query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c568ea42d57170e0c8f4ed19bce13784
Progression 8: Change all chocolates of ____ color to ____ color and return [countOfChangedColor, chocolates]
[ { "docid": "172955e16e6a1fcb84b72c55ae645407", "score": "0.66925734", "text": "function changeChocolateColorAllOfxCount(array, color, finalColor) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] == color) {\n array[i] = finalColor;\n }\n }\n}", "title": "" } ]
[ { "docid": "142e02a7e8122d735ddf0ea519335105", "score": "0.7832751", "text": "function changeChocolateColorAllOfxCount(chocolates, color, finalColor) {\n var number = 0;\n\n // If change color of the color are same then error message show\n if (color == finalColor) {\n return \"Can't replace the same chocolates\";\n }\n\n // change color instead of intial color and count of finalColor\n for (i = 0; i < chocolates.length; i++) {\n if (chocolates[i] == color) {\n chocolates[i] = finalColor;\n }\n if (chocolates[i] == finalColor) {\n number++;\n }\n }\n\n return [number, chocolates];\n}", "title": "" }, { "docid": "b62370f3067232b2d4749a0aecae6af1", "score": "0.7498177", "text": "function changeChocolateColorAllOfxCount(chocolates, Color, finalColor) {\n k = 0;\n if (Color == finalColor) return \"Can't replace the same chocolates\";\n else\n for (var i = chocolates.length; i >= 0; i--) {\n if (chocolates[i] == Color) {\n chocolates[i] = finalColor;\n k++;\n }\n }\n var temp1 = [chocolates.length, chocolates];\n return temp1;\n}", "title": "" }, { "docid": "6591703e21f55772d909893e03ce3eec", "score": "0.7476056", "text": "function changeChocolateColorAllOfxCount(chocolates, currentColor, finalColor) {\n if (currentColor == finalColor) return \"Can't replace the same chocolates\";\n else\n for (var i = chocolates.length; i >= 0; i--) {\n if (chocolates[i] == currentColor) chocolates[i] = finalColor;\n }\n var output = [chocolates.length, chocolates];\n return output;\n}", "title": "" }, { "docid": "daebeb8656a304aebb80b4e2e8f15878", "score": "0.7460512", "text": "function changeChocolateColorAllOfxCount(chocolates, color, finalColor) {\n if (color == finalColor)\n return 'Can\\'t replace the same chocolates'\n else if (chocolates.length == 1) {\n chocolates[0] = finalColor\n return [1, chocolates]\n } else if (chocolates.length == 0) {\n return [0, []]\n }\n for (var chocoIndex = 0; chocoIndex < chocolates.length; chocoIndex++) {\n if (chocolates[chocoIndex] == color) {\n chocolates[chocoIndex] = finalColor\n }\n\n }\n return [chocolates.length, chocolates]\n}", "title": "" }, { "docid": "10cf42f08fa7fcddbf5a75d9f3126b3d", "score": "0.72263205", "text": "function changeChocolateColorAllOfxCount(chocolates, colorToReplace, colorReplacedBy){\n if(chocolates.length===0){\n return [0,[]]\n }else if(colorReplacedBy==colorToReplace){\n return \"Can't replace the same chocolates\"\n }\n else{\n var result=chocolates.map(data=>{\n if(data===colorToReplace){\n return data=colorReplacedBy;\n }\n return data;\n });\n count=0;\n result.forEach(data=>{\n if(data===colorReplacedBy) count++;\n });\n }\n return[count,result]\n}", "title": "" }, { "docid": "6fc86e4fed420502fefc857b3edd1a52", "score": "0.7145165", "text": "function changeChocolateColor(chocolates, count, currentColor, finalColor) {\n if (currentColor == finalColor) return \"Can't replace the same chocolates\";\n else if (count > 0) {\n for (var i = chocolates.length; i >= 0; i--) {\n if (chocolates[i] == currentColor) chocolates[i] = finalColor;\n }\n return chocolates;\n } else return \"Number cannot be zero/negative\";\n}", "title": "" }, { "docid": "0d89816a35f8790a9a178fd548987d2b", "score": "0.69164234", "text": "function addChocolates(color, count) {\n chocolates.push(color, );\n}", "title": "" }, { "docid": "cf1ad8624c43dc6711404a12d1eeb24a", "score": "0.6840821", "text": "function changeChocolateColor(chocolates, number, color, finalColor) {\n var count = 0\n if (color == finalColor)\n return 'Can\\'t replace the same chocolates'\n if (number < 1)\n return 'Number cannot be zero/negative'\n else if (chocolates.length == 1) {\n chocolates[0] = finalColor\n return chocolates\n }\n for (var chocoIndex = 0; chocoIndex < chocolates.length; chocoIndex++) {\n if ((count < number) && (chocolates[chocoIndex] == color)) {\n chocolates[chocoIndex] = finalColor\n count++\n }\n\n }\n return chocolates\n}", "title": "" }, { "docid": "e2cbebcefae59d1aafc840f92fce51d4", "score": "0.6766589", "text": "function changeChocolateColor(chocolates, number, color, finalColor) {\n // If number = 0 then show error message\n if (number <= 0) {\n return \"Number cannot be zero/negative\";\n }\n\n // change color instead of intial color\n if (color == finalColor) {\n return \"Can't replace the same chocolates\";\n }\n\n // change color instead of intial color for (number) of times\n for (i = 0; i < chocolates.length; i++) {\n if (chocolates[i] == color && number > 0) {\n chocolates[i] = finalColor;\n number--;\n }\n }\n return chocolates;\n}", "title": "" }, { "docid": "2e8b555aeb8498b5e1fff40328aab935", "score": "0.6698354", "text": "function changeChocolateColor(chocolates,count,colorToReplace,colorReplacedBy){\n if(count<0)\n return \"Number cannot be zero/negative\"\n else if(colorToReplace===colorReplacedBy)\n return \"Can't replace the same chocolates\";\n for(let i=0;i<chocolates.length;i++){\n if(chocolates[i]==colorToReplace&&count-->0)\n chocolates[i]=colorReplacedBy\n }\n return chocolates\n}", "title": "" }, { "docid": "d25444f9ff1ad7a605854d898a228a88", "score": "0.66432065", "text": "function changeChocolateColor(chocolates, number, color, finalColor) {\n var count = 0;\n if (chocolates.length == 0) return chocolates;\n else if (number <= 0) return \"Number cannot be zero/negative\";\n for (var i = 0; i <= chocolates.length; i++) {\n if (chocolates[i] == finalColor) return \"Can't replace the same chocolates\";\n if (chocolates[i] == color) {\n chocolates[i] = finalColor;\n count++;\n if (count == number) return chocolates;\n }\n }\n if (count < number) return \"Insufficient chocolates in the dispenser\";\n}", "title": "" }, { "docid": "cd31c65705022a96e2a0780ebca3c5af", "score": "0.646748", "text": "changeColorAll(newColor) {\n return useObj.changeColor(asset.getBalance(), newColor);\n }", "title": "" }, { "docid": "cd31c65705022a96e2a0780ebca3c5af", "score": "0.646748", "text": "changeColorAll(newColor) {\n return useObj.changeColor(asset.getBalance(), newColor);\n }", "title": "" }, { "docid": "1a1a7f90db3d0a2c219bc7a7bbdfdb90", "score": "0.6456855", "text": "function changeChocolateColor(number, color, finalColor) {\n array.forEach(function () {\n if (array[i] == color)\n array[i] = finalColor\n });\n}", "title": "" }, { "docid": "43d7770f13b9ebc65debbb975848bb15", "score": "0.6409393", "text": "function checkCorrectColors() {\r\n let randomArray = userInputStorage[\"randomColor\"].slice();\r\n let userArray = userInputStorage[countRows].slice();\r\n let count = 1;\r\n\r\n count = lookForColorCCP(count, randomArray, userArray);\r\n if (randomArray.length > 0) {\r\n lookForColorCC(count, randomArray, userArray);\r\n }\r\n}", "title": "" }, { "docid": "092751939e9a3bd6cfabf8eeba5795e1", "score": "0.62843674", "text": "function sumColors() {\n color = [...Array(3).keys()].map(function(n) {\n return palindromeModulus(this.origColor[n]+this.userColor[n]);\n });\n return color;\n}", "title": "" }, { "docid": "87bb6798c3cea7332548d36fd4630215", "score": "0.6247203", "text": "function chooseFinalColor(){\n //code colors at the beggiing has value -1 which mean not find\n var white = -1;\n var orange = -1;\n var red = -1;\n var blue = -1;\n var yellow = -1;\n //array to put code colors from all ingredients\n var colorCode = [];\n //putting code colors in array\n for(var i =0; i<dataIngredients.length; i++){\n colorCode.push(dataIngredients[i][0].colorGroup)\n }\n //checking if in array is one this code colors\n white = colorCode.indexOf(\"white\");\n orange = colorCode.indexOf(\"orange\");\n red = colorCode.indexOf(\"red\");\n blue = colorCode.indexOf(\"blue\");\n yellow = colorCode.indexOf(\"yellow\");\n //assiging final coctail color base of find code colors\n if(white >= 0){\n if(red >=0 && yellow>=0 && blue <0){\n finalColor = \"#efa17f\";\n }else if(red>=0 && blue >= 0){\n finalColor = \"#ab5d72\";\n }else if(red>=0 && yellow<0 && blue<0){\n finalColor = \"#ec929b\";\n }else if(blue>=0) {\n finalColor = \"#7d69b1\";\n }else{\n finalColor = \"#f8e994\";\n }\n }\n if(orange>=0){\n if(red>= 0 && blue>=0){\n finalColor = \"#b2336e\";\n }else if(red>=0 && blue<0){\n finalColor = \"#f27911\";\n }else if(blue>=0){\n finalColor = \"#8c976e\";\n }else{\n finalColor = \"#f0cc34\";\n }\n }\n}", "title": "" }, { "docid": "bb810383ccdecff791f425b53094ea30", "score": "0.6246987", "text": "function addChocolates(chocolates, color, count) {\n if (count < 1)\n return 'Number cannot be zero/negative'\n for (var index = 0; index < count; index++)\n chocolates.unshift(color)\n return chocolates\n}", "title": "" }, { "docid": "9a904b38203dd88003548e9424a2a005", "score": "0.62448096", "text": "function updateColor()\n\t\t{\n\t\t\tif (whoopingkof.isConnected())\n\t\t\t{\n\t\t\t\twindow.whoopingkof.dispatch('lampcolor', { 'h': selectedColor[0], 's': selectedColor[1], 'b': selectedColor[2] } );\t\t\n\t\t\t\tupdateColorSummary();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c99f8b02b3845f1c15a88b89ed41914b", "score": "0.621139", "text": "function numberOfColors(mode) {\n\treturn mode === \"Easy\" ? 3 : mode === \"Hard\" ? 9 : 6;\n}", "title": "" }, { "docid": "9986217ce63e36fa15a1893d36180938", "score": "0.62045914", "text": "function updateColors() {\n var saturation = $(\"#saturation\").slider(\"value\");\n var lightness = $(\"#lightness\").slider(\"value\");\n var hueMin = $(\"#hue\").slider(\"values\", 0);\n var hueMax = $(\"#hue\").slider(\"values\", 1);\n\n updateValueLabels(saturation, lightness, hueMin, hueMax);\n recolorShapes(saturation, lightness, hueMin, hueMax);\n }", "title": "" }, { "docid": "1b8e65afac7b426b689b60bca10bb1ca", "score": "0.6193834", "text": "function colorChange(resultArr, i) {\n if (resultArr[i].vote === \"Hot\") {\n return \"rgb(233, 30, 99)\";\n } else if (resultArr[i].vote === \"Nice\") {\n return \"rgb(16, 204, 82)\";\n } else if (resultArr[i].vote === \"Cold\") {\n return \"rgb(33, 150, 243)\";\n } else return \"rgba(238, 238, 238, 1)\";\n}", "title": "" }, { "docid": "620f97248f5f525f22302849bc8239e8", "score": "0.616547", "text": "function getNewColors (integer) {\n\tcolors = createColorsArray(integer);\n\ttargetColor = colors[random(colors.length)];\n\tcolorDisplay.textContent = targetColor.toUpperCase();\n}", "title": "" }, { "docid": "837e53e64838fb6beb29c03654e2db6a", "score": "0.6154637", "text": "function HandleColorSelect(divID){\n// var color = document.getElementById(divID).style.backgroundColor;\n if (document.getElementById(divID).style.backgroundColor!=='') unique_colors_index.push(parseInt(divID.substring(8)));\n res_len = unique_colors_index.length;\n if (res_len===1) { // Red added\n // call Yellow\n drawColorSelector(\"Y\");\n } else if (res_len===2) { // Red Yellow added\n // call Blue\n drawColorSelector(\"B\");\n }\n else if (res_len===3) { // Red Yellow Blue added\n // call Green\n drawColorSelector(\"G\");\n }\n else if (res_len===4) { // All added\n //alert(unique_colors_index);\n overlay(3);\n } else // call Error\n alert(\"Error in Unique Hue array size: \"+ res_len);\n \n \n}", "title": "" }, { "docid": "b0d866549a5d6b6d73edfa5972cda1fb", "score": "0.6141228", "text": "function changeColor(event) {\n\tvar color = document.getElementById(\"colorPanel\").getAttribute(\"style\", \"background-color\");\n\tcolor = color.replace(\"background-color: rgb(\", \"\").replace(\");\", \"\").split(',');\n\n\tvar red = parseInt(color[0]);\n\tvar green = parseInt(color[1]);\n\tvar blue = parseInt(color[2]);\n\n\tif (event.target.getAttribute(\"data-increment\") == \"1\") {\n\t\tif (event.target.getAttribute(\"data-type\") == \"red\")\n\t\t\tred += 1;\n\t\tif (event.target.getAttribute(\"data-type\") == \"green\")\n\t\t\tgreen += 1;\n\t\tif (event.target.getAttribute(\"data-type\") == \"blue\")\n\t\t\tblue += 1;\n\t}\n\tif (event.target.getAttribute(\"data-increment\") == \"5\") {\n\t\tif (event.target.getAttribute(\"data-type\") == \"red\")\n\t\t\tred += 5;\n\t\tif (event.target.getAttribute(\"data-type\") == \"green\")\n\t\t\tgreen += 5;\n\t\tif (event.target.getAttribute(\"data-type\") == \"blue\")\n\t\t\tblue += 5;\n\t}\n\tif (event.target.getAttribute(\"data-increment\") == \"10\") {\n\t\tif (event.target.getAttribute(\"data-type\") == \"red\")\n\t\t\tred += 10;\n\t\tif (event.target.getAttribute(\"data-type\") == \"green\")\n\t\t\tgreen += 10;\n\t\tif (event.target.getAttribute(\"data-type\") == \"blue\")\n\t\t\tblue += 10;\n\t}\n\tdocument.getElementById(\"colorPanel\").setAttribute(\"style\", \"background-color: rgb(\"+red+\", \"+green+\", \"+blue+\");\");\n\tdocument.getElementById(\"displayColor\").innerHTML = \"Current color RGB: (\"+red+\", \"+green+\", \"+blue+\")\";\n}", "title": "" }, { "docid": "a8a4bfd0538f6de62722589d5a3dcbd8", "score": "0.6134876", "text": "function colourChange(){\n currentColour++;\n if(currentColour==colours.length)currentColour = 0;\n circle(context,halfWidth,halfHeight,step/2,true);\n}", "title": "" }, { "docid": "f8e0300a972e28383954a9a12a8d38ac", "score": "0.61337703", "text": "function colorNumrVals(){\n redNumVal.value = red.value;\n greenNumVal.value = green.value;\n blueNumVal.value = blue.value;\n\tbrightNumVal.value = bright.value;\n}", "title": "" }, { "docid": "7c61ada173a59bc1e325ff62118c2e02", "score": "0.61000043", "text": "function noOfChocolates(chocolates) {\n var chocolatesCount = [];\n var inOrderChocolates = [\"green\", \"silver\", \"blue\", \"crimson\", \"purple\", \"red\", \"pink\"];\n\n // make chocolatesCount array and store value of count of the color\n for (i = 0; i < inOrderChocolates.length; i++) {\n var count = 0;\n for (j = 0; j < chocolates.length; j++) {\n if (inOrderChocolates[i] == chocolates[j]) {\n count++;\n }\n }\n // if count is 0 it means color is not in chocolates\n if (count != 0) {\n chocolatesCount.push(count);\n\n }\n }\n return chocolatesCount;\n}", "title": "" }, { "docid": "dd4733906748397c57b6358a976785cc", "score": "0.6096539", "text": "function update_color_choosen_indicator(){\n r = red_slider.value;\n g = green_slider.value;\n b = blue_slider.value;\n choosen_color_indicator.style.backgroundColor = toRGB(r,g,b); \n}", "title": "" }, { "docid": "694841229e53b44a0632b7c8839c750c", "score": "0.6095868", "text": "function colorNumbrVals() {\n redVal.value = red.value;\n greenVal.value = green.value;\n blueVal.value = blue.value;\n}", "title": "" }, { "docid": "578da6b1930e20e05d912995a5af83b0", "score": "0.6093595", "text": "function addChocolates(chocolates, color, count) {\n if (count < 1) {\n return \"Number cannot be zero/negative\";\n }\n for (i = 0; i < count; i++) {\n chocolates.unshift(color);\n }\n}", "title": "" }, { "docid": "7ff944d53efd0f22dfffb64b916e8478", "score": "0.60909164", "text": "function addChocolates(chocolates, color, count) {\n if (count > 0) {\n for (let i = 0; i < count; i++) {\n chocolates.unshift(color);\n }\n } else return \"Number cannot be zero/negative\";\n}", "title": "" }, { "docid": "656a188ddf99e487827922c750500c61", "score": "0.60868627", "text": "function correctColorAndPlace(count) {\r\n let placeholderArray = [];\r\n document.querySelector(`#row${countRows}color${count}`).classList.toggle(`correctColorCCP`);\r\n placeholderArray.push(`#row${countRows}color${count}`);\r\n placeholderArray.push(`correctColorCCP`);\r\n changesArray.push(placeholderArray);\r\n}", "title": "" }, { "docid": "ec65e5b3f925bbeecddeec29e0662b92", "score": "0.6070737", "text": "function calculateNoOfColors(frontProcessColors, frontSpotColors, backProcessColors, backSpotColors, variableColors) {\n totalColors = frontProcessColors + frontSpotColors + backProcessColors + backSpotColors + variableColors;\n noOfPlates = totalColors;\n // callback(totalColors, noOfPlates);\n return totalColors;\n}", "title": "" }, { "docid": "3b5558568c31adec359d175f0bc1ee45", "score": "0.60522026", "text": "function addColours() {\n let colours = getSelectedColours();\n \n for (let i=0; i<colours.length; i++) {\n addSingleColour(colours[i]);\n }\n}", "title": "" }, { "docid": "cfc0c3e8176f46ad3982afe52c92cd49", "score": "0.6035595", "text": "updateColors (colors) {\n let ary = [0x88]\n ary = ary.concat(colors.length)\n for (var idx = 0; idx < colors.length; idx++) {\n ary = ary.concat(colors[idx])\n }\n ary = ary.concat(0x55)\n this._sendMessage(ary)\n }", "title": "" }, { "docid": "1cf5a762231d5e8a41fab1c4c82ff814", "score": "0.6035504", "text": "function displayPreviousColor () {\n // CHECK TO SEE IF THERE'S A PREVIOUS COLOR\n if (colorsIndex > 0) {\n // VARIABLE FOR USER'S PREVIOUS ARRAY VALUE\n var i = colorsIndex - 1;\n\n // UPDATE COLOR VALUES WITH PREVIOUS COLOR\n r = colors[i][0];\n g = colors[i][1];\n b = colors[i][2];\n setColors();\n\n // UPDATE COLOR ARRAY INDEX\n colorsIndex--;\n }\n}", "title": "" }, { "docid": "5e4ff504d8e5d487b5c9fd8a94535409", "score": "0.6022574", "text": "function newColors() {\r\n\tsqauresAll.forEach(cur => {\r\n\t\tcur.style.backgroundColor = generateRandomColors()\r\n\t\tcur.style.opacity = 1;\r\n\t});\r\n\tdocument.querySelector(\"h1\").style.backgroundColor = \"steelblue\";\r\n\tdocument.querySelector(\"#reset\").textContent = \"NEW COLORS\";\r\n\tdocument.querySelector(\"#message\").textContent = \"\";\r\n\tvar selectedColor = pickColor(numSquares);\r\n\tdocument.querySelector(\"#colorDisplay\").textContent = selectedColor;\r\n\r\n\tfor (var i = 0; i < squares.length; i++)\r\n\t\tsquares[i].addEventListener(\"click\", function () {\r\n\t\t\tvar clicked = this.style.backgroundColor;;\r\n\t\t\tif (clicked === selectedColor) {\r\n\t\t\t\tsqauresAll.forEach(cur => cur.style.backgroundColor = clicked);\r\n\t\t\t\tdocument.querySelector(\"h1\").style.backgroundColor = clicked;\r\n\t\t\t\tdocument.querySelector(\"#message\").textContent = \"Correct ! YOU WON\";\r\n\t\t\t\tdocument.querySelector(\"#reset\").textContent = \"PLAY AGAIN\";\r\n\t\t\t\tsqauresAll.forEach(cur =>cur.style.opacity = 1);\r\n\t\t\t} else {\r\n\t\t\t\tdocument.querySelector(\"#message\").textContent = \"WRONG TRY AGAIN\";\r\n\t\t\t\tthis.style.opacity = 0;\r\n\t\t\t}\r\n\t\t})\r\n}", "title": "" }, { "docid": "b52abc5c4a7ae1106926c354dc3a80a5", "score": "0.6014681", "text": "function changeColorSyntax() {\n let val = document.querySelector(\"input[name=colorRadios]:checked\").value;\n \n if ( prev !== val ) {\n log( val + \" was chosen.\" );\n let changeVals = [];\n let otherVals = [];\n \n switch( val ) {\n case \"hex\":\n changeVals = document.getElementsByClassName(\"value hex\");\n otherVals.push.apply( otherVals, document.getElementsByClassName(\"value rgb\" ) );\n otherVals.push.apply( otherVals, document.getElementsByClassName(\"value hsl\" ) );\n break;\n case \"rgb\":\n changeVals = document.getElementsByClassName(\"value rgb\");\n otherVals.push.apply( otherVals, document.getElementsByClassName(\"value hex\" ) );\n otherVals.push.apply( otherVals, document.getElementsByClassName(\"value hsl\" ) );\n break;\n case \"hsl\":\n changeVals = document.getElementsByClassName(\"value hsl\");\n otherVals.push.apply( otherVals, document.getElementsByClassName(\"value hex\" ) );\n otherVals.push.apply( otherVals, document.getElementsByClassName(\"value rgb\" ) );\n break;\n default: \n log( \"ERROR\" );\n break;\n }\n\n for ( let i=0; i<changeVals.length; i++ )\n changeVals[i].style.display = \"block\";\n for ( let j=0; j<otherVals.length; j++ )\n otherVals[j].style.display = \"none\";\n \n prev = val;\n }\n}", "title": "" }, { "docid": "5110fefbe4a0074614c27dc0cb28e5d6", "score": "0.60127324", "text": "function colorResult() {\n var procentRed = 0\n , procentYellow = Math.round(.35 * questionMaxGlob)\n , procentGreen = Math.round(.85 * questionMaxGlob);\n if (count <= procentYellow && count && questionMaxGlob !== 2) {\n for (var i = 0; i < $(\"#stage>span\").length; i++) {\n $(\"#stage>span\")[i].classList.toggle(\"active-wrong\")\n }\n }\n else if (count > procentYellow && count < procentGreen || questionMaxGlob === 2 && count === 1) {\n for (var i = 0; i < $(\"#stage>span\").length; i++) {\n $(\"#stage>span\")[i].classList.toggle(\"active-middle\")\n }\n }\n else if (count >= procentGreen) {\n for (var i = 0; i < $(\"#stage>span\").length; i++) {\n $(\"#stage>span\")[i].classList.toggle(\"active-right\")\n }\n }else{\n for (var i = 0; i < $(\"#stage>span\").length; i++) {\n $(\"#stage>span\")[i].classList.toggle(\"active-wrong\")\n }\n }\n }", "title": "" }, { "docid": "fa42870769c214b0d7a017cfb34a0f7e", "score": "0.600904", "text": "function applyColors () {\n var choicesHTML = '';\n var index = 0;\n var state = App.State.get();\n\n state.questions[state.currentQuestion].choices.forEach(function () {\n var choiceHTML = choicesTemplate.replace('@color', state.questions[state.currentQuestion].choices[index]);\n choicesHTML += choiceHTML;\n index++;\n });\n\n $('.options').html(choicesHTML);\n }", "title": "" }, { "docid": "3137323e50884efee2dde613c4e18617", "score": "0.600489", "text": "function modifiyColors() {\n redValue = redRange.value;\n inputTextRed.value = redValue;\n greenValue = greenRange.value;\n inputTextGreen.value = greenValue;\n blueValue = blueRange.value;\n inputTextBlue.value = blueValue;\n finalColor = composeRGB(redValue, greenValue, blueValue);\n var square = document.getElementById('squareColor');\n square.style.backgroundColor = finalColor;\n}", "title": "" }, { "docid": "c3a54921bf0c03dcedad2a0c6b87c1ff", "score": "0.5992824", "text": "function change_colour() {\n if (t == undefined) {\n\n c_R.start = parseInt(c_start.slice(1, 3), 16);\n c_R.dif = parseInt(c_end.slice(1, 3), 16) - c_R.start;\n c_G.start = parseInt(c_start.slice(3, 5), 16);\n c_G.dif = (parseInt(c_end.slice(3, 5), 16)) - c_G.start;\n c_B.start = parseInt(c_start.slice(5, 7), 16);\n c_B.dif = parseInt(c_end.slice(5, 7), 16) - c_B.start;\n\n let d = new Date();\n let n = d.getTime();\n t = n + time_evaluating;\n d = null;\n n = null;\n }\n let d = new Date().getTime();\n d = 1 - (t - d) / time_evaluating;\n\n //assigning colour\n c_cur = \"#\" +\n (\"00\" + Math.floor((c_R.dif) * d + c_R.start).toString(16)).slice(-2) + //red\n (\"00\" + Math.floor((c_G.dif) * d + c_G.start).toString(16)).slice(-2) + //green\n (\"00\" + Math.floor((c_B.dif) * d + c_B.start).toString(16)).slice(-2); //blue\n\n return c_cur;\n }", "title": "" }, { "docid": "ed01d899c6a2b23e2fc9469844e98325", "score": "0.5990737", "text": "function dispenseRainbowChocolates(chocolates, number) {\n rainbowChocolates = 0;\n\n // value of rainbowChocolates increase by 1 if 3 elements are same in row\n for (i = 0; i < number - 2; i++) {\n if (chocolates[i] == chocolates[i + 1] && chocolates[i] == chocolates[i + 2]) {\n rainbowChocolates++;\n }\n }\n return rainbowChocolates;\n}", "title": "" }, { "docid": "0011d83ddb5a25fa854b7a9ee24bc11c", "score": "0.5987274", "text": "function adjustColors(){\n huey($('#artwork img').attr('src'), function(error, rgb, image) {\n if(rgb == null){\n $('body').css('background-color','rgb(25,25,25)');\n triangle.changeColor('rgb(255,255,255)');\n }\n else{\n var red = rgb[0]\n var green = rgb[1]\n var blue = rgb[2]\n\n $('body').css('background-color','rgb('+red+','+green+','+blue+')');\n triangle.changeColor('rgb('+(red+30)+','+(green+30)+','+(blue+30));\n }\n\n $('body').css('background-color','rgb('+red+','+green+','+blue+')');\n triangle.changeColor('rgb('+(red+50)+','+(green+50)+','+(blue+50));\n });\n }", "title": "" }, { "docid": "6993dd70ae6c78e4d81fcc42597d40d3", "score": "0.59856737", "text": "function count_colors_opt(size_x,size_y){\r\n\t\tlet pixel_data = context.getImageData(0,0, size_x, size_y).data;\r\n\t\tlet pixel_arr = [];\r\n\t\tlet last_pixels = [];\r\n\t\tfor (let i=0; i<= pixel_data.length-4;i=i+4){\r\n\t\t\tpixels = pixel_data[i]+\",\"+pixel_data[i+1]+\",\"+pixel_data[i+2]+\",\"+pixel_data[i+3];\r\n\t\t\tif (pixels!==last_pixels) {\r\n\t\t\t\tpixel_arr.push(pixels);\r\n\t\t\t\tlast_pixels = pixels\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst colors_unique_count = [...new Set(pixel_arr)];\r\n\t\t//console.log(colors_unique_count)\r\n\t\treturn colors_unique_count.length;\r\n\t}", "title": "" }, { "docid": "0ebee8396439c4ad11caa032a15790e0", "score": "0.5971473", "text": "update_colors(prev, next) {\n let color = this._colors.get(prev)\n this._colors.delete(prev)\n this._colors.set(next, color)\n }", "title": "" }, { "docid": "e3b19e8a494a4c5c11a7f8de109c4fed", "score": "0.5966698", "text": "colorBonus(colorCount) {\n switch (Math.abs(colorCount)) {\n case 0: case 1: return 0;\n case 2: return 3;\n default: return 2 * this.colorBonus(colorCount - 1);\n }\n }", "title": "" }, { "docid": "92fa11834f46e924bff6037c3f2e7b1f", "score": "0.59531707", "text": "function UPrime(){\n\t\tvar blueSide = $(\".blue .pieces\").children();\n\t\tvar greenSide = $('.green .pieces').children();\n\t\tvar redSide = $('.red .pieces').children();\n\t\tvar orangeSide = $('.orange .pieces').children();\n\t\tvar yellowSide = $('.yellow .pieces').children();\n\n\t\tvar yellow1 = $(yellowSide[0]).css('background-color');\n\t\tvar yellow2 = $(yellowSide[1]).css('background-color');\n\t\tvar yellow3 = $(yellowSide[2]).css('background-color');\n\t\tvar yellow4 = $(yellowSide[3]).css('background-color');\n\n\t\tvar yellow6 = $(yellowSide[5]).css('background-color');\n\t\tvar yellow7 = $(yellowSide[6]).css('background-color');\n\t\tvar yellow8 = $(yellowSide[7]).css('background-color');\n\t\tvar yellow9 = $(yellowSide[8]).css('background-color');\n\n\t\t$(yellowSide[0]).css(\"background-color\", \"\" + yellow3 +\"\");\n\t\t$(yellowSide[1]).css(\"background-color\", \"\" + yellow6 +\"\");\n\t\t$(yellowSide[2]).css(\"background-color\", \"\" + yellow9 +\"\");\n\t\t$(yellowSide[3]).css(\"background-color\", \"\" + yellow2 +\"\");\n\n\t\t$(yellowSide[5]).css(\"background-color\", \"\" + yellow8 +\"\");\n\t\t$(yellowSide[6]).css(\"background-color\", \"\" + yellow1 +\"\");\n\t\t$(yellowSide[7]).css(\"background-color\", \"\" + yellow4 +\"\");\n\t\t$(yellowSide[8]).css(\"background-color\", \"\" + yellow7 +\"\");\n\n\t\tfor (i = 0; i < 3; i++){\n\t\t\tcurrentBlue = $(blueSide[i]).css('background-color');\n\t\t\tcurrentGreen = $(greenSide[i]).css('background-color');\n\t\t\tcurrentRed = $(redSide[i]).css('background-color');\n\t\t\tcurrentOrange = $(orangeSide[i]).css('background-color');\n\n\t\t\t$(blueSide[i]).css(\"background-color\", \"\" + currentOrange +\"\");\n\t\t\t$(greenSide[i]).css(\"background-color\", \"\" + currentRed +\"\");\n\t\t\t$(redSide[i]).css(\"background-color\", \"\" + currentBlue +\"\");\n\t\t\t$(orangeSide[i]).css(\"background-color\", \"\" + currentGreen +\"\");\n\t\t}\n\n\t\treturn \"U'\";\n\t\t\n\t}", "title": "" }, { "docid": "eb3f4d1f351b24e09cde6f03da13cdae", "score": "0.59525454", "text": "changeColor() {\n this.currentColor = this.intersectingColor;\n }", "title": "" }, { "docid": "5da4d99ed5098042be0c79f04bff9c6f", "score": "0.59448314", "text": "function colorNumrVals(){\n redNumVal.value = red.value;\n greenNumVal.value = green.value;\n blueNumVal.value = blue.value;\n}", "title": "" }, { "docid": "138d0580e66e73bb6bd317ac6d46d196", "score": "0.59394014", "text": "function getColors(){\n var rgb = mixerBottle.attr('style').replace('background-color: rgb(', '').replace(')', '').split(',');\n return rgb.map(x => parseInt(x));\n }", "title": "" }, { "docid": "0cb754aa57c93d04a6b1230fafe1d18f", "score": "0.5933301", "text": "static CheckColors4(colors, count) {\n // Check if color3 was used\n if (colors.length === count * 3) {\n const colors4 = [];\n for (let index = 0; index < colors.length; index += 3) {\n const newIndex = (index / 3) * 4;\n colors4[newIndex] = colors[index];\n colors4[newIndex + 1] = colors[index + 1];\n colors4[newIndex + 2] = colors[index + 2];\n colors4[newIndex + 3] = 1.0;\n }\n return colors4;\n }\n return colors;\n }", "title": "" }, { "docid": "248af0a2cec8e82a0d5050745e5f99f9", "score": "0.59254426", "text": "function getColor(note, channel, chins) {\n//\tvar startColor = config.startColor;\n//\tvar endColor = config.endColor;\n\n var step = note/100;\n \n//\tvar c0 = Math.floor(startColor[0]+(endColor[0] - startColor[0])*step); \n//\tvar c1 = Math.floor(startColor[1]+(endColor[1] - startColor[1])*step); \n//\tvar c2 = Math.floor(startColor[2]+(endColor[2] - startColor[2])*step);\n \n//\treturn '#' + d2h(c0) + d2h(c1) + d2h(c2);\n \n var hue = channel / Object.keys(chins).length;\n return [hue, 1, step];\n \n}", "title": "" }, { "docid": "6ef3f9ca3c85caf1b6f1a25164f28834", "score": "0.592061", "text": "function getPickingColor(index) {\n index++;\n return [index & 255, index >> 8 & 255, index >> 16 & 255];\n}", "title": "" }, { "docid": "2fdf38d98fde6e5d43f2b9b08f491d0e", "score": "0.59072304", "text": "function sockMerchant(n, ar) {\n //create storage array for all possible 100 colors\n let colors = [],\n pairs = 0;\n for(let i = 0; i <= 100; i++){\n colors.push(0);\n }\n\n//add socks to the color array\n ar.forEach(sock => {\n colors[sock]++;\n });\n // console.log(colors);\n\n //count the pairs\n colors.forEach(color => {\n pairs += Math.floor(color/2);\n });\n return pairs;\n}", "title": "" }, { "docid": "41c44178905c3e72b8cb315777d98555", "score": "0.5895994", "text": "function lookForColorCCP(count, randomArray, userArray) {\r\n for (let n = 0; n < randomArray.length; ) {\r\n if (userArray[n] === randomArray[n]) {\r\n randomArray.splice(n, 1);\r\n userArray.splice(n, 1);\r\n correctColorAndPlace(count);\r\n count++;\r\n } else {\r\n n++;\r\n }\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "c8b13074810ad0c6f545db014efb6e54", "score": "0.5893527", "text": "function assignFiveColours(result) {\n colour1 = rgbToHexConvert(result[0][0], result[0][1], result[0][2]);\n colour2 = rgbToHexConvert(result[1][0], result[1][1], result[1][2]);\n colour3 = rgbToHexConvert(result[2][0], result[2][1], result[2][2]);\n colour4 = rgbToHexConvert(result[3][0], result[3][1], result[3][2]);\n colour5 = rgbToHexConvert(result[4][0], result[4][1], result[4][2]);\n\n console.log(colour1);\n console.log(colour2);\n console.log(colour3);\n console.log(colour4);\n console.log(colour5);\n}", "title": "" }, { "docid": "22acb3e33b963f455f3418f3947ec72f", "score": "0.588429", "text": "function changeColor()\n {\n var s=Math.floor(Math.random()*colors.length);\n return colors[s];\n }", "title": "" }, { "docid": "f45ded1c2bff8425a0e3efe5e357bd2e", "score": "0.5880278", "text": "function color_change(arr,i1,i2,col) {\n var temp_arr = arr.slice()\n temp_arr[i1] = temp_arr[i1].toString().fontcolor(col)\n temp_arr[i2] = temp_arr[i2].toString().fontcolor(col)\n return temp_arr\n}", "title": "" }, { "docid": "5ab9c0ec97e122d9567cb7b845e674ef", "score": "0.5878239", "text": "function getCountColor(d) {\n return d == 7 ? '#800026' :\n d == 6 ? '#BD0026' :\n d == 5 ? '#E31A1C' :\n d == 4 ? '#FC4E2A' :\n d == 3 ? '#FD8D3C' :\n d == 2 ? '#FEB24C' :\n d == 1 ? '#FED976' :\n d == 0 ? '#FFEDA0':\n '#FFEDA0';\n }", "title": "" }, { "docid": "491dfd4972eded3da6ae4041d92186de", "score": "0.58721733", "text": "function green(n) {\n var fc = 50;\n var r = 250-(n+1)*fc;\n var g = 250-(n*fc);\n var b = 250 - (n+1)*fc;\n return \"rgb(\"+r+\",\"+g+\",\"+b+\")\"\n }", "title": "" }, { "docid": "3102c18635d8148438ce480720b890c4", "score": "0.5863622", "text": "function updateSelection(){\n let random = document.getElementById('btn-random');\n let red = document.getElementById('btn-r');\n let orange = document.getElementById('btn-o');\n let yellow = document.getElementById('btn-y');\n let green = document.getElementById('btn-g');\n let cyan = document.getElementById('btn-c');\n let blue = document.getElementById('btn-b');\n let purple = document.getElementById('btn-p');\n\n if (lastColor < 0){\n random.style.backgroundColor = \"black\";\n // red\n }else if (lastColor === 0){\n red.style.backgroundColor = \"black\";\n // orange\n }else if (lastColor === 1){\n orange.style.backgroundColor = \"black\";\n // yellow\n }else if (lastColor === 2){\n yellow.style.backgroundColor = \"black\";\n // green\n }else if (lastColor === 3){\n green.style.backgroundColor = \"black\";\n // cyan\n }else if (lastColor === 4){\n cyan.style.backgroundColor = \"black\";\n // blue\n }else if (lastColor === 5){\n blue.style.backgroundColor = \"black\";\n // purple\n }else if (lastColor === 6){\n purple.style.backgroundColor = \"black\";\n }\n\n if (currentColor < 0){\n random.style.backgroundColor = \"#262626\";\n // red\n }else if (currentColor === 0){\n red.style.backgroundColor = \"rgba(255,0,0,0.5)\";\n // orange\n }else if (currentColor === 1){\n orange.style.backgroundColor = \"rgba(255,132,0,0.5)\";\n // yellow\n }else if (currentColor === 2){\n yellow.style.backgroundColor = \"rgba(255,232,0,0.5)\";\n // green\n }else if (currentColor === 3){\n green.style.backgroundColor = \"rgba(0,255,0,0.5)\";\n // cyan\n }else if (currentColor === 4){\n cyan.style.backgroundColor = \"rgba(0,255,232,0.5)\";\n // blue\n }else if (currentColor === 5){\n blue.style.backgroundColor = \"rgba(0,0,255,0.5)\";\n // purple\n }else if (currentColor === 6){\n purple.style.backgroundColor = \"rgba(255,0,232,0.5)\";\n }\n}", "title": "" }, { "docid": "2ee107a001c35700684e3e17f4b06e0f", "score": "0.5862951", "text": "function colorNumrVals(){\n redNumVal.value = red.value;\n greenNumVal.value = green.value;\n blueNumVal.value = blue.value;\n opacityNumVal.value = opacity.value;\n}", "title": "" }, { "docid": "12e272b7b17707ec8face029f17ad2f7", "score": "0.58625025", "text": "function createLegoColors() {\r\n var n = guiData.imageWidth * guiData.imageHeight * 4;\r\n \r\n for (var i=0; i <n; i+=4) {\r\n var r = imagePixelData.data[i];\r\n var g = imagePixelData.data[i+1];\r\n var b = imagePixelData.data[i+2];\r\n var a = imagePixelData.data[i+3];\r\n \r\n var c = findCloseColor(legoColors,r,g,b);\r\n \r\n imagePixelData.data[i] = c[0];\r\n imagePixelData.data[i+1] = c[1];\r\n imagePixelData.data[i+2] = c[2];\r\n \r\n }\r\n \r\n document.getElementById(\"mycanvas\").getContext(\"2d\").putImageData(imagePixelData,0,0);\r\n}", "title": "" }, { "docid": "7360ff4e5580440295473cc12a7f0caf", "score": "0.5858077", "text": "function Colorize()\n\t\t\t{ var retcolor;//The variable through which we will return the value for filling\n\n\t\t\t for (var i = 0; i < data.length ; i++)//Passes 28 times, through all the elements in the data\n\t\t\t\t{\n\t\t\t\t if(data[i].id == this.id)\n\t\t\t\t { retcolor = getColor(data[i].turnout);}\n\t\t\t\t //console.log(\"\"+data[i].turnout+\"\"+retcolor+\"\");\n\t\t\t\t}\n\t\t\t return retcolor;\n\n\t\t\t}", "title": "" }, { "docid": "5182aa195583511483011df2ec8d4faa", "score": "0.58551794", "text": "function dispenseChocolatesOfColor(chocolates, number, color) {\n if (number > chocolates.length)\n return \"Insufficient chocolates in the dispenser\";\n else if (number > 0) {\n var chocolatecolor = [];\n var count = 0;\n for (var i = chocolates.length; i >= 0; i--) {\n if (chocolates[i] == color) chocolatecolor[count++] = chocolates.pop();\n }\n return chocolatecolor;\n } else return \"Number cannot be zero/negative\";\n}", "title": "" }, { "docid": "0255b043347fca1eb4ddbb63f50b8bc6", "score": "0.5850385", "text": "function Vn(t,e,i){if(e&&\"string\"==typeof i){var n=Un,r=t.filter(function(t){return!t[i]}),a={};// Paired color set from color brewer\nr.forEach(function(t){a[e(t)]=null}),Object.keys(a).forEach(function(t,e){a[t]=e}),r.forEach(function(t){t[i]=n[a[e(t)]%n.length]})}}", "title": "" }, { "docid": "870ee545f2527598a3a9b760e925e7aa", "score": "0.58501416", "text": "function effacer(){\n/*\n if(colorSelectionIndex == 0){\n userAttempts --;\n for (var i = 1; i < 5; i++){\n var id = \"c\" + userAttempts + i;\n var changingColor = document.getElementById(id);\n changingColor.style.backgroundColor = \"grey\";\n }\n colorSelectionIndex = 0;\n selectedHumanColors = [];\n\n\n for (var i = 1; i < 5; i++){\n \n var id = \"f\" + (userAttempts) + i;\n var idSelector = document.getElementById(id);\n idSelector.style.backgroundColor = \"lightgrey\";\n }\n \n \n }\n else{ */\n for (var i = 1; i < selectedHumanColors.length + 1; i++){\n var id = \"c\" + userAttempts + i;\n var changingColor = document.getElementById(id);\n changingColor.style.backgroundColor = \"grey\";\n }\n colorSelectionIndex = 0;\n selectedHumanColors = [];\n/*\n}\nuserAttempts ++;\n\nconsole.log(userAttempts);\n*/\n}", "title": "" }, { "docid": "6e7bfa0ec6b98c18d64b730e7d43a93f", "score": "0.5847661", "text": "function chooseCol(color) {\n changeBack(choice, color);\n for (var i = 0; i < 4; i++) {\n if (choice == 'choice' + i) { userAnswer[i] = color };\n }\n}", "title": "" }, { "docid": "2a66be51fe198b8647ab0b1fb66aff0c", "score": "0.5846487", "text": "function calculateNumColors(level) {\n return level * 3;\n}", "title": "" }, { "docid": "ff78bde88d057d07bef4d051de78cb00", "score": "0.5844892", "text": "function addingColors(tab) {\n let watchedColors = []\n for (let i = tab.length - 1; i >= 0; i--) {\n tab[i] = tab[i].replace('#','');\n let customColorR = parseInt(tab[i].substring(0,2), 16);\n let customColorG = parseInt(tab[i].substring(2,4), 16);\n let customColorB = parseInt(tab[i].substring(4,6), 16);\n //registering custom colors with a small tolerance\n tracking.ColorTracker.registerColor(tab[i], function(r, g, b) {\n var modR,modG,modB;\n if ((r == customColorR) && (g == customColorG) && (b == customColorB)) {\n return true;\n }\n return false; \n });\n watchedColors.push(tab[i]);\n }\n return watchedColors;\n}", "title": "" }, { "docid": "d6dcaa78aed2cb3674dae9b7b9a72729", "score": "0.5840578", "text": "function dispenseChocolatesOfColor(chocolates, count, color) {\n if (count > chocolates.length)\n return \"Insufficient chocolates in the dispenser\"\n else if (count < 0)\n return \"Number cannot be zero/negative\"\n return chocolates.reverse().splice(chocolates.indexOf(color), count)\n}", "title": "" }, { "docid": "9550387cd73a45977d34a2fc4ff92ab8", "score": "0.58320916", "text": "function generateColors() {\n if (colors.length === 0) {\n colorsRef.get().then((content) => {\n let colorsDB = [];\n colorsDB = content.data()[\"availableColors\"];\n\n var temp = [];\n\n colorsDB.forEach((color) => {\n temp.push(color);\n\n if (colorsDB.length === temp.length) {\n if (oldItem.itemColor.length > 0) {\n var colorSet = new Set(temp);\n\n oldItem.itemColor.forEach((element) => {\n colorSet.add(element);\n });\n\n const arr = [...colorSet];\n\n setColors(arr);\n } else {\n setColors(temp);\n }\n }\n });\n });\n }\n }", "title": "" }, { "docid": "9141e172b155a5e5ff2ee0c2f944faab", "score": "0.5821328", "text": "function colourSchemes() {\r\n const redGreen = answers.find((ans) => {return ans.answer == \"Red-Green\"});\r\n\r\n const blueYellow = answers.find((ans) => {return ans.answer == \"Blue-Yellow\"});\r\n\r\n const complete = answers.find((ans) => {return ans.answer == \"Complete\"});\r\n\r\n // User has Red-Green CVD\r\n if (redGreen !== undefined) {\r\n hueColours = [\"blue\", \"yellow\"];\r\n colourSteps = 25;\r\n }\r\n // user has Blue-Yellow CVD\r\n else if (blueYellow !== undefined) {\r\n hueColours = [\"red\", \"green\"];\r\n colourSteps = 25;\r\n\r\n } \r\n // user has complete CVD\r\n else if (complete !== undefined) {\r\n hueColours = [\"yellow\", \"red\"];\r\n colourSteps = 25;\r\n\r\n } \r\n // user has no CVD\r\n else {\r\n hueColours = [\"blue\", \"green\", \"yellow\", \"red\", \"pink\"];\r\n colourSteps = 10;\r\n }\r\n}", "title": "" }, { "docid": "40a4e56c02fa40b4469160909f71e592", "score": "0.5804561", "text": "function correctColorNotPlace(count) {\r\n let placeholderArray = [];\r\n document.querySelector(`#row${countRows}color${count}`).classList.toggle(`correctColorCC`);\r\n placeholderArray.push(`#row${countRows}color${count}`);\r\n placeholderArray.push(`correctColorCC`);\r\n changesArray.push(placeholderArray);\r\n}", "title": "" }, { "docid": "c5f5c5a4da910e1747a5f7a17ba47e04", "score": "0.5795263", "text": "function checkColor(c) {\n var colors = {\n \"aliceblue\": \"#f0f8ff\",\n \"antiquewhite\": \"#faebd7\",\n \"aqua\": \"#00ffff\",\n \"aquamarine\": \"#7fffd4\",\n \"azure\": \"#f0ffff\",\n \"beige\": \"#f5f5dc\",\n \"bisque\": \"#ffe4c4\",\n \"black\": \"#000000\",\n \"blanchedalmond\": \"#ffebcd\",\n \"blue\": \"#0000ff\",\n \"blueviolet\": \"#8a2be2\",\n \"brown\": \"#a52a2a\",\n \"burlywood\": \"#deb887\",\n \"cadetblue\": \"#5f9ea0\",\n \"chartreuse\": \"#7fff00\",\n \"chocolate\": \"#d2691e\",\n \"coral\": \"#ff7f50\",\n \"cornflowerblue\": \"#6495ed\",\n \"cornsilk\": \"#fff8dc\",\n \"crimson\": \"#dc143c\",\n \"cyan\": \"#00ffff\",\n \"darkblue\": \"#00008b\",\n \"darkcyan\": \"#008b8b\",\n \"darkgoldenrod\": \"#b8860b\",\n \"darkgray\": \"#a9a9a9\",\n \"darkgreen\": \"#006400\",\n \"darkkhaki\": \"#bdb76b\",\n \"darkmagenta\": \"#8b008b\",\n \"darkolivegreen\": \"#556b2f\",\n \"darkorange\": \"#ff8c00\",\n \"darkorchid\": \"#9932cc\",\n \"darkred\": \"#8b0000\",\n \"darksalmon\": \"#e9967a\",\n \"darkseagreen\": \"#8fbc8f\",\n \"darkslateblue\": \"#483d8b\",\n \"darkslategray\": \"#2f4f4f\",\n \"darkturquoise\": \"#00ced1\",\n \"darkviolet\": \"#9400d3\",\n \"deeppink\": \"#ff1493\",\n \"deepskyblue\": \"#00bfff\",\n \"dimgray\": \"#696969\",\n \"dodgerblue\": \"#1e90ff\",\n \"firebrick\": \"#b22222\",\n \"floralwhite\": \"#fffaf0\",\n \"forestgreen\": \"#228b22\",\n \"fuchsia\": \"#ff00ff\",\n \"gainsboro\": \"#dcdcdc\",\n \"ghostwhite\": \"#f8f8ff\",\n \"gold\": \"#ffd700\",\n \"goldenrod\": \"#daa520\",\n \"gray\": \"#808080\",\n \"green\": \"#008000\",\n \"greenyellow\": \"#adff2f\",\n \"honeydew\": \"#f0fff0\",\n \"hotpink\": \"#ff69b4\",\n \"indianred \": \"#cd5c5c\",\n \"indigo\": \"#4b0082\",\n \"ivory\": \"#fffff0\",\n \"khaki\": \"#f0e68c\",\n \"lavender\": \"#e6e6fa\",\n \"lavenderblush\": \"#fff0f5\",\n \"lawngreen\": \"#7cfc00\",\n \"lemonchiffon\": \"#fffacd\",\n \"lightblue\": \"#add8e6\",\n \"lightcoral\": \"#f08080\",\n \"lightcyan\": \"#e0ffff\",\n \"lightgoldenrodyellow\": \"#fafad2\",\n \"lightgrey\": \"#d3d3d3\",\n \"lightgreen\": \"#90ee90\",\n \"lightpink\": \"#ffb6c1\",\n \"lightsalmon\": \"#ffa07a\",\n \"lightseagreen\": \"#20b2aa\",\n \"lightskyblue\": \"#87cefa\",\n \"lightslategray\": \"#778899\",\n \"lightsteelblue\": \"#b0c4de\",\n \"lightyellow\": \"#ffffe0\",\n \"lime\": \"#00ff00\",\n \"limegreen\": \"#32cd32\",\n \"linen\": \"#faf0e6\",\n \"magenta\": \"#ff00ff\",\n \"maroon\": \"#800000\",\n \"mediumaquamarine\": \"#66cdaa\",\n \"mediumblue\": \"#0000cd\",\n \"mediumorchid\": \"#ba55d3\",\n \"mediumpurple\": \"#9370d8\",\n \"mediumseagreen\": \"#3cb371\",\n \"mediumslateblue\": \"#7b68ee\",\n \"mediumspringgreen\": \"#00fa9a\",\n \"mediumturquoise\": \"#48d1cc\",\n \"mediumvioletred\": \"#c71585\",\n \"midnightblue\": \"#191970\",\n \"mintcream\": \"#f5fffa\",\n \"mistyrose\": \"#ffe4e1\",\n \"moccasin\": \"#ffe4b5\",\n \"navajowhite\": \"#ffdead\",\n \"navy\": \"#000080\",\n \"oldlace\": \"#fdf5e6\",\n \"olive\": \"#808000\",\n \"olivedrab\": \"#6b8e23\",\n \"orange\": \"#ffa500\",\n \"orangered\": \"#ff4500\",\n \"orchid\": \"#da70d6\",\n \"palegoldenrod\": \"#eee8aa\",\n \"palegreen\": \"#98fb98\",\n \"paleturquoise\": \"#afeeee\",\n \"palevioletred\": \"#d87093\",\n \"papayawhip\": \"#ffefd5\",\n \"peachpuff\": \"#ffdab9\",\n \"peru\": \"#cd853f\",\n \"pink\": \"#ffc0cb\",\n \"plum\": \"#dda0dd\",\n \"powderblue\": \"#b0e0e6\",\n \"purple\": \"#800080\",\n \"red\": \"#ff0000\",\n \"rosybrown\": \"#bc8f8f\",\n \"royalblue\": \"#4169e1\",\n \"saddlebrown\": \"#8b4513\",\n \"salmon\": \"#fa8072\",\n \"sandybrown\": \"#f4a460\",\n \"seagreen\": \"#2e8b57\",\n \"seashell\": \"#fff5ee\",\n \"sienna\": \"#a0522d\",\n \"silver\": \"#c0c0c0\",\n \"skyblue\": \"#87ceeb\",\n \"slateblue\": \"#6a5acd\",\n \"slategray\": \"#708090\",\n \"snow\": \"#fffafa\",\n \"springgreen\": \"#00ff7f\",\n \"steelblue\": \"#4682b4\",\n \"tan\": \"#d2b48c\",\n \"teal\": \"#008080\",\n \"thistle\": \"#d8bfd8\",\n \"tomato\": \"#ff6347\",\n \"turquoise\": \"#40e0d0\",\n \"violet\": \"#ee82ee\",\n \"wheat\": \"#f5deb3\",\n \"white\": \"#ffffff\",\n \"whitesmoke\": \"#f5f5f5\",\n \"yellow\": \"#ffff00\",\n \"yellowgreen\": \"#9acd32\"\n };\n\n if (typeof colors[c.toLowerCase()] != 'undefined')\n return colors[c.toLowerCase()];\n\n return false;\n}", "title": "" }, { "docid": "e89cffc3ce598b7db6d02418f0296316", "score": "0.579195", "text": "function drawColorSelector(colorCode){\n switch (colorCode){\n case \"R\": \n \n // Update title \n// $(\"#question\").text(\"Click on one of the below color samples to select the best <b>RED</b>\");\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>ĐỎ</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Red_Colors[i-1]);\n } \n break;\n case \"B\":\n // Update title\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>XANH LAM</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Blue_Colors[i-1]);\n }\n break;\n case \"G\":\n // Update title\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>XANH LỤC</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Green_Colors[i-1]);\n }\n break;\n case \"Y\":\n \n // Update title\n $(\"#question\").html(\"Nhấn vào ô màu dưới đây để chọn màu <b>VÀNG</b> đẹp nhất\");\n // Load colors\n for (i=1; i<=11; i++){\n document.getElementById(\"co_cell_\"+i).style.backgroundColor = ncs2hex(Yellow_Colors[i-1]);\n }\n break;\n }\n}", "title": "" }, { "docid": "68d315a6cc9ecec105219c8724cde69d", "score": "0.57788503", "text": "updateColorCounter(countX, countY){\n\t\tconst currentRow = this.state.colorCounters.length\n\t\tconst currentCol = this.state.colorCounters[0].length\n\t\tlet colorCounters = this.state.colorCounters.slice()\n\n\t\t// add to every row\n\t\tif (countX > currentCol && countX !== ''){\n\t\t\tcolorCounters.forEach((row) => {\n\t\t\t\t\tfor (let i = currentCol; i < countX; i++){\n\t\t\t\t\trow.push(this.state.activeColor)\n\t\t\t\t}\n\t\t\t})\n\t\t// remove from every row\n\t\t}\telse if (countX < currentCol && countX !== ''){\n\t\t\tcolorCounters.forEach((row) => {\n\t\t\t\tfor (let i = countX; i < currentCol; i++){\n\t\t\t\t\trow.pop()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// add row\n\t\tif (countY > currentRow && countY !== ''){\n\t\t\tfor (let i = currentRow; i < countY; i++){\n\t\t\t\t\tcolorCounters.push(Array(colorCounters[0].length).fill(this.state.activeColor))\n\t\t\t\t}\n\t\t}\n\t\t// remove row\n\t\tif (countY < currentRow && countY !== ''){\n\t\t\tfor (let i = countY; i < currentRow; i++){\n\t\t\t\t\tcolorCounters.pop()\n\t\t\t\t}\n\t\t}\n\n\t\tthis.setState({colorCounters : colorCounters})\n\t}", "title": "" }, { "docid": "70f2cbbf432f6b202ce7c8e7cfeb42be", "score": "0.5775303", "text": "function get_colors(triangles){\n\tconst probs = [0.5,0.2,0.1,0.1,0.1];\n\tvar color_assignments = [];\n\tvar used_colors,new_probs;\n\tfor(var i=0;i<triangles.length;i++){\n\t\tused_colors = []\n\t\tfor(var j=0;j<color_assignments.length;j++){\n\t\t\tif(is_neighbor(triangles[i], triangles[j])){\n\t\t\t\tused_colors.push(color_assignments[j]);\n\t\t\t}\n\t\t}\n\t\tconsole.log(used_colors);\n\t\tnew_probs = [];\n\t\tfor(var j=0;j<5;j++){\n\t\t\tif(!used_colors.includes(j)){\n\t\t\t\tnew_probs.push(probs[j]);\n\t\t\t} else {\n\t\t\t\tnew_probs.push(0);\n\t\t\t}\n\t\t}\n\t\tconsole.log(new_probs);\n\t\tcolor_assignments.push(random_choice(new_probs));\n\t}\n\treturn(color_assignments);\n}", "title": "" }, { "docid": "ac2cc01aa412f9359c71fe5705d7c41e", "score": "0.57715285", "text": "function onColorChange(e)\n{\n\tconsole.log(\"Pen color changed to \" + e.value);\n\n\t// Color is a string made up of RGB values separated by a comma.\n\t// Split and assign colors.\n\tvar parts = e.value.split(\",\");\n\tred = parseInt(parts[0]);\n\tgreen = parseInt(parts[1]);\n\tblue = parseInt(parts[2]);\n}", "title": "" }, { "docid": "7c712c020cd23d1fd7ef0bf2f59a1d25", "score": "0.57671875", "text": "function updateCurrentSwatch(color)\n{\n updatePaletteSwatch(palette.querySelector(\"[data-selected]\"), color);\n setSetting(\"palette\", [...palette.querySelectorAll(\"[data-color]\")].map(x => x.getAttribute(\"data-color\")));\n}", "title": "" }, { "docid": "69c817ee0f4c3e020f08f5844437411c", "score": "0.5763779", "text": "function color_changed_data(changed_data){\n\tfor (var i = 0; i < changed_data.length; i++) {\n\t\tvar ligne = document.getElementById(i+1+\"\")\n\t\tfor (var j = 0; j < changed_data[i].length; j++) {\n\t\t\tligne.getElementsByClassName(changed_data[i][j]+\"\")[0].style.background =\"#FE9A2E\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d9c8008808227af3d940455d5a7dcfef", "score": "0.57531005", "text": "function changeColor(e) {\n switch (this.dataset.direction) {\n case 'next':\n // check if end of colours are reached\n if (currentColor === nrColors) {\n $('#color' + currentColor).addClass('hidden');\n currentColor = 0;\n } else {\n $('[id^=color].hidden').removeClass('hidden');\n }\n\n $('#bgcolor').attr('class', $('#color' + (currentColor === 0 ? nrColors : currentColor)).attr('class').replace(/\\s?hidden/, '').replace(/\\s?show/, function(match) {\n console.log(match);\n return ' show';\n }));\n // increase color count\n currentColor++;\n\n break;\n\n case 'prev':\n // check if beginning of color range is reached \n console.log(currentColor);\n if (currentColor === 1) {\n // $('#color' + currentColor).addClass('hidden');\n currentColor = nrColors + 1;\n } else $('#color' + currentColor).removeClass('hidden');\n\n $('#bgcolor').attr('class', $('#color' + (currentColor === nrColors + 1 ? nrColors : currentColor - 1)).attr('class').replace(/\\s?hidden/, '') + ' show');\n // decrease colour count;\n currentColor--;\n\n break;\n }\n // remove current colour\n $('[id^=color].show').removeClass('show');\n $('#color' + currentColor).addClass('show');\n $('#controls').attr('class', 'controls' + $('#color' + currentColor).attr('class').replace('color', ''));\n\n\n if (currentColor === nrColors || currentColor === 1) {\n // this.disabled = true;\n } else if (currentColor === nrColors - 1 || currentColor === 2) {\n // $(this).siblings('.arrow')[0].disabled = false;\n }\n }", "title": "" }, { "docid": "6dcc1518c291e0b639a08ab9dfb3dd64", "score": "0.5749026", "text": "function color_toggle() {\n console.log(counter);\n svg.selectAll(\"g\").remove();\n if (counter%2 == 0) {\n /* Color scheme from light blue to dark blue */\n color.range(d3.schemePuBu[9]);\n tract_counter -= 1;\n tract_toggle();\n } else {\n /* Color scheme from light yellow to dark red */\n color.range(d3.schemeOrRd[9]);\n tract_counter -= 1;\n tract_toggle();\n }\n counter += 1;\n return color;\n}", "title": "" }, { "docid": "b2afad4b6f0eb81839ae9009ba985264", "score": "0.5747606", "text": "function U(){\n\t\tvar blueSide = $(\".blue .pieces\").children();\n\t\tvar greenSide = $('.green .pieces').children();\n\t\tvar redSide = $('.red .pieces').children();\n\t\tvar orangeSide = $('.orange .pieces').children();\n\t\tvar yellowSide = $('.yellow .pieces').children();\n\n\t\t\n\t\tvar yellow1 = $(yellowSide[0]).css('background-color');\n\t\tvar yellow2 = $(yellowSide[1]).css('background-color');\n\t\tvar yellow3 = $(yellowSide[2]).css('background-color');\n\t\tvar yellow4 = $(yellowSide[3]).css('background-color');\n\n\t\tvar yellow6 = $(yellowSide[5]).css('background-color');\n\t\tvar yellow7 = $(yellowSide[6]).css('background-color');\n\t\tvar yellow8 = $(yellowSide[7]).css('background-color');\n\t\tvar yellow9 = $(yellowSide[8]).css('background-color');\n\n\t\t$(yellowSide[0]).css(\"background-color\", \"\" + yellow7 +\"\");\n\t\t$(yellowSide[1]).css(\"background-color\", \"\" + yellow4 +\"\");\n\t\t$(yellowSide[2]).css(\"background-color\", \"\" + yellow1 +\"\");\n\t\t$(yellowSide[3]).css(\"background-color\", \"\" + yellow8 +\"\");\n\n\t\t$(yellowSide[5]).css(\"background-color\", \"\" + yellow2 +\"\");\n\t\t$(yellowSide[6]).css(\"background-color\", \"\" + yellow9 +\"\");\n\t\t$(yellowSide[7]).css(\"background-color\", \"\" + yellow6 +\"\");\n\t\t$(yellowSide[8]).css(\"background-color\", \"\" + yellow3 +\"\");\n\t\t\n\t\t\n\t\tfor (i = 0; i < 3; i++){\n\t\t\t\n\t\t\tcurrentBlue = $(blueSide[i]).css('background-color');\n\t\t\tcurrentGreen = $(greenSide[i]).css('background-color');\n\t\t\tcurrentRed = $(redSide[i]).css('background-color');\n\t\t\tcurrentOrange = $(orangeSide[i]).css('background-color');\n\n\t\t\t$(blueSide[i]).css(\"background-color\", \"\" + currentRed +\"\");\n\t\t\t$(greenSide[i]).css(\"background-color\", \"\" + currentOrange +\"\");\n\t\t\t$(redSide[i]).css(\"background-color\", \"\" + currentGreen +\"\");\n\t\t\t$(orangeSide[i]).css(\"background-color\", \"\" + currentBlue +\"\");\n\n\t\t}\n\n\t\treturn \"U\";\n\t\t\n\t}", "title": "" }, { "docid": "64949e914e54bdb36d26efff8df47f1c", "score": "0.573525", "text": "function countColors(array) {\n const color = colors.reduce((colorCounts, color) => {\n if (typeof colorCounts[color] === 'undefined') {\n colorCounts[color] = 1;\n } else {\n colorCounts[color] += 1;\n }\n return colorCounts;\n }, {});\n return color;\n}", "title": "" }, { "docid": "2f679e65716aeae3bdec4d98e981e018", "score": "0.5728897", "text": "function changeColors(event) {\r\n previewCard.classList.remove('palette1-js');\r\n previewCard.classList.remove('palette2-js');\r\n previewCard.classList.remove('palette3-js');\r\n infoPerson.palette = Number(event.target.value);\r\n previewCard.classList.add(`palette${infoPerson.palette}-js`);\r\n}", "title": "" }, { "docid": "b0bab754df4a66142c66ebebbc3e36af", "score": "0.5728412", "text": "function sortChocolateBasedOnCount(chocolates) {\n var chocolatesCount = {};\n var sortArray = [];\n\n // Count chocolates and store count with color name in object chocolatesCount\n for (i = 0; i < chocolates.length; i++) {\n if (chocolatesCount[chocolates[i]] == undefined) {\n chocolatesCount[chocolates[i]] = 1;\n } else {\n chocolatesCount[chocolates[i]]++;\n }\n }\n\n // Sort chocolateCount Object with its count and color\n sortArray = Object.entries(chocolatesCount).sort().sort((a, b) => b[1] - a[1]);\n\n // empty array\n chocolates.length = 0;\n\n // store colors with N times(count of color) in chocolates array from sortArray\n for (i = 0; i < sortArray.length; i++) {\n for (j = 0; j < sortArray[i][1]; j++) {\n chocolates.push(sortArray[i][0]);\n }\n }\n\n return chocolates;\n}", "title": "" }, { "docid": "75fcb675e6932e8340b3bb7c8c3af4ca", "score": "0.5728371", "text": "function switchColor(colorElement){\r\n\tvar colorNum = parseInt(colorElement.attr('data-color')) - 1;\r\n\tvar colorClass = colorElement.attr('data-clrclass');\r\n\r\n\tif(colorNum < 0){\r\n\t\tcolorNum = 0;\r\n\t}\r\n\tif(colorNum > 38){\r\n\t\tcolorNum = \"\";\r\n\t}\r\n\r\n\tif ( jQuery('.colorpal .colorset, .colorpal-sidebar .colorset').filter(\"[data-color=\"+parseInt(colorElement.attr('data-color'))+\"]\").hasClass('selected') ) {\r\n\t\tjQuery('.colorpal .colorset, .colorpal-sidebar .colorset').filter(\"[data-color=\"+parseInt(colorElement.attr('data-color'))+\"]\").removeClass('selected');\r\n \t} else {\r\n\t\tif ( jQuery('.colorpal .colorset.selected').size() < 3 || jQuery('.colorpal-sidebar .colorset.selected').size() < 3 ) {\r\n\t\t\tjQuery(\"input#colorid\").val(colorNum);\r\n\t\t\tjQuery(\".colorset.\"+colorClass).addClass('selected');\r\n\t\t}\r\n\t}\r\n\tvar multiple_colors = [];\r\n\tjQuery('.colorpal .colorset.selected').each(function(){\r\n\t\tmultiple_colors.push(jQuery(this).attr('data-color'));\r\n\t});\r\n\r\n\t//multicolor\r\n\tif ( jQuery('.colorpal .colorset.selected').size() == 3 || jQuery('.colorpal-sidebar .colorset.selected').size() == 3 ) {\r\n\t\tif(!jQuery('.colorpal, .colorpal-sidebar').hasClass('active')){\r\n\t\t\tjQuery('.colorpal, .colorpal-sidebar').addClass('active');\r\n\t\t}\r\n\t} else {\r\n\t\tjQuery('.colorpal, .colorpal-sidebar').removeClass('active');\r\n\t}\r\n\r\n\t// insert hidden param for search\r\n\t// jQuery(\"#colorvalue\").val(colorClass);\r\n\t// jQuery(\"#colorvalueid\").val(colorNum+1);\r\n\tjQuery(\"input#mc\").val(multiple_colors.join(','));\r\n\t// insertHiddenParam('color', '8', colorNum, 1, 'colorid');\r\n\r\n}", "title": "" }, { "docid": "694005e6bc0f556aae6dc9f093ab185c", "score": "0.5727944", "text": "function handleChangeColor(event) {\n\tconst inputId = event.target.id;\n\n\tif (inputId === 'palette1') {\n\t\tedgePreview.classList.remove('palette3');\n\t\tedgePreview.classList.remove('palette2');\n\t\tedgePreview.classList.add('palette1');\n\t} else if (inputId === 'palette2') {\n\t\tedgePreview.classList.remove('palette1');\n\t\tedgePreview.classList.remove('palette3');\n\t\tedgePreview.classList.add('palette2');\n\t} else if (inputId === 'palette3') {\n\t\tedgePreview.classList.remove('palette1');\n\t\tedgePreview.classList.remove('palette2');\n\t\tedgePreview.classList.add('palette3');\n\t}\n\n}", "title": "" }, { "docid": "b8aac4a8dec986ec900e1e6e39e50eb5", "score": "0.57175094", "text": "function colorlogic(dc)\n{\n\tvar dif = 10;//Must be higher than speed of color change I sugest leaving it at 10 and speeds could vary between 1-10\n\t\t\t\t\t//This is the diference between the desired color and the color to know what numbers we can add/substract\n\tvar spdf = 6;//This could count as speed of color change higher is faster.\n\tfor(var i=0;i<3;i++)\n\t{\n\t\tif(c[i]<dc[i]){if((dc[i]-c[i])>dif){c[i] = c[i] + spdf;}else{c[i]++;}} //RGB INCREASE\n\t\tif(c[i]>dc[i]){if((c[i]-dc[i])>dif){c[i] = c[i] - spdf;}else{c[i]--;}} //RGB DECREASE\n\t}\n\tif(c[0] == dc[0] && c[1] == dc[1] && c[2] == dc[2])\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "f953a0c9d66a2c0d9937fd259d480c39", "score": "0.5717334", "text": "function adjColor(red = 0, green = 0, blue = 0, listener = false) {\n let imageObj = document.getElementById('origCanvas');\n\n let canvas = document.getElementById('clrCanvas');\n let context = canvas.getContext('2d');\n\n let imgW = imageObj.width;\n let imgH = imageObj.height;\n canvas.width = imgW;\n canvas.height = imgH;\n\n context.drawImage(imageObj, 0, 0);\n\n let imgPixels = context.getImageData(0, 0, imgW, imgH);\n\n for (let y = 0; y < imgPixels.height; y++) {\n for (let x = 0; x < imgPixels.width; x++) {\n let i = (y * 4) * imgPixels.width + x * 4;\n\n imgPixels.data[i] += red;\n imgPixels.data[i + 1] += green;\n imgPixels.data[i + 2] += blue;\n }\n }\n\n context.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height);\n\n let redInput = document.getElementById('red-adj');\n let greenInput = document.getElementById('green-adj');\n let blueInput = document.getElementById('blue-adj');\n\n if (listener === false) {\n document.getElementById('clrCanvas').addEventListener('click', function() {\n window.open(canvas.toDataURL('image/jpeg'), '_blank');\n });\n\n redInput.addEventListener('change', function() {\n document.getElementById('red-adj').textContent = redInput.value;\n red = Number(redInput.value);\n\n adjColor(red, green, blue, listener);\n });\n\n greenInput.addEventListener('change', function() {\n document.getElementById('green-adj').textContent = greenInput.value;\n green = Number(greenInput.value);\n\n adjColor(red, green, blue, listener);\n });\n\n blueInput.addEventListener('change', function() {\n document.getElementById('blue-adj').textContent = blueInput.value;\n blue = Number(blueInput.value);\n\n adjColor(red, green, blue, listener);\n });\n\n listener = true;\n }\n\n document.getElementById('dl-color').addEventListener('click', function() {\n this.href = canvas.toDataURL('image/jpeg');\n }, false);\n\n return context.canvas.toDataURL('data/jpeg', 1.0);\n}", "title": "" }, { "docid": "0f5b0b6208e66ba93699e91018ccd781", "score": "0.5713542", "text": "function updateColor (colors) {\n\t\tif (!Array.isArray(colors)) {\n\t\t\tcolors = [colors]\n\t\t}\n\n\t\tlet idx = []\n\n\t\tfor (let i = 0; i < colors.length; i++) {\n\t\t\tlet color = colors[i]\n\n\t\t\t// idx colors directly\n\t\t\tif (typeof color === 'number') {\n\t\t\t\tidx[i] = color\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcolor = rgba(color, 'uint8')\n\n\t\t\tlet id = colorId(color, false)\n\n\t\t\t// if new color - save it\n\t\t\tif (paletteIds[id] == null) {\n\t\t\t\tlet pos = palette.length\n\t\t\t\tpaletteIds[id] = Math.floor(pos / 4)\n\t\t\t\tpalette[pos] = color[0]\n\t\t\t\tpalette[pos+1] = color[1]\n\t\t\t\tpalette[pos+2] = color[2]\n\t\t\t\tpalette[pos+3] = color[3]\n\t\t\t}\n\n\t\t\tidx[i] = paletteIds[id]\n\t\t}\n\n\t\t// limit max color\n\t\tupdatePalette(palette)\n\n\t\t// keep static index for single-color property\n\t\treturn idx.length === 1 ? idx[0] : idx\n\t}", "title": "" }, { "docid": "24b854bb713a27ef71c5498360b16ddf", "score": "0.5712692", "text": "function stage() {\n for(let i = 0; i < selectedMode; i++){\n color.push(randomColorGenerator());\n } \n randomSelection = randomChoiceGenerator(selectedMode);\n choice = color[randomSelection];\n colorGuess.textContent = choice;\n colorGuess.style.color = \"white\";\n message.textContent = \" \";\n setColor();\n}", "title": "" }, { "docid": "d3d96c368aa72792ada6f0a11bbbc65b", "score": "0.57123405", "text": "function updateColors() {\n\tvar board = document.getElementById(\"board\");\n\tvar rows = board.getElementsByTagName(\"tr\");\n\tvar spaces, space;\n\tvar rowCounter, colCounter;\n\t\n\t// loop through board rows\n\tfor (rowCounter = 1; rowCounter < rows.length; rowCounter++) {\n\t\tspaces = rows[rowCounter].getElementsByTagName(\"td\");\n\t\t// check each space in a row\n\t\tfor (colCounter = 1; colCounter < spaces.length; colCounter++) {\n\t\t\t// check if space's state by checking which state class it has (free, hasPieceOn, or covered)\n\t\t\t\n\t\t\tif (spaces[colCounter].classList.contains(\"free\")) {\n\t\t\t\tspaces[colCounter].style.backgroundColor = document.getElementById(\"color-picker-free\").value; \n\t\t\t}\n\t\t\tif (spaces[colCounter].classList.contains(\"hasPieceOn\")) {\n\t\t\t\tspaces[colCounter].style.backgroundColor = document.getElementById(\"color-picker-pieceOn\").value;\n\t\t\t}\n\t\t\tif (spaces[colCounter].classList.contains(\"covered\")) {\n\t\t\t\tspaces[colCounter].style.backgroundColor = document.getElementById(\"color-picker-covered\").value;\n\t\t\t}\n\t\t\tif (spaces[colCounter].classList.contains(\"covered\") && spaces[colCounter].classList.contains(\"hasPieceOn\")) {\n\t\t\t\tspaces[colCounter].style.backgroundColor = document.getElementById(\"color-picker-coveredPiece\").value;\n\t\t\t}\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "d07457e5b90c7e6ecd2f13323088a301", "score": "0.57110506", "text": "getRowColors(division) {\n const numTotal = division.standings.length;\n const numUnchanged =\n numTotal -\n division.numWinner -\n (division.numPrizeMoney || 0) -\n division.numAutoPromo -\n division.numPlayoffPromo -\n division.numPlayoffRelegate -\n division.numAutoRelegate;\n let colors = [];\n for (let i = 0; i < division.numWinner; i++) {\n colors.push(WINNER_COLOR_STR);\n }\n for (let i = 0; i < division.numPrizeMoney; i++) {\n colors.push(PRIZE_COLOR_STR);\n }\n for (let i = 0; i < division.numAutoPromo; i++) {\n colors.push(PROMO_COLOR_STR);\n }\n for (let i = 0; i < division.numPlayoffPromo; i++) {\n colors.push(PLAYOFF_PROMO_COLOR_STR);\n }\n for (let i = 0; i < numUnchanged; i++) {\n colors.push(BACKGROUND_COLOR_STR);\n }\n for (let i = 0; i < division.numPlayoffRelegate; i++) {\n colors.push(PLAYOFF_RELEGATE_COLOR_STR);\n }\n for (let i = 0; i < division.numAutoRelegate; i++) {\n colors.push(RELEGATE_COLOR_STR);\n }\n return colors;\n }", "title": "" }, { "docid": "ec52e5ae2f048ccfe2d87bb76b5051b8", "score": "0.5702315", "text": "function getColor(change) {\n if (change > 0) {\n return 'green';\n } else if (change < 0) {\n return 'red';\n } else {\n return '';\n }\n}", "title": "" }, { "docid": "3660c1eb277042edeb1f51102b2e2a81", "score": "0.57002234", "text": "function encodePickingColor(i) {\n return [i + 1 & 255, i + 1 >> 8 & 255, i + 1 >> 16 & 255];\n} // Decodes a picking color in [r, g, b] format to an index", "title": "" }, { "docid": "3660c1eb277042edeb1f51102b2e2a81", "score": "0.57002234", "text": "function encodePickingColor(i) {\n return [i + 1 & 255, i + 1 >> 8 & 255, i + 1 >> 16 & 255];\n} // Decodes a picking color in [r, g, b] format to an index", "title": "" } ]
edf14b5f4772652043779b7d38e205de
Fast Fourier Transform 1DFFT/IFFT, 2DFFT/IFFT (radix2)
[ { "docid": "b48e2d009469ce3f2a8cac7b135ff630", "score": "0.7756917", "text": "function FFT() {\n\t \n\t var _n = 0, // order\n\t _bitrev = null, // bit reversal table\n\t _cstb = null; // sin/cos table\n\t var _tre, _tim;\n\t \n\t this.init = function (n) {\n\t if(n !== 0 && (n & (n - 1)) === 0) {\n\t _n = n;\n\t _setVariables();\n\t _makeBitReversal();\n\t _makeCosSinTable();\n\t } else {\n\t throw new Error(\"init: radix-2 required\");\n\t }\n\t };\n\t \n\t // 1D-FFT\n\t this.fft1d = function (re, im) {\n\t fft(re, im, 1);\n\t };\n\t \n\t // 1D-IFFT\n\t this.ifft1d = function (re, im) {\n\t var n = 1/_n;\n\t fft(re, im, -1);\n\t for(var i=0; i<_n; i++) {\n\t re[i] *= n;\n\t im[i] *= n;\n\t }\n\t };\n\t \n\t // 2D-FFT\n\t this.fft2d = function (re, im) {\n\t var i = 0;\n\t // x-axis\n\t for(var y=0; y<_n; y++) {\n\t i = y*_n;\n\t for(var x1=0; x1<_n; x1++) {\n\t _tre[x1] = re[x1 + i];\n\t _tim[x1] = im[x1 + i];\n\t }\n\t this.fft1d(_tre, _tim);\n\t for(var x2=0; x2<_n; x2++) {\n\t re[x2 + i] = _tre[x2];\n\t im[x2 + i] = _tim[x2];\n\t }\n\t }\n\t // y-axis\n\t for(var x=0; x<_n; x++) {\n\t for(var y1=0; y1<_n; y1++) {\n\t i = x + y1*_n;\n\t _tre[y1] = re[i];\n\t _tim[y1] = im[i];\n\t }\n\t this.fft1d(_tre, _tim);\n\t for(var y2=0; y2<_n; y2++) {\n\t i = x + y2*_n;\n\t re[i] = _tre[y2];\n\t im[i] = _tim[y2];\n\t }\n\t }\n\t };\n\t \n\t // 2D-IFFT\n\t this.ifft2d = function (re, im) {\n\t var i = 0;\n\t // x-axis\n\t for(var y=0; y<_n; y++) {\n\t i = y*_n;\n\t for(var x1=0; x1<_n; x1++) {\n\t _tre[x1] = re[x1 + i];\n\t _tim[x1] = im[x1 + i];\n\t }\n\t this.ifft1d(_tre, _tim);\n\t for(var x2=0; x2<_n; x2++) {\n\t re[x2 + i] = _tre[x2];\n\t im[x2 + i] = _tim[x2];\n\t }\n\t }\n\t // y-axis\n\t for(var x=0; x<_n; x++) {\n\t for(var y1=0; y1<_n; y1++) {\n\t i = x + y1*_n;\n\t _tre[y1] = re[i];\n\t _tim[y1] = im[i];\n\t }\n\t this.ifft1d(_tre, _tim);\n\t for(var y2=0; y2<_n; y2++) {\n\t i = x + y2*_n;\n\t re[i] = _tre[y2];\n\t im[i] = _tim[y2];\n\t }\n\t }\n\t };\n\t \n\t // core operation of FFT\n\t function fft(re, im, inv) {\n\t var d, h, ik, m, tmp, wr, wi, xr, xi,\n\t n4 = _n >> 2;\n\t // bit reversal\n\t for(var l=0; l<_n; l++) {\n\t m = _bitrev[l];\n\t if(l < m) {\n\t tmp = re[l];\n\t re[l] = re[m];\n\t re[m] = tmp;\n\t tmp = im[l];\n\t im[l] = im[m];\n\t im[m] = tmp;\n\t }\n\t }\n\t // butterfly operation\n\t for(var k=1; k<_n; k<<=1) {\n\t h = 0;\n\t d = _n/(k << 1);\n\t for(var j=0; j<k; j++) {\n\t wr = _cstb[h + n4];\n\t wi = inv*_cstb[h];\n\t for(var i=j; i<_n; i+=(k<<1)) {\n\t ik = i + k;\n\t xr = wr*re[ik] + wi*im[ik];\n\t xi = wr*im[ik] - wi*re[ik];\n\t re[ik] = re[i] - xr;\n\t re[i] += xr;\n\t im[ik] = im[i] - xi;\n\t im[i] += xi;\n\t }\n\t h += d;\n\t }\n\t }\n\t }\n\t \n\t // set variables\n\t function _setVariables() {\n\t if(typeof Uint8Array !== 'undefined') {\n\t _bitrev = new Uint8Array(_n);\n\t } else {\n\t _bitrev = new Array(_n);\n\t }\n\t if(typeof Float64Array !== 'undefined') {\n\t _cstb = new Float64Array(_n*1.25);\n\t _tre = new Float64Array(_n*_n);\n\t _tim = new Float64Array(_n*_n);\n\t } else {\n\t _cstb = new Array(_n*1.25);\n\t _tre = new Array(_n*_n);\n\t _tim = new Array(_n*_n);\n\t }\n\t }\n\t \n\t // make bit reversal table\n\t function _makeBitReversal() {\n\t var i = 0,\n\t j = 0,\n\t k = 0;\n\t _bitrev[0] = 0;\n\t while(++i < _n) {\n\t k = _n >> 1;\n\t while(k <= j) {\n\t j -= k;\n\t k >>= 1;\n\t }\n\t j += k;\n\t _bitrev[i] = j;\n\t }\n\t }\n\t \n\t // make trigonometric function table\n\t function _makeCosSinTable() {\n\t var n2 = _n >> 1,\n\t n4 = _n >> 2,\n\t n8 = _n >> 3,\n\t n2p4 = n2 + n4,\n\t t = Math.sin(Math.PI/_n),\n\t dc = 2*t*t,\n\t ds = Math.sqrt(dc*(2 - dc)),\n\t c = _cstb[n4] = 1,\n\t s = _cstb[0] = 0;\n\t t = 2*dc;\n\t for(var i=1; i<n8; i++) {\n\t c -= dc;\n\t dc += t*c;\n\t s += ds;\n\t ds -= t*s;\n\t _cstb[i] = s;\n\t _cstb[n4 - i] = c;\n\t }\n\t if(n8 !== 0) {\n\t _cstb[n8] = Math.sqrt(0.5);\n\t }\n\t for(var j=0; j<n4; j++) {\n\t _cstb[n2 - j] = _cstb[j];\n\t }\n\t for(var k=0; k<n2p4; k++) {\n\t _cstb[k + n2] = -_cstb[k];\n\t }\n\t }\n\t}", "title": "" } ]
[ { "docid": "375d87f9a8fce2af1c2c7c4d0c904d6b", "score": "0.762279", "text": "function FFT() {\n \n var _n = 0, // order\n _bitrev = null, // bit reversal table\n _cstb = null; // sin/cos table\n var _tre, _tim;\n \n this.init = function (n) {\n if(n !== 0 && (n & (n - 1)) === 0) {\n _n = n;\n _setVariables();\n _makeBitReversal();\n _makeCosSinTable();\n } else {\n throw new Error(\"init: radix-2 required\");\n }\n }\n \n // 1D-FFT\n this.fft1d = function (re, im) {\n fft(re, im, 1);\n }\n \n // 1D-IFFT\n this.ifft1d = function (re, im) {\n var n = 1/_n;\n fft(re, im, -1);\n for(var i=0; i<_n; i++) {\n re[i] *= n;\n im[i] *= n;\n }\n }\n \n // 2D-FFT\n this.fft2d = function (re, im) {\n var i = 0;\n // x-axis\n for(var y=0; y<_n; y++) {\n i = y*_n;\n for(var x1=0; x1<_n; x1++) {\n _tre[x1] = re[x1 + i];\n _tim[x1] = im[x1 + i];\n }\n this.fft1d(_tre, _tim);\n for(var x2=0; x2<_n; x2++) {\n re[x2 + i] = _tre[x2];\n im[x2 + i] = _tim[x2];\n }\n }\n // y-axis\n for(var x=0; x<_n; x++) {\n for(var y1=0; y1<_n; y1++) {\n i = x + y1*_n;\n _tre[y1] = re[i];\n _tim[y1] = im[i];\n }\n this.fft1d(_tre, _tim);\n for(var y2=0; y2<_n; y2++) {\n i = x + y2*_n;\n re[i] = _tre[y2];\n im[i] = _tim[y2];\n }\n }\n }\n \n // 2D-IFFT\n this.ifft2d = function (re, im) {\n var i = 0;\n // x-axis\n for(var y=0; y<_n; y++) {\n i = y*_n;\n for(var x1=0; x1<_n; x1++) {\n _tre[x1] = re[x1 + i];\n _tim[x1] = im[x1 + i];\n }\n this.ifft1d(_tre, _tim);\n for(var x2=0; x2<_n; x2++) {\n re[x2 + i] = _tre[x2];\n im[x2 + i] = _tim[x2];\n }\n }\n // y-axis\n for(var x=0; x<_n; x++) {\n for(var y1=0; y1<_n; y1++) {\n i = x + y1*_n;\n _tre[y1] = re[i];\n _tim[y1] = im[i];\n }\n this.ifft1d(_tre, _tim);\n for(var y2=0; y2<_n; y2++) {\n i = x + y2*_n;\n re[i] = _tre[y2];\n im[i] = _tim[y2];\n }\n }\n }\n \n // core operation of FFT\n function fft(re, im, inv) {\n var d, h, ik, m, tmp, wr, wi, xr, xi,\n n4 = _n >> 2;\n // bit reversal\n for(var l=0; l<_n; l++) {\n m = _bitrev[l];\n if(l < m) {\n tmp = re[l];\n re[l] = re[m];\n re[m] = tmp;\n tmp = im[l];\n im[l] = im[m];\n im[m] = tmp;\n }\n }\n // butterfly operation\n for(var k=1; k<_n; k<<=1) {\n h = 0;\n d = _n/(k << 1);\n for(var j=0; j<k; j++) {\n wr = _cstb[h + n4];\n wi = inv*_cstb[h];\n for(var i=j; i<_n; i+=(k<<1)) {\n ik = i + k;\n xr = wr*re[ik] + wi*im[ik];\n xi = wr*im[ik] - wi*re[ik];\n re[ik] = re[i] - xr;\n re[i] += xr;\n im[ik] = im[i] - xi;\n im[i] += xi;\n }\n h += d;\n }\n }\n }\n \n // set variables\n function _setVariables() {\n if(typeof Uint8Array !== 'undefined') {\n _bitrev = new Uint8Array(_n);\n } else {\n _bitrev = new Array(_n);\n }\n if(typeof Float64Array !== 'undefined') {\n _cstb = new Float64Array(_n*1.25);\n _tre = new Float64Array(_n*_n);\n _tim = new Float64Array(_n*_n);\n } else {\n _cstb = new Array(_n*1.25);\n _tre = new Array(_n*_n);\n _tim = new Array(_n*_n);\n }\n }\n \n // make bit reversal table\n function _makeBitReversal() {\n var i = 0,\n j = 0,\n k = 0;\n _bitrev[0] = 0;\n while(++i < _n) {\n k = _n >> 1;\n while(k <= j) {\n j -= k;\n k >>= 1;\n }\n j += k;\n _bitrev[i] = j;\n }\n }\n \n // make trigonometric function table\n function _makeCosSinTable() {\n var n2 = _n >> 1,\n n4 = _n >> 2,\n n8 = _n >> 3,\n n2p4 = n2 + n4,\n t = Math.sin(Math.PI/_n),\n dc = 2*t*t,\n ds = Math.sqrt(dc*(2 - dc)),\n c = _cstb[n4] = 1,\n s = _cstb[0] = 0;\n t = 2*dc;\n for(var i=1; i<n8; i++) {\n c -= dc;\n dc += t*c;\n s += ds;\n ds -= t*s;\n _cstb[i] = s;\n _cstb[n4 - i] = c;\n }\n if(n8 !== 0) {\n _cstb[n8] = Math.sqrt(0.5);\n }\n for(var j=0; j<n4; j++) {\n _cstb[n2 - j] = _cstb[j];\n }\n for(var k=0; k<n2p4; k++) {\n _cstb[k + n2] = -_cstb[k];\n }\n }\n}", "title": "" }, { "docid": "40b9bbdebae4482d0308ce52ee091755", "score": "0.7622331", "text": "function FFT() {\r\n \r\n var _n = 0, // order\r\n _bitrev = null, // bit reversal table\r\n _cstb = null; // sin/cos table\r\n var _tre, _tim;\r\n \r\n this.init = function (n) {\r\n if(n !== 0 && (n & (n - 1)) === 0) {\r\n _n = n;\r\n _setVariables();\r\n _makeBitReversal();\r\n _makeCosSinTable();\r\n } else {\r\n throw new Error(\"init: radix-2 required\");\r\n }\r\n }\r\n \r\n // 1D-FFT\r\n this.fft1d = function (re, im) {\r\n fft(re, im, 1);\r\n }\r\n \r\n // 1D-IFFT\r\n this.ifft1d = function (re, im) {\r\n var n = 1/_n;\r\n fft(re, im, -1);\r\n for(var i=0; i<_n; i++) {\r\n re[i] *= n;\r\n im[i] *= n;\r\n }\r\n }\r\n \r\n // 2D-FFT\r\n this.fft2d = function (re, im) {\r\n var i = 0;\r\n // x-axis\r\n for(var y=0; y<_n; y++) {\r\n i = y*_n;\r\n for(var x1=0; x1<_n; x1++) {\r\n _tre[x1] = re[x1 + i];\r\n _tim[x1] = im[x1 + i];\r\n }\r\n this.fft1d(_tre, _tim);\r\n for(var x2=0; x2<_n; x2++) {\r\n re[x2 + i] = _tre[x2];\r\n im[x2 + i] = _tim[x2];\r\n }\r\n }\r\n // y-axis\r\n for(var x=0; x<_n; x++) {\r\n for(var y1=0; y1<_n; y1++) {\r\n i = x + y1*_n;\r\n _tre[y1] = re[i];\r\n _tim[y1] = im[i];\r\n }\r\n this.fft1d(_tre, _tim);\r\n for(var y2=0; y2<_n; y2++) {\r\n i = x + y2*_n;\r\n re[i] = _tre[y2];\r\n im[i] = _tim[y2];\r\n }\r\n }\r\n }\r\n \r\n // 2D-IFFT\r\n this.ifft2d = function (re, im) {\r\n var i = 0;\r\n // x-axis\r\n for(var y=0; y<_n; y++) {\r\n i = y*_n;\r\n for(var x1=0; x1<_n; x1++) {\r\n _tre[x1] = re[x1 + i];\r\n _tim[x1] = im[x1 + i];\r\n }\r\n this.ifft1d(_tre, _tim);\r\n for(var x2=0; x2<_n; x2++) {\r\n re[x2 + i] = _tre[x2];\r\n im[x2 + i] = _tim[x2];\r\n }\r\n }\r\n // y-axis\r\n for(var x=0; x<_n; x++) {\r\n for(var y1=0; y1<_n; y1++) {\r\n i = x + y1*_n;\r\n _tre[y1] = re[i];\r\n _tim[y1] = im[i];\r\n }\r\n this.ifft1d(_tre, _tim);\r\n for(var y2=0; y2<_n; y2++) {\r\n i = x + y2*_n;\r\n re[i] = _tre[y2];\r\n im[i] = _tim[y2];\r\n }\r\n }\r\n }\r\n \r\n // core operation of FFT\r\n function fft(re, im, inv) {\r\n var d, h, ik, m, tmp, wr, wi, xr, xi,\r\n n4 = _n >> 2;\r\n // bit reversal\r\n for(var l=0; l<_n; l++) {\r\n m = _bitrev[l];\r\n if(l < m) {\r\n tmp = re[l];\r\n re[l] = re[m];\r\n re[m] = tmp;\r\n tmp = im[l];\r\n im[l] = im[m];\r\n im[m] = tmp;\r\n }\r\n }\r\n // butterfly operation\r\n for(var k=1; k<_n; k<<=1) {\r\n h = 0;\r\n d = _n/(k << 1);\r\n for(var j=0; j<k; j++) {\r\n wr = _cstb[h + n4];\r\n wi = inv*_cstb[h];\r\n for(var i=j; i<_n; i+=(k<<1)) {\r\n ik = i + k;\r\n xr = wr*re[ik] + wi*im[ik];\r\n xi = wr*im[ik] - wi*re[ik];\r\n re[ik] = re[i] - xr;\r\n re[i] += xr;\r\n im[ik] = im[i] - xi;\r\n im[i] += xi;\r\n }\r\n h += d;\r\n }\r\n }\r\n }\r\n \r\n // set variables\r\n function _setVariables() {\r\n if(typeof Uint8Array !== 'undefined') {\r\n _bitrev = new Uint8Array(_n);\r\n } else {\r\n _bitrev = new Array(_n);\r\n }\r\n if(typeof Float64Array !== 'undefined') {\r\n _cstb = new Float64Array(_n*1.25);\r\n _tre = new Float64Array(_n*_n);\r\n _tim = new Float64Array(_n*_n);\r\n } else {\r\n _cstb = new Array(_n*1.25);\r\n _tre = new Array(_n*_n);\r\n _tim = new Array(_n*_n);\r\n }\r\n }\r\n \r\n // make bit reversal table\r\n function _makeBitReversal() {\r\n var i = 0,\r\n j = 0,\r\n k = 0;\r\n _bitrev[0] = 0;\r\n while(++i < _n) {\r\n k = _n >> 1;\r\n while(k <= j) {\r\n j -= k;\r\n k >>= 1;\r\n }\r\n j += k;\r\n _bitrev[i] = j;\r\n }\r\n }\r\n \r\n // make trigonometric function table\r\n function _makeCosSinTable() {\r\n var n2 = _n >> 1,\r\n n4 = _n >> 2,\r\n n8 = _n >> 3,\r\n n2p4 = n2 + n4,\r\n t = Math.sin(Math.PI/_n),\r\n dc = 2*t*t,\r\n ds = Math.sqrt(dc*(2 - dc)),\r\n c = _cstb[n4] = 1,\r\n s = _cstb[0] = 0;\r\n t = 2*dc;\r\n for(var i=1; i<n8; i++) {\r\n c -= dc;\r\n dc += t*c;\r\n s += ds;\r\n ds -= t*s;\r\n _cstb[i] = s;\r\n _cstb[n4 - i] = c;\r\n }\r\n if(n8 !== 0) {\r\n _cstb[n8] = Math.sqrt(0.5);\r\n }\r\n for(var j=0; j<n4; j++) {\r\n _cstb[n2 - j] = _cstb[j];\r\n }\r\n for(var k=0; k<n2p4; k++) {\r\n _cstb[k + n2] = -_cstb[k];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2d84f063f39b700046b1fa1be4c83a6c", "score": "0.762096", "text": "function FFT$1() {\n\n\t\tvar _n = 0, // order\n\t\t\t_bitrev = null, // bit reversal table\n\t\t\t_cstb = null; // sin/cos table\n\t\tvar _tre, _tim;\n\n\t\tthis.init = function (n) {\n\t\t\tif(n !== 0 && (n & (n - 1)) === 0) {\n\t\t\t\t_n = n;\n\t\t\t\t_setVariables();\n\t\t\t\t_makeBitReversal();\n\t\t\t\t_makeCosSinTable();\n\t\t\t} else {\n\t\t\t\tthrow new Error('init: radix-2 required');\n\t\t\t}\n\t\t};\n\n\t\t// 1D-FFT\n\t\tthis.fft1d = function (re, im) {\n\t\t\tfft(re, im, 1);\n\t\t};\n\n\t\t// 1D-IFFT\n\t\tthis.ifft1d = function (re, im) {\n\t\t\tvar n = 1/_n;\n\t\t\tfft(re, im, -1);\n\t\t\tfor(var i=0; i<_n; i++) {\n\t\t\t\tre[i] *= n;\n\t\t\t\tim[i] *= n;\n\t\t\t}\n\t\t};\n\n\t\t// 2D-FFT\n\t\tthis.fft2d = function (re, im) {\n\t\t\tvar i = 0;\n\t\t\t// x-axis\n\t\t\tfor(var y=0; y<_n; y++) {\n\t\t\t\ti = y*_n;\n\t\t\t\tfor(var x1=0; x1<_n; x1++) {\n\t\t\t\t\t_tre[x1] = re[x1 + i];\n\t\t\t\t\t_tim[x1] = im[x1 + i];\n\t\t\t\t}\n\t\t\t\tthis.fft1d(_tre, _tim);\n\t\t\t\tfor(var x2=0; x2<_n; x2++) {\n\t\t\t\t\tre[x2 + i] = _tre[x2];\n\t\t\t\t\tim[x2 + i] = _tim[x2];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// y-axis\n\t\t\tfor(var x=0; x<_n; x++) {\n\t\t\t\tfor(var y1=0; y1<_n; y1++) {\n\t\t\t\t\ti = x + y1*_n;\n\t\t\t\t\t_tre[y1] = re[i];\n\t\t\t\t\t_tim[y1] = im[i];\n\t\t\t\t}\n\t\t\t\tthis.fft1d(_tre, _tim);\n\t\t\t\tfor(var y2=0; y2<_n; y2++) {\n\t\t\t\t\ti = x + y2*_n;\n\t\t\t\t\tre[i] = _tre[y2];\n\t\t\t\t\tim[i] = _tim[y2];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// 2D-IFFT\n\t\tthis.ifft2d = function (re, im) {\n\t\t\tvar i = 0;\n\t\t\t// x-axis\n\t\t\tfor(var y=0; y<_n; y++) {\n\t\t\t\ti = y*_n;\n\t\t\t\tfor(var x1=0; x1<_n; x1++) {\n\t\t\t\t\t_tre[x1] = re[x1 + i];\n\t\t\t\t\t_tim[x1] = im[x1 + i];\n\t\t\t\t}\n\t\t\t\tthis.ifft1d(_tre, _tim);\n\t\t\t\tfor(var x2=0; x2<_n; x2++) {\n\t\t\t\t\tre[x2 + i] = _tre[x2];\n\t\t\t\t\tim[x2 + i] = _tim[x2];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// y-axis\n\t\t\tfor(var x=0; x<_n; x++) {\n\t\t\t\tfor(var y1=0; y1<_n; y1++) {\n\t\t\t\t\ti = x + y1*_n;\n\t\t\t\t\t_tre[y1] = re[i];\n\t\t\t\t\t_tim[y1] = im[i];\n\t\t\t\t}\n\t\t\t\tthis.ifft1d(_tre, _tim);\n\t\t\t\tfor(var y2=0; y2<_n; y2++) {\n\t\t\t\t\ti = x + y2*_n;\n\t\t\t\t\tre[i] = _tre[y2];\n\t\t\t\t\tim[i] = _tim[y2];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// 2D-IFFT, real-valued\n\t\t// only outputs the real valued part\n\t\tthis.real_ifft2d = function (re, im) {\n\t\t\tvar i2;\n\t\t\tvar i = 0;\n\t\t\t// x-axis\n\t\t\tfor(var y=0; y<_n; y++) {\n\t\t\t\ti = y*_n;\n\t\t\t\tfor(var x1=0; x1<_n; x1++) {\n\t\t\t\t\t_tre[x1] = re[x1 + i];\n\t\t\t\t\t_tim[x1] = im[x1 + i];\n\t\t\t\t}\n\t\t\t\tthis.ifft1d(_tre, _tim);\n\t\t\t\tfor(var x2=0; x2<_n; x2++) {\n\t\t\t\t\tre[x2 + i] = _tre[x2];\n\t\t\t\t\tim[x2 + i] = _tim[x2];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// y-axis\n\t\t\tvar halfn = _n/2;\n\t\t\tvar rowIdx = 0;\n\t\t\tfor(var x=0; x<_n; x+=2) {\n\t\t\t\t//untangle\n\t\t\t\ti = x;\n\t\t\t\ti2 = x+1;\n\t\t\t\t_tre[0] = re[0 + i];\n\t\t\t\t_tim[0] = re[0 + i2];\n\t\t\t\t_tre[_n/2] = re[(halfn*_n) + i];\n\t\t\t\t_tim[_n/2] = re[(halfn*_n) + i2];\n\t\t\t\tfor (var x2=1;x2<halfn;x2++) {\n\t\t\t\t\trowIdx = x2*_n;\n\t\t\t\t\t_tre[x2] = re[rowIdx+i] - im[rowIdx + i2];\n\t\t\t\t\t_tre[_n - x2] = re[rowIdx+i] + im[rowIdx + i2];\n\t\t\t\t\t_tim[x2] = im[rowIdx+i] + re[rowIdx+i2];\n\t\t\t\t\t_tim[_n - x2] = re[rowIdx+i2] - im[rowIdx+i];\n\t\t\t\t}\n\t\t\t\tthis.ifft1d(_tre, _tim);\n\t\t\t\tfor(var y2=0; y2<_n; y2++) {\n\t\t\t\t\ti = x + y2*_n;\n\t\t\t\t\ti2 = (x + 1) + y2*_n;\n\t\t\t\t\tre[i] = _tre[y2];\n\t\t\t\t\tre[i2] = _tim[y2];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// 2D-FFT, real-valued only\n\t\t// ignores the imaginary input\n\t\t// see:\n\t\t// http://www.inf.fu-berlin.de/lehre/SS12/SP-Par/download/fft1.pdf\n\t\t// http://cnx.org/content/m12021/latest/\n\t\t// http://images.apple.com/acg/pdf/g4fft.pdf\n\t\t// http://www.ti.com/lit/an/spra291/spra291.pdf\n\t\tthis.real_fft2d = function (re, im) {\n\t\t\tvar i = 0, i2 = 0;\n\t\t\t// x-axis\n\t\t\tfor(var y=0; y<_n; y += 2) {\n\t\t\t\ti = y*_n;\n\t\t\t\ti2 = (y+1)*_n;\n\t\t\t\t// tangle\n\t\t\t\tfor(var x1=0; x1<_n; x1++) {\n\t\t\t\t\t_tre[x1] = re[x1 + i];\n\t\t\t\t\t_tim[x1] = re[x1 + i2];\n\t\t\t\t}\n\t\t\t\tthis.fft1d(_tre, _tim);\n\t\t\t\t// untangle\n\t\t\t\tre[0 + i] = _tre[0];\n\t\t\t\tre[0 + i2] = _tim[0];\n\t\t\t\tim[0 + i] = 0;\n\t\t\t\tim[0 + i2] = 0;\n\t\t\t\tre[_n/2 + i] = _tre[_n/2];\n\t\t\t\tre[_n/2 + i2] = _tim[_n/2];\n\t\t\t\tim[_n/2 + i] = 0;\n\t\t\t\tim[_n/2 + i2] = 0;\n\t\t\t\tfor(var x2=1;x2<(_n/2);x2++) {\n\t\t\t\t\tre[x2 + i] = 0.5 * (_tre[x2] + _tre[_n - x2]);\n\t\t\t\t\tim[x2 + i] = 0.5 * (_tim[x2] - _tim[_n - x2]);\n\t\t\t\t\tre[x2 + i2] = 0.5 * (_tim[x2] + _tim[_n - x2]);\n\t\t\t\t\tim[x2 + i2] = -0.5 * (_tre[x2] - _tre[_n - x2]);\n\t\t\t\t\tre[(_n-x2) + i] = re[x2 + i];\n\t\t\t\t\tim[(_n-x2) + i] = -im[x2 + i];\n\t\t\t\t\tre[(_n-x2) + i2] = re[x2 + i2];\n\t\t\t\t\tim[(_n-x2) + i2] = -im[x2 + i2];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// y-axis\n\t\t\tfor(var x=0; x<_n; x++) {\n\t\t\t\tfor(var y1=0; y1<_n; y1++) {\n\t\t\t\t\ti = x + y1*_n;\n\t\t\t\t\t_tre[y1] = re[i];\n\t\t\t\t\t_tim[y1] = im[i];\n\t\t\t\t}\n\t\t\t\tthis.fft1d(_tre, _tim);\n\t\t\t\tfor(var y2=0; y2<_n; y2++) {\n\t\t\t\t\ti = x + y2*_n;\n\t\t\t\t\tre[i] = _tre[y2];\n\t\t\t\t\tim[i] = _tim[y2];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// core operation of FFT\n\t\tfunction fft(re, im, inv) {\n\t\t\tvar d, h, ik, m, tmp, wr, wi, xr, xi,\n\t\t\t\tn4 = _n >> 2;\n\t\t\t// bit reversal\n\t\t\tfor(var l=0; l<_n; l++) {\n\t\t\t\tm = _bitrev[l];\n\t\t\t\tif(l < m) {\n\t\t\t\t\ttmp = re[l];\n\t\t\t\t\tre[l] = re[m];\n\t\t\t\t\tre[m] = tmp;\n\t\t\t\t\ttmp = im[l];\n\t\t\t\t\tim[l] = im[m];\n\t\t\t\t\tim[m] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// butterfly operation\n\t\t\t//butfly(re,im,inv,n4);\n\t\t\tfor(var k=1; k<_n; k<<=1) {\n\t\t\t\th = 0;\n\t\t\t\td = _n/(k << 1);\n\t\t\t\tfor(var j=0; j<k; j++) {\n\t\t\t\t\twr = _cstb[h + n4];\n\t\t\t\t\twi = inv*_cstb[h];\n\t\t\t\t\tfor(var i=j; i<_n; i+=(k<<1)) {\n\t\t\t\t\t\tik = i + k;\n\t\t\t\t\t\txr = wr*re[ik] + wi*im[ik];\n\t\t\t\t\t\txi = wr*im[ik] - wi*re[ik];\n\t\t\t\t\t\tre[ik] = re[i] - xr;\n\t\t\t\t\t\tre[i] += xr;\n\t\t\t\t\t\tim[ik] = im[i] - xi;\n\t\t\t\t\t\tim[i] += xi;\n\t\t\t\t\t}\n\t\t\t\t\th += d;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction _setVariables() {\n\t\t\tif(typeof Uint8Array !== 'undefined') {\n\t\t\t\t_bitrev = new Uint8Array(_n);\n\t\t\t} else {\n\t\t\t\t_bitrev = new Array(_n);\n\t\t\t}\n\t\t\tif(typeof Float64Array !== 'undefined') {\n\t\t\t\t_cstb = new Float64Array(_n*1.25);\n\t\t\t\t_tre = new Float64Array(_n);\n\t\t\t\t_tim = new Float64Array(_n);\n\t\t\t} else {\n\t\t\t\t_cstb = new Array(_n*1.25);\n\t\t\t\t_tre = new Array(_n);\n\t\t\t\t_tim = new Array(_n);\n\t\t\t}\n\t\t}\n\n\t\t// make bit reversal table\n\t\tfunction _makeBitReversal() {\n\t\t\tvar i = 0,\n\t\t\t\tj = 0,\n\t\t\t\tk = 0;\n\t\t\t_bitrev[0] = 0;\n\t\t\twhile(++i < _n) {\n\t\t\t\tk = _n >> 1;\n\t\t\t\twhile(k <= j) {\n\t\t\t\t\tj -= k;\n\t\t\t\t\tk >>= 1;\n\t\t\t\t}\n\t\t\t\tj += k;\n\t\t\t\t_bitrev[i] = j;\n\t\t\t}\n\t\t}\n\n\t\t// make trigonometric function table\n\t\tfunction _makeCosSinTable() {\n\t\t\tvar n2 = _n >> 1,\n\t\t\t\tn4 = _n >> 2,\n\t\t\t\tn8 = _n >> 3,\n\t\t\t\tn2p4 = n2 + n4,\n\t\t\t\tt = Math.sin(Math.PI/_n),\n\t\t\t\tdc = 2*t*t,\n\t\t\t\tds = Math.sqrt(dc*(2 - dc)),\n\t\t\t\tc = _cstb[n4] = 1,\n\t\t\t\ts = _cstb[0] = 0;\n\t\t\tt = 2*dc;\n\t\t\tfor(var i=1; i<n8; i++) {\n\t\t\t\tc -= dc;\n\t\t\t\tdc += t*c;\n\t\t\t\ts += ds;\n\t\t\t\tds -= t*s;\n\t\t\t\t_cstb[i] = s;\n\t\t\t\t_cstb[n4 - i] = c;\n\t\t\t}\n\t\t\tif(n8 !== 0) {\n\t\t\t\t_cstb[n8] = Math.sqrt(0.5);\n\t\t\t}\n\t\t\tfor(var j=0; j<n4; j++) {\n\t\t\t\t_cstb[n2 - j] = _cstb[j];\n\t\t\t}\n\t\t\tfor(var k=0; k<n2p4; k++) {\n\t\t\t\t_cstb[k + n2] = -_cstb[k];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "fe4f559fd541c29f439006957bf02d74", "score": "0.7583594", "text": "function FFT() {\n \n var _n = 0, // order\n _bitrev = null, // bit reversal table\n _cstb = null; // sin/cos table\n var _tre, _tim;\n \n this.init = function (n) {\n if(n !== 0 && (n & (n - 1)) === 0) {\n _n = n;\n _setVariables();\n _makeBitReversal();\n _makeCosSinTable();\n } else {\n throw new Error(\"init: radix-2 required\");\n }\n }\n \n // 1D-FFT\n this.fft1d = function (re, im) {\n fft(re, im, 1);\n }\n \n // 1D-IFFT\n this.ifft1d = function (re, im) {\n var n = 1/_n;\n fft(re, im, -1);\n for(var i=0; i<_n; i++) {\n re[i] *= n;\n im[i] *= n;\n }\n }\n \n // 2D-FFT\n this.fft2d = function (re, im) {\n var i = 0;\n // x-axis\n for(var y=0; y<_n; y++) {\n i = y*_n;\n for(var x1=0; x1<_n; x1++) {\n _tre[x1] = re[x1 + i];\n _tim[x1] = im[x1 + i];\n }\n this.fft1d(_tre, _tim);\n for(var x2=0; x2<_n; x2++) {\n re[x2 + i] = _tre[x2];\n im[x2 + i] = _tim[x2];\n }\n }\n \n // y-axis\n for(var x=0; x<_n; x++) {\n for(var y1=0; y1<_n; y1++) {\n i = x + y1*_n;\n _tre[y1] = re[i];\n _tim[y1] = im[i];\n }\n this.fft1d(_tre, _tim);\n for(var y2=0; y2<_n; y2++) {\n i = x + y2*_n;\n re[i] = _tre[y2];\n im[i] = _tim[y2];\n }\n }\n }\n \n // 2D-IFFT\n this.ifft2d = function (re, im) {\n var i = 0;\n // x-axis\n for(var y=0; y<_n; y++) {\n i = y*_n;\n for(var x1=0; x1<_n; x1++) {\n _tre[x1] = re[x1 + i];\n _tim[x1] = im[x1 + i];\n }\n this.ifft1d(_tre, _tim);\n for(var x2=0; x2<_n; x2++) {\n re[x2 + i] = _tre[x2];\n im[x2 + i] = _tim[x2];\n }\n }\n // y-axis\n for(var x=0; x<_n; x++) {\n for(var y1=0; y1<_n; y1++) {\n i = x + y1*_n;\n _tre[y1] = re[i];\n _tim[y1] = im[i];\n }\n this.ifft1d(_tre, _tim);\n for(var y2=0; y2<_n; y2++) {\n i = x + y2*_n;\n re[i] = _tre[y2];\n im[i] = _tim[y2];\n }\n }\n }\n \n // 2D-IFFT, real-valued\n // only outputs the real valued part\n this.real_ifft2d = function (re, im) {\n var i2;\n var i = 0;\n // x-axis\n for(var y=0; y<_n; y++) {\n i = y*_n;\n for(var x1=0; x1<_n; x1++) {\n _tre[x1] = re[x1 + i];\n _tim[x1] = im[x1 + i];\n }\n this.ifft1d(_tre, _tim);\n for(var x2=0; x2<_n; x2++) {\n re[x2 + i] = _tre[x2];\n im[x2 + i] = _tim[x2];\n }\n }\n // y-axis\n var halfn = _n/2;\n var rowIdx = 0;\n for(var x=0; x<_n; x+=2) {\n //untangle\n i = x;\n i2 = x+1;\n _tre[0] = re[0 + i];\n _tim[0] = re[0 + i2];\n _tre[_n/2] = re[(halfn*_n) + i];\n _tim[_n/2] = re[(halfn*_n) + i2];\n for (var x2=1;x2<halfn;x2++) {\n rowIdx = x2*_n\n _tre[x2] = re[rowIdx+i] - im[rowIdx + i2];\n _tre[_n - x2] = re[rowIdx+i] + im[rowIdx + i2];\n _tim[x2] = im[rowIdx+i] + re[rowIdx+i2];\n _tim[_n - x2] = re[rowIdx+i2] - im[rowIdx+i];\n }\n this.ifft1d(_tre, _tim);\n for(var y2=0; y2<_n; y2++) {\n i = x + y2*_n;\n i2 = (x + 1) + y2*_n;\n re[i] = _tre[y2];\n re[i2] = _tim[y2];\n }\n }\n }\n \n // 2D-FFT, real-valued only\n // ignores the imaginary input\n // see:\n // http://www.inf.fu-berlin.de/lehre/SS12/SP-Par/download/fft1.pdf\n // http://cnx.org/content/m12021/latest/\n // http://images.apple.com/acg/pdf/g4fft.pdf\n // http://www.ti.com/lit/an/spra291/spra291.pdf\n this.real_fft2d = function (re, im) {\n var i = 0, i2 = 0;\n var fftlen = (_n*_n)-1;\n // x-axis\n for(var y=0; y<_n; y += 2) {\n i = y*_n;\n i2 = (y+1)*_n;\n // tangle\n for(var x1=0; x1<_n; x1++) {\n _tre[x1] = re[x1 + i];\n _tim[x1] = re[x1 + i2];\n }\n this.fft1d(_tre, _tim);\n // untangle\n re[0 + i] = _tre[0];\n re[0 + i2] = _tim[0];\n im[0 + i] = 0;\n im[0 + i2] = 0;\n re[_n/2 + i] = _tre[_n/2];\n re[_n/2 + i2] = _tim[_n/2];\n im[_n/2 + i] = 0;\n im[_n/2 + i2] = 0;\n for(var x2=1;x2<(_n/2);x2++) {\n re[x2 + i] = 0.5 * (_tre[x2] + _tre[_n - x2]);\n im[x2 + i] = 0.5 * (_tim[x2] - _tim[_n - x2]);\n re[x2 + i2] = 0.5 * (_tim[x2] + _tim[_n - x2]);\n im[x2 + i2] = -0.5 * (_tre[x2] - _tre[_n - x2]);\n re[(_n-x2) + i] = re[x2 + i];\n im[(_n-x2) + i] = -im[x2 + i];\n re[(_n-x2) + i2] = re[x2 + i2];\n im[(_n-x2) + i2] = -im[x2 + i2];\n }\n }\n // y-axis\n for(var x=0; x<_n; x++) {\n for(var y1=0; y1<_n; y1++) {\n i = x + y1*_n;\n _tre[y1] = re[i];\n _tim[y1] = im[i];\n }\n this.fft1d(_tre, _tim);\n for(var y2=0; y2<_n; y2++) {\n i = x + y2*_n;\n re[i] = _tre[y2];\n im[i] = _tim[y2];\n }\n }\n }\n \n // core operation of FFT\n function fft(re, im, inv) {\n var d, h, ik, m, tmp, wr, wi, xr, xi,\n n4 = _n >> 2;\n // bit reversal\n for(var l=0; l<_n; l++) {\n m = _bitrev[l];\n if(l < m) {\n tmp = re[l];\n re[l] = re[m];\n re[m] = tmp;\n tmp = im[l];\n im[l] = im[m];\n im[m] = tmp;\n }\n }\n // butterfly operation\n //butfly(re,im,inv,n4);\n for(var k=1; k<_n; k<<=1) {\n h = 0;\n d = _n/(k << 1);\n for(var j=0; j<k; j++) {\n wr = _cstb[h + n4];\n wi = inv*_cstb[h];\n for(var i=j; i<_n; i+=(k<<1)) {\n ik = i + k;\n xr = wr*re[ik] + wi*im[ik];\n xi = wr*im[ik] - wi*re[ik];\n re[ik] = re[i] - xr;\n re[i] += xr;\n im[ik] = im[i] - xi;\n im[i] += xi;\n }\n h += d;\n }\n }\n }\n \n function butfly(re, im, inv, n4) {\n var h,d,wr,wi,ik,xr,xi;\n for(var k=1; k<_n; k<<=1) {\n h = 0;\n d = _n/(k << 1);\n for(var j=0; j<k; j++) {\n wr = _cstb[h + n4];\n wi = inv*_cstb[h];\n for(var i=j; i<_n; i+=(k<<1)) {\n ik = i + k;\n xr = wr*re[ik] + wi*im[ik];\n xi = wr*im[ik] - wi*re[ik];\n re[ik] = re[i] - xr;\n re[i] += xr;\n im[ik] = im[i] - xi;\n im[i] += xi;\n }\n h += d;\n }\n }\n }\n \n // set variables\n function _setVariables() {\n if(typeof Uint8Array !== 'undefined') {\n _bitrev = new Uint8Array(_n);\n } else {\n _bitrev = new Array(_n);\n }\n if(typeof Float64Array !== 'undefined') {\n _cstb = new Float64Array(_n*1.25);\n _tre = new Float64Array(_n);\n _tim = new Float64Array(_n);\n } else {\n _cstb = new Array(_n*1.25);\n _tre = new Array(_n);\n _tim = new Array(_n);\n }\n }\n \n // make bit reversal table\n function _makeBitReversal() {\n var i = 0,\n j = 0,\n k = 0;\n _bitrev[0] = 0;\n while(++i < _n) {\n k = _n >> 1;\n while(k <= j) {\n j -= k;\n k >>= 1;\n }\n j += k;\n _bitrev[i] = j;\n }\n }\n \n // make trigonometric function table\n function _makeCosSinTable() {\n var n2 = _n >> 1,\n n4 = _n >> 2,\n n8 = _n >> 3,\n n2p4 = n2 + n4,\n t = Math.sin(Math.PI/_n),\n dc = 2*t*t,\n ds = Math.sqrt(dc*(2 - dc)),\n c = _cstb[n4] = 1,\n s = _cstb[0] = 0;\n t = 2*dc;\n for(var i=1; i<n8; i++) {\n c -= dc;\n dc += t*c;\n s += ds;\n ds -= t*s;\n _cstb[i] = s;\n _cstb[n4 - i] = c;\n }\n if(n8 !== 0) {\n _cstb[n8] = Math.sqrt(0.5);\n }\n for(var j=0; j<n4; j++) {\n _cstb[n2 - j] = _cstb[j];\n }\n for(var k=0; k<n2p4; k++) {\n _cstb[k + n2] = -_cstb[k];\n }\n }\n }", "title": "" }, { "docid": "dd2d72d054297c0c9c1f5662a5ab99a1", "score": "0.74550337", "text": "function FFT() {\n\t\t \n\t\t var _n = 0, // order\n\t\t _bitrev = null, // bit reversal table\n\t\t _cstb = null; // sin/cos table\n\t\t var _tre, _tim;\n\t\t \n\t\t this.init = function (n) {\n\t\t if(n !== 0 && (n & (n - 1)) === 0) {\n\t\t _n = n;\n\t\t _setVariables();\n\t\t _makeBitReversal();\n\t\t _makeCosSinTable();\n\t\t } else {\n\t\t throw new Error(\"init: radix-2 required\");\n\t\t }\n\t\t }\n\t\t \n\t\t // 1D-FFT\n\t\t this.fft1d = function (re, im) {\n\t\t fft(re, im, 1);\n\t\t }\n\t\t \n\t\t // 1D-IFFT\n\t\t this.ifft1d = function (re, im) {\n\t\t var n = 1/_n;\n\t\t fft(re, im, -1);\n\t\t for(var i=0; i<_n; i++) {\n\t\t re[i] *= n;\n\t\t im[i] *= n;\n\t\t }\n\t\t }\n\t\t \n\t\t // 2D-FFT\n\t\t this.fft2d = function (re, im) {\n\t\t var i = 0;\n\t\t // x-axis\n\t\t for(var y=0; y<_n; y++) {\n\t\t i = y*_n;\n\t\t for(var x1=0; x1<_n; x1++) {\n\t\t _tre[x1] = re[x1 + i];\n\t\t _tim[x1] = im[x1 + i];\n\t\t }\n\t\t this.fft1d(_tre, _tim);\n\t\t for(var x2=0; x2<_n; x2++) {\n\t\t re[x2 + i] = _tre[x2];\n\t\t im[x2 + i] = _tim[x2];\n\t\t }\n\t\t }\n\t\t \n\t\t // y-axis\n\t\t for(var x=0; x<_n; x++) {\n\t\t for(var y1=0; y1<_n; y1++) {\n\t\t i = x + y1*_n;\n\t\t _tre[y1] = re[i];\n\t\t _tim[y1] = im[i];\n\t\t }\n\t\t this.fft1d(_tre, _tim);\n\t\t for(var y2=0; y2<_n; y2++) {\n\t\t i = x + y2*_n;\n\t\t re[i] = _tre[y2];\n\t\t im[i] = _tim[y2];\n\t\t }\n\t\t }\n\t\t }\n\t\t \n\t\t // 2D-IFFT\n\t\t this.ifft2d = function (re, im) {\n\t\t var i = 0;\n\t\t // x-axis\n\t\t for(var y=0; y<_n; y++) {\n\t\t i = y*_n;\n\t\t for(var x1=0; x1<_n; x1++) {\n\t\t _tre[x1] = re[x1 + i];\n\t\t _tim[x1] = im[x1 + i];\n\t\t }\n\t\t this.ifft1d(_tre, _tim);\n\t\t for(var x2=0; x2<_n; x2++) {\n\t\t re[x2 + i] = _tre[x2];\n\t\t im[x2 + i] = _tim[x2];\n\t\t }\n\t\t }\n\t\t // y-axis\n\t\t for(var x=0; x<_n; x++) {\n\t\t for(var y1=0; y1<_n; y1++) {\n\t\t i = x + y1*_n;\n\t\t _tre[y1] = re[i];\n\t\t _tim[y1] = im[i];\n\t\t }\n\t\t this.ifft1d(_tre, _tim);\n\t\t for(var y2=0; y2<_n; y2++) {\n\t\t i = x + y2*_n;\n\t\t re[i] = _tre[y2];\n\t\t im[i] = _tim[y2];\n\t\t }\n\t\t }\n\t\t }\n\t\t \n\t\t // 2D-IFFT, real-valued\n\t\t // only outputs the real valued part\n\t\t this.real_ifft2d = function (re, im) {\n\t\t var i2;\n\t\t var i = 0;\n\t\t // x-axis\n\t\t for(var y=0; y<_n; y++) {\n\t\t i = y*_n;\n\t\t for(var x1=0; x1<_n; x1++) {\n\t\t _tre[x1] = re[x1 + i];\n\t\t _tim[x1] = im[x1 + i];\n\t\t }\n\t\t this.ifft1d(_tre, _tim);\n\t\t for(var x2=0; x2<_n; x2++) {\n\t\t re[x2 + i] = _tre[x2];\n\t\t im[x2 + i] = _tim[x2];\n\t\t }\n\t\t }\n\t\t // y-axis\n\t\t var halfn = _n/2;\n\t\t var rowIdx = 0;\n\t\t for(var x=0; x<_n; x+=2) {\n\t\t //untangle\n\t\t i = x;\n\t\t i2 = x+1;\n\t\t _tre[0] = re[0 + i];\n\t\t _tim[0] = re[0 + i2];\n\t\t _tre[_n/2] = re[(halfn*_n) + i];\n\t\t _tim[_n/2] = re[(halfn*_n) + i2];\n\t\t for (var x2=1;x2<halfn;x2++) {\n\t\t rowIdx = x2*_n\n\t\t _tre[x2] = re[rowIdx+i] - im[rowIdx + i2];\n\t\t _tre[_n - x2] = re[rowIdx+i] + im[rowIdx + i2];\n\t\t _tim[x2] = im[rowIdx+i] + re[rowIdx+i2];\n\t\t _tim[_n - x2] = re[rowIdx+i2] - im[rowIdx+i];\n\t\t }\n\t\t this.ifft1d(_tre, _tim);\n\t\t for(var y2=0; y2<_n; y2++) {\n\t\t i = x + y2*_n;\n\t\t i2 = (x + 1) + y2*_n;\n\t\t re[i] = _tre[y2];\n\t\t re[i2] = _tim[y2];\n\t\t }\n\t\t }\n\t\t }\n\t\t \n\t\t // 2D-FFT, real-valued only\n\t\t // ignores the imaginary input\n\t\t // see:\n\t\t // http://www.inf.fu-berlin.de/lehre/SS12/SP-Par/download/fft1.pdf\n\t\t // http://cnx.org/content/m12021/latest/\n\t\t // http://images.apple.com/acg/pdf/g4fft.pdf\n\t\t // http://www.ti.com/lit/an/spra291/spra291.pdf\n\t\t this.real_fft2d = function (re, im) {\n\t\t var i = 0, i2 = 0;\n\t\t var fftlen = (_n*_n)-1;\n\t\t // x-axis\n\t\t for(var y=0; y<_n; y += 2) {\n\t\t i = y*_n;\n\t\t i2 = (y+1)*_n;\n\t\t // tangle\n\t\t for(var x1=0; x1<_n; x1++) {\n\t\t _tre[x1] = re[x1 + i];\n\t\t _tim[x1] = re[x1 + i2];\n\t\t }\n\t\t this.fft1d(_tre, _tim);\n\t\t // untangle\n\t\t re[0 + i] = _tre[0];\n\t\t re[0 + i2] = _tim[0];\n\t\t im[0 + i] = 0;\n\t\t im[0 + i2] = 0;\n\t\t re[_n/2 + i] = _tre[_n/2];\n\t\t re[_n/2 + i2] = _tim[_n/2];\n\t\t im[_n/2 + i] = 0;\n\t\t im[_n/2 + i2] = 0;\n\t\t for(var x2=1;x2<(_n/2);x2++) {\n\t\t re[x2 + i] = 0.5 * (_tre[x2] + _tre[_n - x2]);\n\t\t im[x2 + i] = 0.5 * (_tim[x2] - _tim[_n - x2]);\n\t\t re[x2 + i2] = 0.5 * (_tim[x2] + _tim[_n - x2]);\n\t\t im[x2 + i2] = -0.5 * (_tre[x2] - _tre[_n - x2]);\n\t\t re[(_n-x2) + i] = re[x2 + i];\n\t\t im[(_n-x2) + i] = -im[x2 + i];\n\t\t re[(_n-x2) + i2] = re[x2 + i2];\n\t\t im[(_n-x2) + i2] = -im[x2 + i2];\n\t\t }\n\t\t }\n\t\t // y-axis\n\t\t for(var x=0; x<_n; x++) {\n\t\t for(var y1=0; y1<_n; y1++) {\n\t\t i = x + y1*_n;\n\t\t _tre[y1] = re[i];\n\t\t _tim[y1] = im[i];\n\t\t }\n\t\t this.fft1d(_tre, _tim);\n\t\t for(var y2=0; y2<_n; y2++) {\n\t\t i = x + y2*_n;\n\t\t re[i] = _tre[y2];\n\t\t im[i] = _tim[y2];\n\t\t }\n\t\t }\n\t\t }\n\t\t \n\t\t // core operation of FFT\n\t\t function fft(re, im, inv) {\n\t\t var d, h, ik, m, tmp, wr, wi, xr, xi,\n\t\t n4 = _n >> 2;\n\t\t // bit reversal\n\t\t for(var l=0; l<_n; l++) {\n\t\t m = _bitrev[l];\n\t\t if(l < m) {\n\t\t tmp = re[l];\n\t\t re[l] = re[m];\n\t\t re[m] = tmp;\n\t\t tmp = im[l];\n\t\t im[l] = im[m];\n\t\t im[m] = tmp;\n\t\t }\n\t\t }\n\t\t // butterfly operation\n\t\t //butfly(re,im,inv,n4);\n\t\t for(var k=1; k<_n; k<<=1) {\n\t\t h = 0;\n\t\t d = _n/(k << 1);\n\t\t for(var j=0; j<k; j++) {\n\t\t wr = _cstb[h + n4];\n\t\t wi = inv*_cstb[h];\n\t\t for(var i=j; i<_n; i+=(k<<1)) {\n\t\t ik = i + k;\n\t\t xr = wr*re[ik] + wi*im[ik];\n\t\t xi = wr*im[ik] - wi*re[ik];\n\t\t re[ik] = re[i] - xr;\n\t\t re[i] += xr;\n\t\t im[ik] = im[i] - xi;\n\t\t im[i] += xi;\n\t\t }\n\t\t h += d;\n\t\t }\n\t\t }\n\t\t }\n\t\t \n\t\t function butfly(re, im, inv, n4) {\n\t\t var h,d,wr,wi,ik,xr,xi;\n\t\t for(var k=1; k<_n; k<<=1) {\n\t\t h = 0;\n\t\t d = _n/(k << 1);\n\t\t for(var j=0; j<k; j++) {\n\t\t wr = _cstb[h + n4];\n\t\t wi = inv*_cstb[h];\n\t\t for(var i=j; i<_n; i+=(k<<1)) {\n\t\t ik = i + k;\n\t\t xr = wr*re[ik] + wi*im[ik];\n\t\t xi = wr*im[ik] - wi*re[ik];\n\t\t re[ik] = re[i] - xr;\n\t\t re[i] += xr;\n\t\t im[ik] = im[i] - xi;\n\t\t im[i] += xi;\n\t\t }\n\t\t h += d;\n\t\t }\n\t\t }\n\t\t }\n\t\t \n\t\t // set variables\n\t\t function _setVariables() {\n\t\t if(typeof Uint8Array !== 'undefined') {\n\t\t _bitrev = new Uint8Array(_n);\n\t\t } else {\n\t\t _bitrev = new Array(_n);\n\t\t }\n\t\t if(typeof Float64Array !== 'undefined') {\n\t\t _cstb = new Float64Array(_n*1.25);\n\t\t _tre = new Float64Array(_n);\n\t\t _tim = new Float64Array(_n);\n\t\t } else {\n\t\t _cstb = new Array(_n*1.25);\n\t\t _tre = new Array(_n);\n\t\t _tim = new Array(_n);\n\t\t }\n\t\t }\n\t\t \n\t\t // make bit reversal table\n\t\t function _makeBitReversal() {\n\t\t var i = 0,\n\t\t j = 0,\n\t\t k = 0;\n\t\t _bitrev[0] = 0;\n\t\t while(++i < _n) {\n\t\t k = _n >> 1;\n\t\t while(k <= j) {\n\t\t j -= k;\n\t\t k >>= 1;\n\t\t }\n\t\t j += k;\n\t\t _bitrev[i] = j;\n\t\t }\n\t\t }\n\t\t \n\t\t // make trigonometric function table\n\t\t function _makeCosSinTable() {\n\t\t var n2 = _n >> 1,\n\t\t n4 = _n >> 2,\n\t\t n8 = _n >> 3,\n\t\t n2p4 = n2 + n4,\n\t\t t = Math.sin(Math.PI/_n),\n\t\t dc = 2*t*t,\n\t\t ds = Math.sqrt(dc*(2 - dc)),\n\t\t c = _cstb[n4] = 1,\n\t\t s = _cstb[0] = 0;\n\t\t t = 2*dc;\n\t\t for(var i=1; i<n8; i++) {\n\t\t c -= dc;\n\t\t dc += t*c;\n\t\t s += ds;\n\t\t ds -= t*s;\n\t\t _cstb[i] = s;\n\t\t _cstb[n4 - i] = c;\n\t\t }\n\t\t if(n8 !== 0) {\n\t\t _cstb[n8] = Math.sqrt(0.5);\n\t\t }\n\t\t for(var j=0; j<n4; j++) {\n\t\t _cstb[n2 - j] = _cstb[j];\n\t\t }\n\t\t for(var k=0; k<n2p4; k++) {\n\t\t _cstb[k + n2] = -_cstb[k];\n\t\t }\n\t\t }\n\t\t }", "title": "" }, { "docid": "c5b71db750af458a8ea9c1cff1309889", "score": "0.6792231", "text": "function iDFT(amplitudes, len, freq){ //inverse DFT to return time domain\n var real = 0;\n var imag = 0;\n var _len = 1/len;\n var shared = 6.28318530718*freq*_len;\n\n for(var i = 0; i<len; i++){\n var sharedi = shared*i; //this.thread.x is the target frequency\n real = real+amplitudes[i]*Math.cos(sharedi);\n imag = amplitudes[i]*Math.sin(sharedi)-imag; \n }\n //var mag = Math.sqrt(real[k]*real[k]+imag[k]*imag[k]);\n return [real*_len,imag*_len]; //mag(real,imag)\n}", "title": "" }, { "docid": "c82852e1d1d22b720bb74ef0124270e9", "score": "0.67584014", "text": "function fftRadix2(dir, nrows, ncols, buffer, x_ptr, y_ptr) {\r\n dir |= 0\r\n nrows |= 0\r\n ncols |= 0\r\n x_ptr |= 0\r\n y_ptr |= 0\r\n var nn,m,i,i1,j,k,i2,l,l1,l2\r\n var c1,c2,t,t1,t2,u1,u2,z,row,a,b,c,d,k1,k2,k3\r\n \r\n // Calculate the number of points\r\n nn = ncols\r\n m = bits.log2(nn)\r\n \r\n for(row=0; row<nrows; ++row) { \r\n // Do the bit reversal\r\n i2 = nn >> 1;\r\n j = 0;\r\n for(i=0;i<nn-1;i++) {\r\n if(i < j) {\r\n t = buffer[x_ptr+i]\r\n buffer[x_ptr+i] = buffer[x_ptr+j]\r\n buffer[x_ptr+j] = t\r\n t = buffer[y_ptr+i]\r\n buffer[y_ptr+i] = buffer[y_ptr+j]\r\n buffer[y_ptr+j] = t\r\n }\r\n k = i2\r\n while(k <= j) {\r\n j -= k\r\n k >>= 1\r\n }\r\n j += k\r\n }\r\n \r\n // Compute the FFT\r\n c1 = -1.0\r\n c2 = 0.0\r\n l2 = 1\r\n for(l=0;l<m;l++) {\r\n l1 = l2\r\n l2 <<= 1\r\n u1 = 1.0\r\n u2 = 0.0\r\n for(j=0;j<l1;j++) {\r\n for(i=j;i<nn;i+=l2) {\r\n i1 = i + l1\r\n a = buffer[x_ptr+i1]\r\n b = buffer[y_ptr+i1]\r\n c = buffer[x_ptr+i]\r\n d = buffer[y_ptr+i]\r\n k1 = u1 * (a + b)\r\n k2 = a * (u2 - u1)\r\n k3 = b * (u1 + u2)\r\n t1 = k1 - k3\r\n t2 = k1 + k2\r\n buffer[x_ptr+i1] = c - t1\r\n buffer[y_ptr+i1] = d - t2\r\n buffer[x_ptr+i] += t1\r\n buffer[y_ptr+i] += t2\r\n }\r\n k1 = c1 * (u1 + u2)\r\n k2 = u1 * (c2 - c1)\r\n k3 = u2 * (c1 + c2)\r\n u1 = k1 - k3\r\n u2 = k1 + k2\r\n }\r\n c2 = Math.sqrt((1.0 - c1) / 2.0)\r\n if(dir < 0) {\r\n c2 = -c2\r\n }\r\n c1 = Math.sqrt((1.0 + c1) / 2.0)\r\n }\r\n \r\n // Scaling for inverse transform\r\n if(dir < 0) {\r\n var scale_f = 1.0 / nn\r\n for(i=0;i<nn;i++) {\r\n buffer[x_ptr+i] *= scale_f\r\n buffer[y_ptr+i] *= scale_f\r\n }\r\n }\r\n \r\n // Advance pointers\r\n x_ptr += ncols\r\n y_ptr += ncols\r\n }\r\n}", "title": "" }, { "docid": "3f4e3e39a4a2acc252153c5a7525acf0", "score": "0.67299753", "text": "function fftRadix2(dir, nrows, ncols, buffer, x_ptr, y_ptr) {\n dir |= 0\n nrows |= 0\n ncols |= 0\n x_ptr |= 0\n y_ptr |= 0\n var nn,m,i,i1,j,k,i2,l,l1,l2\n var c1,c2,t,t1,t2,u1,u2,z,row,a,b,c,d,k1,k2,k3\n \n // Calculate the number of points\n nn = ncols\n m = bits.log2(nn)\n \n for(row=0; row<nrows; ++row) { \n // Do the bit reversal\n i2 = nn >> 1;\n j = 0;\n for(i=0;i<nn-1;i++) {\n if(i < j) {\n t = buffer[x_ptr+i]\n buffer[x_ptr+i] = buffer[x_ptr+j]\n buffer[x_ptr+j] = t\n t = buffer[y_ptr+i]\n buffer[y_ptr+i] = buffer[y_ptr+j]\n buffer[y_ptr+j] = t\n }\n k = i2\n while(k <= j) {\n j -= k\n k >>= 1\n }\n j += k\n }\n \n // Compute the FFT\n c1 = -1.0\n c2 = 0.0\n l2 = 1\n for(l=0;l<m;l++) {\n l1 = l2\n l2 <<= 1\n u1 = 1.0\n u2 = 0.0\n for(j=0;j<l1;j++) {\n for(i=j;i<nn;i+=l2) {\n i1 = i + l1\n a = buffer[x_ptr+i1]\n b = buffer[y_ptr+i1]\n c = buffer[x_ptr+i]\n d = buffer[y_ptr+i]\n k1 = u1 * (a + b)\n k2 = a * (u2 - u1)\n k3 = b * (u1 + u2)\n t1 = k1 - k3\n t2 = k1 + k2\n buffer[x_ptr+i1] = c - t1\n buffer[y_ptr+i1] = d - t2\n buffer[x_ptr+i] += t1\n buffer[y_ptr+i] += t2\n }\n k1 = c1 * (u1 + u2)\n k2 = u1 * (c2 - c1)\n k3 = u2 * (c1 + c2)\n u1 = k1 - k3\n u2 = k1 + k2\n }\n c2 = Math.sqrt((1.0 - c1) / 2.0)\n if(dir < 0) {\n c2 = -c2\n }\n c1 = Math.sqrt((1.0 + c1) / 2.0)\n }\n \n // Scaling for inverse transform\n if(dir < 0) {\n var scale_f = 1.0 / nn\n for(i=0;i<nn;i++) {\n buffer[x_ptr+i] *= scale_f\n buffer[y_ptr+i] *= scale_f\n }\n }\n \n // Advance pointers\n x_ptr += ncols\n y_ptr += ncols\n }\n}", "title": "" }, { "docid": "f1b8f60c96f4d5582cbcc1a8308190e2", "score": "0.672726", "text": "function fftRadix2(dir, nrows, ncols, buffer, x_ptr, y_ptr) {\n dir |= 0\n nrows |= 0\n ncols |= 0\n x_ptr |= 0\n y_ptr |= 0\n var nn,i,i1,j,k,i2,l,l1,l2\n var c1,c2,t,t1,t2,u1,u2,z,row,a,b,c,d,k1,k2,k3\n \n // Calculate the number of points\n nn = ncols\n m = bits.log2(nn)\n \n for(row=0; row<nrows; ++row) { \n // Do the bit reversal\n i2 = nn >> 1;\n j = 0;\n for(i=0;i<nn-1;i++) {\n if(i < j) {\n t = buffer[x_ptr+i]\n buffer[x_ptr+i] = buffer[x_ptr+j]\n buffer[x_ptr+j] = t\n t = buffer[y_ptr+i]\n buffer[y_ptr+i] = buffer[y_ptr+j]\n buffer[y_ptr+j] = t\n }\n k = i2\n while(k <= j) {\n j -= k\n k >>= 1\n }\n j += k\n }\n \n // Compute the FFT\n c1 = -1.0\n c2 = 0.0\n l2 = 1\n for(l=0;l<m;l++) {\n l1 = l2\n l2 <<= 1\n u1 = 1.0\n u2 = 0.0\n for(j=0;j<l1;j++) {\n for(i=j;i<nn;i+=l2) {\n i1 = i + l1\n a = buffer[x_ptr+i1]\n b = buffer[y_ptr+i1]\n c = buffer[x_ptr+i]\n d = buffer[y_ptr+i]\n k1 = u1 * (a + b)\n k2 = a * (u2 - u1)\n k3 = b * (u1 + u2)\n t1 = k1 - k3\n t2 = k1 + k2\n buffer[x_ptr+i1] = c - t1\n buffer[y_ptr+i1] = d - t2\n buffer[x_ptr+i] += t1\n buffer[y_ptr+i] += t2\n }\n k1 = c1 * (u1 + u2)\n k2 = u1 * (c2 - c1)\n k3 = u2 * (c1 + c2)\n u1 = k1 - k3\n u2 = k1 + k2\n }\n c2 = Math.sqrt((1.0 - c1) / 2.0)\n if(dir < 0) {\n c2 = -c2\n }\n c1 = Math.sqrt((1.0 + c1) / 2.0)\n }\n \n // Scaling for inverse transform\n if(dir < 0) {\n var scale_f = 1.0 / nn\n for(i=0;i<nn;i++) {\n buffer[x_ptr+i] *= scale_f\n buffer[y_ptr+i] *= scale_f\n }\n }\n \n // Advance pointers\n x_ptr += ncols\n y_ptr += ncols\n }\n}", "title": "" }, { "docid": "d9f2eeb15d9c9193db0ff702a434e780", "score": "0.666142", "text": "function transformRadix2(real, imag) {\n // Initialization\n if (real.length != imag.length)\n throw \"Mismatched lengths\";\n var n = real.length;\n if (n == 1)\n // Trivial transform\n return;\n var levels = -1;\n for (var i = 0; i < 32; i++) {\n if (1 << i == n)\n levels = i;\n // Equal to log2(n)\n }\n if (levels == -1)\n throw \"Length is not a power of 2\";\n var cosTable = new Array(n / 2);\n var sinTable = new Array(n / 2);\n for (var i = 0; i < n / 2; i++) {\n cosTable[i] = Math.cos(2 * Math.PI * i / n);\n sinTable[i] = Math.sin(2 * Math.PI * i / n);\n }\n\n // Bit-reversed addressing permutation\n for (var i = 0; i < n; i++) {\n var j = reverseBits(i, levels);\n if (j > i) {\n var temp = real[i];\n real[i] = real[j];\n real[j] = temp;\n temp = imag[i];\n imag[i] = imag[j];\n imag[j] = temp;\n }\n }\n\n // Cooley-Tukey decimation-in-time radix-2 FFT\n for (var size = 2; size <= n; size *= 2) {\n var halfsize = size / 2;\n var tablestep = n / size;\n for (var i = 0; i < n; i += size) {\n for (var j = i, k = 0; j < i + halfsize; j++,\n k += tablestep) {\n var tpre = real[j + halfsize] * cosTable[k] + imag[j + halfsize] * sinTable[k];\n var tpim = -real[j + halfsize] * sinTable[k] + imag[j + halfsize] * cosTable[k];\n real[j + halfsize] = real[j] - tpre;\n imag[j + halfsize] = imag[j] - tpim;\n real[j] += tpre;\n imag[j] += tpim;\n }\n }\n }\n\n // Returns the integer whose value is the reverse of the lowest 'bits' bits of the integer 'x'.\n function reverseBits(x, bits) {\n var y = 0;\n for (var i = 0; i < bits; i++) {\n y = (y << 1) | (x & 1);\n x >>>= 1;\n }\n return y;\n }\n}", "title": "" }, { "docid": "907178dad98f64048b4d146b5f478edc", "score": "0.66090196", "text": "function transformRadix2(real, imag) {\n\t// Length variables\n\tvar n = real.length;\n\tif (n != imag.length)\n\t\tthrow \"Mismatched lengths\";\n\tif (n == 1) // Trivial transform\n\t\treturn;\n\tvar levels = -1;\n\tfor (let i = 0; i < 32; i++) {\n\t\tif (1 << i == n)\n\t\t\tlevels = i; // Equal to log2(n)\n\t}\n\tif (levels == -1)\n\t\tthrow \"Length is not a power of 2\";\n\n\t// Trigonometric tables\n\tvar cosTable = new Array(n / 2);\n\tvar sinTable = new Array(n / 2);\n\tfor (let i = 0; i < n / 2; i++) {\n\t\tcosTable[i] = Math.cos(2 * Math.PI * i / n);\n\t\tsinTable[i] = Math.sin(2 * Math.PI * i / n);\n\t}\n\n\t// Bit-reversed addressing permutation\n\tfor (let i = 0; i < n; i++) {\n\t\tvar j = reverseBits(i, levels);\n\t\tif (j > i) {\n\t\t\tvar temp = real[i];\n\t\t\treal[i] = real[j];\n\t\t\treal[j] = temp;\n\t\t\ttemp = imag[i];\n\t\t\timag[i] = imag[j];\n\t\t\timag[j] = temp;\n\t\t}\n\t}\n\n\t// Cooley-Tukey decimation-in-time radix-2 FFT\n\tfor (var size = 2; size <= n; size *= 2) {\n\t\tvar halfSize = size / 2;\n\t\tvar tableStep = n / size;\n\t\tfor (let i = 0; i < n; i += size) {\n\t\t\tfor (let j = i, k = 0; j < i + halfSize; j++, k += tableStep) {\n\t\t\t\tvar l = j + halfSize;\n\t\t\t\tvar tPre = real[l] * cosTable[k] + imag[l] * sinTable[k];\n\t\t\t\tvar tPim = -real[l] * sinTable[k] + imag[l] * cosTable[k];\n\t\t\t\treal[l] = real[j] - tPre;\n\t\t\t\timag[l] = imag[j] - tPim;\n\t\t\t\treal[j] += tPre;\n\t\t\t\timag[j] += tPim;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn [real, imag];\n}", "title": "" }, { "docid": "df26438394abb87969dc13a944eaf005", "score": "0.6398922", "text": "function fftRadix2(realVals, imagVals, size, inverse, cpuBackend) {\n if (size === 1) {\n return { real: realVals, imag: imagVals };\n }\n var data = tf.backend_util.mergeRealAndImagArrays(realVals, imagVals);\n var half = size / 2;\n var evenComplex = tf.backend_util.complexWithEvenIndex(data);\n var evenRealVals = evenComplex.real;\n var evenImagVals = evenComplex.imag;\n var evenShape = [evenRealVals.length];\n var evenRealInfo = cpuBackend.makeTensorInfo(evenShape, 'float32', evenRealVals);\n var evenImagInfo = cpuBackend.makeTensorInfo(evenShape, 'float32', evenImagVals);\n var evenTensorInfo = complex({ inputs: { real: evenRealInfo, imag: evenImagInfo }, backend: cpuBackend });\n var oddComplex = tf.backend_util.complexWithOddIndex(data);\n var oddRealVals = oddComplex.real;\n var oddImagVals = oddComplex.imag;\n var oddShape = [oddRealVals.length];\n var oddRealInfo = cpuBackend.makeTensorInfo(oddShape, 'float32', oddRealVals);\n var oddImagInfo = cpuBackend.makeTensorInfo(oddShape, 'float32', oddImagVals);\n var oddTensorInfo = complex({ inputs: { real: oddRealInfo, imag: oddImagInfo }, backend: cpuBackend });\n // Recursive call for half part of original input.\n var $evenComplex = fftRadix2(evenRealVals, evenImagVals, half, inverse, cpuBackend);\n var $evenRealVals = $evenComplex.real;\n var $evenImagVals = $evenComplex.imag;\n var $evenShape = [$evenRealVals.length];\n var $evenRealInfo = cpuBackend.makeTensorInfo($evenShape, 'float32', $evenRealVals);\n var $evenImagInfo = cpuBackend.makeTensorInfo($evenShape, 'float32', $evenImagVals);\n var $evenTensorInfo = complex({\n inputs: { real: $evenRealInfo, imag: $evenImagInfo },\n backend: cpuBackend\n });\n var $oddComplex = fftRadix2(oddRealVals, oddImagVals, half, inverse, cpuBackend);\n var $oddRealVals = $oddComplex.real;\n var $oddImagVals = $oddComplex.imag;\n var $oddShape = [$oddRealVals.length];\n var $oddRealInfo = cpuBackend.makeTensorInfo($oddShape, 'float32', $oddRealVals);\n var $oddImagInfo = cpuBackend.makeTensorInfo($oddShape, 'float32', $oddImagVals);\n var $oddTensorInfo = complex({ inputs: { real: $oddRealInfo, imag: $oddImagInfo }, backend: cpuBackend });\n var e = tf.backend_util.exponents(size, inverse);\n var eShape = [e.real.length];\n var eRealInfo = cpuBackend.makeTensorInfo(eShape, 'float32', e.real);\n var eImagInfo = cpuBackend.makeTensorInfo(eShape, 'float32', e.imag);\n var complexInfo = complex({ inputs: { real: eRealInfo, imag: eImagInfo }, backend: cpuBackend });\n var exponentInfo = multiply({ inputs: { a: complexInfo, b: $oddTensorInfo }, backend: cpuBackend });\n var addPart = add({\n inputs: { a: $evenTensorInfo, b: exponentInfo },\n backend: cpuBackend\n });\n var subPart = sub({\n inputs: { a: $evenTensorInfo, b: exponentInfo },\n backend: cpuBackend\n });\n var addPartReal = real({ inputs: { input: addPart }, backend: cpuBackend });\n var subPartReal = real({ inputs: { input: subPart }, backend: cpuBackend });\n var addPartImag = imag({ inputs: { input: addPart }, backend: cpuBackend });\n var subPartImag = imag({ inputs: { input: subPart }, backend: cpuBackend });\n var $real = concat({\n inputs: [addPartReal, subPartReal],\n backend: cpuBackend,\n attrs: { axis: 0 }\n });\n var $imag = concat({\n inputs: [addPartImag, subPartImag],\n backend: cpuBackend,\n attrs: { axis: 0 }\n });\n var $realVals = cpuBackend.data.get($real.dataId).values;\n var $imagVals = cpuBackend.data.get($imag.dataId).values;\n cpuBackend.disposeIntermediateTensorInfo(evenRealInfo);\n cpuBackend.disposeIntermediateTensorInfo(evenImagInfo);\n cpuBackend.disposeIntermediateTensorInfo(evenTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo(oddRealInfo);\n cpuBackend.disposeIntermediateTensorInfo(oddImagInfo);\n cpuBackend.disposeIntermediateTensorInfo(oddTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo($evenRealInfo);\n cpuBackend.disposeIntermediateTensorInfo($evenImagInfo);\n cpuBackend.disposeIntermediateTensorInfo($evenTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo($oddRealInfo);\n cpuBackend.disposeIntermediateTensorInfo($oddImagInfo);\n cpuBackend.disposeIntermediateTensorInfo($oddTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo(eRealInfo);\n cpuBackend.disposeIntermediateTensorInfo(eImagInfo);\n cpuBackend.disposeIntermediateTensorInfo(complexInfo);\n cpuBackend.disposeIntermediateTensorInfo(exponentInfo);\n cpuBackend.disposeIntermediateTensorInfo(addPart);\n cpuBackend.disposeIntermediateTensorInfo(subPart);\n cpuBackend.disposeIntermediateTensorInfo(addPartReal);\n cpuBackend.disposeIntermediateTensorInfo(addPartImag);\n cpuBackend.disposeIntermediateTensorInfo(subPartReal);\n cpuBackend.disposeIntermediateTensorInfo(subPartImag);\n cpuBackend.disposeIntermediateTensorInfo($real);\n cpuBackend.disposeIntermediateTensorInfo($imag);\n return { real: $realVals, imag: $imagVals };\n}", "title": "" }, { "docid": "df26438394abb87969dc13a944eaf005", "score": "0.6398922", "text": "function fftRadix2(realVals, imagVals, size, inverse, cpuBackend) {\n if (size === 1) {\n return { real: realVals, imag: imagVals };\n }\n var data = tf.backend_util.mergeRealAndImagArrays(realVals, imagVals);\n var half = size / 2;\n var evenComplex = tf.backend_util.complexWithEvenIndex(data);\n var evenRealVals = evenComplex.real;\n var evenImagVals = evenComplex.imag;\n var evenShape = [evenRealVals.length];\n var evenRealInfo = cpuBackend.makeTensorInfo(evenShape, 'float32', evenRealVals);\n var evenImagInfo = cpuBackend.makeTensorInfo(evenShape, 'float32', evenImagVals);\n var evenTensorInfo = complex({ inputs: { real: evenRealInfo, imag: evenImagInfo }, backend: cpuBackend });\n var oddComplex = tf.backend_util.complexWithOddIndex(data);\n var oddRealVals = oddComplex.real;\n var oddImagVals = oddComplex.imag;\n var oddShape = [oddRealVals.length];\n var oddRealInfo = cpuBackend.makeTensorInfo(oddShape, 'float32', oddRealVals);\n var oddImagInfo = cpuBackend.makeTensorInfo(oddShape, 'float32', oddImagVals);\n var oddTensorInfo = complex({ inputs: { real: oddRealInfo, imag: oddImagInfo }, backend: cpuBackend });\n // Recursive call for half part of original input.\n var $evenComplex = fftRadix2(evenRealVals, evenImagVals, half, inverse, cpuBackend);\n var $evenRealVals = $evenComplex.real;\n var $evenImagVals = $evenComplex.imag;\n var $evenShape = [$evenRealVals.length];\n var $evenRealInfo = cpuBackend.makeTensorInfo($evenShape, 'float32', $evenRealVals);\n var $evenImagInfo = cpuBackend.makeTensorInfo($evenShape, 'float32', $evenImagVals);\n var $evenTensorInfo = complex({\n inputs: { real: $evenRealInfo, imag: $evenImagInfo },\n backend: cpuBackend\n });\n var $oddComplex = fftRadix2(oddRealVals, oddImagVals, half, inverse, cpuBackend);\n var $oddRealVals = $oddComplex.real;\n var $oddImagVals = $oddComplex.imag;\n var $oddShape = [$oddRealVals.length];\n var $oddRealInfo = cpuBackend.makeTensorInfo($oddShape, 'float32', $oddRealVals);\n var $oddImagInfo = cpuBackend.makeTensorInfo($oddShape, 'float32', $oddImagVals);\n var $oddTensorInfo = complex({ inputs: { real: $oddRealInfo, imag: $oddImagInfo }, backend: cpuBackend });\n var e = tf.backend_util.exponents(size, inverse);\n var eShape = [e.real.length];\n var eRealInfo = cpuBackend.makeTensorInfo(eShape, 'float32', e.real);\n var eImagInfo = cpuBackend.makeTensorInfo(eShape, 'float32', e.imag);\n var complexInfo = complex({ inputs: { real: eRealInfo, imag: eImagInfo }, backend: cpuBackend });\n var exponentInfo = multiply({ inputs: { a: complexInfo, b: $oddTensorInfo }, backend: cpuBackend });\n var addPart = add({\n inputs: { a: $evenTensorInfo, b: exponentInfo },\n backend: cpuBackend\n });\n var subPart = sub({\n inputs: { a: $evenTensorInfo, b: exponentInfo },\n backend: cpuBackend\n });\n var addPartReal = real({ inputs: { input: addPart }, backend: cpuBackend });\n var subPartReal = real({ inputs: { input: subPart }, backend: cpuBackend });\n var addPartImag = imag({ inputs: { input: addPart }, backend: cpuBackend });\n var subPartImag = imag({ inputs: { input: subPart }, backend: cpuBackend });\n var $real = concat({\n inputs: [addPartReal, subPartReal],\n backend: cpuBackend,\n attrs: { axis: 0 }\n });\n var $imag = concat({\n inputs: [addPartImag, subPartImag],\n backend: cpuBackend,\n attrs: { axis: 0 }\n });\n var $realVals = cpuBackend.data.get($real.dataId).values;\n var $imagVals = cpuBackend.data.get($imag.dataId).values;\n cpuBackend.disposeIntermediateTensorInfo(evenRealInfo);\n cpuBackend.disposeIntermediateTensorInfo(evenImagInfo);\n cpuBackend.disposeIntermediateTensorInfo(evenTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo(oddRealInfo);\n cpuBackend.disposeIntermediateTensorInfo(oddImagInfo);\n cpuBackend.disposeIntermediateTensorInfo(oddTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo($evenRealInfo);\n cpuBackend.disposeIntermediateTensorInfo($evenImagInfo);\n cpuBackend.disposeIntermediateTensorInfo($evenTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo($oddRealInfo);\n cpuBackend.disposeIntermediateTensorInfo($oddImagInfo);\n cpuBackend.disposeIntermediateTensorInfo($oddTensorInfo);\n cpuBackend.disposeIntermediateTensorInfo(eRealInfo);\n cpuBackend.disposeIntermediateTensorInfo(eImagInfo);\n cpuBackend.disposeIntermediateTensorInfo(complexInfo);\n cpuBackend.disposeIntermediateTensorInfo(exponentInfo);\n cpuBackend.disposeIntermediateTensorInfo(addPart);\n cpuBackend.disposeIntermediateTensorInfo(subPart);\n cpuBackend.disposeIntermediateTensorInfo(addPartReal);\n cpuBackend.disposeIntermediateTensorInfo(addPartImag);\n cpuBackend.disposeIntermediateTensorInfo(subPartReal);\n cpuBackend.disposeIntermediateTensorInfo(subPartImag);\n cpuBackend.disposeIntermediateTensorInfo($real);\n cpuBackend.disposeIntermediateTensorInfo($imag);\n return { real: $realVals, imag: $imagVals };\n}", "title": "" }, { "docid": "e13a57258b7b8c628d1f1c6363a89889", "score": "0.6379083", "text": "function fft(re, im, inv) {\n\t\t var d, h, ik, m, tmp, wr, wi, xr, xi,\n\t\t n4 = _n >> 2;\n\t\t // bit reversal\n\t\t for(var l=0; l<_n; l++) {\n\t\t m = _bitrev[l];\n\t\t if(l < m) {\n\t\t tmp = re[l];\n\t\t re[l] = re[m];\n\t\t re[m] = tmp;\n\t\t tmp = im[l];\n\t\t im[l] = im[m];\n\t\t im[m] = tmp;\n\t\t }\n\t\t }\n\t\t // butterfly operation\n\t\t //butfly(re,im,inv,n4);\n\t\t for(var k=1; k<_n; k<<=1) {\n\t\t h = 0;\n\t\t d = _n/(k << 1);\n\t\t for(var j=0; j<k; j++) {\n\t\t wr = _cstb[h + n4];\n\t\t wi = inv*_cstb[h];\n\t\t for(var i=j; i<_n; i+=(k<<1)) {\n\t\t ik = i + k;\n\t\t xr = wr*re[ik] + wi*im[ik];\n\t\t xi = wr*im[ik] - wi*re[ik];\n\t\t re[ik] = re[i] - xr;\n\t\t re[i] += xr;\n\t\t im[ik] = im[i] - xi;\n\t\t im[i] += xi;\n\t\t }\n\t\t h += d;\n\t\t }\n\t\t }\n\t\t }", "title": "" }, { "docid": "2d7499608afdbc9171f61966632df841", "score": "0.6373636", "text": "function fft(re, im, inv) {\n\t\t var d, h, ik, m, tmp, wr, wi, xr, xi,\n\t\t n4 = _n >> 2;\n\t\t // bit reversal\n\t\t for(var l=0; l<_n; l++) {\n\t\t m = _bitrev[l];\n\t\t if(l < m) {\n\t\t tmp = re[l];\n\t\t re[l] = re[m];\n\t\t re[m] = tmp;\n\t\t tmp = im[l];\n\t\t im[l] = im[m];\n\t\t im[m] = tmp;\n\t\t }\n\t\t }\n\t\t // butterfly operation\n\t\t for(var k=1; k<_n; k<<=1) {\n\t\t h = 0;\n\t\t d = _n/(k << 1);\n\t\t for(var j=0; j<k; j++) {\n\t\t wr = _cstb[h + n4];\n\t\t wi = inv*_cstb[h];\n\t\t for(var i=j; i<_n; i+=(k<<1)) {\n\t\t ik = i + k;\n\t\t xr = wr*re[ik] + wi*im[ik];\n\t\t xi = wr*im[ik] - wi*re[ik];\n\t\t re[ik] = re[i] - xr;\n\t\t re[i] += xr;\n\t\t im[ik] = im[i] - xi;\n\t\t im[i] += xi;\n\t\t }\n\t\t h += d;\n\t\t }\n\t\t }\n\t\t }", "title": "" }, { "docid": "bca33bc3fc5ab53299421ed9c61fd088", "score": "0.632116", "text": "fftRadix2(input, size, inverse) {\n if (size === 1) {\n return input;\n }\n\n const data = this.readSync(input.dataId);\n const half = size / 2;\n const evenComplex = tf.backend_util.complexWithEvenIndex(data);\n let evenTensor = tf.complex(evenComplex.real, evenComplex.imag).as1D();\n const oddComplex = tf.backend_util.complexWithOddIndex(data);\n let oddTensor = tf.complex(oddComplex.real, oddComplex.imag).as1D(); // Recursive call for half part of original input.\n\n evenTensor = this.fftRadix2(evenTensor, half, inverse);\n oddTensor = this.fftRadix2(oddTensor, half, inverse);\n const e = tf.backend_util.exponents(size, inverse);\n const exponent = tf.complex(e.real, e.imag).mul(oddTensor);\n const addPart = evenTensor.add(exponent);\n const subPart = evenTensor.sub(exponent);\n const realTensor = tf.real(addPart).concat(tf.real(subPart));\n const imagTensor = tf.imag(addPart).concat(tf.imag(subPart));\n return tf.complex(realTensor, imagTensor).as1D();\n }", "title": "" }, { "docid": "65fac16b8e0c700d8512492e77b33c6d", "score": "0.6292548", "text": "function fft(re, im, inv) {\r\n var d, h, ik, m, tmp, wr, wi, xr, xi,\r\n n4 = _n >> 2;\r\n // bit reversal\r\n for(var l=0; l<_n; l++) {\r\n m = _bitrev[l];\r\n if(l < m) {\r\n tmp = re[l];\r\n re[l] = re[m];\r\n re[m] = tmp;\r\n tmp = im[l];\r\n im[l] = im[m];\r\n im[m] = tmp;\r\n }\r\n }\r\n // butterfly operation\r\n for(var k=1; k<_n; k<<=1) {\r\n h = 0;\r\n d = _n/(k << 1);\r\n for(var j=0; j<k; j++) {\r\n wr = _cstb[h + n4];\r\n wi = inv*_cstb[h];\r\n for(var i=j; i<_n; i+=(k<<1)) {\r\n ik = i + k;\r\n xr = wr*re[ik] + wi*im[ik];\r\n xi = wr*im[ik] - wi*re[ik];\r\n re[ik] = re[i] - xr;\r\n re[i] += xr;\r\n im[ik] = im[i] - xi;\r\n im[i] += xi;\r\n }\r\n h += d;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "4cfddc15914bdc0b093842a5df8a7d0d", "score": "0.6282382", "text": "function fft(re, im, inv) {\n var d, h, ik, m, tmp, wr, wi, xr, xi,\n n4 = _n >> 2;\n // bit reversal\n for(var l=0; l<_n; l++) {\n m = _bitrev[l];\n if(l < m) {\n tmp = re[l];\n re[l] = re[m];\n re[m] = tmp;\n tmp = im[l];\n im[l] = im[m];\n im[m] = tmp;\n }\n }\n // butterfly operation\n for(var k=1; k<_n; k<<=1) {\n h = 0;\n d = _n/(k << 1);\n for(var j=0; j<k; j++) {\n wr = _cstb[h + n4];\n wi = inv*_cstb[h];\n for(var i=j; i<_n; i+=(k<<1)) {\n ik = i + k;\n xr = wr*re[ik] + wi*im[ik];\n xi = wr*im[ik] - wi*re[ik];\n re[ik] = re[i] - xr;\n re[i] += xr;\n im[ik] = im[i] - xi;\n im[i] += xi;\n }\n h += d;\n }\n }\n }", "title": "" }, { "docid": "f4e55db5fb6248849841c874c56ae7a0", "score": "0.62335104", "text": "function fft(re, im, inv) {\n\t var d, h, ik, m, tmp, wr, wi, xr, xi,\n\t n4 = _n >> 2;\n\t // bit reversal\n\t for(var l=0; l<_n; l++) {\n\t m = _bitrev[l];\n\t if(l < m) {\n\t tmp = re[l];\n\t re[l] = re[m];\n\t re[m] = tmp;\n\t tmp = im[l];\n\t im[l] = im[m];\n\t im[m] = tmp;\n\t }\n\t }\n\t // butterfly operation\n\t for(var k=1; k<_n; k<<=1) {\n\t h = 0;\n\t d = _n/(k << 1);\n\t for(var j=0; j<k; j++) {\n\t wr = _cstb[h + n4];\n\t wi = inv*_cstb[h];\n\t for(var i=j; i<_n; i+=(k<<1)) {\n\t ik = i + k;\n\t xr = wr*re[ik] + wi*im[ik];\n\t xi = wr*im[ik] - wi*re[ik];\n\t re[ik] = re[i] - xr;\n\t re[i] += xr;\n\t im[ik] = im[i] - xi;\n\t im[i] += xi;\n\t }\n\t h += d;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "f18f678ed24e11e6c3cb171b784060ab", "score": "0.6219635", "text": "function fft(re, im, inv) {\n var d, h, ik, m, tmp, wr, wi, xr, xi,\n n4 = _n >> 2;\n // bit reversal\n for(var l=0; l<_n; l++) {\n m = _bitrev[l];\n if(l < m) {\n tmp = re[l];\n re[l] = re[m];\n re[m] = tmp;\n tmp = im[l];\n im[l] = im[m];\n im[m] = tmp;\n }\n }\n // butterfly operation\n //butfly(re,im,inv,n4);\n for(var k=1; k<_n; k<<=1) {\n h = 0;\n d = _n/(k << 1);\n for(var j=0; j<k; j++) {\n wr = _cstb[h + n4];\n wi = inv*_cstb[h];\n for(var i=j; i<_n; i+=(k<<1)) {\n ik = i + k;\n xr = wr*re[ik] + wi*im[ik];\n xi = wr*im[ik] - wi*re[ik];\n re[ik] = re[i] - xr;\n re[i] += xr;\n im[ik] = im[i] - xi;\n im[i] += xi;\n }\n h += d;\n }\n }\n }", "title": "" }, { "docid": "f3ecde4fb2bc282188ecf20345cacb69", "score": "0.61776185", "text": "function fourier(waveform, frequenciesR, frequenciesI) {\n var timeScale = 1.0 / waveform.length\n for(var k = 0; k < frequenciesR.length; ++k) {\n var realF = 0;\n var imagF = 0;\n for(var n = 0; n < waveform.length; ++n) {\n var v = (waveform[n] / 128.0) - 1; // scale and unbias\n var theta = 2 * Math.PI * n * k * timeScale;\n realF += v * Math.cos(theta);\n imagF -= v * Math.sin(theta);\n }\n frequenciesR[k] = realF;\n frequenciesI[k] = imagF;\n }\n}", "title": "" }, { "docid": "145bb29bc8afb7607100e5f8a073ab5b", "score": "0.6166561", "text": "function fftn(dir, x, y) {\n //First, handle easy cases\n var n = dimension(x);\n switch(n) {\n case 0:\n return;\n case 1:\n return fft(dir, bits.log2(x.length), x, y);\n case 2:\n return fft2(dir, bits.log2(x[0].length), bits.log2(x.length), x, y);\n case 3:\n return fft3(dir, bits.log2(x[0][0].length), bits.log2(x[0].length), bits.log2(x.length), x, y);\n default:\n break;\n }\n //Slow/unusual case: Handle higher dimensions\n for(var i=0; i<x.length; ++i) {\n fftn(dir, x[i], y[i]);\n }\n realloc(x.length);\n fft_sweep(dir, 0, new Array(n), x, y);\n}", "title": "" }, { "docid": "28e27cf64efdc67fe192503d53c3828d", "score": "0.6162434", "text": "function FourierTransform(bufferSize, sampleRate) {\n this.bufferSize = bufferSize;\n this.sampleRate = sampleRate;\n this.bandwidth = 2 / bufferSize * sampleRate / 2;\n\n this.spectrum = new Float32Array(bufferSize/2);\n this.real = new Float32Array(bufferSize);\n this.imag = new Float32Array(bufferSize);\n\n this.peakBand = 0;\n this.peak = 0;\n\n /**\n * Calculates the *middle* frequency of an FFT band.\n *\n * @param {Number} index The index of the FFT band.\n *\n * @returns The middle frequency in Hz.\n */\n this.getBandFrequency = function(index) {\n return this.bandwidth * index + this.bandwidth / 2;\n };\n\n this.calculateSpectrum = function() {\n var spectrum = this.spectrum,\n real = this.real,\n imag = this.imag,\n bSi = 2 / this.bufferSize,\n sqrt = Math.sqrt,\n rval,\n ival,\n mag;\n\n for (var i = 0, N = bufferSize/2; i < N; i++) {\n rval = real[i];\n ival = imag[i];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n };\n}", "title": "" }, { "docid": "92bb612571205f697cffa15655d78e76", "score": "0.6097159", "text": "function fft(re, im, inv) {\n\t\t\tvar d, h, ik, m, tmp, wr, wi, xr, xi,\n\t\t\t\tn4 = _n >> 2;\n\t\t\t// bit reversal\n\t\t\tfor(var l=0; l<_n; l++) {\n\t\t\t\tm = _bitrev[l];\n\t\t\t\tif(l < m) {\n\t\t\t\t\ttmp = re[l];\n\t\t\t\t\tre[l] = re[m];\n\t\t\t\t\tre[m] = tmp;\n\t\t\t\t\ttmp = im[l];\n\t\t\t\t\tim[l] = im[m];\n\t\t\t\t\tim[m] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// butterfly operation\n\t\t\t//butfly(re,im,inv,n4);\n\t\t\tfor(var k=1; k<_n; k<<=1) {\n\t\t\t\th = 0;\n\t\t\t\td = _n/(k << 1);\n\t\t\t\tfor(var j=0; j<k; j++) {\n\t\t\t\t\twr = _cstb[h + n4];\n\t\t\t\t\twi = inv*_cstb[h];\n\t\t\t\t\tfor(var i=j; i<_n; i+=(k<<1)) {\n\t\t\t\t\t\tik = i + k;\n\t\t\t\t\t\txr = wr*re[ik] + wi*im[ik];\n\t\t\t\t\t\txi = wr*im[ik] - wi*re[ik];\n\t\t\t\t\t\tre[ik] = re[i] - xr;\n\t\t\t\t\t\tre[i] += xr;\n\t\t\t\t\t\tim[ik] = im[i] - xi;\n\t\t\t\t\t\tim[i] += xi;\n\t\t\t\t\t}\n\t\t\t\t\th += d;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "658b9fb12e4521a8beaf67419ceb947d", "score": "0.60921085", "text": "function FourierTransform(bufferSize, sampleRate) {\n this.bufferSize = bufferSize;\n this.sampleRate = sampleRate;\n this.bandwidth = 2 / bufferSize * sampleRate / 2;\n\n this.spectrum = new Float32Array(bufferSize/2);\n this.real = new Float32Array(bufferSize);\n this.imag = new Float32Array(bufferSize);\n\n this.peakBand = 0;\n this.peak = 0;\n\n /**\n * Calculates the *middle* frequency of an FFT band.\n *\n * @param {Number} index The index of the FFT band.\n *\n * @returns The middle frequency in Hz.\n */\n this.getBandFrequency = function(index) {\n return this.bandwidth * index + this.bandwidth / 2;\n };\n\n this.calculateSpectrum = function() {\n var spectrum = this.spectrum,\n real = this.real,\n imag = this.imag,\n bSi = 2 / this.bufferSize,\n sqrt = Math.sqrt,\n rval, \n ival,\n mag;\n\n for (var i = 0, N = bufferSize/2; i < N; i++) {\n rval = real[i];\n ival = imag[i];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n };\n}", "title": "" }, { "docid": "658b9fb12e4521a8beaf67419ceb947d", "score": "0.60921085", "text": "function FourierTransform(bufferSize, sampleRate) {\n this.bufferSize = bufferSize;\n this.sampleRate = sampleRate;\n this.bandwidth = 2 / bufferSize * sampleRate / 2;\n\n this.spectrum = new Float32Array(bufferSize/2);\n this.real = new Float32Array(bufferSize);\n this.imag = new Float32Array(bufferSize);\n\n this.peakBand = 0;\n this.peak = 0;\n\n /**\n * Calculates the *middle* frequency of an FFT band.\n *\n * @param {Number} index The index of the FFT band.\n *\n * @returns The middle frequency in Hz.\n */\n this.getBandFrequency = function(index) {\n return this.bandwidth * index + this.bandwidth / 2;\n };\n\n this.calculateSpectrum = function() {\n var spectrum = this.spectrum,\n real = this.real,\n imag = this.imag,\n bSi = 2 / this.bufferSize,\n sqrt = Math.sqrt,\n rval, \n ival,\n mag;\n\n for (var i = 0, N = bufferSize/2; i < N; i++) {\n rval = real[i];\n ival = imag[i];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n };\n}", "title": "" }, { "docid": "09456995ddcb5cf2b56b19a16e5e5812", "score": "0.6083452", "text": "static fft(y) {\r\n const fftr = new __WEBPACK_IMPORTED_MODULE_0_kissfft_js__[\"FFTR\"](y.length);\r\n const transform = fftr.forward(y);\r\n fftr.dispose();\r\n return transform;\r\n }", "title": "" }, { "docid": "4822b4e33cf50ced6a53c0163ad287f8", "score": "0.6065181", "text": "function fft2(dir, m, n, x, y) {\n realloc(x.length);\n for(var i=0; i<x.length; ++i) {\n fft(dir, m, x[i], y[i]);\n }\n for(var j=0; j<x[0].length; ++j) {\n for(var i=0; i<x.length; ++i) {\n x0[i] = x[i][j];\n y0[i] = y[i][j];\n }\n fft(dir, n, x0, y0);\n for(var i=0; i<x.length; ++i) {\n x[i][j] = x0[i];\n y[i][j] = y0[i];\n }\n }\n}", "title": "" }, { "docid": "96964c9ec9697bcec960fbe2f4fea388", "score": "0.60503393", "text": "function FftNayuki(n) {\n\n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new Array(n / 2);\n this.sinTable = new Array(n / 2);\n\n for (var i = 0; i < n / 2; i++) {\n this.cosTable[i] = Math.cos(2 * Math.PI * i / n);\n this.sinTable[i] = Math.sin(2 * Math.PI * i / n);\n }\n\n /*\n * Computes the discrete Fourier transform (DFT) of the given complex vector,\n * storing the result back into the vector.\n * The vector's length must be equal to the size n that was passed to the\n * object constructor, and this must be a power of 2. Uses the Cooley-Tukey\n * decimation-in-time radix-2 algorithm.\n *\n * @private\n */\n this.forward = function (real, imag) {\n var n = this.n;\n\n // Bit-reversed addressing permutation\n for (var i = 0; i < n; i++) {\n var j = reverseBits(i, this.levels);\n\n if (j > i) {\n var temp = real[i];\n real[i] = real[j];\n real[j] = temp;\n temp = imag[i];\n imag[i] = imag[j];\n imag[j] = temp;\n }\n }\n\n // Cooley-Tukey decimation-in-time radix-2 Fft\n for (var size = 2; size <= n; size *= 2) {\n var halfsize = size / 2;\n var tablestep = n / size;\n\n for (var i = 0; i < n; i += size) {\n for (var j = i, k = 0; j < i + halfsize; j++, k += tablestep) {\n var tpre = real[j + halfsize] * this.cosTable[k] + imag[j + halfsize] * this.sinTable[k];\n var tpim = -real[j + halfsize] * this.sinTable[k] + imag[j + halfsize] * this.cosTable[k];\n real[j + halfsize] = real[j] - tpre;\n imag[j + halfsize] = imag[j] - tpim;\n real[j] += tpre;\n imag[j] += tpim;\n }\n }\n }\n\n // Returns the integer whose value is the reverse of the lowest 'bits'\n // bits of the integer 'x'.\n function reverseBits(x, bits) {\n var y = 0;\n\n for (var i = 0; i < bits; i++) {\n y = y << 1 | x & 1;\n x >>>= 1;\n }\n\n return y;\n }\n };\n\n /*\n * Computes the inverse discrete Fourier transform (IDFT) of the given complex\n * vector, storing the result back into the vector.\n * The vector's length must be equal to the size n that was passed to the\n * object constructor, and this must be a power of 2. This is a wrapper\n * function. This transform does not perform scaling, so the inverse is not\n * a true inverse.\n *\n * @private\n */\n this.inverse = function (real, imag) {\n forward(imag, real);\n };\n}", "title": "" }, { "docid": "0f0c1d379bcc25683c8a9c83dab12252", "score": "0.58774215", "text": "function mapFreq(i){\n var freq = i * SAMPLE_RATE / FFT_SIZE;\n return freq;\n}", "title": "" }, { "docid": "9790f784326bf8a585a663f234528a95", "score": "0.585163", "text": "function FFT(signal, len, freq, sr){ //Extract a particular frequency\n var real = 0;\n var imag = 0;\n var _len = 1/len;\n var shared = 6.28318530718*freq*_len;\n\n var skip = 1;\n var N = 0;\n var factor = sr*.25;\n if(freq <= factor){\n while(freq <= factor){\n factor=factor*.5;\n skip+=1;\n }\n }\n\n for(var i = 0; i<len; i+=skip){\n var j = i;\n if(j > len) { j = len; }\n var sharedi = shared*j; //this.thread.x is the target frequency\n real = real+signal[j]*Math.cos(sharedi);\n imag = imag-signal[j]*Math.sin(sharedi);\n N += 1;\n }\n //var mag = Math.sqrt(real[k]*real[k]+imag[k]*imag[k]);\n return [real/N,imag/N]; //mag(real,imag)\n}", "title": "" }, { "docid": "0868d1a632ee2bed912903e566ff0221", "score": "0.573412", "text": "fftBatch(x, inverse) {\n const batch = x.shape[0];\n const innerDim = x.shape[1]; // Collects real and imaginary values separately.\n\n const realResult = tf.buffer(x.shape, 'float32');\n const imagResult = tf.buffer(x.shape, 'float32');\n const real = tf.real(x).as2D(batch, innerDim);\n const imag = tf.imag(x).as2D(batch, innerDim);\n\n for (let b = 0; b < batch; b++) {\n // TODO: Support slice ops for complex type.\n const r = real.slice([b, 0], [1, innerDim]);\n const i = imag.slice([b, 0], [1, innerDim]);\n const input = tf.complex(r, i); // Run FFT by batch element.\n\n const res = this.readSync(this.fftImpl(input, inverse).dataId);\n\n for (let d = 0; d < innerDim; d++) {\n const c = tf.backend_util.getComplexWithIndex(res, d);\n realResult.values[b * innerDim + d] = c.real;\n imagResult.values[b * innerDim + d] = c.imag;\n }\n }\n\n const t = tf.complex(realResult.toTensor(), imagResult.toTensor());\n return t.as2D(batch, innerDim);\n }", "title": "" }, { "docid": "d082fb9cfd08c3a249c4be8a0fcb6858", "score": "0.57319", "text": "function ifft(amplitude, frequency, phase = 0, fftRealPart = 0, fftImagPart = 0, ignoreImagAmplitudesLowerThan = 1e-3) {\n\t//Create an object that contains all data about the signal\n\tlet data = {\n\t\t//Time domain data\n\t\ttime: {\n\t\t\treal: [], //Real part\n\t\t\trealPart: [], //Real part\n\t\t\timag: [], //Imaginary part\n\t\t\timagPart: [], //Imaginary part\n\t\t\ttime: [] //Time axis\n\t\t},\n\t\t//Frequency domain data\n\t\tfrequency: {\n\t\t\treal: [], //FFT real part\n\t\t\trealPart: [], //FFT real part\n\t\t\timag: [], //FFT imaginary part\n\t\t\timagPart: [], //FFT imaginary part\n\t\t\tamplitude: amplitude, //Amplitude module\n\t\t\tphase: [], //Phase [rad]\n\t\t\tfrequency: frequency //Frequency axis\n\t\t},\n\t\tfs: 0, //Sample rate\n\t\tsamplingTime: 0 //Sampling time\n\t}\n\n\t//Calculate the sampling time and the sample rate\n\tdata.samplingTime = 1 / (Math.abs(frequency[1] - frequency[0]));\n\tdata.fs = 2 * frequency.map(Math.abs).reduce(function (a, b) {\n\t\treturn Math.max(a, b)\n\t});\n\n\t//Generate the time axis\n\tfor (let i = 0; i < data.samplingTime * data.fs; i++) {\n\t\tdata.time.time[i] = i / data.fs;\n\t}\n\n\t//If no phase has been passed\n\tif (typeof phase.length == 'undefined') {\n\t\t//Create an empty phase array\n\t\tdata.frequency.phase = newArrayOfZeros(amplitude.length);\n\t} else {\n\t\t//Otherwise store it\n\t\tdata.frequency.phase = phase;\n\t}\n\n\t//If no real and imaginary part has been passed\n\tif (typeof fftRealPart.length == 'undefined' && typeof fftImagPart.length == 'undefined') {\n\t\t//Calculate them\n\t\tfor (let i = 0; i < data.frequency.amplitude.length; i++) {\n\t\t\tdata.frequency.realPart[i] = (data.frequency.amplitude[i] * data.frequency.amplitude.length) / (2 * Math.sqrt(1 + Math.pow(Math.tan(data.frequency.phase[i]), 2)));\n\t\t\tdata.frequency.imagPart[i] = data.frequency.realPart[i] * Math.tan(data.frequency.phase[i]);\n\t\t}\n\t} else {\n\t\t//Otherwise store it without address association\n\t\tdata.frequency.realPart = fftRealPart.map(function (num) {\n\t\t\treturn num;\n\t\t});\n\t\tdata.frequency.imagPart = fftImagPart.map(function (num) {\n\t\t\treturn num;\n\t\t});\n\t}\n\n\t//Auxiliaries variables for FFT processing without address association\n\tlet auxReal = data.frequency.realPart.map(function (num) {\n\t\treturn num;\n\t});\n\tlet auxImag = data.frequency.imagPart.map(function (num) {\n\t\treturn num;\n\t});\n\n\t//Perform the inverse transform\n\t[data.time.imagPart, data.time.realPart] = inverseTransform(auxReal, auxImag);\n\n\t//Remove amplitude values under 10^-3 (default) and, thus, it's respective phase values\n\tfor (let i = 0; i < data.time.imagPart.length; i++) {\n\t\tif (data.time.imagPart[i] < ignoreImagAmplitudesLowerThan) {\n\t\t\tdata.time.imagPart[i] = 0;\n\t\t}\n\t}\n\n\t//Return the whole thing\n\tdata.time.real = data.time.realPart;\n data.time.imag = data.time.imagPart;\n\tdata.frequency.real = data.frequency.realPart;\n data.frequency.imag = data.frequency.imagPart;\n\treturn data;\n\n}", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "762899bdb1ce5f827b31e4a4677927ac", "score": "0.57270014", "text": "function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" } ]
08de058a97627e2f1a64ac7040c486b7
Note: Although Firefox >= 57 has a native implementation, the maximum message size can be reset for all data channels at a later stage. See:
[ { "docid": "572cfa67e5ae58be8650eb01b2848316", "score": "0.5218203", "text": "function wrapDcSend(dc, pc) {\n var origDataChannelSend = dc.send;\n dc.send = function() {\n var data = arguments[0];\n var length = data.length || data.size || data.byteLength;\n if (dc.readyState === 'open' &&\n pc.sctp && length > pc.sctp.maxMessageSize) {\n throw new TypeError('Message too large (can send a maximum of ' +\n pc.sctp.maxMessageSize + ' bytes)');\n }\n return origDataChannelSend.apply(dc, arguments);\n };\n }", "title": "" } ]
[ { "docid": "ffdcc35fd61ca6dfb35040b643f7d0f8", "score": "0.71868974", "text": "function getMaxMessageSize() {\r\n\treturn 700;\r\n}", "title": "" }, { "docid": "952e0423865d8e6ed16367c80402442f", "score": "0.6826522", "text": "function calculate_payload_size( channel, message ) {\n return encodeURIComponent(\n channel + JSON.stringify(message)\n ).length + 100;\n}", "title": "" }, { "docid": "6ff1a33770cffa757fd97c539e521df2", "score": "0.6353997", "text": "static get MAX_BUFFER_LENGTH() {\n return clarinet.MAX_BUFFER_LENGTH;\n }", "title": "" }, { "docid": "cfd7990788860451bec0e0f58c414a00", "score": "0.62318206", "text": "function kMaxLength () {\n return Buffer$1.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}", "title": "" }, { "docid": "28753441a81f79c69c74f0faabdd69dc", "score": "0.6097813", "text": "function setMaxBufferSize(value) {\n if (!Number.isFinite(value) || value <= 0) {\n throw new Error(`max buffer size must be a positive number.`);\n }\n maxBufferSize = value;\n}", "title": "" }, { "docid": "5e686c362db6be2870d706ce4b713494", "score": "0.60646135", "text": "function validateMessageSize(value, currentSize) {\r\n if (!isNullOrUndefined(value) && propertyMap.maxMessageSize) {\r\n if (typeof value == 'object') value = JSON.stringify(value);\r\n\r\n // Use simple approximation: string.length. Ideally we would convert to UTF8 and checked the # of bytes, \r\n // but JavaScript doesn't have built-in support for UTF8 and it would have greater perf impact.\r\n currentSize += value.toString().length;\r\n if (currentSize > propertyMap.maxMessageSize) {\r\n throw new Error(StatusCodes.REQUEST_ENTITY_TOO_LARGE, errorMessages.messageSizeTooLarge);\r\n }\r\n }\r\n return currentSize;\r\n }", "title": "" }, { "docid": "14b7abb0f0cb90558d27656c413e40f3", "score": "0.60179126", "text": "getPayloadLength64 () {\n const buf = this.consume(8);\n if (buf === null) return;\n\n const num = buf.readUInt32BE(0, true);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this.error(\n new RangeError(\n 'Unsupported WebSocket frame: payload length > 2^53 - 1'\n ),\n 1009\n );\n return;\n }\n\n this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4, true);\n this.haveLength();\n }", "title": "" }, { "docid": "1a20defdd215c76c0bec035a946ae9f0", "score": "0.5959247", "text": "function Messages(maxSize){\n this.maxSize = maxSize;\n this.messages = [];\n }", "title": "" }, { "docid": "3c60518f578a228331a07f6d15189898", "score": "0.59421605", "text": "function createMessageQueue(completeMessageCallback, everyMessageCallback) {\r\n var receiveBuffer = {}; //this is the global buffer object that will receive and assemble message chunks.\r\n var receiveMessage = function(message) {\r\n\r\n console.log(\"Got message!\", message);\r\n \r\n //see if its an array buffer\r\n if (message && message instanceof ArrayBuffer && message.byteLength !== undefined) {\r\n //pull out the header info\r\n var header = new Uint32Array(message, 0, 4);\r\n var messageNumber = header[0]; // unique number for the whole message\r\n var dataSize = header[1]; //data size in bytes\r\n var chunkSize = header[2];\r\n var chunkNumber = header[3]; //which chunk did we receive?\r\n \r\n //see if we should re-initialize the receive buffer\r\n if (receiveBuffer.messageNumber != messageNumber) {\r\n receiveBuffer.messageNumber = messageNumber;\r\n\r\n var additionalSize = (Math.ceil(dataSize / chunkSize) + 4) * 4 * 4;\r\n var bufferSize = 4*Math.ceil(dataSize/4) + additionalSize;\r\n var chunkCount = Math.ceil((dataSize + additionalSize) / chunkSize);\r\n receiveBuffer.buffer = new ArrayBuffer(bufferSize); \r\n receiveBuffer.chunkCount = chunkCount;\r\n receiveBuffer.chunksReceived = 0;\r\n receiveBuffer.byteView = new Uint8Array(receiveBuffer.buffer);\r\n }\r\n \r\n //now copy the data to the receive buffer\r\n \r\n //see what the max length can be\r\n \r\n var bufferLength = receiveBuffer.buffer.byteLength;\r\n var start = chunkNumber*chunkSize;\r\n var maxLength = bufferLength - start;\r\n if (maxLength > message.byteLength) {maxLength = message.byteLength;}\r\n \r\n var data = new Uint8Array(message,0,maxLength);\r\n \r\n //document.getElementById(\"lastMessage\").innerText += \"Array! \" + performance.now() + \" \" + message.byteLength + \" \" + messageNumber + \" \" + chunkNumber + \"\\n\"; \r\n \r\n receiveBuffer.byteView.set(data,chunkNumber*chunkSize);\r\n receiveBuffer.chunksReceived++; \r\n \r\n if (receiveBuffer.chunksReceived == receiveBuffer.chunkCount) {\r\n //console.log(\"Got entire buffer!\");\r\n //reassembleBuffer(globalReceiveBuffer.buffer);\r\n //var result = unpackAllValues(globalReceiveBuffer.buffer);\r\n //debugger;\r\n reassembleBuffer(receiveBuffer.buffer);\r\n completeMessageCallback(receiveBuffer.buffer);\r\n }\r\n \r\n }\r\n else {\r\n if (typeof everyMessageCallback == \"function\") {\r\n everyMessageCallback(message);\r\n }\r\n //document.getElementById(\"lastMessage\").innerText = message;\r\n }\r\n };\r\n\r\n return({receiveBuffer: receiveBuffer, receiveMessage: receiveMessage});\r\n}", "title": "" }, { "docid": "9269275419eb3c2c97f58d1bde5adfd5", "score": "0.5942091", "text": "get maxLength() {\n if (!this.hasAttributeNS(null, \"maxlength\")) {\n return 524288; // stole this from chrome\n }\n return parseInt(this.getAttributeNS(null, \"maxlength\"));\n }", "title": "" }, { "docid": "1bd31cafbfbddcbeba81e33517c4ae1e", "score": "0.5885775", "text": "function do_recv() {\n\t\tconsole.log(\">> do_recv\");\n\t\tif(ws.rQlen() >= 1024) {\n\t\t\tmoreMsgs = true;\n\t\t} else {\n\t\t\tmoreMsgs = false;\n\t\t}\n\t\tvar arr = ws.rQshiftBytes(ws.rQlen()), chr;\n\t\twhile (arr.length > 0) {\n\t\t\tchr = arr.shift();\n\t\t\tlargeMsg += String.fromCharCode(chr); \n\t\t}\n\t\tif (!moreMsgs) {\n\t\t\tconsole.log(\"<< do_recv = \" + largeMsg);\n\t\t\trecvCallback(largeMsg);\n\t\t\tlargeMsg = \"\";\n\t\t}\n\t}", "title": "" }, { "docid": "a890018982948e385e7ebc8afda0db32", "score": "0.5880224", "text": "getPayloadLength64 () {\n\t if (!this.hasBufferedBytes(8)) return;\n\n\t const buf = this.readBuffer(8);\n\t const num = buf.readUInt32BE(0, true);\n\n\t //\n\t // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n\t // if payload length is greater than this number.\n\t //\n\t if (num > Math.pow(2, 53 - 32) - 1) {\n\t this.error(new Error('max payload size exceeded'), 1009);\n\t return;\n\t }\n\n\t this.payloadLength = (num * Math.pow(2, 32)) + buf.readUInt32BE(4, true);\n\t this.haveLength();\n\t }", "title": "" }, { "docid": "ee911504923216eb9fd7289ff6409bae", "score": "0.58752316", "text": "getPayloadLength64 () {\n\t if (!this.hasBufferedBytes(8)) return;\n\n\t const buf = this.readBuffer(8);\n\t const num = buf.readUInt32BE(0, true);\n\n\t //\n\t // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n\t // if payload length is greater than this number.\n\t //\n\t if (num > Math.pow(2, 53 - 32) - 1) {\n\t this.error(new Error('max payload size exceeded'), 1009);\n\t return;\n\t }\n\n\t this._payloadLength = (num * Math.pow(2, 32)) + buf.readUInt32BE(4, true);\n\t this.haveLength();\n\t }", "title": "" }, { "docid": "2de049ea555b591b8605e465e5b39d38", "score": "0.5810437", "text": "function xqserver_msgadd_invaliddata_v2(){\r\n\tif (g_dw0QTypeMaxDataSize>0x00005000){\r\n\t\tDebugPrint(ERROR,\"QType MaxDataSize Too Big; ABORTING TEST\");\r\n\t\tFAIL();\r\n\t}//endif\r\n\tsetup(g_qwUserId);\r\n\tvar bstrData=\"\";\r\n\tfor (i=0; i<g_dw0QTypeMaxDataSize+5; i++){\r\n\t\tbstrData+=String.fromCharCode(i);\r\n\t}//endfor\r\n\tengine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(g_qwUserId),1,g_dw0QType,bstrData,g_dw0QTypeMaxDataSize+5);\r\n\tExpectedState(engine,DISCONNECTED);\r\n}//endmethod", "title": "" }, { "docid": "907e37272638a13f871c67043f87b052", "score": "0.5807155", "text": "getPayloadLength64 () {\n if (!this.hasBufferedBytes(8)) return;\n\n const buf = this.readBuffer(8);\n const num = buf.readUInt32BE(0, true);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this.error(new Error('max payload size exceeded'), 1009);\n return;\n }\n\n this.payloadLength = (num * Math.pow(2, 32)) + buf.readUInt32BE(4, true);\n this.haveLength();\n }", "title": "" }, { "docid": "de53eb7797ef8175dcdc68dc7314b5c6", "score": "0.5801282", "text": "getPayloadLength64 () {\n if (!this.hasBufferedBytes(8)) return;\n\n const buf = this.readBuffer(8);\n const num = buf.readUInt32BE(0, true);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this.error(new Error('max payload size exceeded'), 1009);\n return;\n }\n\n this._payloadLength = (num * Math.pow(2, 32)) + buf.readUInt32BE(4, true);\n this.haveLength();\n }", "title": "" }, { "docid": "93073ea2836513b6212c61913fc7f90a", "score": "0.57490575", "text": "_grow(numBytes) {\n const remainder = numBytes % constants.BUFFER_CHUNK_SIZE;\n if (remainder > 0) {\n numBytes += (constants.BUFFER_CHUNK_SIZE - remainder);\n }\n const buf = Buffer.alloc(numBytes);\n this.buf.copy(buf);\n this.buf = buf;\n this.maxSize = this.size = numBytes;\n }", "title": "" }, { "docid": "df2fe55ee4254fadfc32b94955bef8b7", "score": "0.57462525", "text": "serializeLen() {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n\n let proxyResult;\n proxyResult = Module._vscr_ratchet_message_serialize_len(this.ctxPtr);\n return proxyResult;\n }", "title": "" }, { "docid": "0b4b3f82224024176856d4c5efa672b6", "score": "0.5742786", "text": "maxSize()\r\n {\r\n return this.#size;\r\n }", "title": "" }, { "docid": "293ad932ca288e3d4403db9c3806cf20", "score": "0.5736456", "text": "function readByte () {\n reader.read(1, (err, byte) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize.push(byte)\n\n if (byte && !isEndByte(byte[0])) {\n readByte()\n return\n }\n\n const msgSize = varint.decode(Buffer.concat(rawMsgSize))\n if (msgSize > maxLength) {\n return cb('size longer than max permitted length of ' + maxLength + '!')\n }\n readMessage(reader, msgSize, (err, msg) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize = []\n\n cb(null, msg)\n })\n })\n }", "title": "" }, { "docid": "293ad932ca288e3d4403db9c3806cf20", "score": "0.5736456", "text": "function readByte () {\n reader.read(1, (err, byte) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize.push(byte)\n\n if (byte && !isEndByte(byte[0])) {\n readByte()\n return\n }\n\n const msgSize = varint.decode(Buffer.concat(rawMsgSize))\n if (msgSize > maxLength) {\n return cb('size longer than max permitted length of ' + maxLength + '!')\n }\n readMessage(reader, msgSize, (err, msg) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize = []\n\n cb(null, msg)\n })\n })\n }", "title": "" }, { "docid": "45a3cd02d5c55ca973ebfac43f2d973f", "score": "0.57265544", "text": "get maxSizeInBytes() {\n return this._maxSizeInBytes;\n }", "title": "" }, { "docid": "56625070a1b81c71ade9e4aaa120ee83", "score": "0.5722724", "text": "_grow(numBytes) {\n errors.throwErr(errors.ERR_BUFFER_LENGTH_INSUFFICIENT, this.numBytesLeft(),\n numBytes);\n }", "title": "" }, { "docid": "8b607f4e0cd5c3f8adbbcf5643d4eca6", "score": "0.5682992", "text": "function readByte () {\n reader.read(1, (err, byte) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize.push(byte)\n\n if (byte && !isEndByte(byte[0])) {\n readByte()\n return\n }\n\n const msgSize = varint.decode(Buffer.concat(rawMsgSize))\n if (msgSize > maxLength) {\n return cb(new Error('size longer than max permitted length of ' + maxLength + '!'))\n }\n\n readMessage(reader, msgSize, (err, msg) => {\n if (err) {\n return cb(err)\n }\n\n rawMsgSize = []\n\n if (msg.length < msgSize) {\n return cb(new Error('Message length does not match prefix specified length.'))\n }\n cb(null, msg)\n })\n })\n }", "title": "" }, { "docid": "5816e06946742fb444fbededfc63f6cd", "score": "0.56786394", "text": "function _getMaxCushionSizeInMilliseconds() {\n var maxCushionSize = _maxBufferSizeMilliseconds * _maxCushionSizeInBufferPercentage/100 - _reservoirSizeMilliseconds - _outageProtectionMilliseconds;\n return maxCushionSize;\n }", "title": "" }, { "docid": "c0cd4154548672abfb89b12eb5f4dead", "score": "0.56503946", "text": "function readByte() {\n reader.read(1, function (err, byte) {\n if (err) {\n return cb(err);\n }\n\n rawMsgSize.push(byte);\n\n if (byte && !isEndByte(byte[0])) {\n readByte();\n return;\n }\n\n var msgSize = varint.decode(Buffer.concat(rawMsgSize));\n\n if (msgSize > maxLength) {\n return cb(new Error('size longer than max permitted length of ' + maxLength + '!'));\n }\n\n readMessage(reader, msgSize, function (err, msg) {\n if (err) {\n return cb(err);\n }\n\n rawMsgSize = [];\n\n if (msg.length < msgSize) {\n return cb(new Error('Message length does not match prefix specified length.'));\n }\n\n cb(null, msg);\n });\n });\n }", "title": "" }, { "docid": "e70674ab31e531d827a70da13383aff7", "score": "0.5612726", "text": "get sizeLimit() {\n return this.sizeValidator.maxLimit;\n }", "title": "" }, { "docid": "296de027b8a082bffdb370b8b38989d3", "score": "0.56011057", "text": "static get MAX_LENGTH() { return 5; }", "title": "" }, { "docid": "2d61899abc0f281794e4dbd064bd1b07", "score": "0.5597639", "text": "function setInternalBufferSize(size) {\n // Resize the internal serialization buffer if needed\n if (buffer$1.length < size) {\n buffer$1 = buffer__WEBPACK_IMPORTED_MODULE_0___default.a.Buffer.alloc(size);\n }\n}", "title": "" }, { "docid": "8db94b613ee63e25d42bc0fcc66e901b", "score": "0.5538906", "text": "setMaxDictSize(value) {\n maxDictSize = value;\n }", "title": "" }, { "docid": "8ba43124fa3c360e9267f5057069ddb8", "score": "0.55236477", "text": "function checkMaxInput(form) {\nif (form.message.value.length > maxLen) // if too long.... trim it!\nform.message.value = form.message.value.substring(0, maxLen);\n// otherwise, update 'characters left' counter\nelse form.remLen.value = maxLen - form.message.value.length;\n}", "title": "" }, { "docid": "cb89f0336dcd9d46a86374a33c3556e8", "score": "0.5510116", "text": "function Queue_LSize(maxSize)\r\n{\r\n\tthis._maxSize = maxSize;\r\n this.length = 0;\r\n this._storage = [];\r\n}", "title": "" }, { "docid": "9d6951d0a888c199e2414db0b3597b19", "score": "0.5443929", "text": "get maxSizeInput() {\n return this._maxSize;\n }", "title": "" }, { "docid": "e3b8b522172dce87cc5f78be03128e0f", "score": "0.5428233", "text": "maxByteLength(byteLength) {\n return this.addValidator({\n message: (value, label) => `Expected ${label} to have a maximum byte length of \\`${byteLength}\\`, got \\`${value.byteLength}\\``,\n validator: value => value.byteLength <= byteLength,\n negatedMessage: (value, label) => `Expected ${label} to have a minimum byte length of \\`${byteLength + 1}\\`, got \\`${value.byteLength}\\``\n });\n }", "title": "" }, { "docid": "709611723c21dfd4fae9b35209da8616", "score": "0.5421716", "text": "constructor(initializer) {\n if (initializer) {\n super(initializer);\n } else {\n super(constants.BUFFER_CHUNK_SIZE);\n this.size = this.maxSize;\n }\n }", "title": "" }, { "docid": "265e6b0d017c5aa0f3e151aeccca1f03", "score": "0.5420965", "text": "get maxBufferPx() { return this._maxBufferPx; }", "title": "" }, { "docid": "265e6b0d017c5aa0f3e151aeccca1f03", "score": "0.5420965", "text": "get maxBufferPx() { return this._maxBufferPx; }", "title": "" }, { "docid": "9232ea40776d70cce51f5aee8fc526f7", "score": "0.536819", "text": "dataMessage () {\n if (this.fin) {\n const messageLength = this.messageLength;\n const fragments = this.fragments;\n\n this.totalPayloadLength = 0;\n this.messageLength = 0;\n this.fragmented = 0;\n this.fragments = [];\n\n if (this.opcode === 2) {\n var data;\n\n if (this.binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this.binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data, { masked: this.masked, binary: true });\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString(), { masked: this.masked });\n }\n }\n\n this.state = GET_INFO;\n }", "title": "" }, { "docid": "6a39a91e7341ede4ba59c43c6952ba3a", "score": "0.53561944", "text": "extend_if_needed(num) {\n if ((this.buffer.length - this.size) < num) {\n let new_buffer = new Uint8Array(this.size + num * 2);\n new_buffer.set(this.buffer);\n this.buffer = new_buffer;\n } \n }", "title": "" }, { "docid": "ddf40c583ff734085737398875230d2b", "score": "0.53557104", "text": "handleMessageChange(event){\n this.setState({\n message: event.target.value,\n messageCount: 500 - event.target.value.length\n });\n }", "title": "" }, { "docid": "e140e9d73057c61924508236d00e6b4e", "score": "0.53421044", "text": "'autosize:resized .js-chat-submit-input'(e) {\n const tmpl = Template.instance();\n const messages = tmpl.$('.js-chat-messages');\n const input = $(e.currentTarget);\n const textareaSize = input.outerHeight();\n const messagesSize = messages.outerHeight();\n const initialSizesSum = tmpl.textareaInitSize + tmpl.messagesInitSize;\n if (textareaSize + messagesSize > initialSizesSum) {\n messages.outerHeight(initialSizesSum - textareaSize);\n messages[0].scrollTop = messages[0].scrollHeight;\n }\n }", "title": "" }, { "docid": "1433d6aa063b7d5132af73635be111ef", "score": "0.53401864", "text": "function getLastIsUnlimitedSize(defaultValue){\n if(typeof(Storage)!==\"undefined\"){\n // 2013-10-20: Yes! localStorage and sessionStorage support!\n if(sessionStorage.isUnlimitedSize)\n return Number(sessionStorage.isUnlimitedSize);\n else\n return Number(defaultValue); // Default preference\n }\n else{\n // Sorry! No web storage support..\n return Number(defaultValue); // Default preference\n }\n }", "title": "" }, { "docid": "c404f0079e820f12734beac1b6da3f5e", "score": "0.53351235", "text": "send_stream_size(id, rows, cols) {\n\t\tthis.write(\"%c\" + \"%c%ud%c\", [ PKT_RESIZE, id, rows, cols ]);\n\t}", "title": "" }, { "docid": "63be0f6c7c86481c3370100b4b3480cf", "score": "0.5320886", "text": "get_jobMaxSize()\n {\n return this.liveFunc._jobMaxSize;\n }", "title": "" }, { "docid": "9747470a1c870c156013176d571a2c1c", "score": "0.5316411", "text": "function getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}", "title": "" }, { "docid": "9747470a1c870c156013176d571a2c1c", "score": "0.5316411", "text": "function getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}", "title": "" }, { "docid": "164766c219a5d457ae04855aad78b3b4", "score": "0.53141856", "text": "function wrapDcSend(dc, pc) {\n\t var origDataChannelSend = dc.send;\n\t dc.send = function() {\n\t var data = arguments[0];\n\t var length = data.length || data.size || data.byteLength;\n\t if (dc.readyState === 'open' &&\n\t pc.sctp && length > pc.sctp.maxMessageSize) {\n\t throw new TypeError('Message too large (can send a maximum of ' +\n\t pc.sctp.maxMessageSize + ' bytes)');\n\t }\n\t return origDataChannelSend.apply(dc, arguments);\n\t };\n\t }", "title": "" }, { "docid": "11b3d16500873c9e94b879f2915eada6", "score": "0.53092563", "text": "get_blinkSeqMaxSize() {\n return this.liveFunc._blinkSeqMaxSize;\n }", "title": "" }, { "docid": "b23404295a1203a63e880e8eb8aca9ec", "score": "0.5305791", "text": "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!validation.isValidUTF8(buf)) {\n this.error(\n new Error('Invalid WebSocket frame: invalid UTF-8 sequence'),\n 1007\n );\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "title": "" }, { "docid": "440da8dfae87bda3de36bb1d122bfb83", "score": "0.53038615", "text": "get bufferSize() {return this._pp.keys.length;}", "title": "" }, { "docid": "f9cc7a96359fef88b0ce5386c594a085", "score": "0.5296607", "text": "function ApacheChartBuffer(size)\n{\n this.maxStreamLength = document.all?5000:100000;\t\n this.data = new Array(size?size:100);\n this.iStr = 0;\n}", "title": "" }, { "docid": "72b56e03797cfc81e7ac3f9a4aca8465", "score": "0.5283616", "text": "getDefaultChunkSize(contentLength) {\n const STEP = [\n 1,\n 2,\n 4,\n 8,\n 16,\n 32,\n 64,\n 128,\n 256,\n 512,\n 1024,\n 2048,\n 4096,\n 5120,\n ];\n let available = 1024 * 1024;\n for (let i = 0; i < STEP.length; i++) {\n available = STEP[i] * 1024 * 1024;\n if (contentLength / available <= 10000) break;\n }\n return Math.max(available, 1024 * 1024);\n }", "title": "" }, { "docid": "4c665adde9d3954a4238c80a18faf166", "score": "0.5280719", "text": "numberOfMessages(){\n return this.messages.size;\n }", "title": "" }, { "docid": "47d2959004d58e2ead0b45c7134dc1c1", "score": "0.52768517", "text": "function _getMaxBufferSizeMilliseconds() {\n var maxBufferSizeMilliseconds = config.maxBufferSizeMilliseconds, \n audioStream = playback.audioStream, \n videoStream = playback.videoStream;\n if (config.maxBufferSizeBytes) {\n // This is a quick way to take maxBufferSizeBytes into account, by converting it to MS based on average bitrate.\n // TODO: take maxBufferSizeBytes into account by doing what MediaBuffer does.\n var combinedBytesPerMilllisecond = (audioStream.bitrate + videoStream.bitrate) * KBPStoBPMS * VBR_CEIL;\n maxBufferSizeMilliseconds = Math$min(maxBufferSizeMilliseconds, Math$floor(config.maxBufferSizeBytes / combinedBytesPerMilllisecond));\n }\n return maxBufferSizeMilliseconds;\n }", "title": "" }, { "docid": "e8225495bb0c633eeef7365a80a252ac", "score": "0.5252048", "text": "guaranteeLimit() {\n if (this.size === this.maxSize) {\n this.removeResponse(this.tail.urlId);\n }\n }", "title": "" }, { "docid": "14318409e0b171a2d184ac4c4377d21e", "score": "0.52513033", "text": "function cropMessages(max) {\n $( \".rlc-message\" ).each(function( index ) {\n if (index > max) {\n $( this ).remove();\n }\n });\n }", "title": "" }, { "docid": "33c3c206ca2cb5cdc8561fe25d487070", "score": "0.5247883", "text": "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "title": "" }, { "docid": "b11113095322b6409c13989091afd480", "score": "0.52350676", "text": "get numNewNativeMessages() { return this._numNewNativeMessages;}", "title": "" }, { "docid": "2f7a2b86adeefe0cdc0b739eac33f20f", "score": "0.52124006", "text": "sendFormHeightMessage() {\n const formHeight = document.getElementById('root').clientHeight;\n window.parent.postMessage('{\"iframe_height\":\"' + formHeight + '\"}','*');\n }", "title": "" }, { "docid": "f46dfbe03cdd8d35ac9ab69dc3315b57", "score": "0.52050424", "text": "dataMessage () {\n\t if (this.fin) {\n\t const messageLength = this.messageLength;\n\t const fragments = this.fragments;\n\n\t this.totalPayloadLength = 0;\n\t this.messageLength = 0;\n\t this.fragmented = 0;\n\t this.fragments = [];\n\n\t if (this.opcode === 2) {\n\t var data;\n\n\t if (this.binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this.binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data, { masked: this.masked, binary: true });\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString(), { masked: this.masked });\n\t }\n\t }\n\n\t this.state = GET_INFO;\n\t }", "title": "" }, { "docid": "4adb105b1bcf68a88c53d22bc66910c6", "score": "0.5197584", "text": "function FFString_cutByteString( msg, maxlength) {\n\tvar str,msg;\n\tvar len=0;\n\tvar temp;\n\tvar count;\n\tcount = 0;\n\t \n\tstr = new String(msg);\n\tlen = str.length;\n\n\tfor(k=0 ; k<len ; k++) {\n\t\ttemp = str.charAt(k);\n\t\t\n\t\tif(escape(temp).length > 4) {\n\t\t\tcount += 2;\n\t\t}\n\t\telse if (temp == '\\r' && str.charAt(k+1) == '\\n') { // in case \\r\\n\n\t\t\tcount += 2;\n\t\t}\t\t\n\t\telse if(temp != '\\n') {\n\t\t\tcount++;\n\t\t}\n\t\tif(count > maxlength) {\n\t\t\tstr = str.substring(0,k);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn str;\n}", "title": "" }, { "docid": "a31c1f62cb0bdcd4fdd78de2171c7f9b", "score": "0.51759624", "text": "function size (buffer) {\n validate(buffer);\n\n return buffer.numberOfChannels * buffer.getChannelData(0).byteLength;\n}", "title": "" }, { "docid": "c5e9a875fefe91a3fd98729955385a75", "score": "0.5172946", "text": "function maximumTraceOrDebugBodyLength(localStorage) {\n var value = localStorage[\"camelMaximumTraceOrDebugBodyLength\"];\n if (angular.isString(value)) {\n value = parseInt(value);\n }\n if (!value) {\n value = Camel.defaultCamelMaximumTraceOrDebugBodyLength;\n }\n return value;\n }", "title": "" }, { "docid": "952d44039f63c40e017f3aaa3be611b6", "score": "0.5165472", "text": "function calcMediaLength(messages) {\n var media = 0;\n messages.forEach(function (message) {\n message.expanded = vm.expandAll;\n if (vm.methods.isMedia(message)) {\n media++;\n }\n });\n vm.mediaLength = media;\n }", "title": "" }, { "docid": "872529b1dfb8ad85c212722bb233d543", "score": "0.51609856", "text": "getPanelMaxSize (panelIndex, panels) {\n if (panels[panelIndex].resize === 'fixed') {\n if (!panels[panelIndex].fixedSize) {\n panels[panelIndex].fixedSize = panels[panelIndex].size\n }\n return panels[panelIndex].fixedSize\n }\n return 0\n }", "title": "" }, { "docid": "64c9ba8815df122c19c01329e3279910", "score": "0.51453584", "text": "function setLastIsUnlimitedSize(isUnlimitedSize){\n if(typeof(Storage)!==\"undefined\"){\n // 2013-06-09: Yes! localStorage and sessionStorage support!\n sessionStorage.isUnlimitedSize=Number(isUnlimitedSize);\n }\n else{\n // Sorry! No web storage support..\n console_log(\"No web storage support\");\n }\n }", "title": "" }, { "docid": "52dcc610350a6f4f54245ea2df27aeea", "score": "0.51196253", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "b65743975129dc6b3bb0db22b5a01b2b", "score": "0.51165354", "text": "resize(capacity) {\n this.capacity = capacity;\n this.values = new Uint8Array(Math.ceil(capacity / 8));\n }", "title": "" }, { "docid": "09fb16e4aec3098b3699642db983c0f0", "score": "0.51114994", "text": "get maxBufferPx() {\n return this._maxBufferPx;\n }", "title": "" }, { "docid": "b82250ef2d4591a8c48c4986c966d01c", "score": "0.51057", "text": "calWidth () {\n let len = 0\n this.queue.forEach(message => {\n len += message.content.length * config.default_font_size\n })\n return len\n }", "title": "" }, { "docid": "51bba47d90b585cad641d027145ffb60", "score": "0.5104268", "text": "function reportSize() {\n var height = document.body.clientHeight;\n window.parent.postMessage(JSON.stringify({\n type: 'height',\n height: height\n }), '*');\n }", "title": "" }, { "docid": "60709753b1319302b42a87476570f569", "score": "0.51013976", "text": "function h$__hscore_sizeof_termios() {\n ;\n return 4;\n}", "title": "" }, { "docid": "60709753b1319302b42a87476570f569", "score": "0.51013976", "text": "function h$__hscore_sizeof_termios() {\n ;\n return 4;\n}", "title": "" }, { "docid": "60709753b1319302b42a87476570f569", "score": "0.51013976", "text": "function h$__hscore_sizeof_termios() {\n ;\n return 4;\n}", "title": "" }, { "docid": "d7bb9ceee40b7a57d0d1e6a2495598b3", "score": "0.509666", "text": "_updateMaxLength() {\n const that = this;\n\n if (that._mask.length > 0) {\n that.maxLength = that._mask.length;\n }\n }", "title": "" }, { "docid": "7ca3f3318d5a5befdef9d78c8bbe318e", "score": "0.50941116", "text": "sendMoreMessages (callback) {\n\t\tthis.messages = [this.message];\n\t\tBoundAsync.timesSeries(\n\t\t\tthis,\n\t\t\t10,\n\t\t\tthis.sendMessage,\n\t\t\tcallback\n\t\t);\n\t}", "title": "" }, { "docid": "9622c75d212927d83841967a81b1c7c1", "score": "0.509059", "text": "grow(size) {\n assert.integer(size);\n if (size > this.buffer.byteLength) { //if resizing is necessary\n const newBuffer = new ArrayBuffer(size << 1);\n new Uint8Array(newBuffer).set(new Uint8Array(this.buffer));\n this.buffer = newBuffer;\n }\n return this;\n }", "title": "" }, { "docid": "09794e911da6201942e8b89c90812cc9", "score": "0.50841", "text": "_getMaxLength(): number {\n const maxLength =\n this.props.system.get('nameMax') -\n '.md'.length -\n '.000'.length; // room to disambiguate up to 1,000 duplicate titles\n\n return Math.max(\n 0, // sanity: never return a negative number\n maxLength\n );\n }", "title": "" }, { "docid": "32b441342df7c5289517fc8a6701f53e", "score": "0.50818187", "text": "function wrapDcSend(dc, pc) {\n var origDataChannelSend = dc.send;\n\n dc.send = function send() {\n var data = arguments[0];\n var length = data.length || data.size || data.byteLength;\n\n if (dc.readyState === 'open' && pc.sctp && length > pc.sctp.maxMessageSize) {\n throw new TypeError('Message too large (can send a maximum of ' + pc.sctp.maxMessageSize + ' bytes)');\n }\n\n return origDataChannelSend.apply(dc, arguments);\n };\n }", "title": "" }, { "docid": "e1cc5a50e3c5c0382b522cc160788019", "score": "0.5081534", "text": "function sendPhoto() {\n var dcid = connections[Math.floor(Math.random()*connections.length)];\n var dataChannel = dataChannels[Object.keys(dataChannels)[0]];\n console.info(\"I have chosen dataChannel \", dataChannel, \" with id \", dcid);\n\n console.error(dcid);\n currentDataChannel = dcid;\n\n // Split data channel message in chunks of this byte length.\n var CHUNK_LEN = 64000;\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n var img = document.getElementById('downloaded');\n context.drawImage(img, 0, 0);\n var myData = context.getImageData(0, 0, img.width, img.height);\n\n // canvasWidth = 300;\n // canvasHeight = 150;\n // var img = canvas.getImageData(0, 0, canvasWidth, canvasHeight),\n // len = img.data.byteLength,\n // n = len / CHUNK_LEN | 0;\n var len = myData.data.byteLength,\n n = len / CHUNK_LEN | 0;\n\n console.log('Sending a total of ' + len + ' byte(s)');\n dataChannel.send(len);\n\n // split the photo and send in chunks of about 64KB\n for (var i = 0; i < n; i++) {\n var start = i * CHUNK_LEN,\n end = (i+1) * CHUNK_LEN;\n console.log(start + ' - ' + (end-1));\n dataChannel.send(myData.data.subarray(start, end));\n }\n\n // send the reminder, if any\n if (len % CHUNK_LEN) {\n console.log('last ' + len % CHUNK_LEN + ' byte(s)');\n dataChannel.send(myData.data.subarray(n * CHUNK_LEN));\n }\n // dataChannel.close();\n // delete dataChannels[dcid];\n console.error(dataChannels, dataChannel);\n}", "title": "" }, { "docid": "0838d2f60d712e24e1ec94fcec3be475", "score": "0.50812364", "text": "get size() {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n }", "title": "" }, { "docid": "39f9b74e9e6f5c41ef524a721c75040b", "score": "0.5081022", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "39f9b74e9e6f5c41ef524a721c75040b", "score": "0.5081022", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "65f34ab67bf347a33a8a358c472ee959", "score": "0.50756305", "text": "function _connection(socket, address, timeout, maxSize) {\n EventEmitter.call(this);\n this.socket = socket;\n this.address = address;\n this.timeout = timeout;\n this.maxSize = maxSize;\n this.lastData = new Date().getTime();\n this.msgBuffer = \"\";\n this.channels = {};\n this.listener = null;\n\n // ////////////////////\n // / SOCKET ACTIONS ///\n // ////////////////////\n\n this.socket.on(\"data\", (bytes) => {\n this.msgBuffer += bytes.toString();\n if (this.msgBuffer != \"\" && this.msgBuffer != \"\\n\") {\n const data = this.msgBuffer.split(\"\\n\");\n for (let i = 0; i < data.length; i++) {\n try {\n if (data[i] == \"\") {\n continue;\n }\n const msg = JSON.parse(data[i]);\n this.channels[msg[\"type\"]] = msg[\"data\"];\n if (msg[\"type\"] == IMAGE) {\n if (base64.test(msg[\"data\"])) {\n this.emit(msg[\"type\"], msg[\"data\"]);\n }\n } else {\n this.emit(msg[\"type\"], msg[\"data\"]);\n }\n this.emit(\"data\", msg);\n } catch (err) {}\n }\n }\n });\n this.socket.on(\"end\", () => {\n this.emit(\"end\");\n });\n\n this.socket.on(\"error\", (err) => {\n this.emit(\"warning\", err);\n });\n\n // /////////////\n // / METHODS ///\n // /////////////\n\n this.get = function (channel) {\n return this.channels[channel];\n };\n\n this.write = function (dataType, data) {\n const msg = {\n type: dataType,\n data: data,\n };\n this.socket.write(JSON.stringify(msg) + NEWLINE);\n };\n\n this.close = function () {\n this.socket.destroy();\n };\n\n // Timeout handler\n if (this.timeout > 0) {\n setInterval(() => {\n if ((new Date().getTime() - this.lastData) / 1000 > this.timeout) {\n if (this.msgBuffer == \"\") {\n try {\n this.reset();\n } catch (err) {}\n }\n }\n }, this.timeout);\n }\n}", "title": "" }, { "docid": "08fcbfa3d11218b4d09d873c3def2bc5", "score": "0.5064321", "text": "function getSize(){\n return queue.length;\n }", "title": "" }, { "docid": "b54ea81e90cc7ec8802720534d8e7014", "score": "0.50637513", "text": "dataMessage () {\n\t if (this._fin) {\n\t const messageLength = this._messageLength;\n\t const fragments = this._fragments;\n\n\t this._totalPayloadLength = 0;\n\t this._messageLength = 0;\n\t this._fragmented = 0;\n\t this._fragments = [];\n\n\t if (this._opcode === 2) {\n\t var data;\n\n\t if (this._binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this._binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data);\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString());\n\t }\n\t }\n\n\t this._state = GET_INFO;\n\t }", "title": "" }, { "docid": "56e4fac4af602be891b06e1d3b51f5a4", "score": "0.5037986", "text": "getPayloadLength16 () {\n if (!this.hasBufferedBytes(2)) return;\n\n this.payloadLength = this.readBuffer(2).readUInt16BE(0, true);\n this.haveLength();\n }", "title": "" }, { "docid": "c1df0c9ac32d07c635d61b2ace52ca4f", "score": "0.50321853", "text": "function _getNormalizedBufferLength() {\n // Byte limited buffer\n if (_maxBufferBytes) {\n return config.maxBufferSizeBytes\n ? Number$clamp((_getAudioBufferBytes() + _getVideoBufferBytes()) / config.maxBufferSizeBytes, 0, 1)\n : 0;\n }\n\n // Time limited buffer;\n return Number$clamp(_getBufferLength() / config.maxBufferSizeMilliseconds, 0, 1);\n }", "title": "" }, { "docid": "a4927c06f2edc7850cdf440fe7f37268", "score": "0.5023315", "text": "function getFlashNumOfTimesUponNewMessage() {\r\n\treturn 10;\r\n}", "title": "" }, { "docid": "0fcdbe5914ba302f99d4afc325ac52ab", "score": "0.50191927", "text": "function maxContentSize(bytes) {\n return function (control) {\n var size = control && control.value ? control.value.files.map(function (f) {\n return f.size;\n }).reduce(function (acc, i) {\n return acc + i;\n }, 0) : 0;\n var condition = bytes >= size;\n return condition ? null : {\n maxContentSize: {\n actualSize: size,\n maxSize: bytes\n }\n };\n };\n }", "title": "" }, { "docid": "7979d12330f8c4d9230a6b965089881f", "score": "0.5014798", "text": "replyContentLength () {\n this[kContentLength] = true;\n return this\n }", "title": "" }, { "docid": "52d55063f7a5691b2d8329f91140974b", "score": "0.50143427", "text": "largestCommandLength() {\n const commands = this.prepareCommands();\n return commands.reduce((max, command) => Math.max(max, command[0].length), 0);\n }", "title": "" }, { "docid": "bab9fcaadab6c721ded00362975a1fb9", "score": "0.5014078", "text": "function maxLen(array, maxLength) {\n if (array && array.length > maxLength) {\n array.length = maxLength;\n }\n}", "title": "" }, { "docid": "8a6f0e4a086b316b1ae7d22339bbcc01", "score": "0.5011084", "text": "getUnreadMessageSize(callback, error) {\n this._get({\n callback: callback,\n error: error,\n uri: '/conversations/unread_count',\n params: {}\n });\n }", "title": "" }, { "docid": "a04e22c02ba8229d7cf587ae11968736", "score": "0.50095797", "text": "setMaximumSupportedFrequency(frequency) {\n this.max_frequency_ = frequency;\n }", "title": "" }, { "docid": "8b059a2f93e6fb9db77edaf455e8cb9d", "score": "0.50087976", "text": "function max_key_length(data) {\r\n \tvar max = 0;\r\n for(var i = 0; i < data.length; i++) {\r\n if (data[i].key.length > max) {\r\n max = data[i].key.length;\r\n }\r\n }\r\n return max\r\n }", "title": "" }, { "docid": "bd290b6af5e2f68b1ff84b27b820eae4", "score": "0.5008624", "text": "getPayloadLength16 () {\n if (!this.hasBufferedBytes(2)) return;\n\n this._payloadLength = this.readBuffer(2).readUInt16BE(0, true);\n this.haveLength();\n }", "title": "" }, { "docid": "6e7cc24a22c6294033284fd8258e3a02", "score": "0.500825", "text": "set size(value) {}", "title": "" }, { "docid": "ad78fa8b2e34c368e7217b60f475de40", "score": "0.50072867", "text": "replyContentLength () {\n this[kContentLength] = true\n return this\n }", "title": "" } ]
86e4a5d232ea9a131fc61f35c525b31d
Make GET request to the backend API to display information regarding the patient.
[ { "docid": "56b3a523e2638645a45ffbde17efa191", "score": "0.0", "text": "componentDidMount() {\n axios({\n headers : {\n 'Access-Control-Allow-Credentials': true\n },\n method: 'GET',\n url: process.env.REACT_APP_SERVER_SIDE_URL + 'api/patient?id=' + this.props.patientId,\n withCredentials: true,\n }).then(res => this.setState({firstName: res.data.first_name, secondName: res.data.second_name, address: res.data.address, contactNumber: res.data.contact_number, nextOfKin1FirstName: res.data.next_of_kin1_first_name, nextOfKin1SecondName : res.data.next_of_kin1_second_name, nextOfKin2FirstName : res.data.next_of_kin2_first_name, nextOfKin2SecondName : res.data.next_of_kin2_second_name, age: res.data.medical_data.age, gender: res.data.medical_data.sex, chol: res.data.medical_data.chol, thalach: res.data.medical_data.thalach, exang: res.data.medical_data.exang, fbs: res.data.medical_data.fbs, oldpeak: res.data.medical_data.oldpeak, restecg: res.data.medical_data.restecg, ca: res.data.medical_data.ca, slope: res.data.medical_data.slope, thal: res.data.medical_data.thal, cp: res.data.medical_data.cp, trestbps: res.data.medical_data.trestbps, severity: res.data.severity}))\n }", "title": "" } ]
[ { "docid": "d9ca6f9739469f83e6d7db7a17f987df", "score": "0.7098787", "text": "function getPatients(){\n console.log('patients came here to get patients by get');\n\n // this will be caught by saves.js\n $http.get('data/get').then(function(response){\n $scope.patients=(response.data);\n });\n //this is an API call\n }", "title": "" }, { "docid": "b2cbba638a965cf9a04e2cfc336dce9e", "score": "0.6944868", "text": "async getPatientByID(patient_id) {\n try {\n var response = await axios.get(this.getServerLocation() + '/patients/get' + patient_id)\n return response\n } catch (error) {\n console.log(error)\n return null\n }\n }", "title": "" }, { "docid": "f8dbd5e6f94a991720711fb558c13f4f", "score": "0.6931541", "text": "function getPatient(){\r\n $http.get(\"ajax/getPatient.php?patientId=\"+patient).success(function(data){\r\n $scope.patients = data;\r\n });\r\n }", "title": "" }, { "docid": "9b8d0c623128399fc9419fbfa635c14c", "score": "0.68162465", "text": "function GetAllPatient() {\n\n //var getData = patientsService.getPatients(); \n\n //$scope.patients = getData; \n\n //getData.then(function (response) {\n // debugger;\n // $scope.patients = response; \n //}, function () {\n // alert('Error in getting patients records'); \n //});\n\n $http.get('http://localhost:50186/api/Patients/GetPatients')\n // on success...\n .then(function (result) {\n foo = result.data;\n response = result.data;\n $scope.patients = result.data; \n },\n // on failure...\n function (errorMsg) {\n console.log('Something went wrong loading patients list: ' + errorMsg);\n });\n }", "title": "" }, { "docid": "d923a341c2b65b72fe2b637f0cb7600b", "score": "0.65362597", "text": "function getPatients() {\n $.get(\"/api/patient\", function(patients) {\n patients.forEach(function(element) {\n $(\"#patient-list\").append(\"--------- Patient Info ----------<br>\");\n $(\"#patient-list\").append(\"Patient ID: \" + element.id + \"<br>\");\n $(\"#patient-list\").append(\"Name: \" + element.name + \"<br>\");\n $(\"#patient-list\").append(\"Date of Birth: \" + element.dob + \"<br>\");\n $(\"#patient-list\").append(\"Height (in): \" + element.heightIN + \"<br>\");\n $(\"#patient-list\").append(\"Weight: \" + element.weight + \"<br>\");\n $(\"#patient-list\").append(\n \"<button id='notes'>Add Client Notes</button><br>\"\n );\n });\n });\n }", "title": "" }, { "docid": "44247da25c3e3abf417d691c6d50ae16", "score": "0.65320253", "text": "function getPatient(id) {\n return PatientResource.get({id:id}, onPatientReturned, onFailure);\n }", "title": "" }, { "docid": "44247da25c3e3abf417d691c6d50ae16", "score": "0.65320253", "text": "function getPatient(id) {\n return PatientResource.get({id:id}, onPatientReturned, onFailure);\n }", "title": "" }, { "docid": "a6967aa286f35d3597916e2dedfb57c4", "score": "0.65297943", "text": "function getDemographicDetails(PatientId) {\n var def = $q.defer();\n $http({\n method: 'GET',\n url: config.apiUrl + '/Patient/'+ PatientId,\n headers: {'Accept': 'application/json+fhir'}\n })\n .success(function(data) {\n def.resolve(data);\n })\n .error(function() {\n def.reject(\"Failed to get Demographic Details\");\n });\n return def.promise;\n }", "title": "" }, { "docid": "f4ca239ab2e4885cb199f616d1ea6970", "score": "0.6520732", "text": "function getPatients(){\r\n $http.get(\"ajax/getPatients.php\").success(function(data){\r\n $scope.patients = data;\r\n });\r\n }", "title": "" }, { "docid": "9037c0923eb9f99b0173860a3512a9a9", "score": "0.6363038", "text": "getRecords(params) {\n return axios.get(`/records/${params.patient_id}/all`, {\n params: params\n })\n }", "title": "" }, { "docid": "3ddb8c9d7fa5736dda45db8721fe4d36", "score": "0.62019396", "text": "function getPatients() {\n $.get(\"/api/patients\", function(data) {\n patients = data;\n initializeTable();\n });\n}", "title": "" }, { "docid": "800bf92a178ce9525f063653bce846a2", "score": "0.61800754", "text": "function GetPatientData(searchValue) {\n try {\n var url = vrtlDirr + '/T12201/GetPatientData';\n return $http({\n url: url,\n method: \"POST\",\n data: {searchValue: searchValue }\n }).then(function (results) {\n return results.data;\n }).catch(function (ex) {\n throw ex;\n });\n } catch (ex) {\n throw ex;\n }\n }", "title": "" }, { "docid": "ebb041017d320b6f1f7308f9d6f14889", "score": "0.6115909", "text": "function getPatients() {\n const list = JSON.parse(localStorage.getItem(\"patientsList\"));\n if (list == \"undefined\" || list == null) {\n var requestOptions = {\n method: \"GET\",\n redirect: \"follow\",\n };\n\n fetch(\"http://localhost:3000/doctor/get-patients\", requestOptions)\n .then((response) => response.json())\n .then((result) => {\n localStorage.setItem(\"patientsList\", JSON.stringify(result));\n })\n .catch((error) => console.log(\"error\", error));\n }\n showConversations();\n}", "title": "" }, { "docid": "b264709b5dc5e28ecfedc98f71c66c08", "score": "0.61158264", "text": "function getInfo() {\r\n HttpService.httpGet(self.baseServiceUrl).then(function (response) {\r\n $scope.details = response.data;\r\n }, function (response) {\r\n DialogService.showHttpErrorDialog(response);\r\n DialogService.toastrError(self.moduleName + ' list', 'load');\r\n });\r\n }", "title": "" }, { "docid": "5a4df97e65a8911acbdbf54feb3d21b6", "score": "0.61131865", "text": "async getAssessmentsByPatientId(patient_id) {\n try {\n var response = await axios.get(this.getServerLocation() + '/assessments/getAByPatientId' + patient_id)\n return response\n } catch (error) {\n console.log(error)\n return null\n }\n }", "title": "" }, { "docid": "5eadbd9182a0869ac38c4742f21cba6b", "score": "0.60961366", "text": "async function get() {\n var url = `${storeUrlBase}/v1/patent/patentQuoteList?an=${an}`;\n var result = await client.get(url, {\n headers: {\n accept: 'application/json'\n }\n });\n if( !(result.result) ){\n res.render('error',{error:'您找的引证信息暂无数据!'});\n return;\n }\n res.json(result.result)\n }", "title": "" }, { "docid": "fae4790ba8c613bc0bf9f5429f683bf0", "score": "0.6066267", "text": "static async getAllPatientsofDoctor(req, res){\n const prescriptionDomain = new PrescriptionDomain();\n prescriptionDomain.getAllPatientsofDoctor(req, res);\n }", "title": "" }, { "docid": "11dd212abef6758460b6646c047456cc", "score": "0.60615164", "text": "static async getPrescriptionOfPatient(req, res){\n const prescriptionDomain = new PrescriptionDomain();\n prescriptionDomain.getPrescriptionOfPatient(req, res);\n }", "title": "" }, { "docid": "029057a92a9af7338e2462b1b2f78a2c", "score": "0.6052096", "text": "function getPatientById(args, res, next) {\n const da = new DataAccess('MongoDataSource');\n var patientFromDatabase = da.getPatient(args.shrId.value);\n if(!Lang.isUndefined(patientFromDatabase) && !Lang.isNull(patientFromDatabase)) {\n // Use instead of code below if using HardCodedReadOnlyDataSource\n // res.write(JSON.stringify(patientFromDatabase));\n // res.end();\n patientFromDatabase.then(function(result) {\n res.write(JSON.stringify(result));\n res.end();\n });\n } else {\n res.statusCode = 404;\n res.statusMessage = \"Patient not found.\"\n res.write(\"No patient matched the specified ID.\");\n }\n}", "title": "" }, { "docid": "7eb270325be7babd3519d89ab019b5b7", "score": "0.60515904", "text": "async function get() {\n var url = `${storeUrlBase}/v1/patent/patentSimilarityInfo?an=${an}`;\n var result = await client.get(url, {\n headers: {\n accept: 'application/json'\n }\n });\n if( !(result.result) ){\n res.render('error',{error:'暂无数据!'});\n return;\n }\n res.json(result.result)\n }", "title": "" }, { "docid": "16e49d7c07bc6a9d4ff89b0e7a3b1bc5", "score": "0.60292995", "text": "function patientTreatedGet() {\n return (dispatch) => {\n const headers = { \"Content-Type\": \"application/json\" };\n fetch(`${api}medical/patientTreatedGet`, { headers })\n .then((res) =>\n res.json().then(async (response) => {\n dispatch({ type: ActionTypes.patientTreatedGet, payload: response });\n })\n )\n .catch((err) => {\n });\n };\n}", "title": "" }, { "docid": "f489f98fe820cdb1d88b028cddf18779", "score": "0.60014826", "text": "show(req, res) {\n Disciplina.findById(req.params.id)\n .then(function (disciplina) {\n res.status(200).json(disciplina);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "title": "" }, { "docid": "3a2e5a6a68a7c11f858efcffccb47c03", "score": "0.5990351", "text": "function displayPatient(pt) {\n document.getElementById('patient_name').innerHTML = getPatientName(pt);\n document.getElementById('gender').innerHTML = pt.gender;\n document.getElementById('dob').innerHTML = pt.birthDate;\n document.getElementById('age').innerHTML = getAge(pt.birthDate) + ' years old';\n}", "title": "" }, { "docid": "e2d6a24bbfb7bb697514de0509051d42", "score": "0.59903127", "text": "show(id) {\n return this.client.get(`${this.BASE_URL}/${id}`, { observe: \"response\" });\n }", "title": "" }, { "docid": "42882b5195194e4bd6c4606b062fe985", "score": "0.5974214", "text": "get patient () {\n\t\treturn this._patient;\n\t}", "title": "" }, { "docid": "42882b5195194e4bd6c4606b062fe985", "score": "0.5974214", "text": "get patient () {\n\t\treturn this._patient;\n\t}", "title": "" }, { "docid": "8fed150c9a1be76bacdf14f3070dab0b", "score": "0.59488004", "text": "function renderPatients(request, response){\n db.getPatients().then((data) => {\n renderHelper(data, response);\n });\n}", "title": "" }, { "docid": "10b4efbe178604c3c8e2d83a36306552", "score": "0.5916452", "text": "function requestPatient(patient_id) {\t \n jsonResp = null;\n var url = 'http://tutsgnfhir.com/Patient/' + patient_id + '$everything?_format=json';\n\n var xhr = createCORSRequest('GET', url);\n if (!xhr) {\n alert('CORS not supported');\n return;\n }\n\n // Response handlers.\n xhr.onload = function() {\n //var text = xhr.responseText;\n var jsonResp = JSON.parse(xhr.responseText);\n\n // print json in text format\n //console.log(xhr.responseText);\n // print json object\n console.log(jsonResp);\n var msg = \"\";\n if (jsonResp.total !== 0)\n {\n // Get resource types\n var _patient = getResourceType(jsonResp, \"Patient\", null);\n console.log(_patient);\n var _bmi = getResourceType(jsonResp, \"Observation\", [\"39156-5\"]);\n console.log(_bmi);\n var _glucose = getResourceType(jsonResp, \"Observation\", [\"2339-0\",\"1558-6\",\"2345-7\"]);\n var _pressure = getResourceType(jsonResp, \"Observation\", [\"55284-4\"]);\n var _cholesterol = getResourceType(jsonResp, \"Observation\", [\"2093-3\"]);\n var _tobacco = getResourceType(jsonResp, \"Observation\", [\"72166-2\"]);\n var _diabetis = getResourceType(jsonResp, \"Condition\", [\"44054006\", \"190372001\"]);\n \n var overallRisk = [];\n var bmiRisk = getRisk(_bmi, \"bmi\", \"last\", \"\");\n overallRisk.push(bmiRisk);\n var glucoseRisk = getRisk(_glucose, \"glucose\", \"last\", _diabetis);\n overallRisk.push(glucoseRisk);\n var cholesterolRisk = getRisk(_cholesterol, \"cholesterol\", \"last\", \"\");\n overallRisk.push(cholesterolRisk);\n var smokingRisk = getRisk(_tobacco, \"smoking\", \"last\", \"\");\n overallRisk.push(smokingRisk);\n var bloodPressureRisk = getRisk(_pressure, \"bloodPressure\", \"last\", \"\");\n overallRisk.push(bloodPressureRisk);\n \n //output patient data\n displayData(_patient, \"patientname\", \"\", \"\");\n displayData(\"\", \"overall\", \"\", analyseRisk(overallRisk));\n displayData(_bmi, \"bmi\", \"last\", bmiRisk);\n displayData(_glucose, \"glucose\", \"last\", glucoseRisk);\n displayData(_pressure, \"systolic\", \"last\", bloodPressureRisk);\n displayData(_pressure, \"diastolic\", \"last\", bloodPressureRisk);\n displayData(_cholesterol, \"cholesterol\", \"last\", cholesterolRisk);\n displayData(_tobacco, \"smoking\", \"last\", smokingRisk);\n }\n else\n {\n msg = 'Patient with id ' + patient_id + ' not found.'; \n //alert(msg);\n }\n document.getElementById(\"errorText\").innerHTML = msg;\n };\n\n xhr.onerror = function() {\n alert('Woops, there was an error making the request.');\n };\n\n xhr.send();\n}", "title": "" }, { "docid": "2ef45a0d736736e36a60379825855cde", "score": "0.5911876", "text": "function getDashboard(){\n let url = `https://health.data.ny.gov/resource/gnzp-ekau.json?$where=UPPER(ccs_diagnosis_description) like '%25CANCER%25'&$limit=30`;\n fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then(function(result) {\n return result.json();\n }).then(function(json) {\n processData(json)\n });\n }", "title": "" }, { "docid": "f19d9e52708cac402fc7e305a321a3db", "score": "0.5896804", "text": "get_doctors_patient() {\r\n return this.patient\r\n }", "title": "" }, { "docid": "9080a409a391a231c0fc1aef82bd6e22", "score": "0.5847957", "text": "get patient() {\n\t\treturn this.__patient;\n\t}", "title": "" }, { "docid": "9080a409a391a231c0fc1aef82bd6e22", "score": "0.5847957", "text": "get patient() {\n\t\treturn this.__patient;\n\t}", "title": "" }, { "docid": "9080a409a391a231c0fc1aef82bd6e22", "score": "0.5847957", "text": "get patient() {\n\t\treturn this.__patient;\n\t}", "title": "" }, { "docid": "577491a9204371547e319ee28e6c855a", "score": "0.58265275", "text": "function show(req, res) {\n getAllData(req.params.id, req.query.lat, req.query.long, req.query.departureAirport, req.query.departureDate, req.query.eventId, req.query.arrivalDate, Number(req.query.adults), Number(req.query.childrens), req.query.eventCity, req.query.eventCountry).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "e2b5236b6dd6ab69553a16590a322b7a", "score": "0.5826275", "text": "function show(req, res) {\n Appointment\n .findById(req.params.id) \n .populate('vegId')\n .then(appointment => {\n if (!appointment) return res.status(404).json({ message: 'Not Found ' })\n res.status(200).json(appointment)\n })\n .catch(() => res.status(404).json({ message: 'Not Found ' }))\n}", "title": "" }, { "docid": "9072af611ab91d9e06fe8960b66fb764", "score": "0.58262146", "text": "function get_patient_info(id){\n\t$.ajax({\n\t\turl: 'transaction/get_patient_info',\n\t\tmethod: 'POST',\n\t\tdata: {id: id},\n\t\tdataType: 'json',\n\t\tsuccess: function(result) {\n\t\t\tclear_patient_info();\n\t\t\tvar purok = '';\n\t\t\t\n\t\t\tif (!(result['address_purok'].trim() ==''|result['address_purok'].trim() =='0')){\n\t\t\t\tpurok = 'Purok ' + result['address_purok'] + ', ';\n\t\t\t}\n\t\t\tvar fullname = result['firstname']+' '+result['middlename']+' '+result['lastname']+' '+result['extension'];\n\t\t\tvar address = purok+result['address_brgy']+', '+result['address_citymun']+' Bohol';\n\n\t\t\t$('#text_patient_id').val(result['patientid']);\n\t\t\t$('#text_fullname').val(fullname.toUpperCase());\n\t\t\t$(\"#text_address\").val(address.toUpperCase());\n\t\t\t$('#text_sex').val(result['sex'].toUpperCase());\n\t\t\t$('#text_contact_number').val(result['contact_number'].toUpperCase());\n\t\t\t$('#text_email').val(result['email']);\n\t\t\t$('#text_medical_history_remarks').val(result['remarks'].toString());\n\n\t\t\tvar birthdate = result['birthdate'].toString();\n\t\t\t\n\t\t\tif(birthdate != '0000-00-00'){\n\t\t\t\t$('#text_birthdate').val(result['birthdate'].toUpperCase());\n\t\t\t\tcalculate_age(birthdate);\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "9d72e8467da42bd2e081927b290a72b5", "score": "0.5800782", "text": "function getAppointment(req, res) {\r\n\tvar id = req.params.id;\r\n\r\n\r\n Appointment.findById(id, (err, appointment) => {\r\n if (err) return res.status(500).send({message: `Error al realizar la peticion: ${err}`});\r\n res.json(appointment);\r\n \r\n })\r\n}", "title": "" }, { "docid": "c28fc8cc6d7cbf708c9403229a2eb07d", "score": "0.57711536", "text": "show(req, res) {\n Ability.findById(req.params.id)\n .then((ability) => {\n res.status(200).json(ability);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "title": "" }, { "docid": "a7c940e96d8c7be3189de5c855a6e15b", "score": "0.5770875", "text": "clickViewPatientButton() {\n this._clickButton('view', this.actionButtons.viewPatient);\n const patientDetailPage = require('./../patientDetailPage');\n patientDetailPage._init();\n patientDetailPage.isLoaded();\n return patientDetailPage;\n }", "title": "" }, { "docid": "37d587e71de416c4181a515b68639c93", "score": "0.57609326", "text": "async function loadPatient(id) {\n try {\n var patient = await SanteDB.resources.patient.getAsync(id, \"full\");\n $timeout(() => $scope.patient = patient);\n }\n catch (e) {\n // Remote patient perhaps?\n if (e.$type == \"FileNotFoundException\" || e.cause && e.cause.$type == \"FileNotFoundException\") {\n try {\n\n // Is this a local session? If so, we need to use the application elevator\n var session = await SanteDB.authentication.getSessionInfoAsync();\n if (session.method == \"LOCAL\") // Local session so elevate to use the principal elevator\n {\n var elevator = new ApplicationPrincipalElevator(true);\n await elevator.elevate(session);\n SanteDB.authentication.setElevator(elevator);\n }\n\n $scope.patient = await SanteDB.resources.patient.getAsync({ id: id, _upstream: true }, \"full\");\n $scope.patient._upstream = true;\n if ($scope.patient.tag) {\n delete $scope.patient.tag[\"$mdm.type\"];\n delete $scope.patient.tag[\"$altkeys\"];\n delete $scope.patient.tag[\"$generated\"];\n }\n\n $scope.$apply();\n return;\n }\n catch (e) {\n $rootScope.errorHandler(e);\n }\n }\n $rootScope.errorHandler(e);\n }\n }", "title": "" }, { "docid": "76ba84247f181b3c29764c69324c3620", "score": "0.57504666", "text": "function get() {\n $http\n .get('/api/trails/' + id)\n .then(onGetSuccess, onGetError);\n\n function onGetSuccess(response){\n vm.trail = response.data;\n }\n\n function onGetError(response){\n console.error(\"Failed to get trail\", response);\n $location.path(\"/\");\n }\n }", "title": "" }, { "docid": "baa8745cff8b0c10b6b8bb25d1e40956", "score": "0.5723883", "text": "function show(req, res) {\n return _sqldb.Paciente.find({\n where: {\n id: req.params.id\n }, include: [{\n model: _sqldb.Especie, as: 'especie'\n }, {\n model: _sqldb.Apoderado, as: 'apoderado'\n }, {\n model: _sqldb.Monitor, as: 'monitor', required: false\n }]\n }).then(_apiutils2.default.handleEntityNotFound(res)).then(_apiutils2.default.respondWithResult(res)).catch(_apiutils2.default.handleError(res));\n}", "title": "" }, { "docid": "6426aea200476463285bddcef7b32c00", "score": "0.5714668", "text": "function getPatients(res, mysql, context, complete){\n mysql.pool.query(\"SELECT patient_id as id, patient_name FROM dc_patient\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.patients = results;\n complete();\n });\n }", "title": "" }, { "docid": "4cbc40d43d48a2c29df8ec973ba4acbd", "score": "0.56907076", "text": "function getDetails() {\n const CANDIDATE_DETAIL = verifyData[0].candidates[0].personId;\n const PERSON_DETAILS_URL =\n URL + \"/persongroups/\" + GROUP_ID + \"/persons/\" + CANDIDATE_DETAIL;\n axios({\n method: \"get\",\n headers: {\n \"content-type\": \"application/json\",\n \"Ocp-Apim-Subscription-Key\": API_KEY\n },\n url: PERSON_DETAILS_URL\n })\n .then(response => {\n // console.table(response.data)\n candidateName = response.data.name;\n console.log(candidateName);\n personName.innerHTML = candidateName;\n })\n .catch(err => {\n ifError();\n console.error(err.message);\n });\n}", "title": "" }, { "docid": "fd5747c2c3e039bec75d51a17fb5015f", "score": "0.5675467", "text": "function retrieve_patients(status){\n\t$.ajax({\n\t\turl: 'transaction/retrieve_patients',\n\t\tmethod: 'POST',\n\t\tdata: {status: status},\n\t\tdataType: 'html',\n\t\tbeforeSend: function() {\n\t\t $('.overlay-wrapper').html('<div class=\"overlay\">' +\n\t\t \t\t\t\t\t'<i class=\"fas fa-3x fa-sync-alt fa-spin\"></i>' +\n\t\t \t\t\t\t\t'<div class=\"text-bold pt-2\">Loading...</div>' +\n \t\t\t\t\t'</div>');\n\t\t},\n\t\tcomplete: function(){\n\t\t $('.overlay-wrapper').html('');\n\t\t},\n\t\tsuccess: function(result) {\n\t\t\t$('#patient_list').html(result);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f1e0f6916a9000a331e8cd560a3d6bde", "score": "0.5652614", "text": "async fetchPatients({ commit, rootGetters }) {\n const headers = {\n \"Content-Type\": \"application/json\",\n Authorization: rootGetters.getToken,\n };\n await axios\n .get(`http://${process.env.VUE_APP_SERVER_IP}:${process.env.VUE_APP_SERVER_PORT}/patient/show`, { headers: headers })\n .then(function (response) {\n console.log(response);\n commit(\"setPatients\", response.data);\n })\n .catch(function (error) {\n console.log(error.response.data);\n });\n }", "title": "" }, { "docid": "8287522d453cde40e0b49c77bf675789", "score": "0.5645685", "text": "function getData(id){\n \n fetch('http://localhost:9092/list/read/'+id)\n .then(\n function(response) {\n if (response.status !== 200) {\n console.log('Error with code: ' + response.status);\n return;\n }\n\n response.json().then(function(data) {\n // Show data to form\n showData(data);\n });\n }\n )\n .catch(function(err) {\n console.log('Fetch Error :-S', err);\n });\n}", "title": "" }, { "docid": "ac57ce07b05018597cf06de0b79549d8", "score": "0.5601364", "text": "show(req, res) {\n Simulado.findById(req.params.id)\n .then(function (simulado) {\n res.status(200).json(simulado);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "title": "" }, { "docid": "9906faad17d72c64a01b88062ebb3b92", "score": "0.5600928", "text": "async getInfo() {\n let endpoint = '/'\n let method = 'GET'\n let params = { }\n return await this.handler(endpoint, method, params)\n }", "title": "" }, { "docid": "5c9ef4217e9aaaec27f600d3793728b3", "score": "0.558597", "text": "function onPatientReturned(patient) {\n $scope.daily = patient.Dailies;\n }", "title": "" }, { "docid": "8539a782abed77f8f923748d58f51fdf", "score": "0.5584755", "text": "function showPerson(){\n getPerson(id)\n }", "title": "" }, { "docid": "a298d2c1d12da4c8144af24433d97ef2", "score": "0.555893", "text": "function findPatient(req, res, next){\n Procedure.find({\"pid\":{$eq:req.body.pid}}, function(err, procedures){\n if (err) throw (err);\n res.json({patientProcedures: procedures});\n })\n}", "title": "" }, { "docid": "babfcc6d29bdf5830371d30b4e2b0703", "score": "0.55516416", "text": "async function fetchPatientDatabyId(req, res) {\n try {\n const data = await patient.findById({ _id: req.body.patient_id });\n if (data) {\n return res.send({ success: data });\n } else ({ error: \"No data found\" });\n } catch (err) {\n return res.send({ error: \"No data found\" });\n }\n}", "title": "" }, { "docid": "6d0b79ac48e581681d5ca59595914615", "score": "0.5550137", "text": "retrieve (id) {\n return service.get(\"/retrieve\", {\n params: {\n id: id\n }\n });\n }", "title": "" }, { "docid": "ba13683bf47812ce93a4230f592005c2", "score": "0.5549223", "text": "function showData(req, res) {\n console.log(\"3> From /records/data\");\n connection.query(selectDataQuery,[req.decoded.id], (err, row, fields) => {\n if (err) {\n console.log(err.message);\n res.json(CONFIG.defaultErrorJSON);\n }\n console.log(row[0]);\n res.json(row[0]);\n });\n}", "title": "" }, { "docid": "1193ed4ba3ab05ffce83ac8630ab897c", "score": "0.55485976", "text": "function getData() {\n var u = 'https://portal.opendata.dk/api/3/action/datastore_search?resource_id=5c458799-6926-456f-8629-158f0bf86927&sort=_id%20desc&limit=840'\n var xhr = new XMLHttpRequest();\n xhr.open('GET', u);\n xhr.send(null);\n\n xhr.addEventListener(\"load\", function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var data = JSON.parse(xhr.response)\n if (data.result.records && data.result.records.length > 0) {\n _records = data.result.records;\n done()\n } else {\n err(\"Error loading data\")\n }\n } else {\n err(\"Error loading data\")\n }\n })\n\n xhr.addEventListener(\"error\", function (err) {\n error(err)\n })\n\n xhr.addEventListener(\"abort\", function (err) {\n error(err)\n })\n }", "title": "" }, { "docid": "f5b08659e7af63a2dd2ce3b69dfbe0bb", "score": "0.55438274", "text": "getDentistData(id) {\n return this.http.get('https://dcn-hub-app-api.dentacoin.com/dentist/get-dentist-data/' + id);\n }", "title": "" }, { "docid": "83fe31734d1df9fd7287fd6689d7a7dd", "score": "0.55376834", "text": "async show({ params, request, response }) {}", "title": "" }, { "docid": "00aadc52033435f543f765c183cfd72d", "score": "0.5519005", "text": "fetch_patient(patient, model)\r\n {\r\n //set the doctors current patient\r\n model.set_patient(patient)\r\n //clear current feed\r\n var parent = document.getElementById(\"Feed\")\r\n var i;\r\n for (i = 1; i < parent.childElementCount; i)\r\n {\r\n parent.children[i].remove()\r\n }\r\n \r\n var patients_div = document.getElementById(\"patients-div\")\r\n\r\n patients_div.hidden = true\r\n\r\n var patient_div = document.getElementById(\"Feed\")\r\n const div_string = patient.get_name() + \"'s Health History\"\r\n document.getElementById(\"patient-header\").textContent = div_string\r\n const health_data = patient.get_health_data()\r\n this.show_feed(health_data)\r\n\r\n patient_div.hidden = false\r\n\r\n var patients_btn = document.getElementById(\"button-diff-patient\")\r\n patients_btn.hidden = false\r\n\r\n var analytics_btn = document.getElementById(\"btn-analytics\")\r\n analytics_btn.hidden = false\r\n\r\n }", "title": "" }, { "docid": "8cbc8f271e8b7b95e616f893eee82109", "score": "0.55158377", "text": "function load_patient_info(patient_info){\n html = '<div class=\"panel panel-default\">';\n html += '<div class=\"panel-heading\">Patient Information</div>';\n html += '<div class=\"panel-body\">';\n html += '<p>Name: '+text_info(patient_info.patient_id)+'</p>';\n html += '<p>Age: '+text_info(patient_info.age)+'</p>';\n html += '<p>Gender: '+text_info(patient_info.gender)+'</p>';\n html += '<p>Email: '+ text_info(patient_info.patient_id.slice(0,6)+\"@gmail.com\")+'</p>';\n //html += '<p>Phone number: '+text_info(patient_info.telephone)+'</p>';\n html += '</div></div></div>';\n $('#patient-info').html(html);\n}", "title": "" }, { "docid": "55e50f7f13b7147ededec50a602052a7", "score": "0.5503477", "text": "function show(id) {\n\n return resource.fetch(id)\n .then(function(data){ return data.data; });\n }", "title": "" }, { "docid": "bc62afac8dd0ebf7494a215861d02f20", "score": "0.55028707", "text": "getEmployeesInfo() {\n return fetch(\"http://127.0.0.1:8088/employees?_expand=computer&_expand=department\")\n .then(response => response.json())\n }", "title": "" }, { "docid": "c24c7d8cb9e90a0bbe81cf497ef05e4a", "score": "0.5497709", "text": "function _getHospitalById(req, res, next) {\n Common.ensureUserInSession(req, res, function (caller) {\n var hospitalId = req.query.hospitalId;\n var json = {};\n var param = { hospitalImage: 1, hospitalName: 1, hospitalCategory: 1, address: 1, landMark: 1, pinCode: 1, state: 1, country: 1, phoneNumber: 1, website: 1 };\n COMMON_SERVICES.findById(HOSPITAL_DETAIL, hospitalId, param, function (err, result) {\n if (err) {\n res.send(result);\n }\n else {\n json.hospital = result;\n res.send(json);\n }\n });\n });\n}", "title": "" }, { "docid": "caf5407f3cf9d7c10989c8c148dbbec6", "score": "0.5495743", "text": "get(req, res) {\n return res.json({\n name: 'Filipe',\n id: 1\n });\n }", "title": "" }, { "docid": "b0229f5ded1cdc24f5d1d510a5ba1454", "score": "0.54955304", "text": "function getDetails(petDetailsPath) {\n\t\t$('.pet-detail').remove();\n\t\tvar baseURL = '/api' + petDetailsPath; \n\t\t$.ajax({\n\t\t\turl: baseURL, \n\t\t\tdataType: 'json',\n\t\t\ttype: 'GET',\n\t\t\tcontentType: 'application/json',\n\t\t\tsuccess: function(data){\n\t\t\t\tif (data) {\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t\tdisplayDetails(data);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"no data\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "31e00be30e02a8e00b8cadf4e9b02444", "score": "0.5491679", "text": "async getPatientTestDetails(ctx, phone) {\n\n\t\t// Reference\n\t\tlet testData\n\t\tlet response = []\n\t\tlet testMappingData\n\t\tlet patientTestMappingKey = keys.testMapping(phone)\n\n\t\t// Get User Data\t\t\n\t\ttestMappingData = await ctx.stub.getState(patientTestMappingKey);\n\n\t\t// Check if data exists\n\t\tif (!testMappingData || testMappingData.toString().length <= 0) {\n\t\t\tthrow new Error('No Data Found');\n\t\t}\n\n\t\t// Parse Data into JSON\n\t\ttestMappingData = JSON.parse(testMappingData.toString());\n\n\t\t// Iterate Over Test\n\t\tvar index\n\t\tfor (index = 0; index < testMappingData.testIds.length; index++) {\n\t\t\t// Get Test Data\n\t\t\ttestData = await ctx.stub.getState(testMappingData.testIds[index]);\n\t\t\ttestData = JSON.parse(testData.toString());\n\t\t\tresponse.push(testData)\t\t\t\n\t\t}\n\n\t\t// Response\n\t\treturn JSON.stringify(response);\n\n\t}", "title": "" }, { "docid": "886e06fca7f641357a4318e7b2a35af2", "score": "0.5481553", "text": "function queryWebApp() {\n fetch(ENDPOINT)\n .then(function(response) {\n response.json()\n .then(function(data) {\n //print the data to see in the log\n console.log(\"Got JSON response from server: \" + JSON.stringify(data));\n //create a json object of the data we actually need\n \n var medicineName = data.Items[0].medicineName.S;\n var rate = Number.parseFloat(data.Items[0].rate.N);//comes in hours\n var lastTimeTaken = data.Items[0].lastTimeTaken.S;//comes in unix timestamp as string\n //console.log(\"Medicine: \" + medicineName + \" Rate: \" + rate + \" Last Time Taken: \" + lastTimeTaken);\n //return the data to the fitbit\n returnMedicine(medicineName, rate, lastTimeTaken);\n });\n })\n .catch(function (err) {\n console.log(\"Error fetching medicine: \" + err);\n });\n}", "title": "" }, { "docid": "a7e447f81e2a7afbb7de8a08c1fff34a", "score": "0.5470296", "text": "exampleGet() {\n return this.api.doGet(this.examplePath)\n }", "title": "" }, { "docid": "def9a5c583a2b46f5af993f1627095fd", "score": "0.54629725", "text": "function getAll() {\n $scope.datas = personSrv.query();\n }", "title": "" }, { "docid": "01bf1b6557174717f7063c52338769b1", "score": "0.54610527", "text": "async function fetchPatientData(req, res) {\n if (\n req.body.patient_name != undefined &&\n req.body.patient_phoneno != undefined\n ) {\n const patientdata = await patient.find({\n patient_name: req.body.patient_name,\n patient_phoneno: req.body.patient_phoneno,\n });\n if (patientdata.length > 0) {\n return res.send({ success: patientdata });\n } else {\n /* redirect to error*/ return res.send({\n error: \"No patient data found\",\n });\n }\n }\n if (\n req.body.patient_name != undefined &&\n req.body.patient_phoneno === undefined\n ) {\n const patientdata = await patient.find({\n patient_name: req.body.patient_name,\n });\n if (patientdata.length > 0) {\n return res.send({ success: patientdata });\n } else {\n /* redirect to error*/ return res.send({\n error: \"No patient data found\",\n });\n }\n }\n if (\n req.body.patient_name === undefined &&\n req.body.patient_phoneno != undefined\n ) {\n const patientdata = await patient.find({\n patient_phoneno: req.body.patient_phoneno,\n });\n if (patientdata.length > 0) {\n return res.send({ success: patientdata });\n } else {\n /* redirect to error*/ return res.send({\n error: \"No patient data found\",\n });\n }\n } else {\n const patientdata = await patient.find({});\n if (patientdata.length > 0) {\n return res.send({ success: patientdata });\n } else {\n /* redirect to error*/ return res.send({\n error: \"No patient data found\",\n });\n }\n }\n}", "title": "" }, { "docid": "8faa50fb8ec5dd3dcbee559fed522eee", "score": "0.54595554", "text": "function loadAppointmentInfo() {\n return $j.ajax({\n url: base_url + '/services/schedule-appointment/get-info',\n type: 'GET',\n success: function(data) {\n return data;\n },\n error: function(error) {\n return error;\n }\n });\n}", "title": "" }, { "docid": "48f98499527d74b78ce3265c049ca8f0", "score": "0.5455346", "text": "function show(req, res) {\n var eventDetailUrl = 'http://app.ticketmaster.com/discovery/v2/events/' + req.params.id + '.json?apikey=g4sXxf0ioySFxO0FQFYnGMEoAwW1uMoQ';\n return _requestPromise2.default.get(eventDetailUrl).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "51a6b237531163d074d9534bbbea5a0b", "score": "0.54509944", "text": "function getActivity (){\n axios.request({\n method: \"GET\",\n url: \"http://www.boredapi.com/api/activity/\"\n }).then(getSuccess).catch(getFail);\n}", "title": "" }, { "docid": "33ea96e8adfe7110c4b4958dce6a81ae", "score": "0.5450872", "text": "async function show(req, res) {\n const affirmation = await Affirmation.findById(req.params.id);\n res.status(200).json(affirmation);\n}", "title": "" }, { "docid": "e22420e488aa21a2e7f97eeb8d63199a", "score": "0.5443886", "text": "function get() {\n return axios.get('./db.json', {\n params: {\n ID: 1\n }\n });\n}", "title": "" }, { "docid": "74f5678e2ae71414b45c0ab2f6b2ab21", "score": "0.54428893", "text": "componentDidMount() {\n axios.get('http://localhost:5000/patients/')\n .then(response => {\n this.setState({ patients: response.data })\n })\n .catch((error) => {\n console.log(error);\n })\n }", "title": "" }, { "docid": "062a0dabc4714324cbc827bedcd697ea", "score": "0.54315454", "text": "static getPerson(id) {\n\n return new Promise ((resolve,reject) => {\n axios.get(`${url}${id}`).then((res) => {\n const data = res.data;\n resolve(\n data\n );\n })\n .catch((err)=> {\n reject(err);\n })\n });\n }", "title": "" }, { "docid": "578179d5ff020e32501ef4f2591e22a5", "score": "0.5415226", "text": "function strainDisplay(id)\n {\n return $http.get(\"/strain/\" + id).then(complete).catch(failed);\n }", "title": "" }, { "docid": "7dd33ccb060a090f92419d9777725d47", "score": "0.54095656", "text": "function getNote(req, res, next) {\n Note.findByPk(req.params.id)\n .then(note => res.json(note))\n .catch(err => next(err));\n}", "title": "" }, { "docid": "09419884d44ddabbed27d448aa682e6d", "score": "0.5393612", "text": "static async get(req, res) {\n const studentDomain = new StudentDomain();\n studentDomain.getAllStudents(req, res);\n }", "title": "" }, { "docid": "facca7c0c87de04da614291b191eed0b", "score": "0.5391562", "text": "function query() {\n $http\n .get('/api/graphs')\n .then(function onSuccess(response) {\n vm.graphs = response.data;\n });\n }", "title": "" }, { "docid": "a504f03220af8ee3cf88490a3b24c501", "score": "0.5390635", "text": "function retrivePatientsByAddress(alarmIndex) {\r\n\r\n\t if( $('#dynamicPatientInfo').length == 1){ //check if we have the dynamic data\r\n\t\t \r\n\t\t\t $.getJSON(\"/prospectPatient/\" + alarmIndex,\r\n\t\t\t \t\t function (data){createPatientDiv(data)});\r\n\r\n\t\t\t }\r\n\t \treturn;\r\n\t }", "title": "" }, { "docid": "5ca46ab629dbc9212f17dc3f01771fe2", "score": "0.53839874", "text": "function loadDetails(){\n var resultUrl = ctrl.url + '/' + ctrl._id;\n ctrl.showError = false;\n ctrl.podsRequest =\n $http.get(resultUrl).success(function (data) {\n ctrl.data = data;\n ctrl.object=JSON.stringify(ctrl.data.details)\n ctrl.json.object = JSON.parse(ctrl.object)\n delete ctrl.data.details;\n ctrl.data_field = dataFieldService.dataFunction(ctrl.data, ctrl.data_field)\n }).catch(function (error) {\n ctrl.data = null;\n ctrl.showError = true;\n ctrl.error = error.statusText;\n });\n }", "title": "" }, { "docid": "69eb161c3c1bf3e13561e075b9b2dfdf", "score": "0.5379698", "text": "async get(id, params) {}", "title": "" }, { "docid": "3b7772ce6a0ee405bf8c0f2e4540eef7", "score": "0.5360012", "text": "function getDataHospital(frame_id, url, callback) {\n\t var options = {title:globalHospital().descripcion}\n \treturn $.ajax({\n\t \tdataType:'json',\n\t \ttype: 'GET',\n\t \turl: url + '&level=hospital&code=' + globalHospital().codigo,\n\t \tsuccess:function(data) {callback(data, frame_id, options)}\n \t});\n }", "title": "" }, { "docid": "eb3130b4290d281cfd003a43933d6fd6", "score": "0.535953", "text": "function loadRecords() {\n var promiseGet = crudService.getPaciente(); //The MEthod Call from service\n \n promiseGet.then(function (pl) { $scope.Paciente = pl.data },\n function (errorPl) {\n $log.error('failure loading Paciente', errorPl);\n });\n }", "title": "" }, { "docid": "70077abad97a0fcbac2bcacbba3a781e", "score": "0.5351251", "text": "function loadPatient(){\r\n\t// Hide the side menu\r\n\thidePatientPageWidget();\r\n\t\r\n\tClearAllFields();\r\n\tif (sessionStorage.currentPatientId == '0'){\r\n\t\t$('#patient h1').text(\"New Patient\");\r\n\t\t$('#patientPage li').hide();\r\n\t\t$('#codeButton').hide();\r\n\t\t$('#patientInfoLink').show();\r\n\t}\r\n\telse{\r\n\t\tdb.transaction(\r\n\t\t\tfunction(transaction) {\r\n\t\t\t\ttransaction.executeSql(\r\n\t\t\t\t\t'SELECT * FROM patients WHERE id=?',\r\n\t\t\t\t\t[getCurrentPatientId()],\r\n\t\t\t\t\tfunction (transaction, result) {\r\n\t\t\t\t\t\tfor (var i=0; i < result.rows.length; i++) {\r\n\t\t\t\t\t\t\tvar row = result.rows.item(i);\r\n\t\t\t\t\t\t\t$('#patient h1').text(row.last_name + ', ' + row.first_name);\r\n\t\t\t\t\t\t\t$('#widgetPatientName').html(row.last_name + ', ' + row.first_name);\r\n\t\t\t\t\t\t\t$('#patientPage li').show();\r\n\t\t\t\t\t\t\t$('#codeButton').show();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgetAPGARtotals();\r\n\t\t\t\t\t\tshowHideGCS();\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n}", "title": "" }, { "docid": "f86a861ba586bc4eca3bc5ebadd2d9d6", "score": "0.5348552", "text": "function getRecord(req, res) {\n const id = parseInt(req.params.id);\n db.one('select * from ohducks_v1 where id = $1', id)\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Retrieved record with id'\n });\n })\n .catch(function (err) {\n return err;\n });\n}", "title": "" }, { "docid": "972413466fed774a969163fba32c6423", "score": "0.53445894", "text": "function estGet(req, res, next) {\n try {\n console.log('apiREST params', req.params);\n console.log('apiREST query', req.query);\n let sql = 'SELECT * FROM personas';\n con.query(sql,[], function(err,result) {\n if(err) {\n // Enviar error SQL\n console.error('ERR',err.message);\n res.status(500).send({\n finalizado: true,\n mensaje: 'get Error SQL',\n });\n } else {\n // Manipular resultados\n res.status(200).send({\n finalizado: true,\n mensaje: 'get OK',\n datos: result,\n });\n }\n\t\t});\n\n } catch(e) {\n console.log('ERROR', e);\n res.status(401).send({\n finalizado: true,\n mensaje: 'get Error',\n });\n }\n}", "title": "" }, { "docid": "9613bb95f17f195ca9b19caf5ce76b80", "score": "0.534294", "text": "function displayGottenData() {\n fetch(`http://localhost:3001/api/v1/${checkRadioButtonValue()}`)\n .then(response => response.json())\n .then(data => displayData(data))\n}", "title": "" }, { "docid": "507ea445dcb6b20aa9fed5523f91373d", "score": "0.53424984", "text": "function getPatietnsByDoctor(id){\n\n\n\n $.ajax({\n\n url: \"/rest/doctor/patientsByDoctor/\" + id,\n type: \"GET\",\n dataType:\"json\",\n contentType: \"application/json\",\n headers: {'token': 'token123'},\n success: function(DTO,status,xhr){\n console.log(\"success\", DTO, \"status : \" , status, \"xhr : \", xhr.status );\n patientsByDoctor = DTO;\n\n renderDtoTable(patientsByDoctor);\n\n $('#deleteSuccess').hide()\n $('#displayAllButton').hide();\n\n\n },\n\n error: function(xhr,status,error){\n console.log(\"error\", \"status : \" ,status, \"errpor\" , error, \"xhr : \" , xhr)\n $('#errorHappend').show();\n }\n });\n\n\n}", "title": "" }, { "docid": "2d716bec03206ce439e03ca07bd4190a", "score": "0.5338921", "text": "async function getData() {\n const options = {\n method: 'GET',\n headers: {}\n }\n\n const token = sessionStorage.getItem('token');\n\n if (token !== null) {\n options.headers['X-Authorization'] = token;\n isLogged = true;\n }\n\n const response = await fetch('http://localhost:3030/data/records', options);\n\n return await response.json();\n}", "title": "" }, { "docid": "1574aac689c026654e6d7a2a51c9241f", "score": "0.5334439", "text": "function getById(req, res) {\n res.status(200).send(countryService.getById(req.params.countryId));\n}", "title": "" }, { "docid": "3ff32633c08fc66a134614f045ddd940", "score": "0.5333019", "text": "getReciept(id){\n return fetch(`${config.API_ENDPOINT}/reciept/${id}`)\n .then(res =>\n (!res.ok)\n ? res.json().then(e => Promise.reject(e))\n : res.json()\n )\n }", "title": "" }, { "docid": "405296c452536eceb604a61662f81318", "score": "0.5330633", "text": "function getListing ( req, res ) {\n var data = {\n 'agencies': []\n };\n\n agencyService.getAgencies().then( function ( agencies ) {\n data.agencies = agencies;\n res.render('agency-list', data );\n }).catch( function ( error ) {\n console.error( 'Error at %s >> %s', req.originalUrl, error.message );\n req.flash( GFERR, 'Internal server error occurred. Please try again.' );\n req.redirect( 'back' );\n });\n}", "title": "" }, { "docid": "64d0ae7c3737633ebbcad9ff2ba5cbac", "score": "0.53305334", "text": "function show(req, res) {\n return _subscription2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "1e830d7ddd5c03b9526174ef00ba4a98", "score": "0.5329656", "text": "function getfields() {\n fetch(\"/api/fields\")\n .then(function (response) {\n console.log(response);\n if (response.status === 200) {\n response.json().then(data => console.log(data))\n }\n return response.json();\n });\n }", "title": "" }, { "docid": "9f9e1e2f5e62bf6d904eda48a4cecc7d", "score": "0.5321721", "text": "function fn_getresources()\n{\n /*get the user id and assessment id from cookie*/\n\tvar userid = getCookie('userid');\n\tvar assessmentid = getCookie('assessmentid');\n\t\n\t/* Creating a XMLHttpRequest object*/\n\tvar xmlhttp = new XMLHttpRequest(); \n\t\n\t/*Set the url to retrieve resource information*/\n\tvar url = \"http://localhost:4000/user/\"+userid+\"/assessment/\"+assessmentid;\n\t\n /*Open the connection*/\t\n\txmlhttp.open(\"GET\", url, true);\n\t\n\t/*Set the request header with the content type*/\n\txmlhttp.setRequestHeader(\"Content-Type\", \"application/json\"); \n\t\n /*Send the request*/\t\n\txmlhttp.send();\n\n\txmlhttp.onload = function(){\n\t\t/*Get the resource details from server reposne*/\n\t let res = JSON.parse(xmlhttp.response);\n\t\t\n\t\t/*Render the reasource details in a table*/\n\t\tfn_renderResourceTable(res);\n\t}\n}", "title": "" }, { "docid": "9f1683c5938bbfd077a2dfaf141c5501", "score": "0.5319387", "text": "function httpGet(req, res){\n\t\tif (req.params.id != undefined){\n\t\t\treturn findById(req, res);\n\t\t}else{\n\t\t\treturn list(req, res);\n\t\t}\n\t}", "title": "" }, { "docid": "cf68d0a1a25dd0e52b3f528c0e890cac", "score": "0.5316157", "text": "async function getPersonDetails(id) {\n //get details\n let url = 'https://api.harvardartmuseums.org/person/' + id + '?apikey=fc1b68f0-b251-11e8-b0af-a198bfdbf6ce';\n let output = `<h2>Details</h2>` + `<table>`;\n\n let res = await fetch(url);\n res = await res.json();\n for (let record in res) {\n output += `\n <tr><td>` + record + `</td><td>` + res[record] + `</td></tr>`;\n };\n output += `</table> `;\n document.getElementById('objectDetails').innerHTML = output;\n}", "title": "" }, { "docid": "77cdd1bc28c27f90f96ecc0b33231659", "score": "0.5314629", "text": "async show(req, res) {\n try {\n const diseases_symptom = await diseases_symptoms.findAll(\n { include: [{model : diseases, as: \"Disease\"}, {model : symptoms, as: \"Symptom\"}],\n where: { id_disease: req.params.id }\n });\n const disease = await diseases.findOne(\n { where: { id: req.params.id }\n });\n let ret = { disease, symptoms: [] };\n diseases_symptom.map( fm => ret.symptoms.push( fm.Symptom.description));\n \n\n return res.send(ret);\n \n } catch (error) {\n \n return res.status(400).send({\n error: \"Erro\",\n description: \"Não foi possivel listar a food-micro\"\n });\n }\n }", "title": "" } ]
55dc33dd859e63606b010e1d19f50128
Clear ES index, parse and index all files from the books directory
[ { "docid": "0eec8bf5e39a26c018f64c6d9028779e", "score": "0.6322355", "text": "async function readAndInsertBooks () {\n await esConnection.checkConnection()\n\n try {\n // Clear previous ES index\n await esConnection.resetIndex()\n\n // Read books directory\n let files = fs.readdirSync('./books').filter(file => file.slice(-4) === '.txt')\n console.log(`Found ${files.length} Files`)\n\n // Read each book file, and index each paragraph in elasticsearch\n for (let file of files) {\n console.log(`Reading File - ${file}`)\n const filePath = path.join('./books', file)\n const { title, author, paragraphs } = parseBookFile(filePath)\n await insertBookData(title, author, paragraphs)\n }\n } catch (err) {\n console.error(err)\n }\n finally {\n return \"Data inserted successfully\"\n }\n }", "title": "" } ]
[ { "docid": "31b58a704276696287ba553ca77ac77b", "score": "0.6974209", "text": "async function readAndInsertBooks () {\ntry {\n// Clear previous ES index\nawait esConnection.resetIndex()\n\n// Read books directory\nlet files = fs.readdirSync('./books').filter(file => file.slice(-4) === '.txt')\nconsole.log(`Found ${files.length} Files`)\n\n// Read each book file, and index each paragraph in elasticsearch\nfor (let file of files) {\n console.log(`Reading File - ${file}`)\n const filePath = path.join('./books', file)\n const { title, author, paragraphs } = parseBookFile(filePath)\n await insertBookData(title, author, paragraphs)\n}\n} catch (err) {\nconsole.error(err)\n}\n}", "title": "" }, { "docid": "396c101af14d558f67a43d1224178c52", "score": "0.6122955", "text": "function populateDatabase() {\n // create sqlite database\n var sqliteFile = docsetPath + 'Contents/Resources/docSet.dsidx';\n var database = new sqlite3.Database(sqliteFile);\n\n database.serialize(function () {\n // create tables\n database.run(\"CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT)\");\n database.run(\"CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path)\");\n var stmt = database.prepare(\"INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES (?, ?, ?)\");\n\n // get all files in to index\n function parseFile(filePath, file) {\n console.log('parse file \"' + filePath);\n\n var relativeFileName = path.relative(targetDocumentationDirectory, filePath);\n\n fs.readFile(filePath, function (err, data) {\n // crawl each file and insert its contents to index\n var crawler = new Crawler({\n \"maxConnections\": 10,\n\n // This will be called for each crawled page\n \"callback\": function (error, result, $) {\n\n var className = file.substring(0, file.length - 5);\n if (error == null) {\n var type;\n // insert class to index\n $('h1.classTitle').each(function (index, title) {\n type = $(title).text().trim().split(' ')[0].trim();\n switch (type) {\n case 'Index':\n type = 'Guide';\n break;\n case 'final':\n case 'abstract':\n type = 'Class';\n break;\n }\n\n stmt.run(className, type, relativeFileName);\n console.log('add ' + type + ' to db index: ' + className);\n });\n\n // $ is a jQuery instance scoped to the server-side DOM of the page\n // add all events to index\n $('[href*=event]:not([href^=#])').each(function (index, event) {\n var eventName = $(event).text();\n\n stmt.run(className + ':' + eventName, 'Event', relativeFileName + '#' + $(event).attr('href').split('#')[1]);\n console.log('add Event to db index: ' + eventName);\n });\n\n // enumerations\n if (type === 'Enum') {\n $('.sectionItems .classProperty > a').each(function (index, enumeration) {\n \"use strict\";\n var enumName = className + $(enumeration).text().trim() + $(enumeration).attr('name');\n stmt.run(enumName, 'Enum', relativeFileName + '#' + $(enumeration).attr('name'));\n $(enumeration).prepend('<a name=\"//apple_ref/cpp/Enum/' + $(enumeration).attr('name').slice(1) + '\" class=\"dashAnchor\"></a>');\n });\n }\n\n $('.classMethod b a:not([href^=#]):not([name^=\"//apple_ref/cpp/\"])').each(function (index, section) {\n\n // mark in db\n var type = 'Method';\n var methodName = $(section).text();\n if ($(section).text().indexOf(className) === 0) {\n type = 'Function';\n }else {\n type = 'Method';\n if(methodName[0] === '.') {\n methodName = methodName.slice(1);\n }\n methodName = className + ':' + methodName;\n }\n\n stmt.run(methodName, type, relativeFileName + $(section).attr('href').replace(file, ''));\n\n console.log('add Method to db index: ' + $(section).text());\n });\n\n // modify dom to inject toc information\n $('.classMethod > a').each(function (index, method) {\n \"use strict\";\n\n var methodName = $(method).attr('name');\n var type = 'Method';\n if (methodName[0] === '.' || $(method).text().indexOf(className) === 0) {\n methodName = methodName.slice(1);\n type = 'Function';\n }\n $(method).prepend('<a name=\"//apple_ref/cpp/' + type + '/' + methodName + '\" class=\"dashAnchor\"></a>');\n });\n\n $('.classProperty > a[name^=event]').each(function (index, event) {\n \"use strict\";\n\n $(event).prepend('<a name=\"//apple_ref/cpp/Event/' + $(event).attr('name').replace('event:', '') + '\" class=\"dashAnchor\"></a>');\n });\n\n $('.classItem').prepend('<a name=\"//apple_ref/cpp/Class/' + className + '\" class=\"dashAnchor\"></a>');\n\n fs.writeFile(targetDocumentationDirectory + relativeFileName, '<!DOCTYPE html><html xml:lang=\"en\" lang=\"en\">' +\n $('html').html() +\n '</html>');\n }\n }\n });\n\n crawler.queue([\n {\n 'html': data\n }\n ]);\n });\n }\n\n var crawlDir = function (dir) {\n console.log('crawl direcotry \"' + dir + '\"');\n fs.readdir(dir, function (err, files) {\n if (files) {\n files.forEach(function (file) {\n var filePath = dir + '/' + file;\n fs.lstat(filePath, function (err, stats) {\n if (stats && stats.isFile()) {\n if (file.indexOf('.html') !== -1)\n parseFile(filePath, file);\n }\n else {\n crawlDir(filePath);\n }\n });\n });\n }\n });\n };\n\n crawlDir(targetDocumentationDirectory);\n\n // when everything is parsed... write to db\n process.on('exit', function (code) {\n console.log('write to db');\n stmt.finalize();\n\n database.close();\n });\n });\n}", "title": "" }, { "docid": "e6e4d3764cde8bf151f095f672ffd2d5", "score": "0.59143525", "text": "async function readAndInsertSmartTvs () {\n try {\n // Clear previous ES index\n await esConnection.resetIndex()\n\n // Read books directory\n let files = fs.readdirSync(folderPath) ;//.filter(file => file.slice(-4) === '.json')\n console.log(`Found ${files.length} Files`)\n\n var count = 0;\n var bulkOps = [];\n // Read each book file, and index each paragraph in elasticsearch\n console.log(files.size);\n \n if(files.size < 100){\n for (let file of files) {\n count ++\n console.log(`Reading File - ${file}`)\n const filePath = path.join(folderPath, file) \n var smartTv = parseSmartTVFile(filePath)\n bulkOps.push({ index: { _index: esConnection.index, _type: esConnection.type } })\n bulkOps.push(smartTv); \n }\n await esConnection.client.bulk({ body: bulkOps }); \n \n }else {\n for (let file of files) {\n count ++\n console.log(`Reading File - ${file}`)\n const filePath = path.join(folderPath, file) \n var smartTv = parseSmartTVFile(filePath)\n bulkOps.push({ index: { _index: esConnection.index, _type: esConnection.type } })\n bulkOps.push(smartTv); \n if(count == 10){\n await esConnection.client.bulk({ body: bulkOps });\n count = 0; \n bulkOps = [];\n } \n } \n \n }\n \n /*\n for (let file of files) {\n count ++\n console.log(`Reading File - ${file}`)\n const filePath = path.join('./sample-data', file) \n var smartTv = parseSmartTVFile(filePath)\n bulkOps.push({ index: { _index: esConnection.index, _type: esConnection.type } })\n bulkOps.push(smartTv); \n if(count == 10) {\n await esConnection.client.bulk({ body: bulkOps }) \n count = 0\n }\n }\n */\n \n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "5e28973bc522c51aac45d3acaa26f7e0", "score": "0.58627546", "text": "function _saveIndex() {\n _index.put('_index', rtree.getTree(), function (err) {});\n }", "title": "" }, { "docid": "a24c801eb6072bb3a0b234a1fd86a222", "score": "0.5856725", "text": "function updateIndex (files, ms, done) {\n const idx = {}\n\n Object.keys(files).forEach((fname) => {\n const file = files[fname]\n // memoize based on file contents\n if (file.$) {\n const cacheKey = [ ms.directory(), fname, file.contents ]\n const newIndices = memoize(['index', cacheKey], () => {\n return index(fname, file)\n })\n assign(idx, newIndices)\n }\n })\n\n extendIndex(files['_docpress.json'], (file) => {\n file.searchIndex = idx\n file.lunrIndex = memoize([ 'lunr', ms.directory(), idx ], () => {\n return JSON.stringify(lunrize(idx))\n })\n })\n\n done()\n}", "title": "" }, { "docid": "bf5f58990aba12e007cbf894ab96590d", "score": "0.5540416", "text": "function make_index() {\n var doc_path = browser_doc?path.join(lib_dir, \"doc\"):lib_dir;\n var i = 0;\n var l = help_path.length;\n function make_index_cont() {\n if (i < l) {\n var doc_path = help_path[i++];\n // AG: These paths might not exist, ignore them in this case. Also\n // note that we need to expand ~ here.\n var full_path = expand_tilde(doc_path);\n fs.lstat(full_path, function(err, stat) {\n if (!err) {\n post(\"building help index in \" + doc_path);\n dive(full_path, read_file, make_index_cont);\n } else {\n make_index_cont();\n }\n });\n } else {\n finish_index();\n }\n }\n index_started = true;\n post(\"building help index in \" + doc_path);\n dive(doc_path, read_file, browser_path?make_index_cont:finish_index);\n}", "title": "" }, { "docid": "1506e6257ee77d692cefee2ff7c53aa8", "score": "0.5497546", "text": "function mergeIndexes(path) {\n const exportFilePath = path_1.join(path, 'index.ts');\n const declarationsFilePath = path_1.join(path, 'index.d.ts');\n const declarationFile = shelljs_1.cat(declarationsFilePath);\n const exportsFile = shelljs_1.cat(exportFilePath);\n fs_1.writeFileSync(exportFilePath, [declarationFile, exportsFile].join('\\n'));\n shelljs_1.rm(declarationsFilePath);\n}", "title": "" }, { "docid": "8678de5797ff6a16714f7809ef700122", "score": "0.5393577", "text": "resetDocs() {\n logger_1.logger('Watch.resetDocs', this.requestTag, 'Resetting documents');\n this.changeMap.clear();\n this.resumeToken = undefined;\n this.docTree.forEach((snapshot) => {\n // Mark each document as deleted. If documents are not deleted, they\n // will be send again by the server.\n this.changeMap.set(snapshot.ref.path, REMOVED);\n });\n this.current = false;\n }", "title": "" }, { "docid": "1d87b6fb5e9aa5cb47c1d431ebb735d4", "score": "0.53803253", "text": "function indexData() {\n //create elastic client\n let client = elastic.Client({\n host: 'ss_elastic:9200'\n });\n\n // do indexing\n client.bulk({\n body: bulkArr\n }, (err, resp) => {\n if(err){\n console.error('AN ERROR HAS OCCURRED\\n', err);\n process.exit(-1);\n } else{\n console.info(logInfo);\n console.info('BULK INDEXING SUCCESSFULL');\n }\n });\n}", "title": "" }, { "docid": "0b2a2feecc7badf88898c537e1dd4b85", "score": "0.53581256", "text": "function ignoreIndexedFalse(files, _, done) {\n Object.keys(files).forEach(function(key){\n var file = files[key];\n if (file.indexed === false) {\n delete files[key];\n }\n });\n done();\n}", "title": "" }, { "docid": "4824cb06a6577ea6e579bf8d775c4990", "score": "0.5319377", "text": "async clear() {\n try {\n // if (confirm(\"Do you really want to delete all book records?\")) {\n const collection = await this.DB.collection(this.STORAGE_KEY).get();\n if (collection !== undefined && !collection.empty) {\n // delete all documents\n await Promise.all(collection.docs.map((doc) => this.DB.collection(this.STORAGE_KEY).doc(doc.id).delete()));\n }\n this._instances = {};\n console.info(\"All entities cleared.\");\n // }\n }\n catch (e) {\n console.warn(`${e.constructor.name}: ${e.message}`);\n }\n }", "title": "" }, { "docid": "a3d977f13e0a50888271b959141b4166", "score": "0.5311988", "text": "function createIndex() {\n\n // Copy file\n console.log('Copying index.html template...');\n fs.createReadStream('_templates/index.html').pipe(fs.createWriteStream('www/index.html'));\n\n // Replace nav path and cover image path\n getData(epubFullPath, function(data) {\n console.log('Adding paths to nav and cover image...');\n const replaceOptions = {\n files: 'www/index.html',\n from: ['<!--path-to-nav-document-->', '<!--path-to-cover-image-->'],\n to: [data.navPath, data.coverImagePath]\n };\n replace(replaceOptions);\n });\n\n}", "title": "" }, { "docid": "fc39927dfd88d8a2f503a50ee9518c7a", "score": "0.53026295", "text": "function reindexDocuments() {\n let promises = [];\n let reindexResults = {};\n let endpoint = `https://${config.elasticsearch.host}/_reindex`;\n for (let indexName of indexNames) {\n let requestPromise = request.post(endpoint)\n .ca(ca)\n .send({\n source: {\n index: indexName\n },\n dest: {\n index: indexName + suffix\n }\n })\n .then(function (response) {\n console.log(`Reindexed from ${indexName} to ${indexName}${suffix}.`);\n reindexResults[indexName] = {\n to: indexName + suffix,\n success: true\n }\n })\n .catch(function (error) {\n console.log(`Error reindexing from ${indexName} to ${indexName}${suffix}.`);\n reindexResults[indexName] = {\n to: indexName + suffix,\n success: false\n }\n })\n promises.push(requestPromise);\n }\n return Promise.all(promises)\n .then(function (results) {\n console.log(JSON.stringify(reindexResults, null, 2));\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n })\n}", "title": "" }, { "docid": "f853b71345ddeef57b8afa1925631bf0", "score": "0.53016543", "text": "function index(req, res) {\n if (req.data.save) {\n createBook(req, res);\n }\n if (req.data.remove) {\n removeBook(req, res);\n }\n var books = model.Book.all();\n res.render('skins/index.html', {\n title: 'Storage Demo',\n books: function(/*tag, skin, context*/) {\n var buffer = [];\n for (var i in books) {\n var book = books[i]\n buffer.push(book.getFullTitle(), getDeleteLink(book), \"<br>\\r\\n\");\n }\n return buffer.join(' ');\n }\n });\n}", "title": "" }, { "docid": "9e63b17d538913daf02c7c36c15a772d", "score": "0.53000575", "text": "async function filechecking1() {\n //if inverted-index is not in directory then create it\n fs.readFile(\"./Files/inverted.txt\", (err, data) => {\n if (err) {\n indexing(); //creation of new inverted index if not in directory\n } else {\n invertedindex = JSON.parse(data);\n }\n });\n }", "title": "" }, { "docid": "3ac6a293377a41921203ae47d177ffd2", "score": "0.5292057", "text": "function deleteall() {\n var fileDelete = document.getElementById(\"workingFile\");\n console.log(fileDelete);\n var transaction = db.transaction([\"Annotation\"], \"readwrite\");\n var store = transaction.objectStore('Annotation');\n var index = store.index('filename');\n var cursorRequest = index.openKeyCursor();\n cursorRequest.onsuccess = function (event) {\n var cursor = event.target.result;\n\n if (cursor) {\n if (cursor.key === document.getElementById('workingFile').innerHTML) {\n var objectStoreRequest = store.delete(cursor.primaryKey);\n }\n\n\n\n cursor.continue();\n }\n\n\n };\n\n }", "title": "" }, { "docid": "00b25bda7f98527768026c6e50c8844f", "score": "0.52668506", "text": "function CleanIndexes()\r\n{\r\n sentMemesIndex = new Map();\r\n moreMemeToday = true;\r\n console.log(\" - Cleaning indexes\");\r\n}", "title": "" }, { "docid": "b365f8227ca60bf319ef203583a9d4d8", "score": "0.5264555", "text": "async function createElasticSearchIndex() {\n await createEsIndex();\n await updateEsTypeMapping();\n}", "title": "" }, { "docid": "2ed5248adcd6778f9a88d5c4736a5a57", "score": "0.52544665", "text": "async function deleteAll(){\n Sac.destroy({\n where: {},\n truncate: true\n })\n .then(nums => {\n\n })\n .catch(err => {\n res.status(500).send({\n message: err.message || \"Some error occurred while removing all books.\"\n });\n });\n}", "title": "" }, { "docid": "6ac518f5ed2e6dcb37a985c7c5e3fb78", "score": "0.52491814", "text": "_pruneFileNamesCache(index) {\n var basename = logBaseName(index);\n var prefix = basename.substr(0, INDEX_PATH_PREFIX_LENGTH);\n this[indexFileNames$].delete(prefix);\n }", "title": "" }, { "docid": "9d4852464bbb50a1164d92891a84d9d0", "score": "0.523953", "text": "function removeBook(index){\n myLibrary.splice(index, 1);\n readBooks();\n}", "title": "" }, { "docid": "be80570b83669e706aa326c1b072592c", "score": "0.5236151", "text": "static async deleteIndex() {\n await client.indices.delete({index: indexName})\n }", "title": "" }, { "docid": "b5296bec4ab2fe47abd91e957f5fce84", "score": "0.5210164", "text": "function loadIndex(data) {\n index = lunr.Index.load(data);\n }", "title": "" }, { "docid": "4835362e9a5d0575dd54b39cc33fa3f4", "score": "0.5209132", "text": "function clearDocumentCache()\n {\n _documentCache.length = 0;\n _lastOffset = 0;\n _moreDocumentsExist = false;\n }", "title": "" }, { "docid": "03c07d1b9211eab38349d0b635e01a5e", "score": "0.5188324", "text": "function fetchIndex() {\n $.getJSON(gitbook.state.basePath + \"/search_index.lang.json\")\n .then(loadIndex);\n }", "title": "" }, { "docid": "165dc5d62b9ff00e5b922033b2b7c32a", "score": "0.5157851", "text": "function clear() {\n files = listFiles( startPath );\n files.forEach( function( x ) { removeFile( x.name ) } );\n}", "title": "" }, { "docid": "31cd25d99becc19c8b2738dfe305f08f", "score": "0.5147827", "text": "function cleanDocs(docs) {}", "title": "" }, { "docid": "0e3760e933b76ba488156bddecde8731", "score": "0.5140964", "text": "function clearBooks() {\n localforage.clear().then(function() {\n // Run this code once the database has been entirely deleted.\n console.log('Database is now empty.');\n }).catch(function(err) {\n // This code runs if there were any errors\n console.log(err);\n });\n location.reload();\n}", "title": "" }, { "docid": "370ba010a7f924fd09b39dbc534f2681", "score": "0.5140635", "text": "async resetDatabase() {\n const mutex = new Mutex(\"resetDatabase\", { timeout: 0 });\n\n if (!(await mutex.lock())) {\n throw kerror.get(\n \"api\",\n \"process\",\n \"action_locked\",\n \"Kuzzle is already reseting all indexes.\"\n );\n }\n\n try {\n const indexes = await this.ask(\"core:storage:public:index:list\");\n await this.ask(\"core:storage:public:index:mDelete\", indexes);\n\n await this.ask(\n \"core:cache:internal:del\",\n `${BACKEND_IMPORT_KEY}:mappings`\n );\n\n return { acknowledge: true };\n } finally {\n await mutex.unlock();\n }\n }", "title": "" }, { "docid": "965bae5fccc0b09d596c9f22eccf1238", "score": "0.5138278", "text": "empty () {\n this.indexes = {\n primary: Index.create({ name: 'primary', fields: ['_id'] })\n };\n }", "title": "" }, { "docid": "f4afee3011a9aa557b58aa2fac6d8ff4", "score": "0.51298594", "text": "function createIndices(callback) {\n var q = queue();\n geojson_files.forEach(function(gj) {\n q.defer(createIndex, gj);\n });\n\n q.awaitAll(function(err) {\n if (err) return callback(err);\n return callback();\n });\n }", "title": "" }, { "docid": "745a7e2b08f4deff1ad34691479eb783", "score": "0.50667775", "text": "_prepareFullDocIndex() {\n const indexes = new Array(this._data.length);\n for (let i = 0; i < indexes.length; i++) {\n indexes[i] = i;\n }\n return indexes;\n }", "title": "" }, { "docid": "4f6d1e93e91cb859b1f5c120bd158191", "score": "0.50509477", "text": "async function updateIndexJs(path) {\n const indexJSFileName = `${path}/index.js`;\n let contents = file.readFile(indexJSFileName);\n const firstLine = 'const sequelize = require(\\'./db/sequelize\\');\\n';\n contents = firstLine + contents;\n fs.unlinkSync(indexJSFileName);\n file.writeFile(indexJSFileName, contents);\n}", "title": "" }, { "docid": "85bf97b9a70b8894e140e08662ecfeca", "score": "0.50321645", "text": "async updateIndex(bucketName, newCidMap, remove = false) {\n const { bucketClient, bucketKey } = await this.getOrInit(bucketName);\n\n if (!(bucketKey in this.indices)) {\n this.indices[bucketKey] = {\n publisher: this.identity.public.toString(),\n date: (new Date()).getTime(),\n contents: {}\n }\n }\n\n const index = this.indices[bucketKey];\n\n for (const [fileName, cid] of Object.entries(newCidMap)) {\n if (remove) {\n try {\n delete index.contents[fileName];\n } catch {}\n } else {\n index.contents[fileName] = cid;\n }\n }\n\n const buf = Buffer.from(JSON.stringify(index, null, 2));\n const path = \"index.json\";\n await bucketClient.pushPath(bucketKey, path, buf);\n return index;\n }", "title": "" }, { "docid": "6379c4b3cf339cba235e9baf1c8fcb4c", "score": "0.5025083", "text": "function buildIndex() {\n console.time(\"buildIndexTook\");\n console.info(\"building index...\");\n\n const data = wsData.data; //we could get our data from DB, remote web service, etc.\n for (let i = 0; i < data.length; i++) {\n //we might concatenate the fields we want for our content\n const content =\n data[i].API + \" \" + data[i].Description + \" \" + data[i].Category;\n const key = parseInt(data[i].id);\n searchIndex.add(key, content);\n }\n console.info(\"index built, length: \" + searchIndex.length);\n console.info(\"Open a browser at http://localhost:3000/\");\n console.timelineEnd(\"buildIndexTook\");\n}", "title": "" }, { "docid": "1f4bd76aba8fae281556481ada0f3e4c", "score": "0.5016719", "text": "function indexDoc(reverseIndex, docID, doc, facets, callback) {\n //use key if found, if no key is found set filename to be key.\n var fieldBatch = [],\n id = docID,\n facetValues = {},\n fieldKey,\n highestFrequencyCount,\n k,\n deleteKeys,\n facetIndexKey,\n l,\n thisFacetValue,\n m,\n tokenKey,\n docDeleteIndexKey;\n\n var facety = [];\n for (var i = 0; i < facets.length; i++) {\n //doc has some facet values\n if (doc[facets[i]]) {\n //loop though this facet field\n for (var j = 0; j < doc[facets[i]].length; j++) {\n facety.push(facets[i] + '~' + doc[facets[i]][j]);\n }\n }\n }\n\n var compositeField = '';\n for (fieldKey in doc) {\n if( Object.prototype.toString.call(doc[fieldKey]) === '[object Array]' ) {\n if (facets.indexOf(fieldKey) != -1) {\n facetValues[fieldKey] = doc[fieldKey];\n }\n }\n //throw away fields that have null value\n else if (doc[fieldKey] == null) {\n delete doc[fieldKey];\n console.log('[indexing warning] '.yellow + docID.yellow + ': '.yellow\n + fieldKey.yellow + ' field is null, SKIPPING'.yellow)\n }\n //only index fields that are strings\n else if ((typeof doc[fieldKey]) != 'string') {\n delete doc[fieldKey];\n console.log('[indexing warning] '.yellow + docID.yellow + ': '.yellow\n + fieldKey.yellow \n + ' field not string or array, SKIPPING'.yellow)\n }\n else {\n //field is OK- add it to forage.composite\n compositeField += doc[fieldKey] + ' ';\n }\n }\n\n doc['*'] = compositeField;\n var fieldedVector = {};\n\n var tfValues = [];\n\n for (fieldKey in doc) {\n var reverseIndexValue = {};\n reverseIndexValue['filters'] = facety;\n var tfmap = {};\n tfidf = new TfIdf();\n tfidf.addDocument(doc[fieldKey], fieldKey + '~' + id);\n var docVector = tfidf.documents[tfidf.documents.length - 1];\n highestFrequencyCount = 0;\n for (k in docVector) {\n if (docVector[k] > highestFrequencyCount) highestFrequencyCount = docVector[k];\n if (fieldKey == '*') tfValues.push(k);\n }\n deleteKeys = [];\n\n\n\n //generate bloom filter\n var p = 0.1; //bloomErrorMargin\n var n = (Object.keys(docVector).length) //numberOfItemsInBloomFilter\n var bloomBits = Math.ceil((n * Math.log(p)) / Math.log(1.0 / (Math.pow(2.0, Math.log(2.0)))));\n var bloomHashFunctions = Math.round(Math.log(2.0) * bloomBits / n);\n var bloom = new bf.BloomFilter(bloomBits, bloomHashFunctions);\n //work out facet keys for bloom filter\n for (var i = 0; i < facets.length; i++) {\n //doc has some facet values\n if (doc[facets[i]]) {\n //loop though this facet field\n for (var j = 0; j < doc[facets[i]].length; j++) {\n for (var k in docVector) {\n if (k != '__key'){\n var bloomEntry = k + '~' + facets[i] + '~'\n + doc[facets[i]][j] + '~' + fieldKey;\n bloom.add(bloomEntry);\n }\n }\n }\n }\n }\n //no facets\n for (var k in docVector) {\n if (k != '__key') {\n var bloomEntry = k + '~~~' + fieldKey;\n bloom.add(bloomEntry);\n }\n }\n var bloomArray = [].slice.call(bloom.buckets)\n reverseIndexValue['bloom'] = JSON.stringify(bloomArray);\n\n //wildcard token\n docVector['*'] = 1;\n\n var docVecLength = Object.keys(docVector).length - 2;\n for (k in docVector) {\n if (k != '__key') {\n //no faceting\n facetIndexKey = ['~'];\n for (l = 0; l < facets.length; l++) {\n if (doc[facets[l]]) {\n thisFacetValue = doc[facets[l]];\n for (m = 0; m < thisFacetValue.length; m++) {\n facetIndexKey.push(facets[l] + '~' + thisFacetValue[m]);\n }\n } \n }\n for (l = 0; l < facetIndexKey.length; l++) {\n //augmented term frequency\n var tf = (docVector[k] / highestFrequencyCount / docVecLength).toFixed(10);\n //since levelDB sorts fastest from low to high, it is best\n //to give significant keys (those with highest tf) a lower\n //score. An inverted TF is therefore used for sorting.\n var sortKey = (1 - tf).toFixed(10);\n //design key\n var tokenKey = 'REVERSEINDEX~'\n + k + '~'\n + facetIndexKey[l] + '~'\n + fieldKey + '~'\n + sortKey + '~'\n// + tf + '~'\n + id;\n //make a tf vector for the whole document\n //if (fieldKey == 'forage.composite')\n tfmap[k] = tf;\n fieldBatch.push({\n type: 'put',\n key: tokenKey,\n value: reverseIndexValue});\n deleteKeys.push(tokenKey);\n// console.log(tokenKey);\n }\n }\n }\n //dump references so that docs can be deleted\n docDeleteIndexKey = 'DELETE-DOCUMENT~' + id + '~' + fieldKey;\n deleteKeys.push(docDeleteIndexKey);\n fieldBatch.push({\n type: 'put',\n key: docDeleteIndexKey,\n value: deleteKeys});\n var vectorValue = {};\n vectorValue['vector'] = tfmap;\n vectorValue['facetValues'] = facetValues;\n fieldBatch.push({\n type: 'put',\n key: 'VECTOR~' + fieldKey + '~' + docID + '~',\n value: vectorValue});\n fieldedVector[fieldKey] = vectorValue;\n }\n //generate fielded document vector for weighting\n\n fieldBatch.push({\n type: 'put',\n key: 'VECTOR~*fielded~' + docID + '~',\n value: fieldedVector});\n //document\n fieldBatch.push({\n type: 'put',\n key: 'DOCUMENT~' + docID + '~',\n value: JSON.stringify(doc)});\n\n //put key-values into database\n reverseIndex.batch(fieldBatch, function (err) {\n// console.log(tfValues);\n var msg = {};\n msg['status'] = '[indexed] ' + docID;\n msg['tfValues'] = tfValues;\n callback(msg);\n if (err) return console.log('Ooops!', err);\n return;\n });\n}", "title": "" }, { "docid": "efb5226091b2a028c64a54aeb257192e", "score": "0.50131696", "text": "function fillIndex() {\n const srcIndex = './src/index.html'\n const destIndex = './dist/index.html';\n createFile(srcIndex, destIndex);\n const content = memberInfoFinal.join('');\n\n replace({\n regex: \"content-index\",\n replacement: content,\n paths: [destIndex],\n recursive: true,\n silent: true,\n });\n}", "title": "" }, { "docid": "a6c76bf04d2c4c46dae48158d0d47ef6", "score": "0.49978685", "text": "async function updateDirectory(\n directory,\n frontmatter,\n { rootDirectoryOnly = false, shortTitle = false, indexOrder = {} } = {},\n) {\n const initialDirectoryListing = await getDirectoryInfo(directory)\n // If there are no children on disk, remove the directory\n if (initialDirectoryListing.directoryContents.length === 0 && !rootDirectoryOnly) {\n rimraf(directory)\n return\n }\n\n // Recursively update child directories\n if (!rootDirectoryOnly) {\n await Promise.all(\n initialDirectoryListing.childDirectories.map(async (subDirectory) => {\n await updateDirectory(`${directory}/${subDirectory}`, frontmatter, { indexOrder })\n }),\n )\n }\n\n const indexFile = `${directory}/index.md`\n const { data, content } = await getIndexFileContents(indexFile, frontmatter, shortTitle)\n\n // We need to re-get the directory contents because a recursive call\n // may have removed a directory since the initial directory read.\n const { directoryContents, childDirectories, directoryFiles } = await getDirectoryInfo(directory)\n\n const { childrenOnDisk, indexChildren } = getChildrenToCompare(\n indexFile,\n directoryContents,\n data.children,\n )\n\n const itemsToAdd = difference(childrenOnDisk, indexChildren)\n const itemsToRemove = difference(indexChildren, childrenOnDisk)\n if (itemsToRemove.length === 0 && itemsToAdd.length === 0) {\n return\n }\n\n if (!rootDirectoryOnly) {\n // Update the versions in the index.md file to match the directory contents\n directoryFiles.push(...childDirectories.map((dir) => path.join(dir, 'index.md')))\n const newVersions = await getIndexFileVersions(directory, directoryFiles)\n const isVersionEqual = isEqual(newVersions, data.versions)\n if (!isVersionEqual) {\n data.versions = newVersions\n }\n }\n\n // Update the index.md file contents and write the file to disk\n const dataUpdatedChildren = updateIndexChildren(\n data,\n { itemsToAdd, itemsToRemove },\n indexFile,\n indexOrder,\n isRootIndexFile(indexFile),\n )\n\n await writeFile(indexFile, matter.stringify(content, dataUpdatedChildren))\n}", "title": "" }, { "docid": "5d3e5570af26bc7911255982043909d9", "score": "0.49787694", "text": "clearHistory() {\n this.doc.clearHistory();\n }", "title": "" }, { "docid": "90a01f75ba38a1e19eabd070ae25fbb5", "score": "0.49746165", "text": "index(_req, res) {\n Author.find({})\n .then(authors => res.json(authors))\n .catch(error => res.status(Http.InsufficientStorage).json(error));\n }", "title": "" }, { "docid": "ca27a48ea6051933b2ecb649f8bdcd85", "score": "0.49743348", "text": "function setupDocsDirectory() {\n var docs = fs.readdirSync(__dirname);\n docs.forEach(function(eachFile){\n numberFiles(eachFile);\n });\n}", "title": "" }, { "docid": "4782502cded4fcc67b070fe7712c083f", "score": "0.49712908", "text": "function updateIndex (index, fileName, blobRef) {\n // a. parse the index into an array\n // b. check if the file already has an index entry, and remove it if it does!\n // c. add the new line to the index\n // d. return the new index (in string form)!\n let newIndex = []\n index.forEach((history) => {\n if (history !== '') newIndex.push(history)\n })\n let newIndexStr\n let fileContent = fs.readFileSync(fileName)\n let oldBlobRef = getSha1(fileContent)\n let indexOfFile = newIndex.indexOf(fileName + ' ' + oldBlobRef)\n if (indexOfFile > -1) newIndex.splice(indexOfFile, 1)\n newIndex.push(fileName + ' ' + blobRef)\n newIndexStr = newIndex.join('\\n')\n fs.writeFileSync('./.fvs/index', newIndexStr)\n return newIndexStr\n}", "title": "" }, { "docid": "f5fe9bbc4d676e1e824aa23db0cb5f49", "score": "0.49668002", "text": "async function insertBookData (title, author, paragraphs) {\nlet bulkOps = [] // Array to store bulk operations\n\n// Add an index operation for each section in the book\nfor (let i = 0; i < paragraphs.length; i++) {\n// Describe action\nbulkOps.push({ index: { _index: esConnection.index, _type: esConnection.type } })\n\n// Add document\nbulkOps.push({\n author,\n title,\n location: i,\n text: paragraphs[i]\n})\n\nif (i > 0 && i % 500 === 0) { // Do bulk insert in 500 paragraph batches\n await esConnection.client.bulk({ body: bulkOps })\n bulkOps = []\n console.log(`Indexed Paragraphs ${i - 499} - ${i}`)\n}\n}\n\n// Insert remainder of bulk ops array\nawait esConnection.client.bulk({ body: bulkOps })\nconsole.log(`Indexed Paragraphs ${paragraphs.length - (bulkOps.length / 2)} - ${paragraphs.length}\\n\\n\\n`)\n}", "title": "" }, { "docid": "f4271ca106840debb0b34a46ece1c67e", "score": "0.4964698", "text": "function filechecking2() {\n fs.readFile(\"./Files/positional.txt\", (err, data) => {\n if (err) {\n indexing(); //creation of new positional index if not in directory\n } else {\n positionalindex = JSON.parse(data);\n }\n });\n }", "title": "" }, { "docid": "7d4ef8dc56bcd9cbcbe9ffb02b678e20", "score": "0.49494514", "text": "resetIndex() {\n this._index = 0;\n }", "title": "" }, { "docid": "feb1c67f98c4807dd4fab82bca1c3875", "score": "0.49390996", "text": "async function unindexArchive (db, archive) {\n var release = await lock(`index:${archive.url}`)\n try {\n // find any relevant records and delete them from the indexes\n var recordMatches = await scanArchiveForRecords(db, archive)\n await Promise.all(recordMatches.map(match => match.table.level.del(match.recordUrl)))\n await db._indexMeta.level.del(archive.url)\n } finally {\n release()\n }\n}", "title": "" }, { "docid": "becb503532eb6112b747221911427d02", "score": "0.49222672", "text": "function handleIndex(req, res){\r\n const indexItem = []\r\n List.find({}, function(err, result){\r\n if(!err){\r\n result.forEach(function(i){\r\n indexItem.push(i)\r\n })\r\n }\r\n res.render('index', {listTitle: \"index\", indexName : indexItem})\r\n })\r\n}", "title": "" }, { "docid": "ae8845e18e9037b4087118a6758a2f19", "score": "0.49051756", "text": "function extendIndex (file, block) {\n delete file.contents\n block(file)\n file.contents = JSON.stringify(file)\n}", "title": "" }, { "docid": "6941071bfb08dda8f2b23cdc9bbf1395", "score": "0.48954183", "text": "async function clear(req, res) {\n // C R U DELETE\n try {\n await BookModel.deleteMany({});\n res.status(200).send('Cleared the Database');\n } catch (err) {\n res.status(500).send('Error in clearing the Database');\n }\n}", "title": "" }, { "docid": "6076e5d2cef5cadceaf99756584476a8", "score": "0.48735687", "text": "async function bulkPostToES(docs) {\n return new Promise((resolve, reject) => {\n const req = new AWS.HttpRequest(endpoint);\n\n req.method = 'POST';\n req.path = path.join('/', esDomain.index, '_bulk');\n req.region = esDomain.region;\n req.headers['presigned-expires'] = false;\n req.headers['Host'] = endpoint.host;\n req.headers['Content-Type'] = 'application/x-ndjson';\n req.body = '';\n for (let doc of docs) {\n req.body += '{\"index\":{}}\\n';\n req.body += `${JSON.stringify(doc)}\\n`;\n }\n\n const signer = new AWS.Signers.V4(req, 'es'); // es: service code\n signer.addAuthorization(creds, new Date());\n\n const send = new AWS.NodeHttpClient();\n send.handleRequest(req, null, function (httpResp) {\n let respBody = '';\n httpResp.on('data', function (chunk) {\n respBody += chunk;\n });\n httpResp.on('end', function (chunk) {\n if (![200, 201].includes(httpResp.statusCode)) {\n reject(`${httpResp.statusMessage} ${respBody}`);\n } else {\n resolve(respBody);\n }\n });\n }, function (err) {\n reject(err);\n });\n });\n}", "title": "" }, { "docid": "fe462d64d57d763c731c8c8b13b2f272", "score": "0.4846533", "text": "processIndex(weaver) {\n\n\t\tlet index = weaver.index;\n\n\t\tlet rootAncestorStub = this.ancestorStubFor(index.pages['/']);\n\n\t\tObject.keys(index.pages).forEach((key) => {\n\t\t\tlet page = index.pages[key];\n\n\t\t\t// Ancestors can be derived without looking at any other pages\n\t\t\t// So it can just be set directly right here.\n\t\t\tpage.ancestors = [];\n\n\t\t\tif ('/' !== key && typeof rootAncestorStub !== 'undefined') {\n\t\t\t\tpage.ancestors.push(rootAncestorStub);\n\t\t\t}\n\n\t\t\t// Split the page.key to correspond to where it lives in the folder hierarchy.\n\t\t\tlet keySegments = page.key.split('/')\n\t\t\t\t.filter((frag) => {\n\t\t\t\t\treturn '' !== frag;\n\t\t\t\t});\n\n\t\t\t// Build the page ancestroy\n\t\t\tlet path = '/';\n\t\t\tfor (let __i = 0; __i < keySegments.length - 1; __i++) {\n\t\t\t\tpath += keySegments[__i] + '/';\n\t\t\t\tlet ancestor = index.pages[path];\n\t\t\t\tif (ancestor) {\n\t\t\t\t\t// This if handles the case when a page exists at path /a/b/c.html, but either /index.html\n\t\t\t\t\t// or /a/b/index.html does not exist.\n\t\t\t\t\t// NOTE: Only the key, title and href are needed. The whole ancestor is not added in order\n\t\t\t\t\t// to prevent a recursive explosion within the index tree.\n\t\t\t\t\tpage.ancestors.push(this.ancestorStubFor(ancestor));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Because children has to be built up cumulatively by traversing the set of all pages,\n\t\t\t// it should be initialized if it doesn't exist and left alone if it's already there.\n\t\t\tif (typeof page.children === 'undefined') {\n\t\t\t\tpage.children = {};\n\t\t\t}\n\n\t\t\t// If the current page is a child ...\n\t\t\tif (keySegments.length >= 1) {\n\n\t\t\t\t// Determine the key of the parent page ...\n\t\t\t\tlet parentKey = '/';\n\t\t\t\tfor (let i = 0; i < keySegments.length - 1; i++) {\n\t\t\t\t\tparentKey += keySegments[i] + '/';\n\t\t\t\t}\n\n\t\t\t\t// ... and lookup the parent.\n\t\t\t\tlet parent = index.pages[parentKey];\n\n\t\t\t\t// The parent will not exist when the directory containing the page does not contain an index.html file.\n\t\t\t\t// This is true recursively, so it applies for all parent directories up to the content root.\n\t\t\t\t//\n\t\t\t\t// For example, consider:\n\t\t\t\t// /parent/child.html\n\t\t\t\t//\n\t\t\t\t// If /parent/index.html does not exist, there will be no page with key='/parent/'.\n\t\t\t\t// As a result, when processing /parent/child.html, the parent will be undefined.\n\t\t\t\tif (parent) {\n\n\t\t\t\t\tif (typeof parent.children === 'undefined') {\n\t\t\t\t\t\tparent.children = {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// We only care about two things:\n\t\t\t\t\t// 1) What children (if any) exist?\n\t\t\t\t\t// 2) What is the title of each child\n\t\t\t\t\tparent.children[page.key] = this.childStubFor(page);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "6fb867143e705960642f0e511fb1a15a", "score": "0.48397526", "text": "async function create_inverted_index() {\n\ttry {\n\t\t// Get all the articles and lemmas from the database\n\t\tconst lemmas = await Lemma.find({}, { name: 1, articles: 1 });\n\t\tconst articles = await Article.find({}, { _id: 1, pos_tags: 1 });\n\n\t\tconsole.log(\n\t\t\t`Creating index from ${articles.length} articles and ${lemmas.length} lemmas`\n\t\t);\n\n\t\t// Initialize the tf-idf calculator\n\t\tconst tfidf = nlpService.tfidf;\n\n\t\t// Load all the articles to the tf-idf calculator\n\t\tfor (let i = 0; i < articles.length; i++) {\n\t\t\tconst article = articles[i];\n\t\t\tconst article_lemmas = article.pos_tags.map((word) => {\n\t\t\t\treturn word.lemma;\n\t\t\t});\n\t\t\ttfidf.addDocument(article_lemmas);\n\t\t}\n\n\t\t// Calculate weight (tf-idf metric) for every lemma in the database\n\t\tfor (let i = 0; i < lemmas.length; i++) {\n\t\t\tconst lemma = lemmas[i];\n\n\t\t\ttfidf.tfidfs(lemma.name, function (index, measure) {\n\t\t\t\tif (measure > 0)\n\t\t\t\t\tlemma.set(`articles.${articles[index]._id}.weight`, measure);\n\t\t\t});\n\n\t\t\tawait lemma.save();\n\t\t}\n\n\t\tconsole.log('Inverted index was successfully created');\n\t\treturn;\n\t} catch (error) {\n\t\tthrow error;\n\t}\n}", "title": "" }, { "docid": "52321e2edf0fba8d28336ca075f960ff", "score": "0.4835322", "text": "didBuild(context) {\n const rootPath = context.project.root;\n const distDir = this.readConfig('distDir');\n const indexFileName = this.readConfig('indexFileName');\n const filePath = [rootPath, distDir, indexFileName].join('/');\n\n this.log(`Opening index file: ${ filePath }`, { verbose: true });\n const data = fs.readFileSync(filePath);\n\n if (!data) {\n throw new Error(`Error reading file: ${ filePath }`);\n }\n\n const rawBody = data.toString();\n const reWrittenBody = this._rewriteBody(rawBody);\n\n this.log(`Writing index file: ${filePath}`, { verbose: true });\n fs.writeFileSync(filePath, reWrittenBody);\n }", "title": "" }, { "docid": "68da49f3bc30d4675fc6a3497eb70e1a", "score": "0.48265812", "text": "async updateNormalised(normalisedEvent) {\n log(`${Settings.elasticIndexNormalised} Adding/Updating ${normalisedEvent.id()}`);\n try {\n await this.client.index({\n index: Settings.elasticIndexNormalised,\n id: normalisedEvent.id(),\n body: normalisedEvent.body,\n refresh: 'wait_for',\n });\n } catch (e) {\n log(`${Settings.elasticIndexNormalised} Error Adding/Updating ${normalisedEvent.id()} \\n ${e}`);\n }\n }", "title": "" }, { "docid": "a5e4618fd6a6b28c5b38b0e1d5d1d5df", "score": "0.48265004", "text": "async _loadMongoIndexes(collection) {\n\t\tlet r = await collection.indexes();\n\t\tfor (let rindex of r) {\n\t\t\tlet mindex = null;\n\t\t\tfor (let ind of this._indexes) {\n\t\t\t\tif (objtools.deepEquals(ind.spec, rindex.key) && (!ind.name || !rindex.name || ind.name == rindex.name)) {\n\t\t\t\t\tmindex = ind;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!mindex) {\n\t\t\t\tmindex = {\n\t\t\t\t\tname: rindex.name,\n\t\t\t\t\tspec: rindex.key,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tunique: !!rindex.unique\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis._indexes.push(mindex);\n\t\t\t} else {\n\t\t\t\tmindex.name = rindex.name;\n\t\t\t\tif (!mindex.options) mindex.options = {};\n\t\t\t\tmindex.options.unique = !!rindex.unique;\n\t\t\t}\n\t\t}\n\t\tthis.indexes = r;\n\t}", "title": "" }, { "docid": "cdde0711c42f5f0f625378fbcafa1860", "score": "0.48211008", "text": "function optimizeFiles() {\r\n var listOfFiles = Folder(config.edPathSource).getFiles();\r\n\r\n for (var i = 0; i < listOfFiles.length; i++) {\r\n if (listOfFiles[i] instanceof File && listOfFiles[i].hidden == false) {\r\n\r\n var docRef = open(listOfFiles[i]);\r\n\r\n //Executa Action quando a opção Pre Executar esta selecionada\r\n //Executes Action when Pre Execute option is selected\r\n if (config.chkAction == true && config.radPreExec == true) {\r\n app.doAction(config.edAction, config.edGroupAction);\r\n }\r\n\r\n if (config.chkFileNum == true || config.chkRating == true || config.chkComment == true || config.chkCheckbox == true) {\r\n\r\n //Se a action nao estiver aberta no Photoshop \r\n if (!File(\"Smart Index Action Set.ATN\").exists) {\r\n //app.load(File(\"~/Documents/Smart Index/Smart Index Action Set.ATN\")); //Carrega arquivo de Actions \r\n }\r\n //Se a action nao estiver aberta no Photoshop \r\n if (File(\"~/Documents/Smart Index/Smart Index Action Set.ATN\").exists) {\r\n // app.load(File(\"~/Documents/Smart Index/Smart Index Action Set.ATN\")); //Carrega arquivo de Actions \r\n }\r\n\r\n\r\n\r\n //prepara a foto para criar index\r\n //prepares the photo to create index\r\n if (docRef.height > docRef.width) { //Foto na Vertical - Portrait Photo\r\n var ratio = docRef.height / docRef.width;\r\n var photoOrientation = 0;\r\n if (ratio <= 1.33334) {\r\n app.doAction(\"Prepare to Index V 1.33\", \"Smart Index Action Set.ATN\");\r\n photoOrientation = 1;\r\n } else {\r\n app.doAction(\"Prepare to Index V 1.5\", \"Smart Index Action Set.ATN\");\r\n photoOrientation = 2;\r\n }\r\n } else { //Foto na Horizontal - Landscape Photo\r\n var ratio = docRef.width / docRef.height;\r\n if (ratio <= 1.33334) {\r\n app.doAction(\"Prepare to Index H 1.33\", \"Smart Index Action Set.ATN\");\r\n photoOrientation = 3;\r\n } else {\r\n app.doAction(\"Prepare to Index H 1.5\", \"Smart Index Action Set.ATN\");\r\n photoOrientation = 4;\r\n }\r\n }\r\n\r\n //saveAs(); \r\n //docRef.close(SaveOptions.DONOTSAVECHANGES);\r\n //var fileRef = new File(\"~/Documents/Smart Index/temp.jpg\"); \r\n //docRef = open(fileRef );\r\n\r\n\r\n var fileAux;\r\n var docAux;\r\n //Adiciona estrelas do Rating \r\n //Add Rating Stars\r\n if (config.chkRating == true) {\r\n\r\n if (getRating() == 0) {\r\n fileAux = new File(\"~/Documents/Smart Index/Star Rating 0.png\");\r\n docAux = open(fileAux);\r\n }\r\n if (getRating() == 1) {\r\n fileAux = new File(\"~/Documents/Smart Index/Star Rating 1.png\");\r\n docAux = open(fileAux);\r\n }\r\n if (getRating() == 2) {\r\n fileAux = new File(\"~/Documents/Smart Index/Star Rating 2.png\");\r\n docAux = open(fileAux);\r\n }\r\n if (getRating() == 3) {\r\n fileAux = new File(\"~/Documents/Smart Index/Star Rating 3.png\");\r\n docAux = open(fileAux);\r\n }\r\n if (getRating() == 4) {\r\n fileAux = new File(\"~/Documents/Smart Index/Star Rating 4.png\");\r\n docAux = open(fileAux);\r\n }\r\n if (getRating() == 5) {\r\n fileAux = new File(\"~/Documents/Smart Index/Star Rating 5.png\");\r\n docAux = open(fileAux);\r\n }\r\n\r\n\r\n switch (photoOrientation) {\r\n case 1:\r\n app.doAction(\"Add Star Rating V 1.33\", \"Smart Index Action Set.ATN\");\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 2730);\r\n break;\r\n\r\n case 2:\r\n app.doAction(\"Add Star Rating V 1.5\", \"Smart Index Action Set.ATN\");\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 2720);\r\n break;\r\n\r\n case 3:\r\n app.doAction(\"Add Star Rating H 1.33\", \"Smart Index Action Set.ATN\");\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 2020);\r\n break;\r\n\r\n case 4:\r\n app.doAction(\"Add Star Rating H 1.5\", \"Smart Index Action Set.ATN\");\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 1780);\r\n break;\r\n\r\n default:\r\n alert(\"Ouve uma falha ao detectar a proporção da foto \\n Verifique a proporção da foto \" + docRef.name);\r\n break;\r\n }\r\n //Fecha o Arquivo auxiliar \r\n //Closes the auxiliary file\r\n docAux.close(SaveOptions.DONOTSAVECHANGES);\r\n }\r\n\r\n //Adiciona Check Box\r\n //Add Checkbox\r\n if (config.chkCheckbox == true) {\r\n app.activeDocument.mergeVisibleLayers(); //merge Layers\r\n\r\n fileAux = new File(\"~/Documents/Smart Index/Check Box.png\");\r\n docAux = open(fileAux);\r\n\r\n app.doAction(\"Add Check Box\", \"Smart Index Action Set.ATN\");\r\n switch (photoOrientation) {\r\n case 1:\r\n\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 2830);\r\n break;\r\n\r\n case 2:\r\n\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 2830);\r\n break;\r\n\r\n case 3:\r\n\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 2120);\r\n break;\r\n\r\n case 4:\r\n\r\n MoveLayerTo(app.activeDocument.layers.getByName(\"Layer 1\"), 35, 1888);\r\n break;\r\n\r\n default:\r\n alert(\"Ouve uma falha ao detectar a proporção da foto \\n Verifique a proporção da foto \" + docRef.name);\r\n break;\r\n }\r\n //Fecha o Arquivo auxiliar \r\n //Closes the auxiliary file\r\n docAux.close(SaveOptions.DONOTSAVECHANGES);\r\n }\r\n\r\n //Plota os comentarios \r\n //Plot the comments\r\n if (config.chkComment == true) {\r\n createText(\"Arial\", 10, 0, 0, 0, getComment(docRef), (app.activeDocument.width / 2), app.activeDocument.height - 170);\r\n activeDocument.activeLayer.name = \"Text\";\r\n activeDocument.activeLayer.textItem.justification = Justification.CENTER;\r\n }\r\n\r\n //Renomeia a foto\r\n //Rename the Picture\r\n var newFileName = docRef.name;\r\n if (config.chkRename == true) {\r\n if (config.drpSufix == 0) {\r\n newFileName = config.edNamePrefix + i + \".jpg\";\r\n } else {\r\n newFileName = config.edNamePrefix + docRef.name;\r\n }\r\n }\r\n\r\n //Plota nome do arquivo\r\n //Plot the File Name\r\n if (config.chkFileNum == true) {\r\n createText(\"Arial-BoldMT\", 16, 0, 0, 0, newFileName, (app.activeDocument.width - 35), app.activeDocument.height - 170);\r\n activeDocument.activeLayer.name = \"Text\";\r\n activeDocument.activeLayer.textItem.justification = Justification.RIGHT;\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n\r\n //Adiciona Metadata a partir de arquivo XML e campos Autor e Palavras Chave da tela \r\n //Adds Author, Keywords fields and Metadata from the XML file. \r\n if (config.chkSeo == true) {\r\n addXMPMetaData(config.edPathMeta);\r\n // if(config.edAuthor != \"\" && config.edAuthor != undefined){\r\n // docRef.info.author = config.edAuthor; \r\n // }\r\n\r\n // if(config.edKeywords != \"\" && config.edKeywords != undefined){\r\n // docRef.info.keywords= config.edKeywords; \r\n // } \r\n docRef.info.copyrighted = CopyrightedType.COPYRIGHTEDWORK\r\n\r\n }\r\n\r\n\r\n\r\n\r\n //Otimização da imagem \r\n //Image optimization\r\n if (config.radOtimWeb == true) {\r\n var dpi = 96;\r\n } else {\r\n var dpi = 600; //config.radOtimPDF == \"true\"\r\n }\r\n\r\n\r\n //redimensionamento da imagem \r\n //image resizing\r\n var longestEdge = UnitValue(config.edLongestEdge, \"px\");\r\n\r\n if (docRef.height > docRef.width) {\r\n docRef.resizeImage(null, longestEdge, dpi, ResampleMethod.BICUBIC);\r\n } else {\r\n docRef.resizeImage(longestEdge, null, dpi, ResampleMethod.BICUBIC);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n //Executa Action quando a opção Pos Executar esta selecionada\r\n //Executes Action when After Exec option is selected\r\n if (config.chkAction == true && config.radPostExec == true) {\r\n app.doAction(config.edAction, config.edGroupAction);\r\n }\r\n\r\n\r\n\r\n //Salva o arquivo na pasta de destino\r\n //Saves the file to the destination folder\r\n /*\r\n var newFileName = docRef.name;\r\n \r\n if (config.chkRename == true) {\r\n if (config.drpSufix == 0) {\r\n newFileName = config.edNamePrefix + i + \".jpg\";\r\n } else {\r\n newFileName = config.edNamePrefix + docRef.name;\r\n }\r\n }\r\n */\r\n\r\n saveFile = new File(config.edPathTarget + \"/\" + newFileName);\r\n saveFile.resize;\r\n saveOptions = new JPEGSaveOptions();\r\n saveOptions.embedColorProfile = true;\r\n saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;\r\n saveOptions.matte = MatteType.NONE;\r\n saveOptions.quality = config.sldrQuality; //Qualidade do JPG - nível de compactacao/ JPG quality - compression level\r\n\r\n app.activeDocument.saveAs(saveFile, saveOptions, true, Extension.LOWERCASE);\r\n\r\n //Fecha o Arquivo \r\n //Closes the file\r\n docRef.close(SaveOptions.DONOTSAVECHANGES);\r\n\r\n\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a0c3d2ff0c8428a92ec391ce64316db7", "score": "0.48136613", "text": "function generateIndex(opts, files, subDir) {\n if (subDir === void 0) { subDir = ''; }\n var shouldExport = opts.export;\n var isES6 = opts.es6;\n var content = '';\n var dirMap = {};\n switch (opts.ext) {\n case 'js':\n content += '/* eslint-disable */\\n';\n break;\n case 'ts':\n content += '/* tslint:disable */\\n';\n break;\n }\n files.forEach(function (file) {\n var name = path.basename(file).split('.')[0];\n var filePath = getFilePath(opts.sourcePath, file, subDir);\n var dir = filePath.split('/')[0];\n if (dir) {\n if (!dirMap[dir]) {\n dirMap[dir] = [];\n if (shouldExport) {\n var dirName = camelcase_1.default(dir, {\n pascalCase: true\n });\n content += isES6\n ? \"export * as \" + dirName + \" from './\" + dir + \"'\\n\"\n : \"module.exports.\" + dirName + \" = require('./\" + dir + \"')\\n\";\n }\n else {\n content += isES6\n ? \"import './\" + dir + \"'\\n\"\n : \"require('./\" + dir + \"')\\n\";\n }\n }\n dirMap[dir].push(file);\n }\n else {\n if (shouldExport) {\n var fileName = camelcase_1.default(name, {\n pascalCase: true\n });\n content += isES6\n ? \"export \" + fileName + \" from './\" + filePath + name + \"'\\n\"\n : \"module.exports.\" + fileName + \" = require('./\" + filePath + name + \"')\\n\";\n }\n else {\n content += isES6\n ? \"import './\" + filePath + name + \"'\\n\"\n : \"require('./\" + filePath + name + \"')\\n\";\n }\n }\n });\n fs.writeFileSync(path.join(opts.targetPath, subDir, \"index.\" + opts.ext), content, 'utf-8');\n console.log(colors.green(\"Generated \" + (subDir ? subDir + path.sep : '') + \"index.\" + opts.ext));\n // generate subDir index.js\n for (var dir in dirMap) {\n generateIndex(opts, dirMap[dir], path.join(subDir, dir));\n }\n}", "title": "" }, { "docid": "72239c7d233d57f10db454d4be66611a", "score": "0.48052475", "text": "removeBook(index) {\n this.books.splice(index, 1);\n }", "title": "" }, { "docid": "d5795d7b2d2742512097b2725e1a34cf", "score": "0.47937852", "text": "function GenerateIndex(dirname)\n{\n // construct the files index file\n var out = CreateOutputFile(outputdir,indexFile);\n\n // write the beginning of the file\n out.writeLine('<HTML><HEADER><TITLE>File Index - directory: ' + dirname + '</TITLE><BODY>');\n out.writeLine('<H1>File Index - directory: ' + dirname + '</H1>\\n');\n out.writeLine('<TABLE WIDTH=\"90%\" BORDER=1>');\n out.writeLine('<TR BGCOLOR=0xdddddddd>');\n out.writeLine('<TD><B>File</B></TD>');\n out.writeLine('<TD><B>Description</B></TD></TR>');\n\n var separator = Packages.java.io.File.separator;\n\n // sort the index file array\n var SortedFileArray = [];\n for (var fname in indexFileArray)\n SortedFileArray.push(fname);\n SortedFileArray.sort();\n\n for (var i=0; i < SortedFileArray.length; i++) {\n var fname = SortedFileArray[i];\n \tvar htmlfile = fname.replace(/\\.js$/, \".html\");\n out.writeLine('<TR><TD><A HREF=\\\"' + htmlfile + '\\\">' + fname + '</A></TD></TD><TD>');\n\tif (indexFileArray[fname])\n\t out.writeLine(indexFileArray[fname]);\n\telse\n\t out.writeLine('No comments');\n\tout.writeLine('</TD></TR>\\n');\n }\n out.writeLine('</TABLE></BODY></HTML>');\n out.close();\n\n // construct the functions index file\n var out = CreateOutputFile(outputdir,indexFunction);\n\n // write the beginning of the file\n out.writeLine('<HTML><HEADER><TITLE>Function Index - directory: ' + dirname + '</TITLE><BODY>');\n out.writeLine('<H1>Function Index - directory: ' + dirname + '</H1>\\n');\n out.writeLine('<TABLE WIDTH=\"90%\" BORDER=1>');\n out.writeLine('<TR BGCOLOR=0xdddddddd>');\n out.writeLine('<TD><B>Function</B></TD>');\n out.writeLine('<TD><B>Files</B></TD></TR>');\n\n // sort the function array\n var SortedFunctionArray = [];\n for (var functionname in indexFunctionArray)\n SortedFunctionArray.push(functionname);\n SortedFunctionArray.sort();\n\n for (var j=0; j < SortedFunctionArray.length; j++) {\n var funcname = SortedFunctionArray[j];\n with (indexFunctionArray[funcname]) {\n\t var outstr = '<TR><TD>' + funcname + '</TD><TD>';\n\t var filelst = filename.split(\"|\");\n\t for (var i in filelst) {\n\t var htmlfile = filelst[i].replace(/\\.js$/, \".html\");\n\t outstr += '<A HREF=\\\"' + htmlfile + '#' + funcname + '\\\">' + filelst[i] + '</A>&nbsp;';\n\t }\n\t outstr += '</TD></TR>';\n\t out.writeLine(outstr);\n }\n }\n out.writeLine('</TABLE></BODY></HTML>');\n out.close();\n}", "title": "" }, { "docid": "81a3bef5443f20b55b1042a67f1cc4e0", "score": "0.47932798", "text": "resetActiveIndices({ commit }) {\n commit(RESET_ACTIVE_INDICES);\n ls.setItem('selectedIndices', '');\n }", "title": "" }, { "docid": "74fd9ac642c2fe58ab939af179868780", "score": "0.47925198", "text": "function deleteIndex() { \n return elasticClient.indices.delete({\n index: indexName\n });\n}", "title": "" }, { "docid": "4376904141e3b7f2f1f65065ffd94893", "score": "0.47854242", "text": "function createNewIndices() {\n let promises = [];\n for (indexName of indexNames) {\n let endpoint = `https://${config.elasticsearch.host}/${indexName}${suffix}`;\n let requestPromise = request.put(endpoint)\n .ca(ca)\n .send({\n // First set to these for efficient reindexing\n settings: {\n refresh_interval: -1,\n number_of_replicas: 0\n },\n mappings: mappings.mappings\n })\n .then(function (response) {\n console.log(`Index created: ${indexName}${suffix}.`);\n return response.body\n })\n\n promises.push(requestPromise);\n }\n\n return Promise.all(promises)\n .then(function (result) {\n console.log(JSON.stringify(result, null, 2));\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n })\n}", "title": "" }, { "docid": "90f6aa89b1afe8709b0d26e4f436097a", "score": "0.47776836", "text": "function build_index(cb) {\n function build_index_worker() {\n if (index_done == true) {\n cb(index);\n } else {\n setTimeout(build_index_worker, 500);\n }\n }\n if (index_started == false) {\n make_index();\n }\n build_index_worker();\n}", "title": "" }, { "docid": "9634d1f7f0a14d439c3ac4235b131654", "score": "0.4775667", "text": "async function clear(req, res) {\n try {\n await BookModel.deleteMany({});\n res.status(200).send(\"Database cleared out\");\n } catch (err) {\n res.status(500).send(\"Error in clearing database\");\n }\n}", "title": "" }, { "docid": "be6b7b7c5ea853d7e6161ada505f62df", "score": "0.47637048", "text": "function updateBooks() {\n let deleteButtons = [];\n let toggleButtons = [];\n books.forEach((book) => {\n deleteButtons.push(book.firstChild);\n toggleButtons.push(book.lastChild);\n });\n\n deleteButtons.forEach((button) => {\n button.addEventListener(\"click\", () => {\n let removeIndex = deleteButtons.indexOf(button);\n myLibrary.splice(removeIndex, 1);\n populateStorage();\n DOM.render();\n });\n });\n\n toggleButtons.forEach((button) => {\n button.addEventListener(\"click\", () => {\n let toggleIndex = toggleButtons.indexOf(button);\n myLibrary[toggleIndex].read = !myLibrary[toggleIndex].read;\n populateStorage();\n DOM.render();\n });\n });\n }", "title": "" }, { "docid": "b3ebcc2b3d42c30af0ee89e047810d3c", "score": "0.47614118", "text": "function updateExistingFiles(context) {\r\n updateHTMLFile(context, paths.index_path);\r\n}", "title": "" }, { "docid": "bc66514e5c1cf9f48c005995c5cff8f1", "score": "0.47489664", "text": "function deleteBook(index) {\n // Delete from Local storage:\n\n let Books = localStorage.getItem(\"books\");\n let bookList;\n if (Books == null) {\n bookList = [];\n } else {\n bookList = JSON.parse(Books); // returns an array\n }\n bookList.splice(index, 1);\n localStorage.setItem(\"books\", JSON.stringify(bookList));\n\n // Updating UI:\n let display3 = new DisplayBook();\n display3.showBooks();\n}", "title": "" }, { "docid": "9e0af8bd69903a1f60b8cff4544cbdcb", "score": "0.4729607", "text": "deleteIndex(resolve, // Not calling\r\n params) {\r\n if (!params || !params.hasData) {\r\n return;\r\n }\r\n const indexRequest = dto.DeleteIndexRequest.from(params);\r\n this._searchSvc.hardDelete(indexRequest).catch(console.error);\r\n }", "title": "" }, { "docid": "7738e80447839047e36576d8c19f0a59", "score": "0.47294968", "text": "ensureAllIndexes(force = false) {\n const bIndices = this.binaryIndices;\n for (const key in bIndices) {\n if (bIndices[key] !== undefined) {\n this.ensureIndex(key, force);\n }\n }\n }", "title": "" }, { "docid": "1f1d9740dd76cc5e8b062e939af46810", "score": "0.47264615", "text": "function deleteBook(index) {\n let show = new Display();\n let showmsg = new Display();\n let lStore = localStorage.getItem(\"Books\");\n if (lStore == null) {\n bookObj = [];\n //showmsg.show('warning','No Data Found!');\n } else {\n bookObj = JSON.parse(lStore);\n bookObj.splice(index, 1);\n localStorage.setItem(\"Books\", JSON.stringify(bookObj));\n showmsg.show(\"success\", \"Delete Successfull\");\n }\n show.showData();\n}", "title": "" }, { "docid": "1a55e8906f2800b425370aad60fbdb44", "score": "0.4724365", "text": "function createIndex(model) {\n model.on('es-indexed', function (err, res) {\n console.log(\"Model has been indexed!\");\n });\n }", "title": "" }, { "docid": "1307bbd283f69984f502dc7f06c55ea3", "score": "0.47185495", "text": "loadData(data) {\n Object.keys(data).forEach((path) => {\n this.i[path] = new IndexEntry(path, data[path])\n })\n this.updateMetaNodes()\n this.loaded = true\n }", "title": "" }, { "docid": "4fda44b53e72c7c788ea446d4a92f772", "score": "0.4715833", "text": "function createIndexFiles(startDir) {\n var content = '<?php\\n'\n + licenseHeader;\n + '\\n'\n + 'header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\\n'\n + 'header(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\").\" GMT\");\\n'\n + 'header(\"Cache-Control: no-store, no-cache, must-revalidate\");\\n'\n + 'header(\"Cache-Control: post-check=0, pre-check=0\", false);\\n'\n + 'header(\"Pragma: no-cache\");\\n'\n + 'header(\"Location: [loc]\");\\n'\n + 'exit;';\n\n function createIndexFile(currentDir, loc) {\n // write the index file (replacing any existing one)\n fs.writeFileSync(currentDir + '/index.php', content.replace('[loc]', loc));\n fs.chmodSync(currentDir + '/index.php', 0o755);\n\n fs.readdirSync(currentDir).forEach(function(file) {\n var currentPath = currentDir + '/' + file;\n var stat = fs.statSync(currentPath);\n\n if (stat.isDirectory()) {\n // recursively create the index.php-file in subdirectories\n createIndexFile(currentPath, loc + '../');\n }\n });\n }\n\n createIndexFile(startDir, '../');\n}", "title": "" }, { "docid": "3410bb4c5d727e8965b18d911fc5c942", "score": "0.47157854", "text": "async clear() {\n await this.read();\n try {\n //@TODO\n const result = await this.collection.deleteMany({}); //to delete everything in that collection\n } catch (err) {\n const msg = `cannot drop collection ${this.spreadsheetName}: ${err}`;\n throw new AppError(\"DB\", msg);\n }\n /* @TODO delegate to in-memory spreadsheet */\n this.mem.clear();\n }", "title": "" }, { "docid": "0c7705bcc87b17edc64bed39c70b508e", "score": "0.47029975", "text": "async function applyUpdates (db, archive, archiveMeta, updates) {\n return Promise.all(Object.keys(updates).map(async path => {\n var update = updates[path]\n if (update.type === 'del') {\n return unindexFile(db, archive, update.path)\n } else {\n return readAndIndexFile(db, archive, archiveMeta, update.path)\n }\n }))\n}", "title": "" }, { "docid": "6ae9c7a82691277a51994e33221aad56", "score": "0.46929136", "text": "async function libraryIndex(page, res, next) {\n let page_size = 8;\n const offset = page * page_size;\n\n const { count, rows } = await Book.findAndCountAll({\n where: { id: { [Op.gte]: 0 } },\n offset: offset,\n limit: page_size,\n order: [\n [\"author\", \"ASC\"],\n [\"title\", \"ASC\"],\n ],\n });\n\n let numberOfPages = count / page_size;\n if (page < numberOfPages && page >= 0) {\n res.render(\"index\", {\n books: rows,\n title: \"Library Manager\",\n pages: numberOfPages,\n currentPage: page,\n });\n } else {\n errorPush(500, next);\n }\n}", "title": "" }, { "docid": "209f5437fd50853004338c35a6d203ed", "score": "0.467618", "text": "async function indexArchive (db, archive, needsRebuild) {\n debug('Indexer.indexArchive', archive.url, {needsRebuild})\n var release = await lock(`index:${archive.url}`)\n try {\n // sanity check\n if (!db.isOpen) {\n return\n }\n if (!db.level) {\n return console.log('indexArchive called on corrupted db')\n }\n\n // fetch the current state of the archive's index\n var [indexMeta, archiveMeta] = await Promise.all([\n db._indexMeta.level.get(archive.url).catch(e => null),\n archive.getInfo()\n ])\n indexMeta = indexMeta || {version: 0}\n\n // has this version of the archive been processed?\n if (indexMeta && indexMeta.version >= archiveMeta.version) {\n debug('Indexer.indexArchive no index needed for', archive.url)\n return // yes, stop\n }\n debug('Indexer.indexArchive ', archive.url, 'start', indexMeta.version, 'end', archiveMeta.version)\n\n // find and apply all changes which haven't yet been processed\n var updates = await scanArchiveHistoryForUpdates(db, archive, {\n start: indexMeta.version + 1,\n end: archiveMeta.version + 1\n })\n debug('updates after scanning', updates)\n debug('archive after scanning', archive)\n var results = await applyUpdates(db, archive, archiveMeta, updates)\n debug('Indexer.indexArchive applied', results.length, 'updates from', archive.url)\n\n // update meta\n await Lev.update(db._indexMeta.level, archive.url, {\n _url: archive.url,\n version: archiveMeta.version // record the version we've indexed\n })\n\n // emit\n var updatedTables = new Set(results)\n for (let tableName of updatedTables) {\n if (!tableName) continue\n db[tableName].emit('index-updated', archive, archiveMeta.version)\n }\n db.emit('indexes-updated', archive, archiveMeta.version)\n } finally {\n release()\n }\n}", "title": "" }, { "docid": "fce30526febd8d3fcff0ae7bb26a10ab", "score": "0.467337", "text": "async createDefaultIndex() {\n try {\n await this.createIndex()\n } catch (error) {\n // Do Nothing\n }\n }", "title": "" }, { "docid": "d5891fce95fbb9990f80febc2c5d2fc6", "score": "0.4664675", "text": "function resetOldIndicesSettings() {\n let promises = [];\n let resetResults = {};\n for (let indexName of indexNames) {\n let endpoint = `https://${config.elasticsearch.host}/${indexName}${suffix}/_settings`;\n let requestPromise = request.put(endpoint)\n .ca(ca)\n .send({\n index: settings.settings.index\n })\n .then(function (response) {\n console.log(`Reset settings for ${indexName}${suffix} success.`);\n resetResults[indexName + suffix] = {\n success: true\n }\n })\n .catch(function (error) {\n console.log(`Reset settings for ${indexName}${suffix} failed.`);\n resetResults[indexName + suffix] = {\n success: false,\n error: error\n }\n })\n promises.push(requestPromise);\n }\n return Promise.all(promises)\n .then(function (results) {\n console.log(JSON.stringify(resetResults, null, 2));\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n })\n}", "title": "" }, { "docid": "c009b4803dc7b948d9c5d7ca41aa8874", "score": "0.46619773", "text": "updateIndex(oplog, entries) {\n this._index = oplog.ops\n }", "title": "" }, { "docid": "919e36e0d491327c7f8d49c9a941284e", "score": "0.46603918", "text": "function addingToElastic(sourceFilePath, handleError, done){\n\tvar elasticClient = new elasticDB.Client({\n\t\thost: process.env.ELASTIC_DB_HOST,\n\t\tlog: 'trace'\n\t});\n\n\t// ping Elastic server before sending data\n\telasticClient.ping({\n\t\t// ping usually has a 3000ms timeout\n\t\trequestTimeout: 1000\n\t}, function (error) {\n\t\tif (error) {handleError(new Error('ElasticSearch cluster is down @' + process.env.ELASTIC_DB_HOST));}\n\t\telse {\n\n\t\t\tvar myIndex = \"my_index-\" + Date.now();\n\n\t\t\t// Creating Index in DB\n\t\t\telasticClient.create({\tindex: myIndex, \n\t\t\t\t\t\t\t\t\ttype: \"myType\", \n\t\t\t\t\t\t\t\t\tid: 0, \n\t\t\t\t\t\t\t\t\tbody:{}\n\t\t\t\t\t\t\t\t} , function(error) {\n\t\t\t\tif (error){handleError(new Error('Index creation faild'));}\n\t\t\t\telse {\n\t\t\t\t\t// Configuring DB mapping for Grafana to link with @timeStamp\n\t\t\t\t\telasticClient.indices.putMapping({index: myIndex, type:\"myType\", body:ElasticMapping} , function(error){\n\t\t\t\t\t\tif (error){handleError(new Error('Mapping configuration faild'));}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Read JSON bulk file\n\t\t\t\t\t\t\tfs.readFile(sourceFilePath, 'utf8', function (error, data) {\n\t\t\t\t\t\t\t\tif (error) {handleError(new Error('Reading JSON file faild'));}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t// Adding bulk to DB\n\t\t\t\t\t\t\t\t\telasticClient.bulk({index: myIndex, type:\"myType\", body:data} , function(error){\n\t\t\t\t\t\t\t\t\t\tif (error){handleError(new Error('Mapping configuration faild'));}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t//Delete temporary file after reading it.\n\t\t\t\t\t\t\t\t\t\t\tfs.unlinkSync(sourceFilePath);\n\t\t\t\t\t\t\t\t\t\t\tdone('All is well\\n' + sourceFilePath);\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});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1958c0f318ce678cfd02027e46df0ebb", "score": "0.46541852", "text": "searchBooks(event) {\n event.preventDefault();\n axios('/books/search', {\n method: 'PUT',\n headers: {\n 'Authorization': `Token ${Auth.getToken()}`,\n token: Auth.getToken(),\n },\n data: {\n book: {\n query: this.state.bookQuery\n }\n }\n }).then((res) => {\n console.log(res);\n const results = res.data.data.items;\n const bookSearchData = [];\n let searchId = 1;\n for (let book of results) {\n bookSearchData.push({\n search_id: searchId,\n title: book.volumeInfo.title ? book.volumeInfo.title : null,\n author: book.volumeInfo.authors ? book.volumeInfo.authors[0] : null,\n year: book.volumeInfo.publishedDate ? book.volumeInfo.publishedDate.slice(0,4) : null,\n genre: book.volumeInfo.categories ? book.volumeInfo.categories.join(', ') : null,\n short_description: book.searchInfo ? book.searchInfo.textSnippet : null,\n description: book.volumeInfo.description ? book.volumeInfo.description : null,\n image_url: book.volumeInfo.imageLinks ? book.volumeInfo.imageLinks.thumbnail : null, \n })\n searchId++;\n }\n this.setState({\n bookSearchData: bookSearchData,\n bookQuery: '',\n redirect: '/books/search',\n });\n }).catch((err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "317c57df7d4d86e5bb012e14881e540d", "score": "0.46508458", "text": "function loopBooks() {\n content.innerHTML = '';\n for (const [index, book] of myLibrary.entries()) {\n addBookToContainer(book, index);\n }\n}", "title": "" }, { "docid": "a5595702fa8dc6262ca5f141401e6d0e", "score": "0.46481872", "text": "addToIndexes(namedNode,existingChildren){const newIndexes=map(this.indexes_,(indexedChildren,indexName)=>{const index=index_esm2017_safeGet(this.indexSet_,indexName);index_esm2017_assert(index,'Missing index implementation for '+indexName);if(indexedChildren===fallbackObject){// Check to see if we need to index everything\nif(index.isDefinedOn(namedNode.node)){// We need to build this index\nconst childList=[];const iter=existingChildren.getIterator(NamedNode.Wrap);let next=iter.getNext();while(next){if(next.name!==namedNode.name){childList.push(next);}next=iter.getNext();}childList.push(namedNode);return buildChildSet(childList,index.getCompare());}else{// No change, this remains a fallback\nreturn fallbackObject;}}else{const existingSnap=existingChildren.get(namedNode.name);let newChildren=indexedChildren;if(existingSnap){newChildren=newChildren.remove(new NamedNode(namedNode.name,existingSnap));}return newChildren.insert(namedNode,namedNode.node);}});return new IndexMap(newIndexes,this.indexSet_);}", "title": "" }, { "docid": "34d70ba5154fce25e25743e47f31f5f0", "score": "0.46467957", "text": "async componentDidMount() {\n // console.log('data componentDidMount', this.state.bookLists)\n this.rebuildIndex()\n\n // Axios.get(\"../../contents.json\")\n // .then(result => {\n // console.log('result', result)\n // const bookData = result.data\n // this.setState({ bookList: bookData.books })\n // this.rebuildIndex()\n // })\n // .catch(err => {\n // this.setState({ isError: true })\n // console.log(\"====================================\")\n // console.log(`Something bad happened while fetching the data\\n${err}`)\n // console.log(\"====================================\")\n // })\n }", "title": "" }, { "docid": "3c944e2b52be19f84145fe8a9d253c56", "score": "0.4639901", "text": "index(request, response) {\n Book.find({})\n .then(books => response.json(books))\n .catch(console.log)\n }", "title": "" }, { "docid": "6f0295a0016bf5b8226c8341c7c5f308", "score": "0.46388474", "text": "function indexTask() {\n return src(files.indexPath)\n .pipe(browser.reload({ stream: true }));\n}", "title": "" }, { "docid": "eccd911af15aeb4eec94aa2c140d0fee", "score": "0.463438", "text": "function handleIndexReady (worker) {\n postSummaryCSS(worker);\n postFoldersUpdate(worker);\n postFeedsUpdate(worker);\n}", "title": "" }, { "docid": "1d6e408333e60d8a8893251e76ee7412", "score": "0.46328926", "text": "function dropAllIndexes() {\n //\"this\" refers to the YesNO dialog box\n this.hide();\n var request = Y.io(MV.URLMap.dropAllIndexes(),\n // configuration for dropping the indexes\n {\n method: \"POST\",\n on: {\n success: function(ioId, responseObj) {\n var parsedResponse = Y.JSON.parse(responseObj.responseText),\n response = parsedResponse.response.result,\n error;\n if (response !== undefined) {\n MV.showAlertMessage(response, MV.infoIcon);\n Y.log(\"[0] dropped. Response: [1]\".format(Y.one(\"#currentColl\").get(\"value\"), response), \"info\");\n sm.clearcurrentColl();\n Y.one(\"#\" + Y.one(\"#currentDB\").get(\"value\")).simulate(\"click\");\n } else {\n error = parsedResponse.response.error;\n MV.showAlertMessage(\"Could not drop: [0]. [1]\".format(Y.one(\"#currentColl\").get(\"value\"), MV.errorCodeMap[error.code]), MV.warnIcon);\n Y.log(\"Could not drop [0], Error message: [1], Error Code: [2]\".format(Y.one(\"#currentColl\").get(\"value\"), error.message, error.code), \"error\");\n }\n },\n failure: function(ioId, responseObj) {\n Y.log(\"Could not drop [0].Status text: \".format(Y.one(\"#currentColl\").get(\"value\"), responseObj.statusText), \"error\");\n MV.showAlertMessage(\"Could not drop [0]! Please check if your app server is running and try again. Status Text: [1]\".format(Y.one(\"#currentColl\").get(\"value\"), responseObj.statusText), MV.warnIcon);\n }\n }\n });\n }", "title": "" }, { "docid": "2e840f37acd162d1112bf8876a1e925b", "score": "0.4630435", "text": "clearFiles() {\n this.setState({previews: []});\n }", "title": "" }, { "docid": "2ea1c3330bfb35399161bf3b88ede056", "score": "0.46262124", "text": "_indexRooms() {\n\t\tconst cursor = Rooms.find({ t: { $ne: 'd' } });\n\n\t\tChatpalLogger.debug(`Start indexing ${ cursor.count() } rooms`);\n\n\t\tcursor.forEach((room) => {\n\t\t\tthis.indexDoc('room', room, false);\n\t\t});\n\n\t\tChatpalLogger.info(`Rooms indexed successfully (index-id: ${ this._id })`);\n\t}", "title": "" }, { "docid": "fa2495352deec88f29fc845043ee1748", "score": "0.46227834", "text": "function init() {\n fileNames = [];\n currentIndex = -1;\n\n var filepath = config.corpusDir;\n var files = fs.readdirSync(filepath);\n const maxFiles = config.maxNoOfFilesToLearnFrom;\n if (maxFiles > 0) {\n files = files.slice(0, maxFiles);\n }\n for (var i = 0; i < files.length; i++) {\n var file = filepath + \"/\" + files[i];\n if (!fs.lstatSync(file).isDirectory()) { // Skip directories\n\n fileNames.push(file);\n }\n }\n\n console.log(\"Found \" + fileNames.length + \" files.\");\n }", "title": "" }, { "docid": "7152121c8dbaa97bd8fc74c97508b7d2", "score": "0.46184966", "text": "function clearAllSearches() \n{\n localStorage.clear();\n loadSearches(); // reload searches\n} // end function clearAllSearches", "title": "" }, { "docid": "722e7fd08667578cf92fa1f395473e6e", "score": "0.46174243", "text": "function deleteBook(e) {\n const bookDiv = e.target.parentElement.parentElement\n myLibrary.splice(bookDiv.dataset.indexNumber, 1);\n bookDiv.remove();\n saveAndReload();\n}", "title": "" }, { "docid": "66a8c6caf19f5edb841aaa088a8a0d58", "score": "0.46048033", "text": "function deleteHangingDocuments( err, result ) {\n if( err ) {\n Y.log( `Error querying documents:${ JSON.stringify( err )}`, 'error', NAME );\n callback( err );\n return;\n }\n result = (result) ? result : [];\n require( 'async' ).each( result, forHangingDocument, deleteMedia );\n }", "title": "" }, { "docid": "51ae79b63dd3cbd9e91e5f5408cd36e1", "score": "0.4604159", "text": "function clearAll () {\n rimraf.sync(getSourceFolder())\n}", "title": "" }, { "docid": "3142353fa80bd99d187047b4fd2705cf", "score": "0.45967153", "text": "function resetAll() {\n\t\tif (stream.isSearching) { \n\t\t\t$('#btnToggle').click();\n\t\t}\n\t\t\n\t\tloc.reset();\n\t\tdisplay.reset();\n\t\tentities.reset();\n\t\t\n\t\t// Attach an handler to init a new search for anything with a 'searchTerm' class. \n\t\t$('.searchTerm').click(function() {\n\t\t\tnewSearch($(this).html());\n\t\t});\t\n\t}", "title": "" }, { "docid": "d0098fddf30d9c1eb66339bcbaac1464", "score": "0.45891804", "text": "function indexMaker (c) {\n config = c\n\n configHandlebars(c)\n\n /* read the directory of posts */\n .then(() => dir.promiseFiles(config.dirs.posts))\n\n /* write all the posts to file and push them to listOfPosts array */\n .then(files => files.filter(filterOnlyMarkdownFiles).map(getListOfPosts))\n\n /* Execute */\n .then(posts => Promise.all(posts))\n\n /* Build the index page from posts.hbs */\n .then(() => buildPostsIndex())\n\n /* Log any errors */\n .catch(e => console.error(e))\n}", "title": "" }, { "docid": "5142feec617c3659204b97bef19e8877", "score": "0.45823652", "text": "function clearAllCustomers(e) {\n e.preventDefault();\n // Delete entire database\n let deleteDatabaseRequest = window.indexedDB.deleteDatabase(\"customerDataNew\");\n window.location.assign(\"index.html\");\n\n // Start a transaction to delete all customers records (not entire database)\n // let deleteAllTransaction = database.transaction([\"customersD1\"], \"readwrite\");\n // let deleteAllStore = deleteAllTransaction.objectStore(\"customersD1\");\n // let deleteAllRequest = deleteAllStore.clear();\n\n // deleteAllRequest.onsuccess = function(e){\n // let tbody = document.querySelector(\"#data tbody\");\n // tbody.innerHTML = \"\";\n // window.location.assign(\"index.html\");\n // console.log(\"Data has been deleted\");\n // };\n\n // deleteAllRequest.onerror = function(e){\n // let errorName = e.target.error.name;\n // console.log(`Error: ${errorName}`);\n // };\n}", "title": "" }, { "docid": "8ca8d46349d805bfabea8a1867221f96", "score": "0.45776936", "text": "function pouch_allDocs() {\r\n console.time('PouchDB - all docs');\r\n db.allDocs(function(err, res) {\r\n if (err) log(err);\r\n console.timeEnd('PouchDB - all docs');\r\n });\r\n}", "title": "" } ]
42d9cb64f7dbc8d96b37985e9b7343ae
Perform basic AJAX request.
[ { "docid": "93ba9903948874eec3216b7abbdbe7a7", "score": "0.0", "text": "function performRequest(URL, httpMethod, data, resultMethod) {\n logger.debugLog(\"> [\" + httpMethod + \"] \" + URL + \": \" + data);\n $.ajax({\n url: URL,\n type: httpMethod,\n dataType: 'text',\n data: data,\n error: function(e) {\n logger.debugLog(e);\n notifier.queueAlert(\"Could not connect to the server.\", \"danger\");\n },\n success: function(e) {\n logger.debugLog(e);\n resultMethod(e);\n },\n timeout: 10000\n });\n}", "title": "" } ]
[ { "docid": "62184c7cf98456dc01a4e37fd96b9050", "score": "0.7031154", "text": "function doReqest() {\n // New object of Ajax request\n new Ajax.Request('data.json', {\n method: 'get',\n onSuccess: successFn,\n onFailure: failureFn\n });\n }", "title": "" }, { "docid": "5d91c1756eea935794776cb004d3f1d6", "score": "0.6856576", "text": "function request() {\n var ajax = new _ajaxRequest.default();\n return ajax.request.apply(ajax, arguments);\n }", "title": "" }, { "docid": "4d14b9906fa055f3a2da9fadfe81ac91", "score": "0.67353135", "text": "function xhr(){\n\n\t\t\t// Creates query string of additional form input data\n\t\t\tvar data = ($.isEmptyObject(config.data)) ? '' : '&'+$.param(config.data);\n\n\t\t\t// Returns jQuery Ajax object\n\t\t\treturn $.ajax({\n\t\t\t\ttype: form.attr('method'),\n\t\t\t\turl: form.attr('action'),\n\t\t\t\tdata: form.serialize() + data,\n\t\t\t\tcache: false,\n\t\t\t\tdataType: 'json'\n\t\t\t})\n\t\t\t.always(function(){\n\n\t\t\t\t// Ends loading\n\t\t\t\tloading(false);\n\n\t\t\t})\n\t\t\t.fail(function(){\n\n\t\t\t\t// Logs XHR error\n\t\t\t\tconsole.log('XHR failed!');\n\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "3d5f482572e0cb60674cb8b90edbf698", "score": "0.6718754", "text": "function sendRequest() {\n if (window.XMLHttpRequest){\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n req.onreadystatechange = handleResponse;\n req.open(\"GET\", \"/titaniumfitness/get_list_home\", true);\n console.log(\"ABOUT TO SEND REQUEST\");\n req.send();\n}", "title": "" }, { "docid": "efce8c9a1f0ce516cbc4fedbe7c76f4e", "score": "0.669859", "text": "function makeAjaxRequest(url, method = \"GET\") {\n //logic to make the request\n}", "title": "" }, { "docid": "56fb7c24985f05fa7bf6b28a987dc0a3", "score": "0.66386163", "text": "function AjaxRequest (url, opts){\r\n var headers = {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n 'X-Prototype-Version': '1.6.1',\r\n 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'\r\n };\r\n var ajax = null;\r\n \r\n if (window.XMLHttpRequest)\r\n ajax=new XMLHttpRequest();\r\n else\r\n ajax=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \r\n if (opts.method==null || opts.method=='')\r\n method = 'GET';\r\n else\r\n method = opts.method.toUpperCase(); \r\n \r\n if (method == 'POST'){\r\n headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\r\n } else if (method == 'GET'){\r\n addUrlArgs (url, opts.parameters);\r\n }\r\n\r\n ajax.onreadystatechange = function(){\r\n// ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4\r\n if (ajax.readyState==4) {\r\n if (ajax.status >= 200 && ajax.status < 305)\r\n if (opts.onSuccess) opts.onSuccess(ajax);\r\n else\r\n if (opts.onFailure) opts.onFailure(ajax);\r\n } else {\r\n if (opts.onChange) opts.onChange (ajax);\r\n }\r\n } \r\n \r\n ajax.open(method, url, true); // always async!\r\n\r\n for (var k in headers)\r\n ajax.setRequestHeader (k, headers[k]);\r\n if (matTypeof(opts.requestHeaders)=='object')\r\n for (var k in opts.requestHeaders)\r\n ajax.setRequestHeader (k, opts.requestHeaders[k]);\r\n \r\n if (method == 'POST'){\r\n var a = [];\r\n for (k in opts.parameters)\r\n a.push (k +'='+ opts.parameters[k] );\r\n ajax.send (a.join ('&'));\r\n } else {\r\n ajax.send();\r\n }\r\n}", "title": "" }, { "docid": "09cecae7f71ada4b569ae64a7e862e11", "score": "0.66319567", "text": "function ajax(a,b,c,d){c=c||function(){},b=b||{},b.body=b.body||\"\",b.method=(b.method||\"GET\").toUpperCase(),b.headers=b.headers||{},b.headers[\"X-Requested-With\"]=b.headers[\"X-Requested-With\"]||\"XMLHttpRequest\",\"undefined\"!=typeof window.FormData&&b.body instanceof window.FormData||(b.headers[\"Content-Type\"]=b.headers[\"Content-Type\"]||\"application/x-www-form-urlencoded\"),/json/.test(b.headers[\"Content-Type\"])&&(this.encode=function(a){return JSON.stringify(b.body||{})}),\"object\"!=typeof b.body||b.body instanceof window.FormData||(b.body=u().param(b.body));var e=new window.XMLHttpRequest;u(e).on(\"error timeout abort\",function(){c(new Error,null,e)}).on(\"load\",function(){var a=/^(2|3)/.test(e.status)?null:new Error(e.status),b=parseJson(e.response)||e.response;return c(a,b,e)}),e.open(b.method,a);for(var f in b.headers)e.setRequestHeader(f,b.headers[f]);return d&&d(e),e.send(b.body),e}", "title": "" }, { "docid": "71b1606c0feba7f8f3929a5b1df848c2", "score": "0.6621468", "text": "function AjaxRequest (url, opts){\r\n var headers = {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n 'X-Prototype-Version': '1.6.1',\r\n 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'\r\n };\r\n var ajax = null;\r\n \r\n if (window.XMLHttpRequest)\r\n ajax=new XMLHttpRequest();\r\n else\r\n ajax=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \r\n if (opts.method==null || opts.method=='')\r\n method = 'GET';\r\n else\r\n method = opts.method.toUpperCase(); \r\n \r\n if (method == 'POST'){\r\n headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\r\n } else if (method == 'GET'){\r\n addUrlArgs (url, opts.parameters);\r\n }\r\n\r\n ajax.onreadystatechange = function(){\r\n// ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4\r\n if (ajax.readyState==4) {\r\n if (ajax.status >= 200 && ajax.status < 305)\r\n if (opts.onSuccess) opts.onSuccess(ajax);\r\n else\r\n if (opts.onFailure) opts.onFailure(ajax);\r\n } else {\r\n if (opts.onChange) opts.onChange (ajax);\r\n }\r\n } \r\n \r\n ajax.open(method, url, true); // always async!\r\n\r\n for (var k in headers)\r\n ajax.setRequestHeader (k, headers[k]);\r\n if (matTypeof(opts.requestHeaders)=='object')\r\n for (var k in opts.requestHeaders)\r\n ajax.setRequestHeader (k, opts.requestHeaders[k]);\r\n \r\n if (method == 'POST'){\r\n var a = [];\r\n for (k in opts.parameters){\r\n\t if(matTypeof(opts.parameters[k]) == 'object')\r\n\t\tfor(var h in opts.parameters[k])\r\n\t\t\ta.push (k+'['+h+'] ='+ opts.parameters[k][h] );\r\n\t else\r\n a.push (k +'='+ opts.parameters[k] );\r\n\t}\r\n ajax.send (a.join ('&'));\r\n } else {\r\n ajax.send();\r\n }\r\n}", "title": "" }, { "docid": "2fc313a48f60f7c4859c677929951849", "score": "0.66174555", "text": "function doAjaxCall(url) {\n \tvar xmlhttp;\n \tif (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n \t xmlhttp = new XMLHttpRequest();\n \t} else {// code for IE6, IE5\n \t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n \t}\n \txmlhttp.open(\"POST\", url, true);\n \txmlhttp.send();\n }", "title": "" }, { "docid": "3e2e93de2ccd27e62c04337945909371", "score": "0.66075826", "text": "function ajax(url, callback, data)\n{\n\tvar x = new(window.ActiveXObject||XMLHttpRequest)('Microsoft.XMLHTTP');\n\tx.open(data ? 'POST' : 'GET', url, 1);\n\tx.setRequestHeader('X-Requested-With','XMLHttpRequest');\n\tx.setRequestHeader('Content-type','application/x-www-form-urlencoded');\n\tx.onreadystatechange = function() {\n\t\tx.readyState > 3 && callback && callback(x.responseText, x);\n\t};\n\tx.send(data);\n}", "title": "" }, { "docid": "4cf2f717d139d8658779ef551d825e10", "score": "0.65845776", "text": "function makeAjaxRequest(url, method = 'GET') {\n //logic to make the request\n}", "title": "" }, { "docid": "1e091f392a68b0008754c69a1fe6d9b9", "score": "0.65473104", "text": "function getRequest() {\r\n\tif(window.XMLHttpRequest) {\r\n\t\treturn new XMLHttpRequest();\r\n\t} else if(window.ActiveXObject) {\r\n\t\treturn new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t} else {\r\n\t\talert(\"Tu navegador no soporta AJAX\"); \r\n\t}\r\n}//getRequest", "title": "" }, { "docid": "6438580af9f6d36a1a282f9f729580f3", "score": "0.65471536", "text": "function ajax(data, url, method=\"POST\", content=\"application/x-www-form-urlencoded\") {\n\tconst xhttp = new XMLHttpRequest();\n\txhttp.open(method, url, true);\n\txhttp.setRequestHeader(\"Content-type\", content);\n\txhttp.send(data);\n\txhttp.onreadystatechange = () => {\n\t\tif (this.readyState == 4 && this.status == 200) { console.log(this.responseText); }\n\t};\n}", "title": "" }, { "docid": "7e3a15c011df8b2286edae0c0474b412", "score": "0.6545607", "text": "function AjaxRequest(url, opts) {\r\n\tvar headers = {\r\n\t\t'X-Requested-With': 'XMLHttpRequest',\r\n\t\t'X-Prototype-Version': '1.6.1',\r\n\t\t'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'\r\n\t};\r\n\tvar ajax = null;\r\n\tif (DEBUG_TRACE_AJAX) logit(\"AJAX: \" + url + \"\\n\" + inspect(opts, 3, 1));\r\n\tif (window.XMLHttpRequest)\r\n\t\tajax = new XMLHttpRequest();\r\n\telse\r\n\t\tajax = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\tif (opts.method == null || opts.method == '')\r\n\t\tmethod = 'GET';\r\n\telse\r\n\t\tmethod = opts.method.toUpperCase();\r\n\tif (method == 'POST') {\r\n\t\theaders['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\r\n\t} else if (method == 'GET') {\r\n\t\taddUrlArgs(url, opts.parameters);\r\n\t}\r\n\tajax.onreadystatechange = function () {\r\n\t\t// ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4\r\n\t\tif (ajax.readyState == 4) {\r\n\t\t\tif (ajax.status >= 200 && ajax.status < 305)\r\n\t\t\t\tif (opts.onSuccess) opts.onSuccess(ajax);\r\n\t\t\t\telse\r\n\t\t\tif (opts.onFailure) opts.onFailure(ajax);\r\n\t\t} else {\r\n\t\t\tif (opts.onChange) opts.onChange(ajax);\r\n\t\t}\r\n\t}\r\n\tajax.open(method, url, true); // always async!\r\n\tfor (var k in headers)\r\n\t\tajax.setRequestHeader(k, headers[k]);\r\n\tif (matTypeof(opts.requestHeaders) == 'object')\r\n\t\tfor (var k in opts.requestHeaders)\r\n\t\t\tajax.setRequestHeader(k, opts.requestHeaders[k]);\r\n\tif (method == 'POST') {\r\n\t\tvar a = [];\r\n\t\tfor (k in opts.parameters)\r\n\t\t\ta.push(k + '=' + opts.parameters[k]);\r\n\t\tajax.send(a.join('&'));\r\n\t} else {\r\n\t\tajax.send();\r\n\t}\r\n}", "title": "" }, { "docid": "e527f7bcf94b5055d54ad20b6d264f96", "score": "0.6503727", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n }", "title": "" }, { "docid": "e527f7bcf94b5055d54ad20b6d264f96", "score": "0.6503727", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n }", "title": "" }, { "docid": "e527f7bcf94b5055d54ad20b6d264f96", "score": "0.6503727", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n }", "title": "" }, { "docid": "e527f7bcf94b5055d54ad20b6d264f96", "score": "0.6503727", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n }", "title": "" }, { "docid": "e527f7bcf94b5055d54ad20b6d264f96", "score": "0.6503727", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n }", "title": "" }, { "docid": "c1e6d24e896d1b6ad9e54aabfe7cbeb9", "score": "0.6495222", "text": "function ajax(method, url, data, success, error) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url);\r\n xhr.setRequestHeader(\"Accept\", \"application/json\");\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\r\n if (xhr.status === 200) {\r\n success(xhr.response, xhr.responseType);\r\n } else {\r\n error(xhr.status, xhr.response, xhr.responseType);\r\n }\r\n };\r\n xhr.send(data);\r\n }", "title": "" }, { "docid": "4d961b50308543025dfea586a0db87ce", "score": "0.6489206", "text": "function callRequest(url)\n{\n // Validate browser\n if (window.XMLHttpRequest)\n req = new XMLHttpRequest();\n else if (window.ActiveXObject) {\n\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } else {\n\n req = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n req.onreadystatechange = responseReady;\n req.open(\"GET\", url, true);\n req.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n req.send(null);\n\n}", "title": "" }, { "docid": "caa8bc5d2690f9e3245d022617761588", "score": "0.6488793", "text": "function ajax() {\n\n }", "title": "" }, { "docid": "5a5837f7dce0802a5d76eef55c326ea2", "score": "0.6465372", "text": "function sendRequest() {\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n req.onreadystatechange = handleResponse;\n req.open(\"GET\", \"/globalstreamjson\", true);\n req.send(); \n}", "title": "" }, { "docid": "447879c23d73d2e019a520d136cb8c39", "score": "0.6458145", "text": "function ajax(method, url, data, success, error) {\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.open(method, url);\r\n\txhr.setRequestHeader('Accept', 'application/json');\r\n\txhr.onreadystatechange = function () {\r\n\t\tif (xhr.readyState !== XMLHttpRequest.DONE) return;\r\n\t\tif (xhr.status === 200) {\r\n\t\t\tsuccess(xhr.response, xhr.responseType);\r\n\t\t} else {\r\n\t\t\terror(xhr.status, xhr.response, xhr.responseType);\r\n\t\t}\r\n\t};\r\n\txhr.send(data);\r\n}", "title": "" }, { "docid": "04c9b436a2db3391ca21b5cc2aabf91a", "score": "0.64441967", "text": "pedirAjax() {\n this.oAjax.open(\"GET\", \"http://localhost:8087/saludo.json\");\n this.oAjax.send(null);\n\t}", "title": "" }, { "docid": "a4492c7efc8eed6867248262223a602c", "score": "0.6423589", "text": "function ajax(method, url, data, success, error) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url);\r\n xhr.setRequestHeader(\"Accept\", \"application/json\");\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\r\n if (xhr.status === 200) {\r\n success(xhr.response, xhr.responseType);\r\n } else {\r\n error(xhr.status, xhr.response, xhr.responseType);\r\n }\r\n };\r\n xhr.send(data);\r\n}", "title": "" }, { "docid": "4e8705d57ff3b9a441b69ee619dcad89", "score": "0.6420976", "text": "function ajax(method, url, data, success, error) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(method, url);\n\txhr.setRequestHeader(\"Accept\", \"application/json\");\n\txhr.onreadystatechange = function() {\n\t\tif (xhr.readyState !== XMLHttpRequest.DONE) return;\n\t\tif (xhr.status === 200) {\n\t\t\tsuccess(xhr.response, xhr.responseType);\n\t\t} else {\n\t\t\terror(xhr.status, xhr.response, xhr.responseType);\n\t\t}\n\t};\n\txhr.send(data);\n}", "title": "" }, { "docid": "5834671c0d6af09e05dd24a140730e22", "score": "0.6417551", "text": "function sendGetRequest() {\n var xhr = {\n type: \"GET\",\n url: rooturl + \"api/players/0\"\n };\n xhr.success = function (result, status, xhr) {\n alert(status + \"\\n\" + result);\n };\n xhr.error = function (xhr, status, statusText) {\n alert(status + \" \" + statusText);\n };\n $.ajax(xhr);\n }", "title": "" }, { "docid": "7a4655a06b9d8c3ac29355b6ffef8a00", "score": "0.64033854", "text": "function ajax(method, url, callback, data) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4 && xhr.status == 200) {\n callback(xhr.responseText);\n }\n };\n\n xhr.send(data);\n}", "title": "" }, { "docid": "41994def3a577983131ba81cf14f9882", "score": "0.63722456", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n}", "title": "" }, { "docid": "41994def3a577983131ba81cf14f9882", "score": "0.63722456", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n}", "title": "" }, { "docid": "e495c41290acce7e0046e3de9ef8e952", "score": "0.635532", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n}", "title": "" }, { "docid": "e13c7613dac32d85a2ecbbaf9ee282fb", "score": "0.63447446", "text": "function ajax(method, url, data, success, error) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url);\r\n xhr.setRequestHeader(\"Accept\", \"application/json\");\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\r\n if (xhr.status === 200) {\r\n success(xhr.response, xhr.responseType);\r\n } else {\r\n error(xhr.status, xhr.response, xhr.responseType);\r\n }\r\n };\r\n xhr.send(data);\r\n}", "title": "" }, { "docid": "bdc9378c0aeb848105fc9805fa3bb360", "score": "0.63413984", "text": "function AJAXrequest(scriptURL) {\n\txmlHttp=GetXmlHttpObject()\nxmlHttp=GetXmlHttpObject()\nif (xmlHttp==null)\n {\n alert (\"Your browser does not support AJAX!\");\n return;\n } \n\txmlHttp.onreadystatechange=voteChanged;\n\txmlHttp.open(\"GET\",scriptURL,true);\n\txmlHttp.send(null);\n}", "title": "" }, { "docid": "2e9cc79b544217e6fbd37c75c7103909", "score": "0.6329235", "text": "function ajaxRequest (Method, URL){\r\n\t\t\treturn $.ajax({\r\n\t\t\t\tmethod: Method,\r\n\t\t\t\turl: URL\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "51d15aa4985dcfe1b654dabafc3af96f", "score": "0.6325287", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n}", "title": "" }, { "docid": "4b7549827d492483f4d253f52959ceda", "score": "0.63155735", "text": "function ajaxRequest(url, callback, errorCallback) {\n var ajax_request= false;\n\n if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n ajax_request= new XMLHttpRequest();\n if (ajax_request.overrideMimeType) {\n ajax_request.overrideMimeType('text/xml');\n }\n } else if (window.ActiveXObject) { // IE\n try {\n ajax_request= new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n ajax_request= new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {}\n }\n }\n\n if (!ajax_request) {\n // Unable to initiate the request\n errorCallback();\n return;\n }\n\n ajax_request.onreadystatechange = function() { ajaxStateChange(ajax_request, callback, errorCallback)};\n ajax_request.open('GET', url, true);\n ajax_request.send(null);\n\n }", "title": "" }, { "docid": "b6ee8f7c20c0c604892a17cf03cfa7fd", "score": "0.6311709", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n}", "title": "" }, { "docid": "b6ee8f7c20c0c604892a17cf03cfa7fd", "score": "0.6311709", "text": "function ajax(method, url, data, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState !== XMLHttpRequest.DONE) return;\n if (xhr.status === 200) {\n success(xhr.response, xhr.responseType);\n } else {\n error(xhr.status, xhr.response, xhr.responseType);\n }\n };\n xhr.send(data);\n}", "title": "" }, { "docid": "1fb12056e70dffbe11f92059e1a436c8", "score": "0.6311521", "text": "function ajax (url, method, params, container_id, loading_text) \n{\n try \n { \n // For: chrome, firefox, safari, opera, yandex, ...\n \txhr = new XMLHttpRequest();\n } \n catch(e) \n {\n try\n { \n // for: IE6+\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } \n catch(e1) \n { \n // if not supported or disabled\n alert(\"Not supported!\");\n }\n }\n \n xhr.onreadystatechange = function() \n {\n // Holds the status of the XMLHttpRequest. Changes from 0 to 4: \n // 0: request not initialized \n // 1: server connection established\n // 2: request received \n // 3: processing request \n // 4: request finished and response is ready\n // \n // ref: http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp\n if(xhr.readyState === 4) \n { \n // when result is ready\n document.getElementById(container_id).innerHTML = xhr.responseText;\n } \n else \n { \n // waiting for result \n document.getElementById(container_id).innerHTML = loading_text;\n }\n };\n \n // send reuquest using ajax\n xhr.open(method, url, true);\n xhr.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n xhr.send(params);\n}", "title": "" }, { "docid": "9981cc3e0797f04970853ff970b24bd9", "score": "0.6302071", "text": "function Request() {\n var url = \"http://127.0.0.1:5000/getinfo\";\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n bikedata = JSON.parse(xmlhttp.responseText);\n initialize(bikedata);\n formDropDown(bikedata);\n }\n };\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "d492b811bb94f6c3d7e5127efe005e8b", "score": "0.6298779", "text": "function ajax(method,data,callback) {\n data.method = method;\n $.post('/ajax',data,function(d,r,o) {\n if(callback) callback(o.responseText);\n });\n}", "title": "" }, { "docid": "d492b811bb94f6c3d7e5127efe005e8b", "score": "0.6298779", "text": "function ajax(method,data,callback) {\n data.method = method;\n $.post('/ajax',data,function(d,r,o) {\n if(callback) callback(o.responseText);\n });\n}", "title": "" }, { "docid": "6914b6033093cc0d44f832f23f0f654a", "score": "0.628719", "text": "function makeAJAXCall(endpoint, data) {\n\n\tvar http = new XMLHttpRequest();\n\tvar url = endpoint;\n\tvar params = data;\n\thttp.open('POST', url, false)\n\n\tconsole.log(\"AJAX URL: \" + url);\n\t//console.log(\"params: \" + params)\n\n\t\n\t//Send the proper header information along with the request\n\thttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\t\n\thttp.onreadystatechange = function() {//Call a function when the state changes.\n\t if( http.status == 200) {\n\t\tconsole.log(url + \" response:\" + http.responseText);\n\t\tdocument.getElementById(\"responseText\").innerHTML = http.responseText;\n\t } \n\t}\n\thttp.send(params);\n}", "title": "" }, { "docid": "dfa175481afb71807aab29215a4ee72f", "score": "0.6271111", "text": "function ajaxRequest(url, method, data, callback, json) {\n\n\tlet request = new XMLHttpRequest();\n\trequest.open(method, url, true);\n\n\trequest.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n\t\n\tif (method == \"POST\") {\n\t\trequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t}\n\n\trequest.onreadystatechange = function() {\n\t\t// IF REQUEST IS READY TO BE PROCCESS\n\t\tif (request.readyState === 4) {\n\t\t\t// IF REQUEST WAS SUCCESSFUL\n\t\t\tif (request.status === 200) {\n\t\t\t\t// GET RESPONSE AND CALLBACK\n\t\t\t\tif (json){\n\t\t\t\t\tresponse = JSON.parse(request.responseText);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tresponse = request.responseText;\n\t\t\t\t}\n\n\t\t\t\tcallback(response);\n\t\t\t} else {\n\t\t\t\thandleError(request.statusText);\n\t\t\t}\n\t\t}\n\t}\n\n\trequest.send(data);\t\n}", "title": "" }, { "docid": "e6ae4b9dfb31dc9c0b4a4401de2d790e", "score": "0.6256684", "text": "function ajax(element, meth, URL, readyFun, error404) {\n\t\tif (window.XMLHttpRequest) {var xmlhttp=new XMLHttpRequest();}\n\t\telse {var xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");}\n\t\t\n\t\txmlhttp.onreadystatechange=function() {\n\t\t\tif (xmlhttp.readyState==4 && xmlhttp.status==200) {\n\t\t\t\telement.innerHTML=xmlhttp.responseText;\n\t\t\t\tif (typeof readyFun===\"function\") {readyFun();}\n\t\t\t}\n\t\t\telse if (typeof error404===\"function\" && xmlhttp.status==404) {error404();}\n\t\t}\n\t\t\n\t\txmlhttp.open(((meth)?meth:\"GET\"), URL, true);\n\t\txmlhttp.send();\n\t}", "title": "" }, { "docid": "3cde2ab6bd3b91824e22319e6ef67ded", "score": "0.62513727", "text": "function ajax(url, type, data, callBack) {\n // define the default HTTP method\n type = type || 'GET';\n // assign jQuery ajax method to res variable\n var res = $.ajax({\n url: url,\n type: type,\n data: data\n });\n // if the request success will call the callback function\n res.success(function(data) {\n callBack(data);\n });\n // if failed dispaly the error details\n res.fail(function(err) {\n console.error('response err', err.status);\n });\n }", "title": "" }, { "docid": "747334697a54920cee0544d10a326a14", "score": "0.62383556", "text": "function ajax_request(url, success_func, error_func) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.onreadystatechange = function() {\n\t\t\tif(xhr.readyState == 4) {\n\t\t\t\t// xhr.status = 0 because of some file:// protocol crap\n\t\t\t\tif(xhr.status == 200 || xhr.status == 0) {\n\t\t\t\t\tif(xhr.responseText !== \"\") {\n\t\t\t\t\t\tsuccess_func.call(undefined, JSON.parse(xhr.responseText));\n\t\t\t\t\t} else { //empty response text\n\t\t\t\t\t\terror_func.call(undefined, {\n\t\t\t\t\t\t\tname: \"Request Error\",\n\t\t\t\t\t\t\tmessage: \"Oops! Something unexpected went\\\n\t\t\t\t\t\t\t\t\t\t\t\twrong while making your request.\\nResp: \"\n\t\t\t\t\t\t\t + xhr.responseText + \"\\nStatus: \" + xhr.status\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else if(xhr.status == 404) { //404 error, not found\n\t\t\t\t\terror_func.call(undefined, {\n\t\t\t\t\t\tname: \"Not Found\",\n\t\t\t\t\t\tmessage: \"404 error, page not found\"\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\terror_func.call(undefined, {\n\t\t\t\t\t\tname: \"Request Error\",\n\t\t\t\t\t\tmessage: \"Oops! Something unexpected went\\\n\t\t\t\t\t\t\t\t\t\t\twrong while making your request.\\nStatus: \"\n\t\t\t\t\t\t + xhr.status\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\txhr.open(\"GET\", url, true);\n\t\txhr.send();\n\t}", "title": "" }, { "docid": "5b0b6248e85c1d2fa63f2bd7c3cbcc10", "score": "0.6230087", "text": "function ajaxEvent(data) {\n var xhttp = false;\n var self = this;\n //Verifico se il browser supporta l'oggetto XMLHttpRequest oppure no\n if (window.XMLHttpRequest) {\n self.xhttp = new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n self.xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n // Valuto lo stato della richiesta \n self.xhttp.onreadystatechange = function () {\n if (self.xhttp.readyState === 4 && self.xhttp.status === 200) {\n makeResponse(self.xhttp.responseText);\n }\n };\n //specifico il tipo di richiesta\n self.xhttp.open('POST', 'index.php', true);\n self.xhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n //invio la richiesta al server\n self.xhttp.send('operation=' + data);\n}", "title": "" }, { "docid": "9dd7280e985297bb50a0c0ad67fe42d8", "score": "0.62228703", "text": "function ajax (action, opt, done, before) {\n done = done || function () {};\n\n // A bunch of options and defaults\n opt = opt || {};\n opt.body = opt.body || {};\n opt.method = (opt.method || 'GET').toUpperCase();\n opt.headers = opt.headers || {};\n\n // Tell the back-end it's an AJAX request\n opt.headers['X-Requested-With'] = opt.headers['X-Requested-With'] || 'XMLHttpRequest';\n\n if (typeof window.FormData === 'undefined' || !(opt.body instanceof window.FormData)) {\n opt.headers['Content-Type'] = opt.headers['Content-Type'] || 'application/x-www-form-urlencoded';\n }\n\n // If it's of type JSON, encode it as such\n if (/json/.test(opt.headers['Content-Type'])) {\n opt.body = JSON.stringify(opt.body);\n }\n\n if ((typeof opt.body === 'object') && !(opt.body instanceof window.FormData)) {\n opt.body = u().param(opt.body);\n }\n\n // Create and send the actual request\n var request = new window.XMLHttpRequest();\n\n // An error is just an error\n // This uses a little hack of passing an array to u() so it handles it as\n // an array of nodes, hence we can use 'on'. However a single element wouldn't\n // work since it a) doesn't have nodeName and b) it will be sliced, failing\n u(request).on('error timeout abort', function () {\n done(new Error(), null, request);\n }).on('load', function () {\n // Also an error if it doesn't start by 2 or 3...\n // This is valid as there's no code 2x nor 2, nor 3x nor 3, only 2xx and 3xx\n // We don't want to return yet though as there might be some content\n var err = /^(4|5)/.test(request.status) ? new Error(request.status) : null;\n\n // Attempt to parse the body into JSON\n var body = parseJson(request.response) || request.response;\n\n return done(err, body, request);\n });\n\n // Create a request of the specified type to the URL and ASYNC\n request.open(opt.method, action);\n\n // Set the corresponding headers\n for (var name in opt.headers) {\n request.setRequestHeader(name, opt.headers[name]);\n }\n\n // Load the before callback before sending the data\n if (before) before(request);\n\n request.send(opt.body);\n\n return request;\n}", "title": "" }, { "docid": "310cecff7b22fe7f6fbf444e8d39faff", "score": "0.62206846", "text": "function get(url, success, error)\n{\n $.ajax({\n async: true,\n crossDomain: true,\n method: \"GET\",\n url: url,\n contentType: \"application/x-www-form-urlencoded\",\n dataType: \"text/json\",\n success: success,\n error: error\n }).done(function (msg) {\n if (console && console.log) {\n console.log(\"Sample of data:\", msg.slice(0, 100));\n }\n }).fail(function( jqXHR, textStatus ) {\n alert( \"Request failed: \" + textStatus );\n });\n}", "title": "" }, { "docid": "c87c1a00aab75a78703d243c814cf477", "score": "0.6216326", "text": "function ajax( url, callback ){\n\n\t//console.log( url );\n\n\tvar req = new XMLHttpRequest();\n\tvar self = this;\n\n\treq.open(\"GET\",url,true);\n\treq.send(null);\n\treq.onerror = function(){\n\t\tconsole.log(\"there was an error with your request\");\n\t};\n\treq.onload = function(e){\n\t\t// graceful parsing\n\t\ttry{\n\t\t\tvar response = JSON.parse(e.target.responseText);\n\t\t\tcallback.call(self, response);\n\t\t} catch( e ){\n\t\t\tif( DEBUG ) console.log( e );\n\t\t\tcallback.call(self, false);\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "f41b468e019c4b89db58b30c8a6f3b70", "score": "0.6213835", "text": "function ajax(url, verb, data={}, success=r=>console.log(r), dataType='html'){//defaulting to html\n $.ajax({url:url, type:verb, dataType:dataType, data:data, success:success});\n }", "title": "" }, { "docid": "0aca05150798b153a1617db64e9e5de1", "score": "0.620701", "text": "function Request(url = null, data = null, method = 'post') {\n return $.ajax({\n \"url\": url,\n \"type\": method, // request type\n \"dataType\": \"json\", // expected data type\n \"data\": data,\n });\n }", "title": "" }, { "docid": "7ff3a1274f5b6ef6ef8b0112f8a202ab", "score": "0.61934006", "text": "function loadAJAX()\n{\nif (window.XMLHttpRequest)\n{\nxmlhttp=new XMLHttpRequest();\n}\nelse\n{\nxmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n}\nreturn xmlhttp;\n}", "title": "" }, { "docid": "6d2575e4d79819716c9ebc99c518d07a", "score": "0.6186436", "text": "function Ajax() {\n\n }", "title": "" }, { "docid": "89e67036b7a7c5d4847b02a6e137f5b2", "score": "0.6178104", "text": "execute() {\n this.setUrl();\n $.ajax(this.settings);\n }", "title": "" }, { "docid": "17eb3d69a1587b6d2687718be257284a", "score": "0.6175734", "text": "function ajax(meth, url) {\n\tvar x = new XMLHttpRequest();\n\tx.open(meth, url, true);\n\tx.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\treturn x;\n}", "title": "" }, { "docid": "1acf606c88fe0dfa7ab79248339e74f0", "score": "0.6174128", "text": "function Ajax() {\n var xhr = new XMLHttpRequest();\n this.get = function (fetchFunc, options, cb) {\n if (fetchFunc === true) {\n var err,\n response = {};\n fetch(options.url, {\n method: options.method ? options.method : \"get\",\n mode: options.mode ? options.mode : \"\",\n headers: options.headers ? options.headers : {}\n }).then(function (res) {\n response.res = res;\n return res.json();\n }).then(function (data) {\n response.data = data\n return cb(err, response);\n }).catch(function (error) {\n err = error;\n return cb(err, response);\n });\n } else {\n xhr.open(\"get\", options.url, options.async ? options.async: true);\n if (options.type) {\n this.responseType = options.type;\n }\n if (options.headers) {\n Object.keys(options.headers).forEach(function (index) {\n xhr.setRequestHeader(index, options.headers[index]);\n });\n }\n xhr.setRequestHeader(\"ajax\", \"express\");\n xhr.onreadystatechange = function () {\n if (this.readyState === 0) {\n if (options.beforStart) {\n options.beforStart();\n }\n }\n if (this.readyState === 1) {\n if (options.onStart) {\n options.onStart(xhr);\n }\n }\n if (this.readyState === 3) {\n if (options.onProgress) {\n options.onProgress(xhr);\n }\n }\n var err;\n var data;\n if (this.readyState === 4) {\n if (this.status === 404 || this.status === 403 || this.status === 500) {\n err = {status: this.status};\n }\n if (this.readyState === 4 && this.status === 200) {\n data = {response: this.response, responseText: this.responseText, responseUrl: this.responseURL, responseXML: this.responseXML, responseType: this.responseType};\n }\n return cb(err, data);\n }\n };\n xhr.send();\n }\n }\n this.post = function (options, cb) {\n var err;\n var data;\n var formData = new FormData();\n if (options.url) {\n xhr.open(\"post\", options.url, options.async ? options.async : true);\n if (options.headers) {\n Object.keys(options.headers).forEach(function (index) {\n xhr.setRequestHeader(index, options.headers[index]);\n });\n }\n if (options.fullAjax) {\n return fullAjax(this);\n }\n if (options.data) {\n if (options.upload) {\n var file;\n file = options.upload.file;\n Array.from(file).forEach(function (fil) {\n formData.append(options.upload.fileName, fil);\n });\n if (options.upload.onload) {\n xhr.upload.onload = function (e) {\n return options.upload.onload(e);\n }\n }\n if (options.upload.onprogress) {\n xhr.upload.onprogress = function (e) {\n return options.upload.onprogress(e);\n }\n }\n if (options.upload.onerror) {\n xhr.upload.onerror = function (e) {\n return options.upload.onerror(e);\n }\n }\n }\n if (typeof options.data === \"object\") {\n Object.keys(options.data).forEach(function (item) {\n formData.append(item, options.data[item]);\n });\n options.data = formData;\n } else if (typeof options.data === \"string\") {\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n }\n xhr.setRequestHeader(\"ajax\", \"express\");\n if (options.onabort) {\n xhr.onabort = function (e) {\n\n return options.onabort(e);\n };\n }\n xhr.onreadystatechange = function () {\n if (this.readyState === 0) {\n if (options.beforStart) {\n options.beforStart();\n }\n }\n if (this.readyState === 1) {\n if (options.onStart) {\n options.onStart();\n }\n }\n if (this.readyState === 3) {\n if (options.onProgress) {\n options.onProgress();\n }\n }\n\n if (this.status === 404 || this.status === 403 || this.status === 500) {\n err = {status: this.status};\n }\n if (this.readyState === 4 && this.status === 200) {\n data = {response: this.response, responseText: this.responseText, responseUrl: this.responseURL, responseXML: this.responseXML, responseType: this.responseType};\n }\n if (cb) {\n return cb(err, data);\n }\n };\n xhr.send(options.data);\n } else {\n err = new Error(\"bad request\");\n return console.error(\"cannot send empty data\");\n }\n } else {\n err = new Error(\"bad request\");\n return console.error(\"cannot send empty url\");\n }\n }\n }", "title": "" }, { "docid": "5db100254ec29b6e2c0f99648dd6a6b3", "score": "0.61600065", "text": "function ajax(url, vars, callbackFunction) {\n var request = new XMLHttpRequest();\n request.open(\"POST\", url, true);\n request.setRequestHeader(\"Content-Type\",\n \"application/x-www-form-urlencoded\");\n\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n if (request.responseText) {\n callbackFunction(request.responseText);\n }\n }\n };\n request.send(vars);\n}", "title": "" }, { "docid": "f82fa4d79e9940e9e085848ac40274ea", "score": "0.61596864", "text": "function Ajax() {\n \n // -------------------------------------------------------------------------\n // A function which will try to parse a string to a JSON object.\n // If the object was not a valid JSON object then the string is returned.\n // -------------------------------------------------------------------------\n function try_to_parse_json(string) {\n try {\n string = JSON.parse(string);\n } catch(exception) {}\n return string;\n }\n \n // -------------------------------------------------------------------------\n // This function handles callbacks.\n // -------------------------------------------------------------------------\n function handle_callback(callback, callback_arguments) {\n \n // Check the callback function exists.\n if (callback !== undefined) {\n \n // Check we can call apply on the callback function.\n if (callback.apply === undefined) {\n throw \"Callback function \" + callback.toString() + \" has no apply method\";\n }\n\n // If we have no arguments then set them to be an empty array.\n if (callback_arguments === undefined) {\n callback_arguments = [];\n }\n\n // Apply the callback.\n callback.apply(window, callback_arguments);\n }\n }\n \n // -------------------------------------------------------------------------\n // Perform an AJAX request and pass the response back to a callback.\n // -------------------------------------------------------------------------\n this.call = function ajax___call(file_path, optional_callback, optional_callback_arguments) {\n \n // Build a new XHR object and set the ready state change event handler.\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n \n // Get the response and try to parse it.\n var response = try_to_parse_json(this.responseText);\n \n // Add the response to the callback arguments if we have any.\n var callback_arguments = [response];\n if (optional_callback_arguments !== undefined) {\n callback_arguments.concat(optional_callback_arguments);\n }\n \n // Call the callback.\n handle_callback(optional_callback, callback_arguments);\n }\n };\n \n // Set the file path of the request and send it.\n xhr.open(\"GET\", file_path, true);\n xhr.send();\n };\n\n // -------------------------------------------------------------------------\n // Load the result of an AJAX call into a DOM element.\n // -------------------------------------------------------------------------\n this.load = function ajax___load(dom_element, file_path, optional_callback, optional_callback_arguments) {\n \n // If we are loading the response into an iframe then just set the src\n // on the iframe instead.\n if (dom_element.nodeName.toLowerCase() === \"iframe\") {\n dom_element.src = file_path\n handle_callback(optional_callback, optional_callback_arguments);\n \n // Otherwise set up an AJAX call with a specific callback.\n } else {\n this.call(file_path, function(response) {\n dom_element.innerHTML = response;\n handle_callback(optional_callback, optional_callback_arguments);\n });\n }\n };\n \n // -------------------------------------------------------------------------\n // Send the results of an AJAX call into a native alert.\n // -------------------------------------------------------------------------\n this.alert = function ajax___alert(file_path, optional_callback, optional_callback_arguments) {\n this.call(file_path, function(response) {\n alert(response);\n handle_callback(optional_callback, optional_callback_arguments);\n });\n };\n \n // -------------------------------------------------------------------------\n // Similar to the alert function but instead the response will appear in a\n // UI status strip.\n // -------------------------------------------------------------------------\n this.status = function ajax___status(file_path, optional_timeout, optional_callback, optional_callback_arguments) {\n this.call(file_path, function(response) {\n ui.status(response, optional_timeout);\n handle_callback(optional_callback, optional_callback_arguments);\n });\n }\n}", "title": "" }, { "docid": "6a9aef13a965439f0df2327460caf7b2", "score": "0.6150434", "text": "function ajaxFunction(url)\r\n{\r\n var xmlhttp;\r\n if (window.XMLHttpRequest) {\r\n xmlhttp=new XMLHttpRequest();\r\n } else if (window.ActiveXObject) {\r\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } else {\r\n alert(\"Your browser does not support XMLHTTP!\");\r\n }\r\n\r\n xmlhttp.onreadystatechange=function() {\r\n if(xmlhttp.readyState==4) {\r\n if (xmlhttp.status==200) {\r\n // Send all valid responses to pmRaw().\r\n pmRaw(xmlhttp.responseText);\r\n } else {\r\n clearInterval(my_int_id);\r\n alert(\"Problem retrieving XML data: (\"+xmlhttp.status+\") (\" + xmlhttp.statusText+\")\");\r\n }\r\n }\r\n }\r\n xmlhttp.open(\"GET\",url,true);\r\n xmlhttp.send(null);\r\n}", "title": "" }, { "docid": "67e1f4a2869856be5d37d0174490d52c", "score": "0.613738", "text": "function getTodosAJAX() {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"/api/todos\", true);\n xhr.onreadystatechange = function () {\n if(xhr.readyState == RESPONSE_DONE){\n if(xhr.status == STATUS_OK){\n //console.log(xhr.response);\n addTodoElements(TODO_LIST_ID_ACTIVE, xhr.response);\n addTodoElements(TODO_LIST_ID_COMPLETE, xhr.response);\n addTodoElements(TODO_LIST_ID_DELETED, xhr.response);\n }\n }\n };\n xhr.send(data=null);\n}", "title": "" }, { "docid": "84ec9dbdb988e7a1478c351767e83287", "score": "0.6136553", "text": "function callAjax(){\n console.log(\"Clicked\");\n $.ajax({\n type: \"GET\", \n url: mainURL,\n dataType: \"XML\",\n success: parseXML,\n error: function (request, status, error) {\n console.log(request.responseText);\n }\n });\n}", "title": "" }, { "docid": "bb56e48978dff74e5574cb2ad12d697d", "score": "0.61352736", "text": "function doAjax(params, callback_success, callback_complete, callback_error) {\n\t$.ajax({\n\t\turl: \"controller.php\"\n\t\t, method: \"post\"\n\t\t, data: params\n\t\t, success: callback_success\n\t\t, complete: callback_complete\n\t\t, error: callback_error\n\t});\n}", "title": "" }, { "docid": "5ec622b87d138e9b8ab8e4121e52bc27", "score": "0.6131451", "text": "function quotes() {\n new Ajax.Request(\"quotes.xml\",\n {\n method: \"GET\",\n onSuccess: showQuotes,\n onFailure: ajaxFailed,\n onException: ajaxFailed\n });\n}", "title": "" }, { "docid": "6221b7349af4b5a3ec1521c19c4e06f6", "score": "0.612032", "text": "function _ajax(options){\n/*\n This is not a general ajax function, \n just something that is good enough for Xmla.\n*/\n var xhr,\n handlerCalled = false,\n handler = function(){\n handlerCalled = true;\n switch (xhr.readyState){\n case 0:\n options.aborted(xhr); \n break;\n case 4:\n if (xhr.status===200){\n options.complete(xhr);\n }\n else {\n options.error(\n Xmla.Exception._newError(\n \"HTTP_ERROR\",\n \"_ajax\",\n options\n )\n );\n }\n break;\n }\n };\n if (_useAX) {\n xhr = new ActiveXObject(\"MSXML2.XMLHTTP.3.0\");\n } \n else {\n xhr = new XMLHttpRequest();\n }\n if (options.username && options.password) {\n xhr.open(\n \"POST\", options.url, options.async, \n options.username, options.password\n );\n } else {\n xhr.open(\"POST\", options.url, options.async);\n }\n xhr.onreadystatechange = handler;\n xhr.setRequestHeader(\"Content-Type\", \"text/xml\");\n xhr.send(options.data);\n if (!options.async && !handlerCalled){\n handler.call(xhr);\n } \n return xhr;\n}", "title": "" }, { "docid": "0dfc0d73b8af787e4664b7e00cb18535", "score": "0.6111536", "text": "function makeAjaxRequest(ajaxFunc, callBack, paramName, paramValue, htmlID, defaultHtml){\n\n if (window.XMLHttpRequest) {\n http = new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n http = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n var url = '../../ajax.php?';\n if(paramName.length > 0) {\n var fullurl = url + 'do=' + ajaxFunc + '&' + paramName + '=' + encodeURIComponent(paramValue);\n http.open(\"GET\", fullurl, true);\n http.send(null);\n http.onreadystatechange = callBack;\n }else{\n document.getElementById(htmlID).innerHTML = defaultHtml;\n }\n \n}", "title": "" }, { "docid": "7fa14538200d428c55d3545bd9680f51", "score": "0.6097532", "text": "function ajax(url, callback) {\n\tvar requestURL = NSURL.URLWithString(url);\n\tvar request = NSURLRequest.requestWithURL(requestURL);\n\tvar response = NSURLConnection.sendSynchronousRequest_returningResponse_error(request, null, null);\n\treturn callback(response);\n}", "title": "" }, { "docid": "02c3534c55a2af85daa38ebff757718c", "score": "0.60813755", "text": "function ajax(method, data, fn) {\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: '../MyClosetAPI.asmx/' + method,\n\t\t\tdataType: 'json',\n\t\t\tdata: data,\n\t\t\tsuccess: fn\n\t\t});\n\t}", "title": "" }, { "docid": "793209ea1ea534118c80f8a01dccb717", "score": "0.60702443", "text": "function ajaxCall() {\n $.ajax({\n method: 'GET',\n url: endpoint,\n dataType: 'Json',\n success: onSuccess,\n error: onError\n }); //<== end of .ajax\n}", "title": "" }, { "docid": "bd7428964e80f6330ced9edeba83e25b", "score": "0.6068708", "text": "function myAjax(obj) {\n var xhr = new XMLHttpRequest();\n var url = obj.url;\n var data = null;\n if (obj.type == 'get') {\n if (obj.data) {\n url += url.indexOf('?') == -1 ? '?' : '&';\n for (k in obj.data) {\n url += k + '=' + obj.data[k] + '&';\n }\n url = url.slice(0, -1);\n }\n } else if (obj.type == 'post') {\n data = '';\n for (k in obj.data) {\n data += k + '=' + obj.data[k] + '&';\n }\n data = data.slice(0, -1);\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {\n obj.success(JSON.parse(xhr.responseText));\n } else {\n obj.error(new Error);\n }\n }\n }\n console.log(data);\n xhr.open(obj.type, url, false);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send(data);\n}", "title": "" }, { "docid": "899c9339e043ab3574afcb1b448ae01b", "score": "0.6059049", "text": "function ajaxRequestArticle(value)\n{\n \n var xmlHttp = getXMLHttp();\n \n xmlHttp.onreadystatechange = function()\n {\n if(xmlHttp.readyState == 4) {\n handleArticleResponse(xmlHttp.responseText);\n } else {\n \n }\n }\n\n if(value != '') {\n xmlHttp.open(\"GET\", \"../public/plugins/ajax/articleRequest.php?article_id=\"+value, true);\n xmlHttp.send();\n }\n \n}", "title": "" }, { "docid": "d865af910126e017d06491c003112aed", "score": "0.60571855", "text": "function ajax(options, path, success, error) {\n let xhr = new XMLHttpRequest();\n\n xhr.addEventListener('readystatechange', function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n if (options.success) {\n // Call success handler\n options.success(xhr.responseText);\n }\n } else if (options.error) {\n // Call error handler\n options.error(xhr);\n }\n }\n });\n\n xhr.open(options.method || 'GET', options.path, options.async || true);\n xhr.send();\n}", "title": "" }, { "docid": "d86f712d8a68fad5e11f4cdd2cd7e9bb", "score": "0.604987", "text": "function ajax(options){\n\t\tvar method = (options.method || 'GET').toUpperCase(),\n\t\t\tasync = (undefined == typeof options.async) ? true : options.async,\n\t\t\tonError = options.onerror,\n\t\t\tcallBack = options.callback,\n\t\t\tdata_type = (options.data_type || 'text').toUpperCase(),\n\t\t\theaders = options.headers || [],\n\t\t\tdata = options.data || null\n\n\t\tfunction _appendUrl(url , append){\n\t\t\treturn (url.indexOf('?')<0? '?':'&') + append\n\t\t\t}\n\t\tif (data) {\n\t\t\tdata = fn.http_build_query(data)\n\t\t\tif ('POST' != method ) options.url += _appendUrl(options.url , data)\n\t\t\t}\n\n\t\tif ('JSONP' == method || 'SCRIPT' == method){\n\t\t\tvar l = document.createElement('script')\n\t\t\tl.type = 'text/javascript'\n\t\t\tl.onerror = l.onload = l.onreadystatechange = function() {\n\t\t\t\t\tvar state = this.readyState\n\t\t\t\t\tif (!state || 'loaded' == state || 'complete' == state)\n\t\t\t\t\t\thead.removeChild(l)\n\t\t\t\t}\n\t\t\tif (callBack) {\n\t\t\t\tvar callBackId = '_' + jsonp_callId++\n\n\t\t\t\toptions.url += _appendUrl(options.url , '_callback='+callBackId)\n\n\t\t\t\twindow[callBackId] = function(){\n\t\t\t\t\tcallBack.apply(null ,arguments);\n\t\t\t\t\t//delete window[callBackId]\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tvar head = document.head || document.getElementsByTagName('head')[0] || document.documentElement\n\t\t\tl.src = options.url\n\t\t\thead.appendChild(l)\n\t\t\treturn\n\t\t\t}\n\n\t\tvar xhr = new newXHR\n\t\txhr.onreadystatechange = function(){\n\t\t\tif(xhr.readyState == 4 && xhr.status == 200) {\n\t\t\t\tif (callBack) {\n\t\t\t\t\tif ('HEAD' == data_type) {\n\t\t\t\t\t\tvar headers = xhr.getAllResponseHeaders().split(\"\\n\")\n\t\t\t\t\t\tvar result = {}\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\tfn.map(headers , function(head){\n\t\t\t\t\t\t\thead = head.split(':')\n\t\t\t\t\t\t\tvar h_k = head[0].replace(/^\\s+/g,'').replace(/\\s+$/g,'') ,\n\t\t\t\t\t\t\t\th_v = head[1];\n\t\t\t\t\t\t\tif (! h_k ) return\n\t\t\t\t\t\t\tresult[h_k] = h_v.replace(/^\\s+/g,'').replace(/\\s+$/g,'')\n\t\t\t\t\t\t\t})\n\t\t\t\t\t}else {\n\t\t\t\t\t\tvar result = xhr.responseText\n\t\t\t\t\t\tif ('JSON' == data_type) result = JSON.parse(result)\n\t\t\t\t\t}\n\t\t\t\t\tcallBack(result)\n\t\t\t\t}\n\t\t\t}else if(onError)\n\t\t\t\tonError(res);\n\n\t\t\t}\n\n\t\tif ('POST' == method )\n\t\t\theaders[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\n\t\telse\n\t\t\tdata = null\n\n\t\txhr.open(method, options.url, async)\n\t\tif (options.headers){\n\t\t\tfn.each(option.headers , function(head_content , head_key){\n\t\t\t\t xhr.setRequestHeader(head_key , head_content)\n\t\t\t\t})\n\t\t\t}\n\t\txhr.send(data)\n\n\t\tif (options.timeout) {\n\t\t\twindow.setTimeout(function(){\n\t\t\t\txhr.abort()\n\t\t\t\tonError && onError(false)\n\t\t\t\t} , options.timeout)\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "567526b38233b7d85001683df4f3d3c8", "score": "0.60453445", "text": "function doGET(url) {\r\n\treturn llamadaAJAX(url, \"GET\", \"json\", false, null, null, null);\r\n}", "title": "" }, { "docid": "a2ff3599f9161544ffc3974ab8b11298", "score": "0.60436386", "text": "function request(url, data, completeHandler, errorHandler, progressHandler) {\r\n $.ajax({\r\n url: url, //server script to process data\r\n type: 'POST',\r\n xhr: function () { // custom xhr\r\n myXhr = $.ajaxSettings.xhr();\r\n if (myXhr.upload) { // if upload property exists\r\n myXhr.upload.addEventListener('progress', progressHandler, false); // progressbar\r\n }\r\n return myXhr;\r\n },\r\n // Ajax events\r\n success: completeHandler,\r\n error: errorHandler,\r\n // Form data\r\n data: data,\r\n // Options to tell jQuery not to process data or worry about the content-type\r\n cache: false,\r\n contentType: false,\r\n processData: false\r\n }, 'json');\r\n\r\n }", "title": "" }, { "docid": "15d8830f79eb81019d9c1edd061fb074", "score": "0.60412437", "text": "function ajaxRequest(){ \nvar activexmodes=[\"Msxml2.XMLHTTP\",\"Microsoft.XMLHTTP\"] //activeX versions to check for in IE\nif(window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)\n\tfor(var i=0;i<activexmodes.length;i++){\n\t\ttry{\n\t\t\treturn new ActiveXObject(activexmodes[i]);\n\t\t}catch(e){\n\t\t\t//suppress error\n\t\t}\n\t}\n}else if(window.XMLHttpRequest){ //if Mozilla, Safari etc\n\treturn new XMLHttpRequest();\n}else{\n\treturn false;\n}\n}", "title": "" }, { "docid": "c15ce50eec0dd9f0c9b3196cae5410df", "score": "0.603339", "text": "function doRequest() {\n request = new XMLHttpRequest();\n request.open('GET', 'data.txt', true);\n request.send(null);\n request.onreadystatechange = showStatus;\n}", "title": "" }, { "docid": "3a0017a421f1d94312beaf10a2d7872e", "score": "0.60333467", "text": "function ajax(url, callback) {\n // Change the base URL here if you're targeting someone else's API Server\n url = \"http://ttt.workbench.uits.arizona.edu/ttt.php?\" + url;\n\n // Attach a random seed to the end of the URL to avoid browser caching.\n url = url + \"&seed=\" + (new Date()).getTime();\n\n console.log( \"Sending request to: \" + url );\n\n // Create a new XMLHttpRequest Object\n var req = new XMLHttpRequest();\n\n // Pass Cookie Credentials along with request\n req.withCredentials = true;\n\n // Create a callback function when the State of the Connection changes\n req.onreadystatechange = function() {\n // Upon completion of the request, call the callback() function passed in with the decoded\n // JSON of the response.\n if( req.readyState == 4 ) {\n // 200 is an HTTP OK response\n if( req.status == 200 ) {\n callback( JSON.parse(req.responseText) );\n } else {\n console.log( \"Request response = \\\"\" + req.responseText + \"\\\"\" );\n }\n }\n }\n\n // Set up our HTTP Request\n req.open( \"get\", url );\n\n // Finally initiate the request\n req.send( null );\n}", "title": "" }, { "docid": "073f8b0668bc50db6c6768592cd85779", "score": "0.602836", "text": "function request(endPoint, doneFn, data) {\n\n\t\tsetLoading(true);\n\n\t\t$.post(def.ajaxurl + '?action=' + endPoint, data)\n\t\t\t.done(doneFn)\n\t\t\t.error(function (e) {\n\t\t\t\tconsole.log(e);\n\t\t\t})\n\t\t\t.always(function () {\n\t\t\t\tsetLoading(false);\n\t\t\t});\n\t}", "title": "" }, { "docid": "8519960d6579ae7164ef54c8b88cdd9b", "score": "0.60137725", "text": "update() {\n // Find alternative to jsonp with jquery, maybe require CORS from servers, or find another lib.\n ajax({\n type: \"GET\",\n dataType: \"json\",\n url: sprintf(\"http://%s:%d/?callback=?\", this.host, this.port),\n success: this.success.bind(this),\n error: this.fail.bind(this),\n timeout: 500,\n });\n }", "title": "" }, { "docid": "fa22582fe7c93e6ec0e65a22bfa09bfc", "score": "0.601174", "text": "function sendAjaxGet(url, func){\n\tlet xhr = new XMLHttpRequest() || new ActiveXObject(\"Microsoft.HTTPRequest\");\n\txhr.onreadystatechange = function(){\n\t\tif(this.readyState==4 && this.status==200){\n\t\t\tfunc(this);\n\t\t}\n\t}\n\txhr.open(\"GET\", url);\n\txhr.send();\n}", "title": "" }, { "docid": "fa22582fe7c93e6ec0e65a22bfa09bfc", "score": "0.601174", "text": "function sendAjaxGet(url, func){\n\tlet xhr = new XMLHttpRequest() || new ActiveXObject(\"Microsoft.HTTPRequest\");\n\txhr.onreadystatechange = function(){\n\t\tif(this.readyState==4 && this.status==200){\n\t\t\tfunc(this);\n\t\t}\n\t}\n\txhr.open(\"GET\", url);\n\txhr.send();\n}", "title": "" }, { "docid": "fe3b0b45994745576841e80e2634721e", "score": "0.60099596", "text": "function ajax(url, callback) {\n\tvar context = this,\n\t\trequest = new XMLHttpRequest();\n\trequest.onreadystatechange = change;\n\trequest.open('GET', url, true);\n\trequest.send();\n\n\tfunction change() {\n\t\tif (request.readyState === 4) {\n\t\t\tif (request.status === 200) {\n\t\t\t\tcallback.call(context, request.responseText);\n\t\t\t} else {\n\t\t\t\tcallback.call(context, \"error\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "152b3b316f81977da918d846559f671c", "score": "0.6007781", "text": "function makeRequest() {\r\n\tif (window.XMLHttpRequest) {\r\n\t\txhr = new XMLHttpRequest();\r\n\t}\r\n\telse {\r\n\t\tif (window.ActiveXObject) {\r\n\t\t\ttry {\r\n\t\t\t\txhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t\t}\r\n\t\t\tcatch (e) { }\r\n\t\t}\r\n\t}\r\n\r\n\tif (xhr) {\r\n\t\txhr.onreadystatechange = showContents;\r\n\t\txhr.open(\"GET\", \"DBQuery.php\", true);\r\n\t\txhr.send(null);\r\n\t}\r\n\telse {\r\n\t\tdocument.getElementById(\"updateArea\").innerHTML = \"Sorry but I could not create an XMLHttpRequest\";\r\n\t}\r\n}", "title": "" }, { "docid": "91385c77100b7661376af022953a7f23", "score": "0.6004259", "text": "function ajaxRequest(url, elementId) \n{\n http_request = false;\n\n if (window.XMLHttpRequest) \n { // Mozilla, Safari,...\n http_request = new XMLHttpRequest();\n if (http_request.overrideMimeType) \n {\n http_request.overrideMimeType('text/xml');\n }\n } \n else if (window.ActiveXObject) \n { // IE\n try \n {\n http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) \n {\n try \n {\n http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {}\n }\n }\n\n if (!http_request) \n {\n alert('Giving up :( Cannot create an XMLHTTP instance');\n return false;\n }\n http_request.onreadystatechange = function(){\n\t getAjaxResponseText(elementId);\n\t};\n http_request.open('GET', url, true);\n http_request.send(null);\n}", "title": "" }, { "docid": "6b55f6bdbecce550abeefc75bfb999dd", "score": "0.6000428", "text": "function SendRequest(query, callback){\n // 1. Create a new XMLHttpRequest object\n let xhr = new XMLHttpRequest();\n\n // 2. Configure it: GET-request for the URL /article/.../load\n xhr.open('GET', url + query);\n\n // 3. Send the request over the network\n xhr.send();\n\n // 4. This will be called after the response is received\n xhr.onload = function() {\n if (xhr.status != 200) { // analyze HTTP status of the response\n alert(`Error ${xhr.status}: ${xhr.statusText}`); // e.g. 404: Not Found\n } else { // show the result\n callback(JSON.parse(xhr.response))\n }\n };\n\n xhr.onerror = function() {\n alert(\"Request failed\");\n };\n}", "title": "" }, { "docid": "637e265ecfdc09070e5b2f08dca224c8", "score": "0.5999871", "text": "function sendMyAjax(URL_address){\n\t$.ajax({\n\t\t type: 'POST',\n\t\t url: URL_address,\n\t\t success: function (result) {\n\t\t }\n\t });\n}", "title": "" }, { "docid": "fc213c9582c1608ad995f5c4f4a57de1", "score": "0.599668", "text": "function _run(settings)\n {\n $.ajax(settings);\n }", "title": "" }, { "docid": "b4ce31c1aeaa2f99fe4f901d16424445", "score": "0.5995123", "text": "function microajax(url, callbackFunction, data, reqType) {\n\t if(!url)\n\t return;\n\t var postParam = data;\n\t //(arguments[2] || \"\");\n\t var req = new XMLHttpRequest();\n\t req.onreadystatechange = function(obj) {\n\t if(req.readyState == 4) {\n\t if(callbackFunction)\n\t callbackFunction(req.responseText)\n\t }\n\t };\n\t if(postParam !== \"\") {\n\t req.open(reqType, url, true);\n\t req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\t //req.setRequestHeader('Connection', 'close');\n\t } else {\n\t req.open(\"GET\", url, true);\n\t }\n\t req.send(postParam);\n\t}", "title": "" }, { "docid": "66bc97d4830063638ff6e9a75008ccea", "score": "0.5986816", "text": "function Ajax() {\r\n var http = (\r\n /**\r\n * If IE7, Mozilla, Safari, etc: Use native object.\r\n * Native XMLHttpRequest in IE 7 has a strict permission,\r\n * see http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=839863&SiteID=1\r\n */\r\n window.XMLHttpRequest ? function() {\r\n return new XMLHttpRequest()\r\n } :\r\n // get a XMLHTTP Object. you can append or re-order PROGIDS array.\r\n window.ActiveXObject ? function() {\r\n var PROGIDS = new Array(\r\n 'MSXML2.XMLHTTP.7.0', // try higher versions first\r\n 'MSXML2.XMLHTTP.6.0', \r\n 'MSXML2.XMLHTTP.5.0', \r\n 'MSXML2.XMLHTTP.4.0', \r\n 'MSXML2.XMLHTTP.3.0', \r\n 'MSXML2.XMLHTTP',\r\n 'MSXML3.XMLHTTP',\r\n 'Microsoft.XMLHTTP' // version independent one\r\n );\r\n for (var i=0;i < PROGIDS.length; i++) {\r\n try { return new ActiveXObject(PROGIDS[i]) } catch (e) {};\r\n }\r\n } :\r\n // undefined, failed\r\n function() { }\r\n )();\r\n\r\n if (!http) {\r\n $debug(\"Qomo's ajax core initialize failed!\");\r\n throw new Error([0, 'Can\\'t Find XMLHTTP Object!']);\r\n }\r\n\r\n return http;\r\n}", "title": "" }, { "docid": "0017081e415549aa2138c6c44321101c", "score": "0.5985461", "text": "function _ajax_request(url, data, callback, type, method) {\n\t if (jQuery.isFunction(data)) {\n\t\t callback = data;\n\t\t\t data = {};\n\t\t\t\t }\n\t return jQuery.ajax({\n\t\t\t type: method,\n\t\t url: url,\n\t\t data: data,\n\t\t success: callback,\n\t\t dataType: type\n\t\t\t });\n}", "title": "" }, { "docid": "dee9fb841d4c62d7fc7f06f770ffd63a", "score": "0.5985006", "text": "function httprequest(url, action, data, callback) {\n\tvar ajax = ajaxObj(\"POST\", url);\n\tajax.onreadystatechange = function() {\n\t\tif(ajaxReturn(ajax) == true) {\n\t\t\tvar res = ajax.responseText.trim();\n\t\t\tif(res == \"\"){\n\t\t\t\tstatus(\"Error for action: \" + action, \"black\");\n\t\t\t} else {\n\t\t\t\tcallback(res);\n\t\t\t}\n\t\t}\n\t}\n\tajax.send(\"action=\"+action+\"&\"+data+\"\");\n}", "title": "" }, { "docid": "9043973ca4ff55e7b1e8d393ce7b5615", "score": "0.5972016", "text": "function ajaxFunction(url)\r\n{\r\n var xmlhttp;\r\n if (window.XMLHttpRequest) {\r\n xmlhttp=new XMLHttpRequest();\r\n } else if (window.ActiveXObject) {\r\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } else {\r\n alert(\"Your browser does not support XMLHTTP!\");\r\n }\r\n\r\n xmlhttp.onreadystatechange=function() {\r\n if(xmlhttp.readyState==4) {\r\n if (xmlhttp.status==200) {\r\n pmRaw(xmlhttp.responseText);\r\n } else {\r\n clearInterval(my_int_id);\r\n alert(\"Problem retrieving XML data: (\"+xmlhttp.status+\") (\" + xmlhttp.statusText+\")\");\r\n }\r\n }\r\n }\r\n xmlhttp.open(\"GET\",url,true);\r\n xmlhttp.send(null);\r\n}", "title": "" }, { "docid": "ccbb8ac91f84e3baf86cc45f2df037ea", "score": "0.5972001", "text": "function ajaxRequest(url, params, func, postMethod)\n{\n if (isBusy) return false;\n isBusy = true;\n\n if ( postMethod === undefined ) postMethod = \"get\";\n else if (( postMethod != 'get') || ( postMethod != 'post' )) postMethod = \"get\";\n\n params += \"&ajax=1\";\n new Ajax.Request(url,\n { method: postMethod,\n parameters: params,\n onComplete: function(transport, json)\n {\n isBusy = false;\n //alert(transport.responseText );\n //if ((transport.responseText || '') == '') return false;\n eval(func + \"(transport.responseText)\"); \n },\n onLoading: function()\n {\n },\n onFailure: function()\n {\n isBusy = false;\n }\n });\n}", "title": "" }, { "docid": "395e5fab0780e92d8aed5486ad194cd1", "score": "0.5968626", "text": "function ajaxCallDisc(data) {\r\n\t$.ajax({\r\n\t\turl: `${location}Repo/php-ajax-dischi/server.php`,\r\n\t\tmethod: 'GET',\r\n\t\tdata: {\r\n\t\t\tauthor: data\r\n\t\t},\r\n\t\tsuccess: function (response) {\r\n\t\t\tgetDisc(response);\r\n\t\t},\r\n\t\terror: function () {\r\n\t\t\tconsole.log('Errore!');\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "8ee1f97b9caacbdb9b6026f248645f46", "score": "0.5967213", "text": "function ajax(url, response, data, state) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"POST\", url, state);\r\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState == 4) {\r\n if (xhr.status == 200) {\r\n response(xhr.responseText);\r\n }\r\n else {\r\n alert(\"Error: \" + xhr.statusText);\r\n }\r\n }\r\n } \r\n xhr.send(data);\r\n}", "title": "" }, { "docid": "ad8d1e191d7bb8880f96843da8170099", "score": "0.5967075", "text": "function doAjax(url,type,data,requestOptions = {}) {\n return $.ajax(\n $.extend({\n url: url,\n data: data,\n type: type\n }, requestOptions)\n );\n }", "title": "" }, { "docid": "b89cc1484e97c470f2b4a22b93c5015d", "score": "0.59606194", "text": "function GET(url, data, ok, err, timeout) {\n var params = Object.keys(data).map(\n\tk => encodeURIComponent(k) + '=' + encodeURIComponent(data[k])\n ).join('&');\n var xhr = new XMLHttpRequest();\n if(params)\n\turl = url + '?' + params;\n xhr.open('GET', url);\n xhr.timeout = timeout? timeout: 6000;\n xhr.onreadystatechange = function() {\n\tif(xhr.readyState == 4) {\n\t if(xhr.status == 200)\n\t\tok(xhr);\n\t else\n\t\terr(xhr.status, xhr.statusText);\n\t}\n };\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n xhr.send();\n return xhr;\n}", "title": "" }, { "docid": "165bec2377bca59caf17ac8b8375fa8e", "score": "0.5952181", "text": "function request () {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () { // <= this is a callback -- we define a callback and saying this is what we want to do\n if (xhr.readyState == 4 && xhr.status == 200) {\n var result = JSON.parse(xhr.responseText); // to convert data into defined syntax\n renderList(result);\n }\n };\n xhr.open('GET', '/items', true); // to get the items from the url\n xhr.send();\n}", "title": "" } ]
bf14b45a74d75081ec512c1678c47ba4
=========================================================================== Save the match info and tally the frequency counts. Return true if the current block must be flushed.
[ { "docid": "1ea9645379ebf2d5a6865a5165bd7dad", "score": "0.0", "text": "function _tr_tally(s, dist, lc) // deflate_state *s;\n // unsigned dist; /* distance of matched string */\n // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n {\n //var out_length, in_length, dcode;\n s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 0xff;s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;s.last_lit++;if (dist === 0) {\n /* lc is the unmatched char */s.dyn_ltree[lc * 2] /*.Freq*/++;\n } else {\n s.matches++; /* Here, lc is the match length - MIN_MATCH */dist--; /* dist = match distance - 1 */ //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /*.Freq*/++;s.dyn_dtree[d_code(dist) * 2] /*.Freq*/++;\n } // (!) This block is disabled in zlib defailts,\n // don't enable it for binary compatibility\n //#ifdef TRUNCATE_BLOCK\n // /* Try to guess if it is profitable to stop the current block here */\n // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n // /* Compute an upper bound for the compressed length */\n // out_length = s.last_lit*8;\n // in_length = s.strstart - s.block_start;\n //\n // for (dcode = 0; dcode < D_CODES; dcode++) {\n // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n // }\n // out_length >>>= 3;\n // //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n // // s->last_lit, in_length, out_length,\n // // 100L - out_length*100L/in_length));\n // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n // return true;\n // }\n // }\n //#endif\n return s.last_lit === s.lit_bufsize - 1; /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n }", "title": "" } ]
[ { "docid": "011f5a5a7d79e6e4cc465519187cbaab", "score": "0.5748652", "text": "function track(match) {\n return counters[match] = (counters[match] || 0) + 1;\n }", "title": "" }, { "docid": "5a31ed4d9a48b80af03c88e534157d37", "score": "0.5399412", "text": "function updateMatchCount() {\n\tmatchCount += 1;\n\tif (matchCount == 8) {\n\t\tstopTimer();\n\t\tshowScore();\n\t}\n}", "title": "" }, { "docid": "d1279c798cd4b8f29736222d45ef4dff", "score": "0.5011219", "text": "function isMatch() {\n var lastCardPlayed = cardTypes[0];\n var currentCard = cardTypes[1];\n\n if (currentCard === lastCardPlayed) { //if they match, alert the player:\n document.getElementById('success').innerHTML = \"You found a match!\";\n\n cardsInPlay = []; //empty cardsInPlay\n cardTypes = []; //empty cardTypes:\n matches++; //increment matches count\n document.getElementById('matches').innerHTML = matches + \" / \" + cards.length/2; //add new match count to matches html id\n return true;\n }\n else {\n return false;\t\n }\n}", "title": "" }, { "docid": "727ef9a7c489e42f1747012a69d48bb7", "score": "0.5002016", "text": "function incrementMatched() {\n matchedCount += 2;\n }", "title": "" }, { "docid": "64087ec8f8e4a6bf94b2efb33c36cb64", "score": "0.4861633", "text": "function checkIfMatch () {\n\tsetInterval(function() {\n\tif ($('div').hasClass('whack-boxes bigEntrance fade-in clicked')) {\n\t\tconsole.log('both are matched');\n\t\t$('div').removeClass('clicked fade-in');\n\t\tvar i = 0;\n\t\t$('#score').text(\"Your Score: \" + score.length);\n\t\ti++;\n\t\tscore.push(i);\n\t};\n\t\t},200);\t\n}", "title": "" }, { "docid": "c00148e0134c185562fed1658b44762a", "score": "0.4839584", "text": "function isComplete() {\n return (game.getMatchedIDs().length == 18) ? true : false;\n}", "title": "" }, { "docid": "1d4e1313f71ac0955e6f5d8be41f7590", "score": "0.48054397", "text": "function applyAllSysMatch(){\n\n\tvar iWordCount=0;\n\tvar iModified=0;\n\n\t\txWord = gXmlBookDataBody.getElementsByTagName(\"word\");\n\t\t/*遍历此经中所有单词*/\n\t\tfor(k=0;k<xWord.length;k++)\n\t\t{\n\t\t\t{\n\t\t\t\tif(getNodeText(xWord[k],\"bmc\")==\"bmca\"){\n\t\t\t\t\tsetNodeText(xWord[k],\"bmc\",\"bmc0\")\n\t\t\t\t\tupdataWordBodyByElement(xWord[k]);\n\t\t\t\t\tiModified++;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tiWordCount++;\n\t\t}\n\t\n\tif(iWordCount>0){\n\t\tdocument.getElementById(\"navi_bookmark_inner\").innerHTML = bookMark();\n\t}\n\tvar_dump(iModified+\"个单词被确认。\")\n}", "title": "" }, { "docid": "b9929ff9bbb767472af6647bdb24e306", "score": "0.47949186", "text": "function checkForMatches() {\n const openCards = document.querySelectorAll('.card.open');\n if (openCards.length < 2) {\n return;\n }\n setMoveCount(moveCount + 1);\n const [card1, card2] = openCards;\n // Match?\n if (card1.dataset.card === card2.dataset.card) {\n markMatchedCards([card1, card2]);\n checkForGameCompletion();\n } else {\n // Block the cards to avoid opening a card while flipping \n blockCardFlip = true;\n // Close the cards after a while\n setTimeout(() => {\n closeCards(openCards)\n blockCardFlip = false;\n }, 500);\n }\n}", "title": "" }, { "docid": "93748eb746c6cf7503951e5b81d585ba", "score": "0.47893587", "text": "function handleMatch() {\n scoreWord();\n mark();\n WORDS = document.querySelectorAll('.words-to-match');\n IMAGES = document.querySelectorAll('.images-to-match');\n reset();\n if (winCheck()) stopCheck.stop(`/matching-solution-saver/${gameId}`);\n }", "title": "" }, { "docid": "433cc07ebedced008075dae701b8f002", "score": "0.47395238", "text": "function isDoneJobImpactCalc() {\n var grSaHashProgress = new GlideRecord(\"sa_hash\");\n grSaHashProgress.addQuery(\"name\",\"in_progress_impact\");\n grSaHashProgress.query();\n grSaHashProgress.next();\n var progress = grSaHashProgress.getValue(\"hash\");\n\n var grSaHashCalc = new GlideRecord(\"sa_hash\");\n grSaHashCalc.addQuery(\"name\",\"last_calculated_impact\");\n grSaHashCalc.query();\n grSaHashCalc.next();\n var lastCalculated = grSaHashCalc.getValue(\"hash\");\n if (progress == lastCalculated) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "b7f43a777d8e8f32ea1429a83f0b1bc8", "score": "0.47205025", "text": "match() {\n\t\t\n\t\tlet newRowNeeded = null;\n\t\t\n\t\tconst unmatchedCrystals = this.crystalPlate.unmatchedItems\n\t\tconst unmatchedCompounds = this.libPlate.unmatchedItems;\n\t\t\n\t\tif ( unmatchedCrystals !== unmatchedCompounds) {\n\t\t\tif (unmatchedCompounds > unmatchedCrystals) {\n\t\t\t\tnewRowNeeded = true;\n\t\t\t\t\n\t\t\t\tthis.libPlate.useItems(unmatchedCrystals);\n\t\t\t\tthis.crystalPlate.useAll();\n\t\t\t\tthis.setSize(unmatchedCrystals);\n\t\t\t\t\n\t\t\t\tconst newBatch = createNewBatch(0);\n\t\t\t\tnewBatch.assignPlate(libraryPlates, libraryPlates.indexOf(this.libPlate));\n\t\t\t\tnewBatch.setSize(unmatchedCompounds - unmatchedCrystals);\n\t\t\t//\tconsole.log('newBatch from MATCH: ', newBatch);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewRowNeeded = false;\n\t\t\t\tthis.crystalPlate.useItems(unmatchedCompounds);\n\t\t\t\tthis.libPlate.useAll();\n\t\t\t\tthis.setSize(unmatchedCompounds);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tnewRowNeeded = false;\n\t\t\n\t\t}\n\t\treturn newRowNeeded;\t\t\n\t}", "title": "" }, { "docid": "86320ef43be3f0d878a3a5be08597933", "score": "0.46755388", "text": "function checkForMatch() {\n\tif (\n\t\ttoggledCards[0].firstElementChild.className === \n\t\ttoggledCards[1].firstElementChild.className\n\t\t) {\n\t\ttoggledCards[0].classList.toggle('match');\n\t\ttoggledCards[1].classList.toggle('match');\n\t\ttoggledCards = [];\n\t\tcardsMatched++;\n\t\tif (cardsMatched === TOTAL_PAIRS) {\n\t\t\tgameOver();\n\t\t\tcardsMatched = 0;\n\t\t}\t\t\n\t\tconsole.log(cardsMatched);\t\t\t\t\t\t\n\t} else {\n\t\tsetTimeout(() => {\n\t\t\ttoggleCard(toggledCards[0]);\n\t\t\ttoggleCard(toggledCards[1]);\n\t\t\ttoggledCards = [];\n\t\t}, 1000);\n\t}\n}", "title": "" }, { "docid": "e9c0c25f0d8416990400e315f11f4595", "score": "0.46610373", "text": "function deflate_fast(flush) {\n\t\t\t// short hash_head = 0; // head of the hash chain\n\t\t\tvar hash_head = 0; // head of the hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\t// At this point we have always match_length < MIN_MATCH\n\n\t\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\t\t\t\t}\n\t\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n\t\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tstrstart++;\n\n\t\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\n\t\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n\t\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\t\tins_h = window[strstart] & 0xff;\n\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t\t\t// not\n\t\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No match, output a literal byte\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tstrstart++;\n\t\t\t\t}\n\t\t\t\tif (bflush) {\n\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_block_only(flush == Z_FINISH);\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "e9c0c25f0d8416990400e315f11f4595", "score": "0.46610373", "text": "function deflate_fast(flush) {\n\t\t\t// short hash_head = 0; // head of the hash chain\n\t\t\tvar hash_head = 0; // head of the hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\t// At this point we have always match_length < MIN_MATCH\n\n\t\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\t\t\t\t}\n\t\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n\t\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tstrstart++;\n\n\t\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\n\t\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n\t\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\t\tins_h = window[strstart] & 0xff;\n\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t\t\t// not\n\t\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No match, output a literal byte\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tstrstart++;\n\t\t\t\t}\n\t\t\t\tif (bflush) {\n\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_block_only(flush == Z_FINISH);\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "9b5162798e2d1bfb96c7a5f331ecd4b0", "score": "0.46279314", "text": "function ifCards_match()\n {\n opened_cards.forEach(function(icons){\n icons.className= icons.className + ' match';\n opened_cards= [];\n match++;\n });\n\n if (match === 16)\n {\n setTimeout(game_over, 1000);\n }\n increment_counter();\n }", "title": "" }, { "docid": "f90558af4d708dd5a78f0480f6423c20", "score": "0.46208537", "text": "function updateMatches() {\r\n score++;\r\n\r\n document.getElementById('score').innerHTML = \"Score: \" + score;\r\n\r\n flipped[lastTwo[0]] = false;\r\n flipped[lastTwo[1]] = false;\r\n\r\n matched[lastTwo[0]] = true;\r\n matched[lastTwo[1]] = true;\r\n}", "title": "" }, { "docid": "5e23641fc79c9e5c5f19af3a12a18506", "score": "0.46180284", "text": "recordStats() {\n this.stats.credits = Game.market.credits;\n const time = Game.time - 1;\n // Incoming transactions\n for (let transaction of Game.market.incomingTransactions) {\n if (transaction.time < time) {\n break; // only look at things from last tick\n }\n else {\n if (transaction.order) {\n const resourceType = transaction.resourceType;\n const amount = transaction.amount;\n const price = transaction.order.price;\n if (!this.stats.bought[resourceType]) {\n this.stats.bought[resourceType] = { amount: 0, credits: 0 };\n }\n this.stats.bought[resourceType].amount += amount;\n this.stats.bought[resourceType].credits += amount * price;\n }\n }\n }\n // Outgoing transactions\n for (let transaction of Game.market.outgoingTransactions) {\n if (transaction.time < time) {\n break; // only look at things from last tick\n }\n else {\n if (transaction.order) {\n const resourceType = transaction.resourceType;\n const amount = transaction.amount;\n const price = transaction.order.price;\n if (!this.stats.sold[resourceType]) {\n this.stats.sold[resourceType] = { amount: 0, credits: 0 };\n }\n this.stats.sold[resourceType].amount += amount;\n this.stats.sold[resourceType].credits += amount * price;\n }\n }\n }\n }", "title": "" }, { "docid": "240c146b10eb62f293146bfed19d2ebf", "score": "0.46011817", "text": "function updateMatches(){\n matchCount ++;\n document.querySelector(\".matches\").innerHTML = matchCount;\n}", "title": "" }, { "docid": "35f6b301ac2f21c57414a468b965bcf0", "score": "0.46002662", "text": "checkIfCopleted () {\n if (this.brickCounter === this.bricks.length) {\n setup.editAppContent('#memoryCompleted', this.currentWindow)\n\n clearInterval(this.timer)\n this.time = `${this.time.toFixed(2)}`\n\n this.currentWindow.querySelector('.attempts').textContent += this.attempts\n this.currentWindow.querySelector('.time').textContent += `${this.time}s`\n\n this.loadHighscore()\n }\n }", "title": "" }, { "docid": "396d8587bc6e344b151aec111086f017", "score": "0.45960537", "text": "function runMatch(){\n\n\tvar url = \"data/alienNamesShort.json\";\n\n\tfs.readFile(url, 'utf-8', function (err, data) {\n\t\tif (err) throw err;\n\n\t\td3597 = JSON.parse(data);\n\n\t\td3597.sort(compareCN); // sort object by controlNumber (ascending)\n\n\t\tfor(var i=0; i<d3597.length; i++){\t\n\t\t\td3597[i][\"flesh\"]=[];\n\t\t\t\n\t\t\td3597[i][\"refName\"]=d3597[i].title.toLowerCase().replace(/,/g, \"\");\n\t\t\td3597[i][\"reverseName\"]=reverseOrder(d3597[i].refName).replace(/,/g, \"\");\n\t\t\t//console.log(d3597[i].reverseName);\n\t\t}\n\n\t\tvar url = \"data/historysa.json\";\n\n\t fs.readFile(url, 'utf-8', function (err, data) {\n\t\t\tif (err) throw err;\n\n\t\t\thsa = JSON.parse(data);\n\t\t\t//hsaPure = hsa;\n\t\t\t\n\t\t\tconsole.log(\"checking hsa\");\n\t\t\t\n\t\t\tvar count=0;\n\n\t\t\tfor(var i=0; i<hsa.length; i++){\n\t\t\t\tvar hName = hsa[i].name.toLowerCase().replace(/,/g, \"\");\n\t\t\t\thsa[i][\"series\"]=\"hsa\";\n\n\t\t\t\tfor(var h=0; h<d3597.length; h++){\n\t\t\t\t\tvar dName = d3597[h].refName;\n\t\t\t\t\tvar rName = d3597[h].reverseName;\n\t\t\t\t\tif(dName.indexOf(hName) > -1 || rName.indexOf(hName) > -1){\n\t\t\t\t\t\td3597[h].flesh.push(hsa[i]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log(\"hsa matched \"+count);\n\n\t\t\tvar url = \"data/d1915_ww1Only.json\";\n\n\t \tfs.readFile(url, 'utf-8', function (err, data) {\n\t\t\t\tif (err) throw err;\n\n\t\t\t\td1915 = JSON.parse(data);\n\t\t\t\t\n\t\t\t\tvar count=0;\n\t\t\t\tfor(var i=0; i<d1915.length; i++){\n\t\t\t\t\td1915[i][\"series\"]=\"d1915\";\n\t\t\t\t\td1915[i][\"refName\"]=d1915[i].title.toLowerCase().replace(/,/g, \"\");\n\t\t\t\t\t///\n\t\t\t\t\tvar hName = d1915[i].refName;\n\t\t\t\t\t//console.log(hName);\n\t\t\t\t\tfor(var h=0; h<d3597.length; h++){\n\t\t\t\t\t\tvar dName = d3597[h].refName;\n\t\t\t\t\t\tvar rName = d3597[h].reverseName;\n\t\t\t\t\t\tif(dName.indexOf(hName) > -1 || rName.indexOf(hName) > -1){\n\t\t\t\t\t\t\t//d3597[h].flesh.push({barcode: d1915[i].barcode,});\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t///\n\t\t\t\t}\n\t\t\t\tconsole.log(\"d1915 matched \"+count);\n\n\t\t\t\tvar url = \"data/mp16.json\";\n\n\t \t\tfs.readFile(url, 'utf-8', function (err, data) {\n\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\tmp16 = JSON.parse(data);\n\t\t\t\t\t\n\t\t\t\t\tvar count=0;\n\t\t\t\t\tfor(var i=0; i<mp16.length; i++){\n\t\t\t\t\t\tmp16[i][\"series\"]=\"mp16\";\n\t\t\t\t\t\tmp16[i][\"refName\"]=mp16[i].title.toLowerCase().replace(/,/g, \"\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar hName = mp16[i].refName;\n\t\t\t\t\t\tfor(var h=0; h<d3597.length; h++){\n\t\t\t\t\t\t\tvar dName = d3597[h].refName;\n\t\t\t\t\t\t\tvar rName = reverseOrder(d3597[h].refName);\n\t\t\t\t\t\t\tif(dName.indexOf(hName) > -1 || rName.indexOf(hName) > -1){\n\n\t\t\t\t\t\t\t\tdelete mp16[i].refName;\n\t\t\t\t\t\t\t\tdelete mp16[i].digitisedLink;\n\n\t\t\t\t\t\t\t\td3597[h].flesh.push(mp16[i]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcount++;\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\tconsole.log(\"mp16 matched \"+count);\n\n\t\t\t\t\tvar url = \"data/a1-matches.json\";\n\n\t \t\t\tfs.readFile(url, 'utf-8', function (err, data) {\n\t\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\t\ta1 = JSON.parse(data);\n\n\t\t\t\t\t\tvar count=0;\n\t\t\t\t\t\tfor(var i=0; i<a1.length; i++){\n\t\t\t\t\t\t\ta1[i][\"series\"]=\"a1\";\n\t\t\t\t\t\t\ta1[i][\"refName\"]=a1[i].internName.toLowerCase().replace(/,/g, \"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar hName = a1[i].refName;\n\t\t\t\t\t\t\tvar hCode = a1[i].internBarcode;\n\t\t\t\t\t\t\tfor(var h=0; h<d3597.length; h++){\n\t\t\t\t\t\t\t\tvar dName = d3597[h].refName;\n\t\t\t\t\t\t\t\tvar rName = reverseOrder(d3597[h].refName);\n\t\t\t\t\t\t\t\tvar dCode = d3597[h].barcode;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//if(dName.indexOf(hName) > -1 || rName.indexOf(hName) > -1 || ){\n\t\t\t\t\t\t\t\t// ^^^ matching using names (allows duplicates)\n\t\t\t\t\t\t\t\tif(hCode==dCode){ // matching using barcodes rather than names\n\t\t\t\t\t\t\t\t\tdelete a1[i].refName;\n\t\t\t\t\t\t\t\t\ta1[i][\"title\"] = a1[i].a1title;\n\t\t\t\t\t\t\t\t\tdelete a1[i].a1title;\n\t\t\t\t\t\t\t\t\ta1[i][\"barcode\"] = a1[i].a1barcode;\n\t\t\t\t\t\t\t\t\tdelete a1[i].a1barcode;\n\n\t\t\t\t\t\t\t\t\td3597[h].flesh.push(a1[i]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcount++;\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\tconsole.log(\"a1 matched \"+count);\n\n\t\t\t\t\t\tvar url = \"data/d2375.json\";\n\n\t \t\t\t\tfs.readFile(url, 'utf-8', function (err, data) {\n\t\t\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\t\t\td2375 = JSON.parse(data);\n\n\t\t\t\t\t\t\tvar count=0;\n\t\t\t\t\t\t\tfor(var i=0; i<d2375.length; i++){\n\t\t\t\t\t\t\t\td2375[i][\"series\"]=\"d2375\";\n\t\t\t\t\t\t\t\td2375[i][\"refName\"]=d2375[i].controlSymbol.toLowerCase().replace(/[,.]/g, \"\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar hName = d2375[i].refName;\n\t\t\t\t\t\t\t\tfor(var h=0; h<d3597.length; h++){\n\t\t\t\t\t\t\t\t\tvar dName = d3597[h].refName;\n\t\t\t\t\t\t\t\t\tvar rName = reverseOrder(d3597[h].refName);\n\t\t\t\t\t\t\t\t\tif(dName.indexOf(hName) > -1 || rName.indexOf(hName) > -1){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdelete d2375[i].refName;\n\t\t\t\t\t\t\t\t\t\td2375[i][\"title\"] = d2375[i].controlSymbol;\n\t\t\t\t\t\t\t\t\t\tdelete d2375[i].controlSymbol;\n\n\t\t\t\t\t\t\t\t\t\td3597[h].flesh.push(d2375[i]);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcount++;\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}\n\t\t\t\t\t\t\tconsole.log(\"d2375 matched \"+count);\n\n\t\t\t\t\t\t\tfor(var i=0; i<d3597.length; i++){\n\t\t\t\t\t\t\t\tdelete d3597[i].refName;\n\t\t\t\t\t\t\t\tdelete d3597[i].reverseName;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twriteIt();\n\n\t\t\t\t\t\t});\n\t\t\t\t\t});\t\t\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "61165b3498d03210106a424445949869", "score": "0.4589017", "text": "function checkMatch(a, b) {\n setTimeout(function () {\n if (a.dataset.id == b.dataset.id) {\n //* if the cards match *//\n openCards[0].classList.add(\"match\");\n openCards[1].classList.add(\"match\");\n pairs.push(openCards[0]);\n pairs.push(openCards[1]);\n countPairs();\n if (++matches == 15) {\n setTimeout(endGame(), 500);\n }\n } else {\n openCards[0].classList.remove(\"open\", \"show\");\n openCards[1].classList.remove(\"open\", \"show\");\n }\n openCards = [];\n deck.addEventListener('click', flip)\n }, 750);\n starRating();\n}", "title": "" }, { "docid": "956d11868c12e9af9b20a01d6c6bde8c", "score": "0.45861423", "text": "function verifyAdded() {\n // helper function that counts how many words in source are in target\n function getScore(source, target) {\n var score = 0;\n // strip source of non alphabetic characters and duplicate words\n var sourceArray = source\n .toUpperCase()\n .replace(/[^A-Z0-9]+/g, ' ')\n .trim()\n .split(' ')\n .filter(function(item, i, allItems) {\n return i == allItems.indexOf(item);\n });\n // strip target of non alphabetic characters and duplicate words\n var targetString = target\n .toUpperCase()\n .replace(/[^A-Z0-9]+/g, ' ')\n .trim()\n .split(' ')\n .filter(function(item, i, allItems) {\n return i == allItems.indexOf(item)\n })\n .join(' ');\n // count how many words of source are in target\n sourceArray.map(function(sourceWord) {\n if (targetString.indexOf(sourceWord) > -1) {\n score++;\n }\n });\n return score;\n }\n\n currentTry++;\n self.getTorrents().then(function(result) {\n var hash = null;\n var bestScore = 0;\n // for each torrent compare the torrent.name with .torrent releaseName and record the number of matching words\n result.map(function(torrent) {\n var score = getScore(releaseName, torrent.name);\n if (score > bestScore) {\n hash = torrent.hash.toUpperCase();\n bestScore = score;\n }\n });\n if (hash !== null) {\n resolve(hash);\n } else {\n if (currentTry < maxTries) {\n setTimeout(verifyAdded, 1000);\n } else {\n throw \"No hash found for torrent \" + releaseName + \" in \" + maxTries + \" tries.\";\n }\n }\n });\n }", "title": "" }, { "docid": "5fb9630821c9b206fde08aa639b870a5", "score": "0.45770922", "text": "function checkMatchedBlock(firstBlock, secondBlock) {\n\tlet triesCount = document.querySelector(\".tries span\");\n\tif (firstBlock.dataset.tech === secondBlock.dataset.tech) {\n\t\tfirstBlock.classList.remove(\"flipp\");\n\t\tsecondBlock.classList.remove(\"flipp\");\n\n\t\tfirstBlock.classList.add(\"match\");\n\t\tsecondBlock.classList.add(\"match\");\n\t\tdocument.getElementById(\"success\").play();\n\t} else {\n\t\ttriesCount.innerHTML = parseInt(triesCount.innerHTML) + 1;\n\t\tdocument.getElementById(\"fail\").play();\n\t\tsetTimeout(() => {\n\t\t\tfirstBlock.classList.remove(\"flipp\");\n\t\t\tsecondBlock.classList.remove(\"flipp\");\n\t\t}, duration);\n\t}\n}", "title": "" }, { "docid": "5573c9d21da8ea5c29815868711af0ba", "score": "0.45564058", "text": "function checkDone() {\n if (!paused && counter === 0) {\n counter--;\n stream.emit(\"end\");\n }\n }", "title": "" }, { "docid": "91fbf0abf80ae0c241c517ce2ed68640", "score": "0.45538273", "text": "function progress() {\n\tconst matchCards = document.querySelectorAll('.match');\n\n\tif (matchCards.length === cards.length)\n\t\tendGame();\n}", "title": "" }, { "docid": "eb499cb995006c49d2e955848decc2af", "score": "0.4543181", "text": "function correctMeditationFrequency(current_hour) {\n\tfor (var i = 0; i <= hoursToMeditate.length-1; i++) {\n\t\tif (i == hoursToMeditate.length) {console.log(\"match NOT found\"); return false;}\n\t\t//console.log(hoursToMeditate[i]);\n\t\t\n\t\tif (hoursToMeditate[i] == current_hour) {\n\t\t\t//console.log(\"current hour is: \" + current_hour);\n\t\t\t//console.log(\"match found: \" + hoursToMeditate[i]);\n\t\t\treturn true;\n\t\t}\t\t\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ec097776686cb5e94c81cb386fc378c1", "score": "0.45292205", "text": "function deflate_slow(flush) {\n\t\t\t// short hash_head = 0; // head of hash chain\n\t\t\tvar hash_head = 0; // head of hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\t\t\tvar max_insert;\n\n\t\t\t// Process the input block.\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\tprev_length = match_length;\n\t\t\t\tprev_match = match_start;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there was a match at the previous step and the current\n\t\t\t\t// match is not better, output the previous match:\n\t\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t\t// the hash table.\n\t\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\t\tprev_length -= 2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\t\tmatch_available = 0;\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\tstrstart++;\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t}\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t} else {\n\t\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t\t// the next step to decide.\n\n\t\t\t\t\tmatch_available = 1;\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (match_available !== 0) {\n\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\t\tmatch_available = 0;\n\t\t\t}\n\t\t\tflush_block_only(flush == Z_FINISH);\n\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "ec097776686cb5e94c81cb386fc378c1", "score": "0.45292205", "text": "function deflate_slow(flush) {\n\t\t\t// short hash_head = 0; // head of hash chain\n\t\t\tvar hash_head = 0; // head of hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\t\t\tvar max_insert;\n\n\t\t\t// Process the input block.\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\tprev_length = match_length;\n\t\t\t\tprev_match = match_start;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there was a match at the previous step and the current\n\t\t\t\t// match is not better, output the previous match:\n\t\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t\t// the hash table.\n\t\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\t\tprev_length -= 2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\t\tmatch_available = 0;\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\tstrstart++;\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t}\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t} else {\n\t\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t\t// the next step to decide.\n\n\t\t\t\t\tmatch_available = 1;\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (match_available !== 0) {\n\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\t\tmatch_available = 0;\n\t\t\t}\n\t\t\tflush_block_only(flush == Z_FINISH);\n\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "e9d19c4ef1449447497647f5bc3ce5b9", "score": "0.4526972", "text": "trackCount(flagKey, variationKey) {\n \n if (flagKey == \"\" || variationKey == \"\") {\n return false\n }\n\n let count = 0;\n let eventsCount = this.store.get(EVENTS_COUNT);\n\n if (eventsCount) {\n const index = eventsCount.findIndex(e => e.key == `${flagKey},${variationKey}`);\n\n const eventsCountObj = {\n key: `${flagKey},${variationKey}`,\n count: index >= 0 ? eventsCount[index].count + 1 : count++\n }\n if (index >= 0) {\n eventsCount[index] = eventsCountObj\n } else {\n eventsCount.push(eventsCountObj)\n }\n } else {\n eventsCount = [];\n const eventsCountObj = {\n key: `${flagKey},${variationKey}`,\n count: 1\n }\n eventsCount.push(eventsCountObj)\n }\n\n this.store.set(EVENTS_COUNT, eventsCount)\n\n return true;\n }", "title": "" }, { "docid": "81bcdcfebd8d2ad3db023ca1207d3b4c", "score": "0.45228744", "text": "advance() {\n let updated = false;\n Object.values(this.attributes).forEach((attr) => {\n if (attr.advance()) updated = true;\n });\n if (updated) {\n this.framesWithUpdate += 1;\n if (this.framesWithUpdate > ExcessiveUpdateThreshold) {\n console.warn(\"Marks are being updated excessively!\");\n }\n return true;\n }\n this.framesWithUpdate = 0;\n return false;\n }", "title": "" }, { "docid": "0acf776800b5117ccc7c0209a9eddcb2", "score": "0.4517844", "text": "function updateIsLastMatch(value) {\n // TODO: Computing these two variables is CPU intensive as they both iterate over all items\n if (value !== undefined) {\n isLastEntityMatch = value\n isLastEntityAttributeMatch = value\n m.redraw()\n return false\n }\n try {\n const latestForEntity = findLatestForEntity()\n const latestForEntityAttribute = findLatestForEntityAttribute()\n if (isEditorDirty() || !currentItemId) {\n isLastEntityMatch = !latestForEntity\n isLastEntityAttributeMatch = !latestForEntityAttribute\n } else {\n isLastEntityMatch = latestForEntity === currentItemId\n isLastEntityAttributeMatch = latestForEntityAttribute === currentItemId\n }\n // TODO: Redraw for convenience of callers -- probably makes a spurious redraw a lot of times\n // TODO: Replace this with optimization of info about item when it is retrieved or other new items are added\n m.redraw()\n return true\n } catch(error) {\n console.log(\"Problem in updateIsLastMatch\", error)\n return false\n }\n }", "title": "" }, { "docid": "f9e66207f7f7c94e0a6c727af89e6943", "score": "0.45163712", "text": "saveTestState() {\n const testState = this.testState;\n if (! (testState && this.filteredTests.length)) {\n return;\n }\n\n Object.keys(this.fileInfo).forEach((f) => {\n const info = this.fileInfo[f];\n if (info.hasFailures) {\n delete testState.lastPassedHashes[f];\n } else if (! info.hasSkips) {\n testState.lastPassedHashes[f] = info.hash;\n }\n });\n\n writeTestState(testState);\n }", "title": "" }, { "docid": "38ec9d7420b7c8fb079dcfc9743e647c", "score": "0.45140135", "text": "function checkRecord() {\n if (!currentRecord || timeResult < currentRecord) {\n localStorage.setItem(\"timeRecord\", timeResult); // If is a newRecord, localstorage will be updated \n newRecord = true;\n }\n}", "title": "" }, { "docid": "0b4b7c9d575aeff043df7ecb830d203d", "score": "0.45129684", "text": "function handleMatch() {\n openCards.forEach((openCard) => {\n openCard.off('click');\n openCard.addClass('match');\n });\n remainingMatches--;\n checkingMatch = false;\n}", "title": "" }, { "docid": "1afdc12093a0716292b501773b560f34", "score": "0.45090386", "text": "function checkForMatch() {\n if (card1.dataset.cardname === card2.dataset.cardname) {\n disableCards();\n points++;\n currentScore.innerHTML = \"Points: \" + points;\n checkScore();\n hasTwoCards = false;\n return;\n }\n flipBackCards();\n setTimeout(() => {\n hasTwoCards = false;\n }, 1000);\n}", "title": "" }, { "docid": "37beaf367da113781e8a80dee350d2a8", "score": "0.44924083", "text": "ifItFitsItSits(key, value) {\n // The BSON byteLength of the new element is the same as serializing it to its own document\n // subtracting the document size int32 and the null terminator.\n const newElementSize = bson_1.BSON.serialize(new Map().set(key, value)).byteLength - 5;\n if (newElementSize + this.documentSize > this.maxSize) {\n return false;\n }\n this.documentSize += newElementSize;\n this.document.set(key, value);\n return true;\n }", "title": "" }, { "docid": "3f15ba077d0217137d8e8d1c14227735", "score": "0.448991", "text": "function complete(){\n\t\t\tcallbackCount++;\n\t\t\tif(callbackCount >= ((Object.keys(req.query).length - 1) / 2)){\n\n\t\t\t\tlet someProductsUnmatched = eSaveResults.some( result => {\n\t\t\t\t\tif(result.hasOwnProperty(\"suggested\")){\n\t\t\t\t\t\teSaveResults.sort(compare);\n\t\t\t\t\t\tres.send(JSON.stringify(eSaveResults));\n\t\t\t\t\t\treturn result.hasOwnProperty(\"suggested\")\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tif(!someProductsUnmatched){\n\t\t\t\t\t//Convert data format for processing, tracking, storing and\n\t\t\t\t\t//cumulating values by retailer.\n\t\t\t\t\t//(Outermost object is resultsTotalsByRetailer.)\n\t\t\t\t\tvar resultsTotalsByRetailer = {};\n\n\t\t\t\t\t//If a retailer specfic query is issued\n\t\t\t\t\t//(e.g. when adding a specific promotion to wishlist or favorites),\n\t\t\t\t\t//proceed as such...\n\t\t\t\t\tif(req.query.ret !== \"NULL\"){\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret] = {};\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"prices\"] = {};\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"qts\"] = {};\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"prod_ids\"] = {};\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"discount_ids\"] = {};\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"discounted_price\"] = 0;\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"shipping_price\"] = 0;\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"discount\"] = 0;\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"initial_price\"] = 0;\n\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"num_prods\"] = 0;\n\n\t\t\t\t\t\tlet retIndex;\n\t\t\t\t\t\t//Loop through results for each product, and exit when the index of the\n\t\t\t\t\t\t//specified-retailer is determined. (Stored in retIndex).\n\t\t\t\t\t\teSaveResults.forEach(eSaveResult => {\n\t\t\t\t\t\t\tlet retailerMatch = eSaveResult.results.some((result, i) => {\n\t\t\t\t\t\t\t\tif(result.RET_NAME === req.query.ret || result.RET_ID === req.query.ret){\n\t\t\t\t\t\t\t\t\tretIndex = i;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn result.RET_NAME === req.query.ret || result.RET_ID === req.query.ret;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t//If specified retailer product result is found, add data to resultsTotalsByRetailer.\n\t\t\t\t\t\t\tif(retailerMatch){\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"discounted_price\"] +=\n\t\t\t\t\t\t\t\t\tNumber(eSaveResult.results[retIndex].DISCOUNTED_PRICE);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"shipping_price\"] +=\n\t\t\t\t\t\t\t\t\tNumber(eSaveResult.results[retIndex].SHIPPING_PRICE);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"discount\"] +=\n\t\t\t\t\t\t\t\t Number(eSaveResult.results[retIndex].TOTAL_DISCOUNT);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"initial_price\"] +=\n\t\t\t\t\t\t\t\t\tNumber(eSaveResult.results[retIndex].INITIAL_PRICE);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"prices\"][eSaveResult.prodNum]\n\t\t\t\t\t\t\t\t\t= Number(eSaveResult.results[retIndex].PRICE_PER_UNIT);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"prod_ids\"][eSaveResult.prodNum]\n\t\t\t\t\t\t\t\t\t= Number(eSaveResult.results[retIndex].PROD_ID);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"qts\"][eSaveResult.prodNum]\n\t\t\t\t\t\t\t\t\t= Number(eSaveResult.qt);\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"num_prods\"]++;\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"ret_id\"] =\n\t\t\t\t\t\t\t\t\teSaveResult.results[retIndex].RET_ID;\n\t\t\t\t\t\t\t\tresultsTotalsByRetailer[req.query.ret][\"ret_web_add\"] =\n\t\t\t\t\t\t\t\t\teSaveResult.results[retIndex].RET_WEB_ADD;\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//For non-retailer specific queries, load data as follows...\n\t\t\t\t\telse{\n\t\t\t\t\t\t//For each product, store results be retailer in resultsTotalsByRetailer\n\t\t\t\t\t\teSaveResults.forEach((productResults, i) => {\n\t\t\t\t\t\t\tproductResults.results.forEach(result => {\n\t\t\t\t\t\t\t\t//If retailer is already established in resultsTotalsByRetailer\n\t\t\t\t\t\t\t\t//(i.e. retailer had a product match for a previous product),\n\t\t\t\t\t\t\t\t//add data to retailer's existing object.\n\t\t\t\t\t\t\t\tif(resultsTotalsByRetailer.hasOwnProperty(result.RET_NAME)){\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"discounted_price\"] +=\n\t\t\t\t\t\t\t\t\t\tNumber(result.DISCOUNTED_PRICE);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"discount\"] +=\n\t\t\t\t\t\t\t\t\t\tNumber(result.TOTAL_DISCOUNT);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"initial_price\"] +=\n\t\t\t\t\t\t\t\t\t\tNumber(result.INITIAL_PRICE);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"prices\"][productResults.prodNum]\n\t\t\t\t\t\t\t\t\t\t= Number(result.PRICE_PER_UNIT);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"prod_ids\"][productResults.prodNum]\n\t\t\t\t\t\t\t\t\t\t= Number(result.PROD_ID);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"qts\"][productResults.prodNum]\n\t\t\t\t\t\t\t\t\t\t= Number(productResults.qt);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"num_prods\"]++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//If retailer is not yet established in resultsTotalsByRetailer, establish\n\t\t\t\t\t\t\t\t//retailer object and add data for product to retaier object.\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME] = {};\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"discounted_price\"] = Number(result.DISCOUNTED_PRICE);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"shipping_price\"] = Number(result.SHIPPING_PRICE);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"discount\"] = Number(result.TOTAL_DISCOUNT);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"initial_price\"] = Number(result.INITIAL_PRICE);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"prices\"] = {};\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"prices\"][productResults.prodNum]\n\t\t\t\t\t\t\t\t\t\t= Number(result.PRICE_PER_UNIT);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"prod_ids\"] = {};\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"prod_ids\"][productResults.prodNum]\n\t\t\t\t\t\t\t\t\t\t= Number(result.PROD_ID);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"qts\"] = {};\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"qts\"][productResults.prodNum]\n\t\t\t\t\t\t\t\t\t\t= Number(productResults.qt);\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"num_prods\"] = 1;\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"ret_id\"] = result.RET_ID;\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"ret_web_add\"] = result.RET_WEB_ADD;\n\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[result.RET_NAME][\"discount_ids\"] = {};\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//Delete any retailer from resultsTotalsByRetailer who has not matched\n\t\t\t\t\t//all products queried.\n\t\t\t\t\tfor(let retailer in resultsTotalsByRetailer){\n\t\t\t\t\t\tif(resultsTotalsByRetailer[retailer][\"num_prods\"] !==\n\t\t\t\t\t\t\t\t(Object.keys(req.query).length - 1) / 2){\n\t\t\t\t\t\t\t\t\tdelete resultsTotalsByRetailer[retailer];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//If no retailers match all products, send error message accordingly.\n\t\t\t\t\tif(Object.keys(resultsTotalsByRetailer).length === 0){\n\t\t\t\t\t\tres.send({\"Error\" : \"No Retailers With All Requested Products\"});\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tlet mysql = req.app.get('mysql');\n\t\t\t\t\t\tlet productListString = null;\n\n\t\t\t\t\t\t//For each retailer, determine all eligible discounts, and update\n\t\t\t\t\t\t//retailer results by adding discount ids to discout_ids orbject.\n\t\t\t\t\t\tfor(retailer in resultsTotalsByRetailer){\n\t\t\t\t\t\t\tObject.keys(resultsTotalsByRetailer[retailer][\"prod_ids\"]).forEach((pid, i) => {\n\t\t\t\t\t\t\t\tif(i === 0){\n\t\t\t\t\t\t\t\t\tproductListString = `'${resultsTotalsByRetailer[retailer][\"prod_ids\"][pid]}',`;\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\tproductListString += `'${resultsTotalsByRetailer[retailer][\"prod_ids\"][pid]}',`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(i === Object.keys(resultsTotalsByRetailer[retailer][\"prod_ids\"]).length - 1){\n\t\t\t\t\t\t\t\t\tproductListString = productListString.slice(0, -1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tqueryString = \"SELECT promotion.*, retailer.name AS ret_name \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"FROM promotion JOIN retailer \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ON promotion.retailer = retailer.id WHERE \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`promotion.retailer = '${resultsTotalsByRetailer[retailer][\"ret_id\"]}' ` +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`AND (promotion.qt_required IS NULL OR promotion.product IN (${productListString})) ` +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"AND (promotion.min_spend IS NULL OR \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t`promotion.min_spend <= '${resultsTotalsByRetailer[retailer][\"discounted_price\"]}') ` +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ORDER BY promotion.discount DESC\";\n\t\t\t\t\t\t\tmysql.pool.query(queryString, (err, discounts, fields) => {\n\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\tres.write(JSON.stringify(err));\n\t\t\t\t\t\t\t\t\tres.end();\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\t//Greedy algorithm to apply non-product specfic promotions. The largest\n\t\t\t\t\t\t\t\t\t//discount possible is applied, followed by any smaller discounts from\n\t\t\t\t\t\t\t\t\t//largest to smallest.\n\t\t\t\t\t\t\t\t\tif(discounts.length > 0){\n\t\t\t\t\t\t\t\t\t\tlet ret_name = discounts[0][\"ret_name\"], j = 1;\n\t\t\t\t\t\t\t\t\t\tdiscounts.forEach(discount => {\n\t\t\t\t\t\t\t\t\t\t\tif(discount.product === null &&\n\t\t\t\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[ret_name][\"discounted_price\"] >=\n\t\t\t\t\t\t\t\t\t\t\t\t\tNumber(discount.discount)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[ret_name][\"discount\"] +=\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNumber(discount.discount);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[ret_name][\"discounted_price\"] -=\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNumber(discount.discount);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[ret_name][\"discount_ids\"][String(j++)] = discount.id;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor(let key in resultsTotalsByRetailer[ret_name][\"prod_ids\"]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(String(resultsTotalsByRetailer[ret_name][\"prod_ids\"][key])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t=== String(discount.product) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Number(resultsTotalsByRetailer[ret_name][\"qts\"][key])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t=== Number(discount.qt_required)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tresultsTotalsByRetailer[ret_name][\"discount_ids\"][String(j++)] = discount.id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\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\tcomplete2();\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}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t//Compare function used for sorting final array of result objects when\n\t\t\t//not all products can be matched. (This sort is performed so the suggested\n\t\t //product divs are displayed in the same order in which they were staged by the user.)\n\t\t\t//See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n\t\t\tfunction compare(a, b){\n\t\t\t\treturn a.prodNum - b.prodNum;\n\t\t\t}\n\n\t\t\t//Secondary complete function to track callbacks while each eligible retailer's\n\t\t\t//promotions are applied (i.e. discount_ids object updated), using a greedy technique\n\t\t\t//(as described above). All values are rounded to two decimal places. Once all\n\t\t\t//retailers are updated, the results are sent to the client.\n\t\t\tfunction complete2(){\n\t\t\t\tcallbackCount2++;\n\t\t\t\tif(Object.keys(resultsTotalsByRetailer).length\n\t\t\t\t\t\t&& callbackCount2 === Object.keys(resultsTotalsByRetailer).length){\n\t\t\t\t\tlet minFinalPrice = Number.MAX_SAFE_INTEGER, minFinalPriceRetailer;\n\t\t\t\t\tfor(key in resultsTotalsByRetailer){\n\t\t\t\t\t\tif(resultsTotalsByRetailer[key][\"discounted_price\"] < minFinalPrice){\n\t\t\t\t\t\t\t\t\tminFinalPrice = resultsTotalsByRetailer[key][\"discounted_price\"];\n\t\t\t\t\t\t\t\t\tminFinalPriceRetailer = key;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresultsTotalsByRetailer[minFinalPriceRetailer][\"retailer\"] = minFinalPriceRetailer;\n\t\t\t\t\tresultsTotalsByRetailer[minFinalPriceRetailer][\"discounted_price\"] =\n\t\t\t\t\t\tNumber(resultsTotalsByRetailer[minFinalPriceRetailer][\"discounted_price\"].toFixed(2));\n\t\t\t\t\tresultsTotalsByRetailer[minFinalPriceRetailer][\"discount\"] =\n\t\t\t\t\t\tNumber(resultsTotalsByRetailer[minFinalPriceRetailer][\"discount\"].toFixed(2));\n\t\t\t\t\tresultsTotalsByRetailer[minFinalPriceRetailer][\"initial_price\"] =\n\t\t\t\t\t\tNumber(resultsTotalsByRetailer[minFinalPriceRetailer][\"initial_price\"].toFixed(2));\n\t\t\t\t\t//console.log(\"Winner :\", resultsTotalsByRetailer[minFinalPriceRetailer]);\n\t\t\t\t\tres.send(JSON.stringify([resultsTotalsByRetailer[minFinalPriceRetailer]]));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7ada5c31ed5ae90dd101ff3ed51fa45", "score": "0.4489151", "text": "function checkMatches() {\n if (A == a && B ==b && C == c && D == d) {\n let t1 = performance.now();\n score = parseInt(((t1 - t0) / (amountOfAttempts * 1000))+1);\n document.getElementById('task').innerHTML = '';\n btns.innerHTML = '<h2> You won! Your score is ' + score + '</h2>';\n form.hidden = false;\n attempts.innerHTML ='';\n check.hidden = true;\n } else {\n checkNumberOfAttempt();\n }\n }", "title": "" }, { "docid": "56d184e9d60750e3d816396022706e0d", "score": "0.4480852", "text": "function deflate_stored(flush) {\n\t\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n\t\t\tvar max_block_size = 0xffff;\n\t\t\tvar max_start;\n\n\t\t\tif (max_block_size > pending_buf_size - 5) {\n\t\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t\t}\n\n\t\t\t// Copy as much as possible from input to output:\n\t\t\twhile (true) {\n\t\t\t\t// Fill the window as much as possible:\n\t\t\t\tif (lookahead <= 1) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\tstrstart += lookahead;\n\t\t\t\tlookahead = 0;\n\n\t\t\t\t// Emit a stored block if pending_buf will be full:\n\t\t\t\tmax_start = block_start + max_block_size;\n\t\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t\t\tlookahead = (strstart - max_start);\n\t\t\t\t\tstrstart = max_start;\n\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\n\t\t\t\t}\n\n\t\t\t\t// Flush if we may have to slide, otherwise block_start may become\n\t\t\t\t// negative and the data will be gone:\n\t\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_block_only(flush == Z_FINISH);\n\t\t\tif (strm.avail_out === 0)\n\t\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "56d184e9d60750e3d816396022706e0d", "score": "0.4480852", "text": "function deflate_stored(flush) {\n\t\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n\t\t\tvar max_block_size = 0xffff;\n\t\t\tvar max_start;\n\n\t\t\tif (max_block_size > pending_buf_size - 5) {\n\t\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t\t}\n\n\t\t\t// Copy as much as possible from input to output:\n\t\t\twhile (true) {\n\t\t\t\t// Fill the window as much as possible:\n\t\t\t\tif (lookahead <= 1) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\tstrstart += lookahead;\n\t\t\t\tlookahead = 0;\n\n\t\t\t\t// Emit a stored block if pending_buf will be full:\n\t\t\t\tmax_start = block_start + max_block_size;\n\t\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t\t\tlookahead = (strstart - max_start);\n\t\t\t\t\tstrstart = max_start;\n\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\n\t\t\t\t}\n\n\t\t\t\t// Flush if we may have to slide, otherwise block_start may become\n\t\t\t\t// negative and the data will be gone:\n\t\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_block_only(flush == Z_FINISH);\n\t\t\tif (strm.avail_out === 0)\n\t\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "ab0089f59617d3beefb4234920ca03f0", "score": "0.44761685", "text": "function matched() {\n\tstoredCards[0].classList.add('match', 'disable');\n\tstoredCards[1].classList.add('match', 'disable');\n\tif (matchedCards.length == 16) {\n\t\tclearInterval(time);\n\t\tSwal.fire({\n\t\t\ttitle: \"Well Done\",\n\t\t\thtml: 'You Earned <strong style=\"color: #ff9f33; text-shadow: 2px 2px 2px #000\";>' + nofStar + ' <i class=\"fa fa-star\"></i></strong><br> Time Taken is <br>' + hours + ' Hours ' + min + ' Minutes ' + sec + ' Seconds ',\n\t\t\tconfirmButtonText: '<i class=\"fa fa-play\" aria-hidden=\"true\"></i> PlayAgain',\n\t\t}).then(() => {\n\t\t\treset();\n\t\t});\n\t}\n\tstoredCards = [];\n}", "title": "" }, { "docid": "1f40c53444b436f61b6df1d76de36270", "score": "0.44582555", "text": "function recordLastScore() {\n let newLineScore =\n '<tr><td>' +\n matchNumber +\n '</td><td>' +\n sec +\n ' sec</td><td>' +\n movesNumber +\n '</td><td>' +\n starRating +\n '</td></tr>';\n currentTable.insertAdjacentHTML('beforeend', newLineScore);\n currentCnt.style.display = 'block';\n let lowScore = +localStorage.getItem('low-score') || Infinity;\n if (movesNumber < lowScore) {\n localStorage.setItem('low-score', movesNumber);\n }\n }", "title": "" }, { "docid": "5a5fc33bdcc55c78bfc7552ebefcdc9d", "score": "0.44580826", "text": "function S_Total_PlayOnce(){\n\tvar sz = finalGameInfo.allMelodies.length;\n\tfor(i = 0; i < sz; i++){\n\t\tif(finalGameInfo.allMelodies[i].bonus.bonus_PlayOnce == true){\n\t\t\tSESSION.total_PlayOnce++;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0704213b2f202c93af96aba1010357fc", "score": "0.44409016", "text": "function updateRecordGather() {\r\n\t\tflag = true;\r\n\t}", "title": "" }, { "docid": "db8adec3b7003680d3ea05a91ad7a5cf", "score": "0.44387883", "text": "eatWhile(match) {\n const start = this.pos;\n while (!this.eof() && this.eat(match)) { }\n return comparePosition(this.pos, start) != 0;\n }", "title": "" }, { "docid": "44cf43253e7b8683c79d8c3452e5376e", "score": "0.44331875", "text": "function checkMatch() {\n if (flippedCards[0].dataset.outercard===flippedCards[1].dataset.outercard){\n flippedCards[0].classList.add('match');\n flippedCards[1].classList.add('match');\n flippedCards = [];\n numberMatches += 1;\n /*checks to see if the number of matches is 8 for a win game and if it is\n pop the win game popup, turn off the timer, and set totalTime var*/\n if (numberMatches===8) {\n popThePopup();\n timerEnds();\n document.querySelector('.totalTime').innerHTML = `Total Time: ${secondsPassed}`;\n }\n }\n /*if there is no match, flip the cards back over and clear flippedcards array\n after 1 second*/\n else {\n setTimeout (function(){\n flippedCards[0].classList.remove('open','show');\n flippedCards[1].classList.remove('open','show');\n flippedCards = [];\n }, 1000);\n }\n}", "title": "" }, { "docid": "19f415010c20ab47ecfadd81df12d18a", "score": "0.44283253", "text": "flush() {\n this.count = 0;\n }", "title": "" }, { "docid": "f323a3c7e188b784d07f9ec17bf7cdde", "score": "0.4426058", "text": "function matchWords() {\n if (wordInput.value === currentWord.innerHTML && time > 0) {\n message.innerHTML = 'Correct!!!';\n score++;\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "e292346af4980e50b6d4e09e5fa7f124", "score": "0.44232097", "text": "isMatchEndWithTurnLimit() {\n let damageTaken1 = 0;\n let damageTaken2 = 0;\n this.playerOnMapList.filter(element => element.team === 0).forEach(element => damageTaken1 += element.damageTaken);\n this.playerOnMapList.filter(element => element.team === 1).forEach(element => damageTaken2 += element.damageTaken);\n let result = null;\n if (damageTaken1 === damageTaken2) {\n result = [true, 0];\n } else if (damageTaken1 > damageTaken2) {\n result = [true, 2];\n } else if (damageTaken2 > damageTaken1) {\n result = [true, 1];\n }\n return result;\n }", "title": "" }, { "docid": "d9ed65f646ec9b52e5eaccba1f85e56e", "score": "0.44210562", "text": "get matchCount() {\r\n return this._results.length;\r\n }", "title": "" }, { "docid": "cffc1f6cb4b73d3e077c13ddca3a7a43", "score": "0.44136736", "text": "function testMatch(card) {\n\n\t\tvar flippedCards = $('.flip'),\n\t\t\tcard1 = $(flippedCards[0]).find('.back-style').attr('data-card-type'),\n\t\t\tcard2 = $(flippedCards[1]).find('.back-style').attr('data-card-type');\n\n\t\t// If they match\n\t\tif (card1 === card2) {\n\n\t\t\t// Adding the class clear turns the invisible\n\t\t\tflippedCards.addClass('clear').removeClass('unmatched');\n\n\t\t\t// Flip them back over\n\t\t\t$('.card-container').removeClass('flip');\n\n\t\t\t// Add one to the match score; 8 = win\n\t\t\tscore++;\n\n\t\t\tconsole.log(score);\n\n\t\t} else {\n\n\t\t\t// Flip them over to be reused\n\t\t\t$('.card-container').removeClass('flip');\n\t\t}\n\n\t\t// Test to see if this is the last match\n\t\tif (score === 8) {\n\n\t\t\tcardList.innerHTML = \"<h2>Congratulations: You've won!</h2>\";\n\t\t\tclearInterval(sec);\n\t\t}\n\t}", "title": "" }, { "docid": "b9852f035fb007f4fff1739d55cea830", "score": "0.4411468", "text": "function checkMatch() {\n\t// compare the values of our cards\n\tif((CARD_ONE.card).value == (CARD_TWO.card).value) {\n\t\t// increment matches made\n\t\tMATCHES_MADE++;\n\n\t\t// increase score and multiplier\n\t\tSCORE = SCORE + (MULTIPLIER * SCORE_INC);\n\t\tMULTIPLIER++;\n\t\t$('#score').html(SCORE);\n\t} else {\n\t\t// they don't match so we need to reset our cards\n\n\t\t// clear front html using card one and card two's index value\n\t\t$('.flip-container[cardNum=\"' + CARD_ONE.index + '\"]').children('.flipper').children('.front').html('');\n\t\t$('.flip-container[cardNum=\"' + CARD_TWO.index + '\"]').children('.flipper').children('.front').html('');\n\n\t\t// re-flip the cards to show the back side\n\t\t$('.flip-container[cardNum=\"' + CARD_ONE.index + '\"]').toggleClass('flipped');\n\t\t$('.flip-container[cardNum=\"' + CARD_TWO.index + '\"]').toggleClass('flipped');\n\n\t\t// reset multiplier\n\t\tMULTIPLIER = 1;\n\t}\n\n\t// set cards to null\n\tCARD_ONE = null;\n\tCARD_TWO = null;\n\n\t// we are done checking\n\tCHECKING = false;\n\n\t// increment number of flips we attampted\n\tNUM_FLIPS++;\n\t$('#numFlips').html(NUM_FLIPS);\n\n\t// display multiplier\n\t$('#multiplier').html(MULTIPLIER);\n\n\t// prompt user that they paired all the cards\n\t// do they want to play again?\n\tif(MATCHES_MADE == MATCHES_NEEDED) {\n\t\tvar result = confirm('Congratulations, you paired all the cards!\\nDo you want to play again?');\n\t\tif(result)\n\t\t\tstartNewGame();\n\t}\n\n}", "title": "" }, { "docid": "470cfad9a55c8a6d272de6e3c06938d8", "score": "0.44047952", "text": "matchFrac () {\n const freq1 = this.frequency(this.oldLines.join(\" \"));\n const freq2 = this.frequency(this.newLines.join(\" \"));\n let longer, shorter;\n if (freq1.total > freq2.total) {\n longer = freq1;\n shorter = freq2;\n } else {\n longer = freq2;\n shorter = freq1;\n }\n const words = Object.keys(longer.words);\n let discrepancies = 0;\n words.forEach( word => {\n const shorterWord = word in shorter.words ? shorter.words[word] : 0; \n discrepancies += longer.words[word] - shorterWord;\n });\n return discrepancies / longer.total;\n }", "title": "" }, { "docid": "66166be3adbbaba5bc0315ce27b1c3bb", "score": "0.4404511", "text": "function cardMatch() {\n\topenCards.forEach((card)=> {\n\t\tcard.classList.remove('open', 'show');\n\t\tcard.classList.add('match');\n\t})\n\t\topenCards = [];\n\t\tupdateMoveCount();\n\t\tupdateMatchCount();\n}", "title": "" }, { "docid": "84781f8b0be2d18c63ad64077cbb7336", "score": "0.44034177", "text": "function gameCounter () {\n\tif (charMatch !== true && hangman > 0) {\n\t\thangman = hangman - 1;\n\t}\n}", "title": "" }, { "docid": "c7112bedc1e4980d674bd71d56f9e8dd", "score": "0.43968874", "text": "function checkMatch(){\n\tmatch = (openCards[0] === openCards[1])\n\tif (match){\n\t\thandleMatch();\n\t}\n\telse{\n\t\thandleNoMatch();\n\t}\n\n\tincreaseCounter();\n}", "title": "" }, { "docid": "692dc79015a3f7d19e2aba38bf104cb0", "score": "0.4396393", "text": "function match(){\n wins++; \n $('#numberWins').text(wins);\n reset();\n }", "title": "" }, { "docid": "cce0be8148a7d6659885457aee7b5ed3", "score": "0.43946344", "text": "function isFlush() {\r\n var suitCount = 1;\r\n for (var i = 0; i < orderedDeck.length; i++) {\r\n if (orderedDeck[i].suit === orderedDeck[i + 1].suit) {\r\n suitCount ++;\r\n } else {\r\n return false;\r\n }\r\n if (suitCount === 5) {\r\n return true;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "814f93439137318eb60ba5e40e90b57d", "score": "0.43932837", "text": "function foundAMatch() {\n if (cardCheck[0].id === cardCheck[1].id){\n matchCount++\n matches.innerText = matchCount\n cardCheck[0].classList.add(\"found\");\n cardCheck[1].classList.add(\"found\");\n }\n}", "title": "" }, { "docid": "3ad81bd4dbb2a84849af5f039466c3ef", "score": "0.4388037", "text": "function handleMatch(){\n\topenCards.forEach(function(element){\n\t\t$('.show:has(.' + element + ')').effect('shake');\n\t\tmatchedCards.push(element);\n\t\tkeepOpenOfMatch($('.card:has(.' + element + ')'));\n\t\tisGameOver();\n\t});\n\topenCards.length = 0;\n}", "title": "" }, { "docid": "1723ec7ed4424bb40d1e195c5197e7d5", "score": "0.4382926", "text": "function checkForMatch () {\n incrementMoves();\n if (openCards[0].isEqualNode(openCards[1])) {\n match(openCards[0]);\n match(openCards[1]);\n checkForEnd();\n openCards = [];\n }else {\n setTimeout(()=>{\n openCards[0].classList.remove('open');\n openCards[1].classList.remove('open');\n openCards = [];\n }, 300)\n }\n}", "title": "" }, { "docid": "4dcb4a2b886fec7227bcef30b823ca8d", "score": "0.43767413", "text": "function saveVotesCount() {\n var hash = {};\n hash[pr_key] = usersWhoVoted();\n chrome.storage.sync.get(pr_key, function (stored) {\n console.log(hash[pr_key], stored[pr_key], hash[pr_key] !== stored[pr_key]);\n if (hash[pr_key] !== stored[pr_key]) {\n chrome.storage.sync.set(hash);\n }\n });\n }", "title": "" }, { "docid": "b148d1aa306d81ce2cf628b95ead5217", "score": "0.43749994", "text": "isComplete() {\n if (this.mode === VoiceMode.STRICT || this.mode === VoiceMode.FULL) {\n return this.ticksUsed.equals(this.totalTicks);\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "04855d989a64c02fedb59868db41920c", "score": "0.43694916", "text": "function checkEndGame(){\n if (matchCount == 8){ \n console.log(\"YOU WON!!!\");\n stopTimeCounter(timerId);\n showResults();\n }\n}", "title": "" }, { "docid": "a0ac61fed8d35602dab74ae24c9fa49d", "score": "0.43668494", "text": "function startMatch() {\n\tif (matchWord()) {\n\t\twordInput.placeholder = \"Start typing..\";\n\n\t\t//for next word\n\t\tisPlaying = true;\n\t\ttimeDisplay.innerHTML = Math.floor(currentLevel / 10).toFixed(1);\n\t\ttime = currentLevel;\n\n\t\tshowWord(words);\n\t\twordInput.value = \"\";\n\t\tscore++;\n\t\t//updating highscore\n\t\tif (score > highscore) {\n\t\t\thighscore = score;\n\t\t\tlocalStorage.setItem(\"highscore\", score);\n\t\t\thighscoreDisplay.innerHTML = highscore;\n\t\t}\n\t}\n\tif (score > highscore) {\n\t\thighscore = score;\n\t\tlocalStorage.setItem(\"highscore\", score);\n\t\thighscoreDisplay.innerHTML = highscore;\n\t}\n\tif (score < 0) scoreDisplay.innerHTML = 0;\n\telse scoreDisplay.innerHTML = score;\n}", "title": "" }, { "docid": "2d166305aac841dbdb52bd8328cd5584", "score": "0.43578887", "text": "function _cbCount(){\n\t\tcountSync = countSync+1;\n\t\tif(countSync==3){\n\t\t\tvar file1 = max(fileA, max(fileO, fileB));\n\t\t\tvar file2 = max(fileA, min(fileO, fileB));\n\t\t\tvar file3 = min(fileA, min(fileO,fileB));\n\t\t\t_compare(file1, file2, file3);\n\t\t\t// Convert ASCII code in string and create a string data.\n\t\t\tfor(var j=0; j<dataWArray.length; j++){\n\t\t\t\tdataWArray[j]=String.fromCharCode(dataWArray[j]); \n\t\t\t\tdata = data+dataWArray[j];\n\t\t\t}\n\t\t\t_writeBufOut();\n\t\t}\n\t}", "title": "" }, { "docid": "7ad89a810c2bd10f869dd5809eeec2a3", "score": "0.43548632", "text": "function match() {\n\tif (listOfOpenCards[0].querySelector('I').classList.value == listOfOpenCards[1].querySelector('I').classList.value) {\n\t\tlet currentCards = deck.getElementsByClassName('open');\n\t\tcurrentCards[1].classList.add('match');\n\t\tcurrentCards[1].classList.remove('open');\n\t\tcurrentCards[0].classList.add('match');\n\t\tcurrentCards[0].classList.remove('open');\n\t\tcurrentCards = '';\n\t\tmoveCounter();\n\t\tisEnd();\n\t} else {\n\t\tlet currentCards = deck.getElementsByClassName('open');\n\n\t\tsetTimeout(function(){\n\t\t\tcurrentCards[1].classList.remove('open');\n\t\t\tcurrentCards[0].classList.remove('open');\n\t\t}, 300);\n\t\tmoveCounter();\t\t\n\t}\n}", "title": "" }, { "docid": "8f4065e81a7530b0f32b821d93a61c94", "score": "0.43541038", "text": "function createPatchBlocks(matchdoc){\n if(!current_file){\n console.log('current file is null!');\n return;\n }\n match_table = BSync.parseMatchDocument(matchdoc);\n var block_index = 1;\n\n var numChunk = Math.ceil(current_file.size/chunkSize);\n\n\n parseFile(current_file,function(type,data,start,stop){\n var patchdoc = new ArrayBuffer(1000);\n var patchsize = 1000;\n var patchdoc32View = new Uint32Array(patchdoc);\n var patchdoc8View = new Uint8Array(patchdoc);\n var numPatch = 0;\n patchdoc32View[0] = block_size;\n patchdoc32View[1] = numPatch;\n var doc_offset = 2*4;\n var data_offset = 0;\n\n var data8View = new Uint8Array(data);\n var numBlocks = Math.ceil(data.byteLength / block_size);\n for(i=0; i < numBlocks; i++){\n if(match_table[block_index] >= 0){\n data_offset += block_size;\n }\n else{\n if(patchsize < doc_offset+block_size + 4*2){\n patchdoc = appendBlock(patchdoc,new ArrayBuffer(patchsize+block_size));\n patchdoc32View = new Uint32Array(patchdoc);\n patchdoc8View = new Uint8Array(patchdoc);\n patchsize += patchsize + block_size;\n }\n //not match save into patch\n numPatch++;\n patchdoc32View[doc_offset/4] = block_index;\n doc_offset+=4;\n var current_blocksize = block_size;\n if(data.byteLength - data_offset < block_size){\n current_blocksize = data.byteLength - data_offset;\n }\n patchdoc32View[doc_offset/4] = current_blocksize;\n doc_offset+=4;\n for(j = 0; j < current_blocksize;j++){\n patchdoc8View[doc_offset] = data8View[data_offset+j];\n doc_offset++;\n }\n data_offset += current_blocksize;\n //if doc_offset is not 4-times\n doc_offset = Math.ceil(doc_offset/4)*4;\n\n }\n block_index++;\n }\n patchdoc32View[1] = numPatch;\n var d = new Date();\n var t = d.getTime() - checksum_timetamp.getTime();\n console.info(current_file.name,'patchdoc time is',t,'ms');\n console.log('patchdoc from',start,'to',stop,':',doc_offset,current_file.size);\n\n //emit the patchdoc\n traffic += doc_offset;\n socket.emit('patchdoc', {'filename':current_file.name,'patchdoc':patchdoc.slice(0,doc_offset),'numChunk':numChunk});\n })\n\n}", "title": "" }, { "docid": "cbd1c1c08335c31fdf10cb35caa0a98f", "score": "0.43526998", "text": "function checkChangeBattlelist(){\n\n console.log(battlePokelist);\n console.log(`${Object.keys(battlePokelist).length>0} ${fLookForFighting}`);\n\n if((Object.keys(battlePokelist).length>0)&&(fLookForFighting == 0)){\n fLookForFighting = 1;\n console.log(\"TIME TO FIGHT\");\n lookForFighting(); //lookForFighting recall changeBattlelist after finished\n }\n}", "title": "" }, { "docid": "649a8b8f25f550adefbe85d888c74b1e", "score": "0.435094", "text": "function recallHistorySearchCheckIn() {\n recallHistoryCheckInPoints++;\n\n if(recallHistoryCheckInPoints === recallHistoryExpectedCheckInPoints) {\n finalizeRecallHistorySearch();\n }\n }", "title": "" }, { "docid": "d9e9c910c535fa4df8c61c376a94c824", "score": "0.43493584", "text": "function checkHighScore() {\r\n\t\tif (_curr.highScore._score <= _score) {\r\n\t\t\t_curr.highScore._score = _score;\r\n\t\t\t// MORE HERE TO SAVE IT IN THE BACK END\r\n\t\t\tvar postParameters = {\r\n\t\t\t\tsongID: songID,\r\n\t\t\t\tscore: _score,\r\n\t\t\t\tuser: \"Default\"\r\n\t\t\t};\r\n\t\t\t$.post(\"/savescore\", postParameters);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "dfcd275d9cac986e11fbadfeb9983143", "score": "0.4340913", "text": "function checkMatch () {\r\n if ( \r\n openCards[0].firstElementChild.className === \r\n openCards[1].firstElementChild.className\r\n) { \r\n openCards[0].classList.toggle('match');\r\n openCards[1].classList.toggle('match');\r\n openCards = [];\r\n console.log('Match!');\r\nif (matches === 7) {\r\n console.log(matches);\r\n toggleModal();\r\n stopTimer();\r\n} else {\r\n matches++; \r\n} \r\n } else { \r\n console.log('Not a Match!');\r\n toggleCard(openCards[0]);\r\n toggleCard(openCards[1]);\r\n openCards=[];\r\n }\r\n}", "title": "" }, { "docid": "54f4fdb8b2d1ee70bb949f2a422c7330", "score": "0.43367", "text": "function checkIfDone(){\n\t\t\tinserted++;\n\t\t\tif(inserted >= size)\n\t\t\t\tcallback(null);\n\t\t}", "title": "" }, { "docid": "ab94d2690cecc98bf19bd09bbef18fc2", "score": "0.43351904", "text": "function matchCounter() {\n counter++;\n if (counter === 8) {\n shouldTimerTick = false;\n openWinModal();\n }\n}", "title": "" }, { "docid": "d1c4e9e99c44792fc52b1c1408984592", "score": "0.4332158", "text": "function checkMatch () {\n if ($('.open').length === 2) {\n if ($('.open').first().attr('data-card') == $('.open').last().attr('data-card')) {\n shown.push($('.open').first().attr('data-card'))\n shown.push($('.open').last().attr('data-card'))\n $('.open').addClass('match')\n $('.open').removeClass('open show')\n }else {\n setTimeout(remove, 1000)\n }\n }\n if ($('.open').length === 3) {\n remove()\n }\n}", "title": "" }, { "docid": "6455458ecac44c8a0edaed6807d7fdd6", "score": "0.43290973", "text": "function updateCreepCount() {\n\tvar alive_cnt = 0;\n\tfor (var role in stg.ROLES) {\n\t\tsaveByRoleInRooms(Game.rooms, role, true);\n\t\talive_cnt += Memory.counters[role];\n\t}\n\tMemory.counters.ALIVE = alive_cnt;\n}", "title": "" }, { "docid": "ee681b0c59cc1fe5206dfddb0d528e25", "score": "0.43284234", "text": "function checkForMatch() {\n if (toggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className) {\n toggledCards[0].classList.toggle('match');\n toggledCards[1].classList.toggle('match');\n toggledCards = [];\n console.log(matched);\n matched++;\n // Check if all cards have been matched\n if (matched === totalPairs) {\n gameOver();\n }\n } else {\n setTimeout(function() {\n toggleCard(toggledCards[0]);\n toggleCard(toggledCards[1]);\n toggledCards = [];\n }, 1000);\n };\n}", "title": "" }, { "docid": "fe16199232b9a5b7bb0049e7fe1a1288", "score": "0.4325646", "text": "handleUpdatePlayCount() {\n const recitation = JSON.parse(window.sessionStorage.getItem('CurrentRecitation'));\n\n recitation.plays += 1;\n window.sessionStorage.setItem('CurrentRecitation', JSON.stringify(recitation));\n\n firebase.database().ref().child('Recitations').child(recitation.id).update({\n plays: recitation.plays\n }, this.reloadData(() => {\n this.props.rStore.dispatch({\n type:'UPDATE_PLAYCOUNT',\n shouldUpdatePlayCount: false\n });\n }));\n return;\n }", "title": "" }, { "docid": "668e1503c381de488ecacb79f391d0f0", "score": "0.4324982", "text": "function saveCandidateHistory() {\n var date = new Date();\n var history = {_id: formatDate(date), date: date, avail: 0, used: 0, usable: 0};\n db[HOST_DB_CANDIDATE].find().forEach(function (candidate) {\n history.avail += candidate.avail;\n history.used += candidate.used;\n history.usable += candidate.usable;\n db[HOST_DB_HISTORY].save(history);\n });\n}", "title": "" }, { "docid": "b9d8b6d82508afb333cc8f5c138e2a08", "score": "0.43147835", "text": "async function save(matchHistoryData){\n var query = util.format(\"select dota.write_match_history(%d,%d,%d,%d,%d,%d);\",\n matchHistoryData['match_id'],\n matchHistoryData['match_seq_num'],\n matchHistoryData['start_time'],\n matchHistoryData['lobby_type'],\n matchHistoryData['radiant_team_id'],\n matchHistoryData['dire_team_id']\n );\n\n try{\n logger.info(\"Saving match history using this query: \"+query);\n var status = await client.query(query);\n }catch(exception){\n logger.error(\"Error in access-match-history.js > save\");\n logger.error(exception);\n return cb(exception);\n }\n}", "title": "" }, { "docid": "6b5c4da6849686b4779c78d9839bcf43", "score": "0.4304747", "text": "beginSave() {\n this.sectionCount.intValue = this.countPages();\n }", "title": "" }, { "docid": "4158ec14aeb68c4e5407ff35c3b866a8", "score": "0.43015715", "text": "playerFinish(finish) {\n let login = finish.login;\n let time = finish.timeOrScore;\n\n if(time > 0) {\n let player = this.players.list[login];\n var record = this.records.filter(function (rec) { return rec.PlayerId == player.id; });\n var updateWidget = false;\n\n if (record.length == 1) {\n // Already has a local record\n if(time < record[0].score) {\n var previousTime = record[0].score;\n var previousIndex = (this.records.indexOf(record[0]) + 1);\n\n record[0].score = time;\n if(this.runs[login]) {\n record[0].checkpoints = this.runs[login];\n } else {\n record[0].checkpoints = '';\n }\n record[0].save();\n\n this.records = this.records.sort((a, b) => a.score - b.score);\n\n if(this.chatannounce) {\n var newIndex = (this.records.indexOf(record[0]) + 1);\n\n var improvedRecordText = '';\n if(newIndex < previousIndex) {\n improvedRecordText = '$0f3$<$fff' + player.nickname + '$>$0f3 gained the $fff' + (newIndex) + '$0f3. Local Record, with a time of $fff' + this.app.util.times.stringTime(record[0].score) +\n '$0f3 ($fff' + (previousIndex) + '$0f3. $fff' + this.app.util.times.stringTime(previousTime) + '$0f3/$fff-' + this.app.util.times.stringTime((previousTime - record[0].score)) + '$0f3)!';\n } else {\n improvedRecordText = '$0f3$<$fff' + player.nickname + '$>$0f3 improved his/her $fff' + (newIndex) + '$0f3. Local Record, with a time of $fff' + this.app.util.times.stringTime(record[0].score) +\n '$0f3 ($fff' + this.app.util.times.stringTime(previousTime) + '$0f3/$fff-' + this.app.util.times.stringTime((previousTime - record[0].score)) + '$0f3).';\n }\n\n updateWidget = true;\n\n if(newIndex <= this.displaylimit)\n this.server.send().chat(improvedRecordText).exec();\n else if(newIndex <= this.recordlimit)\n this.server.send().chat(improvedRecordText, {destination: login}).exec();\n }\n } else if(time == record[0].score) {\n if(this.chatannounce) {\n var equalledIndex = (this.records.indexOf(record[0]) + 1);\n var equalledRecordText = '$0f3$<$fff' + player.nickname + '$>$0f3 equalled his/her $fff' + equalledIndex + '$0f3. Local Record, with a time of $fff' + this.app.util.times.stringTime(record[0].score) + '$0f3...';\n\n updateWidget = true;\n\n if(equalledIndex <= this.displaylimit)\n this.server.send().chat(equalledRecordText).exec();\n else if(equalledIndex <= this.recordlimit)\n this.server.send().chat(equalledRecordText, {destination: login}).exec();\n }\n }\n } else {\n // Does not have a local record yet\n var newRecord = this.models.LocalRecord.build({\n score: time,\n Map: this.maps.current,\n MapId: this.maps.current.id,\n PlayerId: player.id\n });\n newRecord.checkpoints = this.runs[login]? this.runs[login] : '';\n\n this.records.push(newRecord);\n newRecord.Player = player;\n this.records = this.records.sort((a, b) => a.score - b.score);\n\n if(this.chatannounce) {\n var newRecordIndex = (this.records.indexOf(newRecord) + 1);\n var newRecordText = '$0f3$<$fff' + player.nickname + '$>$0f3 drove the $fff' + newRecordIndex + '$0f3. Local Record, with a time of $fff' + this.app.util.times.stringTime(newRecord.score) + '$0f3!';\n\n if(newRecordIndex <= this.displaylimit)\n this.server.send().chat(newRecordText).exec();\n else if(newRecordIndex <= this.recordlimit)\n this.server.send().chat(newRecordText, {destination: login}).exec();\n }\n\n updateWidget = true;\n newRecord.save();\n }\n\n if(updateWidget) {\n console.log('Update each...');\n async.each(Object.keys(this.players.list), (login, callback) => {\n let player = this.players.list[login];\n this.displayRecordsWidget(player)\n .then(() => callback())\n .catch((err) => callback(err));\n }, (err) => {\n console.log('Update DONE!');\n });\n }\n }\n }", "title": "" }, { "docid": "8e911d2be47ebac8f8cf3f9ce20dac7d", "score": "0.42965525", "text": "function Phrase_IsMatch()\n{\n return this.mPairs.fIsMatch();\n}", "title": "" }, { "docid": "4e91e370799b43fd9746af124959fbea", "score": "0.42951033", "text": "async function testFlushing() {\n const id = \"test_flushing\";\n // # Guard false negative.\n if (check(id) == false) return \"test_flushing: fail 1\";\n\n // # Use largest waiting delta;\n // # Should guarantee record flush.\n let seconds = Math.max(deltaSecondsFlushID, deltaSecondsFlushScan);\n // # Wait until flush.\n await sleep(1000 * seconds + 1);\n\n // # Guard false negative. -- should act as new\n // # introduction since the old record is gone.\n if (check(id) == false) return \"test_flushing: fail 2\";\n\n // ok.\n return \"test_flushing: ok\";\n}", "title": "" }, { "docid": "855eee8e08cebbd29d17da5816aa5b97", "score": "0.42907056", "text": "function storeInstructionData() {\n\tvar val\n\tvar nCorrect=0\n\tfor( var q=0; q<nQuestions; q++) {\n\t\tval = getRadioButton(\"question\"+q)\n\t\tif( val==\"correct\") nCorrect++\n\t}\n\t\n\t// store\n\tdata.instructionTime[ checkCount ] = toc-tic // [see ***]\n\tdata.instructionCheckScore[ checkCount ] = nCorrect\n\tdata.instructionFails = checkCount \n\t\n\t// return\n\tvar success = nCorrect == nQuestions\n\treturn success\n}", "title": "" }, { "docid": "f5d1e664495f0c31993e711277f3959a", "score": "0.42883095", "text": "getSavedCount() {\n return this.saved.length;\n }", "title": "" }, { "docid": "6761dafc013f14bac1be42b8da3b1574", "score": "0.4276274", "text": "increment_write_score(output) {\n const last_captured = this.last_capture_length;\n const captured = this.assign_score_of(output);\n\n if (last_captured != null) {\n const increment = captured - last_captured;\n this.last_capture_length = captured;\n this.increment_assign_score(increment);\n } else if (this.render_length_limit && captured > this.render_length_limit) {\n this.raise_limits_reached();\n }\n }", "title": "" }, { "docid": "3e4eedb22a46334225ba041d444dfe68", "score": "0.4274512", "text": "async function updateMatches() {\n // This needs checking, does this work correctly?\n fs.readFile('teams.txt', (err, data) => {\n if (err) throw err;\n finTeams = JSON.parse(data);\n });\n // Past matches not yet done, because it needs some kind of time filter\n //await paginateMatches('past');\n await paginateMatches('running');\n await paginateMatches('upcoming');\n}", "title": "" }, { "docid": "76b060c7cc8ec3d5a4f54514374140ce", "score": "0.42712986", "text": "function checkForMatch() {\n\tmoves++;\n\tmovesText.innerText = moves;\n\tif (firstCard.dataset.framework === secondCard.dataset.framework) {\n\t\tdisableCards();\n\t} else {\n\n\t\t// When two Cards are clicked but cards do not match\n\n\t\tunflipCards();\n\t}\n\tif (this.matchedCards.length === 8) {\n\t\tvictory();\n\t}\n\n}", "title": "" }, { "docid": "6a79a6ecc86bffc6ba16841fa54900e6", "score": "0.42699808", "text": "allPlayersDone() {\n var showHostOffset = 0;\n var doneCount = 0;\n\n this.playerMap.doAll((player) => {\n if (player.isShowHost) {\n showHostOffset++;\n } else if (!player.hasFastestFingerChoicesLeft()) {\n doneCount++;\n }\n });\n\n return doneCount >= this.playerMap.getPlayerCount() - showHostOffset;\n }", "title": "" }, { "docid": "9765c47582230f0fa544dda80743dafe", "score": "0.42535642", "text": "cardHasMatched(currentCardSelected, previousCardSelected) {\n this.similarCardsRetrieved.push(currentCardSelected);\n this.similarCardsRetrieved.push(previousCardSelected);\n\t\t// Points to allocate per correct match\n\t\tswitch(levelToBeDisplayed){\n\t\t\tcase \"Easy\":\n\t\t\t\tthis.totalScore+=1;\n\t\t\t\tbreak;\n\t\t\tcase \"Normal\":\n\t\t\t\tthis.totalScore +=2;\n\t\t\t\tbreak;\n\t\t\tcase \"Hard\":\n\t\t\tthis.totalScore +=3;\n\t\t\t\tbreak\n\t\t}\n\t\t\n //Update score on DOM\n this.score.innerText = this.totalScore;\n\n\t\t// Checks if all cards have been match by comparing array length\n if (this.similarCardsRetrieved.length === this.cardsArray.length) {\n\n setTimeout(() => {\n this.victory();\n }, 500);\n }\n\n }", "title": "" }, { "docid": "e094fa69a96b8d0d256e86309e2f099e", "score": "0.4242645", "text": "function checkScore() {\n if (points > highscore) {\n localStorage.setItem(\"highscore\", points);\n newHighScore = true;\n }\n }", "title": "" }, { "docid": "0c68abfd782b40be3ffa7b04a8300b5f", "score": "0.4238538", "text": "function checkScores(){\n for (var i = 0; i < recordsList.length; i++) {\n var recordScore = recordsList[i];\n result = compareScores(score, recordScore.score);\n }\n\n if (result) {\n console.log(chalk.yellowBright.bold.underline(\"* Congratulations! You have beaten a record. Please take a screenshot and send me it to update the table. *\"));\n }\n}", "title": "" }, { "docid": "97160e7cef8993b1043a2b9f57f74596", "score": "0.4236576", "text": "setNewWIDCount() {\n let newWIDCount = 0;\n let currentTime = this.state.wavePlayer.getCurrentTime();\n let wordObjectMap = this.state.wordObjectMap;\n for (let property in wordObjectMap) {\n if (wordObjectMap.hasOwnProperty(property)) {\n if (wordObjectMap[property].timeStamp > currentTime) {\n break;\n }\n newWIDCount++;\n }\n }\n this.setState({\n currentWIDCount: newWIDCount\n });\n }", "title": "" }, { "docid": "438536e2bf7ec2943aade2b70867fda8", "score": "0.42348036", "text": "function saveFoundFile(file, record) {\n\n var data = record.recordData;\n\n if (!trackFile(file)) {\n logit.error('File (path) is not valid %s', file);\n totalFilesToSave--;\n totalErrors++;\n return;\n }\n\n updateFileMeta(file, record);\n\n fileRecords[file].saveHash(data, function (saved) {\n if (!saved) {\n logit.error('Failed to write out sync data file for %s', file);\n totalFilesToSave--;\n totalErrors++;\n } else {\n // no issues writing sync file so write out record to file\n\n fs.outputFile(file, data, function (err) {\n totalFilesToSave--;\n if (err) {\n logit.error('Failed to write out file %s', file);\n totalErrors++;\n } else {\n logit.info('Saved file %s', file);\n }\n\n // done writing out files.\n if (totalFilesToSave <= 0) {\n doneSaving();\n }\n });\n }\n });\n }", "title": "" }, { "docid": "5f7e713c0a51b1b1721eb275e9597585", "score": "0.42336708", "text": "function match() {\n for (let i = 0; i < cardsOpen.length; i++) {\n cardsOpen[i].classList.add('match');\n cardsOpen[i].classList.remove('open', 'show');\n }\n\n cardsOpen = [];\n matchings += 1;\n audioMatch.play();\n\n if (matchings === 8) {\n winGame();\n }\n}", "title": "" }, { "docid": "bf5257ba0ef2cd2b47a711552c27d184", "score": "0.42286852", "text": "async function addFlatee(matchParam) { \n\n let match = await matchList.findOne({ flateeUsername: matchParam.flateeUsername, listingID: matchParam.listingID })\n if (match)\n {\n if (match.matchState == 'list-pending')\n {\n matchParam.matchState = 'matched';\n matchParam.matchedDate = Date.now();\n Object.assign(match, matchParam);\n }\n }\n else\n {\n matchParam.matchState = 'flatee-pending';\n match = new matchList(matchParam);\n }\n\n //if flatee hasnt swiped right on flat, match.matchState = 'flatee-pending';\n //if flatee swiped right on flat, match.matchState = 'matched';\n //if flatee swiped left on flat the card shouldn't have appeared in flattee's page;\n\n // save match\n return await match.save();\n}", "title": "" }, { "docid": "95b9227480208b62511c4a6b1c604ae0", "score": "0.42257464", "text": "function cardMatchSuccess() {\n 'use strict';\n openCards.forEach(function (elem) {\n elem.removeClass().addClass('card match');\n elem.off('click');\n });\n totalOpenCards = totalOpenCards + 2;\n if (totalOpenCards === 16) {\n gameOver();\n }\n}", "title": "" }, { "docid": "f125c3cc73ce7fb924446fbd7fa1d90e", "score": "0.4225423", "text": "function findMatch() {\n const totalMatches = 8;\n\n if (flippedCards[0].firstElementChild.className ===\n flippedCards[1].firstElementChild.className) {\n flippedCards[0].classList.toggle('match');\n flippedCards[1].classList.toggle('match');\n flippedCards = [];\n matchedCards++;\n\n if (matchedCards === totalMatches) {\n endGame();\n }\n } else {\n setTimeout(() => {\n flipCard(flippedCards[0]);\n flipCard(flippedCards[1]);\n flippedCards = [];\n }, 1000);\n }\n }", "title": "" }, { "docid": "1a8206f63e2758137e2c5ce33887253e", "score": "0.42241523", "text": "function DisplayQuestionAndAnswer(){\n event.preventDefault();\n //if user's answer is right, give them 1 point, alert that they are right, send score to local Storage, and move to next question\n if( event.target.innerHTML === questionBank[i].answer){\n totalScore++;\n localStorage.setItem(\"Totalscore\",totalScore)\n console.log(\"match\")\n feedBack.textContent = \"Right\"\n setTimeout(function(){\n feedBack.textContent = \"\"\n },1000)\n nextItem()\n }\n //if user's answer is wrong, minus them 1 point, alert that they are wrong, send score to local Storage, and move to next question\n else{\n totalScore--;\n timeCount = timeCount - 5;\n localStorage.setItem(\"Totalscore\",totalScore)\n console.log(\"unmatch\")\n //\n setTimeout(function(){\n feedBack.textContent = \"\"\n },1000)\n feedBack.textContent = \"Wrong\"\n nextItem()\n }\n}", "title": "" }, { "docid": "f8c5cae49d4b84e66062a382b66a6c8e", "score": "0.4223055", "text": "_defferedSave() {\n if (this.defferedSave.active == true) {\n if (this.defferedSave.saveIn > 0) {\n this.defferedSave.saveIn -= 5;\n } else {\n var todo = this.defferedSave.dbs;\n \n MediaBot.emit('log', `{Deferred} inserted: [${this.defferedSave.records} records] into: (${todo.join(', ')})`);\n\n todo.forEach(db => {\n this.save(db, true, true);\n });\n\n this.defferedSave.active = false;\n this.defferedSave.records = 0;\n this.defferedSave.saveIn = 15;\n this.defferedSave.dbs = [];\n }\n }\n }", "title": "" } ]
edde18d1687107dd51af90356e2c1a85
Start page countdown timer Counts down from START_TIME to 1 PreConditions: START_TIME must be initialized PostConditions: A countdown timer from START_TIME to 1 has been displayed on the start page
[ { "docid": "dd791e0c0b5215cb434503bfcee39d1f", "score": "0.60163337", "text": "function startTimer() {\n var i = START_TIME;\n var countdownTimer = setInterval(function () {\n document.getElementById(\"output\").innerHTML = i + \" seconds remaining\";\n i = i - 1;\n if (i <= 0) {\n clearInterval(countdownTimer);\n }\n }, 1000);\n}", "title": "" } ]
[ { "docid": "69316eb07be4a056b11ba3da9e19129b", "score": "0.7152645", "text": "function startCountdown() {\r\n\t\tif(!_isTimerOn) {\r\n\t\t\t_isTimerOn = true;\r\n\t\t\tcountdown();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "54a8d4950a9f3f58c683e8d26c2939f6", "score": "0.67518383", "text": "function initCountdown() {\n\tif (preventTimer === 1) {\n\t\tonTimer();\n\n\t}\n}", "title": "" }, { "docid": "6b4ed73d1802012491c423e0beea681d", "score": "0.6711454", "text": "function startTimer() {\n\tvar timer = 24;\n\tvar minutes = 0;\n\tvar seconds = 0;\n\tcountDownTimer = setInterval(function() {\n\t\tif (timer == 23) {\n\t\t\tif (startTime == \"\") {\n\t\t\t\tstartTime = new Date().toUTCString();\n\t\t\t}\n\t\t}\n\t\tminutes = parseInt(timer / 60, 10);\n\t\tseconds = parseInt(timer % 60, 10);\n\n\t\tminutes = minutes < 10 ? \"0\" + minutes : minutes;\n\t\tseconds = seconds < 10 ? \"0\" + seconds : seconds;\n\t\t$.countTimer.text = minutes + \":\" + seconds;\n\t\tif (timer == 0) {\n\t\t\tif (countDownTimer != null) {\n\t\t\t\tclearInterval(countDownTimer);\n\t\t\t}\n\t\t\tclearTimeout(gameTimer);\n\t\t\t$.contentView.touchEnabled = false;\n\t\t\t$.messageLabel.text = commonFunctions.L('intructionLabel3', LangCode);\n\t\t\t$.messageView.visible = true;\n\t\t\tendTime = new Date().toUTCString();\n\t\t\tgetValues();\n\t\t}\n\t\ttimer -= 1;\n\t}, 1000);\n}", "title": "" }, { "docid": "1d0f1fb792302532cececc331445a37d", "score": "0.6633733", "text": "function toDoWhileCounting() {\t\t\n\t\ttimer_div = document.getElementById('timeleft');\n\t\ttimer_div.innerHTML = CounterStart + \" seconds remaining!\";\t\n\t\t//console.log(CounterStart);\n\t\t//popup.document.timer.timeleft.value = CounterStart;\t\t\n\t\t//console.log(\"counting down..\");\n\t\t// other things lol\n\t}", "title": "" }, { "docid": "59a4f7240a2cefc32fabe4f0e1d751a0", "score": "0.6589449", "text": "start() {\n if (this._intervalId) {\n if (this._time) {\n this._initTimer();\n } else {\n this.countdownCompleted();\n }\n } else {\n this._initTimer();\n }\n }", "title": "" }, { "docid": "a6a3cdf060d178f4a1d5861f162823f6", "score": "0.6568004", "text": "function startCountDown() {\n startTimerCount()\n function startTimerCount() {\n domGamestartTimer.textContent = game.startTimer;\n game.startTimer--;\n }\n window.setInterval(startTimerCount, 1000);\n}", "title": "" }, { "docid": "209745ecd8cc41f969ece2bc27b5f1a6", "score": "0.6536042", "text": "function startCountdown(){\n\n\t\tsetInterval(countdown, 1000);\n\n\t}", "title": "" }, { "docid": "209745ecd8cc41f969ece2bc27b5f1a6", "score": "0.6536042", "text": "function startCountdown(){\n\n\t\tsetInterval(countdown, 1000);\n\n\t}", "title": "" }, { "docid": "81251c87c042acde363a14e103acd704", "score": "0.65172994", "text": "function setupCountdown(id ,minutes){\n var element = getId(id),\n endDate = new Date( new Date().getTime() + minutes * 60000 );\n\n clearInterval(intervalId);\n restorePageStatus();\n\n var tickFunction = function(){\n var totalSecondsLeft = Math.round( (endDate.getTime() - new Date().getTime()) / 1000);\n if(totalSecondsLeft > 0){\n var minLeft = parseInt( totalSecondsLeft / 60);\n var secondsLeft = parseInt( totalSecondsLeft % 60 );\n var secondsText = secondsLeft < 10 ? '0'+secondsLeft.toString() : secondsLeft.toString();\n element.innerText = minLeft +\":\"+secondsText;\n }else {\n clearInterval(intervalId);\n finalizeCountDown(id);\n }\n };\n tickFunction();\n intervalId = setInterval(tickFunction, 1000);\n}", "title": "" }, { "docid": "d1b664f25690a02ebee7a1cfe2b5fb98", "score": "0.65133774", "text": "function countdownStart(){\n let count=5;\n countdown.textContent=count;\n const timeCountDown=setInterval(()=>{\n count--;\n if(count=== 0){\n countdown.textContent='GO!';\n } \n else if(count === -1){\n showGamepage();\n clearInterval(timeCountDown);\n } else{\n countdown.textContent=count;\n }\n },1000);\n \n}", "title": "" }, { "docid": "a95c7edc28b2d0429ba650b3b998899c", "score": "0.6503807", "text": "function start() {\n\t\ttimer--;\n\t\t$('#timer').text(\"Time Remaining: \" + timer + \" Seconds\");\n\n\t\tif (timer == 0) {\n\t\t\tclearInterval(countdown);\n\t\t\ttimer = 0;\n\t\t\t$('#timer').text(\"Time Remaining: \" + timer + \" Seconds\");\n\n\t\t\ttimesUp();\n\t\t}\n\t}", "title": "" }, { "docid": "5e2b07a3d4dad9741cbd1af010ba5391", "score": "0.6463996", "text": "function countdownStart() {\n\tcountdown = setTimeout(\"countdownStart()\", 1000);\n\tif (timeElapsed > 0) {\n\t\ttimeElapsed--;\n\t\t$(\"#timer\").html(\"Time Left: \" + timeElapsed);\t\t\n\t} else {\n\t\t$(\"#sports-trivia-form\").hide();\n\t\t$(\"#score\").show();\n\t}\n\n}", "title": "" }, { "docid": "9a4c6c82a6097b57937219f6b5207f2c", "score": "0.64303744", "text": "startCountdown() {\n if (countdownTimer == null) {\n countdownTimer = setInterval(this.countdown, 1000);\n } else {\n clearInterval(countdownTimer);\n countdownTimer = null;\n }\n }", "title": "" }, { "docid": "474c983089d83bb6292be36547d86d5b", "score": "0.6428716", "text": "function display_c(start){ //JUST CALL THIS FUNCTION AND PASS THE NUMBER OF SECONDS YOU WANT TO COUNDOWN.\n window.start = parseFloat(start);\n var end = 0 // change this to stop the counter at a higher value\n var refresh=1000; // Refresh rate in milli seconds\n if(window.start >= end ){\n mytime=setTimeout('display_ct()',refresh)\n }\n else {\n //alert(\"Time Over \");//code here what you want to do after the time completes.\n var timeOver = true;\n }\n}", "title": "" }, { "docid": "b8bd8ab1649b80fe6175deb61a0d077b", "score": "0.6427844", "text": "function startCountDown() {\n startTime = getTimerMode();\n let timeDisplay = document.getElementById('time');\n if(startTime === \"none\"){\n startTime = 0;\n }\n timeDisplay.innerText = \"0\" + Math.floor(startTime / 60)\n + \":0\" + startTime % 60;\n if(startTime === \"none\"){\n startTime = 0;\n timerID = setInterval(function() {\n if (startTime === 0) {\n startTime++;\n } else if (startTime % 60 < 10){\n startTime++;\n timeDisplay.innerText = \"0\" + Math.floor((startTime - 1) / 60)\n + \":0\" + (startTime - 1) % 60;\n } else if (startTime === 99){\n timeDisplay.innerText = \"00:00\";\n } else {\n startTime++;\n timeDisplay.innerText = \"0\" + Math.floor((startTime - 1) / 60)\n + \":\" + (startTime - 1) % 60;\n }\n },1000);\n } else {\n timerID = setInterval(function() {\n if (startTime === 0) {\n timeDisplay.innerText = \"00:00\";\n endGame();\n } else if (startTime % 60 < 10){\n startTime--;\n timeDisplay.innerText = \"0\" + Math.floor((startTime + 1) / 60)\n + \":0\" + (startTime + 1) % 60;\n } else {\n startTime--;\n timeDisplay.innerText = \"0\" + Math.floor((startTime + 1) / 60)\n + \":\" + (startTime + 1) % 60;\n }\n }, 1000);\n }\n }", "title": "" }, { "docid": "210e31d6ea11b0ac3d8e62a0270529f7", "score": "0.64218104", "text": "function displayStartingPage() {\n displayPage('starting_page')\n \n clearInterval(timer)\n remainingTime = 0\n timeDisplay.textContent = formatSeconds(remainingTime)\n}", "title": "" }, { "docid": "7d55b2bc207b61260027a8e4ced33d10", "score": "0.6421259", "text": "function startCount() {\n if (!timerOn) {\n timerOn = 1;\n countTime();\n }\n}", "title": "" }, { "docid": "68c1e4678426c357060f6b7ca69b6410", "score": "0.6417623", "text": "function startTimer(){\n\ttimer_on = true;\n\tallow_timer = false;\n\tez.get_ele(\"start_timer\").style.backgroundColor = \"gray\";\n\tez.get_ele(\"start_timer_word\").innerHTML = \"<h3>\" + record_time_limit + \" secs</h3>\";\n\t// after time is up\n\thideButtons();\n\tstartTimerCount(record_time_limit);\n}", "title": "" }, { "docid": "89e6451ab57e867d06b3d83108d62ae9", "score": "0.6407587", "text": "function startCountdown(){\n\n\t\t//calls countdown function every 1 second\n\t\tsetInterval(countdown, 1000);\n\n\t}", "title": "" }, { "docid": "35a81416fffa9a5accb0d0ed672ac447", "score": "0.6402704", "text": "function startTimer() {\n start_timer = setTimeout(countDownTimer, 1000);\n}", "title": "" }, { "docid": "d80828154ded4d9e1263c35fb5c508b0", "score": "0.6396766", "text": "function showCountdown(){\n countdownPage.hidden=false;\n splashPage.hidden=true;\n populateGamePage();\n countdownStart(); \n}", "title": "" }, { "docid": "102d10697bb609d09734a1128ee66acc", "score": "0.63814604", "text": "function timestart() {\n $(\"#trivIntro\").hide();\n $(\"#trivStart\").show();\n intervalId = setInterval(countdown, 1000);\n}", "title": "" }, { "docid": "0b5824e91a6b664b3b739104457f5673", "score": "0.6381168", "text": "function startFunction(type){\n\n\tif(type === \"countdown\" || type == \"initial\"){\n\t//For countdown clock\n\tvar countdown_days = Math.floor(countdownTime/86400);\n\tvar countdown_daysRemainder = countdownTime % 86400;\n\tvar countdown_hours = Math.floor((countdown_daysRemainder)/3600);\n\tvar countdown_hoursRemainder = (countdown_daysRemainder) % 3600;\n\tvar countdown_minutes = Math.floor((countdown_hoursRemainder)/60);\n\tvar countdown_minutesRemainder = (countdown_hoursRemainder)%60;\n\tvar countdown_seconds = countdown_minutesRemainder;\n\n\tdocument.getElementById(\"countdown_days\").innerHTML = countdown_days;\n\tdocument.getElementById(\"countdown_hours\").innerHTML = countdown_hours;\n\tdocument.getElementById(\"countdown_minutes\").innerHTML = countdown_minutes;\n\tdocument.getElementById(\"countdown_seconds\").innerHTML = countdown_seconds;\n\t}\n\telse if(type === \"countup\" || type == \"initial\"){\n\n\t//For count up clock\n\tvar countup_days = Math.floor(countupTime/86400);\n\tvar countup_daysRemainder = countupTime % 86400;\n\tvar countup_hours = Math.floor((countup_daysRemainder)/3600);\n\tvar countup_hoursRemainder = (countup_daysRemainder) % 3600;\n\tvar countup_minutes = Math.floor((countup_hoursRemainder)/60);\n\tvar countup_minutesRemainder = (countup_hoursRemainder)%60;\n\tvar countup_seconds = countup_minutesRemainder;\n\n\tdocument.getElementById(\"countup_days\").innerHTML = countup_days;\n\tdocument.getElementById(\"countup_hours\").innerHTML = countup_hours;\n\tdocument.getElementById(\"countup_minutes\").innerHTML = countup_minutes;\n\tdocument.getElementById(\"countup_seconds\").innerHTML = countup_seconds;\n\t}\n}", "title": "" }, { "docid": "824bf3ffd82615a3441218e2ed0a7a7c", "score": "0.63785005", "text": "function initTimer() {\n counter = counterStart;\n setState(states.start);\n showCounter(true);\n}", "title": "" }, { "docid": "0f97367c7dd7adbe19632a7f4b706a46", "score": "0.63635314", "text": "function setTimerOnPage(){\n let t=timeCounter();\n let min=Math.floor(t/60);\n let sec=t%60;\n const string='Timer '+leadingCeros(min, sec);\n document.getElementById('timer').textContent=string;\n }", "title": "" }, { "docid": "6036e2c2320667cc70dbe37d1d70d4db", "score": "0.63543504", "text": "function countItDown(){\n startTime -= 1\n $el.text(startTime);\n App.doTextFit('#hostWord');\n\n if( startTime <= 0 ){\n // console.log('Countdown Finished.');\n\n // Stop the timer and do the callback.\n clearInterval(timer);\n callback();\n return;\n }\n }", "title": "" }, { "docid": "6f922eedf4f09213f8c6d81ad3d5458d", "score": "0.634624", "text": "function countdown() {\n if (time > 0 && start === true) {\n time--;\n }\n timer.innerHTML = `time left: ${time}`;\n}", "title": "" }, { "docid": "81e05a457abef166fce4c03c9c57017d", "score": "0.6336886", "text": "function startCountdown() {\n setInterval(countdown, 1000);\n }", "title": "" }, { "docid": "190216a723e8140489424bcf15ff3e44", "score": "0.63247454", "text": "function countdown_init(value) {\n\t\n countdown_number = timeAllocated[value];\n countdown_trigger();\n}", "title": "" }, { "docid": "41ae2d2b6d14a70223f964f184b346e1", "score": "0.6306825", "text": "function countItDown(){\n startTime -= 1\n $el.text(startTime);\n\n if( startTime <= 0 ){\n // console.log('Countdown Finished.');\n\n // Stop the timer and do the callback.\n clearInterval(timer);\n callback();\n return;\n }\n }", "title": "" }, { "docid": "28b7210f8ab8fdf0c210178124d11b23", "score": "0.62917477", "text": "function countdown_updateTime(){\n\tif(countdownTime > 0){\n\t\tcountdownTime = countdownTime - 1;\n\t\tstartFunction(\"countdown\");\n\t}else{\n\t\tclearInterval(countdown_clock);\n\t\tdocument.getElementById(\"countdown_button_startAndPause\").disabled = true;\n\t\tdocument.getElementById(\"countdown_startAndPause\").src = \"img/start_100.png\";\n\t}\n}", "title": "" }, { "docid": "0c641a5c2e3c455b09c8885a7d68f815", "score": "0.6288832", "text": "function startTimer() {\n p.ready = false;\n p.timeOfStart = p.millis();\n p.timeOut1 = setTimeout(() => {\n p.ready = true;\n }, p.props.startTime * 1000);\n }", "title": "" }, { "docid": "d0f89d5e7a004ebfdc22a4fc09164480", "score": "0.62846845", "text": "function startTimer() {\n setRunningState('running');\n currentDuration = 60000 * getValueFromDistribution(); // Milliseconds.\n timer = setTimeout(timeFinished, currentDuration);\n nextEndTime = Date.now() + currentDuration;\n displayDuration('totaltime', currentDuration);\n document.getElementById('previous').insertAdjacentText('beforeend',\n ' ' + formatDuration(currentDuration) + ',');\n window.plugins.insomnia.keepAwake()\n }", "title": "" }, { "docid": "0a499ec76b2960a2e3a92e30435598fb", "score": "0.6271445", "text": "function startTimer() {\n timerIsPaused = false;\n g.clear();\n if(timerMode === 'active'){\n counter = activeTime;\n timerLayout.time.col = '#f00';\n }\n else{\n counter = restTime;\n timerLayout.time.col = '#0f0';\n }\n\n timerLayout.clear(timerLayout.set);\n timerLayout.set.label = `Sets: ${setsRemaining}`;\n timerLayout.render();\n Bangle.buzz();\n countDown();\n if (!counterInterval){\n counterInterval = setInterval(countDown, 1000);\n }\n}", "title": "" }, { "docid": "0760b88045cb05446352f36b43f986f4", "score": "0.6270807", "text": "function countdownTimer() {\n // http://coursesweb.net/javascript/\n // if $startchr is 0, and form fields exists, gets data for minutes and seconds, and sets $startchr to 1\n if(startchr == 0 ) {\n // makes sure the script uses integer numbers\n ctmnts = 01;\n ctsecs = 10;\n\n // if data not a number, sets the value to 0\n if(isNaN(ctmnts)) ctmnts = 0;\n if(isNaN(ctsecs)) ctsecs = 0; \n\n // rewrite data in form fields to be sure that the fields for minutes and seconds contain integer number\n\n startchr = 1;\n document.getElementById('btnct').setAttribute('disabled', 'disabled'); // disable the button\n }\n\n // if minutes and seconds are 0, sets $startchr to 0, and return false\n if(ctmnts==0 && ctsecs==0) {\n startchr = 0;\n document.getElementById('btnct').removeAttribute('disabled'); // remove \"disabled\" to enable the button\n\n /* HERE YOU CAN ADD TO EXECUTE A JavaScript FUNCTION WHEN COUNTDOWN TIMER REACH TO 0 */\n\n return false;\n }\n else {\n // decrease seconds, and decrease minutes if seconds reach to 0\n ctsecs--;\n if(ctsecs < 0) {\n if(ctmnts > 0) {\n ctsecs = 59;\n ctmnts--;\n }\n else {\n ctsecs = 0;\n ctmnts = 0;\n }\n }\n }\n\n\n\n // display the time in page, and auto-calls this function after 1 seccond\n document.getElementById('showmns').innerHTML = ctmnts;\n document.getElementById('showscs').innerHTML = ctsecs;\n setTimeout('countdownTimer()', 1000);\n}", "title": "" }, { "docid": "56b9adba6cb4c87105bcf71a30bf060a", "score": "0.6267875", "text": "function countdown() {\n\t\t\tsecondsLeft--;\n\t\t\t$(\"#timer\").html(secondsLeft);\n\t\t\tif (secondsLeft < 1) {\n\t\t\t\tclearInterval(timer);\n\t\t\t\tendQuestion(\"timeUp\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ff3172f0bee0a20dda096c60f206ca55", "score": "0.6261968", "text": "function countDown() {\n // Out of time\n if (counter<=0) {\n if(timerMode === 'active'){\n timerMode = 'rest';\n startTimer();\n return;\n }\n else{\n --setsRemaining;\n if (setsRemaining === 0){\n clearInterval(counterInterval);\n counterInterval = undefined;\n //setWatch(startTimer, (process.env.HWVERSION==2) ? BTN1 : BTN2);\n outOfTime();\n return;\n }\n timerMode = 'active';\n startTimer();\n return;\n }\n }\n\n timerLayout.clear(timerLayout.time);\n timerLayout.time.label = counter;\n timerLayout.render();\n counter--;\n}", "title": "" }, { "docid": "7874487e052ce5676b6cdc1b9d823c66", "score": "0.6257491", "text": "function startTimer() {\n counterStart = counter;\n setState(states.count);\n countDown();\n if (!counterInterval)\n counterInterval = setInterval(countDown, 1000);\n}", "title": "" }, { "docid": "07b50af9629672ca7c33a403f6353f30", "score": "0.62519604", "text": "function startTimer(){\n //decrease original 120 seconds display by 1 every second and display to page\n time--;\n $(\"#timer\").text(\"Time Remaining: \" + time + \" seconds\")\n\n // if time=0 stop interval\n if (time===0) {\n clearInterval(countDown);\n //run done function that moves on to results page\n }; \n\n }", "title": "" }, { "docid": "13ea9c490b076675ed747b33e0f433b4", "score": "0.6230412", "text": "function startTimer() {\n\tdocument.getElementById(\"startButton\").onclick = function(){\n\t\t\n\t\t$( \".timer-container\" ).slideDown( \"slow\", function() {\n\n\t\t\tconsole.log(\"Start: \" + getStart);\n\n\t\t\t// If getStart is undefined it will reload all current tabs open\n\t\t\t// But next time this callback function occurs, getStart will be 'True'\n\t\t\t// thus it won't force a relaod to all current tabs open\n\t\t\tif(getStart === undefined){\n\n\t\t\t\tgetStart = true;\n\t\t\t\treloadPage();\n\t\t\t}\n\t\t\t\n\t\t});\n\n\t\tchrome.runtime.sendMessage({\n\t\t\t\"command\": \"startTimer\"\n\t\t}, function(response) {\n\t\t\tconsole.log(response.message);\n\t\t});\n\n\t}\n\n}", "title": "" }, { "docid": "1edda7c237d3f6e7316af1d69ba83b29", "score": "0.622401", "text": "function countDownTimer() {\n seconds++;\n if (seconds >= 60) {\n seconds = 0;\n minutes++;\n\n if (minutes >= 60) {\n minutes = 0;\n hours++;\n }\n }\n var timeContext = (hours ? (hours > 9 ? hours : \"0\" + hours) : \"00\") + \":\" +\n (minutes ? (minutes > 9 ? minutes : \"0\" + minutes) : \"00\") + \":\" +\n (seconds > 9 ? seconds : \"0\" + seconds);\n\n $('#time--elapsed').html(\"Time elapsed : \" + timeContext);\n startTimer();\n}", "title": "" }, { "docid": "e4536cd3991e13c7ef2368bde11c5012", "score": "0.6212628", "text": "function timeCalcPost() {\n let timerCoreValue = new Date(timerCoreStarter * 1000);\n let hours = Math.floor((timerCoreValue % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n let minutes = Math.floor((timerCoreValue % (1000 * 60 * 60)) / (1000 * 60));\n let seconds = Math.floor((timerCoreValue % (1000 * 60)) / 1000);\n //Output the minutes and seconds. Hide the minute part if it is less than 1 minute\n if (hours < 10) {\n timerHours.textContent = \"0\" + hours;\n } else {\n timerHours.textContent = hours;\n }\n if (minutes < 10) {\n timerMinutes.textContent = \"0\" + minutes;\n } else {\n timerMinutes.textContent = minutes;\n }\n if (seconds < 10) {\n timerSeconds.textContent = \"0\" + seconds;\n } else {\n timerSeconds.textContent = seconds;\n }\n}", "title": "" }, { "docid": "5574a2c290ca1bcfbbe6d26cc2b404d4", "score": "0.61933917", "text": "function showCountdown(){\n\t\tseconds--;\n\n\t\tif(seconds < 10) {\n\t\t\t$(\"#timeLeft\").html(\"00:0\" + seconds);\t\n\t\t} else {\n\t\t\t$(\"#timeLeft\").html(\"00:\" + seconds);\t\n\t\t}\n\t\t\n\t\tif(seconds < 1){\n\t\t\tclearInterval(time);\n\t\t\tanswered = false;\n\t\t\tanswerPage();\n\t\t}\n\t}", "title": "" }, { "docid": "d5ff87ddc434486860953914f3394c9e", "score": "0.6188247", "text": "function startCountdown() {\n let timerAction = () => {\n if (countDown > 0) {\n countDown--;\n timeValueDisplay.textContent = countDown;\n } else {\n // countDown == 0\n finishGame();\n window.clearInterval(timer);\n }\n };\n timer = window.setInterval(timerAction, 1000);\n timeDisplay.classList.add(\"running\");\n timeValueDisplay.classList.add(\"running\");\n}", "title": "" }, { "docid": "aa82dd2e6be2c07ba7c2d0500ab44252", "score": "0.6187375", "text": "function countdown() {\n startBtn.style.display = \"none\";\n darkMode();\n var timeInterval = window.setInterval(function () {\n if (!isPaused) {\n timeLeft--;\n timerEl.textContent = \"Seconds: \" + timeLeft;\n pauseTimer();\n } else if (timeLeft === 0) {\n isPaused = true;\n } else {\n // Once `timeLeft` gets to 0, set `timerEl` to an empty string\n timerEl.textContent = `Finished with ${timeLeft} seconds left. May the force be with you.`;\n // Use `clearInterval()` to stop the timer\n clearInterval(timeInterval);\n // Call the `displayMessage()` function\n }\n }, 1000);\n\n questionsList();\n}", "title": "" }, { "docid": "f45645c4d314643c66cfa59e2cd0bb7c", "score": "0.61772555", "text": "function Start () {\t\n\tif(countup) {\n\t\tDebug.Log(\"Count Up Timer initiated\");\n\t\tsec = 0f;\n\t\tmin = 0f;\n\t\thrs = 0f;\n\t} \n}", "title": "" }, { "docid": "aefababce48f6b5311922ecec4422d3b", "score": "0.61724573", "text": "function start(){\n if(stoptime==true){\n stoptime=false;\n timerCycle();\n }\n}", "title": "" }, { "docid": "752ab7cd5b0f311f11251ad6867329b8", "score": "0.615384", "text": "function OnStartCountdownExpired()\n{\n\tif (inputDirector.IsHosting()) \n\t{\n\t\t// The GameDirector will handle this message. In a solo game, all cycles will\n\t\t// immediately accelerate to a speed of 800 and relenquish control to all players.\n\t\t// In a network game, the server will just do it to their own and send a\n\t\t// non-buffered RPC call to all players to accelerate and relenquish their controls\n\t\t// as well. It's a rather specialized function but it gets the job done in one message.\n\t\tSendMessage(\"OnAccelerateAndUnlockCycles\", 800);\n\t}\n}", "title": "" }, { "docid": "b11e989d52fb1e5e21681c9b1bb4cc32", "score": "0.6150965", "text": "function showCountdown() {\n seconds--;\n\n if (seconds < 10) {\n $(\"#timeLeft\").html(\"00:0\" + seconds);\n } else {\n $(\"#timeLeft\").html(\"00:\" + seconds);\n }\n\n if (seconds < 1) {\n clearInterval(time);\n answered = false;\n answerPage();\n }\n }", "title": "" }, { "docid": "b11e989d52fb1e5e21681c9b1bb4cc32", "score": "0.6150965", "text": "function showCountdown() {\n seconds--;\n\n if (seconds < 10) {\n $(\"#timeLeft\").html(\"00:0\" + seconds);\n } else {\n $(\"#timeLeft\").html(\"00:\" + seconds);\n }\n\n if (seconds < 1) {\n clearInterval(time);\n answered = false;\n answerPage();\n }\n }", "title": "" }, { "docid": "b11e989d52fb1e5e21681c9b1bb4cc32", "score": "0.6150965", "text": "function showCountdown() {\n seconds--;\n\n if (seconds < 10) {\n $(\"#timeLeft\").html(\"00:0\" + seconds);\n } else {\n $(\"#timeLeft\").html(\"00:\" + seconds);\n }\n\n if (seconds < 1) {\n clearInterval(time);\n answered = false;\n answerPage();\n }\n }", "title": "" }, { "docid": "f85fa091bba4403bdcb8f7261de79d18", "score": "0.61441374", "text": "function initCountDown(value){\n window.localStorage.setItem('timeSet',value)\n count = new countDownTime(value)\n timer = setInterval(showTimer, 1000)\n $form.style.display = 'none'\n $reset.style.display = 'block'\n}", "title": "" }, { "docid": "2302b4d43f848476390659325673cf47", "score": "0.6139483", "text": "function startTime() {\n document.getElementById(\"selectProject\").disabled = true;\n document.getElementById(\"del\").disabled = true;\n document.getElementById(\"create\").disabled = true;\n document.getElementById(\"task\").value = \"\";\n\n /* check if seconds, minutes, and hours are equal to zero \n and start the Count-Up */\n if (seconds === 0 && minutes === 0 && hours === 0) {\n /* hide the fulltime when the Count-Up is running */\n var fulltime = document.getElementById(\"fulltime\");\n fulltime.style.display = \"none\";\n var showStart = document.getElementById(\"start\");\n showStart.style.display = \"none\";\n\n /* call the startWatch( ) function to execute the Count-Up \n whenever the startTime( ) is triggered */\n startWatch();\n }\n}", "title": "" }, { "docid": "a415f5cb38587a9e4688ff9dc9945d96", "score": "0.6111373", "text": "function timeStart() {\r\n if (!timeStarted) {\r\n divNum++;\r\n\r\n var today = new Date();\r\n date1h = today.getHours();\r\n date1m = today.getMinutes();\r\n date1s = today.getSeconds();\r\n date1m = checkTime(date1m);\r\n date1s = checkTime(date1s);\r\n curMon = today.getUTCMonth();\r\n curMon = curMon + 1;\r\n curDate = today.getUTCDate();\r\n curYear = today.getUTCFullYear();\r\n\r\n createDurationDiv();\r\n timeStartDiv = curMon + \"/\" + curDate + \"/\" + curYear + \" \" + date1h + \":\" + date1m + \":\" + date1s;\r\n document.getElementById('time1').innerHTML = timeStartDiv;\r\n totalTime();\r\n timeStarted = true;\r\n }\r\n\r\n}", "title": "" }, { "docid": "505f9ad95ee6593f4b488ec84a0536c8", "score": "0.6111024", "text": "function startTimer() {\r\n mins = Number(inputEleForMins.value);\r\n secs = Number(inputEleForSec.value);\r\n\r\n // Converting Time into seconds\r\n totalTimeInSeconds = mins < 1 ? + secs : (mins * 60) + secs;\r\n\r\n if (totalTimeInSeconds === 0 || (mins === NaN && secs === NaN)) {\r\n alert('Please set the time first');\r\n }\r\n\r\n else {\r\n // Disabiling start button\r\n btnStart.disabled = true;\r\n btnStart.style.opacity = '0.6';\r\n\r\n // turning disability off\r\n btnStop.disabled = false;\r\n btnStop.style.opacity = '1';\r\n\r\n interval = setInterval(countdown, 1000);\r\n }\r\n}", "title": "" }, { "docid": "f2f41d172c4021583ae8294f236cea27", "score": "0.61082804", "text": "function startTimer(){\n //countdown to be modfiied\n timeleft = 100;\n downloadTimer = setInterval(function(){\n if(timeleft <= 0){\n clearInterval(downloadTimer);\n get(\"countdown\").innerHTML = \"Fail\";\n } else {\n get(\"countdown\").innerHTML = \"Time: \" +timeleft;\n }\n timeleft -= 1;\n }, 1000);\n }", "title": "" }, { "docid": "8b3308a5a27659cc2703189c689c12a4", "score": "0.6101152", "text": "function timeleft() {\n counter--;\n let min = Math.floor(counter / 60);\n let sec = counter % 60;\n if (min < 0 && sec < 0) {\n window.open('testsubmission.jsp');\n return;\n }\n if (sec < 10) {\n timer.value = `0${min}:0${sec}`;\n } else {\n timer.value = `0${min}:${sec}`;\n }\n }", "title": "" }, { "docid": "59be0737130340dc1d4174ba788f3200", "score": "0.61010814", "text": "function countdown() {\n\t\t\tif (secondsLeft <= 0) {\n\t\t\t\tclearInterval(timerId); // Should stop the timer\n\t\t\t\tclearInterval(moveTimer); // Should stop the timer\n\t\t\t\tthis.gotoAndStop(\"GameOver\");\n\t\t\t} else {\n\t\t\t\tsecondsLeft--; // reduce seconds by 1\n\t\t\t\t// Next line is optional - same as above\n\t\t\t\tthis.Timer_mc.Timer.text = secondsLeft; // update the text field\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "acd43031145efa98b8fc9beb6a94c056", "score": "0.60948724", "text": "function start() {\n seconds = 0;\n startTimer();\n count=0;\n restart();\n}", "title": "" }, { "docid": "b7aee0fd239e65a7f3a3c8ff174f2190", "score": "0.6090356", "text": "startCountdown (startTime) {\n d3.select('.countdown .axis line').attr('y2', 0)\n d3.select('.countdown .axis circle').attr('cy', 0)\n this.parentNode.classList.add('show-countdown')\n this.countdownTimer = d3.interval(\n ms => this.countdownHandler(startTime),\n 100\n )\n const finishTime = new Date(+startTime + 7 * 60000)\n d3.timeout(ms => this.stopCountdown(), finishTime - new Date())\n }", "title": "" }, { "docid": "fdcbeb0b8524f13ceb80cfd973c9ee20", "score": "0.60845983", "text": "function gameTimer(){\n\tcountdownStart();\n}", "title": "" }, { "docid": "b163e550fdc43cce9ddb1b03ed79a484", "score": "0.60573256", "text": "function chronoStart() {\n\n if (startBtn.innerHTML == \"START\" && timer == \"00:00:00:00\") {\n\n start = new Date()\n\n chrono()\n\n startBtn.innerHTML = \"STOP\"\n\n }\n\n else if (startBtn.innerHTML == \"START\" && timer != \"00:00:00:00\") {\n\n start = new Date() - diff\n\n start = new Date(start)\n\n chrono()\n\n startBtn.innerHTML = \"STOP\"\n\n }\n\n else {\n\n clearTimeout(timerID)\n\n startBtn.innerHTML = \"START\"\n\n }\n\n}", "title": "" }, { "docid": "3fea230e6aa30fe3d1f256c03b872b72", "score": "0.60538614", "text": "function Start()\n{\n\t// Here, we set our timeRemaining variable have the same value as timeToCountdownFrom variable.\n\ttimeRemaining = timeToCountdownFrom;\n}", "title": "" }, { "docid": "537cd67fc345b62872b01b9c3c599ace", "score": "0.6050988", "text": "function startTimer(startAt, display) {\n var start = Date.now(),\n diff,\n minutes,\n seconds;\n\n function timer() {\n // get the number of seconds that have elapsed since \n // startTimer() was called\n diff = startAt - (((Date.now() - start) / 1000) | 0);\n\n // does the same job as parseInt truncates the float\n minutes = (diff / 60) | 0;\n seconds = (diff % 60) | 0;\n\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n\n display.textContent = minutes + \":\" + seconds;\n\n if (diff <= 0) {\n // add one second so that the count down starts at the full duration\n // example 05:00 not 04:59\n start = Date.now() + 1000;\n }\n time = minutes + ':' + seconds;\n isZero(time);\n };\n // we don't want to wait a full second before the timer starts\n timer();\n activeTimer = setInterval(timer, 1000);\n}", "title": "" }, { "docid": "e0f2374c65724c1c9b80ef97bac1a8a3", "score": "0.6045649", "text": "function pageStartup() {\n showTime();\n}", "title": "" }, { "docid": "62fbd768e1a1eb6e40ad275272a33255", "score": "0.6042996", "text": "function startCountdown(){\n\tcountdown = setInterval(countDown,1000);\n}", "title": "" }, { "docid": "59dd78406abd5dff6aff8f30a6c6e3c3", "score": "0.60425764", "text": "function startTime() {\n if (!time.counting && (input.val().length != 0 || results.incorrect != 0)) {\n setTime = setInterval(countDown, 1000);\n time.counting = true;\n\n } else\n return;\n}", "title": "" }, { "docid": "25a1d12a73d92f120786d1eccdd99028", "score": "0.60399663", "text": "function initFunction(){\n\tif (typeof countup_clock !== 'undefined' && countdown_clock !== 'undefined') {\n\t\tclearInterval(countdown_clock);\n\t\tclearInterval(countup_clock);\n\t}\n\n\tuserTime = document.getElementById(\"time\").value;\n\tcountdownTime = userTime;\n\tcountupTime = 0;\n\n\tdocument.getElementById(\"countdown_startAndPause\").src = \"img/pause_100.png\";\n\tdocument.getElementById(\"countup_startAndPause\").src = \"img/pause_100.png\";\n\n\tdocument.getElementById(\"countdown_button_startAndPause\").disabled = false; // startAndPause button for countdown clock is enabled \n\tdocument.getElementById(\"countdown_button_reset\").disabled = false; // reset button for countdown clock is enabled \n\tdocument.getElementById(\"countup_button_startAndPause\").disabled = false; // startAndPause button for count up clock is enabled \n\tdocument.getElementById(\"countup_button_reset\").disabled = false; // reset button for count up clock is enabled \n\n\tstartFunction(\"initial\");\n\tcountdown_clock = setInterval(\"countdown_updateTime()\", 1000); // countdown clock is updated every second\n\tcountup_clock = setInterval(\"countup_updateTime()\", 1000); // count up clock is updated every second\n}", "title": "" }, { "docid": "c4b5dd8226fdf18412ead6a2500b684d", "score": "0.6034231", "text": "function startTimer() {\n const tick = () => {\n if (time === 0) {\n goToPage('page-main');\n }\n time--;\n };\n let time = 400;\n tick();\n const timer = setInterval(tick, 1000);\n\n return timer;\n}", "title": "" }, { "docid": "774169161db762f1e87446358a6a275a", "score": "0.6023288", "text": "function setTime() {\n // Start countdown timer\n countDown()\n // Show submit button\n submitButton.style.display = \"block\";\n timerIsrunning = true\n timerInterval = setInterval(countDown, 1000);\n}", "title": "" }, { "docid": "171f36611fa4d7894c02dbe8e13e1c49", "score": "0.6021293", "text": "function startTimer(){\n\ttime--;\n\tdocument.getElementById(\"timer\").innerHTML = time;\n\tif(time < 1){\n\t\tclearInterval(timer);\n\t\ttimeup++;\n\t\tcorrectAnswer = \"timeout\";\n\t\tscorePage();\n\t}\n}", "title": "" }, { "docid": "67b7bd4a7ec80514141bd1c1acd5e7ab", "score": "0.6021037", "text": "function swapToStartTimer() {\n\n\t// Reset the countdown\n\tcountdownReset();\n\n\t// Hide the welcome message\n\t$('#welcome-timer').hide();\n\n\t// Hide the break timer and buttons\n\t$('#java-timer').hide();\n\t$('#break-timer').hide();\n\t$('#break-block').hide();\n\t$('#min-slider').hide();\t\t\t\n\n\t// Show the start timer and start button\n\t$('#start').prop('value','Start a Pom');\n\t$('#pom-timer').show();\n\t$('#start-timer').hide();\n\t$('#start-block').show();}", "title": "" }, { "docid": "9e8c6712beb4de26c1fc838a35ec9e15", "score": "0.6017543", "text": "function start() {\n \tstartTimer(totalTime, display);\n }", "title": "" }, { "docid": "10b4f185c720408ec80072b5a044474d", "score": "0.60170656", "text": "function startTimer() {\n\n\t// If the timer has been paused, the time already elapsed is subtracted\n\t// from the time NOW so that the elapsed time is maintained when the\n\t// timer restarts\n\tT.timeStarted = new Date().getTime() - T.timeElapsed; \n\n\t// Need setInterval as a variable so it can be cleared on stop/reset\n\tupdate = setInterval(postTime, 10);\n\n\t//Disable/enable appropriate buttons\t\n\tdocument.getElementById(\"reset\").disabled = false;\t\n\t// startButtons();\n\t\n\treturn update;\n}", "title": "" }, { "docid": "e9af3963bd2c80896f6b0e31dd6aab05", "score": "0.6015181", "text": "function startTimer() {\n countdownEl.innerHTML = \"Time:\" + timer;\n if (timer <= 0) {\n gameOver();\n } else {\n timer -= 1;\n runningTimer = setTimeout(startTimer, 1000);\n }\n\n }", "title": "" }, { "docid": "72d58f5de55b29ab22fa00bc94328c26", "score": "0.6003796", "text": "function start() {\n timerId = setInterval(countdown,1000)\n}", "title": "" }, { "docid": "d489fe9ecd9157318dfbea8b83596848", "score": "0.6003129", "text": "function Start () {\n\t//invoke the countdown fucntion once every second\n\tInvokeRepeating(\"CountDown\", 1.0, 1.0);\n}", "title": "" }, { "docid": "39422b805a13df6231ede8624bf273f4", "score": "0.6002887", "text": "function countDown()\n{\n if ( maxTime >= 0 )\n {\n hours = Math.floor( maxTime / 3600 );\n minutes = Math.floor( ( maxTime - hours * 3600 ) / 60 );\n seconds = Math.floor( maxTime % 60 );\n var msg = \"Time left: \" + minutes + \" minutes, \" + seconds + \" seconds.\";\n document.getElementById( \"timer\" ).innerHTML = msg;\n \n // Decrements time\n --maxTime;\n window.name = maxTime;\n }\n \n else\n {\n clearInterval( timer );\n timeTaken = getTimeTaken( minutes, seconds );\n alert( \"Time has expired. Moving to next page.\");\n goToNextPage();\n }\n}", "title": "" }, { "docid": "d2cc353b312bbe7f9eda8c73750210db", "score": "0.59989387", "text": "function startTimer(){\n if(!paused)\n {\n //if the timer isnt paused\n //Grabs values located in the spinners under the timer and parses them to be uniform\n currentHours = document.getElementById(\"hour\").value\n currentMinutes = document.getElementById(\"minute\").value\n currentSeconds = document.getElementById(\"second\").value\n currentSeconds = ( currentSeconds < 10 ? \"0\" : \"\" ) + currentSeconds;\n currentMinutes = ( currentMinutes < 10 ? \"0\" : \"\" ) + currentMinutes;\n currentHours = ( currentHours < 10 ? \"0\" : \"\" ) + currentHours;\n \n //overwrites the values in the timer to match the user entered values\n updateTimer();\n }\n \n //starts the count so it isnt paused\n paused = false;\n\n //starts countDown() at an interval of 1 second\n startInterval = setInterval(countDown, 1000);\n //disables the startbutton since it has already started\n document.getElementById(\"start\").disabled = true;\n }", "title": "" }, { "docid": "aaea3cc0d4cefedb4332bb5ddc2f3d59", "score": "0.5997993", "text": "function resumeTimer() {\n if (!counterInterval){\n counterInterval = setInterval(countDown, 1000);\n }\n // display the timer values again.\n timerLayout.clear(timerLayout.time);\n timerLayout.time.label = counter;\n timerLayout.clear(timerLayout.set);\n timerLayout.set.label = `Sets: ${setsRemaining}`;\n timerLayout.render();\n}", "title": "" }, { "docid": "9f8cae0e3c3a6f86c32087aee7357116", "score": "0.59949625", "text": "function countdown() {\n\t\t\tif (secondsLeft == 0) {\n\t\t\t\tclearInterval(timerId); // Should stop the timer\n\t\t\t\tclearInterval(moveTimer); // Should stop the timer\n\t\t\t\tthis.gotoAndStop(\"GameOver\");\n\t\t\t} else {\n\t\t\t\tsecondsLeft--; // reduce seconds by 1\n\t\t\t\t// Next line is optional - same as above\n\t\t\t\tthis.countdown_txt.text = secondsLeft; // update the text field\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c75c7b32389101ea1f73cf112ea90af6", "score": "0.5989971", "text": "function start(){\n\t$(\"main\").show();\n\t$(\"#btn-start\").hide();\n\t//begin countdown for the first question\n\tstartCountdown();\n\t\n}", "title": "" }, { "docid": "3e887f0f513e436485ce3793f47e07f0", "score": "0.5986814", "text": "function setTime() {\n // Creating a function as a variable that decrements the time and displays the countdown on the page\n timerInterval = setInterval(function() {\n secondsLeft--;\n timeEl.innerHTML = \"Time: \" + secondsLeft + \" seconds\";\n \n // When the time is 0, clear the timer countdown and display the ALL DONE page\n if(secondsLeft === 0) {\n clearInterval(timerInterval);\n displayAllDone();\n }\n // Setting timer decrement by 1 every second (i.e. counts down by 1 sec) \n }, 1000);\n}", "title": "" }, { "docid": "7b836b71f69053a4067d5f541e91c0fa", "score": "0.5984253", "text": "countDownStart(periodPrompt) {\n if (this.startTime == 0) {\n this.startTime = new Date();\n this.periodPrompt = periodPrompt;\n KeepAwake.activate();\n }\n }", "title": "" }, { "docid": "b3de3eedd8d7a203a8edf23ef5616649", "score": "0.59831", "text": "function countDown() {\n totalSeconds--;\n setClock();\n // Reached the end of the timer!\n if(totalSeconds === 0) {\n if(!onBreak) incrementPomo();\n resetClock();\n }\n}", "title": "" }, { "docid": "8fd63a91bc6bf30a79abc3965349a0e1", "score": "0.59811413", "text": "function startTimer() {\r\n \r\n\r\n // We only want to start the timer if totalSeconds is > 0\r\n if (totalSeconds > 0) {\r\n /* The \"interval\" variable here using \"setInterval()\" begins the recurring increment of the\r\n secondsElapsed variable which is used to check if the time is up */\r\n interval = setInterval(function() {\r\n secondsElapsed++;\r\n\r\n // So renderTime() is called here once every second.\r\n renderTime();\r\n }, 1000);\r\n } else {\r\n alert(\"Minutes of work/rest must be greater than 0.\")\r\n }\r\n setTime();\r\n}", "title": "" }, { "docid": "68b368e3c449306270bd9de080911cfe", "score": "0.59801406", "text": "function timeToZero(){\n timeStart = 1;\n}", "title": "" }, { "docid": "3d1f55d8a209546f22b57e5d19577a0e", "score": "0.59750783", "text": "function timer() {\n\t\t\t\t// get the number of seconds that have elapsed since\n\t\t\t\t// start_site_notice_timer() was called\n\t\t\t\tdiff = duration - (((Date.now() - start) / 1000) | 0);\n\n\t\t\t\t// does the same job as parseInt truncates the float\n\t\t\t\tminutes = (diff / 60) | 0;\n\t\t\t\tseconds = (diff % 60) | 0;\n\n\t\t\t\tminutes = minutes < 10 ? \"0\" + minutes : minutes;\n\t\t\t\tseconds = seconds < 10 ? \"0\" + seconds : seconds;\n\n\t\t\t\tvar the_time = (diff > 59) ? minutes + \"m \" + seconds + \"s\" : diff + \"s\";\n\n\t\t\t\ttimer_span.text( the_time );\n\n\t\t\t\tif ( diff <= 0 ) {\n\t\t\t\t\t// add one second so that the count down starts at the full duration\n\t\t\t\t\t// example 05:00 not 04:59\n\t\t\t\t\tstart = Date.now() + 1000;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "fe50031ea9df2eecbfcdd1712ce933d5", "score": "0.597457", "text": "function Intcountdown() {\r\n if (timeLeft == 0) {\r\n clearTimeout(timerId);\r\n $(\".time\").hide();\r\n document.title = \"Listo!\";\r\n } else {\r\n var t = \"00:\" + FormatMe(timeLeft);\r\n document.title = t;\r\n elem.html(t);\r\n timeLeft--;\r\n }\r\n }", "title": "" }, { "docid": "96c4ca01cc0749d5e1108ac297705ec3", "score": "0.5973425", "text": "initializeTimeLeft(){}", "title": "" }, { "docid": "192b21af67e5ea8a713eb4c4cb32965f", "score": "0.5971916", "text": "function readyStartingTime() {\n clearInterval(interval);\n totalSeconds = (quizPeriodMinutes * 60) + quizPeriodSeconds;\n}", "title": "" }, { "docid": "9dee1b7e7f8f66ec4c39d169ee5e7f9d", "score": "0.59600365", "text": "function setTimer() {\n event.preventDefault();\n var time = setInterval(function () {\n counterStart--;\n timer.textContent = \"Timer: \" + counterStart;\n\n if (counterStart <= 0) {\n clearInterval(time);\n }\n\n }, 1000);\n\n}", "title": "" }, { "docid": "e4551c47c4512ccb0365e6f15c36c498", "score": "0.593817", "text": "function startTime( ) { \n /* check if seconds, minutes, and hours are equal to zero and start the timer*/ \n if ( seconds === 0 && minutes === 0 && hours === 0 ) { \n startWatch( );\n } }", "title": "" }, { "docid": "4d2bd3d896b9e78a929fd1ba14fa8fb0", "score": "0.5935316", "text": "function countItDown(){\n\n start_time -= 1\n\n if( start_time <= 0 ){\n // Stop the timer and do the callback.\n clearInterval(timer);\n this.$el.find('.countdown').fadeOut();\n app.Game.getRound();\n return;\n }\n\n $count.text(start_time);\n $count.removeClass('huge');\n setTimeout(_.bind(function(){\n $count.addClass('huge');\n }, this), 100);\n }", "title": "" }, { "docid": "b490cc05a41980bef1c8fbb31ef05684", "score": "0.5934928", "text": "function CountDown() {\n var sec = 00;\n var min = 20;\n document.getElementById(\"time\").style.display = 'block';\n var count = setInterval(function () {\n sec--;\n if (sec == -01) {\n sec = 59;\n min = min - 1;\n }\n else {\n min = min;\n }\n if (sec <= 9) {\n sec = \"0\" + sec;\n }\n document.getElementById(\"demo\").innerHTML = min + \"phút\" + sec + \"giây\";\n\n if (min == 00 && sec == 00) {\n clearInterval(count);\n document.getElementById(\"demo\").innerHTML = \"Hết giờ cmmr !!\";\n window.location = \"/WebIQ/Ketqua\";\n }\n }, 1000);\n}", "title": "" }, { "docid": "8d811465a5f461fd65436c42088a1174", "score": "0.59310216", "text": "function startTimer() {\n minutes = Math.floor((timer/100)/60);\n seconds = Math.floor((timer/100) - (minutes * 60));\n milliSeconds = Math.floor(timer - (seconds * 100) - (minutes * 6000));\n\n minutes = leadingZero(minutes);\n seconds = leadingZero(seconds);\n milliSeconds = leadingZero(milliSeconds);\n\n currentTime = minutes+\":\"+seconds+\":\"+milliSeconds;\n theTimer.innerHTML = currentTime;\n timer++;\n }", "title": "" }, { "docid": "4aafae438356cc7a68a6cae51477d207", "score": "0.59293365", "text": "function startTimer() {\n setTime();\n // We only want to start the timer if totalSeconds is > 0\n if (totalSeconds > 0) {\n /* The \"interval\" variable here using \"setInterval()\" begins the recurring increment of the\n secondsElapsed variable which is used to check if the time is up */\n interval = setInterval(function() {\n secondsElapsed++;\n // So renderTime() is called here once every second.\n renderTime();\n }, 1000);\n } else {\n alert(\"Minutes of work/rest must be greater than 0.\")\n }\n}", "title": "" }, { "docid": "3523dbea22574fd8ac3dfae815d2e33b", "score": "0.59263283", "text": "function startTimeGetCurrent (e){\r\n e.stopPropagation();\r\n var i = i == null || i <= 0 ? 0 : i;\r\n var t = Math.floor(ytl.getVariable('currenttime'));\r\n if (ytl.getOption('showPanel')&&t<ytl.getVariable('endtime', i)) {\r\n ytl.setVariable('starttime', i, t);\r\n }\r\n if(ytl.checkIf('inportion')) ytl.replaceUrlVar('start', ytl.getTime(ytl.getVariable('starttime', i)));\r\n ytl.sliderDisplay(i);\r\n }", "title": "" }, { "docid": "e61a71469d305d76ca3a1bb6c4353b51", "score": "0.59183747", "text": "function start_timer()\n{\n \n var curtime=new Date();\n mins=Math.abs(curtime.getMinutes()-start.getMinutes())\n if(mins<10)\n {\n mins='0'+mins\n }\n\n secs=Math.abs(curtime.getSeconds()-start.getSeconds())\n\n if(secs<10)\n {\n secs='0'+secs\n }\n\n milisecs=Math.abs(Math.floor(curtime.getMilliseconds()/10)-Math.floor(start.getMilliseconds()/10))\n \n if(milisecs<10)\n {\n milisecs='0'+milisecs\n }\n\n theTimer.innerHTML=mins+\":\"+secs+\":\"+ milisecs;\n\n\n}", "title": "" }, { "docid": "9b866961ca87df59f87bc152dec993af", "score": "0.59078056", "text": "function startCountdown() {\n timeRemaining = 100;\n return setInterval(() => {\n this.timeRemaining--;\n this.document.getElementById(\"time-remaining\").innerHTML =\n timeRemaining + \" seconds remaining\";\n if (this.timeRemaining === 0) this.gameOver(); //End game if time ends\n }, 1000);\n}", "title": "" } ]
b4f88899eefdd622b705164928b71606
This function will locate an item's value given an object and guid returns false if no match found
[ { "docid": "886f37bbdbc503044b682b6497ade1b3", "score": "0.7296826", "text": "function findValueByGuid(dataObj, guid) {\n // Storage for our return aspect\n var retAspect = false;\n var e = {};\n // Find our item via guid by first\n // searching through all aspects for\n // the guid carried in\n for(var dataObject in dataObj) {\n if(dataObj.hasOwnProperty(dataObject)) {\n for(var i = 0; i < dataObj[dataObject].length; i++) {\n e = dataObj[dataObject][i];\n if(e.guid === guid) {\n retAspect = e;\n }\n if(retAspect.guid === guid) {\n return retAspect.value;\n }\n }\n }\n }\n // If we haven't hit anything yet\n // we are safe to return fasle\n return false;\n }", "title": "" } ]
[ { "docid": "2ff7b5a7efb1d1336437b30c30cff4ae", "score": "0.69352275", "text": "getItemFromValue(value) {\n var _this = this;\n var found = false;\n var foundItem = null;\n this.props.items.forEach(function (item, index) {\n if (item[_this.props.itemDisplayProperty] == value) {\n if (!found) {\n found = true;\n foundItem = item;\n } else {\n return false;\n }\n }\n });\n if (found) {\n return foundItem;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "65e9526903ca5749964a9bbb273569c8", "score": "0.63616633", "text": "getItemById(matchId) {\n for (var id in this.items) {\n if (this.items[id].id === matchId) {\n return this.items[id];\n }\n }\n return false;\n }", "title": "" }, { "docid": "0ce0654fa5e6fde060b2b41ae083e0f3", "score": "0.6265591", "text": "function checkIfItemMatchesValue() {\n\t\t\t\t\t$item = $( this );\n\t\t\t\t\tdata = $item.data( 'item_data' ) || {};\n\t\t\t\t\tif ( data[ items[ i ].property ] === items[ i ].value ) {\n\t\t\t\t\t\tselectItem( $item, items[ i ].selected );\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "a613903173cacb0cade0c1338b8da7d5", "score": "0.62491333", "text": "function checkIfItemMatchesValue () {\n\t\t\t\t$item = $(this);\n\t\t\t\tdata = $item.data('item_data') || {};\n\t\t\t\tif (data[items[i].property] === items[i].value) {\n\t\t\t\t\tselectItem($item, items[i].selected);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "28990e59a885df30d64bee3f05b0beb0", "score": "0.6186967", "text": "function findValueId(val, object) {\n for (var x in object) {\n if (object[x].value === val) {\n return x;\n }\n }\n }", "title": "" }, { "docid": "a8d5c9c65708b5d352be174ed48208ee", "score": "0.6163754", "text": "find(idOrItem) {\n\n if (idLike(idOrItem)) {\n let id = +idOrItem\n return this.items.find((item, i) => {\n return item.id === id;\n })\n } else {\n let item = idOrItem\n let idx = this.items.indexOf(item);\n if (~idx) return item;\n else return undefined;\n }\n }", "title": "" }, { "docid": "516345b73e30a1741581dfd86537b25c", "score": "0.6139614", "text": "function findBy(items, key, value) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (value === item[key]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "51b46c0a14d6c433769176240f3bc605", "score": "0.6106929", "text": "function isFound(item) {\n return item.found;\n }", "title": "" }, { "docid": "2a9c3e120852ac17ec35becc84f7a7f7", "score": "0.6066726", "text": "function findID(obj){\n return obj.value == device_id;\n }", "title": "" }, { "docid": "6dc95be87430cab8a67737e286416c38", "score": "0.60379034", "text": "getItemByProperty(propName, value) {\n for (var id in this.items) {\n if (this.items[id][propName] === value) {\n return this.items[id];\n }\n }\n return false;\n }", "title": "" }, { "docid": "e310abc1d547eb7bf3dae5f705a79827", "score": "0.6006973", "text": "search(item)\n {\n for (let i in this.items) {\n if (typeof item === 'function') {\n if (item(this.items[i], i)) return i;\n } else if (JSON.stringify(this.items[i]) === JSON.stringify(item)) {\n return i;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "3cf5d71aada9718ebe95d6a255f9c41c", "score": "0.5919139", "text": "function findItem(items, refer) {\n var rst = null;\n var value = refer instanceof Group || refer.name === 'legendGroup' ? refer.get('value') : refer;\n Util.each(items, function (item) {\n if (item.value === value) {\n rst = item;\n return false;\n }\n });\n return rst;\n}", "title": "" }, { "docid": "3cf5d71aada9718ebe95d6a255f9c41c", "score": "0.5919139", "text": "function findItem(items, refer) {\n var rst = null;\n var value = refer instanceof Group || refer.name === 'legendGroup' ? refer.get('value') : refer;\n Util.each(items, function (item) {\n if (item.value === value) {\n rst = item;\n return false;\n }\n });\n return rst;\n}", "title": "" }, { "docid": "41607ccefe1591f266a5f8ff193365a8", "score": "0.5896354", "text": "function find(value) {\n if(!value) return;\n var found;\n if(!options.groupKey && scope.items){\n found = scope.items.filter(function (item){\n return item.value === value;\n })[0];\n } else {\n angular.forEach(scope.items, function (group) {\n if(!found) {\n found = group.items.filter(function(item) {\n return item.value === value;\n })[0];\n }\n });\n\n }\n return found;\n }", "title": "" }, { "docid": "3c5200b25d5f6bd1eee591506801660e", "score": "0.5879413", "text": "itemFinder (id) {\n let result = null;\n this.state.items.some((item) => {\n if (item.id === id) {\n result = item;\n return true;\n }\n });\n return result;\n }", "title": "" }, { "docid": "a2989fa6650bc84ccb0b52d6f9720ad5", "score": "0.58711624", "text": "function getItemByAssetID(assetidToFind){\n if (items === undefined || items.length === 0) {\n return false\n }\n return $.grep(items, function(e){ return e.assetid === assetidToFind; })[0];\n}", "title": "" }, { "docid": "14c23453aa313cc57153c2f85e22931b", "score": "0.57970256", "text": "function findVal(object, key) {\n var value;\n Object.keys(object).some(function (k) {\n if (k === key) {\n value = object[k];\n return true;\n }\n if (object[k] && typeof object[k] === 'object') {\n value = findVal(object[k], key);\n return value !== undefined;\n }\n });\n return value;\n }", "title": "" }, { "docid": "273cc8ed2f13cab2eeb56cebdeb0d27b", "score": "0.5791097", "text": "findItemById(items, id) {\n\t for (let item of items) {\n\t if (item._id === id) {\n\t return item;\n\t }\n\t }\n\n\t return false;\n\t}", "title": "" }, { "docid": "23823552cbdf6323a30d7f5d8dae3e55", "score": "0.5786947", "text": "function itemExists(list, itemToFind) {\n for (var i = 0, length = list.length; i < length; i++) {\n var item = list[i];\n if (item === itemToFind) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "b04225ebb6cacf1772517918baf64ea5", "score": "0.57607514", "text": "function findUIDItemInArr(item, userArray){\n for(var i = 0; i < userArray.length; i++){\n if(userArray[i].uid == item){\n console.log(\"Found item: \" + item);\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "0963296222179133a63a8485228caf2c", "score": "0.5758617", "text": "function getObject(theObject,searchKey,searchValue) {\r\n var result = true;\r\n for(var prop in theObject) {\r\n if(prop == searchKey) {\r\n if(theObject[prop] == searchValue) {\r\n return true;\r\n }\r\n }\r\n if(theObject[prop] instanceof Object) {\r\n result = getObject(theObject[prop]);\r\n if (result) {\r\n break;\r\n }\r\n } \r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "585734e06be2d27b39c531c073f931c7", "score": "0.5754506", "text": "function findStuntDescByGuid(guid) {\n // Storage for our return aspect\n var retAspect = false;\n var e = {};\n // Find our item via guid by first\n // searching through all aspects for\n // the guid carried in\n for(var dataObject in FD.stunts) {\n if(FD.stunts.hasOwnProperty(dataObject)) {\n for(var i = 0; i < FD.stunts[dataObject].length; i++) {\n e = FD.stunts[dataObject][i];\n if(e.guid === guid) {\n retAspect = e;\n }\n if(retAspect.guid === guid) {\n return retAspect.description;\n }\n }\n }\n }\n // If we haven't hit anything yet\n // we are safe to return fasle\n return false;\n }", "title": "" }, { "docid": "af36ae9319e59c1e8ef21428413ae83c", "score": "0.5750642", "text": "function findUIDItemInArr(item, userArray){\n for(var i = 0; i < userArray.length; i++){\n if(userArray[i].uid == item){\n //console.log(\"Found item: \" + item);\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "6008d36e7fb569b7e99a302e35284fac", "score": "0.5730194", "text": "function findValue(path,element, identity, searchObj){\n console.log(eval(\"searchObj.\"+path+\"[\"+2+\"].id\"));\n var value;\n for(var i=0; i<path.length;i++){\n if(eval(\"searchObj.\"+path+\"[\"+i+\"].id\")==identity){\n value = eval(\"searchObj.\"+path+\"[\"+i+\"].\"+element);\n console.log(eval(\"searchObj.\"+path+\"[\"+i+\"].\"+element));\n break;\n }\n value = eval(\"searchObj.\"+path+\"[\"+2+\"].\"+element);\n }\n return value;\n }", "title": "" }, { "docid": "98baa9eb49e24923e71be25d355c53a0", "score": "0.57255834", "text": "function locateItem(user, itemStr) {\n var result = []; // The returned array.\n \n for (var location in user.player.worn) {\n var curItem = user.player.worn[location];\n \n // Hands special case.\n if (location == 'hands') {\n for (var hand in curItem) {\n curItem = curItem[hand];\n \n if (strTarget(curItem) == itemStr) {\n result[0] = location + '.' + hand;\n result[1] = curItem;\n break;\n }\n }\n \n if (item) {\n break;\n }\n }\n \n // Any other location.\n if (strTarget(curItem) == itemStr) {\n result[0] = location;\n result[1] = curItem;\n break;\n }\n }\n \n // Not found.\n if (result.length == 0) {\n return false;\n }\n \n return result;\n}", "title": "" }, { "docid": "d619be5dc425c2c1c0abf077fffba251", "score": "0.57169247", "text": "find(value) {\n \n }", "title": "" }, { "docid": "a792074523d3e6e58f468a795c08b46a", "score": "0.57093143", "text": "function locateItemByName(user, itemStr, skip) {\n var item; // The actual object of the item given.\n \n for (var location in user.player.worn) {\n var curItem = user.player.worn[location];\n \n // Hands special case.\n if (location == 'hands') {\n for (var hand in curItem) {\n curItem = curItem[hand];\n \n if (fullName(curItem).toLowerCase().indexOf(itemStr.toLowerCase()) >= 0) {\n // Skip if requested.\n if (skip && skip > 0) {\n skip--;\n continue;\n }\n \n item = curItem;\n break;\n }\n }\n \n if (item) {\n break;\n }\n }\n \n // Any other location.\n if (fullName(curItem).toLowerCase().indexOf(itemStr.toLowerCase()) >= 0) {\n // Skip if requested.\n if (skip && skip > 0) {\n skip--;\n continue;\n }\n \n item = curItem;\n break;\n }\n }\n \n // Not found.\n if (!item) {\n return false;\n }\n \n return item;\n}", "title": "" }, { "docid": "3245ad2ff916c2892caa51c6491ef4e9", "score": "0.5678196", "text": "getItemByID(idNumber) {\n let findItem = null;\n // Find current item\n this.data.taskItems.forEach(function(item) {\n if (item.id === idNumber) {\n findItem = item;\n }\n });\n return findItem;\n }", "title": "" }, { "docid": "451ff12a49c1551544a29931a984d3d2", "score": "0.56769115", "text": "getItemById(items, targetId, idProp) {\n var results = $.grep(items, (item) => {\n return item['objectId' || idProp] === targetId\n })\n return (results && results[0]) || null\n }", "title": "" }, { "docid": "4f806eb2e729285f098d95f5a5be3824", "score": "0.56557614", "text": "function findUIDItemInArr(item, userArray){\n for(var i = 0; i < userArray.length; i++){\n if(userArray[i].uid == item){\n console.log(\"Found item: \" + item);\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "7fa237303315739908e1321694336efc", "score": "0.56444925", "text": "function checkItem(userChoice, inventory) {\n for (var i = 0; i < inventory.length; i++) {\n if (inventory[i].item_id === userChoice) {\n return inventory[i]\n }\n }\n return null\n}", "title": "" }, { "docid": "50a1c9da0025fddf9484ffe781fe9739", "score": "0.5632595", "text": "function find_item(options, completed, failed) {\n db.items.get({qrcode: options.itemId}, function(results){\n // console.log(results);\n if (results.length === 0) {\n list_items(options, function(added_items) {\n // console.log(added_items);\n var _item = lodash.find(added_items, {qrcode: options.itemId})\n // console.log('_item');\n // console.log(_item);\n if (!_item) {\n var error = 'Error: Not found the item!';\n console.error(error);\n failed(error);\n }\n else {\n // console.log(_item);\n completed(_item);\n }\n }, failed);\n } else {\n // it should be one only\n // console.log(results[0]);\n completed(results[0]);\n }\n });\n}", "title": "" }, { "docid": "72dd83b90832c8e96b4d9ff191a6b08f", "score": "0.56081855", "text": "function isExist(item, returnType){\n let itemReturn = returnType;\n if(item !== undefined){\n itemReturn = item;\n }\n return itemReturn;\n}", "title": "" }, { "docid": "ecc8af3e94a907ba1bc0add872b6f068", "score": "0.5604149", "text": "itemOf(searchedValue, fromIndex = 0) {\r\n let current = this.getItemByIndex(fromIndex);\r\n while (current) {\r\n if (current.value === searchedValue) {\r\n return current;\r\n }\r\n current = current.behind;\r\n }\r\n return;\r\n }", "title": "" }, { "docid": "0fec5c0030a37d447ed3d285350d6232", "score": "0.5594593", "text": "function filterById(item) {\n if(isValue(item.name) && item.name === query){\n return true\n }else if(isValue(item.company) && item.company === query){\n return true\n }else{\n return false\n }\n }", "title": "" }, { "docid": "7a3de363e628291b1d9ca4fa8bea57aa", "score": "0.5561124", "text": "async function itemExists(itemId) {\n const item = await itemsService.getItem(itemId);\n if (item.rowCount == 1) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "75e623752f3736218c98faae3f0d39bd", "score": "0.5540897", "text": "function findObject (arrayOfObjects, idKey, idValue) {\n let returnObject\n arrayOfObjects.forEach(function (object) {\n if (object.hasOwnProperty(idKey)) {\n if (object[idKey] === idValue) { returnObject = object }\n }\n })\n return returnObject\n}", "title": "" }, { "docid": "3bf065c99fab3d60501be430f83e6c18", "score": "0.55277187", "text": "function searchInObject(object, searchKey, searchValue) {\n for (var i in object) {\n if (object[i][searchKey].indexOf(searchValue) > -1) {\n return object[i];\n }\n }\n }", "title": "" }, { "docid": "c8c59a8a37694cbd01c4da1477bab14d", "score": "0.55251294", "text": "function findURI(array, item) {\n var i = 0;\n while (array[i].concept != item) {\n i++;\n }\n return array[i].URI;\n }", "title": "" }, { "docid": "dc80ec464bf22b7d1108605b559b0862", "score": "0.55205184", "text": "function findInArray(item, array){\n let exists = false\n for(let i=0; i < array.length; i++){\n if (item == array[i].name){\n return array[i];\n }\n }\n return false;\n}", "title": "" }, { "docid": "2fbd0a0ef8f8965ea3fc1ed42be04a2e", "score": "0.55012584", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1] && item.type == reference[2]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "bb4d37658bd6f0c44b4726120d4f62a2", "score": "0.5484972", "text": "function resolveItemReference(reference) {\r\n for (var i = 0; i < groupedItems.length; i++) {\r\n var item = groupedItems.getAt(i);\r\n if (item.group.key === reference[0] && item.id === reference[1]) {\r\n return item;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "b02f453eb3d33c38342ad3e436122bd9", "score": "0.54827154", "text": "_findItem(item) {\n let node = this.head;\n while (node && node.value != item) {\n node = node.next;\n }\n return node;\n }", "title": "" }, { "docid": "e365bed183c9d37221ed542b46d511cc", "score": "0.54826546", "text": "function find(obj){\n return obj.deviceId == comp1.value;\n }", "title": "" }, { "docid": "cee88054677471ed906d01ac0171a756", "score": "0.54713833", "text": "function getByValue(attrName, attrValue, object) {\r\n\tfor(var i = 0 ; i < object[attrName].length; i++) {\r\n\t\tif(object[attrName][i] == attrValue) {\r\n\t\t\treturn attrValue;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}", "title": "" }, { "docid": "50a8aec98eac5ece016fe9acd47a3c44", "score": "0.5460647", "text": "function findBy(key,val){return _items.filter(function(item){return item[key]===val;});}", "title": "" }, { "docid": "50a8aec98eac5ece016fe9acd47a3c44", "score": "0.5460647", "text": "function findBy(key,val){return _items.filter(function(item){return item[key]===val;});}", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "7afceec83e367ed156aa2cf8680e58bc", "score": "0.54592663", "text": "function resolveItemReference(reference) {\n for (var i = 0; i < groupedItems.length; i++) {\n var item = groupedItems.getAt(i);\n if (item.group.key === reference[0] && item.title === reference[1]) {\n return item;\n }\n }\n }", "title": "" }, { "docid": "e1963337e39a47aeda9c7939b5dcf74c", "score": "0.5438544", "text": "containsValue(value) {\n var len = this.size();\n for (i = 0; i < len; i++) {\n var item = this.get( Object.keys(this.dict)[i] );\n if(value === item)\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "0bff8850430add1330e1302a70d6298c", "score": "0.54353285", "text": "function locateItemHeld(user, itemStr) {\n var result = []; // The returned array.\n \n for (var location in user.player.worn.hands) {\n var curItem = user.player.worn.hands[location];\n \n if (strTarget(curItem) == itemStr) {\n result[0] = location;\n result[1] = curItem;\n break;\n }\n }\n \n // Not found.\n if (result.length == 0) {\n return false;\n }\n \n return result;\n}", "title": "" }, { "docid": "1199cab07d3c1e5e514b127edcc71a2b", "score": "0.54244334", "text": "function findInArray(array, item) {\n for (var i = 0; i < array.length; i++) {\n if (array[i].$$hashKey === item.$$hashKey) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "56e91d1a4e3d6861a5107464df3933e8", "score": "0.5422982", "text": "findGameObject(key, val) {\n const res = (key === 'creep') ? Game.creeps[val] : Game.getObjectById(val);\n if (!res) {\n logger.warning(`Unable to find game object ${key}: ${val}`);\n }\n return res;\n }", "title": "" }, { "docid": "3147feb80c4ee78eec121399774e7b71", "score": "0.54218245", "text": "_findObjectInArrayOfObjects(targetValue, array, propertyName) {\n if (array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i][propertyName] == targetValue) {\n return array[i];\n }\n }\n }\n return -1;\n }", "title": "" }, { "docid": "375506845ee3ce371914c94807003740", "score": "0.5413145", "text": "function find(val, data){\n var search = function(path, searchObj){\n var found = null;\n\n for(var key in searchObj ){\n var rVal = searchObj[key];\n // object\n if(typeof rVal === 'object') {\n if(isNaN(key))\n found = search(path + '\\\\' + key, rVal);\n else {\n found = search(path + '[' + key + ']', rVal);\n }\n if(found) break; // Break out of loop if found\n }\n else if(rVal === val){\n if(isNaN(key))\n found = path + '\\\\' + key ;\n else {\n found = path + '[' + key+ ']';\n }\n }\n }\n return found;\n }\n return search('Path: ', data);\n}", "title": "" }, { "docid": "f03df4c531d6b5d4ec119ae4ec6438d0", "score": "0.5412569", "text": "exists(itemID) {\n return Promise.resolve(false);\n }", "title": "" }, { "docid": "a1b9b12ae3a13622d322c28a9a6053bb", "score": "0.5409209", "text": "findItem(callback, thisArg) {\r\n if (thisArg) {\r\n callback = callback.bind(thisArg);\r\n }\r\n for (const [item, value] of this) {\r\n if (callback(value, item, this)) {\r\n return item;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "249a8bc8f9c2701d5c6b633fbdda14fa", "score": "0.54076", "text": "existsId(obj) {\n const valueFound = obj.id || obj._id;\n if (!valueFound) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "95fd74c08f97e7c112168e8359fee659", "score": "0.54063314", "text": "function findItemByName(name) {\n var foundElem = null;\n getAllItems().forEach(function (elem, index, array) {\n if(elem.name.toUpperCase() == name.toUpperCase()) {\n foundElem = elem;\n console.log(\"ITEM ALREADY PRESENT: \" +elem.name.toUpperCase()+\" \"+name.toUpperCase());\n return foundElem;\n }\n });\n return foundElem;\n}", "title": "" }, { "docid": "bf21f598e6883b9e5b36dea38387b620", "score": "0.5405989", "text": "static findInventoryItem(character, itemId) {\n return character.inventory.find(item => item.id === itemId);\n }", "title": "" }, { "docid": "67758c8ba20af3369e2570a7915ed967", "score": "0.54059094", "text": "function find_object(list, id) {\n\n for (var i = 0; i < list.length; ++i) {\n var object = list[i];\n if (object.id === id) {\n return object;\n }\n }\n console.log('Failed to find object with id ', id);\n return undefined;\n }", "title": "" }, { "docid": "b99ed0280d731aecd314eb18425db482", "score": "0.5405826", "text": "function findCode(searching_for, result) {\n for(item in result) {\n if (result[item] == searching_for) {\n return item;\n }\n }\n return undefined; \n }", "title": "" }, { "docid": "5665cd31029c9e39c2201f5c55ad39bb", "score": "0.54053926", "text": "function getKey(obj, toFindValue) {\n for (const [key, value] of Object.entries(obj)) {\n if (value === toFindValue) return key;\n }\n }", "title": "" }, { "docid": "7ba5098d8270dd54ec40e6150f16bdcc", "score": "0.5402679", "text": "function getItemByAssetID(assetidToFind){\n if (combinedInventories === undefined || combinedInventories.length === 0) {\n return false\n }\n return $.grep(combinedInventories, function(e){ return e.assetid === assetidToFind; })[0];\n}", "title": "" }, { "docid": "576bcfde5c52d215eeb9035cb50b47eb", "score": "0.5400254", "text": "contains(index, value)\n {\n if (value && this.items.hasOwnProperty(index)) {\n return JSON.stringify(this.items[index]) === JSON.stringify(value);\n }\n\n for (let i in this.items) {\n if (JSON.stringify(index) === JSON.stringify(this.items[i])) return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "67c0b01b96c95c0afadcf27fc1e466e7", "score": "0.5398084", "text": "find(fn) {\n const values = this._objects.values();\n for (let value of values) {\n if (fn(value)) {\n return value;\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "0110943956e5cf2caf76c2ce85960558", "score": "0.5388776", "text": "function getKeyByValue(object, value) {\n for (var key in object){\n if (object[key].includes(value)) {\n\n return(key)\n }\n // return Object.keys(object).find(key => object[key].value === value);\n }\n }", "title": "" }, { "docid": "80e90ce3a9a50615721119739cd79fc2", "score": "0.53885174", "text": "function getItemById(itemId, arr) {\r\n return arr.find(item => item.id === itemId)\r\n}", "title": "" }, { "docid": "c5ddfffca4f9728b5d3b5f275b63993e", "score": "0.5382239", "text": "getItem(kat,id){\n let item = this.storage.checklist_items[kat].items.find(x => x.id == id );\n return item;\n }", "title": "" }, { "docid": "569bdefe48e32118396fd97b909828cd", "score": "0.5356682", "text": "searchForItem(thisItem, inventory){\n var itemName = thisItem.toUpperCase();\n for(var i = 0; i < inventory.length; i++){\n\n var currentInventoryItem = inventory[i];\n\n if(currentInventoryItem != null && currentInventoryItem.name === itemName){ \n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "f2ca524bed35e3d4a2452c1b46f8ae34", "score": "0.5353887", "text": "function findValueInHash(value, hash) {\n var found = false;\n for (let k in hash) {\n if (hash[k] === value) {\n found = true;\n break;\n }\n }\n return found;\n}", "title": "" }, { "docid": "e52e7cee1031330cc0ac880c5102e336", "score": "0.5352538", "text": "function isExist(List,item){\n\tvar flag = false;\n\tif(List === null)\n\t\treturn false;\n\tList.forEach(function(listItem){\n\t\tif(item.dataURI === listItem.dataURI){\n\t\t\tflag = true;\n\t\t}\n\t});\n\treturn flag;\n}", "title": "" }, { "docid": "856b1d4b8ac8498d1745bfb1c35b6ba5", "score": "0.5346424", "text": "contains(item) {\n let node = this.findNode(item);\n\n if(node === null) return false;\n\n return true;\n }", "title": "" }, { "docid": "4910804f7871adedc17d423452f0dbbf", "score": "0.53368187", "text": "function selectItem(item) {\n var found = findItem(getIdentity(item));\n if (found && found != item) {\n vm.selectedItem = found;\n // console.log('found');\n } else {\n vm.selectedItem = item;\n }\n }", "title": "" }, { "docid": "c71ae04cfd924ef08109c60b1c85e63a", "score": "0.5335306", "text": "function doesIDExist(id)\n{\n\tfor (var i = 0; i < results.length; i++)\n\t{\n\t\tif(id == results[i].item_id)\n\t\t{\n\t\t\treturn true;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e32d70841e8fe13ccaedc543d91f360d", "score": "0.53307045", "text": "function isItemMatching(item) {\n // Make the search case-insensitive.\n const searchString = queryText.toLowerCase();\n\n // Include an item in the search results if name or username includes the\n // current user input.\n return (item.name.toLowerCase().includes(searchString) || item.id.toLowerCase().includes(searchString));\n }", "title": "" }, { "docid": "a08e2d747a695ea00dae82d34bec257b", "score": "0.5329943", "text": "function fetchIID(o) {\n for(var k in json) {\n a = json[k];\n if(_.isEqual(o, a)){\n return k;\n }\n }\n }", "title": "" }, { "docid": "fde5019c80d22900b505690a5563a943", "score": "0.53272164", "text": "function checkInventory(scannedItem) {\n // Bracket notation allows for dynamically checking an object property\n //Note: dot notation wouldn't work as the input is a string and will result in undefined\n return foods[scannedItem]\n}", "title": "" }, { "docid": "44f248dd380cb420e89c5e8317b63b6e", "score": "0.5327169", "text": "function match(itemOne,itemTwo) {\r\n\tvar matched = false;\r\n\tvar itemOneKeys = Object.keys(itemOne);\r\n\tfor (var i = 0; i < itemOneKeys.length; i++) {\r\n\t\tif (itemOne[String(itemOneKeys[i])] == itemTwo[String(itemOneKeys[i])]) {\r\n\t\t\tmatched = true;\r\n\t\t}\r\n\t}\r\n\treturn matched;\r\n}", "title": "" }, { "docid": "1b4cb92665f0f339fb5e5e49fbc18fa0", "score": "0.53268534", "text": "function valueFoundInObjectList(key, value, array) {\n for (var i=0; i<array.length; i++) {\n if (array[i][key] === value) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "4eedea5d2ef31c8d3525091601018b8a", "score": "0.5325533", "text": "function user_packUuidFindUpdate (packUuidVal, userUuidVal, usedFunction, collection, newData) {\n if (packUuidVal == 'none') {\n usedFunction( { userUuid: { $eq: userUuidVal } } , collection , newData); \n }\n else {\n usedFunction( { packUuid: { $eq: packUuidVal } } , collection , newData);\n }\n}", "title": "" }, { "docid": "c02a4012c4ec5daeefe33336f0706c35", "score": "0.53250337", "text": "function hasItem(obj){\n\tif(data.player.inventory.hasOwnProperty(obj)){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "8839085b476b6af9ab997d6d7f890543", "score": "0.5321175", "text": "function itemLookup(itemInQuestion){\n let returnedPrice = 0;\n for (let i=0; i < theMarket.length; i++){\n if (theMarket[i].item === itemInQuestion) \n return returnedPrice = theMarket[i].price\n\n }\n return false;\n}", "title": "" }, { "docid": "d9f28a7d1dacf6405ca0893dc5b91d2f", "score": "0.5303062", "text": "getItem(id) {\n return _.find(this.items, {id: id});\n }", "title": "" }, { "docid": "40325f12efa92a23de5760bb2a2cd2f2", "score": "0.52979505", "text": "function getHashByName(name) {\n\t\tfor(var i in _itemDefs) {\n\t\t\tif(_itemDefs[i].name.replace('&#39;', '').toLowerCase() == name.replace('\\'', '').toLowerCase()) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\tconsole.log('error finding: ', name)\n\t}", "title": "" }, { "docid": "bbd8a4bc8f2e93a615e02fbc15832d16", "score": "0.5296732", "text": "function checkForItem(item){\n for(var i = 0; i < bidItems.length; i++){\n if(bidItems[i].name === item)\n {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "d050f0353ff2f4d8c1d4761896f9cb98", "score": "0.5287367", "text": "function findItemIndex(oid){\n var i=0;\n if(oid){ \n //inefficient method to find the item\n for(i=0;i<catalogData.items.length;i++){\n if(oid === catalogData.items[i].oid) {\n return i;\n }\n }\n }\n return -1; \n }", "title": "" }, { "docid": "dcdbc737d6121caffc5d6f2f1f682665", "score": "0.5284567", "text": "function lib_data_xml_item_exists(itemId)\r\n{\r\n var item = getDBElementById(this.db_buffer, itemId);\r\n return item != undefined;\r\n}", "title": "" }, { "docid": "8e1ab263dc79af16a91585556f991617", "score": "0.52798235", "text": "function $find(obj, iterator, context) {\n\t\tvar result;\n\t\t$any(obj, function(value, index, list) {\n\t\t\tif (iterator.call(context, value, index, list)) {\n\t\t\t\tresult = value;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\treturn result;\n\t}", "title": "" }, { "docid": "778ed49dbc9b1460e24b36cf047ded46", "score": "0.5273849", "text": "function getValueByName(mds, name) {\n var value = \"ERROR: NOT FOUND\";\n for (var item in mds) {\n // check if the key equals to the search term\n if (item === name ) {\n return mds[item];\n }\n // check if the key points to an object\n if (typeof (mds[item]) === \"object\") {\n // if value is an object call recursively the function to search this subset of the object\n value = getValueByName(mds[item], name);\n // if key was found, returns it\n if (value != \"ERROR: NOT FOUND\") { return value; }\n // if not, continue the loop\n }\n }\n return value;\n}", "title": "" }, { "docid": "a469a2f736ef9eeb513b4d2b388863c0", "score": "0.52720964", "text": "function valueIsAnItem(/* anything */ aValue){\n\t\t\t// summary:\n\t\t\t//\t\tGiven any sort of value that could be in the raw json data,\n\t\t\t//\t\treturn true if we should interpret the value as being an\n\t\t\t//\t\titem itself, rather than a literal value or a reference.\n\t\t\t// example:\n\t\t\t// \t|\tfalse == valueIsAnItem(\"Kermit\");\n\t\t\t// \t|\tfalse == valueIsAnItem(42);\n\t\t\t// \t|\tfalse == valueIsAnItem(new Date());\n\t\t\t// \t|\tfalse == valueIsAnItem({_type:'Date', _value:'May 14, 1802'});\n\t\t\t// \t|\tfalse == valueIsAnItem({_reference:'Kermit'});\n\t\t\t// \t|\ttrue == valueIsAnItem({name:'Kermit', color:'green'});\n\t\t\t// \t|\ttrue == valueIsAnItem({iggy:'pop'});\n\t\t\t// \t|\ttrue == valueIsAnItem({foo:42});\n\t\t\tvar isItem = (\n\t\t\t\t(aValue != null) &&\n\t\t\t\t(typeof aValue == \"object\") &&\n\t\t\t\t(!dojo.isArray(aValue)) &&\n\t\t\t\t(!dojo.isFunction(aValue)) &&\n\t\t\t\t(aValue.constructor == Object) &&\n\t\t\t\t(typeof aValue._reference == \"undefined\") && \n\t\t\t\t(typeof aValue._type == \"undefined\") && \n\t\t\t\t(typeof aValue._value == \"undefined\")\n\t\t\t);\n\t\t\treturn isItem;\n\t\t}", "title": "" }, { "docid": "07ad2f7ebdd0acc995e24f9daee46f13", "score": "0.52705747", "text": "function getByValue(arr, value) {\n for (var i=0; i<arr.length; i++) {\n if (arr[i].id == value) return arr[i];\n }\n return arr[0];\n }", "title": "" }, { "docid": "ead890e407985b8799c912f3940c83d9", "score": "0.5265047", "text": "_findMatch(value) {\n return find(this.filteredOptions, (entry) => entry.props.value === value);\n }", "title": "" }, { "docid": "811fba98a63523e54f2bf2d37d751878", "score": "0.5263946", "text": "function getItemEmbKey(item) {\n if (item.$ && item.$.Key) {\n return item.$.Key;\n }\n return false;\n}", "title": "" }, { "docid": "3ac95a76acd2775e4183ab3dc63a44a5", "score": "0.5258633", "text": "function findItemByFieldName(list, name, value) {\n var index = findIndexByFieldName(list, name, value);\n if (index === null) {\n return null;\n }\n else {\n return list[index];\n }\n }", "title": "" } ]
a040c2686011b3c4db0829b3e61a1022
this function is used to refresh canvas with the original veg code
[ { "docid": "a5293d73f21160df78d60b5f4133755c", "score": "0.0", "text": "function resetCanvas(colorMatrix)\n {\n for(var m=0 ; m<dataY ; m++)\n {\n for(var i=0 ; i<dataX ; i++)\n {\n canvas2DContext.fillStyle = colorScale[colorMatrix[i+dataX*m]];\n // start x, y, width, height\n canvas2DContext.fillRect(cellWidth*i,cellHeight*m,cellWidth,cellHeight);\n // draw lines to separate cell\n canvas2DContext.rect(cellWidth*i,cellHeight*m,cellWidth,cellHeight);\n }\n }\n \n canvas2DContext.stroke();\n }", "title": "" } ]
[ { "docid": "6c46050ab92bc86da3fb8ac07c1f1e8f", "score": "0.7527005", "text": "refresh() {\n em.refreshCanvas();\n }", "title": "" }, { "docid": "56b1d471f03720784b646eb71d3d075b", "score": "0.7203137", "text": "function refreshCanvas() {\n ctx.save();\n ctx.fillStyle = 'black';\n ctx.fillRect(0,0,canvas.width,canvas.height);\n ctx.restore();\n}", "title": "" }, { "docid": "d28c83ee6edddcacdbcf79e1a506c82d", "score": "0.70876366", "text": "function refreshVid() {\n basectx.drawImage(vid, cursor.width / 2, cursor.height / 2);\n } // refreshVid", "title": "" }, { "docid": "69d036b4b551294aa5daec425e426468", "score": "0.6984662", "text": "function rebuilCanvas(){\n\tdrawImage();\n}", "title": "" }, { "docid": "18b89446fb6c52b5e3b4c477bf30d2bb", "score": "0.67834055", "text": "function refreshCanvas(){\r\n //on le fait avancer tous les 98mili second si pas de pause en cour\r\n if (!isPause) {\r\n snakee.advance();\r\n }\r\n \r\n /*On vérifi si lorsqu'on avence on a une collision*/\r\n if (snakee.checkCollision()){\r\n //jeux terminer\r\n gameOver();\r\n } else {\r\n //on vérifie si serpent a mangé la pomme passé en parametre\r\n if (snakee.isEatingApple(applee)){\r\n score++;\r\n snakee.ateApple = true;// le serpent a mangé une pomme\r\n\r\n /*Quand le serpent mange la pomme, on donne une nouvelle position a la pome\r\n et on vérie si cette position est sur le sepent:\r\n si c'est le cas on donne une nouvelle*/\r\n do {\r\n applee.setNewPosition(); \r\n } while(applee.isOnSnake(snakee));\r\n }\r\n\r\n /*\r\n Je dessigne a chaque fois un nouveau rectangle a une position donnée\r\n a chaque fois je met le rectangle a une nouvelle position\r\n */ \r\n ctx.clearRect(0,0,canvasWidth,canvasHeight);\r\n\r\n //dessin de la zone du score\r\n drawScore();\r\n\r\n //on dessine le serpent\r\n snakee.draw();\r\n\r\n //on dessine la pomme a croqué car A chaque fois que le canvas est rafraichir, on doit dessigner la pomme*/\r\n applee.draw();\r\n\r\n timeOut = setTimeout(refreshCanvas,delay);\r\n }\r\n }", "title": "" }, { "docid": "5236dd363091f45dcabf1d4187f206dd", "score": "0.66560334", "text": "function img_update() {\n if(!root.is('no_steps')) {\n new_canvas();\n }\n contextoList[quizJS.getCanvasIndex(root)].drawImage(canvas, 0, 0);\n context.clearRect(0, 0, canvas.width, canvas.height);\n }", "title": "" }, { "docid": "1fdc64fbe9ae2ac69900c9f573245998", "score": "0.663782", "text": "function img_update () {\n\t\t\tcontext.drawImage(tempCanvas, 0, 0);\n\t\t\tcontextTemp.clearRect(0, 0, tempCanvas.width, tempCanvas.height);\n\t\t\twindow.location = \"http://updateCanvas/update\";\t\t\t\t\n\t\t}", "title": "" }, { "docid": "e3e8e8ccec2a38671cee989f89cb2edf", "score": "0.66372037", "text": "function updateCanvas() {\r\n w = canvas.width = canvas.clientWidth;\r\n h = canvas.height = canvas.clientHeight;\r\n\r\n ctx.fillStyle = \"rgb(0,0,0)\";\r\n ctx.fillRect(0, 0, w, h);\r\n\r\n changeFadeSpeed();\r\n }", "title": "" }, { "docid": "06478a3b6c2f6fcb5e0260031de37c55", "score": "0.66338617", "text": "updateCanvas() {\n let canvas = this.refs.canvas;\n let ctx = canvas.getContext('2d');\n\n // Clear it\n ctx.fillStyle = 'gray';\n ctx.fillRect(0, 0, canvasWidth, canvasHeight);\n\n //this.experimentalDraw(canvas, ctx);\n\n // !!! IMPLEMENT ME\n // compute connected components\n // draw edges\n // draw verts\n // draw vert values (labels)\n this.drawEdges(ctx);\n this.drawVertexes(ctx);\n }", "title": "" }, { "docid": "0b419a5367922f019b9cba64c578aa7a", "score": "0.66184956", "text": "function resetCanvas() {\t\n\tcurrentGeneration = 0;\n\tpopulateRockets();\n}", "title": "" }, { "docid": "49ef7d206e4f8b5864771539233ad21a", "score": "0.659558", "text": "function redrawcnvWorker() {\n //BASICALLY CODE TO REDRAW//\n ctxWorker.clearRect(0, 0, cnvWorker.width, cnvWorker.height);\n\n // MOVE AND REDRAW\n if (appMode !== \"pro\") {\n metal_hulk.drawAll();\n human_male.drawAll();\n } else {\n metal_hulk.draw();\n human_male.draw();\n };\n drawFpsNumber();\n counter++;\n requestAnimationFrame(redrawcnvWorker);\n}", "title": "" }, { "docid": "d53eff869e3f4824459a69f1fb2eae7f", "score": "0.6585507", "text": "function FillCanvasoldversion()\n{\n\tclearCanvas();\n\tvar tmp = 0;\n\twhile (tmp != canvasHeight) {\n\t\tfor(var i = 0; i != canvasWidth; i++) {\n\t\t clickX.push(i);\n\t \t clickY.push(tmp);\n\t \t clickDrag.push(true);\n\t \t clickColor.push(curColor);\n\t \t clickSize.push(5);\n\t \t clickTool.push(1);\n\t\t}\n\ttmp++;\n\t}\nredraw();\n}", "title": "" }, { "docid": "e79dc1e7c752ebcc78e519f3da285d90", "score": "0.65458065", "text": "update() {\n \n CTX.drawImage(this.content, this.x, this.y);\n\n }", "title": "" }, { "docid": "c5f8e317ff53d8445c22f78d0f5b89a5", "score": "0.6509783", "text": "function refreshCanvas() {\n\n if(curTool != 'select') {\n selectedId = -1;\n }\n\n var ctx = canvas.getContext('2d');\n ctx.save();\n\n if(screen.width > (743 + 90)) {\n document.getElementById('right').style.display = 'block';\n }\n\n var w = 743;\n var h = 608;\n canvas.width = w;\n canvas.height = h;\n\n if(orienting()) {\n orientation = window.orientation;\n ctx.fillStyle=\"#FFFFFF\";\n\n/* var r = h/w;\n var b = 1;\n if(screen.width < screen.height*r) {\n w = screen.width;\n h = w*r;\n } else {\n h = screen.height;\n w = h/r;\n b = 2;\n }\n*/\n canvas.width = w;\n canvas.height = h;\n\n orientation = window.orientation;\n ctx.rotate(-orientation*Math.PI/180);\n ctx.fillStyle=\"#FFFFFF\";\n\n switch(orientation) {\n case 0:\n ctx.fillStyle=\"#FFFFFF\";\n tx=0; ty=0; \n break;\n case -90:\n tx=0; ty=-h;\n ctx.translate(0,-h);\n break;\n case 90:\n tx=-w; ty=0;\n ctx.translate(-w,0);\n break;\n case 180:\n ctx.fillStyle=\"#FFFFFF\";\n tx=-w; ty=-h;\n ctx.translate(-w,-h);\n break;\n }\n ctx.fillRect(0,0,w,h);\n } else {\n ctx.fillStyle=\"#FFFFFF\";\n ctx.canvas.width = 743;\n ctx.canvas.height = 608;\n }\n\t\n //Redraw every object at the current zoom\n\n ctx.scale(zoom, zoom);\n ctx.translate(originx, originy);\n\n if(background) {\n background.draw(ctx);\n }\n\tif(!cachedraw){\n\t\tctx.save();\n\t\tctx.fillStyle = \"#FFFFFF\";\n\t\tctx.globalAlpha = 1;\n ctx.fillRect(0,0,canvas.width,canvas.height);\n\t\tctx.globalCompositeOperation = \"darker\";\n\t\tvar dObj = objectList[layerList[layerList.length-1]];\n\t\tscratch && ctx.putImageData(scratch,0,0);\n\t\tdObj && dObj.draw(ctx);\n\t\tscratch = ctx.getImageData(0,0,canvas.width,canvas.height);\n\t\tctx.restore();\n\t}\n // For each id in layerList, call this function:\n else{\n\t\t$.each(layerList, function(i, id) {\n\t\t\t// Get the object for this layer\n\t\t\tvar dObj = objectList[id];\n\t\t\tif((!isDragging) || (id != selectedId)) {\n\t\t\t\t// Draw the object\n\t\t\t\tdObj.draw(ctx);\n\t\t\t}\n\t\t});\n\t}\n\n // Draw the selected layer on top of the rest\n if(selectedId != -1) {\n if(isDragging) {\n objectList[selectedId].draw(ctx);\n }\n objectList[selectedId].drawIcons(ctx);\n }\n ctx.restore();\n}", "title": "" }, { "docid": "65eeac005f422c9ecddf79d9ea0b9a39", "score": "0.6503129", "text": "function redraw(){\n if (checkGen()) {\n (timer) += 1;\n }\n for (let i = 0; i < tablero.length; i++) {\n tablero[i].zeigen();\n }\n if (current) {\n current.highlight();\n }\n else if (before){\n before.highlight();\n }\n ctx.drawImage(door,xesq,yesq,w,w);\n}", "title": "" }, { "docid": "22d55e346c6cd0bbb6b3dbdd85cccf9f", "score": "0.6429993", "text": "function redraw() {\n\n // Draw next frame\n\n // Fill in background\n if (appState.bgEnabled) {\n appState.context.strokeStyle = appState.bg;\n appState.context.fillStyle = appState.bg;\n appState.context.lineWidth = '10';\n appState.context.fillRect(0, 0, appState.windowWidth, appState.windowHeight);\n }\n\n // Rotate for the car\n // Translate for the car display\n appState.context.translate(appState.carX, appState.carY);\n appState.context.rotate(appState.carDirection + 1.5708);\n // Draw the car\n appState.context.drawImage(\n appState.carImage,\n -1 * appState.carSize / 2,\n -1 * appState.carSize / 2,\n appState.carSize,\n appState.carSize);\n // Reset rotation\n appState.context.setTransform(1, 0, 0, 1, 0, 0);\n\n /*\n // Draw the walls\n var count = appState.walls.length;\n for (var i = 0; i < count; i++) {\n appState.context.drawRect(\n appState.walls[i].x,\n appState.walls[i].y,\n appState.walls[i].width,\n appState.walls[i].height);\n }\n */\n\n // Draw the help overlay\n if (appState.helpDisplayed) {\n displayHelp();\n }\n\n // Update state\n updateLocations();\n}", "title": "" }, { "docid": "ed3f5b75c0589fa772b082b96e577728", "score": "0.6385207", "text": "reload() {\n if (this.maxIndex > 0) {\n this.View.clearCanvas();\n this.doLoad(LOAD_RELOAD);\n }\n }", "title": "" }, { "docid": "73012b85ab7b556ff50843f27609fd06", "score": "0.638216", "text": "function updateCanvas() {\n ctx.putImageData(canvasData, 0, 0);\n }", "title": "" }, { "docid": "c948c7546f9e8d8b9663d4b230407336", "score": "0.6377669", "text": "function updateImage(){\n canvas.setRealTimeImage();\n}", "title": "" }, { "docid": "9ea8a005c42a669eeda8da2a4c3a58d4", "score": "0.63772255", "text": "function reSet(){\n checkImageLoaded(_currentImg);\n drawToCanvas(_canvas, _originalImg);\n}", "title": "" }, { "docid": "32f6c605cde194d015aba6ec8de60922", "score": "0.6376039", "text": "function refreshGame() {\n context.clearRect(0, 0, width, height);\n drawGameBoard();\n drawPlayerMoves();\n}", "title": "" }, { "docid": "33bf00696268b9cb37ed6c2dbfb9d67e", "score": "0.6318031", "text": "function img_update() {\n contexto.drawImage(canvas, 0, 0);\n context.clearRect(0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "7b4ce5fc09c3fabb2afcacfe3cf4e72b", "score": "0.6308524", "text": "function contDraw(){\n\n clear_game_canvas();\n disp_curr_game_state(); \n\n clear_data_canvas();\n disp_curr_data_state();\n\n draw_to_chart();\n\n update_all();\n}", "title": "" }, { "docid": "7e7f1724a3dabb20e984c8d4999ac049", "score": "0.63008434", "text": "function canvas_redraw() {\n determine_view();\n canvas_clear();\n if (game_data && game_data.status === \"IN-PROGRESS\" && game_data.map && loaded_all_resources) {\n draw_map();\n draw_objects();\n draw_players();\n draw_explosions();\n draw_pointers();\n draw_game_events();\n draw_time_left();\n }\n}", "title": "" }, { "docid": "6fa77631672379b8d019a9ab1c044288", "score": "0.6294531", "text": "function updateCanvas() {\r\n ctx.putImageData(canvasData, 0, 0);\r\n}", "title": "" }, { "docid": "3aa6487edba582d7198bd66a0591f1f2", "score": "0.6276933", "text": "canvas_display(){\r\n delete this.plate;\r\n let val = document.getElementById(\"all_views\").value; //classic, cmyk\r\n this.plate = new this.dic[val](this.canvas, this.ctx);\r\n this.plate.colordecode(this.color);\r\n this.display();\r\n }", "title": "" }, { "docid": "bf4a7261a20086078b2613d97773df40", "score": "0.6269764", "text": "function updateGraphics() {\n\t\t// $log.log(preDebugMsg + \"updateGraphics()\");\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 draw on!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(ctx === null) {\n\t\t\tctx = myCanvas.getContext(\"2d\");\n\t\t}\n\n\t\tvar W = myCanvas.width;\n\t\tif(typeof W === 'string') {\n\t\t\tW = parseFloat(W);\n\t\t}\n\t\tif(W < 1) {\n\t\t\tW = 1;\n\t\t}\n\n\t\tvar H = myCanvas.height;\n\t\tif(typeof H === 'string') {\n\t\t\tH = parseFloat(H);\n\t\t}\n\t\tif(H < 1) {\n\t\t\tH = 1;\n\t\t}\n\n\t\t// $log.log(preDebugMsg + \"Clear the canvas\");\n\t\tctx.clearRect(0,0, W,H);\n\n\t\tdrawBackground(W, H);\n\t\tdrawLifeTable(W, H);\n\t\tdrawAxes(W, H);\n\t\tupdateDropZones(textColor, 0.3, false);\n\t}", "title": "" }, { "docid": "e95f0acd474fbb835db7b80e1fbe4b41", "score": "0.62654257", "text": "function img_update() {\n contexto.drawImage(canvas, 0, 0);\n context.clearRect(0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "bd1219ecf9de66dac934553c97123d8b", "score": "0.6255065", "text": "function reDrawClockCanvas() // private method\n\t{\n\t\tvar canvases = document.querySelectorAll( \"canvas.\" + className ); // get clock canvases\n\t\t\n\t\tfor ( var i = 0; i < canvases.length; i++ ) // update canvases\n\t\t\tpaintClockCanvas( canvases[i] );\n\t}", "title": "" }, { "docid": "ced903b5e40e94a3770c4e1febe7b2ba", "score": "0.62499964", "text": "function resetCanvas() {\n setButtons(graphChoice, currentData);\n logHours();\n logUnits();\n setDropWidth();\n setCanvasSize(canvas);\n drawGraph();\n}", "title": "" }, { "docid": "a45ffeb60aea742560c772c723f93f7d", "score": "0.62446547", "text": "function updateFrame(){\r\n\r\n\tcurrentFrame-=(-1);\r\n\tcurrentFrame = currentFrame % cols;\r\n\tif(switch1==1||switch1==2||switch1==3)\r\n\t{\r\n\t\tcurrentFrame = xx % cols;\r\n\t}\r\n\tsrcX= currentFrame * width;\r\n\t\r\n\t\r\n\tsrcY= height;\r\nc.clearRect(0, 0, canvas.width, canvas.height);\r\n}", "title": "" }, { "docid": "6c794c12701b92a81d15ed898222e529", "score": "0.62199014", "text": "refresh() {\n this.i.sk();\n }", "title": "" }, { "docid": "0d2f58f3a5c15d9e4f2ee6658f2d8541", "score": "0.6207435", "text": "function repaintCanvas(){\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\tfor (var i = 1; i < 53; i++) {\n\t\t\tcardBackCopy = cardBack;\n\t\t\tvar c = cards[i];\n\t\t\tif (!c.selected)\n\t\t\t\tctx.drawImage(c.source, c.offSetX, c.offSetY, c.width, c.height);\n\t\t\telse\n\t\t\t\tctx.drawImage(cardBackCopy, c.offSetX, c.offSetY, c.width, c.height);\n\t\t}\n\t}", "title": "" }, { "docid": "36b4222f97f6d8539c0ea6c6dac62e97", "score": "0.6200021", "text": "function redraw(){\n that.context.clearRect(0, 0, that.context.canvas.width, that.context.canvas.height); // Clears the canvas\n \n that.context.strokeStyle = \"white\";\n that.context.lineJoin = \"round\";\n that.context.lineWidth = 20;\n \n for(var i=0; i < that.clickX.length; i++) {\t\t\n that.context.beginPath();\n if(that.clickDrag[i] && i){\n that.context.moveTo(that.clickX[i-1], that.clickY[i-1]);\n }else{\n that.context.moveTo(that.clickX[i]-1, that.clickY[i]);\n }\n that.context.lineTo(that.clickX[i], that.clickY[i]);\n that.context.closePath();\n that.context.stroke();\n }\n\n //Shows the prediction as the image is being drawn\n showPrediction(that.model)\n\n //Shows activation maps as the image is being drawn\n showActivation(that.modelAct)\n\n }", "title": "" }, { "docid": "d264ecf674867ff7900aae8b7d0b604d", "score": "0.61910814", "text": "update() {\n\t\tthis.draw();\n\t}", "title": "" }, { "docid": "a0a92e273d1aa33fa59b53ecec0aa3e8", "score": "0.6182653", "text": "updateCanvas(payload){\n let changes = payload.update,\n update = new CanvasUpdate(changes.type, changes.objectID, changes.canvasObject);\n update.executeChange(this.canvas);\n }", "title": "" }, { "docid": "108d2ff9af022dd3fb0c01d9a0ead290", "score": "0.618258", "text": "restart() {\n this.colPos = 2;\n this.rowPos = 0;\n this.x = colWidth*this.colPos;\n this.y = canvasHeight - rowWidth*(11/4) - 83*this.rowPos;\n }", "title": "" }, { "docid": "6125be7de202055c824239f27c4aea7a", "score": "0.61721075", "text": "update() {\n this.draw();\n }", "title": "" }, { "docid": "10823f4f1449b714f9375d38f7d1ad32", "score": "0.6152207", "text": "function reOrderCanvas() {\n clearCanvas();\n renderImg(gMeme.selectedImgId);\n let currLineIdx = gMeme.selectedLineIdx\n let lines = gMeme.lines;\n lines.forEach((line, idx) => {\n gMeme.selectedLineIdx = idx;\n drawText(line.txt, line.xline, line.yline)\n });\n gMeme.selectedLineIdx = currLineIdx;\n let currLine = gMeme.lines[gMeme.selectedLineIdx];\n let x = currLine.xline;\n let y = currLine.yline;\n drawRect(x, y);\n}", "title": "" }, { "docid": "28f9f6f598ada9a18372c41416445571", "score": "0.61501867", "text": "function img_update() {\n\tcontexto.drawImage(canvas, 0, 0);\n\tclear(context);\n}", "title": "" }, { "docid": "f6de6fcf488ae6b539d5c5a12e841eb6", "score": "0.61427224", "text": "function memoryBlockRefresh() {\n var memoryCanvas = document.getElementById(\"memoryCanvas\");\n var ctx = memoryCanvas.getContext(\"2d\");\n ctx.clearRect(0,0,memoryCanvas.width,memoryCanvas.height);\n memoryEmpty();\n memoryFill();\n}", "title": "" }, { "docid": "3f1a0d24c4b0c930364566db2e8d77b7", "score": "0.61392236", "text": "repaint() {\n ctx.putImageData(imageData, 0, 0);\n }", "title": "" }, { "docid": "5694359a337f94b9bed766d5650fab37", "score": "0.6138277", "text": "function update_shape()\n{\n canvas_clear();\n current_shape();\n}", "title": "" }, { "docid": "5d40fb58ae5c74cd2dab895526ffb67d", "score": "0.6132152", "text": "function updateFrame() {\n // Clear the Canvas\n gameArea.clear();\n // Redraw the SpaceCraft\n spacecraft.update();\n // Redraw all SpaceInvaders\n for (i in spaceInvaders){\n spaceInvaders[i].update();\n }\n // Draw Explosion (If Needed)\n explosion.update();\n // Draw LaserBeam (If Needed)\n laserBeam.update();\n}", "title": "" }, { "docid": "e1aa056d691bbcd7457d17708164508e", "score": "0.6129162", "text": "onRedrawCanvas() {\n if (!this.file) return false;\n this.file.doAction(Redraw, this.canvas, this.loopCount);\n }", "title": "" }, { "docid": "5dba50906d8704d1ffed9adbba4ff157", "score": "0.61265916", "text": "function Update(){\n \t for (var i = 0; i < 6; i++) {\n \t\t btn[i].value = 'Commencer';\n \t\t paint[i]= false;\n \t\t}\n \t btn[canvasActuel+1].value = 'Tracer';\n \tcontexts[canvasActuel].beginPath();// On démarre un nouveau tracé\n contexts[canvasActuel].strokeStyle = \"#000\";\n contexts[canvasActuel].lineJoin = \"miter\";\n contexts[canvasActuel].lineWidth = 1;\n \tcontexts[canvasActuel].clearRect(0, 0, height, width);\n\t \tcontexts[canvasActuel].moveTo(0, 50-intervalle[canvasActuel]/2);\n\t \tcontexts[canvasActuel].lineTo(1000,50-intervalle[canvasActuel]/2);\n\t \tcontexts[canvasActuel].moveTo(0, 50+intervalle[canvasActuel]/2);\n\t \tcontexts[canvasActuel].lineTo(1000,50+intervalle[canvasActuel]/2);\n \tcontexts[canvasActuel].moveTo(50, 50-intervalle[canvasActuel]/2);\n \tcontexts[canvasActuel].lineTo(50,50+intervalle[canvasActuel]/2);\n \tcontexts[canvasActuel].moveTo(980, 50-intervalle[canvasActuel]/2);\n \tcontexts[canvasActuel].lineTo(980,50+intervalle[canvasActuel]/2);\n\t \tcontexts[canvasActuel].stroke();// On trace seulement les lignes.\n\t contexts[canvasActuel].closePath();\n\t paint[canvasActuel]=true;\n\t clickX = [];\n\t clickY = [];\n\t sortie = false;\n }", "title": "" }, { "docid": "31c5e40de2ab7abcdddbd8d69e4109cf", "score": "0.6124134", "text": "function refresh(){\r\n var i=0;\r\n \r\n c.clearRect(0,0,canvas.width,canvas.height);\r\n c.fillStyle='#FEE715FF';\r\n for(var x=0;x<arrSize;x++){\r\n c.fillRect((rectWidth+rectSpacing)*x,canvas.height,rectWidth,-arr[i]);\r\n i++;\r\n }\r\n}", "title": "" }, { "docid": "7e8d53794dfc4c540e341997437245c6", "score": "0.61215836", "text": "function redraw() {\n\tvar html = window.renderProgram(program);\n\t$(\"#editor\").html(html);\n}", "title": "" }, { "docid": "ed9070898e776f2bd8b82e7826fdb50c", "score": "0.6115018", "text": "function colorGraph() {\n clearCanvas();\n updateShownGraph();\n }", "title": "" }, { "docid": "5de9498874e0cf295779ebb6a7cca2a0", "score": "0.61142033", "text": "function update()\n {\n frames++;\n //console.log(frames);\n ctx.clearRect(0,0,canvas.width,canvas.height);\n defini_dif();\n fondito.draw();\n avioncito.draw();\n // niv_conta++;\n //semillita.draw();\n drawSemi();\n suelecito.draw();\n drawArbol();\n textito.draw();\n //console.log(tiempo);\n textito_tiempo.draw();\n checarTiempo();\n //console.log(niv_conta)\n //nubesita1.draw();\n //nubesita2.draw();\n defini_dif();\n //console.log(niv_conta)\n \n \n dibujarNube();\n //console.log(numRanAlto);\n //console.log(\"la dif es \"+dificultad_jug1);\n // checarColision();\n //console.log(tipoarbol)\n colision();\n\n }", "title": "" }, { "docid": "f61ad63e5675d54cbdb27e2d77eba261", "score": "0.61121225", "text": "requestRedraw() {\n this.source += 'runtime.requestRedraw();\\n';\n }", "title": "" }, { "docid": "5dfcf64e8f179920132d3fd3ad501f0e", "score": "0.6099339", "text": "function update() {\n //Update and redraw all the parts of the canvas.\n ctx.clearRect(0, 0, c.width, c.height);\n ctxe.clearRect(0, 0, ce.width, ce.height);\n\n radians = degToRad(theta)\n radians_90 = degToRad(90 - theta) \n draw_crystal()\n draw_xray_source()\n drawIncidentRays()\n drawRefractedRays()\n draw_xray_passthrough()\n draw_detector()\n draw_s()\n check_bragg(d)\n draw_circle()\n draw_labels()\n draw_horizontal_lines()\n draw_angled_lines()\n draw_d_line()\n\n if (isBraggSatisfied == true) {\n draw_correct_diffraction_spot()\n }\n }", "title": "" }, { "docid": "55bd6a8f82db1aec146922906dd3a850", "score": "0.6093343", "text": "updateCanvas() {\n // Reset color utils\n this.colorUtils = ColorUtils()\n .height(this.props.colorSettings.height)\n .width(this.props.colorSettings.width)\n .fillColor(this.props.colorSettings.fillColor)\n .threshold(this.props.colorSettings.threshold)\n .blackWhite(this.props.colorSettings.blackWhite)\n .invert(this.props.colorSettings.invert);\n\n if (this.props.srcCanvas === null) return;\n this.colorUtils.setSrcCanvas(this.props.srcCanvas);\n\n let ctx = this.refs.canvas.getContext('2d');\n ctx.clearRect(0, 0, this.props.width, this.props.height);\n ctx.fillStyle = this.props.colorSettings.backgroundColor;\n ctx.fillRect(0, 0, this.props.width, this.props.height)\n\n // draw polygons\n if (this.props.shape !== \"circles\") {\n this.drawPolygons(ctx);\n } else {\n this.drawCircles(ctx);\n }\n\n // Blend image\n this.blendOriginalImage(ctx);\n\n // Do whatever `props` says should happen on update\n this.props.onUpdate();\n }", "title": "" }, { "docid": "df64cfbd68a294f64d7c0b6fad9282e9", "score": "0.609226", "text": "function dFrame(){\r\n\tctx.clearRect(0,0,1000,400);\r\n\tp.draw();\r\n\tsensor.draw();\r\n\tBoxes.forEach(function(b){b.draw();});\r\n}", "title": "" }, { "docid": "24a4fb2d705e5d88d756101b2e46aab6", "score": "0.60921675", "text": "function redrawAll() {\n\n resizeCanvas();\n\n if (manager.hasProject()) {\n if(!manager.deleting){\n hackyStateChanger();\n\n\n ctx.fillStyle = \"grey\";\n if(checkSave() || buttonSave){\n ctx.fillStyle = \"white\";\n buttonSave = false;\n }\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n drawNodes();\n\n if (manager.mode === CREATE_MODE) {\n ctx.fillStyle = NEW_NODE_STYLE;\n if(canvasData.mouseX < NODE_RADIUS ||\n canvasData.mouseX > canvas.width - NODE_RADIUS ||\n canvasData.mouseY < NODE_RADIUS ||\n canvasData.mouseY > canvas.height - NODE_RADIUS){\n ctx.fillStyle = \"pink\";\n }\n drawCircle(canvasData.mouseX, canvasData.mouseY, NODE_RADIUS);\n }\n else if (manager.mode === DELETE_MODE) {\n\n }\n }\n }\n\n lastCanvasData = canvasData.clone();\n\n}", "title": "" }, { "docid": "3a5b61ee8c4a901abdc3b567bad3a488", "score": "0.6091098", "text": "function onFrame(e) {\n if (state.contentEditing) {\n cursor.blink(0.02);\n }\n else {\n cursor.opacity = 0;\n }\n\n if (!state.canvasFocused) {\n cursor.opacity = 0;\n }\n\n if (raster && raster.opacity < 1) {\n raster.opacity += 0.1;\n }\n\n var dest = document.getElementById('meme-gen__canvas-dummy');\n var ctx = dest.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(canvas, 0, 0, dest.width, dest.height);\n}", "title": "" }, { "docid": "4bc5e2e5e671a329992410b6fab28fa7", "score": "0.6090998", "text": "function redrawCanvas(pen, game, id) {\n\tpen.clearRect(0, 0, 640, 640);//clear canvas\n\tdrawBG(pen);\n\tfor(var key in game.players) {\n\t\tdrawSnake(pen, game.players[key]);\n\t}\n\tdrawFood(game.foods, pen);\n\tlet scoreboard_canvas = $(\"scoreboard\");\n\tlet scoreboard_pen = scoreboard_canvas.getContext(\"2d\");\n\tscoreboard_pen.clearRect(0, 0, 200, 400);//clear scoreboard\n\tdrawScores(game);\n\tdrawBoostMeter(game, id);\n}", "title": "" }, { "docid": "3670d03bd7c9d59e80a565a6c1a5844a", "score": "0.60893905", "text": "function refreshScreen()\n{\n clearPiecesFromBoard();\n printPiecesToBoard();\n updateGameDataGraphic();\n}", "title": "" }, { "docid": "007782b4f66296122be72db7331060aa", "score": "0.6081728", "text": "function initCanvas() {\n endabgabe2.canvas = document.getElementsByTagName(\"canvas\")[0];\n endabgabe2.crc = endabgabe2.canvas.getContext(\"2d\");\n console.log(endabgabe2.canvasColor, endabgabe2.canvasSizeX, endabgabe2.canvasSizeY);\n endabgabe2.canvas.width = endabgabe2.canvasSizeX;\n endabgabe2.canvas.height = endabgabe2.canvasSizeY;\n endabgabe2.canvas.style.backgroundColor = endabgabe2.canvasColor;\n // alle EventListener für die Buttons\n document.getElementById(\"circleButt\").addEventListener(\"click\", initPlaceCircle);\n document.getElementById(\"squareButt\").addEventListener(\"click\", initPlaceSquare);\n document.getElementById(\"triangleButt\").addEventListener(\"click\", initPlaceTriangel);\n document.getElementById(\"deleteObjectButt\").addEventListener(\"click\", initDeleteObject); //das muss noch gemacht werden \n document.getElementById(\"goBackToOverview\").addEventListener(\"click\", goBackToOverview);\n document.getElementById(\"deletePicture\").addEventListener(\"click\", deleteCanvas);\n document.getElementById(\"startAnim\").addEventListener(\"click\", startStopAnimation);\n document.getElementById(\"stopAnim\").addEventListener(\"click\", startStopAnimation);\n document.getElementById(\"animStyle\").addEventListener(\"change\", globalAnimationStyle);\n document.getElementById(\"savePicture\").addEventListener(\"click\", safePicture);\n document.getElementById(\"moverButt\").addEventListener(\"click\", initMover);\n document.getElementById(\"sprayerButt\").addEventListener(\"click\", initSprayer);\n document.getElementById(\"resizerButt\").addEventListener(\"click\", initResizer);\n //crc.fillStyle = canvasColor;\n //crc.fillRect(0, 0, canvas.width, canvas.height);\n //imgData = crc.getImageData(0, 0, canvas.width, canvas.height);\n imgData = endabgabe2.crc.getImageData(0, 0, endabgabe2.canvas.width, endabgabe2.canvas.height);\n renderCanvas();\n }", "title": "" }, { "docid": "9d5869bf09ca81e8984ac09ad96cd1e8", "score": "0.6080102", "text": "function update(){\n //console.log(frames);\n //borramos primero\n ctx.clearRect(0,0,canvas.width,canvas.height);\n //dibujamos con orden de tamaños\n Road();\n drawLines();\n car.draw();\n}", "title": "" }, { "docid": "5eafe8e56dc464816631948145790c24", "score": "0.6058275", "text": "function reload() {\n var section = plantilla.value;\n var col = color.value;\n\n switch (section) {\n case \"0\":\n canvas.setBackgroundImage('./public/img/Plantilla3.png', canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height\n });\n set_front_bar(tetnews_bar, \"#FFFFFF\");\n break;\n case \"1\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(curi_bar, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(curi_bar, col);\n break;\n case \"2\":\n canvas.clear();\n canvas.setBackgroundImage('./public/img/Plantillas/tet1/TBtet.png', canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n });\n break;\n case \"3\":\n canvas.clear();\n canvas.setBackgroundImage('./public/img/Plantillas/tet1/TBtet2.png', canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n });\n break;\n case \"4\":\n canvas.clear();\n canvas.setBackgroundImage('./public/img/Plantillas/tet1/creadores.png', canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n });\n break;\n case \"5\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(rese, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(rese, col);\n break;\n case \"6\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(MB, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(MB, col);\n break;\n case \"7\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(TT, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(TT, col);\n break;\n case \"8\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(TF, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(TF, col);\n break;\n case \"9\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(Art, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(Art, col);\n break;\n case \"10\":\n canvas.backgroundColor = col;\n canvas.setBackgroundImage(Blan, canvas.renderAll.bind(canvas), {\n width: canvas.width,\n height: canvas.height,\n opacity: 0\n });\n set_front_bar(Blan, col);\n break;\n\n };\n}", "title": "" }, { "docid": "a9644460309aa1824b215883a7499361", "score": "0.6052871", "text": "function update() {\n // get gamemode\n gm = getGameMode();\n if (gm == undefined) {\n alert('Select divide direction');\n document.getElementById('sym').disabled = false;\n document.getElementById('asym').disabled = false;\n return;\n }\n\n document.getElementById('sym').disabled = true;\n document.getElementById('asym').disabled = true;\n\n draw_matrix(composition_matrix)\n // draw static canvas\n if (update_count < 25) {\n draw_dynamic_canvas();\n }\n let element = select();\n let x = element[0];\n let y = element[1];\n // add to offspring\n update_offspring(composition_matrix[x][y])\n // flash cell that will devide\n flash(x, y);\n // symmetric\n if (gm == 2) {\n divide_symmetric(x, y);\n } else {\n divide_asymmetric(x, y);\n }\n update_count += 1;\n plot_offspring();\n if(crypt_is_singular()) {\n\n }\n\n}", "title": "" }, { "docid": "042d7d7555d56efdef5c745953721e9f", "score": "0.6052138", "text": "_refresh(){\n this._refreshSize();\n this._refreshPosition();\n }", "title": "" }, { "docid": "feed15ff8e63be21e6eb6e3993800586", "score": "0.60476065", "text": "_onCanvasReplacement([e]) {\n\t\t\tconst { removedNodes, addedNodes } = e;\n\t\t\tfor (let i = 0; i < removedNodes.length; i++) {\n\t\t\t\tthis._replaceTexture(removedNodes[i], addedNodes[i]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "51bfd53e747a574f0e2327b88424cefa", "score": "0.6046736", "text": "function reiniciar() {\n\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\tctx.restore();\n\t\t\timg_original = null;\n\t\t}", "title": "" }, { "docid": "a8c85ef0c6f15fc0f9c6feda4c305ecc", "score": "0.6042606", "text": "function update() {\n clearContext();\n requestAnimFrame(update);\n drawFireworks();\n }", "title": "" }, { "docid": "813328ff4ff15ec41b4dcacb16b2fe66", "score": "0.6033831", "text": "function upDateCanvas() {\n if (characterComponent.x > gameCanvas.canvas.width) {\n if (!snatchRendered) {\n currentScene.used = true;\n snatchRendered = true;\n return renderSnatch();\n } \n } else {\n gameCanvas.clear();\n background.newPos();\n background.update();\n\n characterComponent.speedX = 0;\n if (arrowKeyPressed) {\n if (gameCanvas.key && gameCanvas.key == 37) {characterComponent.speedX = -5}\n if (gameCanvas.key && gameCanvas.key == 39) { characterComponent.speedX = 5; }\n if (gameCanvas.key && gameCanvas.key == 38) { characterComponent.speedY = -25; }\n if (characterComponent.speedX > 0) {\n sign.speedX = -2;\n background.speedX = -4;\n } else if (characterComponent.speedX < 0) {\n sign.speedX = 2;\n background.speedX = 4;\n }\n } else {\n sign.speedX = 0;\n background.speedX = 0;\n characterComponent.speedY = 0\n }\n if (currentSceneId == 0 || currentSceneId == 1) {\n sign.newPos();\n sign.update();\n }\n \n characterComponent.newPos();\n characterComponent.update();\n }\n}", "title": "" }, { "docid": "ca0551a07b84425b2efae7d10149cfde", "score": "0.60236764", "text": "function resetCanvas() {\n\tcxt.fillStyle = localStorage.fillColor;\n\tcxt.fillRect(0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "3b9dc7a5e1671ede046ea5fddf896ab5", "score": "0.60219616", "text": "function redrawPreviewSlide() {\r\n // Clear the canvas to avoid drawing over previous drawing\r\n currPreviewContext.clearRect(0, 0, currPreviewCanvas.width, currPreviewCanvas.height);\r\n\r\n for (var member in currFormation.members) {\r\n // Check that the property is not from a prototype\r\n if (currFormation.members.hasOwnProperty(member)) {\r\n // Set up drawing paths\r\n currPreviewContext.beginPath();\r\n currPreviewContext.arc((currFormation.members[member].left - canvas.offsetLeft) / (canvas.width / currPreviewCanvas.width),\r\n (currFormation.members[member].top - canvas.offsetTop) / (canvas.width / currPreviewCanvas.width),\r\n 3, 0, 2 * Math.PI);\r\n currPreviewContext.closePath();\r\n\r\n // Set fill color\r\n currPreviewContext.fillStyle = '#556170';\r\n // Draw filled circles\r\n currPreviewContext.fill();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "bbeb8a2b467174f29199c33d2e58e06c", "score": "0.6021443", "text": "function update(){\n frames++;\n (frames%600 == 0) && (refresh -= ((frames/600 > 7) ? 0 : 24));\n ctx.clearRect(0,0,canvas.width,canvas.height);\n board.draw();\n showScore();\n flappy.draw();\n generatePipes();\n drawPipes();\n checkCrash();\n //flappy2.draw();\n }", "title": "" }, { "docid": "ed483fb7231a49927a4c3a067b035c48", "score": "0.60139495", "text": "function refreshScreen() {\n let ctx = c.getContext(\"2d\");\n if (statutGame===\"ingame\") {\n ctx.clearRect(0, 0, c.width, c.height);\n ctx.drawImage(seaImg, seaPosX, seaPosY);\n ctx.drawImage(pontImg, pontPosX, pontPosY);\n ctx.drawImage(canonImg, canonPosX, canonPosY);\n for (let i = 0; i < boat.length; i++) {\n if (boat[i][\"active\"] < 16) ctx.drawImage(eval(boat[i][\"img\"]), boat[i][\"posX\"], boat[i][\"posY\"]);\n }\n for (let i = 0; i < boulet.length; i++) {\n if (boulet[i][\"active\"] === 0) ctx.drawImage(bouletImg, boulet[i][\"posX\"], boulet[i][\"posY\"]);\n }\n live > 4 ? ctx.drawImage(liveImg, 500, 10) : ctx.drawImage(liveLoseImg, 500, 10);\n live > 3 ? ctx.drawImage(liveImg, 530, 10) : ctx.drawImage(liveLoseImg, 530, 10);\n live > 2 ? ctx.drawImage(liveImg, 560, 10) : ctx.drawImage(liveLoseImg, 560, 10);\n live > 1 ? ctx.drawImage(liveImg, 590, 10) : ctx.drawImage(liveLoseImg, 590, 10);\n live > 0 ? ctx.drawImage(liveImg, 620, 10) : ctx.drawImage(liveLoseImg, 620, 10);\n if (live < 1) loadGameOver++;\n ctx.font = '40px serif';\n ctx.fillStyle = \"white\";\n ctx.fillText(score, 10, 40);\n if (loadGameOver > 15 && loadGameOver <80) {\n ctx.drawImage(gameoverImg, 0, 0);\n document.getElementById(\"replay\").style.display = \"inline\";\n }\n if (loadGameOver>=80) { //player tape his name\n ctx.drawImage(nameImg, 0, 0);\n ctx.font = '30px serif';\n ctx.fillStyle = \"white\";\n let posLetterX=320-(name.length*10);\n ctx.fillText(name, posLetterX, 230);\n }\n }\n if (statutGame===\"startscreen\") {\n ctx.clearRect(0, 0, c.width, c.height);\n ctx.drawImage(eval(startscreen), 0, 0);\n statutCount++;\n if (statutCount>100) {\n statutCount=0;\n statutGame=\"highscore\";\n }\n }\n if (statutGame===\"highscore\") {\n ctx.clearRect(0, 0, c.width, c.height);\n ctx.drawImage(highscoreImg, 0, 0);\n ctx.font = '30px serif';\n ctx.fillStyle = \"white\";\n for (let i=0; i<arrayScore.length;i++) {\n if (arrayScore[i][\"position\"]===1) { ctx.fillText(\"1\", 20, 80); ctx.fillText(arrayScore[i][\"name\"], 200, 80); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 80); }\n if (arrayScore[i][\"position\"]===2) { ctx.fillText(\"2\", 20, 130); ctx.fillText(arrayScore[i][\"name\"], 200, 130); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 130);}\n if (arrayScore[i][\"position\"]===3) { ctx.fillText(\"3\", 20, 180); ctx.fillText(arrayScore[i][\"name\"], 200, 180); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 180);}\n if (arrayScore[i][\"position\"]===4) { ctx.fillText(\"4\", 20, 230); ctx.fillText(arrayScore[i][\"name\"], 200, 230); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 230);}\n if (arrayScore[i][\"position\"]===5) { ctx.fillText(\"5\", 20, 280); ctx.fillText(arrayScore[i][\"name\"], 200, 280); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 280);}\n if (arrayScore[i][\"position\"]===6) { ctx.fillText(\"6\", 20, 330); ctx.fillText(arrayScore[i][\"name\"], 200, 330); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 330);}\n if (arrayScore[i][\"position\"]===7) { ctx.fillText(\"7\", 20, 380); ctx.fillText(arrayScore[i][\"name\"], 200, 380); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 380);}\n if (arrayScore[i][\"position\"]===8) { ctx.fillText(\"8\", 20, 430); ctx.fillText(arrayScore[i][\"name\"], 200, 430); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 430);}\n if (arrayScore[i][\"position\"]===9) { ctx.fillText(\"9\", 20, 480); ctx.fillText(arrayScore[i][\"name\"], 200, 480); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 480);}\n if (arrayScore[i][\"position\"]===10){ ctx.fillText(\"10\", 20, 530); ctx.fillText(arrayScore[i][\"name\"], 200, 530); ctx.fillText(arrayScore[i][\"score\"]+\" pts\", 510, 530);}\n }\n statutCount++;\n if (statutCount>50) {\n statutCount=0;\n statutGame=\"startscreen\";\n }\n }\n }", "title": "" }, { "docid": "5054efc2a263af71d709efcb280b1b31", "score": "0.60133415", "text": "function update () {\n\n loadSurfaceColor();\n\n }", "title": "" }, { "docid": "7c3a511f9a6e47abbd5ba71c5c2d79c7", "score": "0.6007503", "text": "redrawEnd()\n {\n ASSERT(mainContext == this.context); // must call redrawStart() before drawing tiles\n glEnable && glCopyToContext(mainContext, 1);\n //debugSaveCanvas(this.canvas);\n\n // set stuff back to normal\n [mainCanvas, mainContext, mainCanvasSize, cameraPos, cameraScale] = this.savedRenderSettings;\n }", "title": "" }, { "docid": "7a81f4e8ddd203b31b619d0c15fbe859", "score": "0.60059685", "text": "engine_cycle()\n { //get img\n let tmp_img = this.get_canvas_img();\n \n //update px\n for(let i = 0; i < tmp_img.width; i++)\n {\n for(let j = 0; j < tmp_img.height; j++)\n {\n if(this.score > 0 && i < this.score)\n {\n tmp_img.set_px(i, j, [0, 255, 0, 255]);\n }\n else if(this.score < 0 && i < Math.abs(this.score))\n {\n tmp_img.set_px(i, j, [255, 0, 0, 255]);\n }\n else\n {\n tmp_img.set_px(i, j, [0, 0, 0, 0]);\n }\n }\n }\n //update img\n this.set_canvas_img(tmp_img);\n this.check_clocks();\n }", "title": "" }, { "docid": "bd0214bdf76c73db7763042d128671c9", "score": "0.5990856", "text": "displayReload(ctx){\n if(this.weapon.reload)\n {\n ctx.beginPath();\n ctx.arc(\n this.player.pos.x + 12,\n this.player.pos.y - 12,\n 5,\n 0,\n Math.PI*2, false\n );\n ctx.fillStyle = 'purple';\n ctx.fill();\n ctx.closePath();\n }\n \n }", "title": "" }, { "docid": "e6174e8e06a0f7ea1879c56c5cb7d010", "score": "0.5988112", "text": "function redraw(){\n background.batchDraw();\n foreground.batchDraw();\n fogLayer.batchDraw();\n }", "title": "" }, { "docid": "a9c3b03a5eb01ec4ff8b0bca3311f7c4", "score": "0.59865427", "text": "Invalidate() {}", "title": "" }, { "docid": "45cd89f0ca585ed4127cff8202a016d6", "score": "0.59735036", "text": "function redraw() {\n\n context.clearRect(0, 0, canvas.width, canvas.height); // clear canvas\n drawShirt(ThisrtColour);\n setText();\n\n\n}", "title": "" }, { "docid": "646796790be9b4935d6b82e91e4dc490", "score": "0.5966788", "text": "refresh() {\n this.render();\n }", "title": "" }, { "docid": "f43dfe12c7073e95204bd61dd5ea81c6", "score": "0.59595495", "text": "function resetCanvas() {\n particles = [];\n resizeCanvas(canvas);\n positionParticles();\n draw();\n}", "title": "" }, { "docid": "1878064e46ab6552d004ee5a7c87b8ea", "score": "0.5954723", "text": "engine_cycle()\n { //get img\n let tmp_img = this.get_canvas_img();\n \n //update px\n for(let i = 0; i < tmp_img.width; i++)\n {\n for(let j = 0; j < tmp_img.height; j++)\n {\n if(this.score > 0 && i < this.score)\n {\n tmp_img.set_px(i, j, [0, 255, 0, 255]);\n }\n else if(this.score < 0 && i < Math.abs(this.score))\n {\n tmp_img.set_px(i, j, [255, 0, 0, 255]);\n }\n else\n {\n tmp_img.set_px(i, j, [0, 0, 0, 0]);//THIS IS WHAT IS \"CLEARING\" The Screen so imgs don't linger\n }\n }\n }\n //update img\n this.set_canvas_img(tmp_img);\n this.check_clocks();\n }", "title": "" }, { "docid": "ef43379f425020520c67e7f221abda09", "score": "0.5943871", "text": "function resetCanvas() {\n resetValues();\n Caman('#photo', function () {\n this.revert();\n saveCanvas();\n })\n}", "title": "" }, { "docid": "ee7a7d661003d577d0eb203baf483783", "score": "0.5943763", "text": "updateCanvas() {\n let width = this.canvas.width\n let height = this.canvas.height\n\n let ctx = this.canvas.getContext('2d')\n let canvasData = this.props.canvasData\n if (!canvasData.data) {\n this.props.initImageData()\n return\n }\n /* helper variables tell canvas when to update, because redux does not recognize changes in array */\n if (this.props.shouldUpdate) {\n ctx.putImageData(canvasData, 0, 0)\n this.props.doneUpdating()\n }\n }", "title": "" }, { "docid": "f0064350c9d92edeb874b406eaf4b9f8", "score": "0.5936557", "text": "function drawCanvas() {\n\t\tdrawer.drawEmptyGrid(context, solver.xLength, solver.yLength);\n\t\tdrawer.drawCombinedArrowGridIndications(context, solver.clueGrid);\n\t\tdrawInsideSpaces(context, drawer, colours, solver, purificator);\n\t\tsolver.callStateForItem(spanState);\n\t}", "title": "" }, { "docid": "8b24db82b073dca4798e72f0c968dfdd", "score": "0.5934105", "text": "_canvas_set() {\n if (this.canvas_set) this.canvas_set(this.canvas);\n }", "title": "" }, { "docid": "f2c023973ad12e3bb61bb5f820252e3d", "score": "0.5930818", "text": "function updateCanvas(img) {\n const parent = editPaneRef.current;\n const canvas = parent.firstChild;\n const context = canvas.getContext('2d');\n\n canvas.width = img.width;\n canvas.height = img.height;\n context.drawImage(img, 0, 0, img.width, img.height);\n canvas.removeAttribute('data-caman-id');\n\n updateImage(curRenderList);\n }", "title": "" }, { "docid": "e513b728cab1086901055120da67aacd", "score": "0.5927992", "text": "function Prerendering() {\n //canvases & contexts\n _this.ctxbg.fillStyle = 'black';\n _this.ctxbg.fillRect(0, 0, _this.cbg.width, _this.cbg.height);\n\n _this.ctxfg.fillStyle = \"rgba(0, 0, 0, 0.1)\";\n _this.ctxfg.fillRect(0, 0, _this.cfg.width, _this.cfg.height);\n\n _this.ctxbg.save();\n _this.ctxfg.save();\n _this.ctxgui.save();\n\n //star\n _this.ctxPreStar.beginPath();\n _this.ctxPreStar.fillStyle = 'yellow';\n _this.ctxPreStar.fillRect(0, 0, _this.cPreStar.width, _this.cPreStar.height);\n\n\n //explosions\n for (var i = 0; i < _this.preExplosionsLength; i++) {\n _this.cPreExplosions[i] = _this.doc.createElement('canvas');\n _this.cPreExplosions[i].width = i * 2 + 2;\n _this.cPreExplosions[i].height = i * 2 + 2;\n _this.ctxPreExplosions[i] = _this.cPreExplosions[i].getContext('2d');\n\n _this.ctxPreExplosions[i].beginPath();\n _this.ctxPreExplosions[i].arc(i + 1, i + 1, i, 0, 2 * Math.PI, false);\n _this.ctxPreExplosions[i].strokeStyle = 'red';\n _this.ctxPreExplosions[i].lineWidth = 1;\n _this.ctxPreExplosions[i].stroke();\n }\n\n //asteroids\n for (var i = 1; i < _this.preAsteroidsLength; i++) {\n _this.cPreAsteroids[i] = _this.doc.createElement('canvas');\n _this.cPreAsteroids[i].width = i * 2 + 2;\n _this.cPreAsteroids[i].height = i * 2 + 2;\n _this.ctxPreAsteroids[i] = _this.cPreAsteroids[i].getContext('2d');\n\n _this.ctxPreAsteroids[i].beginPath();\n _this.ctxPreAsteroids[i].arc(i + 1, i + 1, i, 0, 2 * Math.PI, false);\n _this.ctxPreAsteroids[i].fillStyle = 'grey';\n _this.ctxPreAsteroids[i].fill();\n _this.ctxPreAsteroids[i].strokeStyle = 'white';\n _this.ctxPreAsteroids[i].stroke();\n }\n\n //wall\n _this.ctxPreWall.beginPath();\n _this.ctxPreWall.fillStyle = 'silver';\n _this.ctxPreWall.fillRect(0, 0, _this.cPreWall.width, _this.cPreWall.height);\n\n //laserbeam\n _this.ctxPreLaserBeam.beginPath();\n _this.ctxPreLaserBeam.fillStyle = 'red';\n _this.ctxPreLaserBeam.fillRect(0, 0, _this.cPreLaserBeam.width, _this.cPreLaserBeam.height);\n\n //player\n _this.ctxPrePlayer.beginPath();\n _this.ctxPrePlayer.fillStyle = 'yellow';\n _this.ctxPrePlayer.fillRect(0, 0, _this.cPrePlayer.width, _this.cPrePlayer.height);\n\n _this.ctxPreImmortalPlayer.beginPath();\n _this.ctxPreImmortalPlayer.fillStyle = 'red';\n _this.ctxPreImmortalPlayer.fillRect(0, 0, _this.cPreImmortalPlayer.width, _this.cPreImmortalPlayer.height);\n\n //powerups\n for (var i = 0; i < _this.powerupsLength; i++) {\n\n _this.cPrePowerups[i] = _this.doc.createElement('canvas');\n _this.cPrePowerups[i].width = 10;\n _this.cPrePowerups[i].height = 10;\n _this.ctxPrePowerups[i] = _this.cPrePowerups[i].getContext('2d');\n\n _this.ctxPrePowerups[i].beginPath();\n if (i == 0 || i == 1) {\n _this.ctxPrePowerups[i].fillStyle = 'orange';\n }\n if (i == 2) {\n _this.ctxPrePowerups[i].fillStyle = 'red';\n }\n if (i == 3) {\n _this.ctxPrePowerups[i].fillStyle = 'purple';\n }\n _this.ctxPrePowerups[i].fillRect(0, 0, _this.cPrePowerups[i].width, _this.cPrePowerups[i].height);\n }\n }", "title": "" }, { "docid": "537ef1051096941fb5f37d6b14f3c4a1", "score": "0.5927534", "text": "function main() {\n canvas = document.getElementById(\"canvas\");\n ctx = canvas.getContext(\"2d\");\n chartCtx = document.getElementById(\"chart\").getContext('2d')\n //creating an empty 28X28 black img\n img = Array.from(Array(imgWidth), () => new Array(imgHeight));\n reset();\n loadModels();\n}", "title": "" }, { "docid": "e484afdfca7a3ce8e8a03c9c208fb486", "score": "0.5924913", "text": "canvasReset() {\n this.hdc.beginPath();\n this.hdc.fillStyle = colour.white;\n this.hdc.fillRect(0, 0, this.cfg.width, this.cfg.height);\n\n //make grid:\n for (let x = 0; x <= this.cfg.width; x += this.cfg.step) {\n this.addLine(x, 0, x, this.cfg.height, colour.light_grey, 1);\n }\n for (let y = 0; y <= this.cfg.height; y += this.cfg.step) {\n this.addLine(0, y, this.cfg.width, y, colour.light_grey, 1);\n }\n }", "title": "" }, { "docid": "22a1cf2d0c84c9ae1effeee8f4c92e31", "score": "0.5922899", "text": "render() {\n this.clear_canvas();\n this.render_canvas();\n }", "title": "" }, { "docid": "f081a07a4a974c62f3848c2e42797f16", "score": "0.59197104", "text": "function drawCanvas() {\r\n \r\n //canvas refresh\r\n //DEN HINTERGRUND ZEICHNEN\r\n //den background mit einer color transition(Circle) zeichnen\r\n if (BG === 0) {\r\n blackToGreen = ctx.createRadialGradient(width / 2, height / 2, 5,\r\n width / 2, height / 2, width / 2);\r\n blackToGreen.addColorStop(0, 'green');\r\n blackToGreen.addColorStop(1, 'black');\r\n }\r\n else if (BG === 1) {\r\n blackToGreen = ctx.createLinearGradient(canvas.width, 0, canvas.width, canvas.height)\r\n blackToGreen.addColorStop(0, \"darkgreen\");\r\n blackToGreen.addColorStop(1, \"black\");\r\n }\r\n\r\n ctx.fillStyle = blackToGreen;\r\n \r\n ctx.fillRect(0, 0, width, height);\r\n \r\n //Die Geschwindigkeit mit der horizontalen-mausposition bestimmen\r\n \r\n \r\n //zeichnet die nullen und einsen die aus dem Kreis 'fliegen'\r\n ctx.translate(width / 2, height / 2);\r\n for (var q = 0; q < quads.length; q++) {\r\n //die Position des Quads bestimmen\r\n quads[q].Update(speed, BG);\r\n //das Quad zeichnen\r\n quads[q].Show(ctx); \r\n } ctx.translate(-width / 2, -height / 2);\r\n \r\n setTimeout(drawCanvas, 1000 / 60);\r\n}", "title": "" }, { "docid": "4c299418348840f2125fb23585b3caec", "score": "0.5905634", "text": "function update() {\n grid = nextGen(grid);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n renderLifeBox(grid);\n setTimeout(() => requestAnimationFrame(update), 1000);\n }", "title": "" }, { "docid": "5707f00640ad11f7241bb2bba71bef22", "score": "0.5903808", "text": "update() {\n myGameArea.cnvs.fillStyle = this.color;\n myGameArea.cnvs.fillRect(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "710ef6a5fa76ee42f7396f6b0dc16279", "score": "0.59029526", "text": "function resetCanvas() {\n canvas.height = joystickHeight;\n canvas.width = joystickWidth;\n }", "title": "" }, { "docid": "1bc2dee14b1ca0ce7965cd411235c7b4", "score": "0.5892344", "text": "function reset_canvas() {\n tempimgData = [];\n maskbutData = [];\n deactallflagData = [];\n ctx.clearRect(0, 0, width, height);\n $(\"[id^=togglemask_]\").removeClass(\"active\");\n document.getElementById('undo_btn').disabled = true;\n }", "title": "" }, { "docid": "b1503d1ad06827d3b078b3b2dec015cd", "score": "0.58851165", "text": "function update_view() {\n \"use strict\";\n \n var coefs = {width_coefficient: 0, height_coefficient: 0};\n setCoefs(coefs);\n drawToolbar(coefs.width_coefficient, coefs.height_coefficient);\n drawScreen(coefs.width_coefficient, coefs.height_coefficient);\n}", "title": "" }, { "docid": "64eedaeac15817994d93567fb25a08d1", "score": "0.5885024", "text": "function drawCanvas() {\n\tconsole.log(\"redrawn canvas\");\n\tgame_context.clearRect(0, 0, 400, 400);\n\n\tfor (var i = 0; i < settings.rows; i++) {\n\t\tfor (var j = 0; j < settings.columns; j++) {\n\t\t\tvar x = j * settings.width;\n\t\t\tvar y = i * settings.height;\n\t\t\tvar image = grid[i][j];\n\n\t\t\tswitch (rotations[Math.floor(x / settings.width)][Math.floor(y / settings.height)]) {\n\t\t\t\tcase 0:\n\t\t\t\t\tgame_context.drawImage(image, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tgame_context.save(); \n\t\t\t\t\tgame_context.translate(x, y); \n\t\t\t\t\tgame_context.translate(settings.width/2, settings.height/2); \t\n\t\t\t\t\tgame_context.rotate(Math.PI/2); \n\t\t\t\t\tgame_context.drawImage(image, -settings.width/2, -settings.height/2);\n \t\t\t\tgame_context.restore(); \n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tgame_context.save(); \n\t\t\t\t\tgame_context.translate(x, y); \n\t\t\t\t\tgame_context.translate(settings.width/2, settings.height/2); \t\n\t\t\t\t\tgame_context.rotate(Math.PI); \n\t\t\t\t\tgame_context.drawImage(image, -settings.width/2, -settings.height/2);\n \t\t\t\tgame_context.restore(); \n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tgame_context.save(); \n\t\t\t\t\tgame_context.translate(x, y); \n\t\t\t\t\tgame_context.translate(settings.width/2, settings.height/2); \t\n\t\t\t\t\tgame_context.rotate(3*Math.PI/2); \n\t\t\t\t\tgame_context.drawImage(image, -settings.width/2, -settings.height/2);\n \t\t\t\tgame_context.restore(); \n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6f83bf1cbefdf654d7022577430f2328", "score": "0.58840346", "text": "function updateCanvas(color) {\n\t\t\tvar gradient = vm.ctx.createLinearGradient(0, 0, 280, 10);\n\t\t\tgradient.addColorStop(1, 'rgba(255,255,255,0)');\n\t\t\tgradient.addColorStop(0.53, color || 'rgba(128, 243, 198,1)');\n\t\t\tgradient.addColorStop(0, 'rgba(102,102,102,1)');\n\t\t\tvm.ctx.fillStyle = gradient;\n\t\t\tvm.ctx.fillRect(0, 0, 280, 10);\n\t\t\tvm.palette = vm.ctx.getImageData(0, 0, 257, 1).data;\n\t\t\t//document.getElementsByTagName('body')[0].appendChild(vm.canvas);\n\t\t}", "title": "" }, { "docid": "df96a4e916cf2e817f7d87dcd756ece3", "score": "0.58808094", "text": "function onColorUpdate(e) {\r\n if (current.type == 'Pen') {\r\n current.color = e.target.className.split(' ')[1];\r\n var svgs = document.getElementsByClassName('toolbar__panel__item'); \r\n for (var i = 0; i < svgs.length; i++) {\r\n if(current.color != 'white'){\r\n svgs[i].style.color = current.color;\r\n document.getElementById('penm').style.color = current.color;\r\n document.getElementById('Linem').style.color = current.color;\r\n document.getElementById('Rectm').style.color = current.color; \r\n }\r\n } \r\n }\r\n if (current.type == 'Bg') {\r\n current.bgcolor = e.target.className.split(' ')[1];\r\n //alert(main_canvas.id);\r\n current.canvas = document.getElementById('page' + previouspagecount);\r\n main_ctx = current.canvas.getContext('2d');\r\n animateColorChange(); \r\n setTimeout(function(){\r\n current.canvas.style.backgroundColor = current.bgcolor\r\n document.body.style.backgroundColor = current.bgcolor }, 200); \r\n var s_cht = document.getElementsByClassName('s_msg');\r\n for(var i = 0; i < s_cht.length; i++){\r\n s_cht[i].style.backgroundColor = current.bgcolor;\r\n } \r\n socket.emit('color', {\r\n color: current.bgcolor,\r\n api: api\r\n });\r\n }\r\n if (current.type == 'Fill') {\r\n current.color = 'black';\r\n current.fillcolor = e.target.className.split(' ')[1];\r\n var svgs = document.getElementsByClassName('toolbar__panel__item'); \r\n for (var i = 0; i < svgs.length; i++) {\r\n if(current.fillcolor != 'white'){\r\n svgs[i].style.color = current.fillcolor;\r\n document.getElementById('penm').style.color = current.fillcolor;\r\n document.getElementById('Linem').style.color = current.fillcolor;\r\n document.getElementById('Rectm').style.color = current.fillcolor; \r\n }\r\n } \r\n }\r\n }", "title": "" }, { "docid": "7c1fbdfc43b27d9fe64a415ca8a9d5bc", "score": "0.5878273", "text": "function SetVideoOnCanvas(){ \n ctx.drawImage(vi,xpos, ypos);\n requestAnimationFrame(SetVideoOnCanvas);\n }", "title": "" }, { "docid": "904bf8911b27a60e66ce630284db50c2", "score": "0.5876798", "text": "function resetValues(){\n\tcanvas1=document.getElementById(\"canvas1\");\n\tgcontext=canvas1.getContext(\"2d\");\n\tcanvasHeight=canvas1.height\n\tcanvasWidth=canvas1.width\n}", "title": "" } ]
bf1039be9d90743891b41c065ddd8170
Description: Given an alphabet and a string of text, write a method that tallies the count of each letter defined in said alphabet (case insensitive), then return the result of this tally. Test Cases: alphaCount("aBc", "aabbccdd" ) => "a:2,b:2,c:2" alphaCount("x", "Racer X is my friend :)" ) => "a:2,b:2,c:2" alphaCount("123", "o hai" ) => "no matches" Code:
[ { "docid": "079d5263b34898d49ba7976187e1cac6", "score": "0.80709463", "text": "function alphaCount (alphabet, text) {\n alphaObj = {};\n console.log(alphabet.split(''));\n alphabet.split('').forEach(letter => {\n alphaObj[letter.toLowerCase()] = 0;\n });\n console.log(alphaObj);\n text.split('').forEach(letter => {\n if(alphaObj[letter.toLowerCase()] !== undefined) {\n alphaObj[letter.toLowerCase()]++;\n }\n });\n\n let valid = [];\n Object.keys(alphaObj).forEach(letter => {\n if(alphaObj[letter] !== 0) {\n valid.push(letter + ':' + alphaObj[letter]);\n } else {\n alphaObj[letter] = undefined;\n }\n })\n\n if(valid.length === 0) return 'no matches';\n return valid.join(',');\n}", "title": "" } ]
[ { "docid": "a172e15261b88e02441df202f8010bab", "score": "0.83022803", "text": "function alphaCount (alphabet, text) {\n alphabet = alphabet.toLowerCase();\n text = text.toLowerCase();\n var result = alphabet.split(\"\").map(elem => [elem,0] );\n var letters = alphabet.split(\"\");\n \n text.split('').forEach(letter => {\n if(letters.indexOf(letter) >= 0) {\n result[letters.indexOf(letter)][1]++;\n }\n });\n result = result.filter(elem => {\n return elem[1] > 0;\n })\n \n if(result.length === 0)\n return \"no matches\";\n return result.map(elem => elem.join(':')).join(',');\n}", "title": "" }, { "docid": "83edcb80d2bce7655e62ea50ad5286fb", "score": "0.75753325", "text": "function countNumberOfLetter(text) {\n\n if (typeof text == \"string\") {\n var n = 0;\n for (var i = 0; i < text.length; i++) {\n\n if (text[i] == \"a\" || text[i] == \"A\") {\n n++;\n }\n }\n console.log(n);\n } else {\n console.log(\"Input is not a string\");\n }\n}", "title": "" }, { "docid": "4d0d76bb6f2c57638b64f7524d0e2e66", "score": "0.7540042", "text": "function letterCounter(str){\n strArr = str.split(\"\");\n return function (letter){\n let count = 0;\n for(let i=0; i<strArr.length; i++){\n if (strArr[i].toLowerCase() === letter.toLowerCase()) count++;\n }\n return count;\n }\n}", "title": "" }, { "docid": "4c0012f013f5b83dbaf054038f6108f7", "score": "0.749111", "text": "function countLetters(string) {\r\n\tvar lowerCaseString = string.toLowerCase().split(' ').join('')\r\n\tvar counter = {}\r\n\tvar tally = 0\r\n\tfor (var i = 0; i < lowerCaseString.length; i++) {\r\n\t\tif (!counter.hasOwnProperty(lowerCaseString[i])) {\r\n\t\t\tcounter[lowerCaseString[i]] = 1;\r\n\t\t} else {\r\n\t\t\tcounter[lowerCaseString[i]] += 1;\t\r\n\t\t}\r\n\t\r\n\t}\r\nreturn counter;\r\n}", "title": "" }, { "docid": "7d3ebb80454815b7f4aa5ecbd7fb077c", "score": "0.7467268", "text": "function charFreq(text) {\n\n // Step 1 sort letters into alphabetical order.\n\n var sortAlphabets = function(text) {\n return text.split('').sort().join('');\n };\n\n // Step 2 split string into an array and count letters in string\n\n var arrayedString = sortAlphabets.split;\n // var arraysStringLength = arrayedString.length;\n\n\n // Step 3 run loop to compare initial letter and last letter being examined\n\n // var lastLetter = arraysString[0];\n let countLetter = 0;\n\n // WORKING ON THIS!\n\n // for (let i = 1; i <= arraysStringLength; i++) {\n // if (lastLetter == arryString[i]) // this checks for current letter match\n // {\n // countLetter++;\n // } else {\n // console.log(arrayString[i]);\n // console.log(countletter);\n // }\n // }\n\n }", "title": "" }, { "docid": "b02c10f0554c92ccd7ca106da0f17979", "score": "0.7427536", "text": "function countChar(str, letter) {\n //initialize count var\n var count = 0;\n //normalize string\n var normStr = str.toLowerCase();\n //loop through the string \n for(var i = 0; i < normStr.length; i++){\n //compare each letter of the string to the letter var\n if(normStr.charAt(i) == letter) {\n //add to count for each time the letter is found in the string\n count += 1;\n }\n }\n //log results\n console.log(count);\n}", "title": "" }, { "docid": "c472a3f3f322908e49e6bc49be984bd4", "score": "0.7312558", "text": "function countLetters(string, letter) {\n var counter = 0;\n var searchableString = string.split('');\n for(i = 0; i < searchableString.length; i++) {\n if(searchableString[i] === letter) {\n counter++;\n }\n }\n console.log(counter);\n}", "title": "" }, { "docid": "fd30a3b289c1b398f734bc4d53e8f872", "score": "0.7306328", "text": "function charcount(str,letter){\n var lettercount=0;\n for(var t=0;t<str.length;t++){\n if(str.charAt(t)===letter){\n lettercount +=1; }\n }\n return lettercount;\n}", "title": "" }, { "docid": "6ba44926805248ac52660c9e15a7b236", "score": "0.72969306", "text": "function char_count(str, letter) \n{\n var letter_Count = 0;\n for (var position = 0; position < str.length; position++) \n {\n if (str.charAt(position) == letter) \n {\n letter_Count += 1;\n }\n }\n return letter_Count;\n}", "title": "" }, { "docid": "567db98e7ce862b6ba90d34acfd62a4c", "score": "0.7296606", "text": "function char_count(str, letter){\n\t//console.log(str, letter)\n//Write your code here\n\tlet count = 0;\n\tfor(a of str){\n\t\tif (a === letter){\n\t\t\t ++count;\n\t\t}\n\t}\n\treturn(count);\n}", "title": "" }, { "docid": "a4ea5fe6d405e4742158a74f49da7924", "score": "0.7273677", "text": "function letterCaseCount(str) {\n let charCount = pattern => pattern.test(str) ? str.match(pattern).length : 0;\n\n return { lowercase: charCount(/[a-z]/g),\n uppercase: charCount(/[A-Z]/g),\n neither: charCount(/[^a-zA-Z]/g),\n }\n}", "title": "" }, { "docid": "0ccee80dc7a074f0cd291f82cfbdd31b", "score": "0.7269069", "text": "function letterCaseCount(string) {\n let lowercase = patternCount(/[a-z]/g, string);\n let uppercase = patternCount(/[A-Z]/g, string);\n let neither = patternCount(/[^a-zA-Z]/g, string);\n\n return {\n lowercase: lowercase,\n uppercase: uppercase,\n neither: neither,\n };\n}", "title": "" }, { "docid": "192f61588998b8be11d5455e59bbb45a", "score": "0.72388506", "text": "function char_count(str, letter)\n{\nvar letter_Count = 0;\nfor (var position = 0; position < str.length; position++)\n{\n if (str.charAt(position) == letter)\n {\n letter_Count += 1;\n }\n }\n return letter_Count;\n}", "title": "" }, { "docid": "9dd2fadc0c01247ee6236875dd745495", "score": "0.7229291", "text": "function strCount(str, letter){ \n let count = 0;\n for (const i of str) {\n const ans = i === letter? count++:0;\n } return count;\n}", "title": "" }, { "docid": "902859011f9b00e12eded62560ba9fa9", "score": "0.72246265", "text": "function aCounter(word) {\n let count = 0;\n let index = 0\n while (index < word.length) {\n let char = word[index];\n if (char === \"a\" || char === \"A\") {\n count += 1;\n }\n index++\n }\n return count;\n }", "title": "" }, { "docid": "8a42547a2a8935d0eaf856a7c04aab02", "score": "0.7223388", "text": "function char_count(str, letter) \n{\n var Count = 0;\n for (var position = 0; position < str.length; position++) \n {\n if (str.charAt(position) == letter) \n {\n Count += 1;\n }\n }\n return Count;\n}", "title": "" }, { "docid": "0c0ad0f1de59318434081c6d6f960d25", "score": "0.72068423", "text": "function char_count(str, letter) \r\n{\r\n var letter_Count = 0;\r\n for (var position = 0; position < str.length; position++) \r\n {\r\n if (str.charAt(position) == letter) \r\n {\r\n letter_Count += 1;\r\n }\r\n }\r\n return letter_Count;\r\n}", "title": "" }, { "docid": "34d78fee0a40251afaa6dd2e458a47fb", "score": "0.716804", "text": "function countLetters(input) {\n input = input.toLowerCase();\n var lettersCount = {\n a: 0\n , b: 0\n , c: 0\n , d: 0\n , e: 0\n , f: 0\n , g: 0\n , h: 0\n , i: 0\n , j: 0\n , k: 0\n , l: 0\n , m: 0\n , n: 0\n , o: 0\n , p: 0\n , q: 0\n , r: 0\n , s: 0\n , t: 0\n , u: 0\n , v: 0\n , w: 0\n , x: 0\n , y: 0\n , z: 0\n };\n for (var i = 0; i < input.length; i++) {\n if (Number.isInteger(lettersCount[input[i]])) {\n lettersCount[input[i]]++;\n }\n }\n return lettersCount\n }", "title": "" }, { "docid": "6d3eb1f7db4d64819641c5744e66993c", "score": "0.71327037", "text": "function letterOccurrences (string, letter) {\n var counter = 0;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === letter) {\n counter++;\n }\n }\n return counter;\n}", "title": "" }, { "docid": "a397a3cf4e39401ee94a1a7631073c18", "score": "0.7121234", "text": "function letterCount(word)\n{\n\t// Array for holding the key/value pairs\n\tvar letterCounter = {};\n\n\n\t// Make alphanumeric only and case insensitive\n\t// URL: http://stackoverflow.com/questions/388996/regex-for-javascript-to-allow-only-alphanumeric\n\tword = word.replace(/[^a-z0-9]/gi,'').toUpperCase();\n\t\n\t// Loop through each letter of the string\n\tfor (var index = 0; index < word.length; index += 1)\n\t{\n\t\t// Checks if key already exists in letterCounter\n\t\t// \t\ttrue - adds another to the counter for the key\n\t\tif (letterCounter.hasOwnProperty(word[index]))\n\t\t{\n\t\t\t// Grab the value from the existing key\n\t\t\t// Convert the value into a number before adding 1\n\t\t\t// (because objects always return as strings)\n\t\t\tletterCounter[word[index]] = Number(letterCounter[word[index]]) + (1);\t\n\t\t}\n\n\t\t// \t\tfalse - add to letterCounter a new key/value pair with a value of 1\n\t\telse\n\t\t{\n\t\t\tletterCounter[word[index]] = 1;\n\t\t}\n\n\t}\n\n\t// A sorted array of the keys in letterCounter\n\tvar arr = Object.keys(letterCounter).sort();\n\n\t// Display the key and its number of occurrences\n\tfor (var index = 0; index < Object.keys(letterCounter).length; index += 1)\n\t{\n\t\t// Output format: key : value\n\t\tconsole.log(arr[index] + \": \" + letterCounter[arr[index]]);\n\t}\n}", "title": "" }, { "docid": "b1f85838d0b641cdf726f447985af576", "score": "0.7110821", "text": "function countChars(string, letter){\n var resultletter =0\n for (var i = 0; i < string.length; i++) {\n if (string.charAt(i) === letter) {\n resultletter +=1\n }\n }\n return resultletter\n}", "title": "" }, { "docid": "6a1744dd03b97f990a89b2fe3ba68d66", "score": "0.7109128", "text": "function letter(string) {\n sum = 0;\n for (var i = 0; i < string.length; i++){\n if (string[i] === \"a\" || string[i] === \"A\"){\n sum++;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "967d8865298d1636eab3d9f17ab1d4d1", "score": "0.7084314", "text": "function charCount(str) {\n // do something\n //return an object with keys that are lowercase alphanumeric characters in the string; values should be the counts for those characters\n}", "title": "" }, { "docid": "1b635cfb88abbc0b2896f54d63eedc69", "score": "0.70672244", "text": "function countAs(string) {\n var stringArray = string.split(\"\");\n var count = 0;\n stringArray.forEach(function(letter) {\n if (letter === \"a\") {\n count++;\n }\n });\n return count;\n}", "title": "" }, { "docid": "61fc6dcca58f52fd7816b5a390bbdb4b", "score": "0.70613664", "text": "function singleLetterCount(word, letter) {\n var count = 0;\n for (let i = 0; i < word.length; i++) {\n if (word[i].toLowerCase() === letter.toLowerCase()) {\n count++;\n }\n }\n console.log(count);\n}", "title": "" }, { "docid": "e4340c9ee4d5f7ba5c7a55689e272089", "score": "0.7056634", "text": "function countChar(string, letter){\n var letterCount = 0;\n for (i=0; i < string.length; i++){\n if (string.charAt(i) == letter){\n letterCount++;\n }\n }\n return letterCount;\n}", "title": "" }, { "docid": "4eed75b40d5bfd92e2eabe8bdb65dd88", "score": "0.7035752", "text": "function charCount(str) {\n // do something\n // return an object with keys that are lowercase alphanumeric characters in a string; values should be the counts of those characters\n}", "title": "" }, { "docid": "65e3edbc27603a62c86fff849ef612ad", "score": "0.70274603", "text": "function amountOfLowercaseLetters(inputString) {\n let count = 0;\n for (const char of inputString) {\n if (char.match(/[a-z]/)) {\n count++;\n }\n }\n return count\n}", "title": "" }, { "docid": "40afc987e20df7713f151fee9746a49b", "score": "0.70136076", "text": "function letterAppearances(letter, string) {\n var sum = 0;\n for (var i = 0; i < string.length; i++) {\n if (letter.toLowerCase() === string[i] || letter.toUpperCase() === string[i]) {\n sum++;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "4a3390a25d77f7899701d203d2a3171d", "score": "0.69862837", "text": "function numOfLetter(string, letter) {\n counter = 0;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === letter) {\n counter++\n }\n } return counter\n}", "title": "" }, { "docid": "a6733dcd059a9b3228cc7ce7842a4798", "score": "0.6970219", "text": "function countChar(str, letter) {\r\n let count = 0;\r\n const strArr = str.split('');\r\n for (let i = 0; i < strArr.length; i++) {\r\n if (strArr[i] === letter) count++;\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "95fc3172937276ddce0b9bec55919e89", "score": "0.69689274", "text": "function count_aInString(a) {\n var i;\n var counter = 0;\n\n for (i = 0; i < a.length; i++) {\n if (a[i] == \"a\") {\n counter++;\n }\n }\n return counter;\n}", "title": "" }, { "docid": "72f798d5f1f3566401d240b817a2b4e4", "score": "0.696099", "text": "function appearancesOfLetter(string, letter) {\r\n var count = 0;\r\n var string = 'banana';\r\n var letter = 'b';\r\n\r\n for (i = 0; i < string.length; i++) {\r\n if (string[i] === letter) {\r\n\r\n count++;\r\n }\r\n\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "0350c047705f572745ccc120ee763e9a", "score": "0.69477135", "text": "function countOccurrences(string, letter) {\n let sum = 0;\n for (i = 0; i <= string.length; i++) {\n if (string[i] === letter) {\n sum++;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "b775e46c59461c25bc8d73ae646bf9e9", "score": "0.6946717", "text": "function numOfAppLetter(string) {\n var c = 0;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === 'a' || string[i] === 'A') {\n c++\n }\n } return c\n}", "title": "" }, { "docid": "5e1188d938579537bf47e4ee904732b3", "score": "0.693181", "text": "function letterCount(s){\n const letters = s.split('')\n const counter = {}\n letters.forEach((letter) => counter[letter] = counter[letter] + 1 || 1)\n return counter\n}", "title": "" }, { "docid": "5ba84a5dba44489ef1586d9397c04e6c", "score": "0.6903248", "text": "function duplicateCount(text){\n //...\n // convert text into an array of lowercase letters\n var lower = text.toLowerCase();\n var array = lower.split('');\n // create blank object to pass letters and their quantities to as keys and values\n var obj = {};\n // iterate over the array\n for (var i = 0; i < array.length; i++) {\n // if obj with the current letter in the array is not defined in the array\n // add that letter as the key and set the value to one.\n var letter = array[i];\n if (obj[letter] === undefined) {\n obj[letter] = 1;\n } else {\n // if letter is already in the obj. add one to the value of the current letter\n obj[letter]++;\n }\n }\n // find any value over 1 in the values, meaning that letter is repeated\n // empty array to place the values that are repeated.\n var repeat = [];\n // create an array of the values of the letters.\n var values = Object.values(obj);\n // iterate over array of values and if it is larger than one push that value to \n // the repeat array\n for (var j = 0; j < values.length; j++) {\n var current = values[j];\n if (current > 1) {\n repeat.push(current);\n }\n }\n // return the number of repeated letters, which is the length of the array\n return repeat.length;\n }", "title": "" }, { "docid": "c90a4c0c3a68f84518f7fe956c271fcd", "score": "0.6895518", "text": "function charCount(str) {\n //make an object to return at end \n let result = {}\n //looping over string, for each character...\n for (i = 0; i < str.length; i++) {\n var char = str[i].toLowerCase()\n //if the char is a number/letter AND is a key in object, add one to count\n if (result[char] > 0) {\n result[char]++;\n } \n //if the char is a number/letter AND not in object, add it and set value to 1\n else {\n result[char] = 1;\n };\n \n }\n //if character is something else (space, period, etc) don't do anything\n return result\n //return object at end\n}", "title": "" }, { "docid": "916462b396f038e3f390be9f5bcb2056", "score": "0.68741995", "text": "function LetterCount(str) { \n var senSplit = str.split(\" \")\n var count = 0;\n for(var i = 0; i < senSplit.length; i++){\n var word = senSplit[i];\n for(var j = 0; j < word.length; j++){\n var letter = word[j];\n for(var k = 0; k < word.length; k++) {\n if(letter === word.charAt(k)){\n count++;\n if (count > 1) {\n return word;\n }\n }\n }\n count = 0;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "ad927e4906e275afe69d27ed14f9f570", "score": "0.6873346", "text": "function len(str,letter){\n let count=0;\n for(var i=0;i <= str.length;i++){\n if(str[i]===letter) \n count++;\n \n }\n return count;\n}", "title": "" }, { "docid": "7c72a718dbba7894c42680540e9a3094", "score": "0.6859852", "text": "function count_aInString(a) {\n var i;\n var newString = \"\";\n\n for (i = 0; i < a.length; i++) {\n if (a[i] == \"a\") {\n newString += \"A\";\n }\n else {\n newString += a[i];\n }\n }\n return newString;\n}", "title": "" }, { "docid": "1689df312f9a9523cf2fbc70446a9383", "score": "0.6857536", "text": "function alphabetPosition(text) {\n let alpha = 'abcdefghijklmnopqrstuvwxyz'.split('')\n let numStr = []\n let str = text.toLowerCase()\n for (let i = 0; i <= str.length; i++) {\n alpha.map((el, idx) => {\n if (str[i] === el) numStr.push(idx + 1)\n })\n }\n return numStr.join(' ');\n}", "title": "" }, { "docid": "9ec4d0c8c392a4e6019f293f68954a38", "score": "0.68445545", "text": "function letterAppearances(string) {\n var result = '';\n var a = 0;\n var A = 0;\n var sum = 0;\n for (var i = 0; i < string.length; i++) {\n if(string[i] == 'a') {\n a++;\n }else if (string[i] === 'A');\n }\n return a, A;\n}", "title": "" }, { "docid": "f7c67105c369c427999ac86615e63f90", "score": "0.6844428", "text": "function numOfLetter(string, letter) {\n var count = 0;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === letter) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "06c39ca9b09143154bb1f9cc537b1505", "score": "0.68312484", "text": "function LetterCountI(str) { \n\n // array of words\n var words = str.split(\" \");\n \n // the table that will contain each word with a key and value pair\n // being the characters and the number of times they appeared\n // e.g. {hello: {h: 1, e: 1, l: 2, o: 1}}\n var table = {};\n \n // loop through each word\n for (var i = 0; i < words.length; i++) {\n \n // create new entry in table with the key \n // being this word\n var thisWord = words[i];\n table[thisWord] = {};\n \n // create a key/value pair that will store\n // the highest letter count for each word\n table[thisWord][\"highest\"] = 0;\n \n // loop through each character in word and\n // store number of times each letter appears\n for (var c = 0; c < words[i].length; c++) {\n \n // see if this character already exists in table for\n // this word: if so add 1 to the count, if not set count = 1\n var thisChar = thisWord[c];\n table[thisWord][thisChar] === undefined ?\n table[thisWord][thisChar] = 1 :\n \ttable[thisWord][thisChar] += 1;\n \n // update the highest letter count for each \n // new letter in the iteration\n if (table[thisWord][thisChar] > table[thisWord][\"highest\"]) {\n \ttable[thisWord][\"highest\"] = table[thisWord][thisChar];\n }\n \n }\n \n }\n\n // setup a new object that will store the word\n // with the highest number of repeating characters\n var answer = {word: null, count: 1};\n \n // now determine what word has the highest number \n // of repeating letters by accessing the \"highest\"\n // property of each word in the table\n for (var w in table) {\n if (table[w][\"highest\"] > answer[\"count\"]) {\n answer[\"count\"] = table[w][\"highest\"];\n answer[\"word\"] = w;\n }\n }\n \n return (answer[\"count\"] === 1) ? -1 : answer[\"word\"];\n \n}", "title": "" }, { "docid": "bc85b5ecdee947a8673c4667aec9564b", "score": "0.68241006", "text": "function countCaps(str){\n const caps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n let count = 0;\n for(let char of str){\n if(caps.includes(char)) {\n count++\n }\n }\n return count\n}", "title": "" }, { "docid": "af69395a44114b6fad9b61b9082c9848", "score": "0.6823531", "text": "function letterCaseCount(str) {\n var returnObj = { lowercase: 0, uppercase: 0, neither: 0 }; \n\n for (var i = 0; i < str.length; i++) {\n if (!!str[i].match(/[A-Z]/)) {\n returnObj['uppercase']++;\n } else if (!!str[i].match(/[a-z]/)) {\n returnObj['lowercase']++;\n } else {\n returnObj['neither']++;\n }\n }\n\n console.log(returnObj);\n}", "title": "" }, { "docid": "b61dc96d02d946a56048b09ea135f5aa", "score": "0.6814598", "text": "function occurrencersLetter(word,letter)\n{\n\tif ( typeof word === 'unifined' || typeof letter ==='undifined')\n\t\treturn;\n\n\tif (typeof word === 'number')\n\t\treturn;\n\n var count = 0;\n arrWord = word.split('');\n\n for (var i = 0; i<arrWord.length;i++)\n {\n if (arrWord[i] === letter)\n count++;\n }\n return count;\n}", "title": "" }, { "docid": "c07acaeee3d7e0d0ce5578f1970e3f2c", "score": "0.67857337", "text": "function countLetters(wholePhrase, phraseLetters){\n //loop through sentence\n for (let i = 0; i < wholePhrase.length; i++){\n //access items in string \n let currentLetter = wholePhrase.charAt(i);\n \n if (phraseLetters[currentLetter] >= 0) {\n phraseLetters[currentLetter] += 1;\n //console.log(currentLetter);\n }\n }\n return phraseLetters;\n }", "title": "" }, { "docid": "a0f92343cba06927ca7946ac78de258a", "score": "0.6762865", "text": "function occurance(str, letter) {\n var count = 0;\n var strsplit = str.split(\"\");\n for(var i = 0; i < strsplit.length; i++) {\n if(strsplit[i] == letter) {\n count++;\n }\n }\n document.write(\"Occurance of \"+ letter +\" in \"+ str +\" is \"+ count +\" times\");\n}", "title": "" }, { "docid": "9d5cc30380296c79fc0598847b05019b", "score": "0.6761983", "text": "function countLetter(letter, word) {\n const userLetter = letter;\n const userWord = word.toLowerCase();\n let count = 0;\n\n for (let i = 0; i <= userWord.length; i++) {\n if (userWord[i] === userLetter) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "2fa3140150b6f4a53d90cebbe44f1875", "score": "0.6725754", "text": "function charCount(searchString, searchChar) {\r\n //searchString=myForm.Text.value // text to search\r\n charPos = searchString.indexOf(searchChar) // position of char to count\r\n //searchChar=myForm.letter.value // character to search for\r\n charPos = searchString.indexOf(searchChar) // position of char\r\n\r\n count = 0\r\n while (charPos != -1) {\r\n count++\r\n charPos = searchString.indexOf(searchChar, charPos + 1) // number of occurances\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "ee3b4c980363cebfabac40c63f694524", "score": "0.6710694", "text": "function countBChars(str, letter='B') {\r\n let count = 0;\r\n const strArr = str.split('');\r\n for (let i = 0; i < strArr.length; i++) {\r\n if (strArr[i] === letter) count++;\r\n }\r\n return count;\r\n}", "title": "" }, { "docid": "70bfac19fb81451852266dd1920a9035", "score": "0.67099065", "text": "function letterInString(string, letter) {\r\n \"use strict\";\r\n const max = string.length;\r\n let counter = 0;\r\n \r\n string = string.toLowerCase();\r\n letter = letter.toLowerCase();\r\n \r\n for(let i = 0; i <= max; i += 1) {\r\n if(string[i] === letter) {\r\n counter += 1;\r\n }\r\n }\r\n \r\n return counter;\r\n}", "title": "" }, { "docid": "9b06e9aed657b97d487872e7628b3413", "score": "0.67068064", "text": "function countOccurrence(string, letter) {\n let count = 0;\n for (let i = 0; i < string.length; i++) {\n if (string[i] === letter) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "41927527c196f75105ddc4c5bc75f3d6", "score": "0.6702976", "text": "function countLetter(s,p) {\nvar howMany = 0;\nfor (var eggo = 0; s.length > eggo; eggo++) {\n if (s.charAt(eggo) == p)\n howMany++;\n }\nconsole.log(\"How many? So many: \" + howMany); \n}", "title": "" }, { "docid": "164951b351fadbecd33033deaf27037e", "score": "0.6669542", "text": "function wordCount(text, arrTxt) {\n let totLetters = 0;\n let arrayReturned = [];\n let arrayLetters = [];\n let arrayCount = [];\n\n arrTxt.forEach((element) => {\n if (isLetter(element)) {\n totLetters = totLetters + 1;\n index = arrayLetters.indexOf(element);\n if (index > -1) {\n arrayCount[index] = arrayCount[index] + 1;\n } else {\n arrayCount.push(1);\n arrayLetters.push(element);\n }\n }\n });\n\n arrayReturned[0] = arrayCount;\n arrayReturned[1] = arrayLetters;\n arrayReturned[2] = totLetters;\n\n return arrayReturned;\n}", "title": "" }, { "docid": "72249107820b33e8d8461c633ce1f732", "score": "0.66651016", "text": "function LetterCount(str) { \n var words = str.split(\" \");\n var letters,letter_counts,regExp;\n var maxLetterCount=0, currentMaxLetterCount=0;\n //Loop through words\n for (var wordIndex=0;wordIndex<words.length;wordIndex++) {\n //Loop through each letter in the word\n letters = words[wordIndex].split(\"\");\n letter_counts = letters.map(function (a) {\n if (a.match(/\\w/i)!==null) {\n regExp = new RegExp(a,\"gi\");\n return letters.join(\"\").match(regExp).length;\n }\n else return 0;\n });\n currentMaxLetterCount = letter_counts.sort(function (a,b) {return a-b;}).pop();\n if (currentMaxLetterCount>maxLetterCount) {\n maxLetterCount = currentMaxLetterCount;\n maxLetterWord = words[wordIndex];\n }\n }\n return maxLetterCount>1?maxLetterWord:-1;\n}", "title": "" }, { "docid": "02328da249e5a80e35e71fe0fc8541e4", "score": "0.66651016", "text": "function LetterCountI(str) { \n //take each word\n //tally up repeating chars in each word\n //return word with most repeating chars\n let words = str.split(' ');\n let result = '';\n for (let i = 0; i < words.length; i++) {\n let word = words[i];\n let wordSet = new Set(word);\n if (wordSet.size < word.length && word.length > result.length) {\n result = word;\n }\n }\n return result === '' ? -1 : result;\n}", "title": "" }, { "docid": "64a1f1fca5b5dde2c101dbd9b12fb1c2", "score": "0.66638774", "text": "function letterCount(str){\n\n //split\n const array = str.split(\"\")\n console.log(array)\n \n //for loop --> take first index, count identical characters, ++ counter, splice every instance from array\n\n \n\n //return object\n\n}", "title": "" }, { "docid": "e9840becb935c7785084c7d971413bdd", "score": "0.6650772", "text": "function charCount(str){\n var obj = {}\n for (var char of str) {\n if(alphanumeric(char)) {\n char = char.toLowerCase();\n obj[char] = ++obj[char] || 1;\n }\n }\n return obj;}", "title": "" }, { "docid": "2c7ab3366af49d7c48d230011ae06404", "score": "0.6644366", "text": "function letterCount(str) {\n //create object for keeping track of the letter count.\n var count = {};\n var uniques = \"\";\n //loop through the string to get access to each letter\n for (var i = 0; i < str.length; i++) {\n var letter = str[i];\n //if that oubject already had that letter \n if (count[letter] !== undefined) {\n //incrament it by 1\n count[letter]++;\n } else {\n //create a new property for that letter and set it to 1\n count[letter] = 1;\n uniques += letter;\n } \n }\n //print out the letter and the number of times that letter was found\n //console.log(count);\n //console.log(uniques);\n return count;\n}", "title": "" }, { "docid": "a925877824a3dd5adfd2139f1d0a1e6d", "score": "0.66436654", "text": "function countLetters(str) {\n const obj = {};\n let result = '';\n\n for (const letter of str) {\n if (letter in obj) {\n obj[letter]++;\n } else {\n obj[letter] = 1;\n }\n }\n\n for (const x in obj) {\n if ( obj.hasOwnProperty(x) ) {\n result += obj[x] + x;\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "3208e5bc5c79199d358bcb8cdb85f165", "score": "0.6629075", "text": "function countLetterOccurance(string) {\n stringArr = string.split(\"\");\n const letterArr = [];\n const numberArr = [];\n for (let i = 0; i < stringArr.length; i++) {\n if (letterArr.includes(stringArr[i]) === false) {\n let count = 0;\n for (let x = 0; x < stringArr.length; x++) {\n if (stringArr[i] === stringArr[x]) {\n count++;\n }\n }\n letterArr.push(`${stringArr[i]}`);\n numberArr.push(`: ${count}`);\n }\n }\n\n const output = [];\n for (let y = 0; y < letterArr.length; y++) {\n output.push(letterArr[y].concat(numberArr[y]));\n }\n\n return output.join(\" \");\n}", "title": "" }, { "docid": "e58366c04ed98e1a85d4eb09c3c5b0e2", "score": "0.6627344", "text": "function characterSearch(text, letter) {\n console.log(\"Searching the string: \" + text);\n\n var foundLetters = 0;\n\n for (var i = 0; i < text.length; i++) {\n\n if (text.charAt(i) == letter) {\n foundLetters = foundLetters + 1;\n \n //foundLetters++ , adds one to the existing variable\n // foundLetters += 1 , a lot like ++ but adds one to existing variable.\n }\n \n }\n\n console.log(\"We found a total of \" + foundLetters + \" \" + letter + \"'s\");\n\n}", "title": "" }, { "docid": "244b8eef2889311bd103b1734bbc83ae", "score": "0.65916336", "text": "function letterCounter() {\n const letterCounts = {}\n\n for (let i = 0; i < typedText.length; i++) {\n let currentLetter = typedText[i]\n if (letterCounts[currentLetter] === undefined) {\n letterCounts[currentLetter] = 1\n } else {\n letterCounts[currentLetter]++\n }\n }\n\n for (let letter in letterCounts) {\n const span = document.createElement('span');\n const textContent = `\"${letter}\": ${letterCounts[letter]}, `;\n span.innerText = textContent;\n const letters = document.getElementById('lettersDiv');\n letters.appendChild(span);\n }\n\n return letterCounts\n}", "title": "" }, { "docid": "40e8ce840f9f71b400d3d87b2600d24f", "score": "0.6588109", "text": "function countChars (str) {\n let counts = {};\n\n for (let letter of str.split(\"\")) {\n let lowerLetter = letter.toLowerCase()\n if (counts[lowerLetter] === undefined) {\n counts[letter.toLowerCase()] = 1;\n } else {\n counts[letter.toLowerCase()] += 1;\n }\n }\n return counts;\n}", "title": "" }, { "docid": "5951246ad2054fc715ca56574399d762", "score": "0.6587009", "text": "function numberLetter(s, char) {\n var count = 0;\n for (var i = 0; i < s.length; i++) {\n if (s[i] == char) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "bb2fe23d4e4c3bced9bdee03455326a8", "score": "0.65806466", "text": "function countCharacter(inputString, inputCharacter) {\n let count = 0;\n let string = inputString.toLowerCase();\n let character = inputCharacter.toLowerCase();\n for (let i = 0; i < string.length; i++) {\n if (string[i] === character) {\n count++;\n }\n }\n return count; \n }", "title": "" }, { "docid": "9297283675a106faa1f88102f74129ff", "score": "0.6576571", "text": "function countLetter(s,p) {\nvar eggo = 0;\nvar howMany = 0;\nwhile (s.length > eggo) {\n if (s.charAt(eggo) == p) {\n howMany++;\n eggo++;\n } else {\n eggo++;\n }\n }\nconsole.log(\"How many? So many: \" + howMany);\n}", "title": "" }, { "docid": "c5d6c015146094637c46071453fed6a8", "score": "0.65664077", "text": "function calculateLetterFrequency (s) {\n var counts = {}\n s.toUpperCase().split('').map(function (c) {\n if (!(c in counts)) {\n counts[c] = 1\n } else {\n counts[c] += 1\n }\n })\n return Object.keys(counts).map(function (k) {\n return { letter: k, frequency: counts[k] }\n })\n}", "title": "" }, { "docid": "44c1c795a70f87b7c4d380e008cf508d", "score": "0.65301824", "text": "function LetterCountI(str) {\n var arr = str.split(' ');\n var res = -1;\n var longest = 1;\n for(var i = 0; i<arr.length; i++) {\n if (GetWordRepeatCount(arr[i]) > longest) {\n res = arr[i];\n longest = GetWordRepeatCount(arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "7ffb501c68b091cce6f086001c34a2db", "score": "0.65256727", "text": "function lowercaseCount(str){\n return (str.match(/[a-z]/g) || []).length\n}", "title": "" }, { "docid": "5ba64fff9eedb701ff946a2b2037ad36", "score": "0.65156806", "text": "function charCount(str) {\n\t// Make an object return at the end\n\tvar count = {};\n\t// Loop over string, for each character...\n\tfor (var i = 0 ; i < str.length; i++) {\n\t\tvar char = str[i].toLowerCase();\n\t\tif (/[a-z0-9]/.test(char)) {\n\t\t\t// If character is a number/letter and is a key in object, add one to count\n\t\t\tif (count[char] > 0) {\n\t\t\t\tcount[char]++;\n\t\t\t// \tIf character is a number/letter and is not in object, add it to object and set value to 1\n\t\t\t} else {\n\t\t\t\tcount[char] = 1;\n\t\t\t};\n\t\t}\n\t}\t\n\treturn count;\n}", "title": "" }, { "docid": "7e094fd4ca97c340c6959cf2d9e1e2e3", "score": "0.6509788", "text": "function countBs(subject)\n{\n return countChar(subject, \"B\");\n}", "title": "" }, { "docid": "cbb8f980db74ccc42fc7d06d9e1d2fbc", "score": "0.6504434", "text": "function count(text, char) {\n let c = 0;\n for (let i = 0; i < text.length; i++) { // Iterate through string\n if (text[i] === char)\n c++; // Increment count if found\n }\n return c; // Return count\n}", "title": "" }, { "docid": "b1fb68bddb9adb65d6307778680482cc", "score": "0.65021676", "text": "function countBs(myString){\r\n return countChar(myString, \"B\");\r\n}", "title": "" }, { "docid": "f2852ccd9a5233d6e2d6d1cb26ca2808", "score": "0.64934903", "text": "function LetterCountI(str) { \narr1 = str.replace(/[^a-zA-Z ]/g, '').split(' ') \narr = str.toLowerCase().replace(/[^a-zA-Z ]/g, '').split(' ')\nvar longest = 0\nvar count = 0\n\n for (var i=0 ; i<arr.length ; i++) {\n var arr2 = arr[i].split('').sort() \n\n for (var j=0 ; j<arr2.length ; j++) {\n \n if (arr2[j] === arr2[j+1]) {\n count = count + 1; \n if (count > longest) {output = arr1[i] ; longest = count}\n }\n \n else {count = 0} \n }\n }\n \nreturn output \n}", "title": "" }, { "docid": "9549d52788e39cdea81b2880cadb74ce", "score": "0.6483892", "text": "function numberOfLetters(string, m) {\n var letter = 0;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === m) {\n letter++;\n }\n }\n return letter;\n}", "title": "" }, { "docid": "be72d3c50aa33187851010d95223d6b2", "score": "0.6467927", "text": "function occurrencersLetter (string, letter) {\n var regex = new RegExp(letter, 'g')\n if (string.match(regex) === null) return 0\n return string.match(regex).length\n}", "title": "" }, { "docid": "803508774643c1d80d72c1041aaac9be", "score": "0.64675957", "text": "function charCount (str) {\n\n // make object to return at end\n var string = {};\n\n //loop over string, for each character...\n for (var i = 0; i < str.length; i++) {\n var char = str[i].toLowerCase()\n // if the char is a number/letter \n // AND is a key in the object, add 1 to\n // the count\n if (string[char] > 0) {\n string[char]++;\n // if the char is a number/letter \n // AND not in the object, add it \n // to the object and set value to 1\n } \n else {\n string[char] = 1;\n };\n }\n \n // if the char is something else, don't do \n // anything\n\n //return object at end\n return string;\n}", "title": "" }, { "docid": "516aace5c6473be4798ab3d463cad712", "score": "0.6464932", "text": "function solve(arr){ \n let alpha = \"abcdefghijklmnopqrstuvwxyz\";\n return arr.map(a => a.split(\"\").filter((b,i) => b.toLowerCase() === alpha[i]).length )\n}", "title": "" }, { "docid": "ab0e8a9739e850a606d620451a9e8c8e", "score": "0.6461528", "text": "function getCount(str) {\n return str.split(\"\").filter(letter => {\n return letter.match(/a|e|i|o|u/) !== null\n }).length;\n}", "title": "" }, { "docid": "d2bcf4582d08d5f474dcdf0372743eeb", "score": "0.6457437", "text": "function countA (target, font){\n\t\t\t\tconsole.log(target);\n\t\t\t\tlet kata = target.toLowerCase();\n\t\t\t\tlet Acount= 0;\n\t\t\t\tlet count= 0;\n\t\t\t\tlet pos = -1;\n\t\t\t\tlet sight = font.toLowerCase();\n\t\t\t\tconsole.log(count);\n\n\t\t\t\tif (wordlength==count){\n\t\t\t\t\tconsole.log(Acount);\n\t\t\t\t\treturn 'great success'\n\t\t\t\t} else {\n\t\t\t\t\twhile (count<=wordlength) {\n\t\t\t\t\t\tif (kata[pos+=1]==sight){\n\t\t\t\t\t\t\tAcount+=1\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount+=1;\n\t\t\t\t\t\tconsole.log('loopengine running')\n\n\t\t\t\t\t}\n\t\t\t\t\treturn `this word contain ${Acount} ${font} letters`;\n\t\t\t\t} \n\t\t\t}", "title": "" }, { "docid": "3416e8e7bde532f177df956b5efb587c", "score": "0.64567244", "text": "function howManyNumberAndLetter(words){\r\n // default behavior: count words in a list that are capitalized.\r\n // allCaps flag: count only words that are all caps in a list.\r\n var count = 0;\r\n words.forEach(function(w){\r\n if ( /[a-z]/ig.test(w) && /[0-9]/g.test(w) ) {\r\n count ++;\r\n }\r\n });\r\n return count;\r\n}", "title": "" }, { "docid": "af4c4157501bc575df0d82ee23ea0136", "score": "0.64461637", "text": "function countCharacter(str,chr) {\n var arr = str.split(\"\"); // split an array into substrings\n var charCount = 0;\n\n for (var i = 0; i < arr.length; i++) { // going through each substrings\n if (arr[i] === chr) { // since chr/a hits the right position\n charCount++; // start counting by how many hits before hit \"a\"\n }\n }\n return charCount;\n}", "title": "" }, { "docid": "4e9a30d50e227a8d5833fb9948d394d3", "score": "0.64445233", "text": "function countAll(str) {\n\tconst a = {\n\t\tLETTERS: 0,\n\t\tDIGITS: 0\n\t}\n\t\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str[i].match(/[A-Za-z]/)) {\n\t\t\ta.LETTERS += 1;\n\t\t} else if (str[i].match(/[0-9]/)) {\n\t\t\ta.DIGITS += 1;\n\t\t}\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "4e9a30d50e227a8d5833fb9948d394d3", "score": "0.64445233", "text": "function countAll(str) {\n\tconst a = {\n\t\tLETTERS: 0,\n\t\tDIGITS: 0\n\t}\n\t\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str[i].match(/[A-Za-z]/)) {\n\t\t\ta.LETTERS += 1;\n\t\t} else if (str[i].match(/[0-9]/)) {\n\t\t\ta.DIGITS += 1;\n\t\t}\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "4e9a30d50e227a8d5833fb9948d394d3", "score": "0.64445233", "text": "function countAll(str) {\n\tconst a = {\n\t\tLETTERS: 0,\n\t\tDIGITS: 0\n\t}\n\t\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str[i].match(/[A-Za-z]/)) {\n\t\t\ta.LETTERS += 1;\n\t\t} else if (str[i].match(/[0-9]/)) {\n\t\t\ta.DIGITS += 1;\n\t\t}\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "adb3378a94677987059d667fbceb0ac7", "score": "0.64430285", "text": "function countLettersAndDigits(input) {\n return (input.match(/\\d|[a-z]/gi) || []).length;\n}", "title": "" }, { "docid": "e1ea6b451b4da7280bb357c2a673b6a7", "score": "0.6428141", "text": "function countLetters(str) {\n let arr = str.split(\"\");\n let result = {};\n function countOccurrences(string, letter) {\n let counter = 0;\n for (let i = 0; i < string.length; i++) {\n if (string[i] === letter) {\n counter++;\n }\n }\n return counter;\n }\n for (let i = 0; i < arr.length; i++) {\n let currentChar = arr[i];\n // calling my object with bracket notation\n result[currentChar] = countOccurrences(str, currentChar); // the inner function\n }\n return result;\n}", "title": "" }, { "docid": "74ede235c96857e26d97224f376fe23d", "score": "0.6427244", "text": "function countChars(string) {\n let charCountArr = []\n let str = string\n str = str.toLowerCase()\n\n //count only english alphabet\n str = str.replace(/[^a-z]/gi, '')\n //sort in alphabetical order\n str = [...str].sort((a, b) => a.localeCompare(b))\n //count the characters\n for (let c of str) {\n if(charCountArr[c])\n charCountArr[c]++\n else\n charCountArr[c] = 1\n }\n\n //convert the array of key value pairs into an array of objects containing the counts\n const resultArr = []\n for (const property in charCountArr){\n let charFreq = {}\n charFreq[property] = charCountArr[property]\n resultArr.push(charFreq)\n }\n return resultArr\n}", "title": "" }, { "docid": "c43c54235424472806e2c67bf0213a2f", "score": "0.6417901", "text": "function newCharCount(str) {\n\tvar count = {};\n\tfor (var char of str) {\n\t\tchar = char.toLowerCase();\n\t\tif(/[a-z0-9]/.test(char)) {\n\t\t\tcount[char] > 0 ? count[char]++ : count[char] = 1;\n\t\t}\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "8e3acc434e2834d3cd2250ecc44bc7d0", "score": "0.64167416", "text": "function charCount(){}", "title": "" }, { "docid": "a75e6a28e0bfb0d210b123180a5170d6", "score": "0.64101607", "text": "function vowelsCounter(text) {\n let counter = 0;\n //Initialize the counter at 0\n\n for (let letter of text.toLowerCase()) {\n //Loop through text to test if each character\n if (vowels.includes(letter)) {\n //Checks if those charactgers include a vowel\n counter++;\n //If a vowel is found, then count +1\n }\n }\n\n return counter;\n //Return the number of total vowels in the text, and terminate the iteration.\n}", "title": "" }, { "docid": "abbc65988e454a9645272ad3ca5b2a20", "score": "0.6404748", "text": "function charactersOccurencesCount() {\n\n}", "title": "" }, { "docid": "339ea03e7d96ddb1297509e4b8ee77ee", "score": "0.64024985", "text": "function countCharacter(text) {\n if (typeof text !== 'string') {\n throw new Error('Invalid input');\n }\n let lookUp = {};\n for (let i = 0; i < text.length; i++) {\n lookUp[text[i]] = (lookUp[text[i]] || 0) + 1;\n }\n return lookUp;\n}", "title": "" }, { "docid": "c8d208a93e148d8c656f75b7d69f222e", "score": "0.6401477", "text": "function countChars(str, char) {\n let count = 0;\n for (let i = 0; i<str.length; i++)\n if(str[i] === char){\n count += 1;\n } return count;\n// =======\n// function countChars() {\n\n// >>>>>>> bd735a569053c2c0c27a35c062553d6e40aecf31\n}", "title": "" }, { "docid": "76aa9e16e5e3e2d0b56250b5ab604c25", "score": "0.6395597", "text": "function charCount(str) {\n // make object to return at end\n let result = {}\n // loop over string, for each character...\n for (let i = 0; i < str.length; i++) {\n // make lowercase\n let char = str[i].toLowerCase();\n // if the char is a #/letter AND is a key in obj, add 1 to count\n // if char is something else, (punctuation, space, etc.), do nothing\n if (/[a-z0-9]/.test(char)){\n if (result[char] > 0) {\n result[char]++;\n // if char is a #/letter AND is not in object, add it to the obj and set value to 1\n } else {\n result[char] = 1;\n }\n }\n }\n //return object at end\n return result;\n}", "title": "" }, { "docid": "045c7a3e3681cd1371814b8ebe4b7357", "score": "0.63843906", "text": "function findOccurences({letters, text}) {\n let result = new Map();\n\n letters.forEach(function (pLetter) {\n let pattern = new RegExp(pLetter, \"g\");\n let count = (text.match(pattern) || []).length;\n result.set(pLetter, count);\n });\n\n return result;\n}", "title": "" } ]
6eaa8fe606ea6dd5066d1f9b8c806fce
open database in memory
[ { "docid": "8ffeb4fe6d3a65b4929a8cae12e30a4d", "score": "0.7129209", "text": "function open(path) {\n return new Promise((resolve, reject) => {\n var db = new sqlite3.Database(path, sqlite3.OPEN_READONLY, (err) => {\n if (err) {\n reject(err);\n }\n });\n resolve(db);\n });\n}", "title": "" } ]
[ { "docid": "7af1a7f985dcfb59869a086dbae3a666", "score": "0.77569735", "text": "function openDb() {\n db = openDatabase(shortName, version, displayName, maxSize);\n}", "title": "" }, { "docid": "2baa6f1448cfa4b88544407572bd343d", "score": "0.75047684", "text": "open() {\n const fileToOpen = (this.databaseRestoreFilename) ? this.databaseRestoreFilename : this.databaseFilename;\n\n const filebuffer = fs.readFileSync(fileToOpen);\n\n\n // Load the db\n this.db = new SQL.Database(filebuffer);\n this.db.handleError = this.handleError;\n\n // save over the old file if we are restoring\n if (this.databaseRestoreFilename) {\n this.save();\n }\n }", "title": "" }, { "docid": "fe537f1edc5823175e434630fbedfcd4", "score": "0.72319907", "text": "function openDB(){\n db = window.openDatabase('bookDB', '1.0', 'bookDB', 1024 * 1024);\n console.log(\"Created Database.\");\n}", "title": "" }, { "docid": "bb3c69bec6759c5482d690137ff878dc", "score": "0.721556", "text": "static openDatabase() {\n return idb.open('photos-db', 2, (upgradeDb) => {\n\n if (!upgradeDb.objectStoreNames.contains('photos')) {\n upgradeDb.createObjectStore('photos', {keyPath: 'id'});\n }\n\n });\n }", "title": "" }, { "docid": "5f8e4be894af95058ebd2db6058ea175", "score": "0.71345466", "text": "function openDB()\n{\n db = openDatabaseSync(\"feedsDB\",\"1.0\",\"feeds Database\",1000000);\n createTable();\n}", "title": "" }, { "docid": "357028b09803d2cc44362e95abe4d5ea", "score": "0.70510083", "text": "function openDb() {\n return new Promise(function(resolve, reject) {\n try {\n // Create IPFS instance\n ipfs = new Ipfs(ipfsOptions)\n\n ipfs.on('ready', async () => {\n\n // Create OrbitDB instance\n const orbitdb = new OrbitDB(ipfs)\n\n const access = {\n // Give write access to everyone\n write: ['*'],\n }\n\n // Load the DB.\n db = await orbitdb.keyvalue('GBC', access)\n await db.load()\n\n console.log(`database string: ${db.address.toString()}`)\n console.log(`db public key: ${db.key.getPublic('hex')}`)\n\n // React when the database is updated.\n db.events.on('replicated', () => {\n console.log(`Databse replicated. Check for new prices.`)\n })\n\n return resolve(db);\n })\n\n } catch(err) {\n return reject(err);\n }\n })\n}", "title": "" }, { "docid": "27b6b4128c7252c5a7a537c0e11ab0c3", "score": "0.7004031", "text": "function openDb() {\n var dbName = \"com.solucs.mm_notes\";\n var dbVersion = \"1.0\";\n var dbDisplayName = \"MM Notes\";\n var dbSize = 1000000; // 1 MB\n return window.openDatabase(dbName, dbVersion, dbDisplayName, dbSize);\n }", "title": "" }, { "docid": "ec2512de67f8c842358e592c1da5b01c", "score": "0.70011896", "text": "async function openDB() {\n return sqlite.open({\n filename: './db.sqlite',\n driver: sqlite3.Database\n });\n}", "title": "" }, { "docid": "cbd067d8a449cf0f57f3a827d3d2933b", "score": "0.692284", "text": "function openDatabase(){\n return new Promise((resolve,reject) => {\n let db = new sqlite3.Database(path.join(__dirname, '../database/books'), (error) => {\n if(error){\n reject(error);\n }else {\n db.serialize(()=>{\n db.run('CREATE TABLE IF NOT EXISTS books(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, author TEXT NOT NULL, description TEXT)');\n });\n console.log('Connected to the database');\n resolve(db);\n }\n \n });\n \n });\n}", "title": "" }, { "docid": "03a3e555f8c0067d64c2260a0def9fce", "score": "0.6902663", "text": "static openDatabase() {\r\n return idb.open('restaurants', 3, function(upgradeDB) {\r\n switch(upgradeDB.oldVersion) {\r\n case 0:\r\n // placeholder\r\n case 1:\r\n console.log('Creating restaurants store');\r\n upgradeDB.createObjectStore('restaurants', {keyPath: 'id'});\r\n case 2:\r\n console.log('Creating reviews store');\r\n upgradeDB.createObjectStore('reviews', {\r\n keyPath: 'id',\r\n autoIncrement: true\r\n });\r\n case 3:\r\n console.log('Creating temporary reviews store');\r\n upgradeDB.createObjectStore('tempReviews', {\r\n keyPath: 'id',\r\n autoIncrement: true\r\n });\r\n }\r\n });\r\n }", "title": "" }, { "docid": "daac926b438d202fd82ff331107b8a41", "score": "0.6882876", "text": "function openDatabase(callback) {\n const db = new sqlite3.Database(dbfile, sqlite3.OPEN_READWRITE, function (err) {\n if (err) {\n if (err.code === SQLITE_CANTOPEN) {\n callback(null, null)\n } else {\n callback(err)\n }\n } else {\n log.info(`Opened database '${dbfile}'`)\n callback(null, dbwrapper(db))\n }\n })\n}", "title": "" }, { "docid": "340cab0bed197a8c37ff5627bee76e86", "score": "0.68633604", "text": "function readDatabase() {return}", "title": "" }, { "docid": "14e2b38672ddf7f3e5ea3eabd121bac2", "score": "0.68579465", "text": "async function openDB(dbName) {\n let request = await openRequest(dbName);\n request.addEventListener(\"upgradeneeded\", (e) => {\n // NOTE:- this should be abstracted later for better reuseablity\n // for a new version create default lists automatially\n if (e.oldVersion == 0) {\n defaultLists.forEach((objStore) => {\n request.result.createObjectStore(objStore, objectType).add({\n completed: false,\n name: `this is an example of ${objStore}`,\n });\n });\n }\n });\n return new Promise((resolve, reject) => {\n request.onsuccess = async () => {\n resolve(request.result);\n };\n request.onerror = (e) => {\n requestErr(e);\n reject(\"Some Error in request\");\n };\n });\n}", "title": "" }, { "docid": "ed14e2f07aa0fae9809f488c2aadf062", "score": "0.68396676", "text": "openSqliteDb() {\n return new Promise( (resolve, reject) => {\n let sqlitePath = this.sqlitePath;\n let sqlitedb = new sqlite3.Database(sqlitePath, sqlite3.OPEN_READONLY, (err) => {\n if(err) {\n reject(err);\n }\n else {\n this.sqlitedb = sqlitedb;\n resolve();\n }\n });\n });\n }", "title": "" }, { "docid": "f6846307a7a3038b7b20cd8f0d1ccf18", "score": "0.68350834", "text": "static openDatabase() {\n // If the browser doesn't support service worker,\n // we don't care about having a database\n if (!navigator.serviceWorker) {\n return Promise.resolve();\n }\n\n return idb.open('restaurants-review', 1, function(upgradeDb) {\n let restaurantsStore;\n let reviewsStore;\n let reviewsOfflineStore;\n let favoritesRestaurantsOfflineStore;\n switch(upgradeDb.oldVersion) {\n\t\tcase 0:\n restaurantsStore = upgradeDb.createObjectStore('restaurants', {keyPath: 'id', autoIncrement: true});\n case 1:\n reviewsStore = upgradeDb.createObjectStore('reviews', {keyPath: 'id', autoIncrement: true});\n reviewsStore.createIndex('restaurant_id','restaurant_id',{ unique: false });\n case 2: \n reviewsOfflineStore = upgradeDb.createObjectStore('reviews-offline', {keyPath: 'id', autoIncrement: true});\n case 3: \n favoritesRestaurantsOfflineStore = upgradeDb.createObjectStore('favorites-restaurants-offline', {keyPath: 'id'});\n }\n });\n }", "title": "" }, { "docid": "52ed775fb3ec37856d97809276cc852a", "score": "0.68149894", "text": "open(cb) {\n\t\treturn this.dbConnection.open(this.URI, cb);\n\t}", "title": "" }, { "docid": "f40ba4f8931cc5c987f3cf0c9edd8332", "score": "0.6708713", "text": "function openDatabase() {\n return new Promise((resolve, reject) => {\n let openReq = indexedDB.open('Ejemplo', 1); //OJO CON LA VERSIÓN!!!!\n openReq.addEventListener('upgradeneeded', e => { //No estamos en la versión.\n let db = e.target.result;\n if (!db.objectStoreNames.contains('products')) { // No existe \"productos\"\n //Creamos el almacén de datos:\n db.createObjectStore('products', { autoIncrement: true, keyPath: 'id' });\n }\n //resolve(db); //No hace falta ponerlo!!!\n });\n openReq.addEventListener('success', e => { // OK!\n resolve(e.target.result); // Devolvemos la base de datos.\n });\n openReq.addEventListener('error', e => reject('Error al abrir'));\n openReq.addEventListener('blocked', e => reject('BD ya en uso'));\n }); }", "title": "" }, { "docid": "18bc55f6671157e29c3a9d6aa9d0e804", "score": "0.668005", "text": "function openDb() {\n return new Promise(function(resolve, reject) {\n try {\n // Create IPFS instance\n ipfs = new IPFS(ipfsOptions)\n\n ipfs.on('ready', async () => {\n //ipfs.swarm.connect('/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star');\n ipfs.swarm.connect('/ip4/198.46.197.197/tcp/4001/ipfs/QmdXiwDtfKsfnZ6RwEcovoWsdpyEybmmRpVDXmpm5cpk2s'); // Connect to ipfs.p2pvps.net\n\n // Create OrbitDB instance\n const orbitdb = new OrbitDB(ipfs)\n\n const access = {\n // Give write access to everyone\n write: ['*'],\n }\n\n // Load the DB.\n db = await orbitdb.keyvalue('orderbook01', access)\n await db.load()\n\n console.log(`database string: ${db.address.toString()}`)\n console.log(`db public key: ${db.key.getPublic('hex')}`)\n\n // React when the database is updated.\n db.events.on('replicated', () => {\n console.log(`Databse replicated. Check for new prices.`)\n })\n\n return resolve(db);\n })\n\n } catch(err) {\n return reject(err);\n }\n })\n}", "title": "" }, { "docid": "c50275f7796b619ad9b0ec0ad081611b", "score": "0.6636024", "text": "async open() {\n if (this._db.isOpen()) {\n throw new errors_1.DexieError(`Attempt to call DexieDb.open() failed because the database is already open!`, `dexie/db-already-open`);\n }\n if (!this.isMapped) {\n this.mapModels();\n }\n return this._db.open();\n }", "title": "" }, { "docid": "7d6738a60d7c7d6911098a9d7d7db6eb", "score": "0.6634534", "text": "function openDb() {\n return new Promise(function (resolve, reject) {\n var MongoClient = require('mongodb').MongoClient;\n MongoClient.connect(dbConnectionString, function (err, db) {\n if (err) return reject(err);\n resolve(db);\n })\n });\n }", "title": "" }, { "docid": "11c8f07689c062d68507aae68094b262", "score": "0.6576198", "text": "static openRestaurantDB() {\r\n if (!navigator.serviceWorker) {\r\n return Promise.resolve();\r\n }\r\n return idb.open('restaurantDB', 1, function(upgradeDb) {\r\n const restaurantStore = upgradeDb.createObjectStore('restaurants', {\r\n keyPath: 'id'\r\n });\r\n });\r\n }", "title": "" }, { "docid": "5eb70a4513a14978ef1b95290bebd767", "score": "0.649752", "text": "function openDB(config) {\n const { name, version, upgrade } = config;\n\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(name, version);\n\n request.onerror = () => reject(request.errorCode);\n request.onsuccess = () => resolve(request.result);\n\n if (upgrade) {\n request.onupgradeneeded = () => upgrade(request.result);\n }\n })\n .then(dbRef => {\n db = dbRef;\n\n return Promise.resolve(`opened ${name}, version ${version}`);\n })\n .catch(console.error);\n }", "title": "" }, { "docid": "cc084e0c2fd88c29c45e37db10813e7b", "score": "0.647273", "text": "async function getDB() {\n let db = await Database.open('Zelp.db');\n await db.run('PRAGMA foreign_keys=on');\n\n const SQLiteFormat = (q) => q.replace(/\\$[0-9]+/gi,'?');\n\n return {\n table : (query,values) => db.run(SQLiteFormat(query),values),\n run : (query,values) => db.run(SQLiteFormat(query),values),\n get : (query,values) => db.get(SQLiteFormat(query),values),\n all : (query,values) => db.all(SQLiteFormat(query),values),\n close : () => db.close()\n };\n}", "title": "" }, { "docid": "4a8ea502a9fe2ee29700ba620661f590", "score": "0.6423981", "text": "static initializeDB() {\n const dbPromise = idb.open('commit-step', 2, upgradeDb =>{\n switch(upgradeDb.oldVersion){\n case 0:\n let store = upgradeDb.createObjectStore('username');\n store.put(365, 'stepUp');\n store.put(0, 'stepRight');\n case 1:\n store = upgradeDb.createObjectStore('commits');\n store.put(0, 'counter');\n }\n });\n return dbPromise;\n }", "title": "" }, { "docid": "1998d0d14d716301fade5f9c6be75da8", "score": "0.64049065", "text": "function openConnectionTo(file) {\n const CURRENT_VERSION = 3;\n\n let connection = connections.get(file.path);\n if (!connection) {\n connection = Services.storage.openDatabase(file);\n let fileVersion = connection.schemaVersion;\n\n // If we're upgrading the version, first create a backup.\n if (fileVersion > 0 && fileVersion < CURRENT_VERSION) {\n let backupFile = file.clone();\n backupFile.leafName = backupFile.leafName.replace(\n /\\.sqlite$/,\n `.v${fileVersion}.sqlite`\n );\n backupFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);\n\n log.warn(`Backing up ${file.leafName} to ${backupFile.leafName}`);\n file.copyTo(null, backupFile.leafName);\n }\n\n switch (fileVersion) {\n case 0:\n connection.executeSimpleSQL(\"PRAGMA journal_mode=WAL\");\n connection.executeSimpleSQL(\n \"CREATE TABLE properties (card TEXT, name TEXT, value TEXT)\"\n );\n connection.executeSimpleSQL(\n \"CREATE TABLE lists (uid TEXT PRIMARY KEY, name TEXT, nickName TEXT, description TEXT)\"\n );\n connection.executeSimpleSQL(\n \"CREATE TABLE list_cards (list TEXT, card TEXT, PRIMARY KEY(list, card))\"\n );\n // Falls through.\n case 1:\n connection.executeSimpleSQL(\n \"CREATE INDEX properties_card ON properties(card)\"\n );\n connection.executeSimpleSQL(\n \"CREATE INDEX properties_name ON properties(name)\"\n );\n // Falls through.\n case 2:\n connection.executeSimpleSQL(\"DROP TABLE IF EXISTS cards\");\n // The lists table may have a localId column we no longer use, but\n // since SQLite can't drop columns it's not worth effort to remove it.\n connection.schemaVersion = CURRENT_VERSION;\n break;\n }\n connections.set(file.path, connection);\n }\n return connection;\n}", "title": "" }, { "docid": "c887eb9ce72f35fa9702f2aaaaa1ed3e", "score": "0.64028835", "text": "openDatabase() {\r\n if (!('indexedDB' in window)) {\r\n console.log('This browser doesn\\'t support IndexedDB');\r\n return Promise.resolve();\r\n }\r\n \r\n return idb.open('currencyConverter', 4, upgradeDb => {\r\n switch(upgradeDb.oldVersion) {\r\n case 0:\r\n upgradeDb.createObjectStore('currencies');\r\n case 2:\r\n upgradeDb.transaction.objectStore('currencies').createIndex('id', 'id', {unique: true});\r\n case 3:\r\n upgradeDb.createObjectStore('currencyRates', {keyPath: 'query'});\r\n upgradeDb.transaction.objectStore('currencyRates').createIndex('query', 'query', {unique: true});\r\n }\r\n });\r\n }", "title": "" }, { "docid": "d1a56780b58cc698b90d00641b964a95", "score": "0.6399327", "text": "async open(db = null) {\n\t\tconst self = this;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (self.connected) {\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\tif (db) {\n\t\t\t\t\tself.db = db;\n\t\t\t\t\tthis.connected = true;\n\t\t\t\t\tthis.primeCollections();\n\t\t\t\t\tresolve();\n\t\t\t\t} else {\n\t\t\t\t\tLog.db.verbose(\"Connecting to mongo...\");\n\t\t\t\t\tconst client = new MongoClient(mongoUrl);\n\t\t\t\t\tclient.connect(function(err) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tLog.db.verbose(\"Connected!\");\n\t\t\t\t\t\tself.db = client.db(dbName);\n\t\t\t\t\t\tself.connected = true;\n\n\t\t\t\t\t\tself.primeCollections();\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f1aa815564a0d3bf69d2e80b20093018", "score": "0.6365482", "text": "function getDatabase() {\n return LocalStorage.openDatabaseSync(\"weatherrecorder_db\", \"1.0\", \"StorageDatabase\", 1000000);\n}", "title": "" }, { "docid": "5291255a0cf113e16d2861480b1cbc43", "score": "0.63529086", "text": "function openDatabase(testCase, version) {\n return openNamedDatabase(testCase, databaseName(testCase), version);\n}", "title": "" }, { "docid": "c2d475084c2e7634601b864cbbc0c942", "score": "0.63318264", "text": "static dbPromise() { \n return idb.open('udacity-restaurant', 2, upgradeDB => {\n switch (upgradeDB.oldVersion) {\n case 0 :\n upgradeDB.createObjectStore('restaurants', {keyPath: 'id'});\n case 1 :\n const reviewsStore = upgradeDB.createObjectStore('reviews', {keyPath:'id'});\n reviewsStore.createIndex('restaurant', 'restaurant_id');\n }\n });\n }", "title": "" }, { "docid": "acc5d6b8cb0144ff606e50cbbd50f993", "score": "0.62986803", "text": "function makeDatabase(){\n TVRSdata = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024);\n //alert(\"created database?\");\n TVRSdata.transaction(createDB, errorCB);\n}", "title": "" }, { "docid": "7616c8e4bc8e64afe5fc70e283d04ca2", "score": "0.62891525", "text": "function db_open(db_file, create_new) {\n // Check if the db_file argument is string\n if(typeof db_file !== \"string\") {\n ERROR(\"usage db_open(db_file_path, create_new_flag)\");\n return false;\n }\n\n // Confirm That we are not the openning the databse twice.\n if (typeof db === \"undefined\") {\n repository = db_file || null;\n if (fs.existsSync(repository)) {\n db = new sqlite3.Database(repository);\n return true;\n } else if (create_new) {\n // If the create_new is set then we will try to create\n // the database file as it does not exists.\n db = new sqlite3.Database(repository, sqlite3.OPEN_CREATE | sqlite3.OPEN_READWRITE);\n return true;\n } else {\n ERROR(\"db file '%s' does not exists\", db_file);\n }\n return false;\n }\n\n ERROR(\"Trying to open DB file twice\");\n return false;\n}", "title": "" }, { "docid": "1070e1f2492a0c060248d937a7b3b50e", "score": "0.6277377", "text": "function openDatabaseWithOpts(opts) {\n\t return opts.websql(opts.name, opts.version, opts.description, opts.size);\n\t}", "title": "" }, { "docid": "90d36dfd14dccdf3508c52c0b8b75cd7", "score": "0.62604046", "text": "async getDb() {\n if (!this._db) {\n this._db = await openDB(DB_NAME, 1, {\n upgrade: this._upgradeDbAndDeleteOldDbs.bind(this)\n });\n }\n\n return this._db;\n }", "title": "" }, { "docid": "6797c739f79cb037c6d603e4ca737053", "score": "0.6225917", "text": "function processOpenDatabase(err, db) {\r\n if (err) {\r\n throw err;\r\n }\r\n\r\n if (config.options.console) console.log('Database connected');\r\n\r\n connectionData.mainConn = db;\r\n\r\n //Check if admin features are on\r\n if (config.mongodb.admin === true) {\r\n setupAdminModeDatabases(db);\r\n } else {\r\n //Regular user authentication\r\n if (typeof config.mongodb.auth === 'undefined' || config.mongodb.auth.length === 0 || !config.mongodb.auth[0].database) {\r\n // no auth list specified so use the database from the connection string\r\n setupDefaultDatabase(db);\r\n } else {\r\n setupAuthDatabases(db);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a25106611e68c36b5416c5438daf0e39", "score": "0.62018317", "text": "function accesoBD() {\n\tvar bd = window.openDatabase('Hotel', '1.0', 'Hotel', 2000000);\n\treturn bd;\n}", "title": "" }, { "docid": "8ab9602f48ab3131ac7df2b53b4f9e09", "score": "0.62003994", "text": "function createDb() {\n console.log(\"createDb chain\");\n db = new sqlite3.Database('encoder.db');\n }", "title": "" }, { "docid": "e9fee72e68f1205bf2cfddbc43dbd70b", "score": "0.6175193", "text": "function dbCreate() {\n try{\n /*** Creates a 2mb database ***/\n //db = window.openDatabase(\"Database\", \"1.0\", \"In-flight\", 5 * 1024 * 1024);\n //db.transaction(createDB, dbErrorHandler, successDB)\n\n var createDB = function () { };\n var successDB = function () { };\n }\n catch (err) {\n ex.log(err, this.Name + \".dbCreate()\");\n }\n }", "title": "" }, { "docid": "80173b99c27d4a3d5d98f8c93af98e5a", "score": "0.6173804", "text": "async getIdb() {\n if (this.indexedDB.idb) {\n return this.indexedDB.idb\n }\n this.indexedDB.idb = await openDB('artemis', this.indexedDB.version, {\n upgrade(db) {\n db.createObjectStore('artemis', {\n keyPath: ['id', 'name']\n })\n db.createObjectStore('artemis-owned', {\n keyPath: 'id'\n })\n }\n })\n return this.indexedDB.idb\n }", "title": "" }, { "docid": "b5b2a5d70399c1703c9945ee0b9c8300", "score": "0.61734605", "text": "function open(filePath, useInMemory = true) {\n // check the parameter\n if (!useInMemory && !filePath) {\n throw new Error(FilePathIsUndefinedException);\n }\n\n // create a low db instance\n const adapter = useInMemory ? new Memory() : new FileSync(filePath);\n return low(adapter);\n}", "title": "" }, { "docid": "f221c745b13a8b139b2a4ef6777ca64d", "score": "0.6164681", "text": "function OpenChatDB( create ){\n let FLAG = sqlite3.OPEN_READWRITE;\n if ( create ) {\n FLAG |= sqlite3.OPEN_CREATE\n }\n let db = new sqlite3.Database(DB_PATH, FLAG, err => {\n if(err) return console.log(`Creating database, ${DB_PATH}, failed: ${err.message}`)\n if(create){\n console.log('Created ' + DB_PATH + ' database!')\n }\n else\n console.log('Connected to ' + DB_PATH + ' database')\n db.run('CREATE TABLE IF NOT EXISTS chatbot(name TEXT NOT NULL UNIQUE, hand INT NOT NULL)',\n err => {\n if(err) return console.error('failed to create chabot table: ' +err.message)\n console.log('successfully opened chatbot table!')\n })\n })\n return db\n}", "title": "" }, { "docid": "75f0d4af14a17af4af18153121f0c922", "score": "0.6150308", "text": "loadDatabase() {\n fetcher.API(this.url + 'ztore/', \"GET\")\n .then(items => {\n model.persistLocal(items, this.ztoreDb);\n view.loadItems(items)\n });\n }", "title": "" }, { "docid": "0ee6a888281660c8939660d641abedad", "score": "0.60906565", "text": "async getDB () {\n if (this.db) {\n return this.db;\n }\n\n // If the sim doesn't have a keychains directory, create one\n let keychainsPath = path.resolve(this.sharedResourceDir, 'Library', 'Keychains');\n if (!(await fs.exists(keychainsPath))) {\n await mkdirp(keychainsPath);\n }\n\n // Open sqlite database\n this.db = path.resolve(keychainsPath, 'TrustStore.sqlite3');\n\n // If it doesn't have a tsettings table, create one\n await execSQLiteQuery(this.db, `CREATE TABLE IF NOT EXISTS tsettings (sha1 BLOB NOT NULL DEFAULT '', subj BLOB NOT NULL DEFAULT '', tset BLOB, data BLOB, PRIMARY KEY(sha1));`);\n try {\n await execSQLiteQuery(this.db, 'CREATE INDEX isubj ON tsettings(subj);');\n } catch (e) { }\n\n\n return this.db;\n }", "title": "" }, { "docid": "be7576091a5b89bba2cefe99f172ed5b", "score": "0.60873085", "text": "function openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}", "title": "" }, { "docid": "be7576091a5b89bba2cefe99f172ed5b", "score": "0.60873085", "text": "function openDatabaseWithOpts(opts) {\n return opts.websql(opts.name, opts.version, opts.description, opts.size);\n}", "title": "" }, { "docid": "46835d7985b3a77222c0686a340ca448", "score": "0.6080492", "text": "function iDBStorage(name) {\r\n\t\tthis.storename = name;\r\n\t\texports.whenready = this.ready = new Promise((resolve, reject) => {\r\n\t\t\tvar request = window.indexedDB.open(location.origin);\r\n\t\t\trequest.onupgradeneeded = e => {\r\n\t\t\t\tthis.db = e.target.result;\r\n\t\t\t\tthis.db.createObjectStore(this.storename);\r\n\t\t\t};\r\n\t\t\trequest.onsuccess = e => {this.db = e.target.result; resolve()};\r\n\t\t\trequest.onerror = e => {this.db = e.target.result; reject(e)};\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "c23d55b6fc2fc652d02c5559942767c2", "score": "0.6079141", "text": "function openDatabase(url) {\n mongoose.Promise = global.Promise;\n mongoose.connect(url);\n\n return mongoose.connection;\n}", "title": "" }, { "docid": "0a8e0208ec2fffcd1d9b7888ae169c1a", "score": "0.6062952", "text": "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text)\");\n resolve(database);\n });\n });\n}", "title": "" }, { "docid": "54c043077cc472918cd90cad841c547e", "score": "0.6059388", "text": "function openConnection() {\n pool.connect()\n console.log(\"Database connection opened\")\n}", "title": "" }, { "docid": "18fdc3992dc8d34eba03effb09c8edc3", "score": "0.6034447", "text": "close() {\n if (this._db) this._db.close();\n }", "title": "" }, { "docid": "439289c314973805aad37cbe01834041", "score": "0.60242826", "text": "function mongo_open (data) {\n\tvar server, dbname;\n\t\n\t// Server name and database name\n\tserver = cfg.mongoHost() + ':' + cfg.mongoPort();\n\tdbname = data.database;\n\t\n\t// Open the database\n\tmongo.connect('mongodb://' + server + '/' + dbname, function(err, dbref) {\n\t\t// Check connection to database was successful\n\t\tif(err) {\n\t\t\tcommon.logAction('MON001', [dbname, server, err]);\n\t\t\treturn;\n\t\t}\n\t\tcommon.logAction('MON002', [dbname, server]);\n\t\t\n\t\t// Once connected to database, write data sent by probe\n\t\tmongo_write(dbref, data);\n\t});\n}", "title": "" }, { "docid": "807f0620bc3e4ed25209328accbbd1c9", "score": "0.60127497", "text": "function validate_openDatabase(callback) {\n try {\n callback(null, window.openDatabase('mDesign', '', 'mDesign', 1048576));\n } catch (error) {\n callback(error);\n }\n }", "title": "" }, { "docid": "449cd719f9930d7cae550d1e043c86b2", "score": "0.6005968", "text": "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [description] text, [on_notice_to] text, [address] text, [info_url] text, [comment_url] text, [date_scraped] text)\");\n resolve(database);\n });\n });\n}", "title": "" }, { "docid": "9b8813f1642d7ad42cde8fddbc951da1", "score": "0.59895295", "text": "function readDatabasesDesktop() {\n\tvar db = window.openDatabase(\"Database\", \"1.0\", \"PhoneGap Demo\", 2000000);\n\tgetJson();\n\tdb.transaction(queryDBDesktop, errorRead);\n}", "title": "" }, { "docid": "f7e074cd36bdbef3b7891e6cae538c3e", "score": "0.59689337", "text": "function open(){\r\n\r\n // Connection URL. This is where your mongodb server is running.\r\n \r\n return new Promise((resolve, reject)=>{\r\n // Use connect method to connect to the Server\r\n MongoClient.connect(url, (err, db) => {\r\n if (err) {\r\n reject(err);\r\n } else {\r\n resolve(db);\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "4413ed30c3071927d0d06006b5b8c3dc", "score": "0.59272045", "text": "function activateDbLinking() {\n\tvar allApplication = __dirname+'/public/application/';\n\tvar __file = '/db/application.db';\n\t\n\tfs.readdir(allApplication, function(err, files) {\n\t\tif (err) return;\n\t\tfiles.forEach(function(f) {\n\t\t\t/* console.log('directory ' + f); */\n\t\t\t//Attivo i becessari se esistono all'interno della struttura nella cartella db/\n\t\t\tvar exists = false;\n\t\t\tvar __database = allApplication+f+__file;\n\t\t\tfs.readdir(allApplication+f+__database, function(err, files) {\n\t\t\t\t/* console.log('database '+__database); */\n\t\t\t\texists = fs.existsSync( __database );\n\t\t\t\t/* console.log(exists); */\n\t\t\t\tif( !exists ) {\n\t\t\t\t\tconsole.log('Creazione db sqlite3 '+__database);\n\t\t\t\t\tfs.openSync(__database, 'w' );\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "4759bce2acb7dd77d12b1c03403cd10d", "score": "0.5915641", "text": "isOpen() {\n return this._db.isOpen();\n }", "title": "" }, { "docid": "bf1173f4dcbcebb195b52e740aef1a6c", "score": "0.58976877", "text": "function getOpenDatabase() {\n\ttry {\n\t\tif (!! window.openDatabase) return window.openDatabase;\n\t\telse return undefined;\n\t}\n\tcatch(e) {\n\t\treturn undefined;\n\t}\n}", "title": "" }, { "docid": "ae1923ba6ed79241fecf5b1fe31e5aa8", "score": "0.5888224", "text": "function readDatabasesLaptop() {\n\tvar db = window.openDatabase(\"Database\", \"1.0\", \"PhoneGap Demo\", 2000000);\n\tgetJson();\n\tdb.transaction(queryDBLaptop, errorRead);\n}", "title": "" }, { "docid": "9069ea04a649cbda392cf9d68c385d08", "score": "0.5883617", "text": "function runDataBase() {\n fs.writeFile(\"db/db.json\", JSON.stringify(noteInformation, '\\t'), err => {\n if (err) throw err;\n return true;\n });\n }", "title": "" }, { "docid": "8f84a1dc41f957e5d3debc69431aa0d4", "score": "0.58808", "text": "constructor(dbName, dbVersion, dbDescription = '', dbSize = this.defaultSize, callback) {\n dbName && this.openDatabase(dbName, dbVersion, dbDescription, dbSize, callback)\n }", "title": "" }, { "docid": "7400077ba2284550bd24d87d504f796f", "score": "0.585657", "text": "function openNamedDatabase(testCase, databaseName, version) {\n const request = indexedDB.open(databaseName, version);\n const eventWatcher = requestWatcher(testCase, request);\n return eventWatcher.wait_for('success').then(event => event.target.result);\n}", "title": "" }, { "docid": "ddca2f2bf6d429cb02070ef2d3f181aa", "score": "0.5854936", "text": "open(obj) {\n\t\tif (!obj._db) {\n\t\t\tthrow new Error('Missing _db field');\n\t\t}\n\n\t\tif (obj._db.latest_state) {\n\t\t\t/* already open */\n\t\t\treturn obj;\n\t\t}\n\n\t\t/* we'll need two states:\n\t\t * - the latest one to detect changes\n\t\t * between any two commits() (which are cassed to the callback)\n\t\t * - the generation initial one to detect when fields are changed\n\t\t * back and forth and shouldn't be included in the changelog\n\t\t */\n\t\tobj._db.latest_state = DB.clone_obj(obj);\n\t\tobj._db.initial_gen_state = DB.clone_obj(obj);\n\n\t\t/* first time open */\n\t\tif (!obj._db.changesets) {\n\t\t\t/* first changeset is always the full, original object */\n\t\t\tlet org_obj = DB.clone_obj(obj);\n\t\t\torg_obj._db = { type: obj._db.type, obj: obj, generation: 0 };\n\t\t\tobj._db.changesets = [ org_obj ];\n\t\t}\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "3940edf0640bde7130d71ccd8d14a79f", "score": "0.58472043", "text": "function _initStorage(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] = options[i];\n\t }\n\t }\n\n\t // Initialize a singleton container for all running localForages.\n\t if (!dbContexts) {\n\t dbContexts = {};\n\t }\n\n\t // Get the current context of the database;\n\t var dbContext = dbContexts[dbInfo.name];\n\n\t // ...or create a new context.\n\t if (!dbContext) {\n\t dbContext = {\n\t // Running localForages sharing a database.\n\t forages: [],\n\t // Shared database.\n\t db: null\n\t };\n\t // Register the new context in the global container.\n\t dbContexts[dbInfo.name] = dbContext;\n\t }\n\n\t // Register itself as a running localForage in the current context.\n\t dbContext.forages.push(this);\n\n\t // Create an array of readiness of the related localForages.\n\t var readyPromises = [];\n\n\t function ignoreErrors() {\n\t // Don't handle errors here,\n\t // just makes sure related localForages aren't pending.\n\t return Promise.resolve();\n\t }\n\n\t for (var j = 0; j < dbContext.forages.length; j++) {\n\t var forage = dbContext.forages[j];\n\t if (forage !== this) {\n\t // Don't wait for itself...\n\t readyPromises.push(forage.ready()['catch'](ignoreErrors));\n\t }\n\t }\n\n\t // Take a snapshot of the related localForages.\n\t var forages = dbContext.forages.slice(0);\n\n\t // Initialize the connection process only when\n\t // all the related localForages aren't pending.\n\t return Promise.all(readyPromises).then(function () {\n\t dbInfo.db = dbContext.db;\n\t // Get the connection or open a new one without upgrade.\n\t return _getOriginalConnection(dbInfo);\n\t }).then(function (db) {\n\t dbInfo.db = db;\n\t if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n\t // Reopen the database for upgrading.\n\t return _getUpgradedConnection(dbInfo);\n\t }\n\t return db;\n\t }).then(function (db) {\n\t dbInfo.db = dbContext.db = db;\n\t self._dbInfo = dbInfo;\n\t // Share the final connection amongst related localForages.\n\t for (var k in forages) {\n\t var forage = forages[k];\n\t if (forage !== self) {\n\t // Self is already up-to-date.\n\t forage._dbInfo.db = dbInfo.db;\n\t forage._dbInfo.version = dbInfo.version;\n\t }\n\t }\n\t });\n\t }", "title": "" }, { "docid": "8452abc4939ad80d289de275afdfaa14", "score": "0.5846426", "text": "loadDB() {\n\n if( !fs.existsSync( this.dbPath ) ) return;\n\n // cargar la informacion\n const info = fs.readFileSync( this.dbPath, {encoding: 'utf-8'});\n \n // parseo de datos a JSON\n const data = JSON.parse( info );\n\n this.historial = data.historial;\n }", "title": "" }, { "docid": "7b5239533ef82ba5dd31f7b76024bac5", "score": "0.5843407", "text": "async dbConnect() {\n\n State.DB = State.DB || await new IndexedDB(\n State.dbName,\n State.dbVersion,\n (db, oldVersion, newVersion) => {\n\n // upgrade database\n switch (oldVersion) {\n case 0: {\n db.createObjectStore( State.storeName );\n }\n }\n\n });\n\n return State.DB;\n\n }", "title": "" }, { "docid": "31cd7e31992d947700080b00ea5069fa", "score": "0.5829956", "text": "async function createConnection(){\n const adapter = new FileAsync('db.json'); //db.json asi vamos a llamar al archivo donde se guardaran los datos. En la variable adapter guardamos el objeto que devuelve el new.\n db = await low(adapter);//le paso el objeto o el adapter al lowdb.\n db.defaults({tasks:[]}).write(); // defaults podríamos pensarlo como las tablas que tendriamos en la BD. En mi caso quiero una propiedad 'task' que va a ser un arreglo. Para que se cree le doy el método write().\n}", "title": "" }, { "docid": "8bbe76ad6c8664d13f1ecca41da12307", "score": "0.5820113", "text": "function readDatabasesAir() {\n\tvar db = window.openDatabase(\"Database\", \"1.0\", \"PhoneGap Demo\", 2000000);\n\tgetJson();\n\tdb.transaction(queryDBAir, errorRead);\n}", "title": "" }, { "docid": "55ae5eb1720cb79cd9770ba7d51955fc", "score": "0.5819474", "text": "function _initStorage(options) {\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n return new Promise(function(resolve, reject) {\n var openreq = indexedDB.open(dbInfo.name, dbInfo.version);\n openreq.onerror = function() {\n reject(openreq.error);\n };\n openreq.onupgradeneeded = function() {\n // First time setup: create an empty object store\n openreq.result.createObjectStore(dbInfo.storeName);\n };\n openreq.onsuccess = function() {\n db = openreq.result;\n resolve();\n };\n });\n }", "title": "" }, { "docid": "583e6b8a1fdc67c9f6ec1d16a3e0d38d", "score": "0.5812346", "text": "function init() {\n const dbname = conf.comments || conf;\n const dbpath = path.resolve(process.cwd(), dbname);\n\n return Promise.resolve(db.open(dbpath, { Promise }))\n .then(db =>\n db.migrate({\n // force: process.env.NODE_ENV === 'development' ? 'last' : false\n force: false\n })\n )\n .then(db => db.driver) // @FIXME\n .catch(err => console.error(err));\n}", "title": "" }, { "docid": "492673b982560ba1b194894987e86825", "score": "0.5782645", "text": "function my_database(filename) {\n\t// Conncect to db by opening filename, create filename if it does not exist:\n\tvar db = new sqlite.Database(filename, (err) => {\n \t\tif (err) {\n\t\t\tconsole.error(err.message);\n \t\t}\n \t\tconsole.log('Connected to the phones database.');\n\t});\n\t// Create our phones table if it does not exist already:\n\tdb.serialize(() => {\n\t\tdb.run(`\n \tCREATE TABLE IF NOT EXISTS phones\n \t(id \tINTEGER PRIMARY KEY,\n \tbrand\tCHAR(100) NOT NULL,\n \tmodel \tCHAR(100) NOT NULL,\n \tos \tCHAR(10) NOT NULL,\n \timage \tCHAR(254) NOT NULL,\n \tscreensize INTEGER NOT NULL\n \t)`);\n\t\tdb.all(`select count(*) as count from phones`, function(err, result) {\n\t\t\tif (result[0].count == 0) {\n\t\t\t\tdb.run(`INSERT INTO phones (brand, model, os, image, screensize) VALUES (?, ?, ?, ?, ?)`,\n\t\t\t\t[\"Fairphone\", \"FP3\", \"Android\", \"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Fairphone_3_modules_on_display.jpg/320px-Fairphone_3_modules_on_display.jpg\", \"5.65\"]);\n\t\t\t\tconsole.log('Inserted dummy phone entry into empty database');\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Database already contains\", result[0].count, \" item(s) at startup.\");\n\t\t\t}\n\t\t});\n\t});\n\treturn db;\n}", "title": "" }, { "docid": "4f84440fb09efe46070428cbd46c1f85", "score": "0.57683843", "text": "async function getDatabase() {\n // Read the key of the initial database if it exists.\n const keyFile = fs.resolve(`.db/KEY.${INITIAL_DB}`);\n const dbKey = (await fs.pathExists(keyFile)) ? await fs.readFile(keyFile, 'utf-8') : undefined;\n\n // Create the database.\n const { dir } = await promptForDatabase();\n const db = await example.db.create({ dir, dbKey });\n\n // Store the KEY of the main database (for sharing).\n if (dir.endsWith(INITIAL_DB)) {\n await fs.writeFile(keyFile, db.key.toString('hex'));\n }\n\n return { dir, dbKey, db };\n}", "title": "" }, { "docid": "73c4030f8637d229eac52750dcd0dddf", "score": "0.576701", "text": "function start() {\n\t\t\tvar callback = function(str) {\n\t\t\t\tvar uInt8Array = new Uint8Array(str);\n\t\t\t\t// do not use a 'var' here! So the database is saved as an global document. attribute\n\t\t\t\tdb = new SQL.Database(uInt8Array);\n\t\t\t\tconsole.log(\"database-loading finished\");\n\t\t\t\tcallback2(params);\n\t\t\t};\n\t\t\thttpGetAsync(path, callback);\n\t\t\t\n\t\t}", "title": "" }, { "docid": "79772550ed2bd8f00c86022acaa62e00", "score": "0.57560253", "text": "static async createDatabase(){\n const migrationsArray = await this.getMigrationsArray()\n const conn = this.connect()\n conn.connect()\n for(let migration of migrationsArray){\n const migrationFile = await import('./migrations/' + migration)\n migrationFile.default(conn)\n }\n conn.end()\n }", "title": "" }, { "docid": "94e60fbbbf6240277628a6b5ecba1906", "score": "0.5755785", "text": "function readDatabases() {\n\tvar db = window.openDatabase(\"Database\", \"1.0\", \"PhoneGap Demo\", 2000000);\n\tgetJson();\n\tdb.transaction(queryDB, errorRead);\n}", "title": "" }, { "docid": "a987b5883b8c5c8f10aa95ece48afd27", "score": "0.5751829", "text": "close() {\n this.database_.close();\n }", "title": "" }, { "docid": "b868d4b14b0231a3c7be7027040b6d4d", "score": "0.5742788", "text": "function Database(databaseName, saveinterval)\n{\n\tthis.data = {};\n\tthis.name = databaseName;\n\tthis.interval = saveinterval || -1;\n\tthis.file;\n\tthis.timeout;\n\tthis.path = `${config.data_folder}/${this.name}${config.file_suffix}`;\n\n\tconsole.log(` - Opening database '${this.name}' at \"${this.path}\"`);\n\n\t// Open or create file\n\tlet files = fs.readdirSync(config.data_folder);\n\tthis.file = files.find(f => f === `${this.name}${config.file_suffix}`);\n\n\tif (this.file != undefined)\n\t{\n\t\t// read database file\n\t\tlet content = fs.readFileSync(`${config.data_folder}/${this.file}`);\n\t\tthis.data = JSON.parse(content);\n\t}\n\telse\n\t{\n\t\t// create database file\n\t\tthis.file = `${this.name}${config.file_suffix}`;\n\t\tthis.save();\n\t}\n\n\tif (this.interval != -1) {\n\t\tthis.setSaveInterval(this.interval);\n\t\t}\n}", "title": "" }, { "docid": "e393325feb84c6245a991d431927482a", "score": "0.5742454", "text": "function cargarBD() {\r\n /***********************************************************************************************\r\n *** En la variable dataBase almacenaremos el conector abierto a nuestra base de datos,\r\n *** con open si no existe la base de datos, se crea\r\n ***********************************************************************************************/\r\n dataBase = indexedDB.open(\"CostesAppDB\", 1);\r\n /***********************************************************************************************\r\n *** Para crear una coleccion de objetos se utiliza la propiedad onupgradeneeded,\r\n *** para usarla hay que definirla como metodo para el objeto database,\r\n *** este metodo se ejecutara tanto cuando la base de datos se crea por primera vez como\r\n *** cuando abrimos una bbdd, pero especificando una version diferente a la almacenada\r\n ***********************************************************************************************/\r\n dataBase.onupgradeneeded = function (e) {\r\n // Recupero el conector a la base de datos\r\n active = dataBase.result;\r\n // Una coleccion de objetos aqui es como una tabla\r\n // Coleccion Materiales\r\n materiales = active.createObjectStore(\"materiales\",\r\n { keyPath : 'id_material', autoIncrement : true });\r\n //materiales.createIndex('por_material', 'id', { unique : true });\r\n\t\tmateriales.createIndex('por_presupuesto', 'id_presupuesto', { unique : true });\r\n // Coleccion Mano de Obra\r\n mdObra = active.createObjectStore(\"mdobra\",\r\n { keyPath : 'id_mdobra', autoIncrement : true });\r\n //mdObra = createIndex('por_mdobra', 'id', { unique : true });\r\n // Coleccion Presupuesto\r\n presupuestos = active.createObjectStore(\"presupuestos\",\r\n { keyPath : 'id_presupuesto', autoIncrement : true });\r\n presupuestos.createIndex('por_nombre', 'nombre', { unique : true });\r\n };\r\n\r\n dataBase.onsuccess = function (e) {\r\n alert('Base de datos cargada correctamente');\r\n\t\t// Listo las tablas\r\n\t\tlistarMateriales();\r\n\t\tlistarPresupuestos();\r\n };\r\n dataBase.onerror = function (e) {\r\n alert('Error cargando la base de datos');\r\n };\r\n\r\n}", "title": "" }, { "docid": "821582fd532becd4a7f1bf90393854dd", "score": "0.57423836", "text": "function OpenTokenDB( create ){\n let FLAG = sqlite3.OPEN_READWRITE;\n if ( create ) {\n FLAG |= sqlite3.OPEN_CREATE\n }\n const tokendb = new sqlite3.Database(TKNDB_PATH, FLAG, err => {\n if(err) return console.log(`Creating database, ${TKNDB_PATH}, failed: ${err.message}`)\n if( create ){\n console.log('Created ' + TKNDB_PATH + ' database')\n }\n else\n console.log('Connected to ' + TKNDB_PATH + ' database')\n\n tokendb.run('CREATE TABLE IF NOT EXISTS app_tokens(accesstoken VARCHAR(800) NOT NULL, refreshtoken VARCHAR(800) NOT NULL, expires INT NOT NULL)',\n err => {\n if(err) return console.error('CREATE TABLE IF NOT EXISTS app_tokens: ' +err.message)\n console.log('successfully opened app_tokens table!')\n })\n })\n return tokendb\n}", "title": "" }, { "docid": "b7161dc2ad9f9f06a03f1849ba14a5f1", "score": "0.5730618", "text": "function DatabaseManager(){}", "title": "" }, { "docid": "9bf9dcbde6e8c8d388afca2717902142", "score": "0.5725014", "text": "static get idb() {\n // If the browser doesn't support service worker or IndexedDB,\n // we don't care about having a database\n \n if ((!navigator.serviceWorker) || (!'indexedDB' in window)) {\n console.log('This browser doesn\\'t support IndexedDB');\n return Promise.reject();\n }; \n \n return idb.open(IDB_NAME, IDB_VERSION, (upgradeDb) => {\n if (!upgradeDb.objectStoreNames.contains('restaurants')) {\n var dbRestaurants = upgradeDb.createObjectStore('restaurants', {keyPath: 'id'});\n dbRestaurants.createIndex('by-id', 'id'); \n };\n /*\n if (!upgradeDb.objectStoreNames.contains('reviews')) {\n var dbReviews = upgradeDb.createObjectStore('reviews', {keyPath: 'id'});\n } */ \n });\n }", "title": "" }, { "docid": "40296baa625f227707d4e84128947f80", "score": "0.5719785", "text": "function createDb() { exeSql('CREATE TABLE teste(id integer not null, nome text)') }", "title": "" }, { "docid": "7a5fafc1deb86cdbbbcb04d199cddaed", "score": "0.5712318", "text": "function closeDatabase() {\n db.close()\n}", "title": "" }, { "docid": "1727659c4e5b640361fdb2cc9762de7f", "score": "0.57117045", "text": "function getStockIDB() {\n return new Promise((resolve, reject) => {\n const openReq = indexedDB.open(config.dbName);\n\n openReq.onupgradeneeded = event => {\n event.target.transaction.abort();\n reject(`IndexedDB with name ${config.dbName} does not exits`);\n };\n openReq.onsuccess = event => {\n resolve(openReq.result);\n };\n openReq.error = error => {\n reject(`Error during getting DB with name ${config.dbName}`);\n };\n openReq.onblocked = error => {\n reject(`opening indexedDB is blocked ${error}`);\n };\n });\n }", "title": "" }, { "docid": "5d028b0f5f14849013a253fa78fe831c", "score": "0.57100034", "text": "async function initJsStore() {\r\n var database = getDbSchema();\r\n const isDbCreated = await connection.initDb(database);\r\n if (isDbCreated === true) {\r\n console.log(\"db created\");\r\n // here you can prefill database with some data\r\n } else {\r\n console.log(\"db opened\");\r\n }\r\n\r\n}", "title": "" }, { "docid": "0a8813e9f6f05e21a7e7e9481284cc61", "score": "0.5704678", "text": "function connect(filename) {\r\n\r\n\t// Connect to the database.\r\n\tdatabase = new sqlite3.Database(filename, sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, function(err) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log(err.message);\r\n\t\t}\r\n\t});\r\n\r\n\t// users(database);\r\n\t// events(database);\r\n\t// interest(database);\r\n\t// pictures(database);\r\n\r\n\t// run(\"DROP TABLE Events\");\r\n\r\n}", "title": "" }, { "docid": "b0099274f32cc4ac67f16b01624026de", "score": "0.57043433", "text": "static get db() {\n // return db\n return DATA.db;\n }", "title": "" }, { "docid": "662e8fb71299a7cdda26b9f5d4969262", "score": "0.5700219", "text": "function createDB(){\n\t\t// Checking support of indexedDb\n\t\twindow.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;\n\t\tif (!window.indexedDB) {\n\t\t\tconsole.log(\"Your browser doesn't support a stable version of IndexedDB.\")\n\t\t}\n\n\t\t// Opening a new database connection with\n\t\tvar request = window.indexedDB.open(database, 1);\n\t\trequest.onerror = function(event) {\n\t\t\tconsole.log(\"error: \");\n\t\t};\n\n\t\trequest.onsuccess = function(event) {\n\t\t\tdb = request.result;\n\t\t\tconsole.log(\"success: \"+ db);\n\t\t\tgetSteps();\n\t\t};\n\n\t\t// Fired if database not available\n\t\trequest.onupgradeneeded = function(event) {\n\t\t\tvar db = event.target.result;\n\t\t\tvar objectStore = db.createObjectStore(object_Store, {keyPath: \"Id\",autoIncrement:true});\n\t\t\tobjectStore.createIndex(\"firstStep\",\"firstStep\",{unique:false});\n\t\t\tobjectStore.createIndex(\"totalsteps\",\"totalsteps\",{unique:false});\n\t\t\tobjectStore.createIndex(\"Pedosteps\",\"Pedosteps\",{unique:false});\n\t\t\tobjectStore.createIndex(\"Id\",\"Id\",{unique:true});\n\n\t\t\tvar objectStore2 = db.createObjectStore(object_Store2, {keyPath: \"Id\",autoIncrement:true});\n\t\t\tobjectStore2.createIndex(\"fname\",\"fname\",{unique:false});\n\t\t\tobjectStore2.createIndex(\"lname\",\"lname\",{unique:false});\n\t\t\tobjectStore2.createIndex(\"number\",\"number\",{unique:false});\n\t\t\tobjectStore2.createIndex(\"Id\",\"Id\",{unique:true});\n\n\t\t\tvar data2={ firstStep: \"0\", totalsteps: \"0\" ,Pedosteps:\"0\"};\n\t\t\tupdatePriority(data2);\n\t\t\tvar ctsdata={fname:\"Michael\",lname:\"Musial\",number:\"+18477210660\"};\t\n\t\t\tupdatePriority(ctsdata,\"cts\");\n\t\t}\n\t}", "title": "" }, { "docid": "b6977a81d253b2c8f968015eee87ad28", "score": "0.5692811", "text": "function readDB() {\n idb.open('restaurant_info', 1).then(function(db) {\n var tx = db.transaction(['restaurants'], 'readonly');\n var store = tx.objectStore('restaurants');\n return store.getAll();\n }).then(function(items) {\n // Use restaurant data\n console.log(items);\n return items;\n });\n}", "title": "" }, { "docid": "32fe622c7d2b0c9abe2dd0ae6143e424", "score": "0.5692809", "text": "function MemoryStorage() {\n this._database = {};\n }", "title": "" }, { "docid": "97d3edce045669595b55c932ea78b7d4", "score": "0.5684103", "text": "function getDb() {\n const data = fs.readFileSync(dbPath, \"utf8\");\n return JSON.parse(data);\n}", "title": "" }, { "docid": "ef6e71c551a9d6eaedb5959797cd35f1", "score": "0.56831604", "text": "close(){\n this.db.close();\n }", "title": "" }, { "docid": "c900b6b980ba4839e6012c5df49e211f", "score": "0.56818926", "text": "async function connectDatabase() {\n db = new sqlite.Database('database/emissions.db', sqlite.OPEN_READWRITE, (err) => {\n if (err) {\n console.error(err.message)\n }\n console.log('Connected to the database')\n })\n}", "title": "" }, { "docid": "5a295499aee1cc65d73923deb4eaa95c", "score": "0.56799257", "text": "function sqliteSetup(name, table_name) {\n var db = new Database(name);\n if (db.open == true) {\n db.pragma('journal_mode=WAL');\n db.pragma('synchronous=1');\n db.prepare('CREATE TABLE IF NOT EXISTS ' + table_name + ' (jobId CHAR(25),status INT,target CHAR(25))').run();\n console.log('Connection with database opened')\n return db;\n }\n}", "title": "" }, { "docid": "8caf895b8864ebf25e1ff2dd915d9a4e", "score": "0.5668858", "text": "function readDatabasesWasher() {\n\tvar db = window.openDatabase(\"Database\", \"1.0\", \"PhoneGap Demo\", 2000000);\n\tgetJson();\n\tdb.transaction(queryDBWasher, errorRead);\n}", "title": "" }, { "docid": "365518dd01f4ca862ee4d882512d5515", "score": "0.5667367", "text": "function _initStorage(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] = options[i];\n\t }\n\t }\n\n\t // Initialize a singleton container for all running localForages.\n\t if (!dbContexts) {\n\t dbContexts = {};\n\t }\n\n\t // Get the current context of the database;\n\t var dbContext = dbContexts[dbInfo.name];\n\n\t // ...or create a new context.\n\t if (!dbContext) {\n\t dbContext = {\n\t // Running localForages sharing a database.\n\t forages: [],\n\t // Shared database.\n\t db: null,\n\t // Database readiness (promise).\n\t dbReady: null,\n\t // Deferred operations on the database.\n\t deferredOperations: []\n\t };\n\t // Register the new context in the global container.\n\t dbContexts[dbInfo.name] = dbContext;\n\t }\n\n\t // Register itself as a running localForage in the current context.\n\t dbContext.forages.push(self);\n\n\t // Replace the default `ready()` function with the specialized one.\n\t if (!self._initReady) {\n\t self._initReady = self.ready;\n\t self.ready = _fullyReady;\n\t }\n\n\t // Create an array of initialization states of the related localForages.\n\t var initPromises = [];\n\n\t function ignoreErrors() {\n\t // Don't handle errors here,\n\t // just makes sure related localForages aren't pending.\n\t return Promise.resolve();\n\t }\n\n\t for (var j = 0; j < dbContext.forages.length; j++) {\n\t var forage = dbContext.forages[j];\n\t if (forage !== self) {\n\t // Don't wait for itself...\n\t initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n\t }\n\t }\n\n\t // Take a snapshot of the related localForages.\n\t var forages = dbContext.forages.slice(0);\n\n\t // Initialize the connection process only when\n\t // all the related localForages aren't pending.\n\t return Promise.all(initPromises).then(function () {\n\t dbInfo.db = dbContext.db;\n\t // Get the connection or open a new one without upgrade.\n\t return _getOriginalConnection(dbInfo);\n\t }).then(function (db) {\n\t dbInfo.db = db;\n\t if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n\t // Reopen the database for upgrading.\n\t return _getUpgradedConnection(dbInfo);\n\t }\n\t return db;\n\t }).then(function (db) {\n\t dbInfo.db = dbContext.db = db;\n\t self._dbInfo = dbInfo;\n\t // Share the final connection amongst related localForages.\n\t for (var k = 0; k < forages.length; k++) {\n\t var forage = forages[k];\n\t if (forage !== self) {\n\t // Self is already up-to-date.\n\t forage._dbInfo.db = dbInfo.db;\n\t forage._dbInfo.version = dbInfo.version;\n\t }\n\t }\n\t });\n\t }", "title": "" }, { "docid": "304f80363418634df9baf644e7dd1f40", "score": "0.56670207", "text": "function Database() {\n if (!this.isInstantiated) {\n this.storage = new nativescript_couchbase_1.Couchbase(\"caregiver\");\n this.createViews();\n this.isInstantiated = true;\n }\n }", "title": "" }, { "docid": "bf7482b38d8ff37bbcec757d41531a38", "score": "0.5665271", "text": "function userdb() {\n return new Promise(function (resolve, reject) {\n /**\n * Buat baru jika belum ada atau buka `indexedDB > \"userdb\"`\n */\n const database = indexedDB.open('userdb', 3);\n\n database.onerror = function(e) {\n reject(e);\n };\n\n database.onupgradeneeded = function(e) {\n let db = database.result;\n if (!db.objectStoreNames.contains('customer')) {\n db.createObjectStore('customer', { keyPath: 'date', autoIncrement: true });\n }\n };\n\n database.onsuccess = function(e) {\n resolve(e.target.result);\n };\n });\n}", "title": "" }, { "docid": "dccf1cd09389a3d869e05295e93cde74", "score": "0.5664155", "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] = options[i];\n }\n } // Get the current context of the database;\n\n\n var dbContext = dbContexts[dbInfo.name]; // ...or create a new context.\n\n if (!dbContext) {\n dbContext = createDbContext(); // Register the new context in the global container.\n\n dbContexts[dbInfo.name] = dbContext;\n } // Register itself as a running localForage in the current context.\n\n\n dbContext.forages.push(self); // Replace the default `ready()` function with the specialized one.\n\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n } // Create an array of initialization states of the related localForages.\n\n\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n } // Take a snapshot of the related localForages.\n\n\n var forages = dbContext.forages.slice(0); // Initialize the connection process only when\n // all the related localForages aren't pending.\n\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db; // Get the connection or open a new one without upgrade.\n\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo; // Share the final connection amongst related localForages.\n\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n }", "title": "" }, { "docid": "f6b33f5b620029f4dfa6fa6803ac0f7f", "score": "0.56585133", "text": "function database(func){\n if (!navigator.serviceWorker) {\n return false\n }\n\n const request = indexedDB.open(initials.db_name, initials.db_version)\n request.onupgradeneeded = () => {\n switch (request.result.version) {\n case 1:\n const forecast = request.result.createObjectStore(initials.db_store, {keyPath: 'id'}).createIndex('by_name', 'name')\n break;\n default:\n break;\n }\n }\n\n request.onerror = (error) => {\n func(error, undefined)\n }\n\n request.onsuccess = () => {\n func(null, request)\n }\n}", "title": "" } ]
bc53fa510a5ee3d70f01576d47cbbfb8
Determine the migration number based on its filename
[ { "docid": "3b38099eaab0e6c85133c68cfc0b0b1f", "score": "0.8607591", "text": "function getMigrationNumber(fileName: string): number {\n return Number(fileName.split('-')[0]);\n}", "title": "" } ]
[ { "docid": "9142ab1711886f5e76ebafdd7afe5035", "score": "0.58049977", "text": "function fetch_migration_info(callback) {\n exec(\"ls \" + config.migration_path, function(error, stdout, stderr) {\n if (error) throw stderr;\n var files = stdout.split(/\\s/);\n files.pop();\n \n if (files.length == 0) {\n exit(\"Schema up-to-date.\");\n return;\n }\n\n client.query(\"select * from schema_migrations;\", function(err, result) {\n if (err) return exit(err);\n \n var migration_index = -1;\n \n // Find the index of the last migration\n if (result.length > 0) {\n var last_migration;\n if (result[0].version) {\n last_migration = result[0].version;\n } else {\n last_migration = result[0][0];\n }\n\n for (var i = 0; i < files.length; i++) {\n if (files[i].match(last_migration)) {\n migration_index = i;\n break;\n }\n }\n if (migration_index == -1) {\n return exit('Could not locate last schema migration (' + last_migration + ').'); \n }\n } \n return callback(files, migration_index+1);\n }); \n });\n}", "title": "" }, { "docid": "c45fa3341277816d42436101c6481a92", "score": "0.56506777", "text": "function getActiveFileNum() {\n var num;\n var activeTab = getActiveTab();\n if (tab) {\n num = getNumFromId(activeTab.id);\n }\n return num;\n}", "title": "" }, { "docid": "f7deb76f5a96d1174cd3fb05c79f8b99", "score": "0.5343478", "text": "function thumbNum(name) {\t\t\t// extract the num value from thumbnail file name\n\t\t\t\t\t\t\t\t\tvar nameParts = name.split(\"_\");\n\t\t\t\t\t\t\t\t\tvar order = 10000; // default order num in case we can't parse (at the end)\n\t\t\t\t\t\t\t\t\tif(nameParts.length == 5) {\n\t\t\t\t\t\t\t\t\t\torder = nameParts[3];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn order;\n\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "26cfb5606b577ff6008cb8c89dfb75b9", "score": "0.5336145", "text": "function renumberFileName(oldPath, startIndex) {\n\tvar match = /([\\d]+)\\.[\\w]+$/i.exec(oldPath),\n\t\t\tindex,\n\t\t\tnewPath;\n\n\tif (match && match.length > 1) {\n\t\tindex = parseInt(match[1], 10)\n\t\tnewPath = oldPath.replace(match[0], match[0].replace(match[1], index+startIndex))\n\t\treturn newPath;\n\t}\n\treturn oldPath;\n}", "title": "" }, { "docid": "c67518d8a1d1e673b02b76e359a0eb6d", "score": "0.52512586", "text": "function getCurrentRevision() {\n var number = '18119';\n return number;\n}", "title": "" }, { "docid": "73678b02bb7d4958e2ad1e133f228261", "score": "0.5087892", "text": "generateFileVersion(document) {\n let iVersion = 4;\n let version = '1.' + iVersion.toString();\n return version;\n }", "title": "" }, { "docid": "d89bdba1554d2005b44d5bd02ab100b4", "score": "0.50854385", "text": "function execute_migration(file, callback, down) {\n var parts = file.split('.')[0].split('_');\n var version = file.split('_')[0];\n parts.shift();\n var variable = parts.join('_');\n var filename = config.migration_path.replace(/[\\/\\s]+$/,\"\") + \"/\" + file;\n \n fs.readFile(filename, 'utf8', function(err, data) {\n if (err) \n exit(\"Error reading migration \" + file);\n else {\n eval(data);\n var migration = eval(variable);\n\n sys.puts(\"======================================\");\n\n if (!down) {\n migration.up();\n sys.puts(\"Executing \" + file);\n }\n else {\n migration.down();\n sys.puts(\"Rolling back \" + file);\n }\n\n sys.puts(migration);\n\n multi_query(\n migration.toString(), \n function(result) {\n sys.puts(\"Success!\");\n callback();\n },\n function(error) {\n exit(error.message);\n }\n );\n }\n });\n}", "title": "" }, { "docid": "a30bdcdf5e73cf067d65dfeb3391bc0b", "score": "0.5060581", "text": "getId() {\n const idReg = new RegExp(/\\d{1,}/g)\n let matches = this.file.name.match(idReg)\n return matches[0]\n\n }", "title": "" }, { "docid": "59397874acb8f7a50d2bdd777d753340", "score": "0.4968317", "text": "function db_get_file_name(filename) {\n nameArray = filename.split('/');\n return nameArray[nameArray.length - 1];\n}", "title": "" }, { "docid": "115568216e53ba72915c6e76a603de3e", "score": "0.49668264", "text": "function findMigrations(app) {\n var\n dirname = path.join(app.root, MIGRATIONS_DIR),\n results = [];\n\n fstools.walkSync(dirname, /\\d{14}_\\w*\\.js$/, function (file) {\n // skip:\n // - dirname in path starts with underscore, e.g. /foo/_bar/baz.js\n if (file.match(/(^|\\/|\\\\)_/)) { return; }\n\n results.push(path.basename(file));\n });\n\n return results;\n }", "title": "" }, { "docid": "141121ef8e8a60c0c790d15d41dbe3a6", "score": "0.4904408", "text": "_loadMigrationFiles(glob) {\n return globby(glob).then(migrationFiles => {\n migrationFiles.sort();\n const migrations = [];\n for (const migrationFile of migrationFiles) {\n const migration = require(migrationFile); // eslint-disable-line global-require\n if (!migration.id) {\n throw new Error(`Migration file ${migrationFile} does not export an 'id'`);\n } else if (!migration.up) {\n throw new Error(`Migration file ${migrationFile} does not export a function 'up()'`);\n } else {\n migrations.push(migration);\n }\n }\n return migrations;\n });\n }", "title": "" }, { "docid": "ed250fc5033b8f711385551a653bd008", "score": "0.48982278", "text": "function nextLinkNumber() {\n\tvar lines = editor.getText().split(\"\\n\")\n\tvar lastLine = lines.pop()\n\t// Ignore whitespace after final line of document\n\tnonWhitespaceRegex = /\\S/ \n\twhile (!nonWhitespaceRegex.test(lastLine)){\n\t\tlastLine = lines.pop()\n\t}\t\n\tvar refRegex = /\\[\\^*(\\d+)\\]/\n\tvar existingLink = refRegex.test(lastLine)\n\tif (existingLink == false){\n\t\treturn 1\n\t} else {\n\t\tvar currentLinkNumber = parseInt(refRegex.exec(lastLine)[1])\n\t\treturn currentLinkNumber + 1\n\t}\n}", "title": "" }, { "docid": "fdfa2b94bdebdec30b1f6fc165a42d6f", "score": "0.4866172", "text": "function defaultFilenameModifier (fileInfo, version) {\n if (fileInfo.dest.endsWith('index.um')) {\n return fileInfo.clone({\n dest: fileInfo.dest.replace('index.um', version) + '/' + 'index.um'\n })\n } else {\n return fileInfo.clone({\n dest: fileInfo.dest.replace('.um', '') + '/' + version + '.um'\n })\n }\n}", "title": "" }, { "docid": "38c3c0d007fbf62a03f2059d4e97dd2d", "score": "0.48333505", "text": "static getFileName() {\n return 'maxRevision.json';\n }", "title": "" }, { "docid": "fdbb27d73253841e9fe2fa7cac9cba72", "score": "0.4786587", "text": "function getFileName(num,base) {\n if(base==\"0\"){\n return \"0 (\" + num + \").JPG.jpg\";\n }\n if(base==\"1\"){\n return \"1(\" + num + \").JPG.jpg\";\n }\n \n}", "title": "" }, { "docid": "bf25dd4edbb7564a2be96301ec0a95d9", "score": "0.47697818", "text": "function _getFileType(f) {\n\tlet retVal = 0;\n\tlet extName = path.extname( path.basename(f) );\n\tif (!extName || extName.length < 2) {\n\t\tconsole.info(`☯︎ ignore:`, path.basename(f));\n\t}\n\telse if (copyFileExt.test(extName)) {\n\t\tretVal = 1;\n\t}\n\telse if (pageFileExt.test(extName)) {\n\t\tif (f.indexOf('index.js') > 0) {\n\t\t\tretVal = 2;\n\t\t}\n\t\telse if (f.indexOf('pages/') > 0) {\n\t\t\tretVal = 3;\n\t\t}\n\t\telse if (build_all_triggers.filter( t => f.indexOf(t) > 0).length > 0) {\n\t\t\tretVal = 4;\n\t\t}\n\t}\n\n\treturn retVal;\n}", "title": "" }, { "docid": "7300eb98f92c005ca1c812866659c882", "score": "0.4752284", "text": "function getLargestScriptExecutionNumberFromFileNumbers(uuid){\r\n\tif (!uuid) return 0\r\n\tvar u = components.utils()\r\n\tvar largestFileNumber = 0\r\n\tvar scriptPageDataFolder = coscripterPageDataFolder.clone()\r\n\tscriptPageDataFolder.append(\"coscript\" + uuid)\r\n if (!scriptPageDataFolder.exists()) return 0\r\n do {\r\n\t\tlargestFileNumber++\r\n\t\tvar scriptExecutionFolder = scriptPageDataFolder.clone()\r\n\t\tscriptExecutionFolder.append(\"scriptExecution\" + u.threeDigit(largestFileNumber))\r\n\t\t} while (scriptExecutionFolder.exists())\r\n\t\treturn largestFileNumber - 1\r\n}", "title": "" }, { "docid": "9c5e72e6d362e7ab361298489a3e08a5", "score": "0.4740224", "text": "function getTaskNumber(o) {\r\n\tvar taskId = o.closest(\"tr\").attr(\"id\");\r\n\tvar numAsString = taskId.substring(4,taskId.length);\r\n\treturn parseInt(numAsString,10);\r\n}", "title": "" }, { "docid": "d993ca5adb53b0f44e7588a8fdf370c8", "score": "0.47367612", "text": "function calculateCol(id){\n\tvar upperCol = '';\n\tfor(var i = 5; i < id.length; i++){\n\t\tif(id.charAt(i - 2) == '-' || id.charAt(i - 1) == '-'){\n\t\t\tupperCol += id.charAt(i);\n\t\t}\n\t\telse{\n\n\t\t}\n\t}\n\tvar upperColInt = parseInt(upperCol);\n\treturn upperColInt;\n}", "title": "" }, { "docid": "ac6f96099b98de11dfee0b4c1768bc61", "score": "0.47167996", "text": "@computed('router.currentRouteName')\n get currentStepNumber() {\n const currentRouteName = this.get('router.currentRouteName');\n const currentStepName = currentRouteName.split('.').slice(-1)[0];\n\n return userFacingSteps.indexOf(currentStepName) + 1;\n }", "title": "" }, { "docid": "61e805794b9d51954c566b60f49e3b4d", "score": "0.4714597", "text": "fileIdentifier () {\n // get rid of stuff react router doesn't like, ie., especially periods\n return `${this.encodedFilename()}-lastModified${this.fileLastModified}`\n }", "title": "" }, { "docid": "5971561c3c0f6703cefd3503b84144ca", "score": "0.47124267", "text": "function getColumn(aisle){\n\t\tlet num = (parseInt(aisle) - 36) * 3;\n\t\tlet pos = aisle.slice(2);\n\t\tif (pos === \"L\"){\n\t\t\tnum += 1;\n\t\t}\n\t\telse if(pos === \"R\"){\n\t\t\tnum -= 1;\n\t\t}\n\t\treturn num;\n\t}", "title": "" }, { "docid": "5565df7b6c838ee02f7641d74c950874", "score": "0.46952686", "text": "function getFullmoveNumber() {\n var fen = game.fen()\n var fullmoveNumber = parseInt(fen.split(' ')[5])\n return fullmoveNumber\n }", "title": "" }, { "docid": "4090875f125f25596ecafdcfc2363a43", "score": "0.46790114", "text": "function getColumnNum(element) {\n var isColumn0 = $(element).hasClass('c0');\n var isColumn1 = $(element).hasClass('c1');\n var isColumn2 = $(element).hasClass('c2');\n var isColumn3 = $(element).hasClass('c3');\n var isColumn4 = $(element).hasClass('c4');\n var isColumn5 = $(element).hasClass('c5');\n var isColumn6 = $(element).hasClass('c6');\n switch (true) {\n case isColumn0:\n return 0;\n break;\n case isColumn1:\n return 1;\n break;\n case isColumn2:\n return 2;\n break;\n case isColumn3:\n return 3;\n break;\n case isColumn4:\n return 4;\n break;\n case isColumn5:\n return 5;\n break;\n case isColumn6:\n return 6;\n break;\n default:\n return -1;\n }\n}", "title": "" }, { "docid": "9782cd6ca5a35850c6865b2422059098", "score": "0.46495503", "text": "to_ordinal() {\n let num = this.number;\n //fail fast\n if (!num && num !== 0) {\n return '';\n }\n //teens are all 'th'\n if (num >= 10 && num <= 20) {\n return '' + num + 'th';\n }\n //treat it as a string..\n num = '' + num;\n //fail safely\n if (!num.match(/[0-9]$/)) {\n return num;\n }\n if (fns.endsWith(num, '1')) {\n return num + 'st';\n }\n if (fns.endsWith(num, '2')) {\n return num + 'nd';\n }\n if (fns.endsWith(num, '3')) {\n return num + 'rd';\n }\n return num + 'th';\n }", "title": "" }, { "docid": "9782cd6ca5a35850c6865b2422059098", "score": "0.46495503", "text": "to_ordinal() {\n let num = this.number;\n //fail fast\n if (!num && num !== 0) {\n return '';\n }\n //teens are all 'th'\n if (num >= 10 && num <= 20) {\n return '' + num + 'th';\n }\n //treat it as a string..\n num = '' + num;\n //fail safely\n if (!num.match(/[0-9]$/)) {\n return num;\n }\n if (fns.endsWith(num, '1')) {\n return num + 'st';\n }\n if (fns.endsWith(num, '2')) {\n return num + 'nd';\n }\n if (fns.endsWith(num, '3')) {\n return num + 'rd';\n }\n return num + 'th';\n }", "title": "" }, { "docid": "ebfff50fb08737c3a3b578e9807703f6", "score": "0.46431285", "text": "function idNum() {\n if (lastId == null) {\n id++;\n return \"note\" + id;\n }\n else {\n lastId = JSON.parse(localStorage.getItem(\"noteArray\"))[0].id;\n id = (Number(lastId.charAt(4)) + 1);\n return \"note\" + id;\n }\n }", "title": "" }, { "docid": "374262255afdc4f9a5894bd881c57c90", "score": "0.46400788", "text": "streamNameVersion(job) {\n // The only way to determin which version a job uses is date started\n if (job.analysis.created < moment('2017-08-21T14:00-07:00')) {\n // The original stream name format\n // appDefName / jobId / ecsTaskId\n // FreeSurfer/eb251a5f-6314-457f-a36f-d11665451ddb/bf4fc87d-2e87-4309-abd9-998a0de708de\n return 0\n } else {\n // New stream name format\n // appDefName / 'default' / ecsTaskId\n // FreeSurfer/default/bf4fc87d-2e87-4309-abd9-998a0de708de\n return 1\n }\n }", "title": "" }, { "docid": "22eb7e2e8ce96aa754cfe1ab1373e6b0", "score": "0.4623603", "text": "function default_versionCode(version) {\n var nums = version.split('-')[0].split('.');\n var versionCode = 0;\n if (+nums[0]) {\n versionCode += +nums[0] * 10000;\n }\n if (+nums[1]) {\n versionCode += +nums[1] * 100;\n }\n if (+nums[2]) {\n versionCode += +nums[2];\n }\n\n events.emit('verbose', 'android-versionCode not found in config.xml. Generating a code based on version in config.xml (' + version + '): ' + versionCode);\n return versionCode;\n}", "title": "" }, { "docid": "3e2fc0d7a07bb17e3c5237a52562d7fc", "score": "0.46225187", "text": "static vt(t){const e=t.match(/Android ([\\d.]+)/i),n=e?e[1].split(\".\").slice(0,2).join(\".\"):\"-1\";return Number(n);}", "title": "" }, { "docid": "dd3afae2b05d93f18fc40008ac74218a", "score": "0.46061832", "text": "function convertVer(str) {\n\n let ver = ('.' + str + '.').replace(/\\./g, '..').replace(/\\.(\\d{1})\\./g, '.0$1.').split('..').join('');\n\n // console.log(str + ' ' + parseInt(ver));\n\n return parseInt(ver);\n}", "title": "" }, { "docid": "2dd0e4b42f0d79c2cb56f4c74bf36a3c", "score": "0.4588636", "text": "static formatFileAndLineNumber(node) {\n const sourceFile = node.getSourceFile();\n const lineAndCharacter = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n return `[${sourceFile.fileName}#${lineAndCharacter.line}]`;\n }", "title": "" }, { "docid": "3da3068416ca2f3e4284c669bc5ba98e", "score": "0.4579344", "text": "function nextNum() {\n\tfor (var i = 1; i <= 3; i++) {\n\t\tif (localStorage.getItem('profileItem' + i) === null)\n\t\t\treturn i;\n\t}\n\treturn 'MAX';\n}", "title": "" }, { "docid": "7d13a847782529be372945c0c87a2a99", "score": "0.45730576", "text": "function stopNameToId(name) {\n\t// \tIf the stop is one with duplicate names\n\t// \twe use the number after it to find it's ID \n\t// \teg. Newry Stop 2 would be the 3rd ID associated with Newry\n\tvar splits = name.split(\"Stop\");\n\tif (splits.length == 2) {\n\t\tbaseName = splits[0].trim();\n\t\tnum = parseInt(splits[1]) - 1;\n\t} else {\n\t\tbaseName = name;\n\t\tnum = 0;\n\t}\n\n\t// i = 1 as first line is metadata\n\tfor (let i = 1; i < parsedCSV.data.length; i++) {\n\t\tif (parsedCSV.data[i][1] == baseName) {\n\t\t\tif (num == 0) {\n\t\t\t\treturn parsedCSV.data[i][0];\n\t\t\t} else {\n\t\t\t\tnum = num - 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn \"nope\";\n}", "title": "" }, { "docid": "ab2c958dedf57a1d7bc0feaba3ec3856", "score": "0.4570602", "text": "static formatFileAndLineNumber(node) {\r\n const sourceFile = node.getSourceFile();\r\n const lineAndCharacter = sourceFile.getLineAndCharacterOfPosition(node.getStart());\r\n return `[${sourceFile.fileName}#${lineAndCharacter.line}]`;\r\n }", "title": "" }, { "docid": "18e87173fa55d1ee3f0c1ea3cf8a6c72", "score": "0.45596766", "text": "function getIndexFileName(mainFile: string): string {\n return `${DEFAULT_INDEX_NAME}.${getExt(mainFile)}`;\n}", "title": "" }, { "docid": "bf4393c32be9f3c5e967c04dcfc9974f", "score": "0.45585322", "text": "function setNameFilesByNumber(newValue) {\r\n Config.NAME_FILES_BY_NUMBER = newValue;\r\n GM_getValue('NAME_FILES_BY_NUMBER', Config.NAME_FILES_BY_NUMBER);\r\n}", "title": "" }, { "docid": "9a39c64b4ac167c372ed068754d54417", "score": "0.45560324", "text": "tabToIndex(tabName) {\n let index = -1;\n\n if (tabName === 'Welcome') {\n index = 0;\n } else if (tabName === 'Education') {\n index = 1;\n } else if (tabName === 'Experience') {\n index = 2;\n } else if (tabName === 'Coding') {\n index = 3;\n } else if (tabName === 'Design') {\n index = 4;\n } else if (tabName === 'Contact') {\n index = 5;\n }\n\n return index;\n }", "title": "" }, { "docid": "b8b346562464a81448ed467b8a545bad", "score": "0.45463994", "text": "static numberToIdentifer(n) {\r\n\t\t// lower case\r\n\t\tif(n < DELTA_A_TO_Z) return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n);\r\n\r\n\t\t// upper case\r\n\t\tn -= DELTA_A_TO_Z;\r\n\t\tif(n < DELTA_A_TO_Z) return String.fromCharCode(START_UPPERCASE_ALPHABET_CODE + n);\r\n\r\n\t\t// fall back to _ + number\r\n\t\tn -= DELTA_A_TO_Z;\r\n\t\treturn \"_\" + n;\r\n\t}", "title": "" }, { "docid": "b6cd798f8a1364b22e87ad6f409267b5", "score": "0.45462105", "text": "_devModuleId(mod: Module) {\n const map: PackageMap = (this.packages: any)\n const pkg = mod.package\n const pkgId = this._getPackageId(pkg, map)\n\n let moduleId = pkgId\n if (mod.file != map.getMain(pkg)) {\n const fileId = path.relative(pkg.path, mod.path)\n if (fileId.endsWith('/index.js')) {\n moduleId += '/' + path.dirname(fileId)\n } else {\n moduleId += '/' + fileId\n }\n }\n return moduleId\n }", "title": "" }, { "docid": "2c60f964690214c1dbf83c3648c21070", "score": "0.45176443", "text": "async runMigrations(migrator, connectionName) {\n /**\n * Pretty print SQL in dry run and return early\n */\n if (migrator.dryRun) {\n await migrator.run();\n await migrator.close();\n Object.keys(migrator.migratedFiles).forEach((file) => {\n this.prettyPrintSql(migrator.migratedFiles[file], connectionName);\n });\n return;\n }\n /**\n * A set of files processed and emitted using event emitter.\n */\n const processedFiles = new Set();\n let start;\n let duration;\n /**\n * Starting to process a new migration file\n */\n migrator.on('migration:start', (file) => {\n processedFiles.add(file.file.name);\n this.printLogMessage(file, migrator.direction);\n });\n /**\n * Migration completed\n */\n migrator.on('migration:completed', (file) => {\n this.printLogMessage(file, migrator.direction);\n this.logger.logUpdatePersist();\n });\n /**\n * Migration error\n */\n migrator.on('migration:error', (file) => {\n this.printLogMessage(file, migrator.direction);\n this.logger.logUpdatePersist();\n });\n migrator.on('start', () => (start = process.hrtime()));\n migrator.on('end', () => (duration = process.hrtime(start)));\n /**\n * Run and close db connection\n */\n await migrator.run();\n await migrator.close();\n /**\n * Log all pending files. This will happen, when one of the migration\n * fails with an error and then the migrator stops emitting events.\n */\n Object.keys(migrator.migratedFiles).forEach((file) => {\n if (!processedFiles.has(file)) {\n this.printLogMessage(migrator.migratedFiles[file], migrator.direction);\n }\n });\n /**\n * Log final status\n */\n switch (migrator.status) {\n case 'completed':\n const completionMessage = migrator.direction === 'up' ? 'Migrated in' : 'Reverted in';\n console.log(`\\n${completionMessage} ${this.colors.cyan(pretty_hrtime_1.default(duration))}`);\n break;\n case 'skipped':\n const message = migrator.direction === 'up' ? 'Already up to date' : 'Already at latest batch';\n console.log(this.colors.cyan(message));\n break;\n case 'error':\n this.logger.fatal(migrator.error);\n this.exitCode = 1;\n break;\n }\n }", "title": "" }, { "docid": "4b9fe6f8fa12fd5c48761e66f4e133a2", "score": "0.45135993", "text": "static numberToIdentifer(n) {\n\t\t// lower case\n\t\tif(n < DELTA_A_TO_Z) return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n);\n\n\t\t// upper case\n\t\tn -= DELTA_A_TO_Z;\n\t\tif(n < DELTA_A_TO_Z) return String.fromCharCode(START_UPPERCASE_ALPHABET_CODE + n);\n\n\t\t// fall back to _ + number\n\t\tn -= DELTA_A_TO_Z;\n\t\treturn \"_\" + n;\n\t}", "title": "" }, { "docid": "d5be77a15eaf2f8c35194676474da1de", "score": "0.45105284", "text": "function _getGameNumber(gameNumber) {\r\n let newGameNumber = cl.get('g', 'game');\r\n\r\n if (newGameNumber !== undefined) {\r\n gameNumber = Number(newGameNumber);\r\n }\r\n\r\n if (gameNumber !== 1 && gameNumber !== 2) {\r\n throw new Error(`Vermintide ${gameNumber} hasn't been released yet. Check your ${values.filename}.`);\r\n }\r\n\r\n console.log(`Game: Vermintide ${gameNumber}`);\r\n\r\n return gameNumber;\r\n}", "title": "" }, { "docid": "bddec2c5799c86de822a2324e3b2a691", "score": "0.4510525", "text": "function revToInt (rev) {\n return Number(rev.split('-')[0]);\n}", "title": "" }, { "docid": "1aca7966d1f04c316250e6d012a7b057", "score": "0.44911236", "text": "function getNameFromFilename(filename) {\n if (!filename) return null;\n var parts = filename.split(/[/\\\\]/).map(encodeURI);\n\n if (parts.length > 1) {\n var index_match = parts[parts.length - 1].match(/^index(\\.\\w+)/);\n\n if (index_match) {\n parts.pop();\n parts[parts.length - 1] += index_match[1];\n }\n }\n\n var base = parts.pop().replace(/%/g, 'u').replace(/\\.[^.]+$/, '').replace(/[^a-zA-Z_$0-9]+/g, '_').replace(/^_/, '').replace(/_$/, '').replace(/^(\\d)/, '_$1');\n\n if (!base) {\n throw new Error(\"Could not derive component name from file \".concat(filename));\n }\n\n return base[0].toUpperCase() + base.slice(1);\n}", "title": "" }, { "docid": "1aca7966d1f04c316250e6d012a7b057", "score": "0.44911236", "text": "function getNameFromFilename(filename) {\n if (!filename) return null;\n var parts = filename.split(/[/\\\\]/).map(encodeURI);\n\n if (parts.length > 1) {\n var index_match = parts[parts.length - 1].match(/^index(\\.\\w+)/);\n\n if (index_match) {\n parts.pop();\n parts[parts.length - 1] += index_match[1];\n }\n }\n\n var base = parts.pop().replace(/%/g, 'u').replace(/\\.[^.]+$/, '').replace(/[^a-zA-Z_$0-9]+/g, '_').replace(/^_/, '').replace(/_$/, '').replace(/^(\\d)/, '_$1');\n\n if (!base) {\n throw new Error(\"Could not derive component name from file \".concat(filename));\n }\n\n return base[0].toUpperCase() + base.slice(1);\n}", "title": "" }, { "docid": "46e84f9dfa39b6598903514e3aac16d2", "score": "0.4488593", "text": "function curidx() {\n var basename = window.location.href.replace(/^.*\\/|\\.[^.]*$/g, '');\n console.log(basename);\n for(i=0; i<order.length; i++) {\n if(basename==order[i]) return i; //find first occurence in order\n }\n return 0;//default: switch to beginning\n}", "title": "" }, { "docid": "0e3958971b812c853ce5a61bdaf9db87", "score": "0.4484105", "text": "function find_next_autogen_key(resourceName,offset) {\n var nextId = 'id_'+(Object.keys(DATA[resourceName]).length + offset);\n if (DATA[resourceName][nextId]) {\n nextId = find_next_autogen_key(resourceName,offset + 1);\n }\n return nextId;\n }", "title": "" }, { "docid": "662218071c032fb182e5163579534230", "score": "0.44710642", "text": "function _getArgNum(c, defaultVal) {\n var arg = process.argv.indexOf('-' + c);\n if (arg === -1) return 1;\n var num = parseInt(process.argv[arg + 1]);\n return (isNaN(num) ? defaultVal : num);\n}", "title": "" }, { "docid": "86de7688611a55de51f53863c627484c", "score": "0.4465716", "text": "function getExlColNum(colNum) {\n var AAA_COLUMN = 702; //(0-based) col with 3 letters\n var alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n 'Y', 'Z'];\n var alphabetLen = alphabet.length;\n var exlColStr = \"\";\n\n --colNum;\n\n if (colNum >= AAA_COLUMN) {\n var aCol = colNum - alphabetLen;\n var rem = AAA_COLUMN - alphabetLen;\n exlColStr += alphabet[((aCol / rem) | 0) - 1];\n exlColStr += alphabet[(((aCol % rem) / alphabetLen) | 0)];\n exlColStr += alphabet[(((aCol % rem) % alphabetLen) | 0)];\n } else if (colNum >= alphabetLen) {\n exlColStr += alphabet[((colNum / alphabetLen) | 0) - 1];\n exlColStr += alphabet[((colNum % alphabetLen) | 0)];\n } else {\n exlColStr = alphabet[colNum];\n }\n\n return exlColStr;\n}", "title": "" }, { "docid": "1d91eac29b368c200985056e3d4fabc9", "score": "0.44641292", "text": "function db_get_file_extension(filename)\n{\n var ext = /^.+\\.([^.]+)$/.exec(filename);\n return ext == null ? \"\" : ext[1];\n}", "title": "" }, { "docid": "cd8627b4797e712f3cfa06c73447ce9d", "score": "0.4450119", "text": "function getExampleTitleFromFilename (filename) {\n const words = _.words(_.startCase(basename(filename, '.jsx')));\n return (/^\\d+$/.test(_.head(words)) ? _.tail(words) : words).join(' ');\n}", "title": "" }, { "docid": "a188dfd6186fbb14efd586abfd73faaf", "score": "0.44403654", "text": "function fileNameToDate(fileName) {\n var extension = fileName.slice(-4);\n if (extension == '.jpg') {\n return fileName.slice(0,-4);\n } else {\n return fileName;\n }\n}", "title": "" }, { "docid": "d9feddfd5ca3cd9d135e06bd577cb6fe", "score": "0.44264296", "text": "function generateNewRevisionId() {\n return generateId(9);\n }", "title": "" }, { "docid": "2b6ebe7a06e284e80867408a5a8769b1", "score": "0.4425998", "text": "function selectionEntryNumber(selectionEntry) {\n return selectionEntry.firstElementChild.id.split(\"-\").slice(-2,-1)[0];\n}", "title": "" }, { "docid": "a18ea78ac73a787fde585f378aba4c88", "score": "0.44206488", "text": "formatFileName(fileName) {\n \n if(fileName.indexOf('sites') >= 0) {\n let newNameArray = fileName.split('/');\n let newName = newNameArray[newNameArray.length - 1]\n\n return newName\n }\n\n else\n return fileName\n\n }", "title": "" }, { "docid": "320143858e79dc72f27c44b8d71dab4b", "score": "0.44173902", "text": "function autoIncrement(key){\r\n const lastItem = localStorage.getItem(key);\r\n return (parseInt(lastItem)+1).toString();\r\n}", "title": "" }, { "docid": "0e1f48335e65224d623b3bb5f2c5f1c6", "score": "0.44164765", "text": "function getCurrentNumber(tx, store, callback, sqlFailCb) {\n tx.executeSql('SELECT \"currNum\" FROM __sys__ WHERE \"name\" = ?', [util.escapeSQLiteStatement(store.__currentName)], function (tx, data) {\n if (data.rows.length !== 1) {\n callback(1); // eslint-disable-line standard/no-callback-literal\n } else {\n callback(data.rows.item(0).currNum);\n }\n }, function (tx, error) {\n sqlFailCb((0, _DOMException.createDOMException)('DataError', 'Could not get the auto increment value for key', error));\n });\n}", "title": "" }, { "docid": "979c87efaa68c4526307884e41f0f635", "score": "0.4415447", "text": "function bundleName( filepath ) {\n return path.dirname( path.relative( root, filepath ) )\n}", "title": "" }, { "docid": "87a4bf0718c43bc524845cbd72a8fbef", "score": "0.44145876", "text": "function rollback() {\n var n = (process.argv[3]) ? process.argv[3] : 1;\n var m = 0;\n \n fetch_migration_info(function(files, migration_index) {\n if (migration_index == 0)\n exit('No migrations to roll back.');\n else {\n function roll(index, callback) {\n if (m >= n || index < 0)\n callback();\n else {\n m++;\n execute_migration(files[index], function() {\n client.query(\"delete from schema_migrations;\");\n if (index > 0) \n client.query(\"insert into schema_migrations (version) values (\" + files[index-1].split('_')[0] + \");\");\n roll(index-1, callback); \n }, true);\n }\n }\n\n sys.puts(migration_index-1);\n\n roll(migration_index-1, function() {\n exit(\"Schema rolled back by \" + m + \" migration\" + ((m > 1) ? 's' : '') + '.');\n });\n }\n });\n}", "title": "" }, { "docid": "71f905252b0bf4b3397c364392ab687b", "score": "0.4408949", "text": "function getSlideNumberFromUrlFragment() {\n var fragment = window.location.hash || ''\n\n currentSlideNumber = (parseInt(fragment.substr(1)) - 1) || 0\n}", "title": "" }, { "docid": "8fd10b4f42ce57a68b4f896741ff6c83", "score": "0.44068357", "text": "function getVersionNumberFromTagName(strTag) {\n const match = strTag.match(/^v(\\d+)$/);\n if (match) {\n const versionNumber = Number.parseInt(match[1]);\n if (!(versionNumber.toString().length == strTag.length - 1)) {\n exit(`Sanity check failed. Expected ${versionNumber} to be one character shorter than ${strTag}.`)\n }\n return versionNumber;\n }\n else {\n return null;\n }\n}", "title": "" }, { "docid": "edf3d024e0222612c63593582f002063", "score": "0.4405526", "text": "function uniqueName (base)\n\t\t\t{\n\t\t\tbase = base.replace(/\\.indd$/,\"\");\n\t\t\tvar n=0;\n\t\t\twhile(File(base+\".indd\").exists)\n\t\t\t\tbase = base.replace(/_\\d+$/,\"\") + \"_\"+String(++n);\n\t\t\treturn base+\".indd\";\n\t\t\t} // uniqueName ", "title": "" }, { "docid": "cf9d1787d4208cfa20352a637061185e", "score": "0.44040602", "text": "function getColId(col) {\n var r;\n $.each(col.classList, function () {\n if (this.match(/^col-/)) {\n r = this.replace(/^col-/, '');\n }\n });\n return r;\n }", "title": "" }, { "docid": "e051ac499e2af5892355cde53cc062ff", "score": "0.4400601", "text": "function fileMyRankToPos(file, rank) {\n return fileToStr(file) + myRankToRank(rank);\n}", "title": "" }, { "docid": "03b1c051be1ca42ee46fe7ab107795b1", "score": "0.43998593", "text": "function getNextId(counterType) // use 'house' or 'investor' or 'user' as counterType\n{\n // read the counter file\n let data = fs.readFileSync(__dirname + \"/data/counters.json\", \"utf8\");\n data = JSON.parse(data);\n\n // find the next id from the counters file and then increment the\n // counter in the file to indicate that id was used\n let id = -1;\n switch (counterType.toLowerCase()) {\n case \"house\":\n id = data.nextHouse;\n data.nextHouse++;\n break;\n case \"investor\":\n id = data.nextInvestor;\n data.nextInvestor++;\n break;\n case \"user\":\n id = data.nextUser;\n data.nextUser++;\n break;\n }\n\n // save the updated counter\n fs.writeFileSync(__dirname + \"/data/counters.json\", JSON.stringify(data));\n\n return id;\n}", "title": "" }, { "docid": "1b343c4b23524bd08b9025ba0d69232e", "score": "0.43871647", "text": "function versionToNumber(versionString) {\r\n\t\tvar versionNumber = 0;\r\n\t\tversionNumber = versionString.replace(/\\./g, \"\");\r\n\t\tversionNumber = parseInt(versionNumber, 10);\r\n\t\tif (isNaN(versionNumber) || versionNumber < 0) {\r\n\t\t\tversionNumber = 0;\r\n\t\t}\r\n\t\treturn versionNumber;\r\n\t}", "title": "" }, { "docid": "36b2251bf0f22839d03ca2c3abb0af64", "score": "0.43862182", "text": "_runMigration(migration) {\n return this._getExecutedAt(migration.id).then(date => {\n if (date != null) {\n this.info(`Migration '${migration.id}' was executed on ${moment(date).format('YYYY-MM-DD HH:mm:ss Z')}`);\n return Promise.resolve();\n }\n\n return migration.up(query).then(() => {\n this.info(`✓ Executed migration '${migration.id}'`);\n return this._saveMigration(migration.id);\n }).catch(err => {\n this.error(`✘ Migration '${migration.id}' failed`, err);\n return Promise.reject(err);\n });\n });\n }", "title": "" }, { "docid": "1518e285817caab1a8985c4a2f12343a", "score": "0.43825534", "text": "function COLUMNNUMBER(column) {\n\n if (!ISTEXT(column)) {\n return error$2.value;\n }\n\n // see toColumn for rant on why this is sensible even though it is illogical.\n var s = 0,\n secondPass;\n\n if (column.length > 0) {\n\n s = column.charCodeAt(0) - 'A'.charCodeAt(0);\n\n for (var i = 1; i < column.length; i++) {\n // compensate for spreadsheet column naming\n s += 1;\n s *= 26;\n s += column.charCodeAt(i) - 'A'.charCodeAt(0);\n secondPass = true;\n }\n\n return s;\n }\n\n return error$2.value;\n}", "title": "" }, { "docid": "150f41c6dcff5d11f1d28b05dfbddc4d", "score": "0.43700317", "text": "function takeANumber(katzDeliLine){\n \n if (katzDeliLine.length() > 0){\n \n linePosition = linePosition + 1;\n return linePosition;\n }\n else\n {\n linePosition = 1;\n return linePosition;\n }\n }", "title": "" }, { "docid": "ac9a15db2c518fd593ae80bce9d2def9", "score": "0.4368408", "text": "function version2Int(v) {\n\tvar parts = v.split('.');\n\tassert( parts.length === 3, 'Bad formated version=\"' + v + '\"');\n\tassert( parts[0].length > 0 && parts[0].length <= 2, \"Invalid major version length\" );\n\tassert( parts[1].length > 0 && parts[1].length <= 2, \"Invalid minor version length\" );\n\tassert( parts[2].length > 0 && parts[2].length <= 6, \"Invalid commit number length\" );\n\tvar major = parseInt(parts[0]);\n\tvar minor = parseInt(parts[1]);\n\tvar commit = parseInt(parts[2]);\n\treturn major * 100000000 + minor * 1000000 + commit;\n}", "title": "" }, { "docid": "4749593864c3d1dc4c61e80bc885e009", "score": "0.43645936", "text": "function getQuizNumber() {\n let pathArray = window.location.pathname.split(\"/\");\n let quizId=1;\n if (pathArray[1] == \"addChoice\") {\n quizId = pathArray[2];\n }\n return quizId;\n}", "title": "" }, { "docid": "39932dde211fa50671a30a18ee759019", "score": "0.43589213", "text": "function addMigration() {\n return async (name) => {\n console.log(`${name} migrated`);\n try {\n const migrationQueryInsert = `INSERT INTO migration (name) VALUES('${name}.js')`;\n console.log(migrationQueryInsert);\n await client.query(migrationQueryInsert);\n console.log(`${name} inserted into migration table`);\n } catch (error) {\n console.log(error);\n console.error(`${name} could not be inserted to migration table`);\n throw new Error(\"failed!\");\n }\n };\n }", "title": "" }, { "docid": "a7857bb3310d4ced8b45b6f9d3438712", "score": "0.43453798", "text": "function mapStepSequence(stepString){\n //handles that annoying edge case\n if ( stepString === 'TESTING' ) {\n return 1;\n }\n return Number(stepString.slice(-1));\n}", "title": "" }, { "docid": "2dea87fbb90d6c9ea181fd1644dd5653", "score": "0.4344397", "text": "function convertTeamToInt(name, teams){\n // iterate through teams list until team is found\n for(var i = 0; i < teams.length; i++){\n if(name === teams[i].team){\n // return index of team\n return i; \n }\n }\n // incorrect team name passed in\n return -1;\n}", "title": "" }, { "docid": "75cdca492319e679d485e91659d7b454", "score": "0.43404958", "text": "async getAutoIncrementValue() {\n\t\tconst _this = this;\n\t\tconst collection = _this.collection;\n\t\tconst db = _this.db;\n\t\tconst sequenceCollection = db.collection('sequence');\n\n\t\ttry {\n\t\t\tlet result = await sequenceCollection.findAndModify({ collection: collection }, null, { $inc: { sequence: 1 } }, { new: false });\n\n\t\t\tif (result.value == null) {\n\t\t\t\tsequenceCollection.insert({ collection: collection, sequence: 2 });\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn result.value.sequence;\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "title": "" }, { "docid": "4b9fe4072778866813189d867805f27d", "score": "0.43363246", "text": "function makeIdentifierFromModuleName(moduleName) {\n\t return ts.getBaseFileName(moduleName).replace(/^(\\d)/, \"_$1\").replace(/\\W/g, \"_\");\n\t }", "title": "" }, { "docid": "967d56884538ae53adcd0a18803f59ff", "score": "0.4333591", "text": "function sourceIndexForAst(ast) {\n if (Array.isArray(ast)) {\n //special handling for old Vyper versions\n ast = ast[0];\n }\n if (!ast) {\n return undefined;\n }\n return parseInt(ast.src.split(\":\")[2]);\n //src is given as start:length:file.\n //we want just the file.\n}", "title": "" }, { "docid": "1a110e8693dc869cf2ef2227b35b1a2d", "score": "0.43255794", "text": "function changer(num, str) {\n\t\treturn str.replace(\"1_1_\", num);\n\t}", "title": "" }, { "docid": "023e911277103a42fbb47b0fe4cfe35c", "score": "0.4314354", "text": "function getTeamNumber() {\r\n console.log('looking for team number');\r\n matchObj = grabMatch();\r\n matchObj = JSON.parse(localStorage.matchObj);\r\n match = localStorage.matchNumber - 1;\r\n alliance = getAlliance();\r\n station = getStation() - 1;\r\n if (alliance === 'red') {\r\n teamNumber = parseInt(matchObj[match].alliances.red.team_keys[station].substr(3), 10);\r\n return teamNumber\r\n } else if (alliance === 'blue') {\r\n teamNumber = parseInt(matchObj[match].alliances.blue.team_keys[station].substr(3), 10);\r\n return teamNumber\r\n }\r\n}", "title": "" }, { "docid": "1b2d91763326a179c9b75521169cdfcc", "score": "0.4312992", "text": "function getOrdinal(n) {\n if (n === 1) {\n return \"1st\";\n } else if (n === 2) {\n return \"2nd\";\n } else if (n === 3) {\n return \"3rd\";\n } else {\n return `${n}th`;\n }\n}", "title": "" }, { "docid": "2dea56758d28db763f668751d81d6e6b", "score": "0.43109402", "text": "function getCurrBoardId() {\n var re = new RegExp(\"/([0-9a-zA-Z\\-]+)$\");\n var regexMatches = re.exec(window.location.href);\n if (!regexMatches || !(regexMatches[1])) {\n return null; \n }\n return regexMatches[1];\n }", "title": "" }, { "docid": "476fe5eb2209788178453e9838cbde07", "score": "0.43067762", "text": "function migrateFile(sourceCode, mapping) {\n var e_1, _a;\n var legacyIds = Object.keys(mapping);\n try {\n for (var legacyIds_1 = tslib_1.__values(legacyIds), legacyIds_1_1 = legacyIds_1.next(); !legacyIds_1_1.done; legacyIds_1_1 = legacyIds_1.next()) {\n var legacyId = legacyIds_1_1.value;\n var cannonicalId = mapping[legacyId];\n var pattern = new RegExp(escapeRegExp(legacyId), 'g');\n sourceCode = sourceCode.replace(pattern, cannonicalId);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (legacyIds_1_1 && !legacyIds_1_1.done && (_a = legacyIds_1.return)) _a.call(legacyIds_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return sourceCode;\n }", "title": "" }, { "docid": "41483cfa42f39b63fe151db30e05bf4e", "score": "0.42926034", "text": "function getIndex(filestring, idx) {\n\tvar currString = filestring[idx];\n\tvar coordinate = currString.split(\";\");\n\tvar coordinate_split_top = coordinate[4].split(\":\");\n\tvar top = coordinate_split_top[1];\n\ttop = parseInt(top);\n\treturn top;\t\n}", "title": "" }, { "docid": "ccdc624be269ac89e9342ee9d65f8383", "score": "0.4292068", "text": "function $col_id(arr,col_name){\n\tfor(var i=0; i<arr[0].length; i++){\n\t\tif(arr[0][i].toUpperCase() == col_name.toUpperCase()){return i;}\n\t\t}\n\treturn -1;\n}", "title": "" }, { "docid": "106879748640104face9f798111da3c1", "score": "0.42871973", "text": "function getNameGenNum(){\n var num = getRandomNumber();\n switch(num) {\n case \"0\":\n num = 6;\n break;\n case \"1\":\n num = 7;\n break;\n case \"2\":\n num = 8;\n break;\n case \"3\":\n num = 9;\n break;\n case \"4\":\n num = 10;\n break;\n case \"5\":\n num = 11;\n break;\n case \"6\":\n num = 12;\n break;\n case \"7\":\n num = 13;\n break;\n case \"8\":\n num = 14;\n break;\n case \"9\":\n num = 15;\n break;\n default:\n num = 5;\n break;\n }\n return num;\n}", "title": "" }, { "docid": "8a33f7c1300362245ce1a5d82506c0cd", "score": "0.42829394", "text": "function validateMigrations(migrations, appliedMigrations) {\n const indexNotMatch = (migration, index) => migration.id !== index\n const invalidHash = migration =>\n appliedMigrations[migration.id] &&\n appliedMigrations[migration.id].hash !== migration.hash\n\n // Assert migration IDs are consecutive integers\n const notMatchingId = migrations.find(indexNotMatch)\n if (notMatchingId) {\n throw new Error(\n `Found a non-consecutive migration ID on file: '${\n notMatchingId.fileName\n }'`,\n )\n }\n\n // Assert migration hashes are still same\n const invalidHashes = migrations.filter(invalidHash)\n if (invalidHashes.length) {\n // Someone has altered one or more migrations which has already run - gasp!\n throw new Error(dedent`\n Hashes don't match for migrations '${invalidHashes.map(\n ({fileName}) => fileName,\n )}'.\n This means that the scripts have changed since it was applied.`)\n }\n}", "title": "" }, { "docid": "e79631786755753896bbe33aa13c8c5a", "score": "0.42773107", "text": "function getCol(element){\n var col_num = parseInt(element.classList[1][4]);\n return col_num;\n}", "title": "" }, { "docid": "67e29d8c673449a71a790abab71143c7", "score": "0.4275226", "text": "function max_id(dir) {\n\tvar files = directory_files(dir);\n\tif (files && files.length>0) {\n\t\treturn files.pop().id;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "3099d5145125cc2d95220266154f54e1", "score": "0.42729083", "text": "function toModuleName(filename) {\n return filename.replace('.js', '');\n}", "title": "" }, { "docid": "c834b50e4878583ee0fa4dfbdd68b769", "score": "0.42712575", "text": "function makeIdentifierFromModuleName(moduleName) {\n return ts.getBaseFileName(moduleName).replace(/^(\\d)/, \"_$1\").replace(/\\W/g, \"_\");\n }", "title": "" }, { "docid": "32931ebe4da28a9c12f701c86a889ef7", "score": "0.42689216", "text": "function runMigration4(tx, callback) {\n\n function updateRows(rows) {\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var doc_id_rev = parseHexString(row.hex, encoding);\n var idx = doc_id_rev.lastIndexOf('::');\n var doc_id = doc_id_rev.substring(0, idx);\n var rev$$1 = doc_id_rev.substring(idx + 2);\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET doc_id=?, rev=? WHERE doc_id_rev=?';\n tx.executeSql(sql, [doc_id, rev$$1, doc_id_rev], function () {\n doNext();\n });\n }\n doNext();\n }\n\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev';\n tx.executeSql(sql, [], function (tx) {\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) {\n var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n updateRows(rows);\n });\n });\n });\n });\n }", "title": "" }, { "docid": "f60922d5af6a5084ac83e3087970af33", "score": "0.42594287", "text": "function runMigration4(tx, callback) {\n\n function updateRows(rows) {\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var doc_id_rev = parseHexString(row.hex, encoding);\n var idx = doc_id_rev.lastIndexOf('::');\n var doc_id = doc_id_rev.substring(0, idx);\n var rev = doc_id_rev.substring(idx + 2);\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET doc_id=?, rev=? WHERE doc_id_rev=?';\n tx.executeSql(sql, [doc_id, rev, doc_id_rev], function () {\n doNext();\n });\n }\n doNext();\n }\n\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev';\n tx.executeSql(sql, [], function (tx) {\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) {\n var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n updateRows(rows);\n });\n });\n });\n });\n }", "title": "" }, { "docid": "f60922d5af6a5084ac83e3087970af33", "score": "0.42594287", "text": "function runMigration4(tx, callback) {\n\n function updateRows(rows) {\n function doNext() {\n if (!rows.length) {\n return callback(tx);\n }\n var row = rows.shift();\n var doc_id_rev = parseHexString(row.hex, encoding);\n var idx = doc_id_rev.lastIndexOf('::');\n var doc_id = doc_id_rev.substring(0, idx);\n var rev = doc_id_rev.substring(idx + 2);\n var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n ' SET doc_id=?, rev=? WHERE doc_id_rev=?';\n tx.executeSql(sql, [doc_id, rev, doc_id_rev], function () {\n doNext();\n });\n }\n doNext();\n }\n\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id';\n tx.executeSql(sql, [], function (tx) {\n var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev';\n tx.executeSql(sql, [], function (tx) {\n tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) {\n var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1;\n tx.executeSql(sql, [], function (tx, res) {\n var rows = [];\n for (var i = 0; i < res.rows.length; i++) {\n rows.push(res.rows.item(i));\n }\n updateRows(rows);\n });\n });\n });\n });\n }", "title": "" }, { "docid": "07447dc26603213f5c2f51b34c7bd2fb", "score": "0.42593583", "text": "async function migrate(db, config = {}) {\n config.force = config.force || false;\n config.table = config.table || 'migrations';\n config.migrationsPath =\n config.migrationsPath || path.join(process.cwd(), 'migrations');\n const { force, table, migrationsPath } = config;\n /* eslint-disable no-await-in-loop */\n const location = path.resolve(migrationsPath);\n // Get the list of migration files, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql' }\n // { id: 2, name: 'feature', filename: '002-feature.sql' }\n const migrations = await new Promise((resolve, reject) => {\n fs.readdir(location, (err, files) => {\n if (err) {\n return reject(err);\n }\n resolve(files\n .map(x => x.match(/^(\\d+).(.*?)\\.sql$/))\n .filter(x => x !== null)\n .map(x => ({ id: Number(x[1]), name: x[2], filename: x[0] }))\n .sort((a, b) => Math.sign(a.id - b.id)));\n });\n });\n if (!migrations.length) {\n throw new Error(`No migration files found in '${location}'.`);\n }\n // Get the list of migrations, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql', up: ..., down: ... }\n // { id: 2, name: 'feature', filename: '002-feature.sql', up: ..., down: ... }\n await Promise.all(migrations.map(migration => new Promise((resolve, reject) => {\n const filename = path.join(location, migration.filename);\n fs.readFile(filename, 'utf-8', (err, data) => {\n if (err) {\n return reject(err);\n }\n const [up, down] = data.split(/^--\\s+?down\\b/im);\n if (!down) {\n const message = `The ${migration.filename} file does not contain '-- Down' separator.`;\n return reject(new Error(message));\n }\n /* eslint-disable no-param-reassign */\n migration.up = up.replace(/^-- .*?$/gm, '').trim(); // Remove comments\n migration.down = down.trim(); // and trim whitespaces\n /* eslint-enable no-param-reassign */\n resolve();\n });\n })));\n // Create a database table for migrations meta data if it doesn't exist\n await db.run(`CREATE TABLE IF NOT EXISTS \"${table}\" (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL,\n up TEXT NOT NULL,\n down TEXT NOT NULL\n)`);\n // Get the list of already applied migrations\n let dbMigrations = await db.all(`SELECT id, name, up, down FROM \"${table}\" ORDER BY id ASC`);\n // Undo migrations that exist only in the database but not in files,\n // also undo the last migration if the `force` option is enabled.\n const lastMigration = migrations[migrations.length - 1];\n for (const migration of dbMigrations\n .slice()\n .sort((a, b) => Math.sign(b.id - a.id))) {\n if (!migrations.some(x => x.id === migration.id) ||\n (force && migration.id === lastMigration.id)) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.down);\n await db.run(`DELETE FROM \"${table}\" WHERE id = ?`, migration.id);\n await db.run('COMMIT');\n dbMigrations = dbMigrations.filter(x => x.id !== migration.id);\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n else {\n break;\n }\n }\n // Apply pending migrations\n const lastMigrationId = dbMigrations.length\n ? dbMigrations[dbMigrations.length - 1].id\n : 0;\n for (const migration of migrations) {\n if (migration.id > lastMigrationId) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.up);\n await db.run(`INSERT INTO \"${table}\" (id, name, up, down) VALUES (?, ?, ?, ?)`, migration.id, migration.name, migration.up, migration.down);\n await db.run('COMMIT');\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n }\n}", "title": "" }, { "docid": "8f1d5e1b50f022877deadc6b94900e23", "score": "0.42493156", "text": "function runMigration4(tx, callback) {\n\n\t function updateRows(rows) {\n\t function doNext() {\n\t if (!rows.length) {\n\t return callback(tx);\n\t }\n\t var row = rows.shift();\n\t var doc_id_rev = parseHexString(row.hex, encoding);\n\t var idx = doc_id_rev.lastIndexOf('::');\n\t var doc_id = doc_id_rev.substring(0, idx);\n\t var rev = doc_id_rev.substring(idx + 2);\n\t var sql = 'UPDATE ' + BY_SEQ_STORE$1 +\n\t ' SET doc_id=?, rev=? WHERE doc_id_rev=?';\n\t tx.executeSql(sql, [doc_id, rev, doc_id_rev], function () {\n\t doNext();\n\t });\n\t }\n\t doNext();\n\t }\n\n\t var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id';\n\t tx.executeSql(sql, [], function (tx) {\n\t var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev';\n\t tx.executeSql(sql, [], function (tx) {\n\t tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) {\n\t var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1;\n\t tx.executeSql(sql, [], function (tx, res) {\n\t var rows = [];\n\t for (var i = 0; i < res.rows.length; i++) {\n\t rows.push(res.rows.item(i));\n\t }\n\t updateRows(rows);\n\t });\n\t });\n\t });\n\t });\n\t }", "title": "" }, { "docid": "f2719645f14420d975ff87f59c7700ed", "score": "0.42460942", "text": "function getNextAlphaVersionName() {\n const lastReleasedVersion = versions[0];\n\n return `${lastReleasedVersion}`;\n}", "title": "" }, { "docid": "089af2cc5ceecdd2f72735f65d82d868", "score": "0.42423", "text": "function changeVisits(fileData) {\n\t\t\t\t\t\tvar dataArr = fileData.toString().split(' ');\n\t\t\t\t\t\tvar newFile = '';\n\t\t\t\t\t\tvar parseIntData = parseInt(dataArr[5]);\n\t\t\t\t\t\tparseIntData += 1;\n\t\t\t\t\t\tdataArr[5] = parseIntData;\n\t\t\t\t\t\tnewFile = dataArr.join(' ');\n\t\t\t\t\t\tconsole.log(newFile);\n\t\t\t\t\t\treturn newFile;\n\t\t\t\t\t}", "title": "" }, { "docid": "b7709f7581ad456e10d0351e047a9fa3", "score": "0.4240075", "text": "function platNametoNum(name){\n\tvar num = null;\n\tif(name == \"XBOX\"){\n\t\tnum = 1;\n\t}\n\tif(name == \"PSN\"){\n\t\tnum = 2;\n\t}\n\tif(name == \"PC\"){\n\t\tnum = 4;\n\t}\n\treturn num;\n}", "title": "" }, { "docid": "5d38d81509c3ea25bf27cf2bd52a38d5", "score": "0.42379183", "text": "function getFileExName(fileName){\r\n\tvar dotIndex=fileName.lastIndexOf(\".\");\r\n\treturn fileName.substring(dotIndex+1);\r\n}", "title": "" } ]
f1787e54f51dd9d39d12bf9585fd8c9a
If the status is 404 then render the not0found page
[ { "docid": "37b987b083bfa02a38ba01b4a4ac64b7", "score": "0.7776726", "text": "function notFound(req, res) {\n\tres.status(404).render('not-found.ejs');\n}", "title": "" } ]
[ { "docid": "805f6e883af7578a650224f6e69a2596", "score": "0.83340985", "text": "function errorNotFound() {\n // @FIXME Correct would be to set a 404 status code but that breaks the page as it utilizes\n // remote includes which the WA won't resolve\n response.setStatus(410);\n app.getView().render('error/notfound');\n}", "title": "" }, { "docid": "f1752bda084e51ee7c36f18356a9a68c", "score": "0.79532945", "text": "function notFound(req, res) { \n res.status(404).render('404.ejs')\n}", "title": "" }, { "docid": "b689527da9d2a306ec3686757116580a", "score": "0.764785", "text": "function notFound() {\n\tthis.writeHead(404);\n\tthis.end();\n}", "title": "" }, { "docid": "d3a3815f1335129f125fd261daae0f95", "score": "0.75669485", "text": "static renderNotFound(req, res) {\n Page.get('/', (err, page) => {\n if (!page)\n return Page.render(req, res, MaintenanceMode, {});\n res.status(404);\n page.elements.unshift({type: \"WarningNotice\", props: {message: \"OOPS! Page Not Found\"}});\n page.render(req, res);\n });\n }", "title": "" }, { "docid": "649d2a5d2f51353c52e385e44d97637f", "score": "0.7410102", "text": "function notFound(req, rsp, next) {\n skin(req, rsp, [custom404static, default404], next);\n}", "title": "" }, { "docid": "d00768037883e5fcd7663e3f24a3c5b3", "score": "0.73874456", "text": "show404(err, req, res, next) {\n res.sendStatus(404);\n }", "title": "" }, { "docid": "796b2cfb84b56fea2497637131202c48", "score": "0.7336259", "text": "function notFoundHandler(req, res, next) {\n res.status(404);\n res.send({err: 'not found'})\n}", "title": "" }, { "docid": "bfe0cc8a429afee16dc793e1c0b70170", "score": "0.7293934", "text": "function error404(response){\n\n\t\tresponse.writeHead(404 , {\"Context-Tupe\" : \"text/plain\"});\n\t\tresponse.write(\"<h1>ERROR 404 Archivo no encontrado </h1>\" + \"<h2>las opciones disponibles son </h2>\");\n\t\tresponse.write(\"<h3> http://localhost:8888/?json=json</h3>\");\n\t\tresponse.write(\"<h3> http://localhost:8888/?xml=xml<h3>\");\n\t\tresponse.end();\n}", "title": "" }, { "docid": "7081fbe42266e0797c1a655272dfd77a", "score": "0.7292049", "text": "function notFound (req, res) {\n res.status(404).json({ error: 'Not Found' })\n}", "title": "" }, { "docid": "a76e7c503346f18222b94c13379a435c", "score": "0.7284519", "text": "function NotFound(){\n return(\n <div>\n <h1>Page Not Found 404</h1>\n </div>\n )\n }", "title": "" }, { "docid": "6fde557356b2ded4a380ae06a41ca0c9", "score": "0.72778535", "text": "function display404(url, request, response) {\n response.writeHead(404, {\"Content-Type\": \"text/html\"});\n response.write(\"<h1>404 Not Found</h1>\");\n response.end(`The page you were looking for: ${url} can not be found.`);\n}", "title": "" }, { "docid": "dba9778dae6faf5038b15d497cae7058", "score": "0.72743434", "text": "function display404(url, req, res) {\n res.writeHead(404, {\n \"Content-Type\": \"text/html\"\n });\n res.write(\"<h1>404 Not Found </h1>\");\n res.end(\"The page you were looking for: \" + url + \" can not be found \");\n}", "title": "" }, { "docid": "dba9778dae6faf5038b15d497cae7058", "score": "0.72743434", "text": "function display404(url, req, res) {\n res.writeHead(404, {\n \"Content-Type\": \"text/html\"\n });\n res.write(\"<h1>404 Not Found </h1>\");\n res.end(\"The page you were looking for: \" + url + \" can not be found \");\n}", "title": "" }, { "docid": "dba9778dae6faf5038b15d497cae7058", "score": "0.72743434", "text": "function display404(url, req, res) {\n res.writeHead(404, {\n \"Content-Type\": \"text/html\"\n });\n res.write(\"<h1>404 Not Found </h1>\");\n res.end(\"The page you were looking for: \" + url + \" can not be found \");\n}", "title": "" }, { "docid": "b2f0614eefd0b3c2055e98f7b1daf4e2", "score": "0.72315294", "text": "function NotFound4040() {\n return <h1>La Pagina solicitada no existe</h1>\n}", "title": "" }, { "docid": "f063a2e38f14c5a31f5f789b4a82658a", "score": "0.72153723", "text": "function notFound(req, res, next) {\n return;\n return res.status(404).send({\n \"status\": 404,\n \"error\": \"Not Found\",\n \"message\": \"No message available\",\n \"path\": req.path\n });\n}", "title": "" }, { "docid": "1294d272d1668af4314ada3cd0580208", "score": "0.7200828", "text": "function serve404() {\r\n fs.readFile(ROOT + \"/404.html\", \"utf8\", function (err, data) { //async\r\n if (err)respond(500, err.message);\r\n else respond(404, data);\r\n });\r\n }", "title": "" }, { "docid": "3652b87129b3ab6a0d901797c011e549", "score": "0.71979004", "text": "_notFound(res, err) {\n return this._error(res, 404, err);\n }", "title": "" }, { "docid": "7780d27958b65daeafea02a5ea2cdc84", "score": "0.7192014", "text": "function notFoundResponse({res, message}) {\n\n res.status(404).send(message ? message : {message: 'File not found'})\n }", "title": "" }, { "docid": "4c937d4b75584bb55899798b7cb41a06", "score": "0.7156438", "text": "_render(settings, request, response, done) {\n this._renderTemplate('notfound/notfound', settings, request, response, done);\n }", "title": "" }, { "docid": "161e314dd2dc16fcb3a8ae0105a3ba27", "score": "0.714191", "text": "function notFound(req, res) {\n\tvar notFoundString = \"Not Found\\n\";\n\t\n\tres.writeHead(404, { \"Content-Type\": \"text/plain\", \n\t\t\t\t\t\t \"Content-Length\": notFoundString.length\n\t});\n\t\n\tres.end(notFoundString);\n} // end notFound()", "title": "" }, { "docid": "161e314dd2dc16fcb3a8ae0105a3ba27", "score": "0.714191", "text": "function notFound(req, res) {\n\tvar notFoundString = \"Not Found\\n\";\n\t\n\tres.writeHead(404, { \"Content-Type\": \"text/plain\", \n\t\t\t\t\t\t \"Content-Length\": notFoundString.length\n\t});\n\t\n\tres.end(notFoundString);\n} // end notFound()", "title": "" }, { "docid": "7a90863146df996adc933787e9e552de", "score": "0.71198934", "text": "notFound() {\n return this.status == 404;\n }", "title": "" }, { "docid": "9ac3d97e016e76e9bcd74cb441c0874b", "score": "0.710658", "text": "function defaultNotFound(req, res) {\n res.writeHead(404, { 'Content-Type': 'text/html' });\n res.end('<html><head><title>Error 404: Not Found</title></head><body>\\n' +\n '<h1>Error 404: Not Found</h1>\\n' +\n '<p>Cannot ' + req.method + ' ' + req.url + '</body></html>\\n');\n}", "title": "" }, { "docid": "c7e4be0550843e146d457ba9b31412bd", "score": "0.71033037", "text": "function show404(res) {\n\tres.writeHead(404, { 'Content-Type' : 'text/html' }); \n\tres.end('<html><body><h1>404 Not Found</h1></body></html>');\n}", "title": "" }, { "docid": "b5e4a1238b9047ff62c2c56175b9c9a5", "score": "0.7091744", "text": "function show_404()\n{\n\tvar c = new IndexController;\n c.params = {};\n\tc.not_found();\n}", "title": "" }, { "docid": "f8087238e58331bc6333806cfa21d905", "score": "0.70888066", "text": "function error404(req, res, next) {\n\t// ojeto tipo error de node.js\n\tlet error = new Error(),\n\t\tlocals = {\n\t\t\ttitulo : 'Error 404',\n\t\t\tdescripcion : 'Recurso no encontrado',\n\t\t\t// ponemos el error como tal con la propiedad error\n\t\t\terror : error\n\t\t}\n\n\terror.status = 404\n\t// cuando se ejecuta el middleware\n\t// activa la plantilla de error y le pasamos las variables\t\n\tres.render('error',locals)\t\n\n\tnext()\n}", "title": "" }, { "docid": "4082fd14e16696f6e9edf753f42de56a", "score": "0.7081111", "text": "function serve404(){\r\n\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){\r\n\t\t\tif(err)respondErr(err);\r\n\t\t\telse respond(404,data);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "e752193917e7310e563596a736548c43", "score": "0.70657593", "text": "static renderError(req, res) {\n res.status(500);\n Page.render(req, res, NotFound, {error:\"Server Error\"});\n }", "title": "" }, { "docid": "5ad5bdddddca66c87ca81b16a5982e53", "score": "0.7056728", "text": "function NOT_FOUND(res) {\n\tres.writeHead(400, {\n\t\t'Content-Type': 'application/json',\n\t\t'X-Powered-By': 'Node js'\n\t});\n\n\tres.end(\n\t\tjson({\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tmessage: '404 Not Found'\n\t\t\t}\n\t\t})\n\t);\n}", "title": "" }, { "docid": "ec6991d24660c8231f990ff10dc20847", "score": "0.7047124", "text": "function get404(req, res) {\r\n res.writeHead(404, \"Not Found\", { \"Content-Type\": \"text/html\" });\r\n res.write(\"<html><html><head><title>404</title></head><body>404: Not found. Go to <a href='/users'>Users</a></body></html>\");\r\n res.end();\r\n}", "title": "" }, { "docid": "29c867ef7d4da52009de3355108e19d9", "score": "0.7044588", "text": "function notFound(req, res, next) {\n next(createError(404));\n}", "title": "" }, { "docid": "8b01662f7b9f3f1e3df2087f3c04a487", "score": "0.7040961", "text": "function serve404(){\n\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){ //async\n\t\t\tif(err)respond(500,err.message);\n\t\t\telse respond(404,data);\n\t\t});\n\t}", "title": "" }, { "docid": "8b01662f7b9f3f1e3df2087f3c04a487", "score": "0.7040961", "text": "function serve404(){\n\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){ //async\n\t\t\tif(err)respond(500,err.message);\n\t\t\telse respond(404,data);\n\t\t});\n\t}", "title": "" }, { "docid": "8b01662f7b9f3f1e3df2087f3c04a487", "score": "0.7040961", "text": "function serve404(){\n\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){ //async\n\t\t\tif(err)respond(500,err.message);\n\t\t\telse respond(404,data);\n\t\t});\n\t}", "title": "" }, { "docid": "8b01662f7b9f3f1e3df2087f3c04a487", "score": "0.7040961", "text": "function serve404(){\n\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){ //async\n\t\t\tif(err)respond(500,err.message);\n\t\t\telse respond(404,data);\n\t\t});\n\t}", "title": "" }, { "docid": "829ad5bdb7b098fa7a9861fd5a2babca", "score": "0.70385057", "text": "function send404Res(res) { \n res.writeHead(404,{\n \"Content-Type\":\"text/plain\"\n });\n res.write(\"404 Not Found : oops;;\");\n res.end();\n}", "title": "" }, { "docid": "54eabb5a4414ef383675917db72a7c3a", "score": "0.7027683", "text": "function NotFound() {\n return (\n <>\n <h1>404</h1>\n <h2>Not Found</h2>\n </>\n )\n}", "title": "" }, { "docid": "2afe3e4b1627fc536ae85ff87116bcf7", "score": "0.70216256", "text": "function notFound(req, res, message) {\n message = (message || \"Not Found\\n\") + \"\";\n res.writeHead(404, {\n \"Content-Type\": \"text/plain\",\n \"Content-Length\": message.length\n });\n if (req.method !== \"HEAD\")\n res.write(message);\n res.end();\n}", "title": "" }, { "docid": "cbd76b7d63e7ac5a91ff0a55b847f1cd", "score": "0.7019901", "text": "function serve404(){\r\n\r\n\t\t//Asynchronous\r\n\t\tfs.readFile(ROOT+\"/404.html\", \"utf8\", function(err, data){\r\n\t\t\tif(err){\r\n\t\t\t\trespond(500, err.message);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\trespond(404, data);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "dddaa4a8743a3f3b693290db65edaeaf", "score": "0.69874495", "text": "function show404(req, res) {\n\tres.writeHead(404, {\n\t\t'Content-Type': 'text/plain'\n\t});\n\tres.end('Page Not Found! ><\\n');\n}", "title": "" }, { "docid": "fa68be9d6e4fa8652693d03960e6dbd5", "score": "0.69809103", "text": "function not_found(id) {\n var path = acre.form.build_url(app_routes.app_labels.error + \"/index\", {status:404, not_found:id});\n acre.route(path);\n acre.exit();\n}", "title": "" }, { "docid": "d1da4acb8c16018c05f679b7e2923328", "score": "0.6973567", "text": "function notFound(req, res, message) {\n message = (message || \"Not Found\\n\") + \"\";\n res.writeHead(404, {\n \"Content-Type\":\"text/plain\",\n \"Content-Length\":message.length\n });\n if (req.method !== \"HEAD\") {\n res.write(message);\n }\n res.end();\n}", "title": "" }, { "docid": "33324941713674937ba10fd3b580b77c", "score": "0.6972969", "text": "function handle404 (req, res, next) {\n\tres.json({message: 'Route not found'})\n}", "title": "" }, { "docid": "420386fa97a609862178591ff7b14e1c", "score": "0.6960039", "text": "function send404Response(response){\n response.writeHead(404, {\"Content-Type\": \"text/plain\"});\n response.write(\"Error 404 : Page not found!\");\n response.end();\n \n}", "title": "" }, { "docid": "78acbd7bdd6e3fa0ca4928deaed06269", "score": "0.69597566", "text": "function get404FetchResponse(){return lwc.readonly({ok:false,status:404,statusText:\"NOT_FOUND\",body:[{errorCode:\"NOT_FOUND\",message:\"The requested resource does not exist\"}]});}", "title": "" }, { "docid": "d3c423caab146fae687817050aff8993", "score": "0.69594574", "text": "function display404(url, res) {\n // Here we use the fs package to read our index.html file\n fs.readFile(__dirname + \"/public/404.html\", function (err, data) {\n if (err) throw err;\n // We then respond to the client with the HTML page by specifically telling the browser that we are delivering\n // an html file.\n res.writeHead(404, { \"Content-Type\": \"text/html\" });\n res.end(data);\n });\n}", "title": "" }, { "docid": "a76be688e1bcb91eca15d9d2a5ec25be", "score": "0.6955825", "text": "function display404(url, req, res) {\n var myHTML = \"<html>\" +\n \"<body><h1>404 Not Found </h1>\" +\n \"<p>The page you were looking for: \" + url + \" can not be found</p>\" +\n \"</body></html>\";\n\n // Configure the response to return a status code of 404 (meaning the page/resource asked for couldn't be found), and to be an HTML document\n res.writeHead(404, { \"Content-Type\": \"text/html\" });\n\n // End the response by sending the client the myHTML string (which gets rendered as an HTML document thanks to the code above)\n res.end(myHTML);\n}", "title": "" }, { "docid": "d2788c34a42c6d21517e3d6c25f79a2f", "score": "0.69523895", "text": "function pageNotFoundIfInvalid(req, res, next) {\n const errors = validationResult(req);\n if (errors.isEmpty()) {\n return next();\n }\n\n return next(createError(404, 'Страница не существует'));\n}", "title": "" }, { "docid": "52d8d23481c7fd3d173615d61db1927d", "score": "0.69511914", "text": "function send404(response) {\n response.writeHead(404,{'Content-type':'text/plain'});\n response.write('Error 404: resource not found');\n response.end();\n}", "title": "" }, { "docid": "5380d5460117302090aae120aa1e3336", "score": "0.6949147", "text": "function notFound() {\n var err = new Error();\n err.status = 404;\n err.message = 'User not found';\n return err;\n}", "title": "" }, { "docid": "9485f531593d5d3f31e6f511dbd6f444", "score": "0.6948847", "text": "function on_not_found() {\n return [Status404, {}];\n }", "title": "" }, { "docid": "4e0d0b1f7501e24a4d2fb6e82f5672e0", "score": "0.69354343", "text": "function sendNotFoundResponse(res) {\n res.status(404).send();\n}", "title": "" }, { "docid": "3e8d06eede967f46e44c2e929bd45838", "score": "0.69173604", "text": "function throw404(msg){\n res.writeHead(404, {\n 'Content-Type': 'application/json'\n });\n res.write(JSON.stringify({status:'error', msg: msg}));\n res.end();\n }", "title": "" }, { "docid": "6dc7ee32488bf2485ba07b038d9e57cd", "score": "0.6910098", "text": "function send404Response(response) {\r\n response.writeHead(404, {\"Content-Type\": \"text/plain\"});\r\n response.write(\"Error 404 - Page not found\");\r\n response.end();\r\n}", "title": "" }, { "docid": "14cad190c339840ff1df85642a8ce5e5", "score": "0.68991053", "text": "function not_found(res, msg) {\n console.log(\"[dashbaord] - not found!\");\n res.writeHead(404, {\n \"Content-Type\":\"application/json\"\n });\n var json = {\n error:true,\n message:msg\n };\n res.write(JSON.stringify(json), 'utf-8');\n res.end();\n}", "title": "" }, { "docid": "b1b45275887178634353b826af7a5873", "score": "0.6891133", "text": "function notFoundErrorResponse(err, response) {\n response.writeHead(404, {\n \"Content-Type\": \"text/plain\"\n });\n response.write(err.message);\n response.end();\n}", "title": "" }, { "docid": "b11b63389e26a8f28be128894721f585", "score": "0.68684864", "text": "function error404Handler(req, res, next) {\n var err = new Error('Not Found');\n err.status = 404;\n next(err);\n}", "title": "" }, { "docid": "d88827ea8d0a40bfaa7b8d2ab96b8c96", "score": "0.6863137", "text": "function notFoundHandler(request, response) {\n const {\n output: { statusCode, payload }\n } = boom.notFound()\n\n response.status(statusCode).json(payload)\n}", "title": "" }, { "docid": "9fe95274df10fb6c04a12529ae1de397", "score": "0.68616045", "text": "function not_found_exception(req, res, next) {\n res.status(404).json({\n message: \"This route does not exist!\"\n })\n}", "title": "" }, { "docid": "44f573a422715b9bf18866aaf8a8a2e0", "score": "0.6837707", "text": "function _onNotFound(req, res) {\n res.send(404);\n}", "title": "" }, { "docid": "dc6e05c2e6e0caf9ea211c94390fc80f", "score": "0.6818789", "text": "function send404(response) {\n response.writeHead(404,{'Content-Type': 'text/plain'});\n response.write('Error 404: resource not found.');\n response.end();\n}", "title": "" }, { "docid": "4e21364717dc9b30cecbc9dbb39e3492", "score": "0.68002677", "text": "function notFound(req, res, next) {\n const err = new APIError({\n message: \"Not found\",\n status: httpStatus.NOT_FOUND\n });\n return handler(err, req, res, next);\n}", "title": "" }, { "docid": "0b8b1e74381422d61fcf1727aacaa331", "score": "0.6775093", "text": "function Error(props) {\n return <h1>404 PAGE NOT FOUND</h1>;\n}", "title": "" }, { "docid": "40fbf1293eb0271b6d62db416a761ca4", "score": "0.6762044", "text": "function notFound(req, res) {\n\tres.setHeader(404, [ [\"Content-Type\", \"text/plain\"], [\"Content-Length\", CONFIG['message-server-not-found-message'].length]]);\n\tres.write(CONFIG['message-server-not-found-message']);\n\tres.end();\n}", "title": "" }, { "docid": "32ddda0ef808ce6e13f64ddd51540917", "score": "0.67448586", "text": "function fileNotFound(req, res) {\n let url = req.url;\n res.type('text/plain');\n res.status(404);\n res.send('Cannot find '+url);\n }", "title": "" }, { "docid": "32ddda0ef808ce6e13f64ddd51540917", "score": "0.67448586", "text": "function fileNotFound(req, res) {\n let url = req.url;\n res.type('text/plain');\n res.status(404);\n res.send('Cannot find '+url);\n }", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.6741913", "text": "notFound() {}", "title": "" }, { "docid": "0229c29599e579c474ca2d0e09284401", "score": "0.67290133", "text": "function send404(response) {\n\tresponse.writeHead(404, {'Content-Type': 'text/plain'});\n\tresponse.write('Error 404: resource not found.');\n\tresponse.end();\n}", "title": "" }, { "docid": "360ec81fc94e34ea485f45955b30d1c7", "score": "0.6728892", "text": "function returnError(req, res) {\n res.status(404);\n res.send('Not found');\n}", "title": "" }, { "docid": "dd818a6041493f0f8765dd5f7749435e", "score": "0.6722719", "text": "render() {\n return ( <\n div >\n Page Not Found <\n /div>\n )\n }", "title": "" }, { "docid": "f26929e679ed13dde03dae28761cdf2b", "score": "0.6720167", "text": "function send404(response){\r\n\tresponse.statusCode = 404;\r\n\tresponse.write(\"Unknown resource.\");\r\n\tresponse.end();\r\n}", "title": "" }, { "docid": "548ffe0dc2f034b9b759642a7f3b3b70", "score": "0.6713975", "text": "function isNotFoundResponse(response) {\n return response.status === 404;\n }", "title": "" }, { "docid": "56a82b96d99fac5d7627fe38f0859e53", "score": "0.6706169", "text": "function sendFileNotFound(responseObject) {\n var extension,\n notFoundPath;\n\n // if request was for a favicon, send the magik favicon\n if(responseObject.parsedUrl.pathname === '/favicon.ico'){\n sendFavicon(responseObject);\n } else {\n // file not found, set 404 code unless status code has been overridden\n responseObject.httpStatusCode = responseObject.httpStatusCode === 200 ? 404 : responseObject.httpStatusCode;\n responseObject.headers['Content-Type'] = 'text/html';\n responseObject.fileName = '';\n\n for(var i = 0, l = responseObject.config.extensions.length; i < l + 1; ++i) {\n\n extension = responseObject.config.extensions[i] ? '.' + responseObject.config.extensions[i] : '';\n notFoundPath = path.normalize(responseObject.documentRoot + path.sep + responseObject.config['not-found'] + extension);\n\n if(fs.existsSync(notFoundPath) && fs.statSync(notFoundPath).isFile()) {\n responseObject.filePath = notFoundPath;\n responseObject.fileName = path.normalize('/' + responseObject.config['not-found'] + extension);\n break;\n }\n }\n\n if(!responseObject.fileName) {\n responseObject.filePath = path.normalize(__dirname + path.sep + '404.html');\n }\n\n readFile(responseObject, parsers.fileNotFound);\n }\n }", "title": "" }, { "docid": "86db4100ed673281a1844d2b020431e7", "score": "0.6705184", "text": "function NotFoundPage({ staticContext = {} }) {\n staticContext.notFound = true\n return <div className=\"NotFoundPageCon\">Nothing to see here</div>\n}", "title": "" }, { "docid": "072804d383b7722e13cea29d4d996d68", "score": "0.6677791", "text": "notFoundError(err, req, res, next) {\n if (err instanceof Model.NotFoundError) {\n err.status = 401; // Unauthorized\n err.message = err.data.modelClass ? res.t(`${err.data.modelClass} not found`) : res.t('Record not found');\n err.processed = true;\n }\n next(err);\n }", "title": "" }, { "docid": "1a397443325e90c6890ee846e2fc7a85", "score": "0.6675824", "text": "handle404() {\n // catch 404 and forward to error handler\n this.app.use((req, res, next) => {\n next(this.error.get404());\n });\n // error handler\n this.app.use((err, req, res, next) => {\n // set locals, only providing error in development\n res.locals.message = err.message;\n res.locals.error = req.app.get('env') === 'development' ? err : {};\n\n // render the error page\n res.status(err.status || 500);\n res.json({\n 'success': false,\n 'data': {},\n 'errors': [err.message.toUpperCase()]\n });\n });\n }", "title": "" }, { "docid": "89ddb89f37b7386f1a602cf57e24fb15", "score": "0.6672651", "text": "function handleError(req, res, err) {\n switch (err.name) {\n case 'NotFoundError':\n render(req, res, 'error', err, {status: 404});\n break;\n default:\n render(req, res, 'error', err, {status: 500});\n }\n }", "title": "" }, { "docid": "de06b203c5ed87a06d86155d9a1d8fbe", "score": "0.6666946", "text": "function handleErrors(res) {\n res.writeHead(404, {'Content-Type': 'text/plain'}); \n res.write('Error 404: resource not found.');\n res.end();\n}", "title": "" }, { "docid": "7d739b935142fa167d775cdc51a3f50d", "score": "0.6665912", "text": "function send404(response) {\n response.writeHead(404, {\n 'Content-Type': 'text/plain'\n });\n response.write('Error 404: resource not found');\n response.end();\n}", "title": "" }, { "docid": "b7290dae007f769c7d05d608aa84abdb", "score": "0.665534", "text": "function fileNotFound(req, res) {\n let url = req.url;\n res.type('text/plain');\n res.status(404);\n res.send('Cannot find '+url);\n}", "title": "" }, { "docid": "1235ce1177e5d5a00f858f7506804ce9", "score": "0.6646743", "text": "function NotFoundPage() {\n return (\n <>\n <Head>\n <title>404 | Netflix roulette</title>\n <meta name=\"description\" content=\"Page not found\" />\n </Head>\n <Page404 />\n </>\n );\n}", "title": "" }, { "docid": "ec8d9c7660c36aa5182ca2a35c920a76", "score": "0.66359705", "text": "function NotFound () {\n return (\n <div>\n <h1>404</h1>\n\n <p>Page not found :(</p>\n <p>The requested page could not be found.</p>\n <p>Go back to <Link to=\"/\">main page</Link></p>\n <p>or check out these githubs: <a href=\"https://github.com/planeswalker1/\">planeswalker1</a>, <a href=\"https://github.com/colorlessenergy\">colorlessenergy</a>, <a href=\"https://github.com/genterpw\">genterpw</a></p>\n <img src={img} alt=\"Lanky from Growtopia\"/>\n </div>\n )\n}", "title": "" }, { "docid": "6390f0ded181730ed8b5db746e2333d6", "score": "0.6605171", "text": "function LoadTemplate404(jqXHR,textStatus,errorThrown) {\n if(jqXHR.status==404)\n ReadXML('annotationCache/XMLTemplates/labelme.xml',LoadTemplateSuccess,function(jqXHR) {\n alert(jqXHR.status);\n });\n else\n alert(jqXHR.status);\n}", "title": "" }, { "docid": "2ac33cf1d107ef426ef4f91f2856ece1", "score": "0.6596692", "text": "_swallow404(err) {\n if (err.status !== 404) {\n throw err;\n }\n }", "title": "" }, { "docid": "266b170da95c8c32b6369345b3779ffd", "score": "0.6590384", "text": "get404() {\n\t\treturn (this.errors.notfound) ? `\n\t\t\t<div class=\"alert alert-warning alert-dismissible fade show alertBanner\" role=\"alert\">\n\t\t\t\t<strong>404! - ${this.errors.notfound}</strong> does not exist. If it happens again, report it please.\n\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n\t\t\t\t\t<span aria-hidden=\"true\">&times;</span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t`:``;\n\t}", "title": "" }, { "docid": "698b76613899b02e8082d9a21d62b015", "score": "0.6590286", "text": "function do_error(request, response) {\n response.writeHead(200, {'Content-Type': 'text/plain'});\n response.end('404: ' + request.url + ' not found\\n');\n}", "title": "" }, { "docid": "e129025e34336e1328ff2a37217887f0", "score": "0.6582491", "text": "function send404error(msg,res,statusCode){\r\n res.setHeader('Content-Type', 'application/json');\r\n //res.status(statusCode);\r\n res.send(JSON.stringify({ status: 'failure', message : msg}, null, 3));\r\n}", "title": "" }, { "docid": "0876ffdb6892c0781a6ec960c7b67278", "score": "0.655305", "text": "endpointNotFound(request, response, next) {\n //Sending errors info to the Final errors Handler\n next(new ApiError(404, 'Endpoint could not be found'));\n }", "title": "" }, { "docid": "fc9be35c64f76160c27cecc172eb64e7", "score": "0.6509297", "text": "function error404(response) {\n console.log('error happened....');\n\n //write header with method 404 and content-type html.\n response.writeHead(404, { 'content-type': \"text/html\" });\n\n //created a readStream for error file and piped it to response .\n fs.createReadStream('./serve/error404/index.html').pipe(response);\n}", "title": "" }, { "docid": "6a2a1d6b13be07ddc963aa3641c3a9fb", "score": "0.6481622", "text": "function noResourceHandler(req, res, next) {\n console.log('404');\n res.status(404).end();\n}", "title": "" }, { "docid": "6637bef68f41c67cee7f9a8c56b4bf3f", "score": "0.6477611", "text": "function respondErr(err) {\r\n console.log(\"Handling error: \", err);\r\n if (err.code === \"ENOENT\") {\r\n serve404();\r\n } else {\r\n respond(500, err.message);\r\n }\r\n }", "title": "" }, { "docid": "fadcaf32f2ebd917830aa2845d1b75b0", "score": "0.64694196", "text": "isNotFoundError(status, _headers, _payload) {\n return (0, _errors.isNotFoundError)(status);\n }", "title": "" }, { "docid": "a26cb96ed7038a5de5f54c2869e39973", "score": "0.64520794", "text": "function respondErr(err){\n\t\tconsole.log(\"Handling error: \",err);\n\t\tif(err.code===\"ENOENT\"){\n\t\t\tserve404();\n\t\t}else{\n\t\t\trespond(500,err.message);\n\t\t}\n\t}", "title": "" }, { "docid": "a26cb96ed7038a5de5f54c2869e39973", "score": "0.64520794", "text": "function respondErr(err){\n\t\tconsole.log(\"Handling error: \",err);\n\t\tif(err.code===\"ENOENT\"){\n\t\t\tserve404();\n\t\t}else{\n\t\t\trespond(500,err.message);\n\t\t}\n\t}", "title": "" }, { "docid": "a26cb96ed7038a5de5f54c2869e39973", "score": "0.64520794", "text": "function respondErr(err){\n\t\tconsole.log(\"Handling error: \",err);\n\t\tif(err.code===\"ENOENT\"){\n\t\t\tserve404();\n\t\t}else{\n\t\t\trespond(500,err.message);\n\t\t}\n\t}", "title": "" }, { "docid": "a26cb96ed7038a5de5f54c2869e39973", "score": "0.64520794", "text": "function respondErr(err){\n\t\tconsole.log(\"Handling error: \",err);\n\t\tif(err.code===\"ENOENT\"){\n\t\t\tserve404();\n\t\t}else{\n\t\t\trespond(500,err.message);\n\t\t}\n\t}", "title": "" }, { "docid": "fa102107df45cbcdc6bf7cdad43c109b", "score": "0.64420986", "text": "function NotFound() {\n return (\n <>\n <h1>404:Not Found</h1>\n <div className=\"\">\n <div></div>\n </div>\n </>\n );\n}", "title": "" }, { "docid": "2e8f9d8878e30129af7a258944825537", "score": "0.6424242", "text": "function errorDisplay(err,req,res,next){\n \n // if some route acessed but error occur\n // this will also be handled\n res.status(err.status||500).json({\n Error:err.message||\"Server side error occured please return to home page\"\n })\n \n}", "title": "" }, { "docid": "288223ff8614a2f4176d4188b5ab12bc", "score": "0.64037293", "text": "function respondErr(err){\r\n\r\n\t\tconsole.log(\"Handling error: \", err);\r\n\r\n\t\tif(err.code === \"ENOENT\"){\r\n\t\t\tserve404();\r\n\t\t}\r\n\t\telse{\r\n\t\t\trespond(500, err.message);\r\n\t\t}\r\n\t}", "title": "" } ]
18b6a0e5a2bcf7ecdec2879a0d71d305
Vertice origem:v || Vertice destino:w || Feromonio: f
[ { "docid": "7d936a7d36714b6ec8fe8492aeedda68", "score": "0.57841164", "text": "atualizaFeromonioAresta(v, w, f){\n this.AdjList[v].map(p=>{\n if(p.vertice === w){\n p.feromonio = f;\n }\n })\n }", "title": "" } ]
[ { "docid": "508f3996a09aa52f26fd751bd7ac1fcd", "score": "0.60033715", "text": "function ispeziona_verbi() {\n for (var i=0; i<4; i+=1) {\n var verb = \"v_\"+i;\n for (j in eval(verb).syn) {\n debug_out(verb+\": \"+eval(verb).syn[j]+\"\\n\",1);\n }\n }\n \n}", "title": "" }, { "docid": "bbcb77b288e47a1901be1a46b5510e5c", "score": "0.59516585", "text": "function luoVuoroOsoitin() {\n var body = document.getElementsByTagName(\"body\")[0];\n\n var varit = [\"red\", \"blue\"];\n \n var vuoroOsoitin = luoYmpyra(varit[0], 30);\n vuoroOsoitin.setAttribute(\"id\", \"vuoro-osoitin\");\n vuoroOsoitin.vuoro = 0;\n \n /**\n * Vaihtaa vuoroa tämänhetkiseltä pelaajalta toiselle.\n */\n vuoroOsoitin.vaihdaVuoroa = function() {\n if (this.vuoro < 0 || this.vuoro >= varit.length) this.vuoro = 0;\n \n this.vuoro = 1 - this.vuoro; // Vaihtaa 0 -> 1, 1 -> 0\n this.vaihdaVaria(varit[this.vuoro]);\n \n if (this.getLiikuteltavatNappulat().length === 0) {\n var voittaja = 1 - this.vuoro;\n this.naytaVoittaja(voittaja);\n this.vaihdaVaria(varit[voittaja]);\n }\n };\n \n /**\n * Palauttaa vuoron pelin aloittajalle.\n */\n vuoroOsoitin.alusta = function() {\n this.vuoro = 0;\n this.vaihdaVaria(varit[this.vuoro]);\n \n var voittoIlmoitus = document.getElementById(\"voitto-ilmoitus\");\n if (voittoIlmoitus) voittoIlmoitus.parentNode.removeChild(voittoIlmoitus);\n };\n \n /**\n * Palauttaa tiedon, onko annetun pelinappulan pelaajalla pelivuoro.\n * @param pelaaja Tarkasteltavan pelaajan numero.\n * @return true, jos pelinappulan omistavalla pelaajalla on pelivuoro.\n */\n vuoroOsoitin.isVuoro = function(pelaaja) {\n return this.vuoro === pelaaja;\n };\n \n /**\n * Palauttaa taulukon kaikista pelinappuloista, joita voi tällä\n * vuorolla liikuttaa.\n * @return Taulukko kaikista tällä vuorolla liikuteltavista pelinappuloista.\n */\n vuoroOsoitin.getLiikuteltavatNappulat = function() {\n var taulukko = body.getElementsByTagName(\"table\")[0];\n var kaikki = taulukko.getKaikkiNappulat();\n var pelaajan = [];\n var syovat = [];\n \n for (var i = 0; i < kaikki.length; i++) {\n var nappula = kaikki[i];\n if (this.isVuoro(nappula.getPelaaja()) && nappula.voiLiikuttaa()) {\n pelaajan.push(nappula);\n \n if (nappula.voiSyoda()) {\n syovat.push(nappula);\n }\n }\n }\n \n if (syovat.length > 0) return syovat;\n return pelaajan;\n };\n \n /**\n * Näyttää annetun pelaajan voittajana käyttäjälle.\n * @param voittaja Pelin voittaja. (0 = pelaaja 1, 1 = pelaaja 2)\n */\n vuoroOsoitin.naytaVoittaja = function(voittaja) {\n var voittoIlmoitus = document.getElementById(\"voitto-ilmoitus\");\n if (!voittoIlmoitus)\n voittoIlmoitus = luoIlmoitus(\"voitto-ilmoitus\", \"Pelaaja \" + (voittaja + 1) + \" voitti pelin!\");\n \n if (voittaja) voittoIlmoitus.setAttribute(\"class\", \"sininen\");\n else voittoIlmoitus.setAttribute(\"class\", \"punainen\");\n \n this.parentNode.insertBefore(voittoIlmoitus, this);\n };\n \n var div = document.createElement(\"div\");\n div.appendChild(vuoroOsoitin);\n \n body.appendChild(div);\n\n return vuoroOsoitin;\n}", "title": "" }, { "docid": "717abd83b2f4ec7f52481d12c1a7e069", "score": "0.585134", "text": "function irIzquierda(rover) {\n\tswitch(rover.direction) {\n\t\tcase 'N':\n\t\trover.position = 'W';\n\t\tbreak;\n\t\tcase 'E':\n\t\trover.position = 'N';\n\t\tbreak;\n\t\tcase 'S':\n\t\trover.position = 'E';\n\t\tbreak;\n\t\tcase 'W':\n\t\trover.position = 'S';\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "5d49a9573fb6fd9e228fe114df54b51c", "score": "0.57634956", "text": "function superposicion_vertical(){\r\n for (n=0; n<casillas.length; n++){\r\n coordenadas_ocupadas(casillas[n]);\r\n coordenadas_pieza(pieza_movida);\r\n \r\n if ( \r\n ((casilla_ocupada_x==pieza_movida_x))\r\n &&\r\n (casillas[n].getAttribute(\"ocupada\")==\"true\")\r\n && \r\n (casillas[n] != casilla_anterior)\r\n )\r\n { \r\n // EVITAR SUPERPOSICIÓN VERTICAL\r\n\r\n \r\n // SE HACE UN NUEVO FOR PARA CARGAR TODAS LAS CASILLAS ALINEADAS\r\n //CON LA TORRE Y UNA PIEZA OCUPADA\r\n for (i=0; i<casillas.length; i++){\r\n coordenadas_genericas(casillas[i]);\r\n // CONDICIÓN PARA QUE UNA CASILLA QUEDE \"iNTERPUESTA\"\r\n if(\r\n (casilla_ocupada_x==casilla_generica_x)\r\n &&\r\n (Math.sign(casilla_ocupada_y-pieza_movida_y)\r\n ==\r\n Math.sign(casilla_generica_y-casilla_ocupada_y))\r\n ) \r\n { \r\n // SE AGREGA ESTE ATRIBUTO A LAS CASILLAS BLOQUEADAS POR OTRA PIEZA\r\n casillas[i].setAttribute('imposible','true');\r\n }\r\n \r\n }\r\n \r\n }\r\n // EVITAR SUPERPOSICIÓN HORIZONTAL\r\n if ( \r\n ((casilla_ocupada_y==pieza_movida_y))\r\n &&\r\n (casillas[n].getAttribute(\"ocupada\")==\"true\")\r\n && \r\n (casillas[n] != casilla_anterior)\r\n )\r\n { \r\n \r\n \r\n for (i=0; i<casillas.length; i++){\r\n coordenadas_genericas(casillas[i]);\r\n if(\r\n (casilla_ocupada_y==casilla_generica_y)\r\n &&\r\n (Math.sign(casilla_ocupada_x-pieza_movida_x)\r\n ==\r\n Math.sign(casilla_generica_x-casilla_ocupada_x))\r\n )\r\n\r\n \r\n // Excluir a la pieza del mismo color como casilla destino\r\n \r\n {\r\n casillas[i].setAttribute('imposible','true');\r\n }\r\n \r\n \r\n \r\n }\r\n\r\n \r\n }\r\n }\r\n }", "title": "" }, { "docid": "e686a1fc734f99b494b19a8c696bac5e", "score": "0.57431877", "text": "function pagina() {\n \n //var Guate = new VELatLong(15.5, -90.25);\n\n //map = new VEMap(\"Mapa\");\n //map.LoadMap(Guate, 8, VEMapStyle.Road);\n //return false;\n}", "title": "" }, { "docid": "9a0d10ff1916b2421e3efa0dc85e21f2", "score": "0.5743105", "text": "function renderPorSucursal() {\n var centro = 0;\n var caballito = 0;\n for ( var i = 0; i < local.ventas.length; i++ ) {\n if ( local.ventas[i].sucursal === 'Centro' ) {\n centro = ventasSucursal('Centro')\n } else if ( local.ventas[i].sucursal === 'Caballito') {\n caballito = ventasSucursal('Caballito')\n }\n }\n return ('Las ventas de la sucursal Centro son de: ' + centro) + (' Las ventas de la sucursal Caballito son de: ' + caballito)\n}", "title": "" }, { "docid": "804d338cdfb289c69afabccfdc5bd4b0", "score": "0.5690833", "text": "function encuentro_mruv2(){\r\n var posicion_final_mruv_2;\r\n var posicion_mruv_2 = pasaje_uni_pos(get_pos2(), get_sel_pos2())\r\n var velocidad_mruv_2 = pasaje_uni_vel(get_vel2(), get_sel_vel2())\r\n var tiempo_mruv_2 = pasaje_uni_ti(get_tiem2(), get_sel_tiem2())\r\n var aceleracion_mruv_2 = pasaje_uni_acel(get_acel2(), get_sel_acel2())\r\n posicion_final_mruv_2 = posicion_mruv_2 + (velocidad_mruv_2*tiempo_mruv_2) + ((1/2*aceleracion_mruv_2)*(tiempo_mruv_2*tiempo_mruv_2));\r\n return posicion_final_mruv_2;\r\n}", "title": "" }, { "docid": "0a9b15d2610b56af2d2bb5bf933dac48", "score": "0.5632045", "text": "function irPreguntasVideoG(){\n ocultarMostrar(\"videoJuegos1\",\"pantalla2\");\n}", "title": "" }, { "docid": "a8b464d0cfc4660a5efaacddc6b8cbb0", "score": "0.56066173", "text": "function interpretVerticeSearch(v,isV2Search){\n if (isNaN(v)) {\n if(isV2Search){\n return \"No entry\"\n }else{\n alert(\"Not valid entry.\");\n return false;\n }\n }else if(v <= 0 ||\n v > vertices.length / 2 ||\n v <= 0 ||\n v > vertices.length / 2){\n alert(\"Needed entry out of range\");\n return false;\n }else{\n return true;\n }\n}", "title": "" }, { "docid": "07995303e3371114b40535c950951942", "score": "0.56029296", "text": "function encuentro_mruv1(){\r\n var posicion_final_mruv_1;\r\n var posicion_mruv_1 = pasaje_uni_pos(get_pos1(), get_sel_pos1())\r\n var velocidad_mruv_1 = pasaje_uni_vel(get_vel1(), get_sel_vel1())\r\n var tiempo_mruv_1 = pasaje_uni_ti(get_tiem1(), get_sel_tiem1())\r\n var aceleracion_mruv_1 = pasaje_uni_acel(get_acel1(), get_sel_acel1())\r\n posicion_final_mruv_1 = posicion_mruv_1 + (velocidad_mruv_1*tiempo_mruv_1) + ((1/2*aceleracion_mruv_1)*(tiempo_mruv_1*tiempo_mruv_1));\r\n return posicion_final_mruv_1;\r\n}", "title": "" }, { "docid": "fcb3af439b0cbe8f4eed4419c232cbd7", "score": "0.55896896", "text": "function inverso (bola,piso) {\n\tvar diferencia = 0;\n//\talert(\"Posición del piso: \"+(piso.x+167.5)+\"\\n Posición de la bola: \"+bola.x);\n\t/*if(bola.x < piso.x + 32*escala)\n\t{\n\t\t\tdiferencia = piso.x + 32 - bola.x;\n\t\t\tbola.body.velocity.x =-(4*diferencia)*escala;\t\n\t}\n\telse if(bola.x > piso.x+32*escala)\n\t{\n\t\t\tdiferencia = bola.x - piso.x + 32;\n\t\t\tbola.body.velocity.x= (4*diferencia)*escala;\n\t}*/\n\tif(bola.x < piso.x + (juego.cache.getImage(\"piso\").width/2)*escala)\n\t{\n\t\t\tdiferencia = piso.x+((juego.cache.getImage(\"piso\").width/2)*escala) - bola.x;\n\t\t\tbola.body.velocity.x =-(10*diferencia*escala);\t\n\t}\n\telse if(bola.x > piso.x+ (juego.cache.getImage(\"piso\").width/2)*escala)\n\t{\n\t\t\tdiferencia = bola.x - piso.x+(juego.cache.getImage(\"piso\").width/2)*escala;\n\t\t\tbola.body.velocity.x= (4*diferencia*escala);\n\t}\n\telse\n\t{\n\t\t\tbola.body.velocity.x = 2 + Math.random() * 8;\n\t}\n}", "title": "" }, { "docid": "53d1b68838b030c2aafd1d85ac2a305d", "score": "0.54916483", "text": "adicionaAresta(v, w, p, f = 0.1){\n this.AdjList[v].push({vertice: w, peso: p, feromonio: f});\n this.AdjList[w].push({vertice: v, peso: p, feromonio: f});\n }", "title": "" }, { "docid": "23dcf23181d39036fb66bf5cf3ea4c75", "score": "0.54903334", "text": "function V(forme, y, e, mode)\n\t\t\t{\n\t\t\t\tvar p_0 = {\n\t\t\t\t\tx: forme[forme.length-1].x,\n\t\t\t\t\ty: forme[forme.length-1].y,\n\t\t\t\t\tpoids: 0};\n\t\t\t\tvar p_z;\n\n\t\t\t\tvar x = forme[forme.length-1].x;\n\n\t\t\t\tif(mode==\"absolute\")\n\t\t\t\t{\n\t\t\t\t\tp_z = {x:x, y:y, poids: 0};\n\t\t\t\t}\n\t\t\t\telse if(mode==\"relative\")\n\t\t\t\t{\n\t\t\t\t\tp_z = {x: x, y: forme[forme.length-1].y+y, poids: 0};\n\t\t\t\t}\n\t\t\t\tfor(var c = 0; c<=$rootScope.config.echantillonage_LHV; c++)\n\t\t\t\t{\n\t\t\t\t\tif(c!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar t = c/($rootScope.config.echantillonage_LHV);\n\t\t\t\t\t\tp_0.poids = 1-t;\n\t\t\t\t\t\tp_z.poids = t;\n\t\t\t\t\t\t//puiss 1\n\t\t\t\t\t\tvar m = barycentre(p_0, p_z);\n\n\t\t\t\t\t\tforme.push(m);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\treturn forme;\n\t\t\t}", "title": "" }, { "docid": "186e51b7322c9eb5e2992bb1928b160b", "score": "0.5483943", "text": "function Vr(){}", "title": "" }, { "docid": "677cc44402c8f3dde3461ab511220e76", "score": "0.54833335", "text": "function verif(a, b, c){\n\tif (a==b && a==c){\n\n\t\tif (a==piano){\n\n\t\t\talert(objet.joueur1 + \" défonce la gueule a \" + objet.joueur2);\n\n\t\t}else if(a==occitane){\n\n\t\t\talert(objet.joueur2 + \" deboite la gueule a \" + objet.joueur1);\n\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "38f1873ff8e8421612fba4a0b7690870", "score": "0.54712754", "text": "rebotar() {\n // if (this.posicion.x <= 0 || this.posicion.x > CANVAS_WIDTH) {\n // this.velocidad.x *= -1;\n // }\n // if (this.posicion.y <= 0 || this.posicion.y > CANVAS_HEIGHT - this.largo) {\n // this.velocidad.y *= -1;\n // }\n }", "title": "" }, { "docid": "25de7259eb2919423be2bb025bb9eeaf", "score": "0.5456971", "text": "function vytvorGraf(vstup) {\n\t// rozdeleni vstupu na jednotlive dvojice\n\tvar hrany = vstup.split(\";\");\n\n\tvar vrchol; // aktualni vrchol\n\tvar pridejHranu = true;\n\tvar pridejVrcholX = true;\n\tvar pridejVrcholY = true;\n\n\txy = null; // pole obsahujici dve hodnoty oddelene\n\n\t// rozdeleni prvni dvojice a ulozeni do vysledneho pole\n\txy = hrany[0].split(\",\");\n\tpole[xy[0]] = [];\n\tpole[xy[0]][0] = xy[1];\n\tpole[xy[1]] = [];\n\tpole[xy[1]][0] = xy[0];\n\n\tpoleVrcholu.push(xy[0]);\n\tpoleVrcholu.push(xy[1]);\n\n\t// zpracovani zbyvajicich hodnot ze vstupu\n\tfor (var i = 0; i < hrany.length; i++) {\n\t\tpridejHranu = true;\n\t\tpridejVrcholX = true;\n\t\tpridejVrcholY = true;\n\n\t\txy = hrany[i].split(\",\");\n\n\t\tfor (vrchol in pole) {\n\t\t\tif (xy[0] == vrchol) {\n\t\t\t\tfor (x = 0; x < pole[vrchol].length; x++) {\n\t\t\t\t\tif (pole[vrchol][x] == xy[1]) {\n\t\t\t\t\t\tpridejHranu = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// pridani nove hrany k vrcholu\n\t\t\t\tif (pridejHranu) {\n\t\t\t\t\tpole[vrchol][pole[vrchol].length] = xy[1];\n\t\t\t\t\tpridejHranu = true;\n\t\t\t\t}\n\t\t\t\tpridejVrcholX = false;\n\t\t\t}\n\t\t\tif (xy[1] == vrchol) {\n\t\t\t\tfor (x = 0; x < pole[vrchol].length; x++) {\n\t\t\t\t\tif (pole[vrchol][x] == xy[0]) {\n\t\t\t\t\t\tpridejHranu = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// pridani nove hrany k vrcholu\n\t\t\t\tif (pridejHranu) {\n\t\t\t\t\tpole[vrchol][pole[vrchol].length] = xy[0];\n\t\t\t\t\tpridejHranu = true;\n\t\t\t\t}\n\t\t\t\tpridejVrcholY = false;\n\t\t\t}\n\t\t}\n\t\t// pridavani novych vrcholu\n\t\tif (pridejVrcholX) {\n\t\t\tpole[xy[0]] = [];\n\t\t\tpole[xy[0]][0] = xy[1];\n\t\t\tpoleVrcholu.push(xy[0]);\n\t\t}\n\t\tif (pridejVrcholY) {\n\t\t\tpole[xy[1]] = [];\n\t\t\tpole[xy[1]][0] = xy[0];\n\t\t\tpoleVrcholu.push(xy[1]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8f9c3bb5d2eacf982233347a02057852", "score": "0.5453961", "text": "function inverso (bola,piso) {\n\tvar diferencia = 0;\n//\talert(\"Posición del piso: \"+(piso.x+167.5)+\"\\n Posición de la bola: \"+bola.x);\n\tif(bola.x < piso.x + 71)\n\t{\n\t\t\tdiferencia = piso.x + 71 - bola.x;\n\t\t\tbola.body.velocity.x =-(5*diferencia);\t\n\t}\n\telse if(bola.x > piso.x+71)\n\t{\n\t\t\tdiferencia = bola.x - piso.x + 71;\n\t\t\tbola.body.velocity.x= (2*diferencia);\n\t}\n\t/*if(bola.x < piso.x + (juego.cache.getImage(\"piso\").width/2)*escala)\n\t{\n\t\t\tdiferencia = piso.x+((juego.cache.getImage(\"piso\").width/2)*escala) - bola.x;\n\t\t\tbola.body.velocity.x =-(10*diferencia*escala);\t\n\t}\n\telse if(bola.x > piso.x+ (juego.cache.getImage(\"piso\").width/2)*escala)\n\t{\n\t\t\tdiferencia = bola.x - piso.x+(juego.cache.getImage(\"piso\").width/2)*escala;\n\t\t\tbola.body.velocity.x= (10*diferencia*escala);\n\t}*/\n\telse\n\t{\n\t\t\tbola.body.velocity.x = 2 + Math.random() * 8;\n\t}\n}", "title": "" }, { "docid": "3cfacf142f718ec5f27a2f4a8001d809", "score": "0.5452588", "text": "function pasaje_uni_vel(vel, select_vel){\r\n var velocidad;\r\n if (select_vel == \"km/h\"){\r\n velocidad = vel * (0.277778);\r\n }\r\n else {\r\n velocidad = vel\r\n }\r\n return velocidad;\r\n}", "title": "" }, { "docid": "d5c26cfc8685fb5da770455b00d20360", "score": "0.54371387", "text": "function armarCadena(vel,tam,tiempoVelocidadUsuario,unidadVel,unidadTam) {\r\n\t\tvar velocidad = \"Velocidad: \" +formatNumber(vel) + unidadVel + \" || \";\r\n\t\tvar tamanio = \"Tamaño: \" + formatNumber(tam) + unidadTam + \" || \";\r\n\treturn velocidad + tamanio +\"Tiempo: \" + tiempoVelocidadUsuario;;\r\n}", "title": "" }, { "docid": "d0232f1a6a0a29dd1911ccef238c17f1", "score": "0.54084307", "text": "efectoColision(x,y){\n let celda = this.getCelda(x,y);\n this.setEfecto(celda,'shake');\n }", "title": "" }, { "docid": "010d980f832338d04777628910c1d391", "score": "0.53877896", "text": "constructor(w,h,border_x,border_y,goal_w,goal_h) { // Constructor\n this.w = w; // Ancho del campo\n this.h = h; // Altura del campo\n this.border_x = border_x; // Margen horizontal del campo\n this.border_y = border_y; // Margen vertical del campo\n this.goal_h = goal_h; // Largo del area de gol\n this.goal_w = goal_w; // Ancho del area de gol\n this.TOP = border_y; // Borde Superior del Campo\n this.DOWN = h-border_y; // Borde Inferior del Campo\n this.LEFT = border_x; // Borde Izquierdo del Campo\n this.RIGHT = w-border_x; // Borde Derecho del Campo\n this.VMID = Math.floor(this.h/2); // Linea Horizontal en la mitad (Mitad Vertical)\n this.HMID = Math.floor(this.w/2); // Linea Vertical en la mitad (Mitad Horizonal)\n this.FIELD_COLOR = [255,255,255,255]; // Color del Campo en RGBA: Negro\n this.TOP_LEFT = new cv.Point(border_x,border_y); // Esquina Superior Izquierdo del Campo\n this.BOTTOM_RIGHT = new cv.Point(w-border_x,h-border_y); // Esquina Inferior Derecho del Campo\n this.TOP_GOAL = Math.floor(h/2)-Math.floor(goal_h/2) // Borde Superior de las áreas de gol\n this.BOTTOM_GOAL = Math.floor(h/2)+Math.floor(goal_h/2); // Borde Inferior de las áreas de gol\n this.LEFT_GOAL_L = border_x-Math.floor(goal_w/2) // Borde Izquierdo del área de gol izquierda\n this.LEFT_GOAL_R = border_x+Math.floor(goal_w/2) // Borde Derecho del área de gol izquierda\n this.TL_LEFT_GOAL = new cv.Point(this.LEFT_GOAL_L,this.TOP_GOAL); // Esquina Superior Izquierda del área de gol Izquierda \n this.BR_LEFT_GOAL = new cv.Point(this.LEFT_GOAL_R,this.BOTTOM_GOAL); // Esquina Inferior Derecha del área de gol Izquierda\n this.RIGHT_GOAL_L = w-border_x-Math.floor(goal_w/2); // Borde Izquierdoo del área de gol derecha\n this.RIGHT_GOAL_R = w-border_x+Math.floor(goal_w/2); // Borde Derecho del área de gol derecha\n this.TL_RIGHT_GOAL = new cv.Point(this.RIGHT_GOAL_L,this.TOP_GOAL); // Esquina Superior Izquierda del área de gol Derecha\n this.BR_RIGHT_GOAL = new cv.Point(this.RIGHT_GOAL_R,this.BOTTOM_GOAL); // Esquina Inferior Derecha del área de gol Derecha\n this.LEFT_GOAL_COLOR = [255,0,0,255]; // Color en RGBA del área de gol Izquierda: Rojo\n this.RIGHT_GOAL_COLOR = [0,0,255,255]; // Color en RGBA del área de gol Derecha: Azul\n }", "title": "" }, { "docid": "e70581efa67fb4e10d29f0e110426c88", "score": "0.53789026", "text": "function isVert (text){\r\n var lp = !!(text.indexOf(\"L\")+1);\r\n var mp = !!(text.indexOf(\"M\")+1);\r\n var rp = !!(text.indexOf(\"R\")+1);\r\n return lp!==false || mp!==false || rp!==false;\r\n}", "title": "" }, { "docid": "4d32dd897ac54751938db0d7ee51e6ac", "score": "0.53780854", "text": "function encuentro_mru2(){\r\n var posicion_final_mru_2;\r\n var posicion_mru_2 = pasaje_uni_pos(get_pos2(), get_sel_pos2());\r\n var velocidad_mru_2 = pasaje_uni_vel(get_vel2(), get_sel_vel2());\r\n var tiempo_mru_2 = pasaje_uni_ti(get_tiem2(), get_sel_tiem2());\r\n posicion_final_mru_2 = posicion_mru_2 + (velocidad_mru_2*tiempo_mru_2);\r\n return posicion_final_mru_2;\r\n}", "title": "" }, { "docid": "11f308353c28d434336b754e7197de62", "score": "0.536776", "text": "function encuentro_mru1(){\r\n var posicion_final_mru_1;\r\n var posicion_mru_1 = pasaje_uni_pos(get_pos1(), get_sel_pos1());\r\n var velocidad_mru_1 = pasaje_uni_vel(get_vel1(), get_sel_vel1());\r\n var tiempo_mru_1 = pasaje_uni_ti(get_tiem1(), get_sel_tiem1());\r\n posicion_final_mru_1 = (velocidad_mru_1*tiempo_mru_1) + posicion_mru_1;\r\n return posicion_final_mru_1;\r\n}", "title": "" }, { "docid": "c24745011fce90a78784cc2960dcc20a", "score": "0.5363349", "text": "comprobarFinJuego(){\n if(this.enemigos.length == 0 && this.nave.getVidasJugador()>0){\n this.finJuego = true;\n this.resultado = \"Victoria\";\n }\n\n else if(this.enemigos.length > 0 && this.nave.getVidasJugador()==0){\n this.finJuego = true;\n this.resultado = \"Derrota\";\n this.eliminarJugador()\n }\n \n if(this.enemigos.length > 0){\n for(var i=0;i<this.enemigos.length;i++){\n if(this.enemigos[i].position.z > 25){\n this.finJuego = true;\n this.resultado = \"Derrota\";\n this.eliminarJugador()\n }\n }\n }\n }", "title": "" }, { "docid": "552e20c5bd0c0f9674f91960e57c5fd6", "score": "0.5345568", "text": "function zone_reussite(act)\n{\n if(serie.volees.length==0) return;\n \n var moy=0;\n var tab_tri=[];\n var i=0;\n for(var v=0;v<sn.length;v++)\n {\n for(var f=0;f<sn[v].length;f++)\n {\n if(sn[v][f])\n {\n tab_tri[i]=sn[v][f].v();\n i++;\n }\n }\n }\n var borneh=Math.round(i*0.8);\n var borneb=Math.round(i*0.6);\n\n tab_tri.sort(function(a,b){return a-b}).reverse();\n\n if(i == 0)\n return;\n \n var zr; \n if(i < 2)\n zr=tab_tri[0];\n else if(borneh==borneb)\n zr=tab_tri[borneh] \n else\n {\n for(var f=borneb;f<borneh;f++)\n moy+=tab_tri[f];\n zr=moy/(borneh-borneb);\n }\n\n if(act==\"value\")\n return zr;\n else\n {\n document.getElementById(\"zone_reussite\").setAttribute(\"r\",50*(11-zr));\n document.getElementById(\"zone_reussite_val\").innerHTML=Math.round(10*zr)/10;\n }\n}", "title": "" }, { "docid": "59bd9a275d59082182d775e2c44a3db3", "score": "0.5341376", "text": "function atualiza_posicao_floco(vento) {\n\tthis.y += this.velocidade;\n\tthis.x += (vento / random(5, 10)) || 0;\n\n\tif (this.y > height) this.y = -30;\n\tif (this.x > width) this.x = 0;\n\tif (this.x < 0) this.x = width;\n\n\tthis.angulo += this.velocidade_giro;\n}", "title": "" }, { "docid": "1d3714cd7afb17b9d7ddec30995af73c", "score": "0.53381824", "text": "function saoVizinhos(e1, e2) {\n\t\n\tvar position1 = e1.position();\n\tvar position2 = e2.position();\n\tvar width1 = e1.width();\n\tvar height1 = e1.height();\n\tif((position2.left >= position1.left - width1) && (position2.left < position1.left + 2*width1) && (position2.top >= position1.top - height1) && (position2.top < position1.top + 2*height1))\n\t\treturn true;\n\telse \n\t\treturn false;\n}", "title": "" }, { "docid": "7f266c4e7cef11694618c33e0f01c3ef", "score": "0.5325654", "text": "function tamanoVentana() {\n\tvar w = window.innerWidth\n\t\t|| document.documentElement.clientWidth\n\t\t|| document.body.clientWidth;\n\n\tvar h = window.innerHeight\n\t\t|| document.documentElement.clientHeight\n\t\t|| document.body.clientHeight;\n\n\tvar x = document.getElementById(\"infoVentana\");\n\tx.innerHTML = \n \"<h3>\" + \"La ventana del navegador tiene anchura: \" + w + \"px, y de alto \" + h +\"px.\" + \"</h3>\";\t\n}", "title": "" }, { "docid": "5764c1cabcc5629cf17b2e81f7d90bf0", "score": "0.53243595", "text": "function CarreraDoStep(){\n // computiamo l'evolversi della macchina\n\n var vxm, vym, vzm; // velocita' in spazio macchina\n\n // da vel frame mondo a vel frame macchina\n var cosf = Math.cos(facing*Math.PI/180.0);\n var sinf = Math.sin(facing*Math.PI/180.0);\n vxm = +cosf*vx - sinf*vz;\n vym = vy;\n vzm = +sinf*vx + cosf*vz;\n\n // gestione dello sterzo\n if (key[1]) sterzo+=velSterzo;\n if (key[3]) sterzo-=velSterzo;\n sterzo*=velRitornoSterzo; // ritorno a volante fermo\n\n if(incVelocitaLancio){\n\t\tvzm-=(accMax+0.2);\n\t\tincVelocitaLancio = false;\t\n }\n else{\n\t if (key[0]) vzm-=accMax; // accelerazione in avanti\n\t if (key[2]) vzm+=accMax; // accelerazione indietro\n }\n\n // attriti (semplificando)\n vxm*=attritoX;\n vym*=attritoY;\n vzm*=attritoZ;\n\n // l'orientamento della macchina segue quello dello sterzo\n // (a seconda della velocita' sulla z)\n facing = facing - (vzm*grip)*sterzo;\n \n // rotazione mozzo ruote (a seconda della velocita' sull'asse z della macchina):\n var da ; //delta angolo\n da=(180.0*vzm)/(Math.PI*raggioRuotaA); //Ricavata dalla formula della velocità angolare (vedi slide 17 pacco progetto_car)\n mozzoA+=da;\n da=(180.0*vzm)/(Math.PI*raggioRuotaP);\n mozzoP+=da;\n\n // ritorno a vel coord mondo\n vx = +cosf*vxm + sinf*vzm;\n vy = vym;\n vz = -sinf*vxm + cosf*vzm;\n\n // posizione = posizione + velocita * delta t (ma e' delta t costante = 1)\n px+=vx;\n py+=vy;\n pz+=vz;\n \n //TODO: Controllo collisioni\n\t// if(px+Math.abs(2*Math.cos(facing)) > 3 || px-Math.abs(2*Math.cos(facing)) < -3\t)\n\t\t// px-=vx;\n\t// else\n\t\t// px+=vx;\n\t// py+=vy;\n\t// pz+=vz;\n}", "title": "" }, { "docid": "90c8e0f48eb173d2a04e10e46ef6c370", "score": "0.5321083", "text": "function moveVerm(pat){\n\n if(mvLeft && !mvRight){\n if(pat.batx == 0) {\n pat.x -= pat.velocidade;\n }\n else if(pat.batx == 1){\n pat.x += pat.velocidade;\n }\n else if(pat.batx == 2){\n pat.y += pat.velocidade;\n }\n else if(pat.batx == 3){\n pat.y -= pat.velocidade;\n }\n\n } else\n if(mvRight && !mvLeft){\n if(pat.batx == 0) {\n pat.y -= pat.velocidade;\n }\n else if(pat.batx == 1){\n pat.y += pat.velocidade;\n }\n else if(pat.batx == 2){\n pat.x += pat.velocidade;\n }\n else if(pat.batx == 3){\n pat.x -= pat.velocidade;\n }\n\n }\n if(mvUp && !mvDown){\n if(pat.batx == 0) {\n pat.x += pat.velocidade;\n }\n else if(pat.batx == 1){\n pat.x -= pat.velocidade;\n }\n else if(pat.batx == 2){\n pat.y -= pat.velocidade;\n }\n else if(pat.batx == 3){\n pat.y += pat.velocidade;\n }\n \n } else\n if(mvDown && !mvUp){\n if(pat.batx == 0) {\n pat.x -= pat.velocidade;\n }\n else if(pat.batx == 1){\n pat.x += pat.velocidade;\n }\n else if(pat.batx == 2){\n pat.y += pat.velocidade;\n }\n else if(pat.batx == 3){\n pat.y -= pat.velocidade;\n }\n\n }\n\n}", "title": "" }, { "docid": "1235a0fa1a0778fab7e4c0c3f3ce907b", "score": "0.5318301", "text": "function Vw(a,b){this.H=[];this.ra=a;this.R=b||null;this.D=this.C=!1;this.A=void 0;this.aa=this.ca=this.S=!1;this.N=0;this.B=null;this.F=0}", "title": "" }, { "docid": "a03cb9141d300ce392fd040707300aa4", "score": "0.53157985", "text": "retornaDados(v, w, prop){\n let peso;\n this.AdjList[v].map(p =>{\n if(p['vertice'] == w) \n peso = p[prop];\n })\n return peso;\n }", "title": "" }, { "docid": "63c4a8e5d5eb5c03127589b90e8b6db2", "score": "0.5312221", "text": "function jogada(event, pc) {\n var cords = event == null ? pc : mousePos(event);\n if (cords.x < 200) {\n //Quadrado 1 da primeira linha\n if (cords.y < 200) {\n if (velha[0] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[0] = 1;\n desenhaX(50, 50);\n\n } else {\n velha[0] = 0;\n\n desenhaBola(50, 50);\n\n }\n //Quadrado 1 da segunda linha\n } else if (cords.y < 400) {\n if (velha[3] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[3] = 1;\n desenhaX(50, 250);\n\n } else {\n velha[3] = 0;\n desenhaBola(50, 250);\n\n }\n //Quadrado 1 da terceira linha\n } else if (cords.y < 600) {\n if (velha[6] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[6] = 1\n desenhaX(50, 450);\n\n } else {\n velha[6] = 0;\n desenhaBola(50, 450);\n\n }\n }\n }\n else if (cords.x < 400) {\n //Quadrado 2 da primeira linha\n if (cords.y < 200) {\n if (velha[1] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[1] = 1;\n desenhaX(250, 50);\n\n } else {\n velha[1] = 0;\n desenhaBola(250, 50);\n\n }\n //Quadrado 2 da segunda linha\n } else if (cords.y < 400) {\n if (velha[4] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[4] = 1;\n desenhaX(250, 250);\n\n } else {\n velha[4] = 0;\n desenhaBola(250, 250);\n\n }\n //Quadrado 2 da terceira linha\n } else if (cords.y < 600) {\n if (velha[7] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[7] = 1;\n desenhaX(250, 450);\n\n } else {\n velha[7] = 0;\n desenhaBola(250, 450);\n\n }\n }\n }\n else if (cords.x < 600) {\n // Quadrado 3 da primeira linha\n if (cords.y < 200) {\n if (velha[2] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[2] = 1;\n desenhaX(450, 50);\n\n } else {\n velha[2] = 0;\n desenhaBola(450, 50);\n\n }\n // Quadrado 3 da segunda linha\n } else if (cords.y < 400) {\n if (velha[5] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[5] = 1;\n desenhaX(450, 250);\n\n } else {\n velha[5] = 0;\n desenhaBola(450, 250);\n\n }\n // Quadrado 3 da terceira linha\n } else if (cords.y < 600) {\n if (velha[8] != -5) {\n return false;\n }\n if ((cont % 2) == 1) {\n velha[8] = 1;\n desenhaX(450, 450);\n\n } else {\n velha[8] = 0;\n desenhaBola(450, 450);\n }\n }\n }\n cont++;\n if (pc == null && single == true) {\n computador();\n }\n\n}", "title": "" }, { "docid": "b5d98411fac0a741be3b0b9dae17fda6", "score": "0.5311413", "text": "voltea(){\n this.volteada=!this.volteada;\n if(this.volteada){\n this.imagen=this.caratula;\n } else {\n this.imagen=this.reverso;\n }\n }", "title": "" }, { "docid": "43222f58a8b1b9c0fce5ee51e6020716", "score": "0.53111625", "text": "function check_HorV_Path(origin, who , which){\n // init\n var count = 0;\n var blocked_flag = false;\n var geo;\n\n //initiazes CONSTANTS\n const letter = (who) ? 'x' : 'o'; // what letter are we looking for\n const letter_ = (!who) ? 'x' : 'o';\n const desc = which ? \"vertical\" : \"horizontal\";\n const indexCalc = which ? vertStride : horzStride;\n \n switch( ('' + which + origin) ){\n case \"10\": geo= \"left \"; break;\n case \"11\": geo= \"middle \"; break;\n case \"12\": geo= \"right \"; break;\n case \"00\": geo= \"top \"; break;\n case \"01\": geo= \"middle \"; break;\n case \"02\": geo= \"bottom \"; break;\n default: geo=\"diagonal\"; break;\n }\n\n\n //=== checking horizontal or vertical possibilitses\n for(let x = 0; x < 3; x++){\n if(elements[ indexCalc(x,origin) ] == letter ) count += 1; // increment always if right.\n else if(elements[ indexCalc(x,origin) ] == letter_ ) blocked_flag = true; // Stop right there!\n }\n\tif(count === 3){\n\t return geo + desc + \"won by \" + letter;\n\t }\n // now that we have counted, we need to form a conclusion\n\telse if(count === 2 && blocked_flag ){\n return geo + desc + \" blocked by \" + letter_;\n }\n else if(count === 2){\n // only triggered by 2, not one or 3\n return geo + desc + \" potential by \" + letter;\n }\n else{\n return geo + desc + \" nothing by \" + letter ;\n }\n}", "title": "" }, { "docid": "e3437d5ee53bf697c3a6b6db6cbca8a1", "score": "0.53040886", "text": "function caminar() {\n var deltaX = 0,\n deltaY = 0;\n switch (orientacion) {\n case \"N\":\n deltaY = -64;\n break;\n case \"E\":\n deltaX = 64;\n break;\n case \"S\":\n deltaY = 64;\n break;\n case \"O\":\n deltaX = -64;\n break;\n }\n animarCaminata(deltaX, deltaY); //llama para mover al personaje\n\n}", "title": "" }, { "docid": "551059b996745124ed01b44129006c4b", "score": "0.5295624", "text": "function getFCV(field, hor, ver){\r\n if(field[ver] === undefined){\r\n return 0;\r\n }else{\r\n if(field[ver][hor] === undefined){\r\n return 0;\r\n }else{\r\n return field[ver][hor];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9ab6c5a5b787452c64c97aebc1c59a4e", "score": "0.5293391", "text": "function funz_autista(sezione) {\n avanti(sezione);\n $(\"#scelta_tunnel\").text(testi[lingua].h3.autista);\n\n $(\"#img_bimbo\").transition({y:-80, delay:2000}, 1000);\n $(\"#img_macchina2\").transition({x:-530, y:-200, rotate: '-22deg', delay:2000}, 1000);\n}", "title": "" }, { "docid": "c7c718545986e6de090c17128dc1daae", "score": "0.5292441", "text": "poserBombe() {\n if (this.bombesDispo && this.joueur.vivant) {\n let colonne = this.joueur.colonneCourante;\n let ligne = this.joueur.ligneCourante;\n if (this.deplacementEnCours) {\n colonne = this.joueur.getColonneFromPosition();\n ligne = this.joueur.getLigneFromPosition();\n } \n if (this.map.caseEstLibre(colonne, ligne)) {\n this.envoieMessage(\"BoP#\" + colonne + \"#\" + ligne);\n }\n }\n }", "title": "" }, { "docid": "74abb7d7f1303f6a0c56d03bd4776ff6", "score": "0.52922827", "text": "function fV(a,b){this.af=[];this.Lea=a;this.Vda=b||null;this.rL=this.xE=!1;this.ht=void 0;this.i4=this.Ara=this.A3=!1;this.nU=0;this.Xd=null;this.w3=0}", "title": "" }, { "docid": "f7862b3ef2508a636d3166bc8d5aa8cf", "score": "0.5286476", "text": "setCeldaEfecto(valor,x,y){ }", "title": "" }, { "docid": "bc7527279feb6835f93a988c5d905d1f", "score": "0.5281699", "text": "constructor(maxima, inicial){\n this.maxima = maxima;\n this.inicial = inicial;\n this.vidas = this.inicial;\n\n // variáveis para a posição e o tamanho da imagem:\n this.largura = 30;\n this.altura = 30;\n\n this.xInicial = 20;\n this.y = 20;\n }", "title": "" }, { "docid": "7a19f156fa16c1338153444b06dfa3f7", "score": "0.5272287", "text": "bouge(){\r\n this.gauche=this.gauche+this.vitesseX;\r\n this.haut=this.haut+this.vitesseY;\r\n\r\n // Appel de la variable qui limite les mouvements de la balle\r\n this.limitmouv();\r\n\r\n this.majHTML();\r\n }", "title": "" }, { "docid": "d171372b88c3a767424a9542bd637c78", "score": "0.5269559", "text": "function ouvrirMur(){\n let camera = Scene.getInstance().camera;\n\n //la direction que la camera fait face\n let fltX = getCibleCameraX(camera) - getPositionCameraX(camera);\n let fltZ = getCibleCameraZ(camera) - getPositionCameraZ(camera);\n\n //la position de la camera\n let intXCamera = Math.floor(getPositionX(camera));\n let intZCamera = Math.floor(getPositionZ(camera));\n\n //nord\n if(fltZ<=-1 && fltX>=-1 && fltX<=1){\n intZCamera=intZCamera-1;\n }\n //sud\n else if(fltZ>=1 && fltX>=-1 && fltX<=1){\n intZCamera=intZCamera+1;\n }\n //est\n else if(fltZ>=-1 && fltZ<=1 && fltX>=1){\n intXCamera=intXCamera+1;\n }\n //ouest\n else{\n intXCamera=intXCamera-1;\n }\n try{\n //regarde si l'objet est un mur ouvrable\n if((Scene.getInstance().tabDessinables[0].grille[intZCamera][intXCamera].constructor.name == \"MurOuvrable\")){\n //enlever l'objet dans la grille et enlever 1 ouvreur\n Scene.getInstance().tabDessinables[0].grille[intZCamera][intXCamera].ouvert = true;\n Scene.getInstance().tabDessinables[0].intNbOuvreurs--;\n Sounds.getInstance().playOuvrirMur();\n Scene.getInstance().intScore -= 50;\n }\n else\n console.log('Vous ne pouvez pas ouvrir un' + (Scene.getInstance().tabDessinables[0].grille[intZCamera][intXCamera].constructor.name))\n }catch(e){console.log('Vous faites face à aucun objet')}\n}", "title": "" }, { "docid": "0239d19bee81029127ccc70652ab4970", "score": "0.52615476", "text": "function drawTraversinoOrPP(pos_s, pos_e, h){\n\t\tvar dim = pos_s.distanceTo(pos_e)-100;\n\t\tvar geometry = new THREE.CylinderGeometry( 30, 30, dim, 32 );\n\t\tvar traversinoOr = new THREE.Mesh( geometry, traversino_material );\n\t\ttraversinoOr.position.set((pos_s.x+pos_e.x)/2, h, (pos_s.z+pos_e.z)/2);\n\t\ttraversinoOr.rotateX(90*Math.PI/180);\n\t\treturn traversinoOr;\n\t}", "title": "" }, { "docid": "650b15ca18f883404fb000923c13163f", "score": "0.52450526", "text": "function irDerecha(rover) {\n\tswitch(rover.direction) {\n\t\tcase 'N':\n\t\trover.position = 'E';\n\t\tbreak;\n\t\tcase 'E':\n\t\trover.position = 'S';\n\t\tbreak;\n\t\tcase 'S':\n\t\trover.position = 'W';\n\t\tbreak;\n\t\tcase 'W':\n\t\trover.position = 'N';\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "b8da4d576dc0dd64462127a8eda192f9", "score": "0.5231158", "text": "function vepego(pego){\r\n if(pego>=1){\r\n z = Mudaz(z)\r\n x=movePeixe(x)\r\n FunpeixeD(x,500,z)\r\n }if(pego<1){\r\n z = Mudaz(z)\r\n if(z<=20)\r\n ctx.drawImage(peixe2pego,1260,y)\r\n else\r\n ctx.drawImage(peixe1pego,1260,y)\r\n }\r\n }", "title": "" }, { "docid": "06548186540864e5e74fc08ed3f5df28", "score": "0.5230828", "text": "function ipotecaTerreno(){\n\n //verifico che il terreno esista e salvo il risultato in proprietà\n var n = EsisteTerreno(props.terreni, terreno);\n \n if(n === -1){\n setTestoIpoteche('Controlla che il nome del terreno sia scritto in modo corretto');\n setOpenIpoteche(true); \n return;\n }\n var proprietà = props.terreni[n];\n \n \n //verifico che sul terreno non ci siano ne case ne alberghi\n if(proprietà.case > 0 || proprietà.alberghi > 0){\n setTestoIpoteche('Non puoi ipotecare un terreno con case o alberghi');\n setOpenIpoteche(true); \n return;\n }\n //verifico che il turnoGiocatore sia proprietario di proprietà\n if((proprietà.proprietario !== props.turnoGiocatore)){\n setTestoIpoteche('Non puoi ipotecare una proprietà che non ti appartiene');\n setOpenIpoteche(true);\n return;\n }\n\n //verifico che il terreno non si già ipotecato\n if (proprietà.ipotecato === true) {\n setTestoIpoteche('Non puoi ipotecare una proprietà già ipotecata');\n setOpenIpoteche(true);\n return;\n }\n \n //modifico l'array terreni e l'array giocatori\n proprietà.ipotecato = true;\n var nuoviTerreni = props.terreni;\n nuoviTerreni[n] = proprietà;\n props.setTerreni(nuoviTerreni);\n\n var nuoviGiocatori = props.giocatori;\n var guadagno = proprietà.valore/2;\n nuoviGiocatori[props.turnoGiocatore].capitale = nuoviGiocatori[props.turnoGiocatore].capitale + guadagno;\n props.setGiocatori(nuoviGiocatori);\n\n setTestoIpoteche('Questa proprietà è stata ipotecata. Hai guadagnato:'+guadagno);\n setOpenIpoteche(true); \n }", "title": "" }, { "docid": "9f3effddc63a1b1a03426f482f9e81d9", "score": "0.52292013", "text": "function iniciaConvoy() {\n \n enemigos = enemigos.filter(function(enemigo) {\n return false;\n })\n \n for (fila = 0; fila < 5; fila++) {\n for (columna = 0; columna < 11; columna++) {\n x = (columna*50)+75;\n y= (fila*35)+75;\n switch (fila) {\n case 0: tipoEnemigo = tipo1;\n break;\n case 1:\n case 2: tipoEnemigo = tipo2;\n break;\n case 3:\n case 4: tipoEnemigo = tipo3;\n }\n enemigos.push({\n x: x,\n y: y,\n tipo: tipoEnemigo,\n sprite: 0,\n estado: VIVO\n });\n }\n }\n \n }", "title": "" }, { "docid": "347f07e8c32d7cf1c5b49350222f9b6d", "score": "0.5228384", "text": "function afficher_ligne_interieur_tab(serveur) {\n\t\tvar scan_info = GM_getValue('scan' + serveur, '').split('#');\n\t\tvar ligne_tableau = ' ';\n\t\tvar nb = scan_info.length;\n\n\t\tvar nb_scan_deb_fin = connaitre_scan_afficher(serveur, nb_scan_page, info.url, nb);\n\t\tvar nb_scan_fin = nb_scan_deb_fin[0];\n\t\tvar nb_scan_deb = nb_scan_deb_fin[1];\n\n\t\tvar url_2 = info.url.split('&raidefacil=scriptOptions')[0];\n\t\tvar bbcode_export = ' ';\n\n\t\t//var inactif_normal = GM_getValue('inactif', '');\n\n\t\t//on recupere les infos sur les attaques des 24h dernieres\n\t\tsuprimmer_attaque_24h_inutile();\n\t\tvar attaque_24h = GM_getValue('attaque_24h', '');\n\t\tvar attaque_24h_split = attaque_24h.split('#');\n\t\tvar attaque_24h_split2 = attaque_24h_split;\n\t\tfor (var x = 0; x < attaque_24h_split.length; x++) {\n\t\t\tattaque_24h_split2[x] = attaque_24h_split[x].split('/');\n\t\t}\n\n\t\t// on regarde la planette selectionner(liste de droite des planettes) pour connaitre la galaxie\n\t\tif (document.getElementsByName('ogame-planet-coordinates')[0]) {\n\t\t\tvar coordonnee_slelec = document.getElementsByName('ogame-planet-coordinates')[0].content;\n\t\t}\n\t\telse {\n\t\t\tif (pos_depart != 'x:xxx:x') { var coordonnee_slelec = pos_depart; }\n\t\t\telse { var coordonnee_slelec = '0'; }\n\t\t}\n\n\n\t\t// on les utilises et les place\n\t\tvar cptLigne = 0;\n\t\tfor (var i = nb_scan_deb; i < nb_scan_fin; i++) {\n\t\t\tif (scan_info[i] != undefined && scan_info[i] != ';;;;;;;;;;;;;;;;;x;;') {\n\t\t\t\tvar scan_info_i = scan_info[i].split(';');\n\t\t\t\t//on verifie si c'est ok pour l'afficher\n\t\t\t\tif (scan_info_i[9] != undefined && scan_info_i[1].split(':')[1] && (q_flo_vis == 1 || scan_info_i[9] != '?/?/?/?/?/?/?/?/?/?/?/?/?/') && (q_def_vis == 1 || scan_info_i[10] != '?/?/?/?/?/?/?/?/?/?')) {\n\n\n\t\t\t\t\t//on veut savoir si on n'affiche que les scan de la galaxie, si oui on vérifie la galaxie\n\t\t\t\t\tif((q_galaxie_scan == 1 && coordonnee_slelec.split(':')[0].replace( /[^0-9-]/g, \"\") == scan_info_i[1].split(':')[0].replace( /[^0-9-]/g, \"\"))\n\t\t\t\t\t\t|| q_galaxie_scan == 0\n\t\t\t\t\t\t|| (galaxie_demande == scan_info_i[1].split(':')[0].replace( /[^0-9-]/g, \"\") && q_galaxie_scan == 2)\n\t\t\t\t\t\t|| (q_galaxie_scan == 3 && (parseInt(coordonnee_slelec.split(':')[0].replace( /[^0-9-]/g, \"\")) + galaxie_plus_ou_moins) >= parseInt(scan_info_i[1].split(':')[0].replace( /[^0-9-]/g, \"\")) && (parseInt(coordonnee_slelec.split(':')[0].replace( /[^0-9-]/g, \"\")) - galaxie_plus_ou_moins) <= parseInt(scan_info_i[1].split(':')[0].replace( /[^0-9-]/g, \"\")))\n\t\t\t\t\t\t|| filtre_joueur != '' //si on filtre sur le joueur, on affiche toutes les coordonnées\n\t\t\t\t\t){\n\n\t\t\t\t\t\t//###### Gestion des filtres ######//\n\t\t\t\t\t\tvar filtre = false;\n\t\t\t\t\t\t// on regarde ce qu'on affiche : planette + lune = 0, planette =1 , lune =2\n\t\t\t\t\t\tif(\t(afficher_seulement == 0)\n\t\t\t\t\t\t\t|| (afficher_seulement == 1 && scan_info_i[14]== 1)\n\t\t\t\t\t\t\t|| (afficher_seulement == 2 && scan_info_i[14]!= 1)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t// on regarde ce qu'on affiche : actif + inactif = 0, actif =1 , inactif =2\n\t\t\t\t\t\t\tif(\t(filtre_actif_inactif == 0)\n\t\t\t\t\t\t\t\t|| (filtre_actif_inactif == 1 && scan_info_i[24]!= 'i' && scan_info_i[24]!= 'I' )\n\t\t\t\t\t\t\t\t|| (filtre_actif_inactif == 2 && (scan_info_i[24]== 'i' || scan_info_i[24]== 'I'))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t// on regarde le joueur qu'on affiche\n\t\t\t\t\t\t\t\tif ((filtre_joueur == '') || (filtre_joueur != '' && filtre_joueur.toLowerCase() == scan_info_i[2].toLowerCase()))\n\t\t\t\t\t\t\t\t\tfiltre = true;\n\n\t\t\t\t\t\tif (filtre) {\n\t\t\t\t\t\t\t// date\n\t\t\t\t\t\t\tvar date_scan = parseInt(scan_info_i[0]);\n\t\t\t\t\t\t\tvar datecc = new Date();\n\t\t\t\t\t\t\tdatecc.setTime(date_scan);\n\t\t\t\t\t\t\tvar date_final = datecc.getDate() + '/' + (datecc.getMonth() + 1) + '/' + datecc.getFullYear() + ' ' +\n\t\t\t\t\t\t\t\tdatecc.getHours() + ':' + datecc.getMinutes() + ':' + datecc.getSeconds();\n\n\n\t\t\t\t\t\t\t// si la date est demander en chronos\n\t\t\t\t\t\t\tvar date2;\n\t\t\t\t\t\t\tif (q_date_type_rep == 0) {\n\t\t\t\t\t\t\t\tvar datecc2 = (info.ogameMeta['ogame-timestamp'] ? parseInt(info.ogameMeta['ogame-timestamp']) * 1000 : info.startTime) - date_scan;\n\t\t\t\t\t\t\t\tdate2 = timeFormat(datecc2 / 1000);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdate2 = ((datecc.getDate() < 10) ? '0' : '') + datecc.getDate() + '/'\n\t\t\t\t\t\t\t\t\t+ (datecc.getMonth() < 10 ? '0' : '') + (datecc.getMonth() + 1) + '/'\n\t\t\t\t\t\t\t\t\t+ (datecc.getFullYear() - 2000) + ' '\n\t\t\t\t\t\t\t\t\t+ (datecc.getHours() < 10 ? '0' : '') + datecc.getHours() + ':'\n\t\t\t\t\t\t\t\t\t+ (datecc.getMinutes() < 10 ? '0' : '') + datecc.getMinutes() + ':'\n\t\t\t\t\t\t\t\t\t+ (datecc.getSeconds() < 10 ? '0' : '') + datecc.getSeconds();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// type de la planette\n\t\t\t\t\t\t\tvar type_planette = scan_info_i[14];\n\t\t\t\t\t\t\tvar l_q = '';\n\t\t\t\t\t\t\tif (type_planette != 1) { l_q = ' L'; }\n\n\t\t\t\t\t\t\t//nom joueur et planette\n\t\t\t\t\t\t\tvar nom_joueur = scan_info_i[2];\n\t\t\t\t\t\t\tvar nom_planete_complet = scan_info_i[3];\n\t\t\t\t\t\t\tif (nom_planete_complet.indexOf('1diez1') >= 0) {\n\t\t\t\t\t\t\t\tnom_planete_complet = nom_planete_complet.replace(/1diez1/g, \"#\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar nom_planete = raccourcir(nom_planete_complet);\n\n\t\t\t\t\t\t\t//coordonee + url\n\t\t\t\t\t\t\tvar coordonee = scan_info_i[1];\n\t\t\t\t\t\t\tvar coordonee_split = coordonee.split(':');\n\t\t\t\t\t\t\tvar galaxie = (coordonee_split[0]).replace(/[^0-9-]/g, \"\");\n\t\t\t\t\t\t\tvar systeme = (coordonee_split[1]).replace(/[^0-9-]/g, \"\");\n\t\t\t\t\t\t\tvar planette = (coordonee_split[2]).replace(/[^0-9-]/g, \"\");\n\t\t\t\t\t\t\tvar url_galaxie = document.getElementById(\"menuTable\").getElementsByClassName('menubutton ')[8].href;\n\n\t\t\t\t\t\t\tvar url_fleet1 = document.getElementById(\"menuTable\").getElementsByClassName('menubutton ')[7].href;\n\t\t\t\t\t\t\tif (espionnage_lien == 1) {\n\t\t\t\t\t\t\t\tvar espionnage = url_fleet1 + '&galaxy=' + galaxie + '&system=' + systeme + '&position=' + planette + '&type=' + type_planette + '&mission=6';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (espionnage_lien == 0) {\n\t\t\t\t\t\t\t\tvar espionnage = url_galaxie + '&galaxy=' + galaxie + '&system=' + systeme + '&position=' + planette + '&planetType=1&doScan=1';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar coordonee_fin = '<a href=\"' + url_galaxie + '&galaxy=' + galaxie + '&system=' + systeme + '&position=' + planette + '\"';\n\t\t\t\t\t\t\tif (nom_j_q_q != 1 && nom_p_q_q != 1)\n\t\t\t\t\t\t\t\tcoordonee_fin += ' title=\" Planette: ' + nom_planete_complet.replace(/\"/g, '&quot;') + ' | Joueur: ' + nom_joueur + '\">';\n\t\t\t\t\t\t\telse if (nom_j_q_q != 1)\n\t\t\t\t\t\t\t\tcoordonee_fin += ' title=\" Joueur: ' + nom_joueur + '\">';\n\t\t\t\t\t\t\telse if (nom_p_q_q != 1)\n\t\t\t\t\t\t\t\tcoordonee_fin += ' title=\" Planette: ' + nom_planete_complet.replace(/\"/g, '&quot;') + '\">';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tcoordonee_fin += '>';\n\t\t\t\t\t\t\tcoordonee_fin += coordonee + l_q + '</a>';\n\n\n\t\t\t\t\t\t\tvar pourcent = 50;\n\t\t\t\t\t\t\tvar type_joueur = scan_info_i[24] ? scan_info_i[24] : '&nbsp';\n\t\t\t\t\t\t\tif (type_joueur == \"ph\") {\n\t\t\t\t\t\t\t\ttype_joueur = '<span class=\"status_abbr_honorableTarget\">' + type_joueur + '</span>';\n\t\t\t\t\t\t\t\tpourcent = 75;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (type_joueur == \"o\")\n\t\t\t\t\t\t\t\ttype_joueur = '<span class=\"status_abbr_outlaw\">' + type_joueur + '</span>';\n\t\t\t\t\t\t\telse if (type_joueur == \"i\")\n\t\t\t\t\t\t\t\ttype_joueur = '<span class=\"status_abbr_inactive\">' + type_joueur + '</span>';\n\t\t\t\t\t\t\telse if (type_joueur == \"I\")\n\t\t\t\t\t\t\t\ttype_joueur = '<span class=\"status_abbr_longinactive\">' + type_joueur + '</span>';\n\t\t\t\t\t\t\telse if (type_joueur == \"f\")\n\t\t\t\t\t\t\t\ttype_joueur = '<span class=\"status_abbr_strong\">' + type_joueur + '</span>';\n\t\t\t\t\t\t\telse if (type_joueur == \"v\")\n\t\t\t\t\t\t\t\ttype_joueur = '<span class=\"status_abbr_vacation\">' + type_joueur + '</span>';\n\n\t\t\t\t\t\t\tvar type_honor = scan_info_i[25] ? scan_info_i[25] : '&nbsp';\n\t\t\t\t\t\t\tif (type_honor == \"b1\") {\n\t\t\t\t\t\t\t\ttype_honor = '<span class=\"honorRank rank_bandit1\"></span>';\n\t\t\t\t\t\t\t\tpourcent = 100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (type_honor == \"b2\") {\n\t\t\t\t\t\t\t\ttype_honor = '<span class=\"honorRank rank_bandit2\"></span>';\n\t\t\t\t\t\t\t\tpourcent = 100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (type_honor == \"b3\") {\n\t\t\t\t\t\t\t\ttype_honor = '<span class=\"honorRank rank_bandit3\"></span>';\n\t\t\t\t\t\t\t\tpourcent = 100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (type_honor == \"s1\")\n\t\t\t\t\t\t\t\ttype_honor = '<span class=\"honorRank rank_starlord1\"></span>';\n\t\t\t\t\t\t\telse if (type_honor == \"s2\")\n\t\t\t\t\t\t\t\ttype_honor = '<span class=\"honorRank rank_starlord2\"></span>';\n\t\t\t\t\t\t\telse if (type_honor == \"s3\")\n\t\t\t\t\t\t\t\ttype_honor = '<span class=\"honorRank rank_starlord3\"></span>';\n\n\t\t\t\t\t\t\t//activite\n\t\t\t\t\t\t\tvar activite = scan_info_i[7];\n\t\t\t\t\t\t\tif (activite == 'rien') {\n\t\t\t\t\t\t\t\tvar activite_fin = ' ';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (parseInt(activite) <= 15) {\n\t\t\t\t\t\t\t\t\tvar activite_fin = '<img style=\"width: 12px; height: 12px;\" src=\"http://gf1.geo.gfsrv.net/cdn12/b4c8503dd1f37dc9924909d28f3b26.gif\" alt=\"' + activite + ' min \" title=\"' + activite + ' min\"/>';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar activite_fin = '<span style=\"background-color: #000000;border: 1px solid #FFA800;border-radius: 3px 3px 3px 3px;color: #FFA800;\">' + activite + '</span>';\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\t//ressource\n\t\t\t\t\t\t\tvar ressource_m = scan_info_i[4];\n\t\t\t\t\t\t\tvar ressource_c = scan_info_i[5];\n\t\t\t\t\t\t\tvar ressource_d = scan_info_i[6];\n\t\t\t\t\t\t\tvar nb_pt = shipCount(parseInt(ressource_m), parseInt(ressource_c), parseInt(ressource_d), 5000, pourcent);\n\t\t\t\t\t\t\tvar nb_gt = shipCount(parseInt(ressource_m), parseInt(ressource_c), parseInt(ressource_d), 25000, pourcent);\n\t\t\t\t\t\t\tvar ressource_total = parseInt(ressource_m) + parseInt(ressource_c) + parseInt(ressource_d);\n\n\t\t\t\t\t\t\tif (question_rassemble_col == 0) {\n\t\t\t\t\t\t\t\tvar ressourceTitle = [\n\t\t\t\t\t\t\t\t\tpourcent + '% de ressources pillables',\n\t\t\t\t\t\t\t\t\taddPoints(nb_pt) + ' ' + text.nb_pt + ' | ' + addPoints(nb_gt) + ' ' + text.nb_gt,\n\t\t\t\t\t\t\t\t\ttext.metal + ': ' + addPoints(Math.round(parseInt(ressource_m) * (pourcent / 100))) + ' | ' + text.cristal + ': ' + addPoints(Math.round(parseInt(ressource_c) * (pourcent / 100))) + ' | ' + text.deut + ': ' + addPoints(Math.round(parseInt(ressource_d) * (pourcent / 100)))\n\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\tvar ressource = '<acronym title=\"' + ressourceTitle.join('<br>') + '\">' + addPoints(Math.round(ressource_total * (pourcent / 100))) + '</acronym>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// vitesse minimum.\n\t\t\t\t\t\t\tvar accronyme_temp_vol = vaisseau_vitesse_mini(tech_impul_a, tech_hyper_a, tech_combus_a, vaisseau_lent, coordonee);\n\n\t\t\t\t\t\t\t//cdr possible\n\t\t\t\t\t\t\tvar cdr_possible = Math.round(parseInt(scan_info_i[8]) * pourcent_cdr);\n\t\t\t\t\t\t\tvar cdr_possible_m = Math.round(parseInt(scan_info_i[15]) * pourcent_cdr);\n\t\t\t\t\t\t\tvar cdr_possible_c = Math.round(parseInt(scan_info_i[16]) * pourcent_cdr);\n\n\t\t\t\t\t\t\t// on verifie que cdr possible existe et soit un chiffre\n\t\t\t\t\t\t\tif (cdr_possible == '?' || isNaN(cdr_possible)) { var cdr_aff = 0; cdr_possible = '?'; }\n\t\t\t\t\t\t\telse { var cdr_aff = cdr_possible; }\n\n\t\t\t\t\t\t\t// cdr de défense\n\t\t\t\t\t\t\t// on verifie que le cdr def est bien creer dans le scan info\n\t\t\t\t\t\t\tif (scan_info_i[21]) { var cdr_def = scan_info_i[21].split('/'); }\n\t\t\t\t\t\t\telse { var cdr_def = '?'; }\n\t\t\t\t\t\t\tif (cdr_def[0] != '?' && pourcent_cdr_def != 0 && cdr_def != 'undefined') {\n\t\t\t\t\t\t\t\tvar cdr_possible_def = Math.round(parseInt(cdr_def[0]) * pourcent_cdr_def);\n\t\t\t\t\t\t\t\tvar cdr_possible_def_m = Math.round(parseInt(cdr_def[1]) * pourcent_cdr_def);\n\t\t\t\t\t\t\t\tvar cdr_possible_def_c = Math.round(parseInt(cdr_def[2]) * pourcent_cdr_def);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar cdr_possible_def = 0;\n\t\t\t\t\t\t\t\tvar cdr_possible_def_m = 0;\n\t\t\t\t\t\t\t\tvar cdr_possible_def_c = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (cdr_possible != '?') { cdr_possible = cdr_possible + cdr_possible_def; }\n\t\t\t\t\t\t\telse { cdr_possible = cdr_possible; }\n\n\t\t\t\t\t\t\tcdr_aff = cdr_aff + cdr_possible_def;\n\t\t\t\t\t\t\tcdr_possible_m = cdr_possible_m + cdr_possible_def_m;\n\t\t\t\t\t\t\tcdr_possible_c = cdr_possible_c + cdr_possible_def_c;\n\n\t\t\t\t\t\t\tif (isNaN(cdr_aff)) { cdr_aff = 0; }\n\t\t\t\t\t\t\telse { cdr_aff = cdr_aff; }\n\n\t\t\t\t\t\t\tif (question_rassemble_col == 0) {\n\t\t\t\t\t\t\t\tvar cdrTitle = addPoints(Math.ceil(cdr_aff / 20000)) + ' ' + text.nb_rc + '<br>' + text.met_rc + ': ' + addPoints(cdr_possible_m) + ' | ' + text.cri_rc + ': ' + addPoints(cdr_possible_c);\n\t\t\t\t\t\t\t\tvar cdrDisplayedNumber = addPoints(cdr_q_type_affiche === 0 ? cdr_possible : Math.ceil(cdr_aff / 20000));\n\t\t\t\t\t\t\t\tvar cdr_aco = '<acronym title=\"' + cdrTitle + ' \">' + cdrDisplayedNumber + '</acronym>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// colonne cdr + resource\n\t\t\t\t\t\t\tif (question_rassemble_col == 1) {\n\t\t\t\t\t\t\t\tvar col_cdr = '<acronym title=\"' + pourcent + '% | ' + addPoints(nb_pt) + text.nb_pt + '/' + addPoints(nb_gt) + text.nb_gt + ' | ' + text.metal + ': ' + addPoints(Math.round(parseInt(ressource_m) * (pourcent / 100))) + ' | ' + text.cristal + ': ' + addPoints(Math.round(parseInt(ressource_c) * (pourcent / 100))) + ' | ' + text.deut + ': ' + addPoints(Math.round(parseInt(ressource_d) * (pourcent / 100))) + '\\n' + addPoints(Math.ceil(cdr_aff / 20000)) + text.nb_rc + ' | ' + text.met_rc + ': ' + addPoints(cdr_possible_m) + ' | ' + text.cri_rc + ': ' + addPoints(cdr_possible_c) + '\">' + addPoints(cdr_aff + Math.round(ressource_total * (pourcent / 100))) + '</acronym>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//recherhe adersersaire\n\t\t\t\t\t\t\tvar recherche_ad = scan_info_i[13].split('/');\n\t\t\t\t\t\t\tvar tech_arme_d = recherche_ad[0];\n\t\t\t\t\t\t\tvar tech_bouclier_d = recherche_ad[1];\n\t\t\t\t\t\t\tvar tech_protect_d = recherche_ad[2];\n\n\t\t\t\t\t\t\t//recupere vaisseau et defense\n\t\t\t\t\t\t\tvar vaisseau_type = new Array(vari.pt, vari.gt, vari.cle, vari.clo, vari.cro, vari.vb, vari.vc, vari.rec, vari.esp, vari.bb, vari.sat, vari.dest, vari.edlm, vari.tra);\n\t\t\t\t\t\t\tvar defense_type = new Array(i18n.get('lm'), i18n.get('lle'), i18n.get('llo'), i18n.get('gauss'), i18n.get('ion'), i18n.get('pla'), i18n.get('pb'), i18n.get('gb'), i18n.get('mic'), i18n.get('mip'));\n\n\t\t\t\t\t\t\t//type pour les different simulateur.\n\t\t\t\t\t\t\tvar vaisseau_speed = new Array(\"ship_d0_0_b\", \"ship_d0_1_b\", \"ship_d0_2_b\", \"ship_d0_3_b\", \"ship_d0_4_b\", \"ship_d0_5_b\", \"ship_d0_6_b\", \"ship_d0_7_b\", \"ship_d0_8_b\", \"ship_d0_9_b\", \"ship_d0_10_b\", \"ship_d0_11_b\", \"ship_d0_12_b\", \"ship_d0_13_b\");\n\t\t\t\t\t\t\tvar def_speed = new Array(\"ship_d0_14_b\", \"ship_d0_15_b\", \"ship_d0_16_b\", \"ship_d0_17_b\", \"ship_d0_18_b\", \"ship_d0_19_b\", \"ship_d0_20_b\", \"ship_d0_21_b\", \"abm_b\", \"\");\n\n\t\t\t\t\t\t\tvar vaisseau_win = new Array(\"d0\", \"d1\", \"d2\", \"d3\", \"d4\", \"d5\", \"d6\", \"d7\", \"d8\", \"d9\", \"d10\", \"d11\", \"d12\", \"d13\");\n\t\t\t\t\t\t\tvar def_win = new Array(\"d14\", \"d15\", \"d16\", \"d17\", \"d18\", \"d19\", \"d20\", \"d21\", \"\", \"\");\n\n\t\t\t\t\t\t\tvar vaisseau_drag = new Array(\"numunits[1][0][k_t]\", \"numunits[1][0][g_t]\", \"numunits[1][0][l_j]\", \"numunits[1][0][s_j]\", \"numunits[1][0][kr]\", \"numunits[1][0][sc]\", \"numunits[1][0][ko]\", \"numunits[1][0][re]\", \"numunits[1][0][sp]\", \"numunits[1][0][bo]\", \"numunits[1][0][so]\", \"numunits[1][0][z]\", \"numunits[1][0][t]\", \"numunits[1][0][sk]\");\n\t\t\t\t\t\t\tvar def_drag = new Array(\"numunits[1][0][ra]\", \"numunits[1][0][l_l]\", \"numunits[1][0][s_l]\", \"numunits[1][0][g]\", \"numunits[1][0][i]\", \"numunits[1][0][p]\", \"numunits[1][0][k_s]\", \"numunits[1][0][g_s]\", \"missiles_available_v\", \"\");\n\n\t\t\t\t\t\t\tvar url_dragosim = '';\n\t\t\t\t\t\t\tvar url_speedsim = '';\n\t\t\t\t\t\t\tvar url_ogamewinner = '';\n\n\t\t\t\t\t\t\t// def et vaisseau variable\n\t\t\t\t\t\t\tvar acronyme_vaisseau = ' ';\n\t\t\t\t\t\t\tvar nb_totalvaisseau = 0;\n\t\t\t\t\t\t\tvar acronyme_def = i18n.get('th_nd') + '<div class=\"splitLine\"></div>';\n\t\t\t\t\t\t\tvar nb_totaldef = 0;\n\n\t\t\t\t\t\t\tvar vaisseau22 = scan_info_i[9];\n\t\t\t\t\t\t\tif (vaisseau22 != '?/?/?/?/?/?/?/?/?/?/?/?/?/?') {\n\t\t\t\t\t\t\t\tvar vaisseau = vaisseau22.split('/');\n\t\t\t\t\t\t\t\tfor (var k = 0; k < vaisseau.length; k++) {\n\t\t\t\t\t\t\t\t\tif (parseInt(vaisseau[k]) != 0) {\n\t\t\t\t\t\t\t\t\t\tacronyme_vaisseau = acronyme_vaisseau + ' | ' + vaisseau_type[k] + ' : ' + addPoints(parseInt(vaisseau[k]));\n\t\t\t\t\t\t\t\t\t\tnb_totalvaisseau = nb_totalvaisseau + parseInt(vaisseau[k]);\n\n\t\t\t\t\t\t\t\t\t\turl_speedsim = url_speedsim + '&amp;' + vaisseau_speed[k] + '=' + parseInt(vaisseau[k]);\n\t\t\t\t\t\t\t\t\t\turl_dragosim = url_dragosim + '&amp;' + vaisseau_drag[k] + '=' + parseInt(vaisseau[k]);\n\t\t\t\t\t\t\t\t\t\turl_ogamewinner = url_ogamewinner + '&amp;' + vaisseau_win[k] + '=' + parseInt(vaisseau[k]);\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\tnb_totalvaisseau = addPoints(nb_totalvaisseau);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar vaisseau = vaisseau22.split('/');\n\t\t\t\t\t\t\t\tacronyme_vaisseau = '?';\n\t\t\t\t\t\t\t\tnb_totalvaisseau = '?';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar defense2 = scan_info_i[10];\n\t\t\t\t\t\t\tif (defense2 != '?/?/?/?/?/?/?/?/?/?') {\n\t\t\t\t\t\t\t\tvar defense = defense2.split('/');\n\t\t\t\t\t\t\t\tfor (var k = 0; k < defense.length; k++) {\n\t\t\t\t\t\t\t\t\tif (parseInt(defense[k]) != 0) {\n\t\t\t\t\t\t\t\t\t\tacronyme_def = acronyme_def + '<br>' + defense_type[k] + ' : ' + addPoints(parseInt(defense[k]));\n\n\t\t\t\t\t\t\t\t\t\turl_speedsim = url_speedsim + '&amp;' + def_speed[k] + '=' + parseInt(defense[k]);\n\t\t\t\t\t\t\t\t\t\turl_dragosim = url_dragosim + '&amp;' + def_drag[k] + '=' + parseInt(defense[k]);\n\t\t\t\t\t\t\t\t\t\turl_ogamewinner = url_ogamewinner + '&amp;' + def_win[k] + '=' + parseInt(defense[k]);\n\n\t\t\t\t\t\t\t\t\t\tif (k != 8 && k != 9) {// si k n'est pas des missiles (interplanetaire ou de def)\n\t\t\t\t\t\t\t\t\t\t\tnb_totaldef = nb_totaldef + parseInt(defense[k]);\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\tnb_totaldef = addPoints(nb_totaldef);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar defense = defense2.split('/');\n\t\t\t\t\t\t\t\tacronyme_def = '?';\n\t\t\t\t\t\t\t\tnb_totaldef = '?';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar acronyme_vaisseau2 = '';\n\t\t\t\t\t\t\tif (vaisseau_question == 1)\n\t\t\t\t\t\t\t\tacronyme_vaisseau2 = '<acronym title=\" ' + acronyme_vaisseau + '\">' + nb_totalvaisseau + '</acronym>';\n\t\t\t\t\t\t\telse if (vaisseau_question == 2 && (scan_info_i[22] == '?' || !scan_info_i[2]))\n\t\t\t\t\t\t\t\tacronyme_vaisseau2 = '<acronym title=\" ' + acronyme_vaisseau + ',' + text.c_nbv + ' ' + nb_totalvaisseau + ' \">?</acronym>';\n\t\t\t\t\t\t\telse if (vaisseau_question == 2)\n\t\t\t\t\t\t\t\tacronyme_vaisseau2 = '<acronym title=\" ' + acronyme_vaisseau + ',' + text.c_nbv + ' ' + nb_totalvaisseau + ' \">' + addPoints(parseInt(scan_info_i[22])) + '</acronym>';\n\n\t\t\t\t\t\t\tvar acronyme_def2 = '';\n\t\t\t\t\t\t\t// -------------------------------------------------------------------------------------------------\n\t\t\t\t\t\t\tif (defense_question == 1)\n\t\t\t\t\t\t\t\tacronyme_def2 = '<div class=\"tooltipTitle\">' + acronyme_def + '</div><acronym>' + nb_totaldef + '</acronym>';\n\t\t\t\t\t\t\telse if (defense_question == 2 && (scan_info_i[23] == '?' || !scan_info_i[23]))\n\t\t\t\t\t\t\t\tacronyme_def2 = '<div class=\"tooltipTitle\">' + acronyme_def + ',' + text.c_nbd + ' ' + nb_totaldef + '</div><acronym>?</acronym>';\n\t\t\t\t\t\t\telse if (defense_question == 2)\n\t\t\t\t\t\t\t\tacronyme_def2 = '<div class=\"tooltipTitle>\" ' + acronyme_def + ',' + text.c_nbd + ' ' + nb_totaldef + '</div><acronym>' + addPoints(parseInt(scan_info_i[23])) + '</acronym>';\n\t\t\t\t\t\t\t// -------------------------------------------------------------------------------------------------\n\n\n\t\t\t\t\t\t\t//url d'attaque\t\t//am202 = pt / am203 = gt\n\t\t\t\t\t\t\tvar url_fleet1 = document.getElementById(\"menuTable\").getElementsByClassName('menubutton ')[7].href;\n\t\t\t\t\t\t\tvar url_attaquer = url_fleet1 + '&galaxy=' + galaxie + '&system=' + systeme + '&position=' + planette + '&type=' + type_planette + '&mission=1';\n\t\t\t\t\t\t\tif (lien_raide_nb_pt_gt == 1) {\n\t\t\t\t\t\t\t\tvar nb_pt2;\n\t\t\t\t\t\t\t\tif (nb_ou_pourcent == 1) {\n\t\t\t\t\t\t\t\t\tnb_pt2 = nb_pt + nb_pourcent_ajout_lien;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnb_pt2 = Math.ceil(nb_pt + (nb_pt / 100) * nb_pourcent_ajout_lien);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\turl_attaquer += '&am202=' + nb_pt2;\n\t\t\t\t\t\t\t} else if (lien_raide_nb_pt_gt == 0) {\n\t\t\t\t\t\t\t\tvar nb_gt2;\n\t\t\t\t\t\t\t\tif (nb_ou_pourcent == 1) {\n\t\t\t\t\t\t\t\t\tnb_gt2 = nb_gt + nb_pourcent_ajout_lien;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnb_gt2 = Math.ceil(nb_gt + (nb_gt / 100) * nb_pourcent_ajout_lien);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\turl_attaquer += '&am203=' + nb_gt2;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// url de simulation\n\t\t\t\t\t\t\tif (q_techzero == 1 && recherche_ad[0] == \"?\") {\n\t\t\t\t\t\t\t\tvar tech_arme_a_sim = 0;\n\t\t\t\t\t\t\t\tvar tech_protect_a_sim = 0;\n\t\t\t\t\t\t\t\tvar tech_bouclier_a_sim = 0;\n\t\t\t\t\t\t\t\tvar tech_arme_d_sim = 0;\n\t\t\t\t\t\t\t\tvar tech_bouclier_d_sim = 0;\n\t\t\t\t\t\t\t\tvar tech_protect_d_sim = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar tech_arme_a_sim = tech_arme_a;\n\t\t\t\t\t\t\t\tvar tech_protect_a_sim = tech_protect_a;\n\t\t\t\t\t\t\t\tvar tech_bouclier_a_sim = tech_bouclier_a;\n\t\t\t\t\t\t\t\tvar tech_arme_d_sim = tech_arme_d;\n\t\t\t\t\t\t\t\tvar tech_bouclier_d_sim = tech_bouclier_d;\n\t\t\t\t\t\t\t\tvar tech_protect_d_sim = tech_protect_d;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (simulateur == 1) {\n\t\t\t\t\t\t\t\tvar url_simul = 'http://websim.speedsim.net/index.php?version=1&lang=' + vari.lang_speedsin + '&tech_a0_0=' + tech_arme_a_sim + '&tech_a0_1=' + tech_bouclier_a_sim + '&tech_a0_2=' + tech_protect_a_sim + '&engine0_0=' + tech_combus_a + '&engine0_1=' + tech_impul_a + '&engine0_2=' + tech_hyper_a + '&start_pos=' + coordonnee_slelec\n\t\t\t\t\t\t\t\t\t+ '&tech_d0_0=' + tech_arme_d_sim + '&tech_d0_1=' + tech_bouclier_d_sim + '&tech_d0_2=' + tech_protect_d_sim\n\t\t\t\t\t\t\t\t\t+ '&enemy_name=' + nom_planete_complet.replace(/\"/g, '&quot;') + '&perc-df=' + (pourcent_cdr * 100) + '&enemy_pos=' + coordonee + '&enemy_metal=' + parseInt(ressource_m) + '&enemy_crystal=' + parseInt(ressource_c) + '&enemy_deut=' + parseInt(ressource_d) + url_speedsim\n\t\t\t\t\t\t\t\t\t+ '&uni_speed=' + vitesse_uni + '&perc-df=' + pourcent_cdr * 100 + '&plunder_perc=' + pourcent + '&del_techs=1&rf=1';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (simulateur == 0) {\n\t\t\t\t\t\t\t\tvar url_simul = 'http://drago-sim.com/index.php?style=new&template=New&lang=' + vari.lang_dragosin + '&' + 'techs[0][0][w_t]=' + tech_arme_a_sim + '&techs[0][0][s_t]=' + tech_bouclier_a_sim + '&techs[0][0][r_p]=' + tech_protect_a_sim + '&engine0_0=' + tech_combus_a + '&engine0_1=' + tech_impul_a + '&engine0_2=' + tech_hyper_a + '&start_pos=' + coordonnee_slelec\n\t\t\t\t\t\t\t\t\t+ '&techs[1][0][w_t]=' + tech_arme_d_sim + '&techs[1][0][s_t]=' + tech_bouclier_d_sim + '&techs[1][0][r_p]=' + tech_protect_d_sim\n\t\t\t\t\t\t\t\t\t+ '&v_planet=' + nom_planete_complet.replace(/\"/g, '&quot;') + '&debris_ratio=' + pourcent_cdr + '&v_coords=' + coordonee + '&v_met=' + parseInt(ressource_m) + '&v_kris=' + parseInt(ressource_c) + '&v_deut=' + parseInt(ressource_d) + url_dragosim;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (simulateur == 2) {\n\t\t\t\t\t\t\t\tvar url_simul = 'http://www.gamewinner.fr/cgi-bin/csim/index.cgi?lang=fr?' + '&aattack=' + tech_arme_a_sim + '&ashield=' + tech_bouclier_a_sim + '&aarmory=' + tech_protect_a_sim\n\t\t\t\t\t\t\t\t\t+ '&dattack=' + tech_arme_d_sim + '&dshield=' + tech_bouclier_d_sim + '&darmory=' + tech_protect_d_sim\n\t\t\t\t\t\t\t\t\t+ '&enemy_name=' + nom_planete_complet.replace(/\"/g, '&quot;') + '&enemy_pos=' + coordonee + '&dmetal=' + parseInt(ressource_m) + '&dcrystal=' + parseInt(ressource_c) + '&ddeut=' + parseInt(ressource_d) + url_ogamewinner;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// batiment adversaire + prodh + resrrouce x h\n\t\t\t\t\t\t\t//+bat +prod/h\n\t\t\t\t\t\t\tvar mine_array = scan_info_i[19].split('/');\n\t\t\t\t\t\t\tvar mine_m = mine_array[0];\n\t\t\t\t\t\t\tvar mine_c = mine_array[1];\n\t\t\t\t\t\t\tvar mine_d = mine_array[2];\n\n\t\t\t\t\t\t\t// si on a besoin de la production pour afficher une colone\n\t\t\t\t\t\t\tif (prod_h_q == 1 || prod_gg != 0 || q_vid_colo == 1) {\n\t\t\t\t\t\t\t\tif (mine_array != '?,?,?') {\n\t\t\t\t\t\t\t\t\tvar prod_t = calcule_prod(mine_m, mine_c, mine_d, coordonee, '?');\n\t\t\t\t\t\t\t\t\tvar prod_m_h = prod_t.metal;\n\t\t\t\t\t\t\t\t\tvar prod_c_h = prod_t.cristal;\n\t\t\t\t\t\t\t\t\tvar prod_d_h = prod_t.deut;\n\t\t\t\t\t\t\t\t\tvar prod_tot = parseInt(prod_m_h) + parseInt(prod_c_h) + parseInt(prod_d_h);\n\n\t\t\t\t\t\t\t\t\tvar acro_prod_h = '<acronym title=\" ' + text.metal + ' : ' + addPoints(parseInt(prod_m_h)) + ' | ' + text.cristal + ' : ' + addPoints(parseInt(prod_c_h)) + ' | ' + text.deut + ' : ' + addPoints(parseInt(prod_d_h)) + ' \">' + addPoints(prod_tot) + '</acronym>';\n\n\t\t\t\t\t\t\t\t\t//ressource x h\n\t\t\t\t\t\t\t\t\tvar prod_m_xh = Math.round(parseInt(prod_m_h) * (parseInt(prod_gg) / 60));\n\t\t\t\t\t\t\t\t\tvar prod_c_xh = Math.round(parseInt(prod_c_h) * (parseInt(prod_gg) / 60));\n\t\t\t\t\t\t\t\t\tvar prod_d_xh = Math.round(parseInt(prod_d_h) * (parseInt(prod_gg) / 60));\n\t\t\t\t\t\t\t\t\tvar prod_tt_xh = prod_m_xh + prod_c_xh + prod_d_xh;\n\n\t\t\t\t\t\t\t\t\tvar ressource_m_xh = parseInt(ressource_m) + prod_m_xh;\n\t\t\t\t\t\t\t\t\tvar ressource_c_xh = parseInt(ressource_c) + prod_c_xh;\n\t\t\t\t\t\t\t\t\tvar ressource_d_xh = parseInt(ressource_d) + prod_d_xh;\n\t\t\t\t\t\t\t\t\tvar ressource_tt_xh = ressource_m_xh + ressource_c_xh + ressource_d_xh;\n\n\t\t\t\t\t\t\t\t\tvar acro_ress_xh = '<acronym title=\" ' + text.metal + ' : ' + addPoints(ressource_m_xh) + '(+' + addPoints(prod_m_xh) + ') | ' + text.cristal + ' : ' + addPoints(ressource_c_xh) + '(+' + addPoints(prod_c_xh) + ') | ' + text.deut + ' : ' + addPoints(ressource_d_xh) + '(+' + addPoints(prod_d_xh) + ') | +' + addPoints(prod_tt_xh) + ' \">' + addPoints(ressource_tt_xh) + '</acronym>';\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\tvar acro_prod_h = '<acronym title=\"' + text.batiment_non_visible + '\"> ? </acronym>';\n\t\t\t\t\t\t\t\t\tvar acro_ress_xh = '<acronym title=\"' + text.batiment_non_visible + '\"> ? </acronym>';\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\t//case simuler en mode exporter vers un autre simulateur.\n\t\t\t\t\t\t\tif (simulateur == 3) {\n\t\t\t\t\t\t\t\tvar saut = '\\n';\n\t\t\t\t\t\t\t\tvar tabulation = '&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t\t\t\t\t\tvar export_scan_simul = 'Ressources sur Mirage ' + coordonee + ' (joueur \\'' + nom_joueur + '\\') le ' + datecc.getMonth() + '-' + datecc.getDate() + ' ' + datecc.getHours() + 'h ' + datecc.getMinutes() + 'min ' + datecc.getSeconds() + 's'\n\t\t\t\t\t\t\t\t\t+ saut\n\t\t\t\t\t\t\t\t\t+ saut + 'Métal:' + tabulation + addPoints(parseInt(ressource_m)) + tabulation + 'Cristal:' + tabulation + addPoints(parseInt(ressource_c))\n\t\t\t\t\t\t\t\t\t+ saut + 'Deutérium:' + tabulation + addPoints(parseInt(ressource_d)) + tabulation + ' Energie:' + tabulation + '5.000'\n\t\t\t\t\t\t\t\t\t+ saut\n\t\t\t\t\t\t\t\t\t+ saut + 'Activité'\n\t\t\t\t\t\t\t\t\t+ saut + 'Activité'\n\t\t\t\t\t\t\t\t\t+ saut + 'Activité signifie que le joueur scanné était actif sur la planète au moment du scan ou qu`un autre joueur a eu un contact de flotte avec cette planète à ce moment là.'\n\t\t\t\t\t\t\t\t\t+ saut + 'Le scanner des sondes n`a pas détecté d`anomalies atmosphériques sur cette planète. Une activité sur cette planète dans la dernière heure peut quasiment être exclue.'\n\t\t\t\t\t\t\t\t\t+ saut + 'Flottes';\n\t\t\t\t\t\t\t\tvar vaisseau_nom = new Array(vari.pt, vari.gt, vari.cle, vari.clo, vari.cro, vari.vb, vari.vc, vari.rec, vari.esp, vari.bb, vari.sat, vari.dest, vari.edlm, vari.tra);\n\t\t\t\t\t\t\t\tvar q_saut_v = 0;\n\t\t\t\t\t\t\t\tif (vaisseau22 != '?/?/?/?/?/?/?/?/?/?') {\n\t\t\t\t\t\t\t\t\tvar vaisseau = vaisseau22.split('/');\n\t\t\t\t\t\t\t\t\tfor (var k = 0; k < vaisseau.length; k++) {\n\t\t\t\t\t\t\t\t\t\tif (parseInt(vaisseau[k]) != 0) {\n\t\t\t\t\t\t\t\t\t\t\tif (q_saut_v < 3) { export_scan_simul = export_scan_simul + ' | ' + vaisseau_nom[k] + tabulation + ' : ' + addPoints(parseInt(vaisseau[k])); q_saut_v++; }\n\t\t\t\t\t\t\t\t\t\t\telse { export_scan_simul = export_scan_simul + saut + ' | ' + vaisseau_nom[k] + tabulation + ' : ' + addPoints(parseInt(vaisseau[k])); q_saut_v = 0; }\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\n\t\t\t\t\t\t\t\texport_scan_simul = export_scan_simul + saut + 'Défense';\n\t\t\t\t\t\t\t\tvar defense_nom = new Array(vari.lm, vari.lle, vari.llo, vari.gauss, vari.ion, vari.pla, vari.pb, vari.gb, vari.mic, vari.mip);\n\t\t\t\t\t\t\t\tvar q_saut = 0;\n\t\t\t\t\t\t\t\tif (defense2 != '?/?/?/?/?/?/?/?/?/?') {\n\t\t\t\t\t\t\t\t\tvar defense = defense2.split('/');\n\t\t\t\t\t\t\t\t\tfor (var k = 0; k < defense.length; k++) {\n\t\t\t\t\t\t\t\t\t\tif (parseInt(defense[k]) != 0) {\n\t\t\t\t\t\t\t\t\t\t\tif (q_saut < 3) { export_scan_simul = export_scan_simul + ' | ' + defense_nom[k] + tabulation + ' : ' + addPoints(parseInt(defense[k])); q_saut++; }\n\t\t\t\t\t\t\t\t\t\t\telse { export_scan_simul = export_scan_simul + saut + ' | ' + defense_nom[k] + tabulation + ' : ' + addPoints(parseInt(defense[k])); q_saut = 0; }\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\n\t\t\t\t\t\t\t\texport_scan_simul = export_scan_simul + saut + 'Bâtiment'\n\t\t\t\t\t\t\t\t+ saut + vari.mine_m + tabulation + mine_m + tabulation + vari.mine_c + tabulation + mine_c\n\t\t\t\t\t\t\t\t+ saut + vari.mine_d + tabulation + mine_d + tabulation\n\t\t\t\t\t\t\t\t+ saut + 'Recherche'\n\t\t\t\t\t\t\t\t+ saut + vari.tech_arm + tabulation + tech_arme_d + tabulation + vari.tech_bouc + tabulation + tech_bouclier_a + tabulation\n\t\t\t\t\t\t\t\t+ saut + vari.tech_pro + tabulation + tech_protect_d\n\t\t\t\t\t\t\t\t+ saut + 'Probabilité de contre-espionnage : 0 %';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//compteur d'attaque\n\t\t\t\t\t\t\tif (q_compteur_attaque == 1) {//si il est activé\n\t\t\t\t\t\t\t\tvar coordonee2_ss_crochet = galaxie + ':' + systeme + ':' + planette;\n\t\t\t\t\t\t\t\tif (attaque_24h.indexOf(coordonee2_ss_crochet) > -1) {//si il est pas compté.\n\t\t\t\t\t\t\t\t\tvar compteur = 0;\n\t\t\t\t\t\t\t\t\tfor (var s = 0; s < attaque_24h_split.length; s++) {\n\t\t\t\t\t\t\t\t\t\tif (attaque_24h_split2[s][1] == coordonee2_ss_crochet) {\n\t\t\t\t\t\t\t\t\t\t\tcompteur++;\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 attaque_deja_fait = compteur;\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\tvar attaque_deja_fait = 0;\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\t//ligne du tableau <tr> de toute les infos du scan\n\t\t\t\t\t\t\tcptLigne++;\n\t\t\t\t\t\t\tligne_tableau += '\\n<tr class=\"' + coordonee + '\" id=\"tr_' + i + '\">';\n\t\t\t\t\t\t\tvar num_scan = nb_scan_deb + cptLigne;\n\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + num_scan + '.</td>';\n\t\t\t\t\t\t\tligne_tableau += '<td><input type=\"checkbox\" name=\"delcase\" value=\"' + i + '\" id=\"check_' + i + '\"/></td>';\n\t\t\t\t\t\t\tligne_tableau += '<td class=\"marqueur\"></td>';\n\n\t\t\t\t\t\t\tif (nom_j_q_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"left\">' + nom_joueur + '</td>';\n\t\t\t\t\t\t\tif (coor_q_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"coordonee\">' + coordonee_fin + '</td>';\n\t\t\t\t\t\t\tligne_tableau += '<td>' + type_honor + '</td>';\n\t\t\t\t\t\t\tligne_tableau += '<td>' + type_joueur + '</td>';\n\t\t\t\t\t\t\tligne_tableau += '<td>' + activite_fin + '</td>';\n\n/* \t\t\t\t\t\t\tvar indexof_inactif = inactif_normal.indexOf(nom_joueur);\n\t\t\t\t\t\t\tif(q_inactif == 0 && indexof_inactif != -1)\n\t\t\t\t\t\t\t\tvar inactif_nom_j = '('+'<span style=\"color:#4A4D4A\">i</span>'+')';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tvar inactif_nom_j = '';\n\t\t\t\t\t\t\tif(nom_p_q_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + nom_planete + inactif_nom_j + '</td>';\n\t\t\t\t\t\t\tif(q_inactif == 1 && indexof_inactif != -1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + '<input type=\"checkbox\" checked=\"checked\" name=\"inactif\" value=\"'+ nom_joueur +'\" class=\"inactif\" id=\"inactif_'+ i +'\"/>' + '</td>';\n\t\t\t\t\t\t\telse if(q_inactif == 1 && indexof_inactif == -1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + '<input type=\"checkbox\" name=\"inactif\" value=\"'+ nom_joueur +'\" class=\"inactif\" id=\"inactif_'+ i +'\"/>' + '</td>'; */\n\t\t\t\t\t\t\tif (nom_p_q_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td title=\"' + nom_planete_complet.replace(/\"/g, '&quot;') + '\">' + nom_planete + '</td>';\n\n\t\t\t\t\t\t\tif (date_affiche == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + date2 + '</td>';\n\t\t\t\t\t\t\tif (tps_vol_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + accronyme_temp_vol + '</td>';\n\t\t\t\t\t\t\tif (prod_h_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + acro_prod_h + '</td>';\n\t\t\t\t\t\t\tif (prod_gg != 0)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + acro_ress_xh + '</td>';\n\t\t\t\t\t\t\tif (q_vid_colo == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td>' + calcul_dernier_vidage(ressource_m, ressource_c, ressource_d, prod_m_h, prod_c_h, prod_d_h, date_scan, mine_m) + '</td>';\n\n\t\t\t\t\t\t\tif (question_rassemble_col == 0) {\n\t\t\t\t\t\t\t\tif (pt_gt != 0)\n\t\t\t\t\t\t\t\t\tligne_tableau += '<td>' + addPoints(nb_pt) + '/' + addPoints(nb_gt) + '</td>';\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + ressource + '</td>';\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + cdr_aco + '</td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + col_cdr + '</td>';\n\t\t\t\t\t\t\t\tif (pt_gt != 0)\n\t\t\t\t\t\t\t\t\tligne_tableau += '<td>' + addPoints(nb_pt) + '/' + addPoints(nb_gt) + '</td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (vaisseau_question != 0)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + acronyme_vaisseau2 + '</td>';\n\t\t\t\t\t\t\tif (defense_question != 0)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right htmlTooltip\">' + acronyme_def2 + '</td>';\n\t\t\t\t\t\t\tif (tech_q == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"right\">' + tech_arme_d + '/' + tech_bouclier_d + '/' + tech_protect_d + '</td>';\n\n\t\t\t\t\t\t\tif (q_compteur_attaque == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td class=\"nombreAttaque\">' + attaque_deja_fait + '</td>';\n\n\t\t\t\t\t\t\tligne_tableau += '<td> <a href=\"' + espionnage + '\" title=\"' + text.espionner + '\"> <img src=\"http://gf2.geo.gfsrv.net/45/f8eacc254f16d0bafb85e1b1972d80.gif\" height=\"16\" width=\"16\"></a></td>';\n\t\t\t\t\t\t\tligne_tableau += '<td> <a class=\"del1_scan\" data-id=\"' + i + '\" title=\"' + text.eff_rapp + '\" ><img src=\"http://gf1.geo.gfsrv.net/99/ebaf268859295cdfe4721d3914bf7e.gif\" height=\"16\" width=\"16\"></a></td>';\n\t\t\t\t\t\t\tvar target;\n\t\t\t\t\t\t\tif (stockageOption.get('attaquer nouvel onglet') === 1) {\n\t\t\t\t\t\t\t\ttarget = '';\n\t\t\t\t\t\t\t} else if (stockageOption.get('attaquer nouvel onglet') === 2) {\n\t\t\t\t\t\t\t\ttarget = ' target=\"_blank\"';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttarget = ' target=\"attaque\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tligne_tableau += '<td class=\"boutonAttaquer\"> <a href=\"' + url_attaquer + '\" title=\"' + text.att + '\"' + target + '><img src=\"http://gf1.geo.gfsrv.net/9a/cd360bccfc35b10966323c56ca8aac.gif\" height=\"16\" width=\"16\"></a></td>';\n\t\t\t\t\t\t\tif (q_mess == 1) {\n\t\t\t\t\t\t\t\tvar url_href = 'index.php?page=showmessage&session=' + info.session + '&ajax=1&msg_id=' + scan_info_i[11] + '&cat=7';\n\t\t\t\t\t\t\t\tligne_tableau += '<td><a class=\"overlay\" href=\"' + url_href + '\" id=\"' + scan_info_i[11] + '\"><img src=\"http://snaquekiller.free.fr/ogame/messages.jpg\" height=\"16\" width=\"16\"/></a></td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (simulateur != 3 && q_lien_simu_meme_onglet == 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td> <a href=\"' + url_simul + '\" title=\"' + text.simul + '\" target=\"_blank\"><img src=\"http://snaquekiller.free.fr/ogame/simuler.jpg\" height=\"16\" width=\"16\"></a></td></tr>';\n\t\t\t\t\t\t\telse if (simulateur != 3 && q_lien_simu_meme_onglet != 1)\n\t\t\t\t\t\t\t\tligne_tableau += '<td> <a href=\"' + url_simul + '\" title=\"' + text.simul + '\" target=\"RaideFacileSimul\"><img src=\"http://snaquekiller.free.fr/ogame/simuler.jpg\" height=\"16\" width=\"16\"></a></td></tr>';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tligne_tableau += '<td> <a href=\"#\" title=\"' + text.simul + '\" id=\"simul_' + i + '\" class=\"lien_simul_' + i + '\"><img src=\"http://snaquekiller.free.fr/ogame/simuler.jpg\" height=\"16\" width=\"16\"></a></td></tr>';\n\t\t\t\t\t\t\tif (simulateur == 3) {\n\t\t\t\t\t\t\t\tligne_tableau += '<tr style=\"display:none;\" id=\"textarea_' + i + '\" class=\"textarea_simul_' + i + '\">' + '<TD COLSPAN=20> <textarea style=\"width:100%;background-color:transparent;color:#999999;text-align:center;\">' + export_scan_simul + '</textarea></td></tr>';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**************** BBCODE EXPORT **************/\n\t\t\t\t\t\t\t// bbcode_export = bbcode_export + coordonee +'==>';\n\t\t\t\t\t\t\tbbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[1] + bbcode_balisem[8] + nom_joueur + '' + bbcode_balisef[8];\n\t\t\t\t\t\t\tif (coor_q_q == 1) { bbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[2] + bbcode_balisem[8] + ' ==> ' + coordonee + '' + bbcode_balisef[8]; }\n\t\t\t\t\t\t\t// bbcode_export = bbcode_export +'==>' + activite_fin + '';\n\t\t\t\t\t\t\tif (nom_p_q_q == 1) { bbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[3] + bbcode_balisem[8] + ' ==> ' + nom_planete_complet + '' + bbcode_balisef[8]; }\n\t\t\t\t\t\t\tbbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[4] + bbcode_balisem[8] + ' ==> ' + addPoints(parseInt(ressource_m)) + 'metal ,' + addPoints(parseInt(ressource_c)) + 'cristal ,' + addPoints(parseInt(ressource_d)) + 'deut (' + nb_pt + '/' + nb_gt + ')' + '' + bbcode_balisef[8];\n\t\t\t\t\t\t\tbbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[5] + bbcode_balisem[8] + ' ==> ' + addPoints(cdr_possible_m) + ' metal ,' + addPoints(cdr_possible_c) + ' cristal ,' + addPoints(Math.round(cdr_possible / 25000)) + ' rc ' + bbcode_balisef[8];\n\t\t\t\t\t\t\tif (acronyme_vaisseau != ' ') { bbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[6] + bbcode_balisem[8] + ' ==> ' + acronyme_vaisseau + '' + bbcode_balisef[8]; }\n\t\t\t\t\t\t\tif (acronyme_vaisseau != ' ') { bbcode_export = bbcode_export + bbcode_baliseo[8] + couleur2[7] + bbcode_balisem[8] + ' ==> ' + acronyme_def + '\\n' + bbcode_balisef[8]; }\n\t\t\t\t\t\t\telse { bbcode_export = bbcode_export + '\\n\\n'; }\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tnb_scan_fin++; // on rajoute un scan a afficher\n\t\t\t\t\t} else\n\t\t\t\t\t\tnb_scan_fin++;\n\t\t\t\t} else if (scan_info[i] && scan_info[i].indexOf(';;;;;;;;;;;;;;;;;x;;') === -1) {\n\t\t\t\t\tscan_info[i] = '';\n\t\t\t\t\tnb_scan_fin++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tnb_scan_fin++;\n\t\t\t} else if (scan_info[i] && scan_info[i].indexOf(';;;;;;;;;;;;;;;;;x;;') === -1)\n\t\t\t\tscan_info[i] = '';\n\t\t}\n\t\tdocument.getElementById('corps_tableau2').innerHTML = ligne_tableau;\n\n\t\t/**************** BBCODE EXPORT **************/{\n\t\t\tvar bbcode_haut = ' ';\n\t\t\tif (q_centre == 1) { bbcode_haut = bbcode_haut + bbcode_baliseo[10] + bbcode_balisem[10]; }\n\t\t\tif (q_cite == 1) { bbcode_haut = bbcode_haut + bbcode_baliseo[4]; }\n\t\t\tbbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[1] + bbcode_balisem[8] + text.th_nj + '' + bbcode_balisef[8];\n\t\t\tif (coor_q_q == 1) { bbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[2] + bbcode_balisem[8] + ' ==> ' + text.th_coo + '' + bbcode_balisef[8]; }\n\t\t\t// bbcode_haut = bbcode_haut +'==>' + activite_fin + '';\n\t\t\tif (nom_p_q_q == 1) { bbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[3] + bbcode_balisem[8] + ' ==> ' + text.th_np + '' + bbcode_balisef[8]; }\n\t\t\tbbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[4] + bbcode_balisem[8] + ' ==> ' + text.th_ress + ' metal , cristal ,deut (pt/gt)' + '' + bbcode_balisef[8];\n\t\t\tbbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[5] + bbcode_balisem[8] + ' ==> ' + text.cdr_pos + ' metal , cristal ,' + text.nb_rc + bbcode_balisef[8];\n\t\t\tbbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[6] + bbcode_balisem[8] + ' ==> pt/gt/cle/clo/cro/vb/vc/rec/esp/bb/sat/dest/edlm/tra' + bbcode_balisef[8];\n\t\t\tbbcode_haut = bbcode_haut + bbcode_baliseo[8] + couleur2[7] + bbcode_balisem[8] + ' ==> lm/lle/llo/gauss/ion/plas/pb/gb/mic/mip \\n\\n' + bbcode_balisef[8];\n\n\t\t\tbbcode_export = bbcode_export + '\\n\\n\\n' + bbcode_baliseo[1] + bbcode_baliseo[5] + 'http://board.ogame.fr/index.php?=Thread&postID=10726546#post10726546' + bbcode_balisem[5] + 'par Raide-Facile' + bbcode_balisef[5] + bbcode_balisef[1];\n\t\t\tif (q_centre == 1) { bbcode_export = bbcode_export + bbcode_balisef[10]; }\n\t\t\tif (q_cite == 1) { bbcode_export = bbcode_export + bbcode_balisef[4]; }\n\n\t\t\tdocument.getElementById('text_bbcode').innerHTML = bbcode_haut + bbcode_export;\n\t\t}\n\t}", "title": "" }, { "docid": "bcd03f2aeed94733990b5383245f9b14", "score": "0.52228117", "text": "function visVareneIKurven() {\n for (var i=0; i < varene.length; i++) {\n if (erIKurven(i)) {\n visEnVare(i);\n }\n }\n }", "title": "" }, { "docid": "a4dd938f41b70970b3c13d5d20ce651f", "score": "0.5219366", "text": "function verifVertical(){\n\tvar contV = 0\n\tfor(x=1;x<8;x++){\n\t\tvar q = $(\".col-\"+x+\" > img.elemento\")\n\t\tfor(y=0;y<5;y++){\n\t\t\tif(($(q[y]).attr(\"src\") == $(q[y+1]).attr(\"src\")) &&\n\t\t\t ($(q[y+1]).attr(\"src\") == $(q[y+2]).attr(\"src\")) &&\n\t\t\t $(q[y]).attr(\"src\") != null && $(q[y+1]).attr(\"src\") != null\n\t\t\t && $(q[y+2]).attr(\"src\") != null){\n\t\t\t\t$(q[y]).addClass(\"borrar\")\n\t\t\t\t$(q[y+1]).addClass(\"borrar\")\n\t\t\t\t$(q[y+2]).addClass(\"borrar\")\n\t\t\t\tcontV = 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn contV;\n}", "title": "" }, { "docid": "9a7372e029ce5255de616703ed573901", "score": "0.52101505", "text": "function casillaValida(colorFichas, posicionAnterior, posicionNueva){\n \n //salida de control\n console.log('verifica, color fichas: ' + colorFichas);\n console.log('verifica, posicion anterior: ' + posicionAnterior);\n console.log('verifica, posicion nueva: ' + posicionNueva);\n\n //creo variables de comparacion de posicion fila y columna\n var filaAnterior = parseInt(posicionAnterior.substring(0,1));\n var columnaAnterior = parseInt(posicionAnterior.substring(2));\n var filaNueva = parseInt(posicionNueva.substring(0,1));\n var columnaNueva = parseInt(posicionNueva.substring(2));\n\n //salida de control\n console.log('verifica, fila anterior: ' + filaAnterior);\n console.log('verifica, columna anterior: ' + columnaAnterior);\n console.log('verifica, fila nueva: ' + filaNueva);\n console.log('verifica, columna nueva: ' + columnaNueva);\n\n\n //verifico segun el color de ficha que toca mover\n if (colorFichas == 'blancas'){ \n console.log('mueven las blancas');\n\n\n //verifico si se esta moviendo en diagonal 1 o 2 lugares\n //para que las blancas puedan avanzar, deben estar en una fila anterior a la 8 en ascendente\n //y la fila nueva ser la proxima a la anterior posicion\n if(filaAnterior < 8 \n && filaNueva == (filaAnterior+1) \n && Math.abs(columnaAnterior-columnaNueva) == 1){\n //para que las blancas puedan avanzar, debe haber una casilla libre en diagonal \n //en la proxima fila que la compararé con la posicion \"target\"\n return true;\n }\n else if(filaAnterior < 7 \n && filaNueva == (filaAnterior+2) \n && Math.abs(columnaAnterior-columnaNueva) == 2){\n //para que las blancas puedan avanzar 2 casillas en diagonal, debe haber una casilla \n //en la proxima segunda fila que la compararé con la posicion \"target\"\n //y debe haber una ficha negra en la casilla anterior para \"comer\"\n \n var posicionPosibleFicha = (filaAnterior+1) + \"-\" + (columnaAnterior + ((columnaNueva-columnaAnterior)/2));\n console.log(posicionPosibleFicha);\n\n //identifico la casilla intermedia\n var casillaVerificar = document.getElementById(posicionPosibleFicha);\n\n //si en la casilla intermedia hay una ficha negra, se mueve la ficha blanca\n //y \"come\" la ficha negra\n if (casillaVerificar.classList.contains('ficha-negra')){ \n casillaVerificar.classList.remove(\"ficha-negra\");\n document.getElementById('puntos2').value -= 1;\n return true;\n }\n }\n } \n else if (colorFichas == 'negras') {\n console.log('mueven las negras');\n\n //para que las negras puedan avanzar, deben estar en una fila anterior a la 0 en descendente\n //y la fila nueva ser la proxima a la anterior posicion\n if(filaAnterior > 0 \n && filaNueva == (filaAnterior-1) \n && Math.abs(columnaAnterior-columnaNueva) == 1){\n //para que las negras puedan avanzar, debe haber una casilla libre en diagonal \n //en la proxima fila que la compararé con la posicion \"target\"\n\n //la casilla, si esta en la columna 1 o la 8, solo tendra posible una casilla de avance\n if (columnaAnterior > 1){\n console.log('se mueve desde la columna mayor a 1, hay celda libre avance columna anterior')\n }\n else if (columnaAnterior < 8){\n console.log('se mueve desde la columna menor a 8, hay celda libre avance columna siguiente')\n }\n return true;\n }\n else if(filaAnterior > 1 \n && filaNueva == (filaAnterior-2) \n && Math.abs(columnaAnterior-columnaNueva) == 2){\n //para que las negras puedan avanzar 2 casillas en diagonal, debe haber una casilla \n //en la proxima segunda fila que la compararé con la posicion \"target\"\n //y debe haber una ficha blanca en la casilla anterior para \"comer\"\n \n var posicionPosibleFicha = (filaAnterior-1) + \"-\" + (columnaAnterior + ((columnaNueva-columnaAnterior)/2));\n console.log(posicionPosibleFicha);\n\n //identifico la casilla intermedia\n var casillaVerificar = document.getElementById(posicionPosibleFicha);\n\n //si en la casilla intermedia hay una ficha blanca, se mueve la ficha negra\n //y \"come\" la ficha blanca\n if (casillaVerificar.classList.contains('ficha-blanca')){ \n casillaVerificar.classList.remove(\"ficha-blanca\");\n document.getElementById('puntos1').value -= 1;\n return true;\n }\n }\n }\n \n //si la casilla no es valida, no se realiza el movimiento\n return false;\n\n}", "title": "" }, { "docid": "9f5424daa3e40ec1a21dc720628baaf4", "score": "0.5203217", "text": "function funz_frena(sezione) {\n avanti(sezione);\n $(\"#scelta_motociclista\").text(testi[lingua].h3.frena);\n\n $(\"#img_macchina\").transition({x:-700, delay:2000}, 1000);\n $(\"#img_casco\").transition({y:+70, delay:2000}, \"slow\");\n $(\"#img_nocasco\").transition({y:-70, delay:2000}, \"slow\");\n}", "title": "" }, { "docid": "33f89739cb2b7424e030adfe350aede6", "score": "0.5200953", "text": "function juega(){\n if (prota.vida > 0){\n if (!ac.pausa){\n mueveNave();\n// //masMalos();\n// mueveMalos();\n// masBalas();\n// mueveBalas();\n// explota();\n pintaEscenario();\n pintaDinamicas();\n pintaCuadroInfo();\n }\n requestAnimationFrame(juega);\n } else {\n cargaFin();\n }\n }", "title": "" }, { "docid": "32ce185b232cf3507b18b9738893482f", "score": "0.5200906", "text": "calculTrajectoire(){\n\n\t\t//Si l'oiseau a été lancé seulement on lui applique une vitesse et la gravité autrement il tomberait au sol ou ne resterait pas à sa position initiale \n\t\tif (this.lance){\n\t\t\tthis.vitesse=this.vitesse.add(Constants.gravity);\n\t\t\tthis.origine=this.origine.add(this.vitesse);\n\t\t}\n\t\t\n\t\t\t\n\t\t//On gère les rebonds avec les obstacles ou le sol\n\t\tif (this.origine.y + this.height > this.y ){\n\t\t\t//this.vitesse=this.vitesse.mult(this.rebond);\n\t\t\tthis.origine.y= this.y - this.height;\n\t\t\tthis.vitesse.y= this.vitesse.y*this.rebond;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t//friction:\n\n\t\tif (this.origine.y + this.height == this.y ){\n\t\t\tthis.vitesse.x*=0.6;\t\t\n\t\t\t}\n\n\t}", "title": "" }, { "docid": "3c0106ed3ff0f1934ac7c79ef85afab6", "score": "0.51979893", "text": "function segunInstrucciones(rover, secondRover) {\n\tfor (var i = 0; i < instrucciones.length; i++) {\n\t\tswitch(instrucciones[i]) {\n\t\t\tcase \"f\":\n\t\t\tirAdelante(rover);\n\t break;\n\t case \"b\":\n\t irAtras(rover);\n\t break;\n\t case \"r\":\n\t irDerecha(rover);\n\t break;\n\t case \"l\":\n\t irIzquierda(rover);\n\t break;\n\t default:\n\t console.log(\"El argumento introducido es incorrecto\");\n\t break;\n\t\t}\n\t}\n\n// Si se encuentra un obstaculo por el camino\nif (rover.position[i] == obstaculos.position1[i]) {\n\tconsole.log(\"Se ha encontrado un obstaculo, es una\" + \" \" + obstaculos.name1 + \"!\");\n} \n\nelse if (rover.position[i] == obstaculos.position2[i]) {\n\tconsole.log(\"Se ha encontrado un obstaculo, es una\" + \" \" + obstaculos.name2 + \"!\");\n}\n console.log(\"Rover position: [\" + rover.position[0] + \",\" + rover.position[1] + \"]\\nRover direction: \" + rover.direction);\n}", "title": "" }, { "docid": "bd564565758e85eaa7c68a4ece871920", "score": "0.519605", "text": "function dibujarVotacion() {\n var c = document.getElementById(\"tablero\");\n var ctx = c.getContext(\"2d\");\n var buttons = [];\n buttons.push(makeButton(0, 560, 300, 800, 300, 'El equipo contrario a solicitado pausar la partida', 'white', 'black', 'black'));\n buttons.push(makeButton(1, 585, 515, 250, 60, 'Aceptar', 'gray', 'black', 'black'));\n buttons.push(makeButton(2, 1085, 515, 250, 60, 'Rechazar', 'gray', 'black', 'black'));\n buttons.forEach(function(b, idx) {\n ctx.clearRect(b.x - 1, b.y - 1, b.w + 2, b.h + 2);\n ctx.fillStyle = b.fill;\n ctx.fillRect(b.x, b.y, b.w, b.h);\n ctx.strokeStyle = b.stroke;\n ctx.strokeRect(b.x, b.y, b.w, b.h);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.font = fuente;\n ctx.fillStyle = b.labelcolor;\n if (b.id == 0) {\n ctx.fillText(b.label, b.x + b.w / 2, b.y + b.h / 4);\n } else {\n ctx.fillText(b.label, b.x + b.w / 2, b.y + b.h / 2);\n if (botonesP.length < 2) {\n botonesP.push(mkBoton(b.id + 11, b.x / dimensiones.escalaTablero, b.y / dimensiones.escalaTablero, b.w / dimensiones.escalaTablero, b.h / dimensiones.escalaTablero));\n }\n }\n });\n}", "title": "" }, { "docid": "379f07b8944b96a8762b3ec7ed9c9821", "score": "0.51940763", "text": "function funcao6()\n{\nalert(\"Produto: Placa de Video GTX 1050\\nValor: R$ 690,75\\nDisponível:5\");\n}", "title": "" }, { "docid": "4deb61976cde5025fb55af423fc467ba", "score": "0.5190078", "text": "function uvIndex(uvi){\n\n if(uvi < 3){\n return 'uvi-low';\n \n }else if(uvi < 6 && uvi > 3){\n return 'uvi-moderate';\n \n } else if(uvi < 8 && uvi > 5){\n return 'uvi-high';\n\n } else if(uvi < 11 && uvi > 7){\n return 'uvi-vhigh';\n\n } else {\n return 'uvi-extreme';\n }\n}", "title": "" }, { "docid": "aa23dd2afeb8b38d6eab37e4eee25fda", "score": "0.51826537", "text": "function intercambiarPosiciones(fila1, columna1, fila2, columna2) {\n // Intercambio posiciones en la cuadrilla\n var pieza1 = cuadrilla[fila1][columna1];\n var pieza2 = cuadrilla[fila2][columna2];\n\n intercambiarPosicionescuadrilla(fila1, columna1, fila2, columna2);\n \n intercambiarPosicionesDOM('pieza' + pieza1, 'pieza' + pieza2);\n\n}", "title": "" }, { "docid": "ca029647f26a43bb8d993ca60efc4542", "score": "0.51786083", "text": "function activarLayout2(layout,nomIdContenedorVC_ON, nomIdContenedorVC_OFF,SEGUIDORES,estadoVentanas){\r\n var activarVentana;\r\n activate = \"SI\"\r\n \r\n //alert(\"ESTADO VENTANAS \" + estadoVentanas)\r\n //alert(\"SEGUIDORES \" + SEGUIDORES)\r\n //alert(\"nomIdContenedorVC_ON \" + nomIdContenedorVC_ON)\r\n //alert(\"nomIdContenedorVC_OFF \" + nomIdContenedorVC_OFF)\r\n \r\n var ventanaActivaAnterior = \"ninguna\";\r\n for (var i = 0; i < estadoVentanas.length; i++) {\r\n if(estadoVentanas[i]==\"greenMandon\" || estadoVentanas[i]==\"red\"){\r\n ventanaActivaAnterior = \"2\"+(i+1) \r\n //alert(\"la ventana activa antes del cambio es: \" + ventanaActivaAnterior)\r\n }\r\n };\r\n ////// si la ventana que voy a activar NO es de vistas combinadas\r\n var identificadorGr = miIDgrafico(nomIdContenedorVC_OFF)\r\n var identificadorGrOn = miIDgrafico(nomIdContenedorVC_ON)\r\n if (identificadorGr==\"noG\"&&identificadorGrOn==\"noG\"){alert(\"no hay gráfico!!!!!!!\")}\r\n else{\r\n if (nomIdContenedorVC_OFF!=[]) { ////// si la ventana que voy a activar NO es de vistas combinadas\r\n var activarVentana = miWorkFrame_fromIDVIP(nomIdContenedorVC_OFF)\r\n var identificadorGr = miIDgrafico(nomIdContenedorVC_OFF)\r\n /////////////////////////////////////// AQUÍ!!!\r\n myFunctionBotonesCuadradosSimple(ventanaActivaAnterior, activarVentana)\r\n \r\n var titulo = titulosGraficos(identificadorGr)\r\n d3.select(\"#\" + nomIdContenedorVC_OFF).selectAll(\"h3\").remove()\r\n d3.select(\"#\" + nomIdContenedorVC_OFF).selectAll(\"h3\").data([1]).enter().append(\"h3\")\r\n .text(titulo + \" \" + untilYear).attr(\"align\",\"center\")\r\n\r\n d3.select(\"#\" + nomIdContenedorVC_OFF).selectAll(\"svg\").remove()\r\n d3.select(\"#\" + nomIdContenedorVC_OFF).selectAll(\"svg\").data([1]).enter().append(\"svg\")\r\n .attr(\"id\",\"contenedorGr\" + activarVentana)\r\n .attr(\"class\",\"chart\" + activarVentana)\r\n .attr(\"width\", \"100%\")\r\n workFrame = activarVentana;\r\n \r\n if (controlEVOLUTION==true){\r\n if (VARIACIONANUAL==\"SI\") {renderVariacionAnual(datos)}\r\n else{renderEvolucion(datos)};\r\n }\r\n else{render(datos)}\r\n \r\n }\r\n else\r\n { \r\n if(nomIdContenedorVC_ON!=[]) ////// si la ventana que voy a activar SI es de vistas combinadas\r\n { //alert(\"nomIdContenedorVC_ON: \" + nomIdContenedorVC_ON)\r\n //alert(\"identificadorGr: \" + identificadorGr)\r\n //workFrame = miWorkFrame_fromIDVIP(nomIdContenedorVC_ON)\r\n //workFrame = ventanaActivaAnterior\r\n //alert(workFrame)\r\n\r\n var activarVentana = miWorkFrame_fromIDVIP(nomIdContenedorVC_ON)\r\n var identificadorGr = miIDgrafico(nomIdContenedorVC_ON)\r\n myFunctionBotonesCuadradosSimple(ventanaActivaAnterior, activarVentana)\r\n //alert(\"Graficar vc \" + miWorkFrame_fromIDVIP(nomIdContenedorVC_ON))\r\n miColorVentanaActiva(miWorkFrame_fromIDVIP(nomIdContenedorVC_ON))\r\n\r\n //myFunctionBotonesCuadradosSimple(ventanaActivaAnterior, activarVentana)\r\n\r\n var titulo = titulosGraficos(identificadorGr)\r\n d3.select(\"#\" + nomIdContenedorVC_ON).selectAll(\"h3\").remove()\r\n d3.select(\"#\" + nomIdContenedorVC_ON).selectAll(\"h3\").data([1]).enter().append(\"h3\")\r\n .text(titulo + \" \" + untilYear).attr(\"align\",\"center\")\r\n\r\n d3.select(\"#\" + nomIdContenedorVC_ON).selectAll(\"svg\").remove()\r\n d3.select(\"#\" + nomIdContenedorVC_ON).selectAll(\"svg\").data([1]).enter().append(\"svg\")\r\n .attr(\"id\",\"contenedorGr\" + miWorkFrame_fromIDVIP(nomIdContenedorVC_ON))///\r\n .attr(\"class\",\"chart\" + miWorkFrame_fromIDVIP(nomIdContenedorVC_ON))///\r\n .attr(\"width\", \"100%\")\r\n workFrame = miWorkFrame_fromIDVIP(nomIdContenedorVC_ON)\r\n datos = window[\"graphic\"+ identificadorGr];\r\n if (controlEVOLUTION==true){\r\n if (VARIACIONANUAL==\"SI\") {renderVariacionAnual(datos)}\r\n else{renderEvolucion(datos)};\r\n }\r\n else{render(datos)}\r\n \r\n //////////////////// SI EXISTEN SLAVES\r\n if (SEGUIDORES ==\"#window21\" || SEGUIDORES ==\"#window22\") {\r\n //alert(\"dentro de seguidores SEGUIDORES \" + SEGUIDORES)\r\n console.log(SEGUIDORES)\r\n miColorVentanaSLAVEactivadas(miGraficoActivoAlmoadilla(SEGUIDORES))\r\n \r\n fromMASTER = miPosicionResumenMAT(nomIdContenedorVC_ON)\r\n toSLAVE = miPosicionResumenMAT_workframe(miGraficoActivo_workframe(SEGUIDORES))\r\n\r\n //console.log(resumenMAT)\r\n console.log(\"from: \"+ fromMASTER)\r\n console.log(\"to: \"+ toSLAVE)\r\n\r\n //workFrame = miGraficoActivo_workframe(SEGUIDORES)\r\n \r\n //myFunctionBotonesCuadradosSimple(ventanaActivaAnterior, activarVentana)\r\n\r\n copyFiltradoMaster(resumenMAT,miGraficoActivo_workframe(SEGUIDORES), fromMASTER,toSLAVE)\r\n //console.log(resumenMAT)\r\n //alert(\"seguidores: \" + SEGUIDORES)\r\n //alert(\"cargar datos \"+ miIDgrafico(miGraficoActivo_IDVIP(SEGUIDORES)))\r\n \r\n \r\n // graficar\r\n var titulo = titulosGraficos( miIDgrafico(miGraficoActivo_IDVIP(SEGUIDORES)))\r\n\r\n //alert(\"workframe2 :\" + miGraficoActivo(SEGUIDORES[i]))\r\n d3.select(\"#\" + miGraficoActivoAlmoadilla(SEGUIDORES)).selectAll(\"h3\").remove()\r\n d3.select(\"#\" + miGraficoActivoAlmoadilla(SEGUIDORES)).selectAll(\"h3\").data([1]).enter().append(\"h3\")\r\n .text(titulo + \" \" + untilYear).attr(\"align\",\"center\")\r\n\r\n d3.select(\"#\" + miGraficoActivoAlmoadilla(SEGUIDORES)).selectAll(\"svg\").remove()\r\n d3.select(\"#\" + miGraficoActivoAlmoadilla(SEGUIDORES)).selectAll(\"svg\").data([1]).enter().append(\"svg\")\r\n .attr(\"id\",\"contenedorGr\" + miGraficoActivo_workframe(SEGUIDORES))\r\n .attr(\"class\",\"chart\" + miGraficoActivo_workframe(SEGUIDORES))\r\n .attr(\"width\", \"100%\")\r\n datos = window[\"graphic\" + miIDgrafico(miGraficoActivo_IDVIP(SEGUIDORES))];\r\n workFrame = miGraficoActivo_workframe(SEGUIDORES)\r\n if (controlEVOLUTION==true){\r\n if (VARIACIONANUAL==\"SI\") {renderVariacionAnual(datos)}\r\n else{renderEvolucion(datos)};\r\n }\r\n else{render(datos)}\r\n\r\n //};\r\n\r\n }; \r\n }\r\n } \r\n }\r\n}", "title": "" }, { "docid": "ec5d1908cf6327b3af3e08fe7aa47566", "score": "0.5170731", "text": "function hayGanador(v)\r\n{\r\n\t// posibilidad de victoria 1\r\n\tvar p1 = [\"b0\", \"b1\", \"b2\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\t\r\n\r\n\t// posibilidad de victoria 2\r\n\tvar p1 = [\"b0\", \"b4\", \"b8\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// posibilidad de victoria 3\r\n\tvar p1 = [\"b0\", \"b3\", \"b6\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// posibilidad de victoria 4\r\n\tvar p1 = [\"b1\", \"b4\", \"b7\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// posibilidad de victoria 5\r\n\tvar p1 = [\"b2\", \"b4\", \"b6\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// posibilidad de victoria 6\r\n\tvar p1 = [\"b2\", \"b5\", \"b8\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// posibilidad de victoria 7\r\n\tvar p1 = [\"b3\", \"b4\", \"b5\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t// posibilidad de victoria 8\r\n\tvar p1 = [\"b6\", \"b7\", \"b8\"];\r\n\tif(v.indexOf(p1[0])>-1)\r\n\t{\r\n\t\tif(v.indexOf(p1[1])>-1)\r\n\t\t{\r\n\t\t\tif(v.indexOf(p1[2])>-1)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\r\n\treturn false;\r\n}", "title": "" }, { "docid": "4f7329b129def371f031e00f349c2b9c", "score": "0.51653314", "text": "function deseneazaVideoPlayer() {\n\t\t//Fundal canvas---------------------------------------------------------------\n\t\tcontext.fillStyle = '#000'; //Setez culoarea de umplere cu negru\n\t\tcontext.fillRect(0, 0, canvas.width, canvas.height); //Desenez un dreptunghi\n\t\t//Container/bordura canvas----------------------------------------------------\n\t\tcontext.strokeStyle = '#fff'; //Setez culoarea bordurii cu alb\n\t\tcontext.strokeRect(5, 5, canvas.width - 10, canvas.height - 10);\n\t\t//Cadru video-----------------------------------------------------------------\n\t\t//In functie de id-ul efectului \n\t\tif (idEfect == 0) {//Desenez imaginea normala pe care o preluam din videoclip\n\t\t\tcontext.drawImage(video, 7, 7, 600, 340);\n\t\t}\n\t\telse if (idEfect == 1) {//Aplic efectul de gri\n\t\t\tgri();\n\t\t}\n\t\telse if (idEfect == 2) {//Aplic efectul sepia\n\t\t\tsepia();\n\t\t}\n\t\telse if (idEfect == 3) {//Aplic efectul rosu\n\t\t\trosu();\n\t\t}\n\t\telse if (idEfect == 4) {//Aplic efectul de inversare a culorilor\n\t\t\tinverseaza();\n\t\t}\n\t\t//Desenare gradient player------------------------------------------------------------\n\t\t//Creez un gradient liniar in zona in care vor fi plasate controalele, in partea de jos\n\t\tvar gradient = context.createLinearGradient(0, 200, 0, 600);\n\t\tgradient.addColorStop(0, \"white\"); //Culoarea de start de sus\n\t\tgradient.addColorStop(0.5, \"black\"); //Culoarea de mijloc\n\t\tgradient.addColorStop(1, \"white\"); //Culoarea de stop de jos\n\t\tcontext.fillStyle = gradient; //Atasez gradientul ca si culoare de umplere\n\t\tcontext.fillRect(7, 348, 600, 35); //Umplu gradientul atasat in zona de dreptunghi\n\t\t//Desenare controale------------------------------------------------------------------\n\t\t//Previous----------------------------------------------------------------------------\n\t\tcerc(35, 366, 15, \"#868686\"); \n\t\tsageataStanga(25, 355, 32, 23, \"#282828\"); //Desenez sageata stanga a butonului previous\n\t\t//Play--------------------------------------------------------------------------------\n\t\tcerc(80, 366, 15, \"#868686\"); //Desenez cercul butonului play\n\t\tif (video.paused) {//Daca videoclipul e setat pe pauza atunci afisam sageata de redare(spre dreapta)\n\t\t\tsageataDreapta(59, 355, 32, 23, \"#194719\"); //Sageata dreapta \n\t\t\t//Fundal zona video---------------------------------------------------------\n\t\t\t//Cand vide-ul este pe pause punem o culare de gri pe zona video si un buton de play\n\t\t\tcontext.beginPath(); //Incep/resetez o zona pt desena pe canvas\n\t\t\tcontext.rect(7, 7, 600, 340); //Creez un dreptunghi cat zona video\n\t\t\tcontext.fillStyle = \"rgba(0, 0, 0, 0.5)\"; //Setez o culoare transparenta de umplere\n\t\t\tcontext.fill(); //Umplu regiunea \n\t\t\tcerc(307, 195, 30, \"rgba(199, 199, 198, 0.5)\"); //Creez cercul butonului ce va aparea in mijlocul zonei video\n\t\t\tsageataDreapta(262, 173, 67, 45, \"rgba(0, 0, 0, 0.5)\"); //In el pun sageata dreapta / de play\n\t\t\tcontext.closePath();\n\t\t}\n\t\telse {//Altfel daca filmul ruleaza atunci afisam simbolul de pauza, \n\t\t\t//doua bare laterale\n\t\t\tbara(67, 356, 36, 19);\n\t\t\tbara(75, 356, 36, 19);\n\t\t}\n\t\t//Next--------------------------------------------------------------------------------\n\t\tcerc(580, 366, 15, \"#868686\"); //Desenez cercul butonului next\n\t\tsageataDreapta(558, 355, 32, 23, \"#282828\"); //Desenez sageata dreapta a butonului next\n\t\t//Progress bar-------------------------------------------------------------------------\n\t\tcontext.beginPath(); //Incep/resetez o zona pt desena pe canvas\n\t\tcontext.rect(113, 357, 437, 20); //Desenez un dreptungi in partea de jos intre \n\t\t//butoanele de play/pause si next\n\t\tcontext.fillStyle = \"#868686\"; //Setez culoare de umplere\n\t\tcontext.fill(); //Umplu regiunea\n\t\tcontext.lineWidth = 0.6; //Setez grosimea bordurii\n\t\tcontext.strokeStyle = 'black'; //Setez culoarea bordurii\n\t\tcontext.stroke(); //Aplic bordura\n\t\tcontext.closePath();\n\t\t//Setez un intervar pentru a executa functia de desenare progress bar la 20 milisecunde\n\t\tvar interval2 = window.setInterval(progress(), 20);\n\t\t//video.addEventListener(\"timeupdate\", progress()); //As fi putut sa folosesc si evenimentul timeupdate\n\t\t//Functia care va fi apelata pt desenarea dinamica a progress bar-ului\n\t\tfunction progress() {\n\t\t\t//Calculez cat la suta s-a scurs din video raportat la durata si impart la 100\n\t\t\tvar procent = Math.floor((100 / video.duration) * video.currentTime) / 100;\n\t\t\tcontext.beginPath(); //Incep/resetez o zona pt desena pe canvas\n\t\t\tcontext.fillStyle = \"#999999\"; //Setez culoarea de umplere\n\t\t\tcontext.fillRect(113, 357, 437 * procent, 20); //Creez un dreptunghi la x=113 si y=357, \n\t\t\t//de latime cat s-a scurs ori latimea pe care trebuie s-o aiba si inaltime 20 \n\t\t\tcontext.closePath();\n\t\t}\n\t\twindow.clearInterval(interval2); //Resetez intervalul \n\n\t\t//Subtitrare-------------------------------------------------------------------------------\n\t\tfor (var i = 0; i < videoclipuri.length; i++) { //Parcurg array-ul aflat in fisierul json\n\t\t\tif (videoclipuri[i].id == idVideo) { //Daca id-ul videoclipului corespunde cu id-ul clipului care ruleaza\n\t\t\t\t//Imi obtin subtitrarea de la pozitia i din colectia de clipuri (pentru a ma referi mai usor)\n\t\t\t\tvar s = videoclipuri[i].subtitrare;\n\t\t\t\tfor (var j = 0; j < s.length; j++) { //Parcurg subtitrarea clipului curent\n\t\t\t\t\t//Compar partea intreaga din secunda videoclipului care ruleaza, altfel ar trebui sa compar cu valori cu multe zecimale\n\t\t\t\t\t//cu secunda definita in colectia de subtitrari de la pozitia j\n\t\t\t\t\tif (s[j].sec1 <= video.currentTime && video.currentTime <= s[j].sec2) {\n\t\t\t\t\t\tcontext.beginPath(); //Incep/resetez o zona pt desena pe canvas\n\t\t\t\t\t\tcontext.fillStyle = \"white\"; //Setez culoarea de umplere\n\t\t\t\t\t\tcontext.strokeStyle = \"black\"; //Setez culoarea bordurii\n\t\t\t\t\t\tcontext.lineWidth = 0.2; //Setez grosimea bordurii\n\t\t\t\t\t\tcontext.font = \"30px Georgia\"; //Setez fontul (+dimensiunea) \n\t\t\t\t\t\tcontext.textAlign = \"center\"; //Setez aliniamentul textului\n\t\t\t\t\t\t//Setez unde apara textul si bordura subtitrarii (pe care il iau din colectie de la pozitia j)\n\t\t\t\t\t\t//La x=307 (mijlocul zonei canvas), y=330 in partea de jos a zonei video, 400=latimea maxima admisa a textului\n\t\t\t\t\t\tcontext.fillText(s[j].text, 307, 330, 400); //textul\n\t\t\t\t\t\tcontext.strokeText(s[j].text, 307, 330, 400); //bordura\n\t\t\t\t\t\tcontext.closePath();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7f51032aee3dc5afc35ea34ec3f4fb0a", "score": "0.51632", "text": "function joue(x,y){\n\tif(!continueJeu) return false;\n\tif(grille[x][y]) return false;\n\tvar rslt;\n\tchangeCouleur(x,y);\n\tcouleurTour = couleurTour%2+1;\n\tif(rslt=verifVainqueur(x,y)){ //y a-t-il un gagnant ?\n\t\tcontinueJeu = false;\n\t\talert((rslt===1?\"Noirs\":\"Blancs\")+\" vainqueurs\");\n\t}\n\n\tif(!verifNbLibre()){\n\t\tcontinueJeu = false;\n\t\talert(\"Parie nulle : égalité\");\n\t}\n\n\t//est-ce que le prochain coup doit être joué par l'IA ?\n\tiaToPlay();\n}", "title": "" }, { "docid": "d86b163b9c7d35fc978be4b2f3d1fff7", "score": "0.51628053", "text": "function segundaPreguntaVideoG(){\n alerta(\"incorrect5\",\"incorrect4\", \"correct2\" );\n if (estado == 'contestado'){\n ocultarMostrar(\"videoJuegos3\",\"videoJuegos2\");\n } \n}", "title": "" }, { "docid": "e751eda537fdc7e83ee83f08903b6fee", "score": "0.5159485", "text": "parte_parque1(pos_x, pos_y, pos_z, rot_x, rot_y, rot_z, esc_x, esc_y, esc_z) {\n t.crear_texturas(\"texturas/piedra.webp\", 3, 3);\n cu.crear_cubo(\n 220,\n 10,\n -300,\n 1000,\n 25,\n 800,\n textura,\n false,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1\n );\n baseiglesia.add(cubo);\n //gradas frente\n darColor = true;\n cu.crear_cubo(\n 220,\n 3,\n -278,\n 1000,\n 5,\n 800,\n textura,\n false,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 0x6e6e6e\n );\n baseiglesia.add(cubo);\n darColor = true;\n cu.crear_cubo(\n 220,\n 6,\n -286,\n 1000,\n 9,\n 800,\n textura,\n false,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 0x848484\n );\n baseiglesia.add(cubo);\n darColor = true;\n cu.crear_cubo(\n 220,\n 10,\n -292,\n 1000,\n 13,\n 800,\n textura,\n false,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 0x6e6e6e\n );\n baseiglesia.add(cubo);\n\n baseiglesia.position.x = pos_x;\n baseiglesia.position.y = pos_y;\n baseiglesia.position.z = pos_z;\n\n baseiglesia.rotation.x = rot_x;\n baseiglesia.rotation.y = rot_y;\n baseiglesia.rotation.z = rot_z;\n\n baseiglesia.scale.x = esc_x;\n baseiglesia.scale.y = esc_y;\n baseiglesia.scale.z = esc_z;\n }", "title": "" }, { "docid": "334779a88d629b6e3b42e933946ed952", "score": "0.5156972", "text": "function encodeVowelWord(word) {\n let referencia = palabra.value;\n let adFinal = \"yay\";\n let total = referencia;\n if(vogals.includes(referencia.split(\"\")[0])){\n total = referencia + adFinal;\n showResults(\"vocalPig\", total);\n return total;\n }else{\nencodeConsonantWord();\n }\n}", "title": "" }, { "docid": "dea55ae0b0b82bfaec6db0b500688ea3", "score": "0.5155963", "text": "function makeVase(segments, phiStart, phiLength) {\n \n var vase = new THREE.Object3D();\n var points = [];\n var height = 5;\n var count = 30;\n for (var i = 0; i < count; i++) {\n points.push(new THREE.Vector3((Math.sin(i * 0.2) + Math.cos(i * 0.3)) * height + 12, 0, ( i - count ) + count / 2));\n }\n console.log(points); \n\n // geometry for the bottom\n var vbottomG = new THREE.PlaneGeometry((2*points[points.length-1].x)/Math.sqrt(2),(2*points[points.length-1].x)/Math.sqrt(2));\n console.log(2*points[points.length-1].x);\n var vbottomMat = new THREE.MeshPhongMaterial({\n color: color, \n side: THREE.DoubleSide,\n transparent: true,\n opacity: 0.9\n } );\n var vbottom = new THREE.Mesh(vbottomG,vbottomMat);\n\n // rotate the bottom so that it is in the same orientation as the body of the base \n vbottom.rotation.z =.25*Math.PI;\n vbottom.rotation.x = .5*Math.PI;\n vase.add(vbottom);\n\n // use the same points to create a convexgeometry\n var latheGeometry = new THREE.LatheGeometry(points, segments, phiStart, phiLength);\n latheMesh = new THREE.Mesh(latheGeometry,vbottomMat);\n latheMesh.translateY(14);\n latheMesh.rotation.x=.5*Math.PI;\n vase.add(latheMesh);\n\n return vase;\n }", "title": "" }, { "docid": "dc339105bb01e0acc32ee38c29dc2275", "score": "0.5151523", "text": "function lado_colision (obj1, obj2) {\nvar dist_h=obj1.x_anterior-obj2.x_anterior;\nvar dist_v=obj1.y_anterior-obj2.y_anterior;\nvar angulo=(Math.asin(Math.abs(dist_v)/(Math.sqrt((Math.abs(dist_v)*Math.abs(dist_v))+(Math.abs(dist_h)*Math.abs(dist_h)))))*180)/Math.PI;\nif (dist_h > 0 && dist_v <= 0){\nif (angulo < 45) return 3;\nif (angulo > 45) return 2;\n}\nif (dist_h <= 0 && dist_v <= 0){\nif (angulo < 45) return 1;\nif (angulo > 45) return 2;\n}\nif (dist_h <= 0 && dist_v > 0){\nif (angulo < 45) return 1;\nif (angulo > 45) return 4;\n}\nif (dist_h > 0 && dist_v > 0){\nif (angulo < 45) return 3;\nif (angulo > 45) return 4;\n}\n}", "title": "" }, { "docid": "4e4d9b01a716cb3302fec5f1f6a7873a", "score": "0.5145096", "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": "a7f177be82352faa689c0d3c9b0060b0", "score": "0.514367", "text": "function getVencedor() {\n if (getTamanhoMao(maoJogador) > 21 || getTamanhoMao(maoBot) > 21) {\n if (getTamanhoMao(maoBot) > getTamanhoMao(maoJogador)) {\n pontosJogador++;\n resultado = 'Você venceu';\n comando = 'parar';\n revelarCartaBot()\n encerrar()\n popUp()\n\n } else if (getTamanhoMao(maoJogador) == getTamanhoMao(maoBot)) {\n pontosEmpate++;\n resultado = 'Empate';\n comando = 'parar'\n revelarCartaBot()\n encerrar()\n popUp()\n }\n else {\n pontosBot++;\n resultado = 'Você perdeu';\n comando = 'parar'\n revelarCartaBot()\n encerrar();\n popUp();\n }\n }\n else if (getTamanhoMao(maoJogador) == 21 || getTamanhoMao(maoBot) == 21) {\n if (getTamanhoMao(maoJogador) > getTamanhoMao(maoBot)) {\n pontosJogador++;\n resultado = 'Você venceu';\n comando = 'parar'\n revelarCartaBot()\n encerrar();\n popUp();\n } else if (getTamanhoMao(maoJogador) == getTamanhoMao(maoBot)) {\n pontosEmpate++;\n comando = 'parar'\n resultado = 'Empate';\n revelarCartaBot()\n encerrar();\n popUp();\n }\n else {\n pontosBot++;\n comando = 'parar'\n resultado = 'Você perdeu';\n revelarCartaBot()\n encerrar();\n popUp();\n\n }\n }\n else if (getTamanhoMao(maoJogador) < 21 || getTamanhoMao(maoBot) < 21) {\n if (getTamanhoMao(maoJogador) > getTamanhoMao(maoBot)) {\n pontosJogador++;\n resultado = 'Você venceu';\n comando = 'parar'\n revelarCartaBot()\n encerrar();\n popUp();\n } else if (getTamanhoMao(maoJogador) == getTamanhoMao(maoBot)) {\n pontosEmpate++;\n comando = 'parar'\n resultado = 'Empate';\n revelarCartaBot()\n encerrar();\n popUp();\n }\n else {\n pontosBot++;\n comando = 'parar'\n resultado = 'Você perdeu';\n revelarCartaBot()\n encerrar();\n popUp();\n }\n }\n}", "title": "" }, { "docid": "7fd227a28d36b43584676e81cc17596d", "score": "0.51294994", "text": "function venceu(escolhaDoComputador,escolhaDoJogador) {\r\n //Incrementar o placar\r\n placarJogador++;\r\n placarJogadorSpan.innerText = placarJogador;\r\n resultadoP.innerText = `${escolhaDoJogador} vence ${escolhaDoComputador}. Você venceu!`;\r\n }", "title": "" }, { "docid": "2ff6082b2476b884d3d8ba66c6f487bb", "score": "0.5122535", "text": "function Vh(a){var b=Wh;this.g=[];this.v=b;this.o=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.w=this.i=!1;this.h=0;this.b=null;this.l=0}", "title": "" }, { "docid": "917fb9896796b99771b7d1ab4a577932", "score": "0.51219296", "text": "function check_colision_zona (objeto)\n{\nif (zona.height < objeto.y*escala+objeto.alto){\nfriccion_x(objeto,0);\nobjeto.velocidad_inicial_y=-(calc_velocidad_actual_y(objeto))*coeficientes[0][objeto.material][3];\nobjeto.y=(zona.height-objeto.alto)/escala;\nobjeto.y_inicial=objeto.y;\nobjeto.tiempo_inicial_y=indice_frame;\n};\nif (0 > objeto.y*escala){\nfriccion_x(objeto,0);\nobjeto.velocidad_inicial_y=-(calc_velocidad_actual_y(objeto))*coeficientes[0][objeto.material][3];\nobjeto.y=0;\nobjeto.y_inicial=objeto.y;\nobjeto.tiempo_inicial_y=indice_frame;\n};\nif (0 > objeto.x*escala){\nfriccion_y(objeto,0);\nobjeto.velocidad_inicial_x=-(calc_velocidad_actual_x(objeto))*coeficientes[0][objeto.material][3];\nobjeto.x=0;\nobjeto.x_inicial=objeto.x;\nobjeto.tiempo_inicial_x=indice_frame;\n};\nif (zona.width < objeto.x*escala+objeto.ancho){\nfriccion_y(objeto,0);\nobjeto.velocidad_inicial_x=-(calc_velocidad_actual_x(objeto))*coeficientes[0][objeto.material][3];\nobjeto.x=(zona.width-objeto.ancho)/escala;\nobjeto.x_inicial=objeto.x;\nobjeto.tiempo_inicial_x=indice_frame;\n};\n}", "title": "" }, { "docid": "730c1764f12e1493720589ce05cf65a1", "score": "0.5118771", "text": "function evi(IdEvi,NEvi,ValEvi) {\n\t// IdEvi -> es el Id del btn que se esta pulsando \n\t// NEvi -> este el numero de la evidencia que nos sirve para saber si esta es la evidencia 1 2 3 4 5 \n\t// Val -> y este contiene la calificacion de la evidencia \n\n\t/* \n\t\tal crear esta funcion y usar arrays para el almacenamiento se evita repetir codigo\n\t\tevitando escribir un metodo para cada numero de evidencia, de esta manera sin importar cuantas \n\t\tsean las evidencia a calificar funciona y almacena las calificaciones de cada una.\n\t*/\n\n\t/*\n\t\tEsta funcion se encarga de mostrar y guardar la calificacion de cada una de las evidencias \n\t\tmarca en un color verde la calificaion seleccionada y guarda dentro del array ValorEvidencia la calificion \n\t\tEstos valores se ocupan para realizar los calculos de la calificaion final por el momento el porcentaje \n\t\tde todas las evidencias es del 50% de la calificacion total es decir si son 3 evidencias y en todas se obtine\n\t\tuna calificacion de 10 tiene ya un 50% de la calificaion total.\n\n\t\tComo el codigo es para mi papa y el ocupara siempre el valor 50% evidencias 50% examen no crei necesario \n\t\tponer la opcion de dar un valor en porcentaje a las evidencias y al examen\n\t*/\n\n\tif (IdEvidencia[NEvi] != \"\") {\n\t\t/*\n\t\t\tcada que se pulsa un boton este se debe poner en color verded para que el usuario sepa que \n\t\t\tcalificacion esta otorgando a cada evidencia, por lo que primero antes de poner de color verde el boton \n\t\t\tpulsado comprueba si existe otro boton en color verde, esto lo hace viendo si existe un id de boton almacenado \n\t\t\ten el array si esta es true toma ese id del boton para regresarlo a ser de color azul y despues poner en verde el btn\n\t\t\tpulsado \n\t\t*/\n\t\t$(IdEvidencia[NEvi]).removeClass(\"btn-success\");\n\t\t$(IdEvidencia[NEvi]).addClass(\"btn-primary\");\n\t}else{\n\t\t/*\n\t\t\tsi no existe ningun id en array esto quiere decir que el btn que esta en el verde es el btn por default N/P\n\t\t\tpor lo que se le quita a este el color verde para despues darle el color verde al btn pulsado\n\t\t*/\n\t\tvar NN = NEvi + 1;\n\t\tvar IdEvi0 = \"#Var\"+NN+\"E0\";\n\t\t$(IdEvi0).removeClass(\"btn-success\");\n\t\t$(IdEvi0).addClass(\"btn-primary\");\n\t}\n\t\n\t// en esta parte se pone de color verde el btn pulsado y se toma el valor del mismo para poder hacer calculos \n\tvar id = \"#\"+IdEvi; // primero tomamos de la funcion el parametro del Id el cual no sirve para saber que btn ser va a poner en verde\n\t$(id).removeClass(\"btn-primary\"); // se le quita el color azul \n\t$(id).addClass(\"btn-success\"); // y despues se pasa a ponerlo en color verded\n\n\tValorEvidencia[NEvi] = ValEvi; // se guarda en el arreglo el valor de la calificacion\n\tIdEvidencia[NEvi] = id; // y se guarda el Id de btn para quitarle el color verde cuando se pulse otro \n\tcalcular();\n}", "title": "" }, { "docid": "de45015865d5e34fcd93c4c0dcf84d6d", "score": "0.5117551", "text": "function primeraPreguntaVideoG(){\n alerta(\"incorrect\",\"incorrect2\", \"correct\" );\n if (estado == 'contestado'){\n ocultarMostrar(\"videoJuegos2\",\"videoJuegos1\");\n } \n}", "title": "" }, { "docid": "ecf42a357f7c1714aaffe89599ae9033", "score": "0.5117119", "text": "function alterar_dse(linha,coluna){\r\n\r\n\t\tvar k=1;\r\n\t\tif(linha-k < 0 || coluna-k<0) return false;\r\n\t\telse if(tab[linha-k][coluna-k] == player || tab[linha-k][coluna-k] == 0) return false;\r\n\r\n\t\tfor(var i=linha-2; i>=0; i--){\r\n\t\t\tk++;\r\n\t\t\tif( coluna-k < 0) return false;\r\n\t\t\tif( tab[i][coluna-k] == player) { trocar_pecas(linha,coluna,6,k); return true;}\r\n\t\t\tif( tab[i][coluna-k] == 0) return false;\r\n\t\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "8d889add06465476391ba01ac7054f66", "score": "0.5113447", "text": "function dibujar() {\n if (fondo.cargaOK == true) {\n papel.drawImage(fondo.imagen, 0, 0);\n }\n if (vaca.cargaOK == true) {\n for (let v = 0; v < 1; v++) {\n x = redondear(0, vp.width - vaca.imagen.width);\n y = redondear(0, vp.height - vaca.imagen.height);\n papel.drawImage(vaca.imagen, x, y);\n console.log(\"🚀 ~ vaca.imagen\", vaca.imagen);\n console.log(\"🚀 ~ x\", x);\n console.log(\"🚀 ~ y\", y);\n }\n }\n}", "title": "" }, { "docid": "591da9407bdbd27a6becfafa7779f40c", "score": "0.51126367", "text": "function actualizarVida() {\n if (player1.vida < 10) {\n barraVida.frame = 0;\n }\n if (player1.vida >= 10 && player1.vida < 20) {\n barraVida.frame = 1;\n }\n if (player1.vida >= 20 && player1.vida < 30) {\n barraVida.frame = 2;\n }\n if (player1.vida >= 30 && player1.vida < 40) {\n barraVida.frame = 3;\n }\n if (player1.vida >= 40 && player1.vida < 50) {\n barraVida.frame = 4;\n }\n if (player1.vida >= 50 && player1.vida < 60) {\n barraVida.frame = 5;\n }\n if (player1.vida >= 60 && player1.vida < 70) {\n barraVida.frame = 6;\n }\n if (player1.vida >= 70 && player1.vida < 80) {\n barraVida.frame = 7;\n }\n if (player1.vida >= 80 && player1.vida < 90) {\n barraVida.frame = 8;\n }\n if (player1.vida >= 90 && player1.vida < 100) {\n barraVida.frame = 9;\n }\n if (player1.vida === 100) {\n barraVida.frame = 10;\n }\n}", "title": "" }, { "docid": "fe414b33823334c47163b0b3d163ff6c", "score": "0.51082563", "text": "function rombo (ctx, vertice1, vertice2, vertice3, vertice4) {\r\n ctx.moveTo(vertice1[0], vertice1[1]);\r\n ctx.lineTo(vertice2[0], vertice2[1]);\r\n ctx.lineTo(vertice3[0], vertice3[1]);\r\n ctx.lineTo(vertice4[0], vertice4[1]);\r\n ctx.lineTo(vertice1[0], vertice1[1]);\r\n }", "title": "" }, { "docid": "d7f9cd2a7b6818789a0b3f133320b473", "score": "0.5098434", "text": "function dugme11(){//trazim magijska stvorenja u zamku i duhove\r\n gryffindorpts+=10;\r\n slytherinpts+=0;\r\n hufflepuffpts+=50;\r\n ravenclawpts+=40;\r\n ispisiPoene();\r\n pitanje1nestaje();\r\n}", "title": "" }, { "docid": "6650eb629b4f056b8e7850e61f056cdb", "score": "0.50936466", "text": "function perg2_1(){\n pergunta = \"Qual o Objetivo de Desenvolvimento Sustentável #2? \"\n resposta1 = \"Erradicação da Pobreza\";\n resposta2 = \"Redução das desigualdades\";\n resposta3 = \"Paz, justiça e instituições fortes\";\n resposta4 = \"Fome zero e agricultura sustentável\";\n telaPerguntas(imagemRespODS2,1,v,v,v,9,resposta1,resposta2,resposta3, resposta4, pergunta);\n\n}", "title": "" }, { "docid": "fbaeac39445160428aa9a3d003a5eb64", "score": "0.5093581", "text": "function tuaEscolha(nomeEscolha) {\r\n pausa = 0;\r\n if (all != 0) fim();\r\n if (all == 0) {\r\n cf = 0;\r\n ok = 0;\r\n temp = nomeEscolha;\r\n verificarEspaco();\r\n if (ok == 1) {\r\n document.images[nomeEscolha].src = x;\r\n }\r\n if (ok == 0) usado();\r\n processo();\r\n if ((all == 0) && (pausa == 0)) minhaEscolha();\r\n }\r\n }", "title": "" }, { "docid": "bab94f9c0765d739015b74ae3dd1a29d", "score": "0.50931287", "text": "function paridispari() {\n if (numeroutente > numerocpu) {\n document.write(sceltautente);\n } else if (numeroutente === numerocpu) {\n document.write('pareggio');\n } else {\n document.write(sceltacpu);\n }\n}", "title": "" }, { "docid": "bdfe4aeb1b6b17c22bd30d99678b9e1f", "score": "0.508946", "text": "function ADouaFunctie(/* intre parantezele rotunde se pun parametri */) {\r\n // intre acolade se pune continutul functiei (liniile de cod)\r\n}", "title": "" }, { "docid": "bbaa085868661a7115c0cef6d24384c9", "score": "0.5089183", "text": "function verificaVitoria() {\n if (!temVencedor) {\n if ((velha[0] + velha[1] + velha[2]) == 3 * last) {\n strike(0, 100, 600, 100);\n }\n else if ((velha[3] + velha[4] + velha[5]) == 3 * last) {\n strike(0, 300, 600, 300);\n }\n else if ((velha[6] + velha[7] + velha[8]) == 3 * last) {\n strike(0, 500, 600, 500);\n }\n else if ((velha[0] + velha[3] + velha[6]) == 3 * last) {\n strike(100, 0, 100, 600);\n }\n else if ((velha[1] + velha[4] + velha[7]) == 3 * last) {\n strike(300, 0, 300, 600);\n }\n else if ((velha[2] + velha[5] + velha[8]) == 3 * last) {\n strike(500, 0, 500, 600);\n }\n else if ((velha[2] + velha[4] + velha[6]) == 3 * last) {\n strike(600, 0, 0, 600);\n }\n else if ((velha[0] + velha[4] + velha[8]) == 3 * last) {\n strike(0, 0, 600, 600);\n }\n if (temVencedor) {\n if (last == 1) {\n $('pt-x').innerHTML = parseInt($('pt-x').textContent) + 1;\n }\n else if (last == 0) {\n $('pt-bl').innerHTML = parseInt($('pt-bl').textContent) + 1;\n }\n }\n }\n}", "title": "" }, { "docid": "7812fea82d6e6fa8ff61e1e03b5a197d", "score": "0.50885016", "text": "function verificarColision(){ \n mano.actualizarPosicionesYescala(objeto.getWorldPosition(),objeto.getWorldScale()); \n for(var i=0;i<objetos_mesh.length;i++){\n if(objetos_mesh[i]==null)\n continue;\n if(objetos_mesh[i].colisiona(objeto)){//if(mano.colisiona(objetos[i].get())){\n console.log(\"Colisiona con \"+objetos[i].getNombre()+\" \"+i); \n logicaMemorama(i);\n } \n }\n }", "title": "" }, { "docid": "0339f0a30ff86aae64cb05f77e496d0f", "score": "0.50868344", "text": "posOriginal() {\n //dependiendo si es la roja o la azul la devuelve a su montoncito correcto.\n if (this.color == \"rojo\") {\n let posX = 200;\n let posY = 310;\n this.setPosition(posX, posY);\n } else {\n let valor = (tablero.getColumna() - 1) * 100 + 400;\n let posX = valor + 40;\n let posY = 310;\n this.setPosition(posX, posY);\n }\n }", "title": "" }, { "docid": "32424d6b945c03c532464928cc909c8a", "score": "0.50848013", "text": "function casillaValidaPosible(colorFichas, posicionAnterior, posicionNueva){\n \n // //salida de control\n // console.log('verifica, color fichas: ' + colorFichas);\n // console.log('verifica, posicion anterior: ' + posicionAnterior);\n // console.log('verifica, posicion nueva: ' + posicionNueva);\n\n //creo variables de comparacion de posicion fila y columna\n var filaAnterior = parseInt(posicionAnterior.substring(0,1));\n var columnaAnterior = parseInt(posicionAnterior.substring(2));\n var filaNueva = parseInt(posicionNueva.substring(0,1));\n var columnaNueva = parseInt(posicionNueva.substring(2));\n\n // //salida de control\n // console.log('verifica, fila anterior: ' + filaAnterior);\n // console.log('verifica, columna anterior: ' + columnaAnterior);\n // console.log('verifica, fila nueva: ' + filaNueva);\n // console.log('verifica, columna nueva: ' + columnaNueva);\n \n var casillaValidar = document.getElementById(posicionNueva)\n\n //verifico que la casilla a validar este vacia\n if ( casillaValidar.classList.contains('ficha-blanca') || casillaValidar.classList.contains('ficha-negra') ) {\n \n return false; //si hay una ficha en la casilla no se toma en cuenta, retorna FALSE\n\n }\n else {\n \n //verifico segun el color de ficha que toca mover\n if (colorFichas == 'blancas'){ \n\n //verifico si se esta moviendo en diagonal 1 o 2 lugares\n //para que las blancas puedan avanzar, deben estar en una fila anterior a la 8 en ascendente\n //y la fila nueva ser la proxima a la anterior posicion\n if(filaAnterior < 8 \n && filaNueva == (filaAnterior+1) \n && Math.abs(columnaAnterior-columnaNueva) == 1){\n //para que las blancas puedan avanzar, debe haber una casilla libre en diagonal \n //en la proxima fila que la compararé con la posicion \"target\"\n return true;\n }\n else if(filaAnterior < 7 \n && filaNueva == (filaAnterior+2) \n && Math.abs(columnaAnterior-columnaNueva) == 2){\n //para que las blancas puedan avanzar 2 casillas en diagonal, debe haber una casilla \n //en la proxima segunda fila que la compararé con la posicion \"target\"\n //y debe haber una ficha negra en la casilla anterior para \"comer\"\n \n var posicionPosibleFicha = (filaAnterior+1) + \"-\" + (columnaAnterior + ((columnaNueva-columnaAnterior)/2));\n console.log(posicionPosibleFicha);\n\n //identifico la casilla intermedia\n var casillaVerificar = document.getElementById(posicionPosibleFicha);\n\n //si en la casilla intermedia hay una ficha negra, hay posibilidad de movimiento de la ficha blanca\n if (casillaVerificar.classList.contains('ficha-negra')){ \n return true;\n }\n }\n } \n else if (colorFichas == 'negras') {\n\n //para que las negras puedan avanzar, deben estar en una fila anterior a la 0 en descendente\n //y la fila nueva ser la proxima a la anterior posicion\n if(filaAnterior > 0 \n && filaNueva == (filaAnterior-1) \n && Math.abs(columnaAnterior-columnaNueva) == 1){\n //para que las negras puedan avanzar, debe haber una casilla libre en diagonal \n //en la proxima fila que la compararé con la posicion \"target\"\n\n //la casilla, si esta en la columna 1 o la 8, solo tendra posible una casilla de avance\n if (columnaAnterior > 1){\n console.log('se mueve desde la columna mayor a 1, hay celda libre avance columna anterior')\n }\n else if (columnaAnterior < 8){\n console.log('se mueve desde la columna menor a 8, hay celda libre avance columna siguiente')\n }\n return true;\n }\n else if(filaAnterior > 1 \n && filaNueva == (filaAnterior-2) \n && Math.abs(columnaAnterior-columnaNueva) == 2){\n //para que las negras puedan avanzar 2 casillas en diagonal, debe haber una casilla \n //en la proxima segunda fila que la compararé con la posicion \"target\"\n //y debe haber una ficha blanca en la casilla anterior para \"comer\"\n \n var posicionPosibleFicha = (filaAnterior-1) + \"-\" + (columnaAnterior + ((columnaNueva-columnaAnterior)/2));\n console.log(posicionPosibleFicha);\n\n //identifico la casilla intermedia\n var casillaVerificar = document.getElementById(posicionPosibleFicha);\n\n //si en la casilla intermedia hay una ficha blanca, hay posibilidad de movimiento de la ficha negra\n if (casillaVerificar.classList.contains('ficha-blanca')){ \n return true;\n }\n }\n } \n\n } \n\n}", "title": "" }, { "docid": "52ad46c5eca15cf14697a3ce7fbfc11d", "score": "0.50839335", "text": "function SeguirVivo() {\n //Calculas si en la primeras tres filas (donde aparecen las piezas)\n //hay alguna que tenga mas de dos clases (que haya fichas sobreescritas)\n for (var i = 0; i < 4; i++) {\n for (var n = 0; n < COLUMNAS; n++) {\n if (Tablero.children[i].children[n].classList.length>2) {\n Vivo=false;\n }\n }\n }\n //De ser asi terminara el juego\n if (!Vivo) {\n Musica_Fondo_1.pause()\n if (Modificarcookies) {\n cookieScore(Puntuacion)\n Modificarcookies=false;\n console.log(\"cookieScore\");\n }\n let VolverPlay = document.createElement(\"button\")\n VolverPlay.innerText=\"Volver a jugar\"\n VolverPlay.addEventListener(\"click\", ()=>{\n //Se reinician a los valores predeterminados\n Velocidad = 1100;\n Puntuacion = 0;\n FilasDestruidas = 0;\n Vivo=true;\n Tablero.innerHTML= \"\"//Limpia el tablero\n Proxima_Figura.innerHTML= \"\"//Limpia la proxima pieza\n CrearTerreno()\n CrearProxFig()\n ModifcarPuntaje(Puntuacion);//limpia la puntuacion\n document.getElementById(\"FilasD\").innerHTML = FilasDestruidas;//Limpia las filas destruidas\n document.getElementById(\"Datos_Juego\").style.display = \"none\";//Desaperece la pestaña de game over\n Tetris(Velocidad);//Vuelve a comenzar el juego\n DibujarTet(FilAct, CeldAct, RotarFig)\n DibujarNext()\n Modificarcookies=true;\n if (MusicaON) {\n Musica_Fondo_1.play()\n }\n })\n //Muestra el mensaje de que perdiste\n let Mensaje = document.createElement(\"h1\")\n Mensaje.innerText=\"Has perdido :(\"\n let PuntuacionFinal = document.createElement(\"h3\")\n ModifcarPuntaje(Puntuacion);\n PuntuacionFinal.innerText=\"Tu puntuacion es de \"+Puntuacion;\n document.getElementById(\"Datos_Juego-cont\").innerHTML= \"\"\n document.getElementById(\"Datos_Juego-cont\").appendChild(Mensaje)\n document.getElementById(\"Datos_Juego-cont\").appendChild(PuntuacionFinal)\n document.getElementById(\"Datos_Juego-cont\").appendChild(VolverPlay)\n document.getElementById(\"Datos_Juego-cont\").appendChild( document.createElement(\"br\"))\n document.getElementById(\"Datos_Juego\").style.display = \"inherit\";\n setTimeout(()=>{\n Game_Over.play()\n }, 200)\n }\n return Vivo;\n }", "title": "" }, { "docid": "d9b5f21f472fa51b6d43f1cf362a8e9f", "score": "0.5082685", "text": "function luoRuutu(x, y) {\n var ruutu = document.createElement(\"td\");\n ruutu.addEventListener(\"click\", soluaKlikattu);\n\n ruutu.sijainti = new Vektori(x, y);\n \n /**\n * Antaa rivin, jolla ruutu sijaitsee.\n * @return Rivi, jolla ruutu sijaitsee.\n */\n ruutu.getRivi = function() {\n return this.sijainti.y;\n };\n \n /**\n * Antaa sarakkeen, jolla ruutu sijaitsee.\n * @return Sarake, jolla ruutu sijaitsee.\n */\n ruutu.getSarake = function() {\n return this.sijainti.x;\n };\n \n /**\n * Antaa ruudun sijaintivektorin.\n * @return Tämän ruudun sijaintivektori.\n */\n ruutu.getSijainti = function() {\n return this.sijainti;\n };\n \n /**\n * Palauttaa tiedon, onko tämä ruutu tyhjä.\n * @return true, jos ruutu on vapaa.\n */\n ruutu.isVapaa = function() {\n return !this.firstChild;\n };\n \n /**\n * Antaa vektorin, joka kertoo suunnan ja matkan tästä ruudusta annettuun ruutuun.\n * @param toinenRuutu Kohderuutu, johon vektori osoittaa tästä ruudusta.\n * @return Vektori, joka sisältää x- ja y-pituuden.\n */\n ruutu.laskeVektori = function(toinenRuutu) {\n var vektori = toinenRuutu.getSijainti().vahennaVektori(this.getSijainti());\n \n return vektori;\n };\n\n /**\n * Laskee vektorin avulla sijainnin, jossa oleva ruutu palautetaan.\n * @param vektori Vektori, joka lisätään tämän ruudun sijaintivektoriin.\n * @return Lasketussa sijainnissa sijaitseva ruutu tai null, jos ruutua ei ole.\n */\n ruutu.lisaaVektori = function(vektori) {\n var sijainti = this.getSijainti().lisaaVektori(vektori);\n var lauta = document.getElementsByTagName(\"body\")[0].getElementsByTagName(\"table\")[0];\n \n return lauta.annaRuutu(sijainti);\n };\n \n /**\n * Poistaa nappulan, jos sellainen löytyy tästä ruudusta.\n */\n ruutu.poistaNappula = function() {\n this.removeChild(this.firstChild);\n };\n \n return ruutu;\n}", "title": "" }, { "docid": "f7a4ea84ce504d5c581e58cbdff0eccb", "score": "0.5082402", "text": "edges() {\n if (this.pos.x < 0 || this.pos.x > width) {\n this.fastVel.x *= -1;\n this.slowVel.x *= -1;\n }\n if (this.pos.y < 0 || this.pos.y > height) {\n this.fastVel.y *= -1;\n this.slowVel.y *= -1;\n }\n }", "title": "" }, { "docid": "578232fb4e1978ed877286fe34693d31", "score": "0.5080655", "text": "function vertF(u, v, f) {\n if (u.length !== v.length) {\n console.log('err: vert lengths differ');\n }\n\n let ans = [];\n\n for (let i = 0; i < Math.min(u.length, v.length); i++) {\n ans.push(f(u[i], v[i]));\n }\n\n return ans;\n}", "title": "" }, { "docid": "87cd81cc5cbd7a2a65c76e9295a4c656", "score": "0.50787383", "text": "function gestionClicCase() {\n\n // On récupere l'index de la case cliquer \n\n const indexCase = parseInt(this.dataset.index)\n\n\n // On check si la case et déjà joué ou si le jeu et terminée \n\n if (etatJeu[indexCase] != \"\" || !jeuActif) {\n return\n }\n // On écrit le symbole du joueur dans le tableau \n\n etatJeu[indexCase] = joueurActif\n this.innerHTML = joueurActif\n\n // on verifie qui gagne \n verifWin()\n}", "title": "" }, { "docid": "6ffa44de85591277f9c574cfdd55d402", "score": "0.50704104", "text": "function zerandoColuna(linha, coluna) {\n var vetor;\n var vetorAtual;\n var vetorAux;\n vetorAtual = getLinha(linha);\n vetorAux = vetorAtual;\n\n for (var i = 1; i <= numLinhas; i++) {\n\n vetor = getLinha(i);\n pivo = getCelula(i, coluna);\n vetorAtual = getLinha(linha);\n\n // verificação para não calcular a linha atual do pivo.\n if ((linha != i) && (pivo != 0)) {\n\n for (var j = 2; j < vetor.length; j++) {\n vetorAtual[j] = parseFloat(vetorAtual[j] * -pivo);\n }\n\n atualizarLinha(vetorAtual, linha);\n salvarEstado();\n\n if ((vetorAtual[coluna] + pivo) != 0) {\n for (var k = 2; k < vetor.length; k++) {\n vetor[k] = parseFloat(vetor[k]) * vetorAtual[coluna];\n }\n atualizarLinha(vetor, i);\n salvarEstado();\n }\n\n for (var l = 2; l < vetor.length; l++) {\n vetor[l] = vetorAtual[l] + vetor[l];\n }\n\n atualizarLinha(vetor, i);\n atualizarLinha(vetorAux, linha);\n salvarEstado();\n }\n }\n }", "title": "" }, { "docid": "bda6a3d089ec47a426bbe51247159b41", "score": "0.50584173", "text": "function is_anweisung_tipo(instruccion, rows, column){\n /* \n 1 inmedi\n 3 direc\n 5 index,X\n 7 index,Y\n 9 ext\n 11 inhe\n 13 relativo */\n var bandera=false\n for(var row of rows){\n if(instruccion.toLowerCase()==row[0] && row[column]!=\"--\" ){\n bandera=true\n }\n }\n\n \n return bandera\n}", "title": "" }, { "docid": "6aa758e1da87fadbbe6612bd004cf837", "score": "0.5058275", "text": "function ejercicio7(planeta){\n\n}", "title": "" } ]
f79f4ff25111e5866ba9ba02c62f9345
properties: menuItems: [MenuItem] menu items to show orderStore: OrderStore store for the orders renderHeader: ?() => Component renderFooter: ?() => Component onRefresh: async () => void visible: (i) => Bool whether this menu item is visible
[ { "docid": "87989ee5895ff698649c1618a02f9f08", "score": "0.0", "text": "constructor(props, getSimpleListView : () => SimpleListView) {\n super()\n this.props = props\n /* TODO: This is pretty hacky... do this better */\n this.getSimpleListView = getSimpleListView\n this.renderHeader = props.renderHeader\n this.renderFooter = props.renderFooter\n this.refresh = this.props.onRefresh && (\n () => this.runRefresh(this.props.onRefresh)\n )\n }", "title": "" } ]
[ { "docid": "df7d986d9900ea113f4c8a8a3086942a", "score": "0.71231437", "text": "function renderMenuItems() {\n logger.info('rendering menu items');\n var menuData;\n if (!currentCustomer.isLoggedIn()) {\n menuData = filterMenuItems(isCustomerLogoutMenuBlackList);\n }\n\n if (isKioskMode()) {\n menuData = filterMenuItems(isKioskModeMenuBlackList, menuData);\n\n if (isKioskManagerLoggedIn()) {\n $.admin_dashboard_wrapper.show();\n $.admin_dashboard_wrapper.setHeight(62);\n $.admin_dashboard_wrapper.setEnable(true);\n } else {\n $.admin_dashboard_wrapper.hide();\n $.admin_dashboard_wrapper.setHeight(0);\n $.admin_dashboard_wrapper.setEnable(false);\n }\n }\n\n if (!isKioskMode() && currentCustomer.isLoggedIn()) {\n menuData = filterMenuItems(isCustomerLoginMenuBlackList);\n }\n\n if (!Alloy.CFG.enable_wish_list) {\n menuData = filterMenuItems(isWishListDisabledBlackList, menuData);\n }\n\n if (storePasswordHelpers.isStorePasswordExpiring()) {\n var expirationDays = Alloy.Models.storeUser.getExpirationDays();\n menuData.push({\n id : 'change_store_password',\n accessibilityValue : 'change_store_password',\n submenuLabel : expirationDays == 1 ? String.format(_L('Expires in %d Day'), expirationDays) : String.format(_L('Expires in %d Days'), expirationDays),\n label : _L('Change Store Password Menu'),\n image : Alloy.Styles.warningIcon\n });\n }\n\n $.side_bar.setData(generateMenuRows(menuData));\n}", "title": "" }, { "docid": "14d2ec2f4a8dd9e3ca9a17c9a92bd2f0", "score": "0.6957751", "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": "6085c493c4b753e1f2bbaf91ee4cdbe9", "score": "0.6840324", "text": "showUpdateMenuItem (state) {\n const checkForUpdateItem = _.find(this.flattenMenuItems(this.menu), ({ label }) => label === 'Check for Update')\n const checkingForUpdateItem = _.find(this.flattenMenuItems(this.menu), ({ label }) => label === 'Checking for Update')\n const downloadingUpdateItem = _.find(this.flattenMenuItems(this.menu), ({ label }) => label === 'Downloading Update')\n const installUpdateItem = _.find(this.flattenMenuItems(this.menu), ({ label }) => label === 'Restart and Install Update')\n\n if ((checkForUpdateItem == null) || (checkingForUpdateItem == null) || (downloadingUpdateItem == null) || (installUpdateItem == null)) { return }\n\n checkForUpdateItem.visible = false\n checkingForUpdateItem.visible = false\n downloadingUpdateItem.visible = false\n installUpdateItem.visible = false\n\n switch (state) {\n case 'idle': case 'error': case 'no-update-available':\n return checkForUpdateItem.visible = true\n case 'checking':\n return checkingForUpdateItem.visible = true\n case 'downloading':\n return downloadingUpdateItem.visible = true\n case 'update-available':\n return installUpdateItem.visible = true\n }\n }", "title": "" }, { "docid": "1fa7c4e971185ede67c4219c2cb26f25", "score": "0.67277074", "text": "renderMenu(item, renderedItems) {\n let visible = (!item.permission || (this.props.session && (item.permission in this.props.session.permissions)));\n if (!visible)\n return;\n let renderedChildren = [];\n if (item.children) {\n item.children.forEach(child => {\n this.renderMenu(child, renderedChildren);\n });\n }\n renderedItems.push((<Menu key={item.label} label={item.label} link={item.link || ''}>{renderedChildren}</Menu>));\n }", "title": "" }, { "docid": "9d172842529d20f9f8af04185998e743", "score": "0.6446236", "text": "render(){\n let styleOption=menuHide;\n \n if (this.props.menuVisibility){\n styleOption=menuShow;\n }\n \n return(\n <div style={styleOption}\n onClick={this.props.handleClick}>\n <Menu>\n <MenuItem changePage={this.props.handleNavChange} name=\"home\">Home</MenuItem>\n <MenuItem changePage={this.props.handleNavChange} name=\"landscape\">Landscape Galleries</MenuItem>\n <MenuItem changePage={this.props.handleNavChange} name=\"event\">Event Galleries</MenuItem>\n <MenuItem changePage={this.props.handleNavChange} name=\"studio\">Studio Galleries</MenuItem>\n <MenuItem changePage={this.props.handleNavChange} name=\"all\">All Galleries</MenuItem>\n <MenuItem changePage={this.props.handleNavChange} name=\"about\">About</MenuItem>\n </Menu>\n </div>\n );\n }", "title": "" }, { "docid": "7624e36a072f0d07c6ab1cbeb6f99235", "score": "0.63798386", "text": "renderSetupMenu() {\r\n let { strings } = this.props;\r\n if (this.state.dataFetch) {\r\n if (this.state.menuList.length > 0) {\r\n let menuList = values(groupBy(this.state.menuList, 'GroupSortOrder'));\r\n this.urlPath = getCurrentURL();\r\n return (<Scrollbars autoHide autoHeight\r\n autoHeightMax={(typeof document === 'undefined') ? 500 : (document.body.clientHeight - 200)}>\r\n {map(menuList, (group, index) => {\r\n if (group.length > 0) {\r\n return (<div key={index} className=\"set-left-confi\">\r\n <h2><img src={this.siteURL + \"/static/images/modules/\" + group[0].GroupIcon} alt=\"icon\" />\r\n {group[0].GroupName}\r\n </h2>\r\n {map(group, (menu, indexMenu) => {\r\n return (<span key={indexMenu}><Link to={menu.RedirectURL} className={this.getMenuSelection(menu.RedirectURL)}>\r\n {menu.Name}\r\n </Link></span>);\r\n })}\r\n </div>);\r\n }\r\n })}\r\n </Scrollbars>);\r\n }\r\n else {\r\n return (<div className=\"set-left-confi\">{strings.NO_MENU_FOUND}</div>);\r\n }\r\n }\r\n else {\r\n return (<div className=\"set-left-confi\">Loading...</div>);\r\n }\r\n }", "title": "" }, { "docid": "da7ac47f349180fce97faacaa5f036ac", "score": "0.6232275", "text": "function manageMenu() {\n templateHandler('headerMenu.html', '#menu', {username: sessionHandler.getUsername()})\n .then(function () {\n let homeTag = $('#linkHome'),\n loginTag = $('#linkLogin'),\n registerTag = $('#linkRegister'),\n listAdsTag = $('#linkListAds'),\n createAdTag = $('#linkCreateAd'),\n logoutTag = $('#linkLogout');\n\n homeTag.on('click', showViewOnClick);\n loginTag.on('click', showViewOnClick);\n registerTag.on('click', showViewOnClick);\n listAdsTag.on('click', handleDisplayingAllAd);\n createAdTag.on('click', showViewOnClick);\n logoutTag.on('click', handleLogout);\n }).catch(handleError);\n\n //\n // if (sessionHandler.getUsername() == undefined) {\n // homeTag.show();\n // loginTag.show();\n // registerTag.show();\n // createAdTag.hide();\n // listAdsTag.hide();\n // logoutTag.hide();\n // } else {\n // homeTag.show();\n // loginTag.hide();\n // registerTag.hide();\n // listAdsTag.show();\n // createAdTag.show();\n // logoutTag.show();\n // }\n }", "title": "" }, { "docid": "d30c5c1e4120fbdbe0a3f8101f8d7d95", "score": "0.6169483", "text": "function renderMenu() {\n var options = {\n placeholder: 'app-menu-placeholder',\n connectWith: '.app-menu ul',\n update: function (event, ui) {\n var reorderedApps = $(\"#\" + selector + \" ul\"). sortable('toArray', {attribute: \"data-id\"});\n\n menu.updateOrder(reorderedApps);\n menu.save(saveOrder);\n },\n sort: twoColumnRowFix,\n tolerance: \"pointer\",\n cursorAt: { left: 55, top: 30 }\n };\n\n renderAppManager(selector);\n\n $('.app-menu ul').sortable(options).disableSelection();\n }", "title": "" }, { "docid": "7489eeea44102d4c4c780980b9e07ba1", "score": "0.614714", "text": "function renderMenu() {\n popupBody.classList.add('hide-scroll');\n let menuItems = null;\n if (currentMenu.length !== 0) {\n menuItems = getMenu(currentMenu[currentMenu.length - 1], menuMap);\n } else {\n menuItems = menuMap;\n }\n\n popupBody.innerHTML = getTemplate(menuItems);\n setTimeout(() => {\n popupBody.classList.remove('hide-scroll');\n });\n }", "title": "" }, { "docid": "7dc118a46c26ab955f1f450f3546a757", "score": "0.6124916", "text": "render()\n {\n return(\n this.props.menu ?\n <View>\n <Header style={{backgroundColor:'#6FA7E4',alignItems:'center',height:hp('10%')}}>\n <Icon name=\"md-menu\" style={{left:wp('-31%'),color:'white'}} onPress={()=>this.props.navigation.toggleDrawer()}/>\n <Text style={{color:'white',fontSize:hp('4.2%'),fontWeight:'bold',left:wp('-2.9%')}}>Shop</Text>\n </Header>\n {this.props.children}\n </View>\n :\n <View>\n <Header style={{backgroundColor:'#6FA7E4',alignItems:'center',justifyContent:'center',height:hp('10%')}}>\n <Text style={{color:'white',fontSize:hp('4.2%'),fontWeight:'bold'}}>Shop</Text>\n </Header>\n {this.props.children}\n </View>\n )\n }", "title": "" }, { "docid": "a901ff92d054e4b52bb88d89aec95aa7", "score": "0.61205715", "text": "function displayMenu(date) {\n visibleDate = date;\n\n console.log(`Retrieving data for ${date}`);\n\n if(!cachedMenuData.has(date)) {\n console.log(`sending web request for ${date} data`)\n\n getPrimaryMenuThroughAPI(date)\n .then(data => {\n data['primary'] = readOption(\"special_only\");\n cachedMenuData.set(date, data);\n refreshDisplay();\n });\n\n // Show loading prompt and hide any errors that may be visible\n errorLabelElement.style.display = 'none';\n loadingLabelElement.style.display = 'block';\n primaryMenuElement.innerHTML = \"\";\n } else {\n refreshDisplay();\n }\n}", "title": "" }, { "docid": "353d4c023fd685c7ba40535722a0271a", "score": "0.6116146", "text": "renderMenuItem(item) {\n return (\n <MenuItem item={item} navigator={this.props.navigator} />\n )\n }", "title": "" }, { "docid": "90f2ca4eb75ba5530c94d742cc46b8ac", "score": "0.6101022", "text": "function updateMenu() {\n\t\t$timeout(function(){\n\t\t\t$scope.menu = {};\n\t\t\tfor (var i in menuButtons) {\n\t\t\t\t$scope.menu[menuButtons[i]] = {\n\t\t\t\t\ttext : Language.strings.menu[menuButtons[i]],\n\t\t\t\t\tvisible : \n\t\t\t\t\t\t//Don't show navigation link for current page\n\t\t\t\t\t\t!(new RegExp(\"/\" + menuButtons[i].toLowerCase() + \"($|/)\").test($location.path()))&&(\n\t\t\t\t\t\t\tUser.logged?\n\t\t\t\t\t\t\t\t//If is logged don't show login link\n\t\t\t\t\t\t\t\t(menuButtons[i] !== \"Login\"):\n\t\t\t\t\t\t\t\t//If is not logged don't show admin link\n\t\t\t\t\t\t\t\t(menuButtons[i] !== \"Admin\"))\n\t\t\t\t\t\t//Home have 2 names\n\t\t\t\t\t\t&&((menuButtons[i].toLowerCase() != 'home')||!(new RegExp(/search/).test($location.path())))\n\t\t\t\t};\n\t\t\t}\n\t\t\t$scope.$digest();\n\t\t});\n\t}", "title": "" }, { "docid": "460310d9c44e5e12d2638d316317dfcf", "score": "0.60769135", "text": "showViewMenu(anchorElement) {\n const showPanels = !this.props.inventoryVisible;\n this.props.uiShowMenu([\n {\n text: `${showPanels ? 'Show' : 'Hide'} all panels`,\n action: this.togglePanels,\n },\n {\n text: `${this.state.minimized ? 'Show' : 'Hide'} Nested Blocks`,\n action: () => { this.toggleMinimized(); },\n },\n {\n text: `${this.state.showHidden ? 'Hide' : 'Show'} Hidden Blocks`,\n action: this.toggleHiddenBlocks,\n },\n {\n text: `${this.props.visibleExtension === sequenceViewerName ? 'Hide' : 'Show'} Sequence`,\n action: this.toggleSequenceViewer,\n },\n ],\n ConstructViewer.getToolbarAnchorPosition(anchorElement),\n true);\n }", "title": "" }, { "docid": "35578d52b3438a12d0cd2c8a27cdd20a", "score": "0.6071359", "text": "function show_header_footer_menu(){\n var checked = $('#ekit-admin-switch__module__list____header-footer').prop('checked');\n var menu_html = $('#elementskit-template-admin-menu').html();\n var menu_parent = $('#toplevel_page_elementskit .wp-submenu');\n var menu_item = menu_parent.find('a[href=\"edit.php?post_type=elementskit_template\"]');\n \n if(checked == true){\n if(menu_item.length > 0 || menu_parent.attr('item-added') == 'y'){\n menu_item.parent().show();\n }else{\n menu_parent.find('li.wp-first-item').after(menu_html);\n menu_parent.attr('item-added', 'y');\n }\n }else{\n menu_item.parent().hide();\n }\n }", "title": "" }, { "docid": "c0ee8ad5dbe98493d7f7930b167979e7", "score": "0.60679567", "text": "function checkMenu(){\n if (props.menu !== 'projects' || props.navState === false){\n setIsListDisplayed(false)\n \n }else if(props.menu === 'projects'){\n setIsListDisplayed(true)\n \n }\n }", "title": "" }, { "docid": "4501f42bcccba56ff479a791f3fe7ab7", "score": "0.60633254", "text": "renderMenu() {\n this.menu = this.buildMenu();\n this.render(this.menu);\n }", "title": "" }, { "docid": "1f6b80961ccea6f3da197157e744c9cb", "score": "0.60430634", "text": "function includeHeaderMenu() {\n app.getView().render('components/header/headermenu');\n}", "title": "" }, { "docid": "83ab7cc313b9143109c530d2f640dadb", "score": "0.60183823", "text": "renderMenuItems() {\n return html `<slot\n @close-menu=${this.onCloseMenu}\n @deactivate-items=${this.onDeactivateItems}\n @deactivate-typeahead=${this.handleDeactivateTypeahead}\n @activate-typeahead=${this.handleActivateTypeahead}\n @stay-open-on-focusout=${this.handleStayOpenOnFocusout}\n @close-on-focusout=${this.handleCloseOnFocusout}></slot>`;\n }", "title": "" }, { "docid": "74675e35c12984799bc5fa60b4ec674b", "score": "0.6001493", "text": "renderLinks() {\n const { activeItem } = this.state;\n const { authenticated, signOutUser } = this.props;\n // If the user is authenticated, only show the sign out menu item\n if (authenticated) {\n return (\n <div className='nav-links'>\n <Menu.Item \n as={Link} \n to='/create' \n name='Create' \n active={activeItem === 'Create'} \n onClick={this.handleItemClick}>\n Create Poll\n <Icon className='header-icon' name='add' />\n </Menu.Item>\n <Menu.Item \n name='Sign Out' \n onClick={() => signOutUser()}>\n Sign Out\n <Icon className='header-icon' name='sign out' />\n </Menu.Item>\n </div>\n );\n // Otherwise show the login and register menu items\n } else {\n return (\n <div className='nav-links'>\n <Modal trigger={\n <Menu.Item name='Login'>\n Login\n <Icon className='header-icon' name='sign in' />\n </Menu.Item>\n }>\n <Modal.Header>Login</Modal.Header>\n <Modal.Content>\n <Modal.Description>\n <Login />\n </Modal.Description>\n </Modal.Content>\n </Modal>\n <Modal trigger={\n <Menu.Item name='Register'>\n Register\n <Icon className='header-icon' name='add user' />\n </Menu.Item>\n }>\n <Modal.Header>Register</Modal.Header>\n <Modal.Content>\n <Modal.Description>\n <Register />\n </Modal.Description>\n </Modal.Content>\n </Modal>\n </div>\n );\n }\n }", "title": "" }, { "docid": "c34da7d1483682b9042513505eaba28d", "score": "0.5969001", "text": "function ShowSavedMenu(vItem, X, Y){\n\tif(typeof(vItem) == \"number\"){\n\t\tif(CheckObject(window.m_arMenus) && window.m_arMenus[vItem]){\n\t\t\twindow.m_arMenus[vItem].ShowAtPosition(X, Y, true);\n\t\t}\n\t}else{\n\t\tvItem.m_oMenuHeader = oMenuHeader;\n\t\tvItem.ShowAtPosition(X, Y);\n\t}\n}", "title": "" }, { "docid": "0711d26f60f5a30eaf00ad448d4f4093", "score": "0.59617835", "text": "static displayMenu() {\n CliUtils.verticalSpace(1);\n console.dir(MenuHelper.constructMenu(), {colors : true});\n CliUtils.verticalSpace(1);\n }", "title": "" }, { "docid": "e5feb6612bcf7055e527fe8d7ee25eb6", "score": "0.5912834", "text": "function handleMenuItemClicked() {\n console.log('handleMenuItemClicked');\n // bring to appropriate view\n // get the item clicked in the menu\n // send event to restaurantLists with the item to render the appropriate component\n const itemClicked = $(this).attr('data-item');\n if(itemClicked === \"history\" || itemClicked === \"liked\" || itemClicked === \"disliked\") {\n event.preventDefault();\n pubSub.emit('renderRestaurantList', {itemClicked: itemClicked});\n toggleMenu();\n }\n if(itemClicked === \"search\") {\n pubSub.emit('renderRestaurantSearch');\n toggleMenu();\n }\n }", "title": "" }, { "docid": "f16cac03418f72c21fe4d1c5dff2d7b5", "score": "0.59063005", "text": "displayMenu() {\n\t\tdocument.querySelectorAllBEM(\".menu__item\", \"menu\").removeMod(\"hide\");\n\t}", "title": "" }, { "docid": "ffab54793a61202268ef29e5f4073fb9", "score": "0.59022576", "text": "render() {\n const { itemList } = this.state;\n\n return (\n <div className=\"App\">\n <div className=\"title\">Todo List</div>\n\n <Header />\n\n {itemList.map((item, index) =>\n // if (item.display === true) { ... }\n item.display === true &&\n <Item\n key={index}\n item={item}\n handleSelect={() => this.handleSelect(index)}\n />\n )}\n\n <Footer\n itemsRemaining={itemList.filter(item => item.selected === false).length}\n handleFilterAll={this.handleFilterAll}\n handleFilterTodo={this.handleFilterTodo}\n handleFilterCompleted={this.handleFilterCompleted}\n />\n </div>\n );\n }", "title": "" }, { "docid": "c718538aa9152574443f01c1e1c06f36", "score": "0.589036", "text": "function showMenu(storeID,quick){\n console.log('Fetching menu for '+storeID.info+'...');\n order.StoreID=storeID\n rl.prompt();\n\n var store=new pizzapi.Store(\n {\n ID:storeID\n }\n );\n\n store.getMenu(\n function(data){\n if(quick){\n console.log(\n '\\n##########################\\n'.blue,\n 'Quick Menu'.yellow,\n '\\n##########################\\n'.blue\n );\n for(var i in data.result.PreconfiguredProducts){\n var product=data.result.PreconfiguredProducts[i];\n console.log(\n '\\n'.blue+\n (\n (\n product.Name.bold+' : '+\n product.Code+'\\n'\n ).menuTitle+\n product.Description+'\\n'+\n product.Size\n ).menuItem.white\n );\n };\n\n rl.prompt();\n return;\n }\n\n console.log(\n '\\n##########################\\n'.blue,\n 'Full Menu'.yellow,\n '\\n##########################\\n'.blue\n );\n\n var menuPortions=[\n 'Sides',\n 'PreconfiguredProducts',\n 'Products'\n ];\n\n for(var j in menuPortions){\n for(var i in data.result[menuPortions[j]]){\n if(!data.result[menuPortions[j]][i].Name){\n console.log(\n (\n '=========='.cyan+\n i.blue+\n '=========='.cyan\n ).bgYellow\n );\n\n for(var k in data.result[menuPortions[j]][i]){\n var product=data.result[menuPortions[j]][i][k];\n console.log(\n '(+)'+(\n (\n product.Name.bold+' : '+\n product.Code+'\\n'\n ).menuTitle+\n product.Description+'\\n'+\n product.Size\n ).menuItem.white\n );\n }\n continue;\n }\n var product=data.result[menuPortions[j]][i];\n console.log(\n '(+)'+(\n (\n product.Name.bold+' : '+\n product.Code+'\\n'\n ).menuTitle+\n product.Description+'\\n'+\n product.Size\n ).menuItem.white\n );\n };\n }\n }\n );\n}", "title": "" }, { "docid": "f6c96430ca449bce8414264325ddcc3f", "score": "0.588818", "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": "21e693012bd791d46e73264dd1abd472", "score": "0.5882062", "text": "function mproxy_menuShowing(sMenu){\r\n\tvar oObj = null;\r\n\t\r\n\tif(sMenu == \"context\"){\r\n\t\toObj = document.getElementById(\"mproxy-context-menu\");\r\n\t}\r\n\telse if(sMenu == \"toolbar\"){\r\n\t\toObj = document.getElementById(\"proxy-toolbar\");\r\n\t}\r\n\t\r\n\tif(oObj == null)\r\n\t\treturn false;\r\n\t\r\n\treturn !eval(oObj.getAttribute(\"collapsed\"));\r\n}", "title": "" }, { "docid": "bca7605245c5357f8b09047e99dfaebc", "score": "0.58679086", "text": "async function getDashboardMenu() {\n\n const userApiKey = '13d5713b139a6df83565cf5f6dff63e2';\n const menuUrl = `https://ict4510.herokuapp.com/api/menus?api_key=${userApiKey}`;\n const response = await fetch(menuUrl);\n const menuData = await response.json();\n let menuPageHtml = ``;\n menuData.menu.forEach(item => {\n menuPageHtml += `<article class=\"menu-card\">\n <div class=\"hort-line\"></div>\n <div class=\"row\">\n <h3 class=\"menu-card-item\">${item.item}</h3>\n <p class=\"menu-card-price\">$${item.price}</p>\n </div>\n <p class=\"menu-description\">${item.description}</p>\n </article>`;\n })\n hideLoader();\n menuCardContainer.innerHTML = menuPageHtml;\n }", "title": "" }, { "docid": "d975be5a610d6cf62e3da9de6d63538f", "score": "0.5855894", "text": "showMoreMenu(anchorElement) {\n this.props.uiShowMenu([\n {\n text: `${this.state.minimized ? 'Show' : 'Hide'} Nested Blocks`,\n //action: () => { this.sg.ui.toggleCollapsedState(); },\n action: () => { this.toggleMinimized(); },\n },\n {\n text: `${this.state.showHidden ? 'Hide' : 'Show'} Hidden Blocks`,\n action: this.toggleHiddenBlocks,\n },\n {\n text: 'Color',\n disabled: this.isSampleProject() || this.props.construct.isFixed(),\n menuItems: this.getPaletteMenuItems(),\n },\n {\n text: 'Order DNA',\n disabled: !this.allowOrder(),\n action: this.onOrderDNA,\n },\n {\n text: 'Download Construct',\n disabled: false,\n action: () => {\n downloadConstruct(this.props.currentProjectId, this.props.constructId, this.props.focus.options);\n },\n },\n {\n text: 'Delete Construct',\n disabled: this.isSampleProject(),\n action: () => {\n this.props.projectRemoveConstruct(this.props.projectId, this.props.constructId);\n },\n },\n ],\n ConstructViewer.getToolbarAnchorPosition(anchorElement),\n true);\n }", "title": "" }, { "docid": "e4ec6c2dd2d33ef8ba989bdffb71686b", "score": "0.58491147", "text": "function menuShow() {\n\t\t$('#list-menu-catalog').show();\n\t}", "title": "" }, { "docid": "1883a98c77042a98ef7f9f87770763f0", "score": "0.58483976", "text": "getViewMenuItems() {\n const showPanels = !this.props.inventoryVisible;\n const firstViewer = ConstructViewer.getAllViewers()[0];\n return [\n {\n text: `${showPanels ? 'Show' : 'Hide'} all panels`,\n action: this.togglePanels,\n },\n {\n text: `${firstViewer && firstViewer.isMinimized() ? 'Show' : 'Hide'} Nested Blocks`,\n disabled: !firstViewer,\n action: () => {\n ConstructViewer.getAllViewers().forEach((viewer) => {\n viewer.setMinimized(!firstViewer.isMinimized());\n });\n },\n },\n ];\n }", "title": "" }, { "docid": "804e035aafa6f22c52de5317670040df", "score": "0.5840157", "text": "showNavigationMenu() {\n if (this.props.isSidebarShown) {\n return;\n }\n\n this.toggleNavigationMenu();\n }", "title": "" }, { "docid": "4181329a2fa5bece52719905a3b7abc7", "score": "0.58394575", "text": "function renderMenu(ctx){\n g_menu.render(ctx)\n}", "title": "" }, { "docid": "e0527192d4910b314207231d5a3f3f20", "score": "0.58262724", "text": "render() {\n const { activeItem } = this.state;\n return (\n <Menu tabular compact size = \"tiny\" >\n\t\t\t\t\t\t<Menu.Item name='15m' active={activeItem === '15m'} onClick={this.handleItemClick} />\n\t\t\t\t\t\t<Menu.Item name='1h' active={activeItem === '1h'} onClick={this.handleItemClick} />\n\t\t\t\t\t\t<Menu.Item name='4h' active={activeItem === '4h'} onClick={this.handleItemClick} />\n\t\t </Menu>\n );\n }", "title": "" }, { "docid": "fd9c686f14d657304b514a87ee5bf240", "score": "0.5811002", "text": "function managerMenu() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Load the possible manager menu options, pass in the products data\n managerOptions(res);\n });\n }", "title": "" }, { "docid": "59df34e22b996e83a2043aa30647027a", "score": "0.5802057", "text": "async showMenu(displayHomeMenu) {\n const productList = await this.store.getAllProducts();\n\n //Creates a table object for displaying in console\n let table = new Table();\n\n //Loops thru the result and adds each product to the table\n productList.forEach(data => {\n table.cell(\"ID\", data.item_id);\n table.cell(\"Product Name\", data.product_name);\n table.cell(\"Price\", data.price, Table.number(2));\n table.newRow();\n });\n\n //Display the product list in console in a table format\n console.log(\"\\n\" + table.toString());\n\n const questions = [\n {\n type: \"input\",\n name: \"productID\",\n message: \"What is the ID of the product you'd like to buy?\"\n },\n {\n type: \"input\",\n name: \"quantity\",\n message: \"How many units would you like to buy?\"\n }\n ];\n\n const answers = await inquirer.prompt(questions);\n\n //Searches the product array for the user's choice of product\n const selectedProduct = productList.find(function(product) {\n return product.item_id === parseInt(answers.productID);\n });\n\n if (selectedProduct) {\n this.buyProduct(selectedProduct, answers.quantity, displayHomeMenu);\n } else {\n console.log(\"\\nPlease provide a valid product ID.\\n\\n\");\n this.showMenu();\n }\n }", "title": "" }, { "docid": "3f4b37fb51f804c4e2daddcc91144420", "score": "0.57839805", "text": "async function onMenuOpen() {\n setLoadingState(true);\n const response = await axios.get(\"http://localhost:8000/magazine/list\");\n const magazines = response.data;\n const options = magazines.map(magazine => {\n return {\n value: magazine._id,\n label: magazine.name + \"; \" + magazine.issue,\n magazineName: magazine.name,\n magazineIssue: magazine.issue\n };\n });\n setLoadingState(false);\n setOptions(options);\n }", "title": "" }, { "docid": "b370782262714a5459dc0b8e53f1e15b", "score": "0.5771259", "text": "function showMenuItems(bLayoutOnly=false) {\n\n\t// you need to change both of these numbers if you change one\n\tvar andFrac = 0.71; \n\tvar andOffsetMult = 2.2;\n\n\t// If we're keeping the menu, don't change it\n\tif (!bLayoutOnly && bKeepMenu && $( \"#\"+menuElems[0][0] ).is(\":visible\")) return;\n\n\tvar menuItems = [];\n\tvar menuWidth = 0;\n\t$.each(menuElems, function(index, element) {\n\n\t\tvar item = $( menu[ element[0] ][\"txt\"] );\n\t\tif (element[0] == \"logo\") {\n\n\t\t\t// call this when the first image is shown\n\t\t\titem.css(\"font-size\", w.titleSizePx);\n\t\t\titem.css(\"letter-spacing\", (w.titleLetterSpacing*w.titleSizePx) + \"px\"); // .1993\n\t\t\titem.css(\"line-height\", w.titleLineHeight);\n\t\t\titem.css(\"z-index\", w.bTitleAbove * 2 -1);\n\n\t\t\tsetTxtPosDim(item, \n\t\t\t\tw.windowL + w.windowW/2 - $( logo ).width()/2,\n\t\t\t\tw.titleSizePx*w.titleTopOffset );\n\t\t\t\n\t\t\tif (!bLayoutOnly) item.fadeIn({queue: false, duration: w.fadeMs});\n\n\t\t} else { // all other menu items\n\n\t\t\t// only set the sizes for now\n\t\t\titem.css(\"font-size\", w.titleSizePx * w.menuSizeFrac * (element[0]==\"and\" ? andFrac : 1));\n\t\t\t// item.css(\"letter-spacing\", );\n\t\t\titem.css(\"line-height\", w.titleLineHeight);\n\t\t\titem.css(\"z-index\", w.bTitleAbove * 2 -1);\n\n\t\t\tmenuItems.push( item );\n\t\t\tmenuWidth += item.width();\n\n\t\t\tif (item.attr(\"id\") != \"and\") {\n\t\t\t\t// on hovering over these items, they become darker\n\t\t\t\tvar fadeFrac = 0.4;\n\t\t\t\tsetupAnimateOnHover( \t// will this be duplicated? [BUG] ?\n\t\t\t\t\t[ menu[element[0]][\"txt\"] ], \n\t\t\t\t\tmenu[element[0]], \n\t\t\t\t\t[ menu[element[0]][\"txt\"] ], \n\t\t\t\t\t\"queue_\" + $(menu[element[0]][\"txt\"]).attr(\"id\"), \n\t\t\t\t\t{color: w.menuColorClick}, \n\t\t\t\t\tw.fadeMs * fadeFrac, \n\t\t\t\t\t0, \n\t\t\t\t\t{color: w.menuColor}, \n\t\t\t\t\tw.fadeMs * fadeFrac, \n\t\t\t\t\t0);\n\t\t\t}\n\t\t}\n\t});\n\n\tvar xOffset = w.windowL + w.windowW/2 - menuWidth/2;\n\tvar ty = $(menu[\"logo\"][\"txt\"]).offset().top + $(menu[\"logo\"][\"txt\"]).height();\n\t$.each(menuItems, function(index, item) {\n\n\t\t// Layout the menu items\n\t\tvar thisY = ty + item.height() * (item.attr(\"id\")==\"and\" ? 0.2/andFrac*andOffsetMult : 0.2);\n\t\tsetTxtPosDim(item,\n\t\t\txOffset,\n\t\t\tthisY );\n\n\t\tif (!bLayoutOnly) item.fadeIn({queue: false, duration: w.fadeMs}); \n\n\t\txOffset += item.width();\n\t});\n}", "title": "" }, { "docid": "8fd42b9122e01a80f8b9c7d4bd764eb9", "score": "0.5764677", "text": "render(){ \n const { onLogoutTry, userRole } = this.props;\n const { subMenuOpen, currentOption, quote } = this.state;\n // if (totalItems === 0) return <label>No hay libros que corresponda al criterio</label>;\n return ( \n <> \n <div className=\"container mb-5\">\n\n <OffCanvas\n width= {200}\n transitionDuration= {300}\n effect= {\"parallax\"}\n isMenuOpened= {this.state.isMenuOpened}\n position= {\"left\"}\n className= \"mr-4\"\n >\n {/* Este es el cuerpo de la aplicacion, dependiendo la opcion se visualiza una pagina/componente*/}\n <OffCanvasBody className= \"ml-4\">\n <Navbar onLogoutTry={onLogoutTry} onSetSidebarOpen= {this.onSetSidebarOpen} quote= { quote }/>\n {/* Renderizado condicional dependiendo cual es el item seleccionado del submenu */}\n { currentOption === \"LIBROS_PRESTAR\" && <BorrowBook itemsPerPage={itemsPerPage} userRole= { this.props.userRole } /> }\n { currentOption === \"LIBROS_PRESTADOS\" && <BorrowedBooks /> }\n { currentOption === \"AGREGAR_LIBROS\" && <AddBook /> }\n { currentOption === \"LIBROS_AGENDADOS\" && <ScheduledBooks /> }\n\n { currentOption === \"AGREGAR_USUARIO\" && <AddUser type= 'ADD' /> }\n { currentOption === \"MODIFICAR_USUARIO\" && <UpdateUser /> }\n \n </OffCanvasBody>\n\n {/* Se realizo un toggle menu dependiendo de un estado que este seleccionado */}\n <OffCanvasMenu className=\"bg-light\">\n {/* cabecera del menu */}\n <div className= \"w-100 px-4 d-flex flex-row flex-wrap align-items-center justify-content-between text-white bg-dark\">\n <h4 className = \"px-3 py-2\" style= {{'margin': 'unset'}}> \n <FontAwesomeIcon icon={ faHouseUser } /> Menu </h4>\n <a href=\"#\" onClick={ this.onSetSidebarOpen }> <h4 style= {{'margin': 'unset'}} className=\"text-white\"> <FontAwesomeIcon icon={ faTimes } /> </h4> </a>\n </div> \n\n <ul className=\"list-group list-group-flush\">\n <li className=\"list-group-item\">\n <button type=\"button\" name=\"BOOKS\" onClick={ this.onMenuChange }>\n <FontAwesomeIcon icon={ faJournalWhills } /> Libros \n </button>\n \n {subMenuOpen === 'BOOKS' &&\n <div >\n <ul className=\"list-group list-group-flush\">\n\n <SubMenuItem currentOption= { currentOption }\n icon= { faBookOpen }\n label= \"Prestar\"\n onClickFunction= { this.onPageChange }\n optionName= \"LIBROS_PRESTAR\" />\n\n <SubMenuItem currentOption= { currentOption }\n icon= { faExchangeAlt }\n label= \"Prestamos\"\n onClickFunction= { this.onPageChange }\n optionName= \"LIBROS_PRESTADOS\" />\n\n { userRole === 'ROLE_ADMIN' && \n <SubMenuItem currentOption= { currentOption }\n icon= { faPlus }\n label= \"Agregar\"\n onClickFunction= { this.onPageChange }\n optionName= \"AGREGAR_LIBROS\" />\n }\n { userRole === 'ROLE_ADMIN' && \n <SubMenuItem currentOption= { currentOption }\n icon= { faPencilAlt }\n label= \"Agendados\"\n onClickFunction= { this.onPageChange }\n optionName= \"LIBROS_AGENDADOS\" />\n }\n {/*\n <SubMenuItem currentOption= { currentOption }\n icon= { faPencilAlt }\n label= \"Modificar\"\n onClickFunction= { this.onPageChange }\n optionName= \"MODIFICAR_LIBRO\" />\n\n <SubMenuItem currentOption= { currentOption }\n icon= { faMinus }\n label= \"Eliminar\"\n onClickFunction= { this.onPageChange }\n optionName= \"ELIMINAR_LIBRO\" />\n */}\n </ul>\n </div> }\n\n </li>\n { userRole === 'ROLE_ADMIN' &&\n <li className=\"list-group-item\" onClick={this.onMenuChange}>\n <button type=\"button\" name=\"USERS\" onClick={ this.onMenuChange }>\n <FontAwesomeIcon icon={ faUsers } /> Usuarios\n </button>\n\n { subMenuOpen === 'USERS' && \n <div>\n <ul className=\"list-group list-group-flush\">\n\n <SubMenuItem currentOption= { currentOption }\n icon= { faUserPlus }\n label= \"Agregar\"\n onClickFunction= { this.onPageChange }\n optionName= \"AGREGAR_USUARIO\" />\n\n <SubMenuItem currentOption= { currentOption }\n icon= { faUserEdit }\n label= \"Modificar\"\n onClickFunction= { this.onPageChange }\n optionName= \"MODIFICAR_USUARIO\" />\n {/*\n <SubMenuItem currentOption= { currentOption }\n icon= { faUserTimes }\n label= \"Eliminar\"\n onClickFunction= { this.onPageChange }\n optionName= \"ELIMINAR_USUARIO\" />\n\n */}\n\n </ul>\n </div> }\n </li>\n }\n </ul>\n </OffCanvasMenu>\n </OffCanvas> \n </div>\n <Footer />\n </>\n );\n }", "title": "" }, { "docid": "30d92508ecf40ad13baa64ebaf4bc45d", "score": "0.57604355", "text": "getUniqueItemsToDisplay(items){\n\t\t\n\t\tconst index = this.state.menuIndex;\n\t\t\n\t\tif (index === 0){ // home\n\t\t\n\t\t\tif (this.state.completingHabit !== \"\"){\n\t\t\t\titems.push(<EventView key=\"event\" habitTitle={this.state.completingHabit} startDate={this.state.user.getHabitByTitle(this.state.completingHabit).getStartDate()} onReturn={this.onEventReturn} />);\n\t\t\t} else {\n\t\t\t\titems.push(\n\t\t\t\t\t<p key=\"welcome\" className=\"App-intro\">\n\t\t\t\t\t Welcome, {this.state.user.getName()}!\n\t\t\t\t\t</p>,\n\t\t\t\t\t<TodaysTasks key=\"tasks\" tasks={this.state.user.getTodaysTasks()} onChecked={this.onTodaysTaskChecked} />\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (index === 1){\t\t// habits\n\t\t\titems.push(<Habits key=\"habits\" user={this.state.user} />);\n\t\t} else if (index === 2){\t\t// habit history\n\t\t\titems.push(<HabitHistory key=\"history\" user={this.state.user} />);\n\t\t} else if (index === 3){\t\t// followed users\n\t\t\n\t\t} else if (index === 4){\t\t// follow requests\n\t\t\titems.push(<FollowRequests key=\"requests\" user={this.state.user} />);\n\t\t} else if (index === 5){\t\t// search users\n\t\t\n\t\t} else {\t\t\t\t\t\t// shouldn't happen\n\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "106bf5afc7ab79ab3e0f537b7ac0cb4d", "score": "0.57308805", "text": "function showMenu() {\n inquirer.prompt([\n {\n type: 'list',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product', 'Exit'],\n message: \"What would you like to accomplish?\",\n name: 'menu'\n }\n ]).then(function(res) {\n //Calls manager-level functions\n var command = res.menu;\n switch (command) {\n case 'View Products for Sale':\n listItems();\n break;\n case 'View Low Inventory':\n viewLow();\n break;\n case 'Add to Inventory':\n getProdList();\n break;\n case 'Add New Product':\n getDptList();\n break;\n case 'Exit':\n console.log(\"\\nThanks for updating the store. Have a great day!\\n\");\n connection.end();\n break;\n default:\n console.log(\"This command was not recognized.\");\n }\n })\n}", "title": "" }, { "docid": "b1cc95fe2abd0ce308415a915afc34c5", "score": "0.57242066", "text": "function setupMenu() {\n if($scope.signedInUser.role === 'patient') {\n $scope.menu.push({\n subheader: 'Patient menu',\n elements: [\n {title: \"Search doctor\", click: openSearchUser},\n {title: \"My profile\", click: openMyProfile}\n ]\n });\n } else if($scope.signedInUser.role === 'doctor') {\n $scope.menu.push({\n subheader: 'Doctor menu',\n elements: [\n {title: \"Register patient\", click: openRegisterPatient},\n {title: \"Search patient\", click: openSearchUser},\n {title: \"My patients\", click: openMyPatients},\n {title: \"Sounds\", click: openSounds}\n ]\n });\n } else if($scope.signedInUser.role === 'researcher') {\n $scope.menu.push({\n subheader: 'Researcher menu',\n elements: [\n {title: \"Menu1\", click: orM},\n {title: \"Menu2\", click: orM}\n ]\n });\n }\n }", "title": "" }, { "docid": "601a6572df75b2f8f9e29190e5917c3e", "score": "0.5685176", "text": "get renderItems() {\n return this.queryItems((item, composer) => {\n return composer.getItemPropertyValue(item, 'hidden') !== true;\n });\n }", "title": "" }, { "docid": "84575b1b7682dc1fd2bd514b031dc8fc", "score": "0.5678756", "text": "function AddCustomMenuItems(menu) {\r\n menu.AddItem(strRefresh, 0, OnMenuClicked);\r\n menu.AddItem(strGadgetPage, 0, OnMenuClicked);\r\n menu.AddItem(strAtlantisPage, 0, OnMenuClicked);\r\n}", "title": "" }, { "docid": "f2e0c3093b746faf421f0a16ff929ad8", "score": "0.5678012", "text": "getHeaderContent(state2){\n //\n header_shopOption.mutations.getShopOptions(state) // get shop dropdown content\n header_brand.mutations.getBrandCat(state) // brand dropdown content\n //}\n }", "title": "" }, { "docid": "87b093c61a252ad1db5583e1cfb1f7af", "score": "0.56746197", "text": "renderMenuItemBlock(item, level){\n level = this.props.collapsed ? 2 : level; // If the menu is collapsed all icons should be on the same level.\n const menuItemStyle = {paddingLeft: 10 * level + 'px'};\n // Set up class for expanding\n const subitemClassName = (item.title ? (item.expanded == true ? '' : ' collapsed') : '');\n let itemBlock;\n if (item.title){\n if (!this.props.collapsed){\n itemBlock = (\n <div className={'menu-item ' + (window.location.pathname == item.url ? 'current-url' : '')} style={menuItemStyle}>\n {item.icon ?<div className=\"icon-block\" style={{color: item.color || ''}}><Icon icon={item.icon} /></div> : ''}\n {item.url ? <Link to={item.url} onClick={()=>this.props.linkClickHandler()}>{item.title}</Link> : <span>{item.title}</span> }\n {item.items ? <button className=\"button-expand\" onClick={() => this.toggleSubMenu(item)}><Icon icon=\"angle-down\" /></button>: ''} \n </div>\n );\n } else {\n // Show only icon or default icon\n const itemCollapsedIcon = item.icon ? \n <Icon icon={item.icon} style={{color: item.color || ''}} /> : \n <Icon className=\"default-color\" icon='arrow-alt-circle-right' />;\n itemBlock = (\n <div className=\"menu-item\" style={menuItemStyle}>\n <div className=\"icon-block\" title={item.title}>{item.url ? <Link to={item.url}>{itemCollapsedIcon}</Link> : <span>{itemCollapsedIcon}</span> }</div>\n {item.items ? <button className=\"button-expand\" onClick={() => this.toggleSubMenu(item)}><Icon icon=\"angle-down\" /></button>: ''} \n </div>\n );\n }\n } else {\n itemBlock = '';\n }\n return (\n <div key={item.title || item.groupTitle}>\n {itemBlock}\n {item.items ? \n <div className={'item-submenu' + subitemClassName}>\n {\n item.items.map((subItem)=>this.renderMenuItemBlock(subItem, level + 1))\n }\n </div> \n : ''\n }\n </div>\n );\n }", "title": "" }, { "docid": "3543f4a3da1e73908fc8d9ba72a04bce", "score": "0.5672721", "text": "showMoreMenu(anchorElement) {\n this.props.uiShowMenu([\n {\n text: 'New Construct',\n disabled: this.props.readOnly,\n action: this.onAddConstruct,\n },\n {\n text: 'View',\n menuItems: this.getViewMenuItems(),\n },\n {\n text: 'Download Project',\n action: () => {\n downloadProject(this.props.project.id, this.props.focus.options);\n },\n },\n {\n text: 'Upload Genbank or CSV...',\n disabled: this.props.readOnly,\n action: this.upload,\n },\n {\n text: 'Publish Project...',\n disabled: this.props.readOnly || (this.props.projectVersionIsPublished && !this.props.projectIsDirty) || (this.props.project.components.length === 0),\n action: this.onShareProject,\n },\n {\n text: 'Unpublish Project',\n disabled: this.props.readOnly || !this.props.projectIsPublished,\n action: this.onUnpublishProject,\n },\n {\n text: 'Delete Project...',\n disabled: this.props.readOnly,\n action: this.onDeleteProject,\n },\n ],\n ProjectHeader.getToolbarAnchorPosition(anchorElement),\n true);\n }", "title": "" }, { "docid": "595fa24bcb4c8da3d48c3539c87d9975", "score": "0.56678414", "text": "function Navigate() {\n\n const handleItemClick = (e, { name }) => ({ activeItem: name })\n\n\n return (\n \n <Grid.Column width={3}>\n <Menu vertical>\n <Menu.Item\n name='contacts' href=\"contacts\"\n onClick={handleItemClick}\n >\n <Label color='teal'>1</Label>\n Contacts\n </Menu.Item>\n\n <Menu.Item\n name='accounts' href=\"accounts\"\n onClick={handleItemClick}\n >\n <Label>51</Label>\n Accounts\n </Menu.Item>\n\n <Menu.Item\n name='settings' href=\"settings\"\n onClick={handleItemClick}\n >\n <Label>1</Label>\n Settings\n </Menu.Item>\n </Menu>\n {/* <Switch>\n <Route path=\"/contacts\">\n <Contacts />\n </Route>\n <Route path=\"/accounts\">\n <Accounts />\n </Route>\n <Route path=\"/settingss\">\n <Settings />\n </Route>\n </Switch> */}\n </Grid.Column>\n \n )\n}", "title": "" }, { "docid": "04c1ace9222dcd65344c3fcfc1af40f5", "score": "0.5667281", "text": "_inMenuOverviewMode() {\n return this._centerItem == null;\n }", "title": "" }, { "docid": "006f187bde9280ee0c066d01d8194884", "score": "0.56669444", "text": "showItem() {\n var {items} = this.state;\n if (this.state.visible) { \n return (\n <div>\n <ul>\n { /* <li>CountryCode: {items.CountryCode}</li>\n <li>VATNumber: {items.VATNumber}</li> */}\n {Object.keys(items).map(key => \n <li>\n {key}: {items[key]} \n </li>)} \n </ul>\n </div>)\n } else {\n return <h4>Click the \"Search\" button to Fetch Data</h4>\n } \n }", "title": "" }, { "docid": "445ff72dd4bcdc9bae8cc99fcd341883", "score": "0.56669164", "text": "showMenuList() {\n this.menu.style.display = 'block';\n }", "title": "" }, { "docid": "975c1bd73dc5352ab2d60175c213ce9a", "score": "0.5658304", "text": "render() {\n return (\n <Menu right onStateChange={this.isMenuOpen} isOpen={this.state.menuOpen}>\n <SearchFeature/>\n </Menu>\n );\n }", "title": "" }, { "docid": "2dd85671f2d1f6822774409e49998830", "score": "0.5657282", "text": "function updateMenu() {\n // console.log('updateMenu');\n\n const menuPanel = document.getElementById('menu');\n const menuGrip = document.getElementById('menuGrip');\n const menuFlag = document.getElementById('menuFlag');\n const menuPdf = document.getElementById('menuPdf');\n const menuPng = document.getElementById('menuPng');\n const menuSave = document.getElementById('menuSave');\n const menuHighlight = document.getElementById('menuHighlight');\n const menuExportSvg = document.getElementById('menuExportSvg');\n const menuExportPng = document.getElementById('menuExportPng');\n\n if (Common.isIOSEdge) {\n const menuPrint = document.getElementById('menuPrint');\n menuPrint.style.display = 'none';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuHighlight.src = '/media/edit-on.svg';\n menuHighlight.title = 'Turn off highlighter';\n } else {\n menuHighlight.src = '/media/edit-off.svg';\n menuHighlight.title = 'Turn on highlighter';\n }\n\n if (PageData.Flagged) {\n menuFlag.src = '/media/flagged.svg';\n menuFlag.title = 'Remove flag';\n } else {\n menuFlag.src = '/media/unflagged.svg';\n menuFlag.title = 'Flag this diagram';\n }\n\n if (SvgModule.Data.Highlighting) {\n menuSave.style.display = 'inline';\n\n // menuExportSvg.style.display = 'inline';\n menuExportSvg.style.display = (Common.isIOSEdge ? 'none' : 'inline');\n\n // menuExportPng.style.display = (isIE ? 'none' : 'inline');\n menuExportPng.style.display = (Common.isIOSEdge || Common.isIE ? 'none' : 'inline');\n } else {\n menuSave.style.display = 'none';\n menuExportSvg.style.display = 'none';\n menuExportPng.style.display = 'none';\n }\n\n menuFlag.style.display = 'inline';\n\n if (SvgModule.Data.Highlighting) {\n menuPdf.style.display = 'none';\n menuPng.style.display = 'none';\n } else {\n menuPdf.style.display = 'inline';\n menuPng.style.display = 'inline';\n }\n\n menuPanel.style.display = 'block';\n\n // 4px padding on div#menu\n PageData.MenuOffset = menuPanel.clientWidth - menuGrip.clientWidth - 4;\n}", "title": "" }, { "docid": "0d9e5d826087ce253c002b529eca709e", "score": "0.56567323", "text": "showSection() {\n\n //close other section\n shared.closeSections();\n\n //show this section\n const managerSection = document.getElementById(\"manager_section\");\n managerSection.style.display = \"block\";\n\n //update nav bar\n navBar.setManageDisplay();\n\n navBar.setMenuItem(NAV_MY_TICKETS, false, false);\n navBar.setMenuItem(NAV_MANAGE_TICKETS, true, true);\n navBar.setMenuItem(NAV_LOG_OUT, false, false);\n\n this.getAllTicketsRequest();\n }", "title": "" }, { "docid": "0eaaf7c2726b3f2eb8246b5a3afb017e", "score": "0.56548023", "text": "function initDynamicNavigationMenu()\n {\n //aggiungo dinamicamente al menu di sx\n msNavigationService.saveItem('apps.notes.notes2', {\n title : 'Notes2 dinamico',\n state : 'app.notes2'\n });\n }", "title": "" }, { "docid": "8cec6513f556b565f032797a36190b77", "score": "0.56539446", "text": "function buildMenu() {\n sectionNames.forEach(helperBuildMenuFn);\n const menuItemDoc = document.getElementById(\"menuItems\");\n menuItemDoc.appendChild(sectionFragment);\n}", "title": "" }, { "docid": "776ced660936c3effcc5bb438b8420e9", "score": "0.56500375", "text": "function getMenu() {\n $.get('/app/products', function(data) {\n menuItems = data;\n initializeRows();\n });\n }", "title": "" }, { "docid": "3777905e5d67951f2d99fe082b096c60", "score": "0.56339115", "text": "get_drawer_menu(){\n var iconStyle = { color: \"#888\"};\n var selectedIconStyle = { color: \"#333\"};\n var selectedStyle = {color:\"#333\", fontWeight:\"bold\"};\n var {pathname} = this.props.location;\n return (\n <Menu value={pathname} selectedMenuItemStyle={selectedStyle} autoWidth={false} width=\"250px\">\n <MenuItem primaryText=\"Check In\" value=\"/\"\n leftIcon={ <FontIcon style={pathname==\"/\" ? selectedIconStyle : iconStyle} className=\"material-icons\">airport_shuttle</FontIcon>}\n style={iconStyle}\n containerElement={<Link to=\"\"/>}\n onTouchTap={this.close_drawer}\n />\n {this.props.route.role==\"coordinator_admin\" &&\n <MenuItem primaryText=\"Manage Users\" value=\"/users\"\n leftIcon={ <FontIcon style={pathname==\"/users\" ? selectedIconStyle : iconStyle} className=\"material-icons\">people</FontIcon>}\n style={iconStyle}\n containerElement={<Link to=\"/users\"/>}\n onTouchTap={this.close_drawer}\n />\n }\n <Divider style={{marginTop:200}}/>\n <MenuItem primaryText={this.props.route.username} value=\"/xyz\"\n leftIcon={ <FontIcon style={pathname==\"/xyz\" ? selectedIconStyle : iconStyle} className=\"material-icons\">face</FontIcon>}\n style={iconStyle}\n containerElement={<Link to=\"\"/>}\n onTouchTap={this.close_drawer}\n />\n <MenuItem primaryText=\"Help\" value=\"/help\"\n leftIcon={ <FontIcon style={pathname==\"/help\" ? selectedIconStyle : iconStyle} className=\"material-icons\">help</FontIcon>}\n style={iconStyle}\n containerElement={<Link to=\"\"/>}\n onTouchTap={()=>this.setState({showHelpPopup:true}, ()=> this.close_drawer())}\n />\n <MenuItem primaryText=\"Logout\" value=\"/logout\"\n leftIcon={ <FontIcon style={pathname==\"/logout\" ? selectedIconStyle : iconStyle} className=\"material-icons\">exit_to_app</FontIcon>}\n style={iconStyle}\n href=\"/coordinator/logout/\"\n onTouchTap={this.close_drawer}\n />\n </Menu>\n )\n }", "title": "" }, { "docid": "e507ad1602f5faeacacac7ae54314781", "score": "0.5625624", "text": "renderMenu() {\n const shouldFocusOnMenu = this.shouldFocusMenuOnNextRender;\n const { autoSuggest_menu, autoSuggest__disabled, } = this.props.managedClasses;\n this.shouldFocusMenuOnNextRender = false;\n if (!this.state.isMenuOpen) {\n return;\n }\n const focusedItem = this.state.focusedItem !== null ? [this.state.focusedItem] : [];\n return (React.createElement(Listbox, { id: this.props.listboxId, typeAheadEnabled: false, disabled: this.props.disabled, focusItemOnMount: shouldFocusOnMenu, defaultSelection: focusedItem, onSelectedItemsChanged: this.updateFocusedItem, onItemInvoked: this.handleItemInvoked, onKeyDown: this.handleMenuKeydown, managedClasses: {\n listbox: autoSuggest_menu,\n listbox__disabled: autoSuggest__disabled,\n } }, this.renderChildren()));\n }", "title": "" }, { "docid": "f0325c760bcfa1b2ba7d6df98f7e3206", "score": "0.56233275", "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": "e8de4fcebca50bf8f72e64b3a1199391", "score": "0.56194484", "text": "mainMenu(show = false) {\n // eslint-disable-next-line no-unused-vars\n const showMenu = show ? Transition.in(this.mainMenuTransitionController) : null;\n\n this.setState(oldState => ({\"menuStack\": [oldState.menuStack[0]]}));\n }", "title": "" }, { "docid": "648d54ab6d98f6d795e313fbf400d1f2", "score": "0.5617487", "text": "render() { \n return `\n <div class=\"meter\">\n <nav role=\"navigation\">\n <div id=\"menuToggle\">\n <input type=\"checkbox\" />\n <span></span>\n <span></span>\n <span></span>\n <ul id=\"menu\">\n <a href=\"#\"><li>Home</li></a>\n <a href=\"#contact\"><li>Contact</li></a>\n <a href=\"#tarifas\"><li>Tarifas</li></a>\n <a href=\"#catalogo\"><li>Catálogo</li></a>\n </ul>\n </div>\n <button type=\"button\" class=\"menu__buttonMenu--black\" id=\"ES\">Español</button>\n <button type=\"button\" class=\"menu__buttonMenu--black\" id=\"VAL\">Valenciano</button>\n </nav>\n </div>\n `;\n }", "title": "" }, { "docid": "f555c99afec8e692fd29d9fdedf30841", "score": "0.56169456", "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": "46ea8075b32ad6b87c2dd14d306b0889", "score": "0.561558", "text": "function openMenuBar() {\n menuBg.style.display = \"block\";\n menuItems.style.display = \"block\";\n closeButton.style.display = \"block\";\n}", "title": "" }, { "docid": "968407bdb3b73b4e8e135fe8d2d82fb4", "score": "0.56067353", "text": "isRendered() {\n return this.getUserView().$el.find('#user-menu').length > 0;\n }", "title": "" }, { "docid": "e87e78ffafb2f27f9d5bee10bfeb6ff9", "score": "0.5593254", "text": "function showMenu() {\n console.log (\"Main menu:\\n\");\n for(var i=0; i<menuItems.length; i++) {\n console.log(i+1 + \". \" + menuItems[i]);\n }\n console.log (\"\\nPlease choose a menu item: \");\n}", "title": "" }, { "docid": "8f1059ab5e59993bf4f3f8d561a10edf", "score": "0.5592704", "text": "render(){\n\t\treturn (\n\t\t\t<nav id=\"menu\">\n\t\t\t\t<ul className=\"links\">\n\t\t\t\t\t{this.props.menu.map((items) => \n\t\t\t\t\t\t<li key={items.title}><a key={items.title} href={items.url}>{items.title}</a></li>\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t</ul>\n\t\t\t\t<ul className=\"actions vertical\">\n\t\t\t\t\t{this.props.login.map((items) => \n\t\t\t\t\t\t<li key={items.title}><a key={items.title} href={items.url} className={items.style}>{items.title}</a></li>\n\t\t\t\t\t)}\n\t\t\t\t</ul>\n\t\t\t</nav>\n\t\t);\n\t}", "title": "" }, { "docid": "ba9cc31b012f4f49df5547e0b20ab091", "score": "0.5578609", "text": "render() {\n this.appendMenuContent();\n\n this.$container.attr('aria-hidden', true);\n this.$el.appendTo(this.accessibility.getMainWrap());\n }", "title": "" }, { "docid": "676d7b7d42f8fc1ae1e0ac74f0586609", "score": "0.55746824", "text": "render(items, data) {\n this.listContainer.innerHTML = '';\n let completedItems = 0;\n\n if (items.length > 0) {\n this.mainSection.style.display = 'block';\n this.footerSection.style.display = 'block';\n\n items.filter(item => {\n return !((data.view === 'active' && item.completed) || (data.view === 'completed' && !item.completed));\n }).map(item => {\n this.insertItem(item);\n if (item.completed) {\n completedItems++;\n }\n });\n\n this.toggleAllCheck.checked = completedItems === items.length;\n } else {\n this.mainSection.style.display = 'none';\n this.footerSection.style.display = 'none';\n }\n }", "title": "" }, { "docid": "2051e0d44daa756e3de975fa959d75fa", "score": "0.557393", "text": "function shoppingListMain() {\n renderShoppingList();\n newItemSubmit();\n itemCheckClicked();\n deleteItemClicked();\n displayUnchecked();\n handleSearch();\n console.log(STORE);\n}", "title": "" }, { "docid": "cfcc53932c748e38dcf32f3a018029ad", "score": "0.55664164", "text": "get showButtonMenu() {\n return (\n this.approvalHistory.isCurrentUserApprover ||\n this.approvalHistory.showRecall\n );\n }", "title": "" }, { "docid": "02fc4e82b9e5e1cbb24449450e1e4a41", "score": "0.55629045", "text": "render() {\n return (\n <div className=\"App\">\n {this.state.products.length > 0 ?\n <>\n <Menu products={this.state.products} product={this.state.product} setProduct={this.setProduct}/>\n <Home products={this.state.products} product={this.state.product} setProduct={this.setProduct}/>\n {this.paintProducts()}\n </>\n : <></>\n }\n </div>\n );\n }", "title": "" }, { "docid": "89aec2a065ad8e33be8dc8cfa39c78b6", "score": "0.5562683", "text": "render(){\r\n return(\r\n <div>\r\n <Menu id = \"menu\"/>\r\n </div>\r\n )\r\n }", "title": "" }, { "docid": "49e9fab40339207ee59273a4b47e3313", "score": "0.55608034", "text": "render() {\n \n // console.log(this.state.foodInCart)\n const itemsInCart = this.state.foodInCart.length\n \n const foodmenu = this.state.food.map(item => \n <Body key={item.id} item={item} addToCart={this.addToCart} removeFromCart={this.removeFromCart}/> )\n //console.log(foodmenu)\n return (\n <div>\n <Navbar \n filterRating={this.filterRating} \n filterCategory={this.filterCategory} \n filterPrice={this.filterPrice} \n displayAll={this.displayAll} \n inCart={itemsInCart}\n checkOut={this.checkOut}\n />\n <div className=\"container\">\n <div className=\"row myrow col-12\">\n {foodmenu}\n </div>\n </div>\n <Footer />\n \n </div>\n )\n }", "title": "" }, { "docid": "62ae6e8d560d889f6932731ef1ab4d9d", "score": "0.55463207", "text": "function enableMenu() {\n \n // prints menu item 1\n menu.classList.add('menuTab');\n content.appendChild(menu);\n menu.appendChild(menuItem);\n menuItem.appendChild(menuPicture);\n menuItem.appendChild(topDescription);\n menuItem.appendChild(bottomDescription);\n\n // prints menu item 2\n menu.appendChild(menuItem2);\n menuItem2.appendChild(menuPicture2);\n menuItem2.appendChild(topDescription2);\n menuItem2.appendChild(bottomDescription2); \n \n // prints menu item 2\n menu.appendChild(menuItem3);\n menuItem3.appendChild(menuPicture3);\n menuItem3.appendChild(topDescription3);\n menuItem3.appendChild(bottomDescription3); \n\n // prints menu item 2\n menu.appendChild(menuItem4);\n menuItem4.appendChild(menuPicture4);\n menuItem4.appendChild(topDescription4);\n menuItem4.appendChild(bottomDescription4); \n\n \n\n\n }", "title": "" }, { "docid": "8442d3f76bdb3f9b172f3c5be28f45ae", "score": "0.5546135", "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": "637060c2fef00c1e5cd642b7b89d5e2a", "score": "0.55414236", "text": "function displayMenu() {\n\t\t\tvar mainLogoHeight = document.getElementById(\"logo-canvas\").offsetTop;\n\t\t\tif (scrollPos >= mainLogoHeight) {\n\t\t\t\tif(menuStyle.display === 'inline') {\n\t\t\t\t\tmenuStyle.display='inline'; // Counteract the constant re-animation on a new scroll\n\t\t\t\t\tcontactStyle.display='inline';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfadeIn(menuSelector,'inline');\t\n\t\t\t\t\tfadeIn(contactDiv,'inline');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\tfadeOut(menuSelector);\n\t\t\t\t\tfadeOut(contactDiv);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8748cdd757bd7730cd1cfa756a953896", "score": "0.55412275", "text": "function showSelectedMenu(item){\n\t$(\".menu div\").each(function() {\n\t\t$(this).hide();\n\t});\n\n\tvar menuName = null;\n\t$.each(toolbarItem , function(key, value) { \n\t\tif (value == item.index()) {\n\t\t\tmenuName = key.toLowerCase();\n\t\t};\n\t});\n\n\tif (menuName!=null){\n\t$(\".\"+menuName).slideDown();\n\t}\n}", "title": "" }, { "docid": "ba5195225fa18b57ffda524aa12f8ccd", "score": "0.5541195", "text": "function filterMenu(e) {\n var item1 = {\n title: lang['pgApprovalWorklist.item1.title'],\n icon: 'icon.png', // Andrid 3.0- only\n onSelected: function(e) {\n displayApprovalRequests('waiting');\n }\n };\n var item2 = {\n title: lang['pgApprovalWorklist.item2.title'],\n icon: 'icon.png', // Andrid 3.0- only\n onSelected: function(e) {\n displayApprovalRequests('approved');\n }\n }\n var item3 = {\n title: lang['pgApprovalWorklist.item3.title'],\n icon: 'icon.png', // Andrid 3.0- only\n onSelected: function(e) {\n displayApprovalRequests('rejected');\n }\n }\n\n var item4 = {\n title: lang['pgOutOfOffice.btnSave.onPressed.secondButtonText'],\n itemType: SMF.UI.MenuItemType.cancel, // iOS Only\n onSelected: function(e) {}\n };\n var myItems = [item1, item2, item3, item4]; // assume that items are predefined\n var menu1 = new SMF.UI.Menu({\n menuStyle: SMF.UI.MenuStyle.OPTIONALMENU,\n icon: 'menu_icon.png', // Android Context Menu Only\n items: myItems\n });\n menu1.show();\n }", "title": "" }, { "docid": "c56cca28919b96d607f3d86084297e54", "score": "0.5539505", "text": "function BurgerMenu(props) {\n const handleClick = () => {\n props.setListVisibility(!props.isPlaylistVisible)\n }\n return (\n <Menu {...props}>\n <div onClick={handleClick} className=\"menu-item\">\n Playlist\n </div>\n <div className=\"menu-item\">\n Favorites\n </div>\n </Menu>\n )\n}", "title": "" }, { "docid": "73ea99f055d54dbb7dfa410ef7731360", "score": "0.553665", "text": "function displayMenuItems(menuItems) {\n let displayMenu = menuItems.map(function (item) {\n return `<article class=\"menu-item\">\n <img src=${item.img} alt=${item.title} class=\"photo\" />\n <div class=\"item-info\">\n <header>\n <h4>${item.title}</h4>\n <h4 class=\"price\">$${item.price}</h4>\n </header>\n <p class=\"item-text\">\n ${item.desc}\n </p>\n </div>\n </article>`;\n })\n displayMenu = displayMenu.join(\"\");\n sectionCenter.innerHTML = displayMenu;\n\n}", "title": "" }, { "docid": "3cfc2027a1d98985755c820c348efb62", "score": "0.55357444", "text": "enterMenu() {\n if (this.navigationManager_) this.navigationManager_.enterMenu();\n }", "title": "" }, { "docid": "7ceb936f198dd2eaff58b834b186f1a4", "score": "0.55350995", "text": "function onOpen() {\n createMenu();\n}", "title": "" }, { "docid": "8e6db0346233418945b62fbd6db38758", "score": "0.55326587", "text": "showMenu() {\n this.setState({\n page: this.menuPage,\n });\n }", "title": "" }, { "docid": "5ed3f0085aef1f75a1bf943cddaefb68", "score": "0.5530158", "text": "constructor(props) {\n super(props);\n \n this.state = {\n elPublicMenu_visible: false,\n };\n }", "title": "" }, { "docid": "927a893a84bcf02e35b6472b4f40b9fc", "score": "0.5525418", "text": "_init(params = {}) {\n super._init(params);\n\n // Create a Gio.Settings object. This is required to use the correct font when\n // drawing a text icon.\n this._settings = utils.createSettings();\n\n // This list contains all currently visible items. The only exception are the\n // _centerItem and the _backButton which are not in this list but managed\n // separately.\n this._items = [];\n this._centerItem = null;\n\n // This stores a reference to the currently selected item.\n this._selectedItem = null;\n\n // When this is set to true, vfunc_size_allocate() will be called repeatedly for\n // the TRANSITION_DURATION.\n this._restartAnimation = false;\n\n // These are set during setItems() and are evaluated in the next\n // vfunc_size_allocate() to move the items around accordingly.\n this._upcomingTransition = TransitionType.NONE;\n this._transitionAngle = 0;\n\n // Here we create the icon and label which are shown if no menu is present.\n {\n const icon =\n new Gtk.Image({icon_name: 'face-crying-symbolic', pixel_size: 128});\n const label = new Gtk.Label({label: _('No menus configured')});\n utils.addCSSClass(label, 'title-3');\n const description = new Gtk.Label(\n {label: _('Create a new menu with the button in the top right corner.')});\n utils.addCSSClass(description, 'caption');\n\n this._ifEmptyHint = Gtk.Box.new(Gtk.Orientation.VERTICAL, 4);\n this._ifEmptyHint.vexpand = true;\n this._ifEmptyHint.valign = Gtk.Align.CENTER;\n this._ifEmptyHint.sensitive = false;\n utils.boxAppend(this._ifEmptyHint, icon);\n utils.boxAppend(this._ifEmptyHint, label);\n utils.boxAppend(this._ifEmptyHint, description);\n\n // The MenuEditor is derived from Gtk.Fixed on GTK3 and from Gtk.Widget on GTK4.\n // So we have add child items differently.\n if (utils.gtk4()) {\n this._ifEmptyHint.set_parent(this);\n } else {\n this.put(this._ifEmptyHint, 0, 0);\n }\n }\n\n // Here we create the icon and label which are shown to highlight the add-new-item\n // button.\n {\n let icon;\n if (utils.gtk4()) {\n icon = Gtk.Image.new_from_icon_name('flypie-arrow-up-symbolic');\n } else {\n icon = Gtk.Image.new_from_icon_name(\n 'flypie-arrow-up-symbolic', Gtk.IconSize.BUTTON);\n }\n const label = new Gtk.Label({label: _('Add a new item')});\n utils.addCSSClass(label, 'caption');\n\n this._addItemHint = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 4);\n this._addItemHint.hexpand = true;\n this._addItemHint.halign = Gtk.Align.END;\n this._addItemHint.valign = Gtk.Align.START;\n this._addItemHint.sensitive = false;\n this._addItemHint.margin_end = 20;\n this._addItemHint.margin_top = 8;\n utils.boxAppend(this._addItemHint, label);\n utils.boxAppend(this._addItemHint, icon);\n\n // The MenuEditor is derived from Gtk.Fixed on GTK3 and from Gtk.Widget on GTK4.\n // So we have add child items differently.\n if (utils.gtk4()) {\n this._addItemHint.set_parent(this);\n } else {\n this.put(this._addItemHint, 0, 0);\n }\n }\n\n // Now we set up the back-navigation button which is shown whenever we are in a\n // submenu.\n {\n this._backButton = new Gtk.Button({\n margin_start: 20,\n margin_end: 20,\n margin_top: 20,\n margin_bottom: 20,\n });\n utils.addCSSClass(this._backButton, 'pill-button');\n this._backButton.connect('clicked', (b) => {\n // Navigate to the previous level when clicked.\n this.emit('go-back');\n });\n\n // Assign a state so that it gets scaled like the other child buttons.\n this._backButton.state = ItemState.CHILD;\n\n // As the arrow on the back-button should be rotated in the parent direction, we\n // use a custom Gtk.DrawingArea.\n const icon = new Gtk.DrawingArea({\n margin_start: 10,\n margin_end: 10,\n margin_top: 10,\n margin_bottom: 10,\n });\n\n utils.setDrawFunc(icon, (widget, ctx) => {\n const width = widget.get_allocated_width();\n const height = widget.get_allocated_height();\n const size = Math.min(width, height);\n if (this._parentAngle >= 0) {\n ctx.translate(width / 2, height / 2);\n ctx.rotate((this._parentAngle + 90) * Math.PI / 180);\n ctx.translate(-width / 2, -height / 2);\n }\n ctx.translate((width - size) / 2, (height - size) / 2);\n const color = utils.getColor(widget);\n utils.paintIcon(ctx, 'go-previous-symbolic', size, 1, 'Sans', color);\n\n return false;\n });\n\n utils.setChild(this._backButton, icon);\n\n // The MenuEditor is derived from Gtk.Fixed on GTK3 and from Gtk.Widget on GTK4.\n // So we have add child items differently.\n if (utils.gtk4()) {\n this._backButton.set_parent(this);\n } else {\n this.put(this._backButton, 0, 0);\n\n // Make sure that the button is not shown automatically.\n this._backButton.no_show_all = true;\n icon.visible = true;\n }\n }\n\n // The entire menu editor is a drop target. This is used both for internal\n // drag-and-drop of menu items and external drops for item creation based on URLs\n // etc. Setting up drag and drop is quite different on GTK3 / GTK4. Therefore this\n // code looks a bit more difficult than it actually is. There are a few lambdas\n // involved which are then connected to the various signals of the widget (GTK3)\n // or the EventController (GTK4).\n {\n\n // On GTK3, we need special drag and drop targets.\n if (!utils.gtk4()) {\n this._dndTargets = [\n Gtk.TargetEntry.new('FLY-PIE-ITEM', Gtk.TargetFlags.SAME_APP, 0),\n Gtk.TargetEntry.new('text/uri-list', 0, 1),\n Gtk.TargetEntry.new('text/plain', 0, 2),\n ];\n }\n\n // The index of the dragged item.\n this._dragIndex = null;\n\n // The index where the dragged item will be placed if dropped.\n this._dropIndex = null;\n\n // In menu overview mode, these will contain the row and column where the\n // dragged thing will end up when dropped.\n this._dropRow = null;\n this._dropColumn = null;\n\n // When the user drags something across the widget, we re-arrange all items to\n // visually show where the new item would be created if dropped. In this\n // 'motion' callback, we compute the index where the data is supposed to be\n // dropped. The actual item positioning is later done in vfunc_size_allocate()\n // based on the computed index.\n const dragMotion = (x, y) => {\n // If any of the below values changes during this callback, we will trigger\n // an animation so that items move around smoothly.\n const lastDropRow = this._dropRow;\n const lastDropColumn = this._dropColumn;\n const lastDropIndex = this._dropIndex;\n\n // Computing the _dropIndex in menu overview mode is rather simple as we\n // just have to compute the row and column the pointer resides currently\n // over.\n if (this._inMenuOverviewMode()) {\n\n // The grid is drawn centered. Here we make the coordinates relative to\n // the grid and clamp the coordinates to the grid bounds.\n x -= this._gridOffsetX;\n y -= this._gridOffsetY;\n x = Math.max(0, Math.min(this._columnCount * ItemSize[ItemState.GRID], x));\n y = Math.max(0, Math.min(this._rowCount * ItemSize[ItemState.GRID], y));\n\n // To allow for drops into items, the valid drop zones are between two\n // items with a total width of half an item (one quarter from the one item\n // and a quarter of the next item).\n const dropZoneWidth = ItemSize[ItemState.GRID] / 4;\n\n // Compute the _drop* members if we are in a drop zone, else set them to\n // null.\n if (x % ItemSize[ItemState.GRID] < dropZoneWidth ||\n x % ItemSize[ItemState.GRID] >\n ItemSize[ItemState.GRID] - dropZoneWidth) {\n this._dropColumn = Math.floor(x / ItemSize[ItemState.GRID] + 0.5);\n this._dropRow = Math.floor(y / ItemSize[ItemState.GRID]);\n this._dropIndex = Math.min(\n this._items.length,\n this._columnCount * this._dropRow + this._dropColumn);\n } else {\n this._dropColumn = null;\n this._dropRow = null;\n this._dropIndex = null;\n }\n\n } else {\n // In menu edit mode, the computation is much more involved.\n\n // First we make the coordinates relative to the center.\n x -= this._width / 2;\n y -= this._height / 2;\n\n // We assume that we are not in a valid drop zone. If we are, this will be\n // set to the appropriate index later.\n this._dropIndex = null;\n\n // We compute the pointer-center distance. Items cannot be dropped too\n // close to the center.\n const distance = Math.sqrt(x * x + y * y);\n if (distance > ItemSize[ItemState.CENTER] / 2) {\n\n // Compute the angle between center-pointer and center-up.\n let mouseAngle = Math.acos(x / distance) * 180 / Math.PI;\n if (y < 0) {\n mouseAngle = 360 - mouseAngle;\n }\n mouseAngle = (mouseAngle + 90) % 360;\n\n // Compute the angle of all items. As we reset this._dropIndex before,\n // these will not include the gap for the to-be-dropped item. If an item\n // is dragged around (as opposed to external data), the angle of the\n // dragged item will coincide with its successor.\n const itemAngles = this._computeItemAngles();\n\n // Now compute the _dropIndex by comparing the mouseAngle with the\n // itemAngles. There are a few special cases when there are only a few\n // items in the menu.\n if (itemAngles.length == 0) {\n // If there is no current item, it's easy: We simply drop at index\n // zero.\n this._dropIndex = 0;\n\n } else if (itemAngles.length == 1) {\n // If there is one current item, we always drop at zero if it's an\n // internal drag (as we are obviously dragging the only item around).\n // If it's an external drag, we have to decide whether to drop before\n // or after.\n if (this._dragIndex != null) {\n this._dropIndex = 0;\n } else {\n this._dropIndex = (mouseAngle - itemAngles[0] < 90 ||\n mouseAngle - itemAngles[0] > 270) ?\n 0 :\n 1;\n }\n\n } else if (itemAngles.length == 2 && this._dragIndex != null) {\n // If there are two items but one of them is dragged around, we have\n // to decide whether to drop before or after. However, 'after' means\n // at index 2, as the item addition happens before the item removal\n // during an internal drag-and-drop.\n this._dropIndex = (mouseAngle - itemAngles[0] < 90 ||\n mouseAngle - itemAngles[0] > 270) ?\n 0 :\n 2;\n\n } else {\n\n // All other cases can be handled with a loop through the drop zone\n // wedges between the items. For each wedge, we decide whether the\n // pointer is inside the wedge.\n for (let i = 0; i < itemAngles.length; i++) {\n let wedgeStart = itemAngles[i];\n let wedgeEnd = itemAngles[(i + 1) % itemAngles.length];\n\n // Wrap around.\n if (wedgeEnd < wedgeStart) {\n wedgeEnd += 360;\n }\n\n // Angular width of the wedge.\n const diff = wedgeEnd - wedgeStart;\n\n // The drop zone wedges are considered to directly start at one item\n // and end at the next one. If however, there is a custom menu at\n // one side of the wedge, we at some padding to allow dropping into\n // the custom menu.\n let wedgeStartPadding = 0;\n let wedgeEndPadding = 0;\n\n if (this._items[i].getConfig().type == 'CustomMenu') {\n wedgeStartPadding = 0.25;\n }\n\n if (this._items[(i + 1) % itemAngles.length].getConfig().type ==\n 'CustomMenu') {\n wedgeEndPadding = 0.25;\n }\n\n // The last wedge has to be handled in a special manner as it allows\n // dropping at index zero.\n const lastWedge = i == itemAngles.length - 1 ||\n (i == itemAngles.length - 2 &&\n this._dragIndex == itemAngles.length - 1);\n\n // The last wedge is basically split in the middle - if dropped in\n // the clockwise side, we will drop at index zero, if dropped in the\n // counter-clockwise side, we will drop after the last element.\n if (lastWedge &&\n ((mouseAngle >= wedgeStart + diff * 0.5 &&\n mouseAngle < wedgeEnd - diff * wedgeEndPadding) ||\n (mouseAngle + 360 >= wedgeStart + diff * 0.5 &&\n mouseAngle + 360 < wedgeEnd - diff * wedgeEndPadding))) {\n\n this._dropIndex = 0;\n break;\n\n } else if (\n (mouseAngle >= wedgeStart + diff * wedgeStartPadding &&\n mouseAngle < wedgeEnd - diff * wedgeEndPadding) ||\n (mouseAngle + 360 >= wedgeStart + diff * wedgeStartPadding &&\n mouseAngle + 360 < wedgeEnd - diff * wedgeEndPadding)) {\n\n // In all other cases we simply drop after the current wedge.\n this._dropIndex = i + 1;\n break;\n }\n }\n }\n }\n }\n\n // We need to reposition all items with a smooth animation if any of the\n // below items changed during this callback.\n if (this._dropColumn != lastDropColumn || this._dropRow != lastDropRow ||\n this._dropIndex != lastDropIndex) {\n this._restartAnimation = true;\n }\n\n this.queue_allocate();\n };\n\n // When the pointer leaves the widget, we reset the _drop* members and update\n // the item layout.\n const dragLeave = () => {\n // For external drag-and-drop events, 'leave' is called before 'drop'. We\n // have to reset this._dropIndex in 'leave', to make sure that the items\n // move back to their original position when the pointer leaves the drop\n // area. However, we need this._dropIndex in 'drop' to fire the 'add-item'\n // and 'add-data' signals. Therefore, we temporarily store this._dropIndex\n // in this._lastDropIndex. This is only used a few lines below in the 'drop'\n // signal handler.\n this._lastDropIndex = this._dropIndex;\n\n this._dropColumn = null;\n this._dropRow = null;\n this._dropIndex = null;\n this.updateLayout();\n };\n\n // When an internal item or external data is dropped, either the 'drop-item'\n // or 'drop-data' signals are emitted. There are several cases where this may\n // fail; usually the 'notification' signal will be emitted to notify the user\n // about the reason.\n const dragDrop = (value, internalDrag, containsUris) => {\n // See documentation of the 'leave' signal above.\n if (this._dropIndex == null) {\n this._dropIndex = this._lastDropIndex;\n }\n\n // This shouldn't happen.\n if (this._dropIndex == null) {\n return false;\n }\n\n // For internal drop events, the dropped data is a JSON representation of\n // the dropped item.\n if (internalDrag) {\n\n const config = JSON.parse(value);\n\n // Do not allow top-level drops of actions.\n if (this._inMenuOverviewMode() &&\n ItemRegistry.getItemTypes()[config.type].class != ItemClass.MENU) {\n\n this.emit(\n // Translators: This is shown as an in-app notification when the\n // user attempts to drag an action in the menu editor to the menu\n // overview.\n 'notification', _('Actions cannot be turned into toplevel menus.'));\n\n this._dropColumn = null;\n this._dropRow = null;\n this._dropIndex = null;\n return false;\n }\n\n this.emit('drop-item', value, this._dropIndex);\n\n } else {\n\n // Do not allow external drops in menu overview mode.\n if (this._inMenuOverviewMode()) {\n\n this.emit(\n 'notification',\n // Translators: This is shown as an in-app notification when the\n // user attempts to drag external stuff to the menu editor's\n // overview.\n _('You can only create new Action items inside of Custom Menus.'));\n\n this._dropColumn = null;\n this._dropRow = null;\n this._dropIndex = null;\n return false;\n }\n\n // If the dropped data contains a list of URIs, call the 'drop-data' once\n // for each item.\n if (containsUris) {\n value.split(/\\r?\\n/).forEach((line, i) => {\n if (line != '') {\n this.emit('drop-data', line, this._dropIndex + i);\n }\n });\n } else {\n this.emit('drop-data', value, this._dropIndex);\n }\n }\n\n // Reset all _drop* members. We do not need to trigger a re-layout as this\n // will be done in the resulting add() call.\n this._dropColumn = null;\n this._dropRow = null;\n this._dropIndex = null;\n\n return true;\n };\n\n if (utils.gtk4()) {\n this._dropTarget =\n new Gtk.DropTarget({actions: Gdk.DragAction.MOVE | Gdk.DragAction.COPY});\n\n // We accept strings: Menu items are represented with a JSON representation\n // (the same format which is used for saving Fly-Pie's settings). External\n // drops usually are URIs.\n this._dropTarget.set_gtypes([GObject.TYPE_STRING]);\n\n // We accept everything :)\n this._dropTarget.connect('accept', () => true);\n\n this._dropTarget.connect('motion', (t, x, y) => {\n dragMotion(x, y);\n\n // Return null if the drop at the current position is not possible.\n return this._dropIndex == null ? null : Gdk.DragAction.MOVE;\n });\n\n\n this._dropTarget.connect('leave', dragLeave);\n\n this._dropTarget.connect('drop', (t, what) => {\n const internalDrag = t.get_drop().get_drag() != null;\n const containsUris =\n t.get_drop().formats.contain_mime_type('text/uri-list');\n return dragDrop(what, internalDrag, containsUris);\n });\n\n this.add_controller(this._dropTarget);\n } else {\n\n this.drag_dest_set(\n 0, this._dndTargets, Gdk.DragAction.MOVE | Gdk.DragAction.COPY);\n this.drag_dest_set_track_motion(true);\n this.connect('drag-leave', () => {\n dragLeave();\n this.drag_unhighlight();\n });\n this.connect('drag-data-received', (w, context, x, y, data, i, time) => {\n // These numbers refer to the number in this._dndTargets.\n const internalDrag = i == 0;\n const containsUris = i == 1;\n const success = dragDrop(\n ByteArray.toString(data.get_data()), internalDrag, containsUris);\n Gtk.drag_finish(\n context, success, context.get_selected_action() == Gdk.DragAction.MOVE,\n time);\n });\n\n this.connect('drag-drop', (w, context, x, y, time) => {\n const availableTargets = context.list_targets();\n\n for (let i = 0; i < this._dndTargets.length; i++) {\n if (availableTargets.includes(this._dndTargets[i].target)) {\n this.drag_get_data(context, this._dndTargets[i].target, time);\n return;\n }\n }\n\n this.drag_get_data(context, 'text/plain', time);\n });\n\n this.connect('drag-motion', (w, context, x, y, time) => {\n dragMotion(x, y);\n\n // Return false if the drop at the current position is not possible.\n if (this._dropIndex == null) {\n return false;\n }\n\n this.drag_highlight();\n\n // Make sure to choose the copy action if Ctrl is held down.\n const pointer = Gdk.Display.get_default().get_default_seat().get_pointer();\n const mods = w.get_window().get_device_position(pointer)[3];\n\n if (mods & Gdk.ModifierType.CONTROL_MASK) {\n Gdk.drag_status(context, Gdk.DragAction.COPY, time);\n } else {\n Gdk.drag_status(context, Gdk.DragAction.MOVE, time);\n }\n\n return true;\n });\n }\n }\n }", "title": "" }, { "docid": "58f9dac9434a7d0afce90a7bc1f63ecf", "score": "0.5525186", "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.5525186", "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.5525186", "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.5525186", "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": "bcfbf9997da36e08a0653e7e1405f096", "score": "0.55247486", "text": "render() {\n let screenname = 'Shopping Lists';\n if (this.state.view === 'items') screenname = this.state.shoppingList.title;\n return (\n <div className=\"App\">\n <nav>\n <div className=\"nav-wrapper\">\n <div className=\"brand-logo left\">\n {this.renderBackButton()}\n <span onClick={this.displayLists}>{screenname}</span>\n </div>\n <div className=\"right\">\n <a className=\"btn-floating pink lighten-2\" style={{'margin-right':'8px'}}\n onClick={this.displayAddingUI}>\n <i className=\"material-icons\" style={{'line-height':'unset'}}>add</i>\n </a>\n </div>\n </div>\n </nav>\n <div className=\"listsanditems container\" style={{margin:'8px',backgroundColor:'white'}}>\n {this.state.adding ? this.renderNewNameUI() : <span/>}\n {this.state.view === 'lists' ? this.renderShoppingLists() : this.renderShoppingListItems()}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "53ad0b9acc794cbfd7e331f44d277559", "score": "0.55245775", "text": "function MenuBar() {\n const {user, logout} = useContext(AuthenticationContext);\n const pathname = window.location.pathname;\n\n const path = pathname === '/' ? 'home' : pathname.substr(1);\n const [activeItem, setActiveItem] = useState(path);\n\n const handleItemClick = (e, {name}) => setActiveItem(name);\n\n // Renders the menu bar and saves it a variable\n const menuBar = user ? (\n <Menu pointing secondary size=\"massive\" color=\"teal\">\n <Menu.Item name={user.username} active as={Link} to=\"/\"/>\n\n <Menu.Menu position=\"right\">\n <Menu.Item\n name={user.cartItems !== undefined ? user.cartItems !== null ? user.cartItems.length < 1 ? \"Cart (Empty)\" : user.cartItems.length > 1 ? \"Cart (\" + user.cartItems.length + \" Items)\" : \"Cart (\" + user.cartItems.length + \" Item)\" : \"Cart\" : \"Cart\"}\n onClick={handleItemClick}\n as={Link}\n to=\"/cart\"\n />\n <Menu.Item name=\"logout\" onClick={logout}/>\n </Menu.Menu>\n </Menu>\n ) : (\n <Menu pointing secondary size=\"massive\" color=\"teal\">\n <Menu.Item\n name=\"home\"\n active={activeItem === 'home'}\n onClick={handleItemClick}\n as={Link}\n to=\"/\"\n />\n\n <Menu.Menu position=\"right\">\n <Menu.Item\n name=\"login\"\n active={activeItem === 'login'}\n onClick={handleItemClick}\n as={Link}\n to=\"/login\"\n />\n <Menu.Item\n name=\"register\"\n active={activeItem === 'register'}\n onClick={handleItemClick}\n as={Link}\n to=\"/register\"\n />\n </Menu.Menu>\n </Menu>\n );\n\n return menuBar;\n}", "title": "" }, { "docid": "23ae802992a8882c14569d0924dec990", "score": "0.55244607", "text": "function onOpen(){\n createMenu()\n}", "title": "" }, { "docid": "152e1e43cacfe9312e272cb0b195a695", "score": "0.5521326", "text": "getMenuItems() {\n let id = 0; // Key id of each child\n let btnid = 0; // Button id for changing page\n const menuitems = []; // Div storer\n\n // Create default menuitems\n menuitems.push(<div css={styleMenuTitle} className=\"sticky\" key={id++}>\n <b>FocusKit</b>\n </div>);\n\n menuitems.push(<MenuButton\n page={this.props.page}\n onClick={this.props.onClick}\n icon=\"img/menu/home.png\"\n name=\"Home\"\n id={btnid++}\n key={id++}\n />);\n\n menuitems.push(<MenuButton\n page={this.props.page}\n onClick={this.props.onClick}\n icon=\"img/menu/mail.png\"\n name=\"Email\"\n id={btnid++}\n key={id++}\n />);\n\n menuitems.push(<MenuButton\n page={this.props.page}\n onClick={this.props.onClick}\n icon=\"img/menu/calendar.png\"\n name=\"Calendar\"\n id={btnid++}\n key={id++}\n />);\n\t\n\tmenuitems.push(<MenuButton\n page={this.props.page}\n onClick={this.props.onClick}\n icon=\"img/menu/spotify.png\"\n name=\"Spotify\"\n id={btnid++}\n key={id++}\n />);\n\t\n\tmenuitems.push(<MenuButton\n page={this.props.page}\n onClick={this.props.onClick}\n icon=\"img/menu/notes.png\"\n name=\"Writing\"\n id={btnid++}\n key={id++}\n />);\n\t\n menuitems.push(<hr key={id++} />);\n\t// Get the categories from data\n let catid = 0;\n categories.forEach((category) => {\n menuitems.push(<MenuCategory\n page={this.props.page}\n onClick={this.props.onClick}\n name={category}\n id={catid++}\n key={id++}\n />,\n );\n });\n\t\n return menuitems;\n }", "title": "" }, { "docid": "571a010751f7d4c8ec786700f26f89a5", "score": "0.55146945", "text": "function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}", "title": "" }, { "docid": "571a010751f7d4c8ec786700f26f89a5", "score": "0.55146945", "text": "function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}", "title": "" }, { "docid": "e482c87514ea9dee921e9ee67067da44", "score": "0.55101347", "text": "function showMenu({title = 'Untitled', width = 200, height = 100, items = []}) {\n // title, items – taken from options,\n // width, height – defaults used\n console.log(`${title} ${width} ${height}`); // My Menu 200 100\n console.log(items); // Item1, Item2\n}", "title": "" }, { "docid": "c6dc69984ac59e5b054b7e119747daed", "score": "0.55091053", "text": "function Menu(props) {\n\n // for redux state updates\n // this allows the \"add to cart\" functionality work\n // basically, if the button \"add to cart\" is pressed, the\n // dispatch will update the store to reflect that the\n // item was added.\n const dispatch = useDispatch()\n\n // sets the menu items to \"state\" so they can easily be accessed\n const items = useSelector(items => items.items)\n\n const [state, setState] = useState({activeIndex: 0})\n\n function handleClick(e, titleProps) {\n const {index} = titleProps\n const {activeIndex} = state\n const newIndex = activeIndex === index ? -1 : index\n setState({ activeIndex: newIndex })\n }\n\n const { activeIndex } = state\n\n // UI that is returned to the browser\n return (\n \n\n // The styling must be wrapped in a \"div\" element\n <div>\n \n <div>\n <div className=\"ui hidden divider\" />\n <div className=\"ui hidden divider\" />\n <div className=\"ui hidden divider\" />\n \n </div>\n <Header as=\"h1\" size=\"large\" className=\"ui center aligned header menu-header\">\n Order Today!\n </Header>\n <Accordion fluid styled>\n <Accordion.Title \n active={activeIndex === 0}\n content=\"Loaded Teas\"\n className=\"menu-title\"\n index={0}\n onClick={handleClick}\n />\n <Accordion.Content\n active={activeIndex===0}\n content={(\n <div>\n \n {/* Subsection for loaded tea items */}\n \n {/* Subheader description for teas */}\n <h3 className=\"ui center aligned header\">\n 200mg caffeine, 4 carbs, 24 calories, 0 sugar\n </h3>\n <h3 className=\"ui center aligned header\">\n Energy, Hunger Control, Mental Focus, Vitamins A, B, C, & E,\n Calorie Burner, Immunity Booster\n </h3>\n \n {/* displays tea items, fetches the array and filters it to only include teas*/}\n <div className=\"ui centered cards\">\n <Card.Group itemsPerRow={6} stackable centered>\n {items && items.filter(item => item.category === \"tea\").map((item, i) => (\n \n /* for each item, creates a card using the MenuCard.js component */\n /* card contains the name, description, and the price */\n <MenuCard key={i} name={item.item_name} description={item.description} price={item.price}\n \n /* if the \"Add To Cart\" button is pressed, the cart is updated.\n The dispatcher sends the \"ADD\" action to the event handler\n This also sends the item id, which allows the event handler to \n add the item name, description and price as an item to the cart. */\n handleAdd={() => dispatch({ type: ADD_TO_CART, id: item.id })} />\n ))}\n </Card.Group>\n </div>\n </div>\n )} />\n\n \n <Accordion.Title\n active={activeIndex === 1}\n content=\"Shakes\"\n className=\"menu-title\"\n index={1}\n onClick={handleClick}\n />\n <Accordion.Content\n active={activeIndex === 1}\n content={(\n <div>\n {/* Subsection for Meal Replacements, same as teas */}\n\n\n {/* Subheader */}\n <h3 className=\"ui center aligned header\">\n 24-27 grams of protein, 5-10 grams of sugar,\n 10-14 net carbs, 200-250 calories\n </h3>\n\n {/* Menu Item card display */}\n <div className=\"ui centered cards\">\n <Card.Group itemsPerRow={6} stackable centered>\n {items && items.filter(item => item.category === \"shake\").map((item, i) => (\n <MenuCard key={i} name={item.item_name} description={item.description} price={item.price} \n /* if the \"Add To Cart\" button is pressed, the cart is updated.\n The dispatcher sends the \"ADD\" action to the event handler\n This also sends the item id, which allows the event handler to \n add the item name, description and price as an item to the cart. */\n handleAdd={() => {\n dispatch({ type: ADD_TO_CART, id: item.id });\n }} />\n ))}\n </Card.Group>\n </div> \n </div>\n )} />\n <Accordion.Title\n active={activeIndex === 2}\n content=\"Beauty\"\n className=\"menu-title\"\n index={2}\n onClick={handleClick}\n />\n <Accordion.Content\n active={activeIndex === 2}\n content={(\n <div>\n {/* Subsection for Beauty Line */}\n\n\n {/* Subheaders */}\n <h3 className=\"ui center aligned header\">\n 115mg caffeine, 4 carbs, 45 calories, 0 sugar\n </h3>\n <h3 className=\"ui center aligned header\">\n Energy, Hunger Control, Mental Cocus, Calorie Burner,\n Immunity Booster, Biotin/Collagen, Vitamins A, B, C, & E\n </h3>\n\n {/* Displays the subsection Menu Item cards */}\n <div className=\"ui centered cards\">\n <Card.Group itemsPerRow={6} stackable centered>\n {items && items.filter(item => item.category === \"beauty\").map((item, i) => (\n <MenuCard key={i} name={item.item_name} description={item.description} price={item.price}\n handleAdd={() => dispatch({ type: ADD_TO_CART, id: item.id })} />\n ))}\n </Card.Group>\n </div> \n </div> )} />\n\n \n <Accordion.Title\n active={activeIndex === 3}\n content=\"Specialty\"\n className=\"menu-title\"\n index={3}\n onClick={handleClick}\n />\n <Accordion.Content\n active={activeIndex===3}\n content={(\n <div>\n {/* Subsection for specialty Menu Items */}\n\n\n {/* Subheaders */}\n <h3 className=\"ui center aligned header\">\n 115mg caffeine (1/2 caff), 200 mg caffeine (full caff),\n 9 carbs, 105 calories, 0 sugar\n </h3>\n <h3 className=\"ui center aligned header\">\n Energy, Hunger Control, Mental Focus, Calorie Burner,\n Biotin/Collagen, Vitamins A, B, C, & E, 17 grams of Protein\n </h3>\n\n {/* Subsection Item Card Display */}\n <div className=\"ui centered cards\">\n <Card.Group itemsPerRow={6} stackable centered>\n {items && items.filter(item => item.category === \"specialty\").map((item, i) => (\n <MenuCard key={i} name={item.item_name} description={item.description} price={item.price}\n handleAdd={() => dispatch({ type: ADD_TO_CART, id: item.id })} />\n ))}\n </Card.Group>\n </div>\n </div>\n )} \n />\n\n <Accordion.Title\n active={activeIndex === 4}\n content=\"Donut Holes\"\n className=\"menu-title\"\n index={4}\n onClick={handleClick}\n />\n <Accordion.Content\n active={activeIndex === 4}\n content={(\n <div>\n {/* Subsection for specialty Donut Holes */}\n\n {/* Subheaders */}\n <h3 className=\"ui center aligned header\">\n Fat Burner and Hunger Control\n </h3>\n\n {/* Subsection Item Card Display */}\n <div className=\"ui centered\">\n <Card.Group itemsPerRow={6} stackable centered>\n {items && items.filter(item => item.category === \"donut\").map((item, i) => (\n <MenuCard key={i} name={item.item_name} description={item.description} price={item.price}\n handleclick={() => dispatch({ type: ADD_TO_CART, id: item.id })} />\n ))}\n </Card.Group>\n </div>\n </div>\n )} \n />\n\n \n </Accordion>\n\n </div>\n\n )\n}", "title": "" }, { "docid": "a02918eb8b35cff10437ffe5f8042072", "score": "0.55073047", "text": "_itemsContainerMenuHandler(event) {\n const that = this,\n menu = that.$.menu,\n layoutRect = that.getBoundingClientRect(),\n menuButtonRect = event.detail.button.getBoundingClientRect();\n\n menu.open(menuButtonRect.left - layoutRect.left, menuButtonRect.top - layoutRect.top);\n that._menuOpenButton = event.detail.button;\n }", "title": "" }, { "docid": "6ec3effbcc5ec6d7197d08a09d73bccc", "score": "0.5505037", "text": "renderMenu(title, i){\n return(\n <MenuItem \n key={i} \n eventKey={i}\n id = {`${title}-${i}`}\n onClick = {()=>this.loadSectionBox(title)}\n >\n {title}\n </MenuItem>);\n }", "title": "" } ]
c28eb24fbfcecf408bfe94a90e9203ee
Returns a new m= line with the specified codec as the first one.
[ { "docid": "965627fc0ffc109712ee5196a28fad6e", "score": "0.68427235", "text": "function setDefaultCodec(mLine, payload) {\n const elements = mLine.split(' ');\n\n // Just copy the first three parameters; codec order starts on fourth.\n const newLine = elements.slice(0, 3);\n\n // Put target payload first and copy in the rest.\n newLine.push(payload);\n for (let i = 3; i < elements.length; i++) {\n if (elements[i] !== payload) {\n newLine.push(elements[i]);\n }\n }\n return newLine.join(' ');\n}", "title": "" } ]
[ { "docid": "64e2d0314813276f6da09d0dcc02256e", "score": "0.71943486", "text": "function setMLineDefaultCodec(mLine, codecId) {\n var elements = mLine.split(' ');\n\n // Copy first three elements, codec order starts on fourth.\n var newLine = elements.slice(0, 3);\n\n // Put target |codecId| first and copy the rest.\n newLine.push(codecId);\n for (var i = 3; i < elements.length; i++) {\n if (elements[i] != codecId)\n newLine.push(elements[i]);\n }\n\n return newLine.join(' ');\n}", "title": "" }, { "docid": "f25b03ee219115dd92a02c3db5c66475", "score": "0.69548976", "text": "function setDefaultCodec(mLine, payload) {\n var elements = mLine.split(' ');\n var newLine = new Array();\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n if (elements[i] !== payload)\n newLine[index++] = elements[i];\n }\n return newLine.join(' ');\n }", "title": "" }, { "docid": "f06a8062f0be9b465c3d7580fe8d36d2", "score": "0.6914343", "text": "function setDefaultCodec(mLine, payload) {\n var elements = mLine.split(' ');\n\n // Just copy the first three parameters; codec order starts on fourth.\n var newLine = elements.slice(0, 3);\n\n // Put target payload first and copy in the rest.\n newLine.push(payload);\n for (var i = 3; i < elements.length; i++) {\n if (elements[i] !== payload) {\n newLine.push(elements[i]);\n }\n }\n return newLine.join(' ');\n }", "title": "" }, { "docid": "c19f4ebeb0f6871342c14d824713c158", "score": "0.6884422", "text": "function setDefaultCodec(mLine, payload) {\n \n var elements = mLine.split(' ');\n var newLine = [];\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) { // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n }\n if (elements[i] !== payload) {\n newLine[index++] = elements[i];\n }\n }\n return newLine.join(' ');\n}", "title": "" }, { "docid": "6e141efe8e87e9e6374a1f055ba6155f", "score": "0.68759686", "text": "function setDefaultCodec(mLine, payload) {\n var elements = mLine.split(' ');\n var newLine = [];\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) {\n // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n }\n if (elements[i] !== payload) {\n newLine[index++] = elements[i];\n }\n }\n return newLine.join(' ');\n }", "title": "" }, { "docid": "8ec4b0a1d029a5151ad553b9a7b75738", "score": "0.68747616", "text": "function setDefaultCodec(mLine, payload) {\r\n var elements = mLine.split(' ');\r\n var newLine = new Array();\r\n var index = 0;\r\n for (var i = 0; i < elements.length; i++) {\r\n if (index === 3) // Format of media starts from the fourth.\r\n newLine[index++] = payload; // Put target payload to the first.\r\n if (elements[i] !== payload)\r\n newLine[index++] = elements[i];\r\n }\r\n return newLine.join(' ');\r\n }", "title": "" }, { "docid": "cbdcb2296258440c45fdb5c1531025cd", "score": "0.6866189", "text": "function setDefaultCodec(mLine, payload) {\n var elements = mLine.split(' ');\n var newLine = [];\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) { // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n }\n if (elements[i] !== payload) {\n newLine[index++] = elements[i];\n }\n }\n return newLine.join(' ');\n}", "title": "" }, { "docid": "cbdcb2296258440c45fdb5c1531025cd", "score": "0.6866189", "text": "function setDefaultCodec(mLine, payload) {\n var elements = mLine.split(' ');\n var newLine = [];\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) { // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n }\n if (elements[i] !== payload) {\n newLine[index++] = elements[i];\n }\n }\n return newLine.join(' ');\n}", "title": "" }, { "docid": "cbdcb2296258440c45fdb5c1531025cd", "score": "0.6866189", "text": "function setDefaultCodec(mLine, payload) {\n var elements = mLine.split(' ');\n var newLine = [];\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) { // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n }\n if (elements[i] !== payload) {\n newLine[index++] = elements[i];\n }\n }\n return newLine.join(' ');\n}", "title": "" }, { "docid": "189c1dc57864077c184d4e7000622d25", "score": "0.68507344", "text": "function setDefaultCodec (mLine, payload) {\n var elements = mLine.split (' ');\n var newLine = [];\n var index = 0;\n for (var i = 0; i < elements.length; i++) {\n if (index === 3) { // Format of media starts from the fourth.\n newLine[index++] = payload; // Put target payload to the first.\n }\n if (elements[i] !== payload) {\n newLine[index++] = elements[i];\n }\n }\n return newLine.join (' ');\n}", "title": "" }, { "docid": "2d73c29969352c586f9999b195ca0a92", "score": "0.5954484", "text": "function getMLineDefaultCodec(mLine) {\n var elements = mLine.split(' ');\n if (elements.length < 4)\n return null;\n return parseInt(elements[3]);\n}", "title": "" }, { "docid": "935e8fc26a3cde8639ae7e70d0ab12b2", "score": "0.59302664", "text": "function setCodecOrder(mLine, payloads) {\n const elements = mLine.split(' ');\n\n // Just copy the first three parameters; codec order starts on fourth.\n let newLine = elements.slice(0, 3);\n\n // Concat payload types.\n newLine = newLine.concat(payloads);\n\n return newLine.join(' ');\n}", "title": "" }, { "docid": "fe26cdc680d64d31e6342dec24c5f057", "score": "0.52260584", "text": "function setCodecParam(sdp, codec, param, value, mid) {\n let sdpLines = sdp.split('\\r\\n');\n let headLines = null;\n let tailLines = null;\n if (typeof mid === 'string') {\n const midRange = findMLineRangeWithMID(sdpLines, mid);\n if (midRange) {\n const { start, end } = midRange;\n headLines = sdpLines.slice(0, start);\n tailLines = sdpLines.slice(end);\n sdpLines = sdpLines.slice(start, end);\n }\n }\n\n // SDPs sent from MCU use \\n as line break.\n if (sdpLines.length <= 1) {\n sdpLines = sdp.split('\\n');\n }\n\n const fmtpLineIndex = findFmtpLine(sdpLines, codec);\n\n let fmtpObj = {};\n if (fmtpLineIndex === null) {\n const index = findLine(sdpLines, 'a=rtpmap', codec);\n if (index === null) {\n return sdp;\n }\n const payload = getCodecPayloadTypeFromLine(sdpLines[index]);\n fmtpObj.pt = payload.toString();\n fmtpObj.params = {};\n fmtpObj.params[param] = value;\n sdpLines.splice(index + 1, 0, writeFmtpLine(fmtpObj));\n } else {\n fmtpObj = parseFmtpLine(sdpLines[fmtpLineIndex]);\n fmtpObj.params[param] = value;\n sdpLines[fmtpLineIndex] = writeFmtpLine(fmtpObj);\n }\n\n if (headLines) {\n sdpLines = headLines.concat(sdpLines).concat(tailLines);\n }\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n}", "title": "" }, { "docid": "b770255d98ad0a700f19e96f3fcf7b08", "score": "0.5199221", "text": "function setCodecParam(sdp, codec, param, value) {\n var sdpLines = sdp.split('\\r\\n');\n\n var fmtpLineIndex = findFmtpLine(sdpLines, codec);\n\n var fmtpObj = {};\n if (fmtpLineIndex === null) {\n var index = findLine(sdpLines, 'a=rtpmap', codec);\n if (index === null) {\n return sdp;\n }\n var payload = getCodecPayloadTypeFromLine(sdpLines[index]);\n fmtpObj.pt = payload.toString();\n fmtpObj.params = {};\n fmtpObj.params[param] = value;\n sdpLines.splice(index + 1, 0, writeFmtpLine(fmtpObj));\n } else {\n fmtpObj = parseFmtpLine(sdpLines[fmtpLineIndex]);\n fmtpObj.params[param] = value;\n sdpLines[fmtpLineIndex] = writeFmtpLine(fmtpObj);\n }\n\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n }", "title": "" }, { "docid": "087ad299029fbcc144d47096a1887b71", "score": "0.50372326", "text": "function maybePreferCodec(sdp, type, dir, codec) {\n var str = type + ' ' + dir + ' codec';\n if (!codec) {\n trace('No preference on ' + str + '.');\n return sdp;\n }\n\n trace('Prefer ' + str + ': ' + codec);\n\n var sdpLines = sdp.split('\\r\\n');\n\n // Search for m line.\n var mLineIndex = findLine(sdpLines, 'm=', type);\n if (mLineIndex === null) {\n return sdp;\n }\n\n // If the codec is available, set it as the default in m line.\n var payload = getCodecPayloadType(sdpLines, codec);\n if (payload) {\n sdpLines[mLineIndex] = setDefaultCodec(sdpLines[mLineIndex], payload);\n }\n\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n }", "title": "" }, { "docid": "1923df3ca633f261cb25eff769ab46af", "score": "0.50164855", "text": "function maybeRemoveCodecFromSDP(sdp, codec) {\n var sdpLines = sdp.split('\\r\\n');\n\n //Look for video m line\n var mLineIndex = findLine(sdpLines, 'm=video');\n if (mLineIndex === null) {\n return sdp;\n } \n\n if (sdpLines[mLineIndex].search(codec) == -1) {\n return sdp;\n } \n\n //Remove codec from m=video line\n sdpLines[mLineIndex] = sdpLines[mLineIndex].replace(' '+codec, '');\n\n // Look for rtpmap attribute and remove it from sdp\n var rtpmapLine = findLine(sdpLines, 'a=rtpmap:' + codec);\n if (rtpmapLine)\n sdpLines.splice(rtpmapLine,1);\n\n //check for a=fmtp attributes for the codec and remove them from sdp\n var fmtpLine = findLine(sdpLines, 'a=fmtp:' + codec);\n if (fmtpLine) {\n sdpLines.splice(fmtpLine,1);\n } \n\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n }", "title": "" }, { "docid": "3097b4b5a134f3e449c6812a9a440aea", "score": "0.5016056", "text": "function getCodecPayloadType(sdpLines, codec) {\n var index = findLine(sdpLines, 'a=rtpmap', codec);\n return index ? getCodecPayloadTypeFromLine(sdpLines[index]) : null;\n }", "title": "" }, { "docid": "cdc8bc305321108e16c6063ec831219b", "score": "0.49997935", "text": "function getCodecPayloadTypeFromLine(sdpLine) {\n var pattern = new RegExp('a=rtpmap:(\\\\d+) [a-zA-Z0-9-]+\\\\/\\\\d+');\n var result = sdpLine.match(pattern);\n return (result && result.length === 2) ? result[1] : null;\n }", "title": "" }, { "docid": "66451ac69ea661fca693d9ef0d47a397", "score": "0.4990571", "text": "function removeCodecParam(sdp, codec, param) {\n var sdpLines = sdp.split('\\r\\n');\n\n var fmtpLineIndex = findFmtpLine(sdpLines, codec);\n if (fmtpLineIndex === null) {\n return sdp;\n }\n\n var map = parseFmtpLine(sdpLines[fmtpLineIndex]);\n delete map.params[param];\n\n var newLine = writeFmtpLine(map);\n if (newLine === null) {\n sdpLines.splice(fmtpLineIndex, 1);\n } else {\n sdpLines[fmtpLineIndex] = newLine;\n }\n\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n }", "title": "" }, { "docid": "5856218dea0bfce926713f730702d3d3", "score": "0.49563497", "text": "function getCodecPayloadType(sdpLines, codec) {\n const index = findLine(sdpLines, 'a=rtpmap', codec);\n return index ? getCodecPayloadTypeFromLine(sdpLines[index]) : null;\n}", "title": "" }, { "docid": "f00f44de8b319596d5d0958234766d6f", "score": "0.4931479", "text": "function maybePreferCodec(sdp, type, dir, codec) {\n const str = type + ' ' + dir + ' codec';\n if (!codec) {\n Logger.debug('No preference on ' + str + '.');\n return sdp;\n }\n\n Logger.debug('Prefer ' + str + ': ' + codec);\n\n const sdpLines = sdp.split('\\r\\n');\n\n // Search for m line.\n const mLineIndex = findLine(sdpLines, 'm=', type);\n if (mLineIndex === null) {\n return sdp;\n }\n\n // If the codec is available, set it as the default in m line.\n let payload = null;\n for (let i = 0; i < sdpLines.length; i++) {\n const index = findLineInRange(sdpLines, i, -1, 'a=rtpmap', codec);\n if (index !== null) {\n payload = getCodecPayloadTypeFromLine(sdpLines[index]);\n if (payload) {\n sdpLines[mLineIndex] = setDefaultCodec(sdpLines[mLineIndex], payload);\n }\n }\n }\n\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n}", "title": "" }, { "docid": "3e52bcc39339b5e6bf8fe0f86e35acfd", "score": "0.49118447", "text": "function getCodecPayloadTypeFromLine(sdpLine) {\n const pattern = new RegExp('a=rtpmap:(\\\\d+) [a-zA-Z0-9-]+\\\\/\\\\d+');\n const result = sdpLine.match(pattern);\n return (result && result.length === 2) ? result[1] : null;\n}", "title": "" }, { "docid": "ada6b3d98c6d3866fb6b97489e791f94", "score": "0.48352307", "text": "function removeCodecParam(sdp, codec, param) {\n const sdpLines = sdp.split('\\r\\n');\n\n const fmtpLineIndex = findFmtpLine(sdpLines, codec);\n if (fmtpLineIndex === null) {\n return sdp;\n }\n\n const map = parseFmtpLine(sdpLines[fmtpLineIndex]);\n delete map.params[param];\n\n const newLine = writeFmtpLine(map);\n if (newLine === null) {\n sdpLines.splice(fmtpLineIndex, 1);\n } else {\n sdpLines[fmtpLineIndex] = newLine;\n }\n\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n}", "title": "" }, { "docid": "ea0386a9e5b1f25ecb410cb6329a4fcf", "score": "0.47302574", "text": "set line(linep) {\n if (linep && linep.indexOf('~') !== -1) {\n // eslint-disable-next-line no-throw-literal\n throw '~ cannot be used in line of file commands. ~ is reserved for sed in the rpc-service';\n }\n this.line_base64 = window.btoa(unescape(encodeURIComponent(linep || '')));\n }", "title": "" }, { "docid": "2e2f09a890d924994f43f5327eae4189", "score": "0.46782598", "text": "clone() {\n const newLine = new BufferLine(0);\n newLine._data = new Uint32Array(this._data);\n newLine.length = this.length;\n for (const el in this._combined) {\n newLine._combined[el] = this._combined[el];\n }\n for (const el in this._extendedAttrs) {\n newLine._extendedAttrs[el] = this._extendedAttrs[el];\n }\n newLine.isWrapped = this.isWrapped;\n return newLine;\n }", "title": "" }, { "docid": "46af975a322b2c402e628b47104f50cf", "score": "0.46185684", "text": "function findFmtpLine(sdpLines, codec) {\n // Find payload of codec.\n var payload = getCodecPayloadType(sdpLines, codec);\n // Find the payload in fmtp line.\n return payload ? findLine(sdpLines, 'a=fmtp:' + payload.toString()) : null;\n }", "title": "" }, { "docid": "82614c4398d6fbfc3746c735e19a12bc", "score": "0.45607328", "text": "function removeVideoCodec(pSdp, codecToRemove) {\n var sdp = \"\", substr = \"\", descriptions = [], index, reg = /\\r\\n|\\r|\\n/m, video_arr, i, \n new_substr = \"\", elm, regExpCodec;\n\n descriptions = pSdp.split(/^(?=m=)/m);\n for (index = 0; index < descriptions.length; index++) {\n substr = descriptions[index];\n if (substr.indexOf(mLine + video) !== -1) {\n video_arr = substr.split(reg);\n for (i = 0; i < video_arr.length; i++) {\n elm = video_arr[i];\n if (elm && elm.indexOf(mLine + video) !== -1) {\n // remove given video codec from m=video line\n regExpCodec = new RegExp(\" \" + codecToRemove, \"g\");\n elm = elm.replace(regExpCodec, \"\");\n elm = elm + lf + nl;\n // Workaround for issue 1603.\n } else if (elm && elm.indexOf(\"a=fmtp:\" + codecToRemove) !== -1) {\n elm = elm.replace(/a=fmtp[\\w\\W]*/, \"\");\n } else if (elm && elm.indexOf(\"a=rtpmap:\" + codecToRemove) !== -1) {\n elm = elm.replace(/a=rtpmap[\\w\\W]*/, \"\");\n } else if (elm && elm.indexOf(\"a=rtcp-fb:\" + codecToRemove) !== -1) {\n elm = elm.replace(/a=rtcp-fb[\\w\\W]*/, \"\");\n } else if (elm && elm !== \"\") {\n elm = elm + lf + nl;\n }\n new_substr = new_substr + elm;\n }\n substr = new_substr;\n }\n sdp = sdp + substr;\n }\n return sdp;\n }", "title": "" }, { "docid": "be6a7d884f413393365a1df5db762397", "score": "0.45319656", "text": "function removeAudioCodec(pSdp, codecToRemove) {\n var sdp = \"\", substr = \"\", descriptions = [], index, reg = /\\r\\n|\\r|\\n/m, audio_arr, i, \n new_substr = \"\", elm, regExpCodec;\n\n descriptions = pSdp.split(/^(?=m=)/m);\n for (index = 0; index < descriptions.length; index++) {\n substr = descriptions[index];\n if (substr.indexOf(mLine + audio) !== -1) {\n audio_arr = substr.split(reg);\n for (i = 0; i < audio_arr.length; i++) {\n elm = audio_arr[i];\n if (elm && elm.indexOf(mLine + audio) !== -1) {\n // remove given audio codec from m=audio line\n regExpCodec = new RegExp(\" \" + codecToRemove, \"g\");\n elm = elm.replace(regExpCodec, \"\");\n elm = elm + lf + nl;\n // Workaround for issue 1603.\n } else if (elm && elm.indexOf(\"a=fmtp:\" + codecToRemove) !== -1) {\n elm = elm.replace(/a=fmtp[\\w\\W]*/, \"\");\n } else if (elm && elm.indexOf(\"a=rtpmap:\" + codecToRemove) !== -1) {\n elm = elm.replace(/a=rtpmap[\\w\\W]*/, \"\");\n } else if (elm && elm.indexOf(\"a=rtcp-fb:\" + codecToRemove) !== -1) {\n elm = elm.replace(/a=rtcp-fb[\\w\\W]*/, \"\");\n } else if (elm && elm !== \"\") {\n elm = elm + lf + nl;\n }\n new_substr = new_substr + elm;\n }\n substr = new_substr;\n }\n sdp = sdp + substr;\n }\n return sdp;\n }", "title": "" }, { "docid": "f538d2e07bef119adc61a36c85baaead", "score": "0.4515344", "text": "constructor (version, codec, multihash) {\n if (typeof version === 'string') {\n if (multibase.isEncoded(version)) { // CID String (encoded with multibase)\n const cid = multibase.decode(version)\n this.version = parseInt(cid.slice(0, 1).toString('hex'), 16)\n this.codec = multicodec.getCodec(cid.slice(1))\n this.multihash = multicodec.rmPrefix(cid.slice(1))\n } else { // bs58 string encoded multihash\n this.codec = 'dag-pb'\n this.multihash = mh.fromB58String(version)\n this.version = 0\n }\n } else if (Buffer.isBuffer(version)) {\n const firstByte = version.slice(0, 1)\n const v = parseInt(firstByte.toString('hex'), 16)\n if (v === 0 || v === 1) { // CID\n const cid = version\n this.version = v\n this.codec = multicodec.getCodec(cid.slice(1))\n this.multihash = multicodec.rmPrefix(cid.slice(1))\n } else { // multihash\n this.codec = 'dag-pb'\n this.multihash = version\n this.version = 0\n }\n } else if (typeof version === 'number') {\n if (typeof codec !== 'string') {\n throw new Error('codec must be string')\n }\n if (!(version === 0 || version === 1)) {\n throw new Error('version must be a number equal to 0 or 1')\n }\n mh.validate(multihash)\n this.codec = codec\n this.version = version\n this.multihash = multihash\n }\n }", "title": "" }, { "docid": "488aadaa534008bb88f88c7a59387afc", "score": "0.44611225", "text": "function setSdpDefaultCodec(sdp, type, codec, preferHwCodec, profile) {\n var sdpLines = splitSdpLines(sdp);\n\n // Find codec ID, e.g. 100 for 'VP8' if 'a=rtpmap:100 VP8/9000'.\n // TODO(magjed): We need a more stable order of the video codecs, e.g. that HW\n // codecs are always listed before SW codecs.\n var useLastInstance = !preferHwCodec;\n var codecId = findRtpmapId(sdpLines, codec, useLastInstance, profile);\n if (codecId === null) {\n throw new MethodError(\n 'setSdpDefaultCodec',\n 'Unknown ID for |codec| = \\'' + codec + '\\' and |profile| = \\'' +\n profile + '\\'.');\n }\n\n // Find 'm=|type|' line, e.g. 'm=video 9 UDP/TLS/RTP/SAVPF 100 101 107 116'.\n var mLineNo = findLine(sdpLines, 'm=' + type);\n if (mLineNo === null) {\n throw new MethodError('setSdpDefaultCodec',\n '\\'m=' + type + '\\' line missing from |sdp|.');\n }\n\n // Modify video line to use the desired codec as the default.\n sdpLines[mLineNo] = setMLineDefaultCodec(sdpLines[mLineNo], codecId);\n return mergeSdpLines(sdpLines);\n}", "title": "" }, { "docid": "11509cd1af884bc72049ecc1b459daea", "score": "0.44602636", "text": "function removeCodecFramALine(sdpLines, payload) {\n const pattern = new RegExp('a=(rtpmap|rtcp-fb|fmtp):'+payload+'\\\\s');\n for (let i=sdpLines.length-1; i>0; i--) {\n if (sdpLines[i].match(pattern)) {\n sdpLines.splice(i, 1);\n }\n }\n return sdpLines;\n}", "title": "" }, { "docid": "698c9ec195bebe372694352ccfe467d6", "score": "0.44569278", "text": "function findRtpmapCodec(sdpLines, id) {\n var lineNo = findRtpmapLine(sdpLines, id);\n if (lineNo === null)\n return null;\n // Parse <codec> from 'a=rtpmap:<id> <codec>/<rate>'.\n var from = sdpLines[lineNo].indexOf(' ');\n var to = sdpLines[lineNo].indexOf('/', from);\n if (from === null || to === null || from + 1 >= to)\n throw new MethodError('findRtpmapCodec', '');\n return sdpLines[lineNo].substring(from + 1, to);\n}", "title": "" }, { "docid": "2e23a9d9d2f4f5069343bee923be79b8", "score": "0.44436672", "text": "function addLine(self, to, packet)\n{\n // if we've sent an open and have a line, just use that\n if(to.openSent && to.line) return packet.js.line = to.line;\n\n // make sure to send a signed open\n to.openSent = true;\n if(!to.open) addOpen(self, to);\n packet.js.open = to.open;\n packet.sign = true;\n}", "title": "" }, { "docid": "41728f6e9868072c5e79c557818039eb", "score": "0.4429064", "text": "setLine(line) { this.line = line; return this; }", "title": "" }, { "docid": "5897ea0fbdc603b0ae40160d8bf52b7f", "score": "0.44287047", "text": "function findFmtpLine(sdpLines, codec) {\n // Find payload of codec.\n const payload = getCodecPayloadType(sdpLines, codec);\n // Find the payload in fmtp line.\n return payload ? findLine(sdpLines, 'a=fmtp:' + payload.toString()) : null;\n}", "title": "" }, { "docid": "86b793ea3d601be2ac09ab60eb82fe40", "score": "0.44073626", "text": "function Codec(initialEncoding) {\n this.encodingName = undefined;\n this.setEncoding(initialEncoding);\n}", "title": "" }, { "docid": "fe7a93af64137e7d38d0f37c024f5c50", "score": "0.44054607", "text": "getLibrary(cb){\n\t\tmSubmitLine.call(this,\"save -e -l -\",true,(str)=>{\n\t\t\tconst lines=str.split(\"\\n\");\n\t\t\tconst tracks=[];\n\t\t\tlet track=null;\n\t\t\tfor(const line of lines){\n\t\t\t\tif(line.length==0)continue;\n\t\t\t\tconst idx=line.indexOf(\" \");\n\t\t\t\tif(idx==-1){\n\t\t\t\t\tthrow new Error(\"Unexpected line on 'save -l -' output from cmus-remote: '\"+line+\"'\");\n\t\t\t\t}\n\t\t\t\tconst head=line.slice(0,idx),rest=line.slice(idx+1);\n\t\t\t\tif(head==\"file\"){\n\t\t\t\t\tif(track)tracks.push(track);\n\t\t\t\t\ttrack={};\n\t\t\t\t\ttrack.file=rest;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(!track){\n\t\t\t\t\tthrow new Error(\"Expected 'file' key on output 'save -l -' from cmus-remote: '\"+line+\"'\");\n\t\t\t\t}\n\t\t\t\tif(head==\"duration\"||head==\"codec\"||head==\"bitrate\"){\n\t\t\t\t\ttrack[head]=rest;\n\t\t\t\t} else if(head==\"tag\"){\n\t\t\t\t\tconst idx=rest.indexOf(\" \");\n\t\t\t\t\tif(idx==-1){\n\t\t\t\t\t\tthrow new Error(\"Unexpected line on 'save -l -' output from cmus-remote: '\"+line+\"'\");\n\t\t\t\t\t}\n\t\t\t\t\tconst tag=rest.slice(0,idx),rest2=rest.slice(idx+1);\n\t\t\t\t\ttrack[tag]=rest2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(track)tracks.push(track);\n\t\t\tcb(tracks);\n\t\t});\n\t}", "title": "" }, { "docid": "7044a590e60b1ada7da455dfed8f1ba3", "score": "0.43517935", "text": "function addVP8Codec (pSdp, offerSdp) {\n var sdp = \"\", substr=\"\",descriptions=[],index, \n reg = /\\r\\n|\\r|\\n/m, video_arr, i, new_substr = \"\", \n vp8PayloadType, codecType, elm,\n videoUFRAGParam, videoPWDParam, ice_ufrag, ice_pwd;\n\n if(pSdp.indexOf(\"VP8/90000\") !== -1) {\n return pSdp; \n }\n \n descriptions= pSdp.split(/^(?=m=)/m);\n for(index=0;index<descriptions.length;index++){\n substr = descriptions[index];\n if(substr.indexOf(mLine + video) !== -1){\n if (offerSdp && \n offerSdp.indexOf(mLine + video) !== -1 &&\n offerSdp.indexOf(\"VP8/90000\") !== -1) {\n vp8PayloadType = getVP8PayloadType(offerSdp);\n if (substr.indexOf(\"a=rtpmap:\" + vp8PayloadType) !== -1) {\n removeSdpLineContainingText(substr,\"a=rtpmap:\" + vp8PayloadType);\n }\n } else {\n codecType = 100;\n while (substr.indexOf(\"a=rtpmap:\" + codecType) !== -1) {\n codecType = codecType + 1;\n }\n vp8PayloadType = codecType;\n }\n video_arr = substr.split(reg);\n for(i=0;i<video_arr.length;i++){\n elm = video_arr[i];\n if (elm && elm.indexOf(\"m=video\") !== -1) {\n if (elm.indexOf(vp8PayloadType) === -1) {\n elm = elm + \" \" + vp8PayloadType;\n }\n elm = elm + lf + nl + \"a=rtpmap:\" + vp8PayloadType + \" VP8/90000\" + lf + nl;\n } else if (elm && elm !== \"\") {\n elm = elm + lf + nl;\n }\n new_substr = new_substr + elm;\n }\n substr = new_substr;\n }\n sdp = sdp + substr;\n }\n\n videoUFRAGParam = checkICEParams(sdp, \"video\", ICEParams.ICE_UFRAG);\n\tif(videoUFRAGParam < 2){\n ice_ufrag = getICEParams(sdp, ICEParams.ICE_UFRAG, false);\n if (ice_ufrag) {\n sdp = restoreICEParams(sdp, \"video\", ICEParams.ICE_UFRAG, ice_ufrag);\n }\n\t}\n\tvideoPWDParam = checkICEParams(sdp, \"video\", ICEParams.ICE_PWD);\n\tif(videoPWDParam < 2){\n ice_pwd = getICEParams(sdp, ICEParams.ICE_PWD, false);\n if (ice_pwd) {\n sdp = restoreICEParams(sdp, \"video\", ICEParams.ICE_PWD, ice_pwd);\n }\n\t} \n\n return performVP8RTCPParameterWorkaround(sdp);\n }", "title": "" }, { "docid": "88edcff333c64bd7ce164299dde30533", "score": "0.43286255", "text": "function updateAudioCodec(pSdp) {\n var sdp = \"\", substr = \"\", descriptions = [], index, reg = /\\r\\n|\\r|\\n/m, audio_arr, i, new_substr = \"\", elm,\n remcodec, regExpCodec, codecsToRemove = [], j, remrtpmap;\n\n remrtpmap = \"\";\n descriptions = pSdp.split(/^(?=m=)/m);\n for (index = 0; index < descriptions.length; index++) {\n substr = descriptions[index];\n if (substr.indexOf(mLine + audio) !== -1) {\n audio_arr = substr.split(reg);\n for (i = 0; i < audio_arr.length; i++) {\n elm = audio_arr[i];\n if (elm && elm.indexOf(mLine + audio) !== -1) {\n // remove audio codecs given in config file from m=audio line\n codecsToRemove = fcsConfig.codecsToRemove;\n if (codecsToRemove !== undefined) {\n for (j = 0; j < codecsToRemove.length; j++) {\n remcodec = codecsToRemove[j];\n regExpCodec = new RegExp(\" \" + remcodec, \"g\");\n elm = elm.replace(regExpCodec, \"\");\n\n if (j !== 0) {\n remrtpmap = remrtpmap + \"|\";\n }\n remrtpmap = remrtpmap + remcodec;\n }\n }\n // remove opus due to dtmf support problem, this is not tied to configuration\n //elm = elm.replace(/ 111 /, \" \");\n elm = elm + lf + nl;\n // Workaround for issue 1603.\n } else if (elm && elm.indexOf(\"a=fmtp\") !== -1) {\n elm = elm.replace(/a=fmtp[\\w\\W]*/, \"\");\n } else if (elm && elm !== \"\") {\n elm = elm + lf + nl;\n }\n new_substr = new_substr + elm;\n }\n substr = new_substr;\n }\n sdp = sdp + substr;\n }\n // remove rtpmap of removed codecs\n if (remrtpmap !== \"\") {\n regExpCodec = new RegExp(\"a=rtpmap:(?:\" + remrtpmap + \").*\\r\\n\", \"g\");\n sdp = sdp.replace(regExpCodec, \"\");\n }\n return sdp;\n }", "title": "" }, { "docid": "1c51554b1183ffc2821929a288c88507", "score": "0.42547733", "text": "static initialize(obj, codec) { \n obj['codec'] = codec;\n }", "title": "" }, { "docid": "627d7d46443f8b47ace83c0c66a5829a", "score": "0.41886953", "text": "function preferBitRate(sdp, bitrate, mediaType) {\n var sdpLines = sdp.split('\\r\\n');\n\n // Find m line for the given mediaType.\n var mLineIndex = findLine(sdpLines, 'm=', mediaType);\n if (mLineIndex === null) {\n trace('Failed to add bandwidth line to sdp, as no m-line found');\n return sdp;\n }\n\n // Find next m-line if any.\n var nextMLineIndex = findLineInRange(sdpLines, mLineIndex + 1, -1, 'm=');\n if (nextMLineIndex === null) {\n nextMLineIndex = sdpLines.length;\n }\n\n // Find c-line corresponding to the m-line.\n var cLineIndex = findLineInRange(sdpLines, mLineIndex + 1,\n nextMLineIndex, 'c=');\n if (cLineIndex === null) {\n trace('Failed to add bandwidth line to sdp, as no c-line found');\n return sdp;\n }\n\n // Check if bandwidth line already exists between c-line and next m-line.\n var bLineIndex = findLineInRange(sdpLines, cLineIndex + 1,\n nextMLineIndex, 'b=AS');\n if (bLineIndex) {\n sdpLines.splice(bLineIndex, 1);\n }\n\n // Create the b (bandwidth) sdp line.\n var bwLine = 'b=AS:' + bitrate;\n // As per RFC 4566, the b line should follow after c-line.\n sdpLines.splice(cLineIndex + 1, 0, bwLine);\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n }", "title": "" }, { "docid": "df390953695275cb6929c0b897709693", "score": "0.4175861", "text": "setLine(line) {\n this.line = line;\n return this;\n }", "title": "" }, { "docid": "cffed641cfceb53cfa413db4496d4a98", "score": "0.41636273", "text": "function getSdpDefaultCodec(sdp, type) {\n var sdpLines = splitSdpLines(sdp);\n\n // Find 'm=|type|' line, e.g. 'm=video 9 UDP/TLS/RTP/SAVPF 100 101 107 116'.\n var mLineNo = findLine(sdpLines, 'm=' + type);\n if (mLineNo === null) {\n throw new MethodError('getSdpDefaultCodec',\n '\\'m=' + type + '\\' line missing from |sdp|.');\n }\n\n // The default codec's ID.\n var defaultCodecId = getMLineDefaultCodec(sdpLines[mLineNo]);\n if (defaultCodecId === null) {\n throw new MethodError('getSdpDefaultCodec',\n '\\'m=' + type + '\\' line contains no codecs.');\n }\n\n // Find codec name, e.g. 'VP8' for 100 if 'a=rtpmap:100 VP8/9000'.\n var defaultCodec = findRtpmapCodec(sdpLines, defaultCodecId);\n if (defaultCodec === null) {\n throw new MethodError('getSdpDefaultCodec',\n 'Unknown codec name for default codec ' + defaultCodecId + '.');\n }\n return defaultCodec;\n}", "title": "" }, { "docid": "713c5b5f85f65043adf89452b7b4322a", "score": "0.41413766", "text": "function addPlain(line) {\n var lineParts = [];\n var match;\n var index = 0;\n while (match = varPattern.exec(line.substr(index))) {\n var plain = line.substr(index, match.index);\n if (plain) lineParts.push(JSON.stringify(plain));\n lineParts.push('(' + match[1] + ')');\n index += match.index + match[0].length;\n }\n var plain = line.substr(index);\n if (plain) lineParts.push(JSON.stringify(plain));\n return 'chunks[' + parts.length + '] = (' + lineParts.join(\" + \") + ');';\n }", "title": "" }, { "docid": "4c54cbf1aa2f93b2a4dea60829e86a9f", "score": "0.41412625", "text": "constructor(msg, src, line, col) {\n let srcLines = src.split('\\n');\n let relevantLines = [line - 3, line - 2, line - 1, line]\n .filter(line => line > 0);\n let lines = relevantLines.map(line => `${line}: ${srcLines[line - 1]}`);\n let colLine = new Array(col + line.toString().length + 2).fill(' ');\n colLine[col + line.toString().length + 1] = '^';\n lines.splice(lines.length, 0, colLine.join(''));\n let message = `${msg} (line: ${line}, col: ${col})\\n\\n` + lines.join('\\n') + `\\n`;\n super(message);\n }", "title": "" }, { "docid": "6dda39da6671080c4e0bccbcec9b2c9b", "score": "0.4131967", "text": "function findFmtpLine(sdpLines, codecId) {\n return findLine(sdpLines, 'a=fmtp:' + codecId);\n\n}", "title": "" }, { "docid": "51b70ce6c2d46a57eefabe81d974a60a", "score": "0.41193423", "text": "function addCodeMirror(id) {\n\treturn CodeMirror.fromTextArea(document.getElementById(id), {\n\t\tmode: \"application/xml\",\n\t\ttabMode: \"indent\",\n\t\tstyleActiveLine: true,\n\t\tlineNumbers: true,\n\t\tlineWrapping: true,\n\t\tlineNumbers: true,\n\t});\n}", "title": "" }, { "docid": "d28c26f6cfdf9ec79e4493b3ec54532d", "score": "0.41032174", "text": "function createQualifier(logger, line) {\n logger.debug('qualifier=' + line);\n\n var MINIMUM_FIELDS_LENGTH = 4;\n var arr = line.split('^');\n if (arr.length !== MINIMUM_FIELDS_LENGTH) {\n throw new Error('The RPC returned data but the qualifier was missing elements: ' + line);\n }\n\n var qualifier = {\n ien: arr[1],\n name: arr[2],\n synonym: arr[3]\n };\n\n logger.debug({qualifier: qualifier});\n return qualifier;\n}", "title": "" }, { "docid": "b60b9fe8d43d70ea4ba204db64063fa1", "score": "0.40969655", "text": "constructor() {\n\t\tsuper();\n\t\tthis.lines.push('data:text/csv;charset=utf-8,');\n\t\tthis.lines.push('Timer;Current page;Current chap;Reached page;Reched chap;Action;Time from test begining;Time from page begining;Video timer;Time from chap begining;Time from PLAY;Curr slide Chap;Reached slide Chap;Time from chap slide begining');\n\t}", "title": "" }, { "docid": "d4ada5c667ef373241af32d87f9357b8", "score": "0.40667057", "text": "function preferBitRate(sdp, bitrate, mediaType) {\n const sdpLines = sdp.split('\\r\\n');\n\n // Find m line for the given mediaType.\n const mLineIndex = findLine(sdpLines, 'm=', mediaType);\n if (mLineIndex === null) {\n Logger.debug('Failed to add bandwidth line to sdp, as no m-line found');\n return sdp;\n }\n\n // Find next m-line if any.\n let nextMLineIndex = findLineInRange(sdpLines, mLineIndex + 1, -1, 'm=');\n if (nextMLineIndex === null) {\n nextMLineIndex = sdpLines.length;\n }\n\n // Find c-line corresponding to the m-line.\n const cLineIndex = findLineInRange(sdpLines, mLineIndex + 1,\n nextMLineIndex, 'c=');\n if (cLineIndex === null) {\n Logger.debug('Failed to add bandwidth line to sdp, as no c-line found');\n return sdp;\n }\n\n // Check if bandwidth line already exists between c-line and next m-line.\n const bLineIndex = findLineInRange(sdpLines, cLineIndex + 1,\n nextMLineIndex, 'b=AS');\n if (bLineIndex) {\n sdpLines.splice(bLineIndex, 1);\n }\n\n // Create the b (bandwidth) sdp line.\n const bwLine = 'b=AS:' + bitrate;\n // As per RFC 4566, the b line should follow after c-line.\n sdpLines.splice(cLineIndex + 1, 0, bwLine);\n sdp = sdpLines.join('\\r\\n');\n return sdp;\n}", "title": "" }, { "docid": "e9943feca943a84e10a83f3ee6db8bdb", "score": "0.4043256", "text": "newLineString(){\n\t\tthis.currentFeature = new Feature(this.assignId());\n\t}", "title": "" }, { "docid": "d714c4aa7e8f48e8c3af2cdf73ff8c31", "score": "0.40421736", "text": "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\t\t\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t\t if (line.styleClasses.textClass)\n\t\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t\t }\n\t\t\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\t\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\t\t\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\t }\n\t\t\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\t\n\t\t return builder;\n\t\t }", "title": "" }, { "docid": "bbf8d8d21b5efa3ea57053f16dfecfda", "score": "0.40344068", "text": "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built;\r\n }\r\n return buildLineContent(cm, lineView);\r\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "23435a6c75c284f1048b56b61d5d8fcb", "score": "0.40306577", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "title": "" }, { "docid": "ea671136e9dd1ff37a50ced5332d79cd", "score": "0.4023332", "text": "function addSoftLinebreaks(str, encoding){\n var lineLengthMax = 76;\n\n encoding = (encoding || \"base64\").toString().toLowerCase().trim();\n \n if(encoding == \"qp\"){\n return addQPSoftLinebreaks(str, lineLengthMax);\n }else{\n return addBase64SoftLinebreaks(str, lineLengthMax);\n }\n}", "title": "" }, { "docid": "e4dce15f6b8126ead4f99f60c0e7bb10", "score": "0.4021692", "text": "inlineInternalMatch (thisValue, _otherCodec) {\n return `${thisValue}`;\n }", "title": "" }, { "docid": "394b19fbb4579850a1ad2452cbe9edf8", "score": "0.40172848", "text": "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "title": "" }, { "docid": "d91917f8c8ab81e8c13f302d9f48a4fb", "score": "0.4015798", "text": "function yaml(c) {\n return c.pushWhitespaceInsignificantSingleLine().one(value);\n}", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "1fc31a1378a21f699509c37316b46cc6", "score": "0.40149853", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "title": "" }, { "docid": "bfa7fa9df39d642da60ce1543fe1e664", "score": "0.40102834", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" }, { "docid": "bfa7fa9df39d642da60ce1543fe1e664", "score": "0.40102834", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" }, { "docid": "c9e58b07c6b9f02a075025e8e8dd7d2f", "score": "0.40068084", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "title": "" }, { "docid": "a0ce7259e5d40e78d5540e80ef2950bd", "score": "0.4004644", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "57d914f3bb2b245552b29eaa90445930", "score": "0.40041152", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "title": "" }, { "docid": "ab5f90d5e449593d828f4f837efb8783", "score": "0.39982185", "text": "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: eltP(\"pre\", [content], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {}; // Iterate over the logical lines that make up this visual line.\n\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line,\n order = void 0;\n builder.pos = 0;\n builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) {\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n }\n\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) {\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n }\n\n if (line.styleClasses.textClass) {\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n } // Ensure at least a single node is present, for measuring.\n\n\n if (builder.map.length == 0) {\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n } // Store the map and a cache object for the current logical line\n\n\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n } // See issue #2901\n\n\n if (webkit) {\n var last = builder.content.lastChild;\n\n if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\n if (builder.pre.className) {\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n }\n\n return builder;\n }", "title": "" }, { "docid": "83313c12067cc9922cc56aa3a7a4a704", "score": "0.39964458", "text": "function getLineSpanExtractor(cm) {\r\n if (extractor_symbol in cm)\r\n { return cm[extractor_symbol]; }\r\n var inst = cm[extractor_symbol] = new LineSpanExtractor(cm);\r\n return inst;\r\n }", "title": "" }, { "docid": "edaf85c79a4507263520ab0c5b95f792", "score": "0.39928478", "text": "function MultiLine(str)\n{\n\tvar holder = str.toString().replace(\"function (){/*\",\"\").replace(\"*/}\",\"\").replace(\"function(){/*\",\"\");\n\treturn holder;\n\t\n}", "title": "" }, { "docid": "d025985c64041ab331f9c2aca154c713", "score": "0.39900118", "text": "constructor(line)\n {\n this.line = line;\n this.next = null;\n }", "title": "" }, { "docid": "20d817a39f19e05eab53458da606c1fe", "score": "0.39886177", "text": "static get multilinecomment(){return new comment('\\\\*[\\\\s\\\\S]*?\\\\*');}", "title": "" }, { "docid": "c728f3dc391850a224c9f191d9fc8e62", "score": "0.39796695", "text": "get protocol()\t{ return this.match[3] || \"\" }", "title": "" }, { "docid": "9c92ac8f0ea23d0bfe2a34f2d2fe6248", "score": "0.39785963", "text": "function newLine(className) {\n var line = new TerminalLine(className);\n return line;\n }", "title": "" }, { "docid": "d5cb290d37b1322b4254a5383b958120", "score": "0.39784256", "text": "function parser( mtl, options ){\n\n\tvar lines = mtl.split( \"\\n\" );\n\tvar delimiter_pattern = /\\s+/;\n\tvar materials = [];\n\tvar index = 0;\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\tvar line = lines[ i ];\n\t\tline = line.trim();\n\n\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' || line.substr( 0, 2 ) === \"//\" ) {\n\n\t\t\t// Blank line or comment ignore\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tvar pos = line.indexOf( ' ' );\n\n\t\tvar key = ( pos >= 0 ) ? line.substring( 0, pos) : line;\n\t\tkey = key.toLowerCase();\n\n\t\tvar value = ( pos >= 0 ) ? line.substring( pos + 1 ) : \"\";\n\t\tvalue = value.trim();\n\n\t\tif ( key === \"newmtl\" ) {\n\t\t\t// save index for later\n\t\t\tindex = materials.length;\n\n\t\t\t// New material\n\t\t\tvar material = {\n\t\t\t\t'DbgName': value,\n\t\t\t\t'DbgIndex': index,\n\t\t\t\t'DbgColor' : generate_color(index)\n\t\t\t};\n\n\t\t\tmaterials.push(material);\n\n\t\t} else if ( materials.length > 0 ) {\n\t\t\t// skip under certain conditions\n\t\t\t// - colorAmbient disabled for THREE.js > r80\n\t\t\t// - colorEmissive not supported\n\t\t\tif ( key === \"ka\" || key === \"ke\" || key === \"map_ke\" ) continue;\n\n\t\t\tif ( key === \"kd\" || key === \"ks\" ) {\n\n\t\t\t\tvar ss = value.split( delimiter_pattern, 3 );\n\t\t\t\tmaterials[ index ][ keyMap[key] ] = [ parseFloat( ss[0] ), parseFloat( ss[1] ), parseFloat( ss[2] ) ];\n\n\t\t\t} else {\n\n\t\t\t\t// skip empty values\n\t\t\t\tif( value == \"\" ) continue;\n\t\t\t\t// check if our value is a number\n\t\t\t\tvar is_num = !isNaN( parseFloat(value) );\n\n\t\t\t\t// special conditions for transparency...\n\t\t\t\tif( key == \"d\" || key == \"map_d\" ){\n\t\t\t\t\t//if ( value < 1 ) ...\n\t\t\t\t\tvalue = ( options.transparency == \"invert\" && is_num ) ? 1.0 - parseFloat(value) : value;\n\t\t\t\t\tmaterials[ index ][\"transparent\"] = true;\n\t\t\t\t}\n\t\t\t\tif( key == \"tr\" ){\n\t\t\t\t\t// tr is opposite of d\n\t\t\t\t\t//if ( value > 0 ) ...\n\t\t\t\t\tvalue = ( options.transparency !== \"invert\" && is_num ) ? 1.0 - parseFloat(value) : value;\n\t\t\t\t\tmaterials[ index ][\"transparent\"] = true;\n\t\t\t\t}\n\n\t\t\t\t// is it necessary to parse floats on number string?\n\t\t\t\tmaterials[ index ][ keyMap[key] ] = (!is_num) ? value : parseFloat(value);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn materials;\n}", "title": "" }, { "docid": "b2c41eb2709d5da1f8bac96208209191", "score": "0.39770362", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" }, { "docid": "b2c41eb2709d5da1f8bac96208209191", "score": "0.39770362", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" }, { "docid": "b2c41eb2709d5da1f8bac96208209191", "score": "0.39770362", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" }, { "docid": "b2c41eb2709d5da1f8bac96208209191", "score": "0.39770362", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" }, { "docid": "b2c41eb2709d5da1f8bac96208209191", "score": "0.39770362", "text": "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "title": "" } ]
987cb1ed81c149f0bf9d2b8a6c82143d
RING CENTRAL WEB PHONE INTERFACING AND UI METHODS
[ { "docid": "d777d074a3a355d6aa88c9db3e7b46b1", "score": "0.0", "text": "function onAccepted(session) {\n //console.log('Call: Accepted', session.request);\n //console.log('To: ', session.request.to.displayNmae, session.request.to.friendlyName);\n //console.log('From: ', session.request.from.displayName, session.request.from.friendlyName);\n\n session.on('accepted', function() {\n console.log('Accepted');\n activeCall = true;\n $activeButton.addClass('btn-danger');\n $activeButton.removeClass('btn-success');\n $activeButton.text('Hang Up');\n });\n\n session.on('cancelled', function() {\n console.log('Cancelled');\n });\n\n session.on('rejected', function() {\n console.log('Rejected');\n });\n\n session.on('replaced', function(newSession) {\n console.log('Replaced: old session ', session, ' has been replaced with: ', newSession);\n onAccepted(newSession);\n });\n\n session.on('terminated', function() {\n console.log('Terminated');\n activeCall = false;\n $activeButton.removeClass('btn-danger');\n $activeButton.addClass('btn-success');\n $activeButton.text(tmpNumberCache);\n });\n\n session.on('bye', function() {\n console.log('Goodbye');\n });\n\n session.mediaHandler.on('iceConnection', function() { console.log('ICE: iceConnection'); });\n session.mediaHandler.on('iceConnectionChecking', function() { console.log('Event: ICE: iceConnectionChecking'); });\n session.mediaHandler.on('iceConnectionConnected', function() { console.log('Event: ICE: iceConnectionConnected'); });\n session.mediaHandler.on('iceConnectionCompleted', function() { console.log('Event: ICE: iceConnectionCompleted'); });\n session.mediaHandler.on('iceConnectionFailed', function() { console.log('Event: ICE: iceConnectionFailed'); });\n session.mediaHandler.on('iceConnectionDisconnected', function() { console.log('Event: ICE: iceConnectionDisconnected'); });\n session.mediaHandler.on('iceConnectionClosed', function() { console.log('Event: ICE: iceConnectionClosed'); });\n session.mediaHandler.on('iceGatheringComplete', function() { console.log('Event: ICE: iceGatheringComplete'); });\n session.mediaHandler.on('iceGathering', function() { console.log('Event: ICE: iceGathering'); });\n session.mediaHandler.on('iceCandidate', function() { console.log('Event: ICE: iceCandidate'); });\n session.mediaHandler.on('userMedia', function() { console.log('Event: ICE: userMedia'); });\n session.mediaHandler.on('userMediaRequest', function() { console.log('Event: ICE: userMediaRequest'); });\n session.mediaHandler.on('userMediaFailed', function() { console.log('Event: ICE: userMediaFailed'); });\n }", "title": "" } ]
[ { "docid": "d562ae7411ff1ccee8567ff4f4bbb45d", "score": "0.5924024", "text": "function GetPhotography(){return EIDAWebComponent.GetPhotography();}", "title": "" }, { "docid": "b25c7397c20c5ec6a51a7a4d0e638902", "score": "0.5909674", "text": "function changePhoneAjax(country_code,phone_number){\n\t//send otp to that number and verify in loginCallback function\n\tAccountKit.login(\n 'PHONE',\n {countryCode: country_code, phoneNumber: phone_number},\n loginCallback\n );\n}", "title": "" }, { "docid": "a3f7c3ed2e7e085e218a334b993d41b8", "score": "0.57978314", "text": "function showMobilePhoneNumberPage() {\n\n var centered = \"Y\";\n var prefix = \"\";\n var hint = \"\";\n postRenderFunctionsArray=[];\n\n var screenCode=\"\";\n\n\n // Label\n screenCode+='<br><br>';\n screenCode+=htmlLabel(\"subHeader\", hint, \"Enter Phone Number\", centered, prefix) ;\n\n // Phone Number\n screenCode+='<div style=\"text-align:center;\">';\n screenCode+=inputPhone(\"userPhone\", hint, \"\", \"\", \"false\", \"\", mobileLoginPhoneNumber) ;\n screenCode+='</div>';\n screenCode+='<br><br>';\n\n\n // Dropdown\n var valueField = \"val\";\n var descField = \"desc\";\n var dropdownData = [ \n { \"val\" : \"Alltel\" , \"desc\": \"Alltel Wireless\" }, \n { \"val\" : \"ATT\" , \"desc\": \"AT&T Wireless\" }, \n { \"val\" : \"Boost\" , \"desc\": \"Boost Mobile\" },\n { \"val\" : \"Cricket\" , \"desc\": \"Cricket\" },\n { \"val\" : \"Metro\" , \"desc\": \"Metro PCS\" },\n { \"val\" : \"Sprint\" , \"desc\": \"Sprint\" },\n { \"val\" : \"Straight\" , \"desc\": \"Straight Talk\" },\n { \"val\" : \"TMobile\" , \"desc\": \"T-Mobile\" },\n { \"val\" : \"USCell\" , \"desc\": \"U.S. Cellular\" },\n { \"val\" : \"Verizon\" , \"desc\": \"Verizon\" },\n { \"val\" : \"Virgin\" , \"desc\": \"Virgin Mobile\" } \n ];\n\n screenCode+='<div style=\"width:75%\" class=\"centered\">';\n screenCode+=inputDropdown(\"serviceProvider\", \"\", \"Service Provider\", dropdownData, valueField, descField, mobileLoginServiceProvider) ;\n screenCode+='</div>';\n screenCode+='<br><br>';\n\n\n // Get PIN Button\n screenCode+=\"<br>\";\n screenCode+=\"<br>\";\n screenCode+=\"<br>\";\n screenCode+=\"<br>\";\n screenCode+='<div style=\"margin-top:5px;text-align:center;\">';\n screenCode+=' <a href=\"#\" style=\"width:80%; background: #' + appRules.buttonColor + ';\" class=\"btn rounded\" ' ;\n screenCode+=' onclick=\"mobilePhoneCreateAccount(); return(false);\" >';\n screenCode+=' <span class=\"\" style=\"vertical-align:middle;font-size:large;color:#' + appRules.buttonTextColor + ';\">Next</span> ';\n screenCode+=' </a>';\n screenCode+='</div>';\n screenCode+=\"<br>\";\n\n document.getElementById(\"mainDiv\").innerHTML = screenCode;\n\n for ( var funcCnt=0; funcCnt< postRenderFunctionsArray.length; funcCnt++ ) {\n postRenderFunctionsArray[funcCnt]();\n }\n\n $('.selectpicker').selectpicker({\n style: 'btn-default',\n size: 'auto'\n });\n\n}", "title": "" }, { "docid": "7f40f84f08c474c6cbaa744bd924722f", "score": "0.5685716", "text": "openTelephone() {\n openLinkingURL(\"tel\", \"+919041908803\");\n }", "title": "" }, { "docid": "848bbbe15175d38dc6a03e19e2a38cbe", "score": "0.5610017", "text": "function smsLogin(user_phone) {\n\t\t // var countryCode = document.getElementById(\"country_code\").value;\n\t\t var countryCode = \"+880\";\n\t\t var phoneNumber = user_phone.replace( /^(01)/, \"1\" );\n\t\t //var phoneNumber = user_phone;\n\t\t // console.log(countryCode+\",\"+phoneNumber);\n\t\t AccountKit.login(\n\t\t 'PHONE', \n\t\t {countryCode: countryCode, phoneNumber: phoneNumber}, // will use default values if not specified\n\t\t loginCallback\n\t\t );\n\t\t}", "title": "" }, { "docid": "19902a0029b3b03d1c403c2d4bbe3a2f", "score": "0.55005664", "text": "function MyAccount()\n{\n try{\n var uri = common.GetParameter('accounturi');\n if (common.IsMizuServer() === true || uri.indexOf('/mvweb') > 0) // open url in new window\n {\n uri = common.OpenWebURL( uri, '', false ); // replace keywords\n if (common.IsWindowsSoftphone() === true)\n {\n common_public.OpenLinkInExternalBrowser(uri);\n }else\n {\n window.open(uri);\n }\n }else\n {\n common.OpenWebURL( uri, stringres.get('myaccount') );\n }\n } catch(err) { common.PutToDebugLogException(2, \"_dialpad: MyAccount\", err); }\n}", "title": "" }, { "docid": "f354f3a95c205d9449fd28b1b79f858e", "score": "0.54306936", "text": "function BaGetPhoneCode(cellphone, country_code, bind_type, suc_func, error_func) {\n var api_url = 'sms_send.php',\n post_data = {\n 'cellphone': cellphone,\n 'country_code': country_code,\n 'bind_type': bind_type\n };\n CallUserApi(api_url, post_data, suc_func, error_func);\n}", "title": "" }, { "docid": "2f3b1cf9a32b8ba1a4b7917efc3195fd", "score": "0.5405851", "text": "function addPhoneNumber() {\n viewLayer.addPhoneNumberInput();\n }", "title": "" }, { "docid": "65c2e1ea0a247b38412e853a8ed72c9f", "score": "0.5388491", "text": "function PhenotypeGeocoder() {\n}", "title": "" }, { "docid": "6393694b19c9c441cb36606bfbd3355e", "score": "0.53632104", "text": "function PhoneLogin(country_code, cellphone, pass_word_hash, cfm_code, sms_code, suc_func, error_func) {\n var api_url = 'lgn_phone.php',\n post_data = {\n 'country_code': country_code,\n 'cellphone': cellphone,\n 'pass_word_hash': pass_word_hash,\n 'cfm_code': cfm_code,\n 'sms_code': sms_code\n };\n CallApi(api_url, post_data, suc_func, error_func);\n}", "title": "" }, { "docid": "1ed62f7f85b119ca997687805cd88d99", "score": "0.53536844", "text": "function phoneHome(query_string)\n{\n\tif(xmlHttp&&xmlHttp.readyState!=0){\n\t\txmlHttp.abort()\n\t\t}\n\t\txmlHttp=getXMLHTTP();\n\t\tif(xmlHttp){\n\t\t\txmlHttp.open(\"GET\",query_string,true);\n\t\t\txmlHttp.onreadystatechange=function() {\n\t\t\t\tif(xmlHttp.readyState==4&&xmlHttp.responseText) {\n\t\t\t\t\tvar frameElement=B;\n\t\t\t\t\tif(xmlHttp.responseText.charAt(0)==\"<\"){\n\t\t\t\t\t\t_timeoutAdjustment--\n\t\t\t\t\t}else{\n\t\t\t\t\t\teval(xmlHttp.responseText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n // DON'T TRY TO TALK WHEN WE'RE LOCAL...\n // Comment out when running from a local file...\n\t xmlHttp.send(null)\n\t}\n}", "title": "" }, { "docid": "e00b0162fe60af946256542773705a2f", "score": "0.53235847", "text": "function captainInit() { //加载场地信息的图片,名称和评分\n//\tgetPendings();\n\tconsole.log(\"In Captain Page\");\n\t$('#goBackToPersonal').on('touchend', function(event) {\n var webview = plus.webview.currentWebview();\n \twebview.hide(\"pop-out\");\n });\n// $('.accept').on(\"touchend\", function(event) {\n// accept(event.target.id);\n// });\n// $('.reject').on(\"touchend\", function(event) {\n// reject(event.target.id);\n// });\n}", "title": "" }, { "docid": "44ca32521abd3e4725d10ad28261a64c", "score": "0.5309129", "text": "function OnCmdContact()\r\n{\r\n OnCmdShowOnline();\r\n document.getElementById(\"browser\").loadURI(\"http://online.kneemailcentral.com/pg/contact\");\r\n}", "title": "" }, { "docid": "1e2b713c8ff7b8d210797a20f46642ac", "score": "0.5297078", "text": "function an_server() {\n\n connection.send('?#geTex#'+document.getElementById('gemeisamer_Text').value);\n\n}", "title": "" }, { "docid": "39ea7c38da480d616e1877870c1f9d07", "score": "0.5287425", "text": "function getPhotFromoCurrentLocation() {\n // get the current city from the local storage\n const currentLocationName = helpers.handleLocalStorage(\n \"currentLocation\",\n \"get\"\n ) || { city: \"Durban\", initial: \"NL\", country: \"South-Africa\" };\n\n const locationFullName = `${currentLocationName.city}, ${\n currentLocationName.initial\n }, ${currentLocationName.country}`;\n\n // save the city has visited\n helpers.handleSaveVisitedCities(locationFullName);\n\n // redirect the user to the photos page\n urlRedirector.handleRedirection(locationFullName);\n}", "title": "" }, { "docid": "2b7e62ed6ffa2911552caf65c2c28b68", "score": "0.52787715", "text": "function updatePhone() {\n id(\"single-phone\").classList.add(\"hidden\");\n id(\"update-area\").classList.remove(\"hidden\");\n window.scrollTo(0, 0);\n showParts();\n }", "title": "" }, { "docid": "fd37ab175cf21a0a9e6e34ae51141059", "score": "0.5251947", "text": "function GetUserPhoneCode(cellphone, country_code, bind_type, cfm_code, suc_func, error_func) {\n var api_url = 'sms_send.php',\n post_data = {\n 'cellphone': cellphone,\n 'country_code': country_code,\n 'bind_type': bind_type,\n 'cfm_code': cfm_code\n };\n CallUserApi(api_url, post_data, suc_func, error_func);\n}", "title": "" }, { "docid": "1ce745586f060568f59003dd46c3a28a", "score": "0.51878774", "text": "function useMaximind(){\n\tvar onSuccess = function(location){\n\t\t\n\t var string = JSON.stringify(location, undefined, 4);\n\t var data = JSON.parse(string);\n\t var postalCode = data.postal.code;\n\t var city = data.city.names.en;\n\t // var state = data.state.names.en;\n\t //console.log(state); // TODO: Create a Cookie for the City\n\t //setCookie('city', city, 365);\n\t //setCookie('state', state, 365);\n\t getZone(postalCode);\n\t \n\t}\n\t\n\t// IP look up unsucessful\n\tvar onError = function(error){\n\t\t// The error\n\t\t//console.log(JSON.stringify(error, undefined, 4));\n\t}\n\t\n\t// Call the GeoIP2 API\n\tgeoip2.city(onSuccess, onError);\n}", "title": "" }, { "docid": "aaed7ccde23d638c60672ff7b7b5bce6", "score": "0.516346", "text": "function OnRun() {\n\tvar input = window.location.search; \n\tvar twitter = \"Disabled\";\n\tif (typeof (Storage) !== \"undefined\") {\n\t\tif (sessionStorage.twitter_authentication_code) {\n\t\t\ttwitter = \"{'twitter':'\" +sessionStorage.twitter_authentication_code+\"'}\";\n\t\t}\n\t} else {\n\t\tdocument.getElementById(\"result\").innerHTML = \"Storage Failed\";\n\t}\n\n\tif(twitter==\"Disabled\"){\n\t\talert(\"Please go to the main page to get authenticated \")\n\t}\n\ttwitter = encodeURIComponent(twitter)\n\tdatabase_request(geo_point_request,input+\"&auth_codes=\"+twitter);\n\tconsole.log(input+\"&authcodes=\"+twitter);\n\tconsole.log(\"Completed \");\n}", "title": "" }, { "docid": "d22276d0ef5b7eae5953585ece2a7d2d", "score": "0.513781", "text": "function sendpin(){\n\t\t\tcorploginemail=document.getElementById(\"corpemail\").value;\n\t\t if(corploginemail!=\"\"){\n\t \tmyinfo.email=corploginemail;\n\t\t\t\turl=\"/ridezu/api/v/1/users/generatePin/login/\"+corploginemail;\n\t\t\t\tvar request=$.ajax({\n\t\t\t\t\turl: url,\n\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\tx=data.generatePin.text;\n\t\t\t\t\t\tif(x==\"success\"){\n\t\t\t\t\t\t\tdocument.getElementById(\"corpwelcome\").style.display=\"none\";\n\t\t\t\t\t\t\tdocument.getElementById(\"corpwelcome2\").style.display=\"block\";\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif(x==\"fail\"){\n\t\t\t\t\t\t\tmessage=\"<h2>Snap!</h2><p>We didn't find your email with our corporate user list. Please try again or contact your corp admin</p>\";\n\t\t\t\t\t\t\topenconfirm();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\talert(\"Yikes, I am not getting any account data.\"+JSON.stringify(data));reporterror(url); },\n\t\t\t\t\tbeforeSend: setHeader\n\t\t\t\t});\t\n\t\t\t}\t\n\t\t}", "title": "" }, { "docid": "1157249196f68b6c8a883b75a529ccea", "score": "0.5120532", "text": "function sendIpLocation() {\n\t\treturn;\n\t\t// no another service is being used\n $http.jsonp(\"http://ipinfo.io?callback=JSON_CALLBACK\").success(function (response) {\n User.setLocation({\n ip: response.ip,\n city: response.city,\n country: response.country\n });\n });\n }", "title": "" }, { "docid": "d246cdf128b4beda93c2d6a30b22c400", "score": "0.50985557", "text": "function GetPhoneCode(cellphone, country_code, bind_type, cfm_code, suc_func, error_func) {\n var api_url = 'sms_send.php',\n post_data = {\n 'cellphone': cellphone,\n 'country_code': country_code,\n 'bind_type': bind_type,\n 'cfm_code': cfm_code\n };\n CallApi(api_url, post_data, suc_func, error_func);\n}", "title": "" }, { "docid": "8fd68a15593d01bcd29d3e93bdb09758", "score": "0.5088558", "text": "function onNeedPIN() {\n _debug('onNeedPIN');\n\n // Remove the watchdog after we get the responses from server\n _removeWatchdog(tab.id);\n // Reset a watchdog to wait for the responses again\n // _setWatchdog(tab.id, 5 * kWatchdogTimer);\n\n // Re-direct the URL to the PIN code entering page\n _debug('Re-directing URL of tab ' + tab.id + ' to pincode-entering page......');\n let window = GetRecentWindow();\n window.BrowserApp.loadURI(kRemoteControlPairingPINURL, tab.browser);\n }", "title": "" }, { "docid": "465481f65bfa36bad1e259c7ceefd6ac", "score": "0.5088133", "text": "invited_to_call(data) {\n generatePopup(\n data.popup_text,\n \"fa-phone\",\n [\n {\n \"label\": data.accept_text,\n \"action\": () => $.ajax({ type: \"PATCH\", url: data.accept_url })\n },\n {\n \"label\": data.reject_text,\n \"action\": () => $.ajax({ type: \"PATCH\", url: data.reject_url })\n }\n ]\n )\n }", "title": "" }, { "docid": "c4bbfab63a41aa8be1c1b1a88c8d0dc0", "score": "0.5085919", "text": "function getPhone() {\n try {\n // Gets the person by specifying resource name/account ID\n // in the first parameter of People.People.get.\n // This example gets the person for the user running the script.\n const people = People.People.get('people/me', {personFields: 'phoneNumbers'});\n // Gets phone number by type, such as home or work.\n const phoneNumber = people['phoneNumbers'].find((phone) => phone['type'] === 'home')['value'];\n // Prints the phone numbers.\n console.log(phoneNumber);\n } catch (err) {\n // TODO (developers) - Handle exception\n console.log('Failed to get the connection with an error %s', err.message);\n }\n}", "title": "" }, { "docid": "aeff216bd4f16f650bbbbe9670ae37cd", "score": "0.50775856", "text": "static getUserPhoneNumber() {\n if (Platform.OS === 'ios') return;\n return RNPushe.getUserPhoneNumber();\n }", "title": "" }, { "docid": "02103f33cd7dd1f40fafd37f8fb43699", "score": "0.5042433", "text": "function gather() {\n const gatherNode = twiml.gather({ numDigits: 5, timeout:10 });\n gatherNode.say('Welcome to the peachy service, please enter you 5 digit code');\n\n // If the user doesn't enter input, loop\n twiml.redirect('/voice');\n }", "title": "" }, { "docid": "531d94d76e667f6475baa2cee349ab7e", "score": "0.5033188", "text": "function getPhoneNumberFromUserInput() {\r\n\t return document.getElementById('phone-number').value;\r\n\t }", "title": "" }, { "docid": "f4b8fbce58826a426b73e569a5decd9f", "score": "0.50218636", "text": "function calliPlanner (api, params) {\n var invokeString, iFrame;\n if (isiPlanner) {\n invokeString = \"objc://iplanner/\" + api + \"?\" + encodeURIComponent(params),\n iFrame = document.createElement(\"IFRAME\");\n iFrame.setAttribute(\"src\", invokeString);\n document.body.appendChild(iFrame); \n iFrame.parentNode.removeChild(iFrame);\n iFrame = null;\n }\n }", "title": "" }, { "docid": "dc471846f8027c07f5cbd4d25ea99437", "score": "0.50188607", "text": "function geocode(platform) {\n var geocoder = platform.getSearchService(),\n geocodingParameters = {\n q: $(\"#userAddress\").val()\n };\n geocoder.geocode(\n geocodingParameters,\n onSuccess,\n onError\n );\n}", "title": "" }, { "docid": "de898c41ab22e9fa0d0377a58b3a9935", "score": "0.50134313", "text": "function deliveryPersonLogin() {\n var self = this;\n var nosql = new Agent();\n var pn = new PhoneNumber(self.body.phoneNo, 'IN');\n if (self.body.phoneNo = \"9347980470\") {\n return self.json({\n status: true,\n message: \"Otp Sent\"\n })\n }\n if (pn.isValid()) {\n const secret = OTP_SECRET + self.body.phoneNo;\n const token = otplib.authenticator.generate(secret);\n var options = {\n 'method': 'GET',\n 'url': `https://2factor.in/API/V1/e27f1a8a-e428-11e9-9721-0200cd936042/SMS/${self.body.phoneNo}/${token}/Happi`,\n };\n request(options, async function (error, response) {\n var res = JSON.parse(response.body);\n console.log(\"res\", res)\n if (res.Status == \"Success\") {\n // enter request data into otp_request collection\n nosql.insert('otp', 'otp_request').make(function (builder) {\n builder.set('phoneNo', self.body.phoneNo);\n builder.set('type', 'delivery_person');\n builder.set('timeStamp', new Date());\n })\n\n var optRequest = await nosql.promise('otp');\n console.log(\"optRequest\", optRequest);\n\n self.json({\n status: true,\n message: \"Otp Sent\"\n })\n } else {\n self.json({\n status: false,\n message: \"Unable to send OTP\"\n })\n }\n });\n } else {\n self.json({\n status: false,\n message: \"Invalid Phone number\"\n })\n }\n}", "title": "" }, { "docid": "c5a04ed275300f8c6165394c7c2d3017", "score": "0.5002281", "text": "getPhoneInfo(phone) {\n\t\tlet uri = API_HOSTNAME + '/' + this.app_key + '/normalize';\n\n\t\treturn sendRequest( 'POST', uri, {\n\t\t\tapp_key: this.app_key,\n\t\t\tapi_key: this.api_key,\n\t\t\tphone: phone\n\t\t});\n\t}", "title": "" }, { "docid": "cfb6422ecb4bd37ce15e5f37e534236e", "score": "0.49899977", "text": "function callToGuide(){\n window.open('tel:'+localStorage.guidePhone, '_system')\n}", "title": "" }, { "docid": "16df0656692f7d7d622c3ed24a10a272", "score": "0.49881348", "text": "onSendCode() {\n const { dispatchSavePhoneInfo, dispatchSendCode, navigation } = this.props;\n const { phone } = this.state;\n if (validator.isMobilePhone(phone)) {\n const state = dispatchSavePhoneInfo({\n phoneNumber: this.format(phone),\n countryCode: \"1\"\n });\n dispatchSendCode(state, navigation);\n } else {\n this.setState({ displayPhoneError: true });\n Alert.alert(\n \"Sorry!\",\n \"There was a problem verifying your phone number. Please make sure you have entered the correct number.\"\n );\n }\n }", "title": "" }, { "docid": "8c4ee0155b493dab2c215e375fbafea4", "score": "0.4972786", "text": "function WebPhone(regData, options) {\r\n if (regData === void 0) { regData = {}; }\r\n if (options === void 0) { options = {}; }\r\n this.sipInfo = regData.sipInfo[0] || regData.sipInfo;\r\n this.sipFlags = regData.sipFlags;\r\n this.uuidKey = options.uuidKey || constants_1.uuidKey;\r\n var id = options.uuid || localStorage.getItem(this.uuidKey) || utils_1.uuid(); //TODO Make configurable\r\n localStorage.setItem(this.uuidKey, id);\r\n this.appKey = options.appKey;\r\n this.appName = options.appName;\r\n this.appVersion = options.appVersion;\r\n var ua_match = navigator.userAgent.match(/\\((.*?)\\)/);\r\n var app_client_os = (ua_match && ua_match.length && ua_match[1]).replace(/[^a-zA-Z0-9.:_]+/g, '-') || '';\r\n var userAgentString = (options.appName ? options.appName + (options.appVersion ? '/' + options.appVersion : '') + ' ' : '') +\r\n (app_client_os ? app_client_os : '') +\r\n (\" RCWEBPHONE/\" + version);\r\n var modifiers = options.modifiers || [];\r\n if (options.enableDefaultModifiers !== false) {\r\n modifiers.push(sip_js_1.Web.Modifiers.stripG722);\r\n modifiers.push(sip_js_1.Web.Modifiers.stripTcpCandidates);\r\n }\r\n if (options.enableMidLinesInSDP) {\r\n modifiers.push(sip_js_1.Web.Modifiers.addMidLines);\r\n }\r\n var sdpSemantics = 'unified-plan';\r\n if (options.enablePlanB) {\r\n sdpSemantics = 'plan-b';\r\n }\r\n var stunServerArr = options.stunServers || this.sipInfo.stunServers || ['stun.l.google.com:19302'];\r\n var iceServers = [];\r\n stunServerArr.forEach(function (addr) {\r\n addr = !/^(stun:)/.test(addr) ? 'stun:' + addr : addr;\r\n iceServers.push({ urls: addr });\r\n });\r\n var sessionDescriptionHandlerFactoryOptions = options.sessionDescriptionHandlerFactoryOptions || {\r\n peerConnectionOptions: {\r\n iceCheckingTimeout: this.sipInfo.iceCheckingTimeout || this.sipInfo.iceGatheringTimeout || 500,\r\n rtcConfiguration: {\r\n sdpSemantics: sdpSemantics,\r\n iceServers: iceServers\r\n }\r\n },\r\n constraints: options.mediaConstraints || constants_1.defaultMediaConstraints,\r\n modifiers: modifiers\r\n };\r\n var browserUa = navigator.userAgent.toLowerCase();\r\n var isSafari = false;\r\n var isFirefox = false;\r\n if (browserUa.indexOf('safari') > -1 && browserUa.indexOf('chrome') < 0) {\r\n isSafari = true;\r\n }\r\n else if (browserUa.indexOf('firefox') > -1 && browserUa.indexOf('chrome') < 0) {\r\n isFirefox = true;\r\n }\r\n if (isFirefox) {\r\n sessionDescriptionHandlerFactoryOptions.alwaysAcquireMediaFirst = true;\r\n }\r\n var sessionDescriptionHandlerFactory = options.sessionDescriptionHandlerFactory || [];\r\n var sipErrorCodes = regData.sipErrorCodes && regData.sipErrorCodes.length\r\n ? regData.sipErrorCodes\r\n : ['408', '502', '503', '504'];\r\n var wsServers = [];\r\n if (this.sipInfo.outboundProxy && this.sipInfo.transport) {\r\n wsServers.push({\r\n wsUri: this.sipInfo.transport.toLowerCase() + '://' + this.sipInfo.outboundProxy,\r\n weight: 10\r\n });\r\n }\r\n if (this.sipInfo.outboundProxyBackup && this.sipInfo.transport) {\r\n wsServers.push({\r\n wsUri: this.sipInfo.transport.toLowerCase() + '://' + this.sipInfo.outboundProxyBackup,\r\n weight: 0\r\n });\r\n }\r\n wsServers = wsServers.length ? wsServers : this.sipInfo.wsServers;\r\n var maxReconnectionAttemptsNoBackup = options.maxReconnectionAttemptsNoBackup || 15;\r\n var maxReconnectionAttemptsWithBackup = options.maxReconnectionAttemptsWithBackup || 10;\r\n var reconnectionTimeoutNoBackup = options.reconnectionTimeoutNoBackup || 5;\r\n var reconnectionTimeoutWithBackup = options.reconnectionTimeoutWithBackup || 4;\r\n var configuration = {\r\n uri: \"sip:\" + this.sipInfo.username + \"@\" + this.sipInfo.domain,\r\n transportOptions: {\r\n wsServers: wsServers,\r\n traceSip: true,\r\n maxReconnectionAttempts: wsServers.length === 1 ? maxReconnectionAttemptsNoBackup : maxReconnectionAttemptsWithBackup,\r\n reconnectionTimeout: wsServers.length === 1 ? reconnectionTimeoutNoBackup : reconnectionTimeoutWithBackup,\r\n connectionTimeout: 5\r\n },\r\n authorizationUser: this.sipInfo.authorizationId,\r\n password: this.sipInfo.password,\r\n // turnServers: [],\r\n log: {\r\n level: options.logLevel || 1,\r\n builtinEnabled: typeof options.builtinEnabled === 'undefined' ? true : options.builtinEnabled,\r\n connector: options.connector || null\r\n },\r\n domain: this.sipInfo.domain,\r\n autostart: false,\r\n register: true,\r\n userAgentString: userAgentString,\r\n sessionDescriptionHandlerFactoryOptions: sessionDescriptionHandlerFactoryOptions,\r\n sessionDescriptionHandlerFactory: sessionDescriptionHandlerFactory,\r\n allowLegacyNotifications: true,\r\n registerOptions: {\r\n instanceId: options.instanceId || undefined,\r\n regId: options.regId || undefined\r\n }\r\n };\r\n options.sipErrorCodes = sipErrorCodes;\r\n options.switchBackInterval = this.sipInfo.switchBackInterval;\r\n this.userAgent = userAgent_1.patchUserAgent(new sip_js_1.UA(configuration), this.sipInfo, options, id);\r\n }", "title": "" }, { "docid": "5e19a56ae766e45eab6f5d813706959f", "score": "0.49619597", "text": "function onEndpointPresence(name, number, phoneStatus, imStatus, activity, note) {\n /*\n * Set supporters status globally\n */\n updateSupporterStatus(name, phoneStatus, imStatus, activity, note);\n\n if(instanceConference.call) return;\n var activeSupporter = 0;\n var lastSupporter = instanceConference.supporters[0];\n\n createWidget.call(instanceConference, instanceConference.supporters);\n\n /*\n * If no WebRTC is supported\n */\n if (!innovaphone.pbxwebsocket.WebRtc.supported) {\n var tooltips = document.querySelectorAll('.innovaphone-tooltip');\n document.querySelector('.iconCall').classList.remove('available');\n document.querySelector('.iconVideo').classList.remove('available');\n tooltips[0].innerHTML = instanceConference.options.translations.unsupported;\n tooltips[0].classList.add('innovaphone-tooltip--smaller');\n tooltips[1].innerHTML = instanceConference.options.translations.unsupported;\n tooltips[1].classList.add('innovaphone-tooltip--smaller');\n }\n }", "title": "" }, { "docid": "598a4f5b96059ab94bdc2d9fb680efea", "score": "0.4951858", "text": "function dial(){\n\tclient.makeCall({\n\n\t//to: '+19292404478', //me\n\tto: '+18605733345', //seth\n\tfrom: '+12012126779', // Twilio number\n\turl: 'http://104.131.167.46:3001/usps.xml' // A URL that produces an XML document (TwiML) which contains instructions for the call\n\n\t}, function(err, responseData) {\n\n\t if (err) console.log(err);\n\t //executed when the call has been initiated.\n\t console.log(responseData.from);\n\t});\n}", "title": "" }, { "docid": "ef0619d173d53b375ce2f9e8781f52bb", "score": "0.49500796", "text": "function showDialer() {\n hide();\n showMenu();\n getOutgoingNumbers();\n numbersAutoComplete(\"#dialerNumber\", true, true);\n $('#blockDialer').fadeIn(400);\n $(\"#menuDialer\").addClass(\"active\");\n\n $(\"#dialerNumber\").attr('maxlength','15');\n\n // Remove any error classes that may there\n $('#dialerNumberGroup').removeClass('error');\n\n // Uncheck withhold checkbox just incase it is\n $('#dialerWithhold').prop('checked', false);\n\n // Add some useful info for the user\n $('#dialerInfo').text('This will dial from extension ' + localStorage[localStorage['loginUsername'] + '_prefMainExtensionShort'] +'.');\n\n setTimeout(function(){ $('#dialerNumber').focus(); },200);\n\n // Lets see if we have any URL params\n // As the dialer screen is the default one we also use it to catch URL params for other blocks!\n // This would be best placed somewhere else, but for now it works here\n var getNumber = getUrlParams();\n if (getNumber.number) {\n // If we get a number then we put it in the text field\n $('#dialerNumber').val(getNumber.number);\n } else if (getNumber.sms) {\n // If we got a sms number we do the same as above but send the user to the messages block\n showSMSMessages();\n showNewSMS();\n $('#smsNumber').val(getNumber.sms);\n } else if (getNumber.contact) {\n // This will pull up a edit contact modal in the contacts block\n showBook();\n showContact(getNumber.contact);\n } else if (getNumber.smsThread) {\n showSMSThread(getNumber.smsThread);\n }\n\n return false;\n}", "title": "" }, { "docid": "205fb415e42608d6bc63a2228b83b684", "score": "0.4944487", "text": "function conferenceJsHook() //don't change this name\n{\n\tinitiateTheCall();\n}", "title": "" }, { "docid": "57abcc36e0d37439bca3037c9497a102", "score": "0.49224868", "text": "function makeApiCall() {\n\tgapi.client.load('plus', 'v1').then(function() {\n\t\tvar request = gapi.client.plus.people.get({\n\t\t\t'userId': 'me'\n\t\t});\n\n\t\trequest.execute(function(resp) {\n\t\t\tvar heading = document.createElement('h4');\n\t\t\tvar image = document.createElement('img');\n\n\t\t\timage.src = resp.image.url;\n\t\t\theading.appendChild(image);\n\t\t\theading.appendChild(document.createTextNode(resp.displayName));\n\t\t\ttry {\n\t\t\t\tgoogleEmail = resp.emails[0].value;\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tgoogleEmail = \"unknown\";\n\t\t\t}\n\t\t\tdocument.getElementById('content').appendChild(heading);\n\n\t\t\tdocument.getElementById(\"divLoadingMsg\").innerHTML = \"Page State: User Logged In, Awaiting Selection..\"\n\t\t\tvar docEl;\n\t\t\tdocEl = document.getElementById(\"msgSignIn\");\n\t\t\tdocEl.innerHTML = resp.displayName + \" is now signed in...\";\n\t\t});\n\t});\n} // makeApiCall", "title": "" }, { "docid": "526d7ebc68928102ce4c77f5815f29c8", "score": "0.49214694", "text": "function secretPhoneNumber(numbers) {\n // your code here\n}", "title": "" }, { "docid": "faca9a9d880ce12c1295d6bf3093a75c", "score": "0.49212116", "text": "function createRequest()\n{\n RMPApplication.debug(\"begin createRequest\");\n c_debug(dbug.insert, \"begin createRequest\");\n $(\"#id_spinner_insert\").show();\n\n var caller, logical_name, location, separator;\n var num_pos = \"01\"; // Cashdesk n° => we sinplify RMSDEMO case\n selected_location = JSON.parse(RMPApplication.get(\"selected_location\"));\n selected_affiliate = JSON.parse(RMPApplication.get(\"selected_affiliate\"));\n \n switch (selected_location.affiliate) {\n\n case 'societeXX': // EXAMPLE\n caller = \"hotline@societexx.com\";\n location = $.trim(selected_location.location_name);\n // logical_name format => MAG00BxxxCAI01\n logical_name = \"MAG00\" + selected_location.location_code + RMPApplication.get(\"variables.short_cat\") + num_pos;\n break;\n\n default:\n separator = \"-\";\n location = $.trim(selected_location.location) + separator + $.trim(selected_location.location_code);\n // caller = login.user;\n caller = \"Resp \" + location;\n logical_name = \"MAG\" + selected_location.location_code + RMPApplication.get(\"variables.short_cat\") + num_pos;\n }\n\n var contract = selected_affiliate.company + \"\\\\\" + selected_affiliate.abbreviation; // SNOW contract name\n var customer_site = location; \n var requestType = \"intervention\";\n var work_order_type = requestType;\n var contact_type = \"RunMyStore\";\n var qualification_group = \"\";\n var customer_reference = \"\"; \n var contact = login.user;\n var description = RMPApplication.get(\"description\");;\n var short_description = description.substring(0,99);\n var state = \"1\"; // draft\n var expected_start = \"\";\n var priority = \"2\";\n var contact_detail = (isEmpty(selected_location.email)) ? \"\" : selected_location.email;\n contact_detail += (isEmpty(selected_location.phone)) ? \"\" : \"\\n\" +selected_location.phone;\n var photo_consult = ${P_quoted(i18n(\"photo_consult_txt\", \"Connectez-vous à RMS pour consulter les photos jointes lors de l'ouverture de l'incident\"))};\n\n // define insertion query before sending to Service Now\n var work_order = {};\n work_order.sn_caller = caller\n work_order.sn_contract = contract;\n work_order.sn_contact_type = contact_type;\n work_order.sn_correlation_id = customer_reference;\n work_order.sn_location = location;\n work_order.sn_u_customer_site = customer_site;\n work_order.sn_state = state;\n work_order.sn_qualification_group = qualification_group;\n work_order.sn_short_description = short_description;\n work_order.sn_priority = priority;\n work_order.sn_u_contact_details = contact_detail;\n work_order.sn_u_work_order_type = work_order_type;\n work_order.sn_category = RMPApplication.get(\"variables.category\") + \" \" + selected_affiliate.affiliate;;\n work_order.sn_u_problem_type = RMPApplication.get(\"variables.problem_type\");\n work_order.sn_u_product_type = RMPApplication.get(\"variables.product_type\");\n work_order.sn_expected_start = expected_start;\n work_order.sn_cmdb_ci = logical_name;\n work_order.location_code = selected_location.location_code;\n \n var my_array = eval(RMPApplication.get(\"attachment\"));\n if (my_array.length !=0) {\n var medias = [];\n for (var i = 0; i < my_array.length; i++) {\n medias.push(my_array[i].id);\n }\n work_order.media = medias;\n description += \"\\n => \" + photo_consult;\n }\n work_order.sn_description = description;\n\n c_debug(dbug.insert, \"=> createRequest: work_order = \", work_order);\n var options = {};\n id_insert_work_order_api.trigger (work_order, options, insert_ok, insert_ko);\n \n RMPApplication.debug(\"end createRequest\");\n}", "title": "" }, { "docid": "5af663493613b4e71d4881cb6109cfb4", "score": "0.4914894", "text": "function PinAuthModule() {\n\n var currentPlayback = null;\n var retries = 0;\n var digits = '';\n\n /**\n * Checks the entered PIN with the bridge PIN.\n *\n * @param {Integer} pin - the bridge PIN\n * @return {Boolean} result - true if the PIN matches\n */\n this.checkPin = function(pin) {\n if (currentPlayback) {\n var stopPlayback = Q.denodeify(currentPlayback.stop.bind(\n currentPlayback));\n stopPlayback()\n .catch(function (err) {\n return;\n })\n .done();\n }\n return parseInt(digits) === pin;\n };\n\n /**\n * Concatenates a given digit to digits.\n *\n * @param {Integer} digit - the digit to add\n */\n this.addDigit = function(digit) {\n digits += digit;\n };\n\n /**\n * Asks the user to enter the PIN to the conference.\n *\n * @param {Object} ari - the ARI client\n * @param {Object} channel - the channel entering the PIN\n * @param {Object} bridge - the bridge the channel is trying to join\n */\n this.enterPin = function(ari, channel, bridge) {\n currentPlayback = ari.Playback();\n var soundToPlay = util.format('sound:%s',\n bridge.config.media_settings.enter_pin_sound);\n var play = Q.denodeify(channel.play.bind(channel));\n play({media: soundToPlay}, currentPlayback)\n .catch(function(err) {\n console.error(err);\n })\n .done();\n };\n\n /**\n * Lets the user know they entered an invallid PIN. If the maximum amount\n * of retries is reached, the channel will be hung up.\n *\n * @param {Object} ari - the ARI client\n * @param {Object} channel - the channel entering the PIN\n * @param {Object} bridge - the bridge the channel is trying to join\n */\n this.invalidPin = function(ari, channel, bridge) {\n retries++;\n currentPlayback = ari.Playback();\n var soundToPlay = util.format('sound:%s',\n bridge.config.media_settings.bad_pin_sound);\n var play = Q.denodeify(channel.play.bind(channel));\n play({media: soundToPlay}, currentPlayback)\n .catch(function(err) {\n console.error(err);\n })\n .done();\n if (retries == bridge.config.pin_retries) {\n currentPlayback.once('PlaybackFinished', function (err, completedPlayback) {\n var hangup = Q.denodeify(channel.hangup.bind(channel));\n hangup()\n .catch(function (err) {\n console.error(err);\n })\n .done();\n });\n }\n digits = '';\n };\n\n}", "title": "" }, { "docid": "7c1286a5ab489eee92a73f24fcff58c3", "score": "0.491255", "text": "function geoFindMe() { //html geolocation\n /* Chrome need SSL! */\n var is_chrome = /chrom(e|ium)/.test(navigator.userAgent.toLowerCase());\n var is_ssl = 'https:' == document.location.protocol;\n if (is_chrome && !is_ssl) {\n return false;\n }\n\n /* HTML5 Geolocation */\n navigator.geolocation.getCurrentPosition(\n function (position) { // success cb\n\n /* Current Coordinate */\n var lat = position.coords.latitude;\n var lng = position.coords.longitude;\n var google_map_pos = new google.maps.LatLng(lat, lng);\n\n\n /* Use gisgraphy to get address */\n var getURL = encodeURIComponent(\"http://services.gisgraphy.com/reversegeocoding/search?lat=\" + lat + \"&lng=\" + lng + \"&from=1&to=1&format=JSON\");\n $.ajax({\n type: \"post\"\n , url: \"//libsat.countingopinions.com/redirect.php?getURL=\" + getURL\n , data: { get_param: 'getURL' }\n , datatype: \"json\"\n , success: function (result) {\n //////////console.log(\"redirect...\");\n result = $.parseJSON(result); //convert into javascript array\n //////////console.log(result.result[0].state);\n\n //alert((result_string));\n $(\"select[name='region'] option:contains('\" + result.result[0].state + \"')\")\n .prop('selected', 'selected'); //Select the state value\n if (result.result[0].countryCode == \"CA\") {\n $(\"select[name='country']\")\n .val(\"C\");\n window.country = \"C\"; //Set the global variable and country field to Canada\n }\n if (result.result[0].countryCode == \"US\") {\n $(\"select[name='country']\")\n .val(\"U\");\n window.country = \"U\";\n }\n }\n }); //gisgraphy reverse geocoder service\n\n\n /* Use Google map Geocoder to get address */\n var google_maps_geocoder = new google.maps.Geocoder();\n google_maps_geocoder.geocode({ 'latLng': google_map_pos }\n , function (results, status) {\n if (status == google.maps.GeocoderStatus.OK && results[0]) {\n //////////console.log( results);\n $(\"input[name='street-address']\")\n .val(results[0].formatted_address);\n if (results[0].formatted_address.includes(\"Canada\")) {\n //////////console.log(\"Canada\");\n $(\"select[name='country']\")\n .val(\"C\");\n window.country = \"C\"; //Set the global variable and country field to Canada\n }\n if (results[0].formatted_address.includes(\"United State\")) {\n $(\"select[name='country']\")\n .val(\"U\");\n window.country = \"U\";\n }\n }\n }\n );\n }\n , function () { // fail cb\n }\n );\n }", "title": "" }, { "docid": "067435ebb928721a30fe5fbeb9f3efca", "score": "0.49077177", "text": "function callNumber(phone_no) {\n \n //chrome.storage.local.set({'PhoneNumber': phone_no});\n //alert(phone_no);\n phone_no=phone_no.replace(/[^0-9]/g,'');\n chrome.runtime.sendMessage({greeting:\"TechCall|**|\"+phone_no}, function(response) \n\t\t\t\t{\n\t\t\t\t\tconsole.log(response.farewell);\n\t\t\t\t});\n}", "title": "" }, { "docid": "e69c7ef92d84116a60341f4a623c3aa1", "score": "0.48980278", "text": "function appstart(){\n\t\t\t\t\n\t\t\tif(myinfo.fbid!=undefined && myinfo.add1!=undefined && myinfo.seckey!=undefined){\t// start the app you've got everything!\n\t\t\t\twelcome();\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\tif(myinfo.fbid!=undefined && myinfo.add1!=undefined && myinfo.seckey==undefined){\t// reg the user already;\n\t\t\t\tregnewuser();\n\t \t\t return false;\n\t\t\t\t}\n\n\t\t\tif(myinfo.fbid!=undefined && myinfo.add1==undefined){\t// get the address\n\t\t\t\tdocument.getElementById(\"corpstartcalc\").innerHTML=\"<div style='font-size:18px;padding:10px;'>Next, tell us about your commute.</div><input class=\\\"arvo\\\" type=\\\"text\\\" value=\\\"Where I live\\\" id=\\\"home\\\" onfocus=\\\"if(this.value==this.defaultValue)this.value=\\'\\';\\\" onblur=\\\"if(this.value==\\'\\')this.value=this.defaultValue;\\\"><input class=\\\"arvo\\\" type=\\\"text\\\" value=\\\"Where I work\\\" id=\\\"work\\\" onfocus=\\\"if(this.value==this.defaultValue)this.value=\\'\\';\\\" onblur=\\\"if(this.value==\\'\\')this.value=this.defaultValue;\\\"><a href=\\\"#\\\" onclick=\\\"getaddr();\\\" id=\\\"startbutton\\\">Next</a>\";\n\t\t\t\t//document.getElementById(\"overlay\").style.display=\"none\";\n\t\t\t\tinitialize();\n\t \t\t return false;\n\t\t\t\t}\n\n\t\t\tif(myinfo.fbid==undefined && myinfo.add1!=undefined){\t// got the address now get them to enroll in fb\n\t\t\t    document.getElementById(\"corpstartcalc\").innerHTML=\"<span style='font-size:22px;color:#000;padding-bottom:20px;'>Please login with Facebook.<br><br>We're a green company focused on social good. We'll never spam you, share your private information, or abuse your trust.</span><a href=\\\"#\\\" onclick=\\\"loginUser();\\\" id=\\\"startbutton\\\">Login</a>\";     \n\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "0678a660ecd6e2bab29bed5016a97073", "score": "0.4882943", "text": "function CfmPhone(sms_code, country_code, cellphone, suc_func, error_func) {\n var api_url = 'cfm_phone.php',\n post_data = {\n 'sms_code': sms_code,\n 'country_code': country_code,\n 'cellphone': cellphone\n };\n CallUserApi(api_url, post_data, suc_func, error_func);\n}", "title": "" }, { "docid": "29831590e5e8d973e9f09b64ece04c80", "score": "0.4880194", "text": "function loginStart() {\n return {\n type: PHONE_LOGIN_REQUEST_START\n };\n}", "title": "" }, { "docid": "9c8426d609facb856cd08cde6ea71df9", "score": "0.48763347", "text": "function triggerSnapIn(gslbBaseURL, deploymentId, buttonId, serviceTagVal, issueVal, browserLang, descriptionText) {\n embedded_svc.settings.displayHelpButton = true;\n embedded_svc.settings.enabledFeatures = ['LiveAgent'];\n embedded_svc.settings.entryFeature = 'LiveAgent';\n if( serviceTagVal === '29VZS71' ) {\n embedded_svc.settings.prepopulatedPrechatFields = {\n FirstName: \"John\",\n LastName: \"Doe\"\n } \n } \n if( browserLang === 'ja' ) {\n embedded_svc.settings.extraPrechatFormDetails = [\n {\"label\":\"名\", \"transcriptFields\":[\"FirstName__c\"]},\n {\"label\":\"姓\", \"transcriptFields\":[\"LastName__c\"]},\n {\"label\":\"主に使う電話番号\", \"transcriptFields\":[\"ContactNumber__c\"]},\n {\"label\":\"メール\", \"transcriptFields\":[\"Email__c\"]},\n {\"label\":\"Subject\", \"value\":issueVal, \"transcriptFields\":[\"Issue__c\"]},\n {\"label\":\"Service Tag\", \"value\":serviceTagVal, \"transcriptFields\":[\"Service_Tag__c\"]},\n {\"label\":\"問題の記述\", \"transcriptFields\":[\"Description__c\"]},\n {\"label\":\"AccountNumber\", \"transcriptFields\":[\"CustomerNumber__c\"]},\n {\"label\":\"Account BUID\", \"transcriptFields\":[\"CustomerBUID__c\"]},\n ]; \n\n embedded_svc.settings.extraPrechatInfo = [{\n \"entityFieldMaps\": [{\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"LastName\",\n \"isExactMatch\":true,\n \"label\":\"姓\"\n }, {\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"FirstName\",\n \"isExactMatch\":true,\n \"label\":\"名\"\n }, {\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"Email\",\n \"isExactMatch\":true,\n \"label\":\"メール\"\n }, {\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"Primary_Phone__c\",\n \"isExactMatch\":true,\n \"label\":\"主に使う電話番号\"\n }],\n \"entityName\":\"Contact\"\n },{\n \"entityFieldMaps\": [{\n \"doCreate\": false,\n \"doFind\": true,\n \"fieldName\": \"Name\",\n \"isExactMatch\": true,\n \"label\": \"Service Tag\"\n }],\n \"entityName\": \"Asset\",\n \"saveToTranscript\": \"Asset__c\"\n },{\n \"entityFieldMaps\": [{\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"Issue_Description__c\",\n \"isExactMatch\":true,\n \"label\":\"問題の記述\"\n }\n ],\n \"entityName\":\"Case\"\n }\n ]; \n } else {\n embedded_svc.settings.extraPrechatFormDetails = [\n {\"label\":\"First Name\", \"transcriptFields\":[\"FirstName__c\"]},\n {\"label\":\"Last Name\", \"transcriptFields\":[\"LastName__c\"]},\n {\"label\":\"Primary Phone Number\", \"transcriptFields\":[\"ContactNumber__c\"]},\n {\"label\":\"Email Address\", \"transcriptFields\":[\"Email__c\"]},\n {\"label\":\"Subject\", \"value\":issueVal, \"transcriptFields\":[\"Issue__c\"]},\n {\"label\":\"Service Tag\", \"value\":serviceTagVal, \"transcriptFields\":[\"Service_Tag__c\"]},\n {\"label\":\"Issue Description\", \"transcriptFields\":[\"Description__c\"]},\n {\"label\":\"AccountNumber\", \"transcriptFields\":[\"CustomerNumber__c\"]},\n {\"label\":\"Account BUID\", \"transcriptFields\":[\"CustomerBUID__c\"]}\n ]; \n// ,{\"label\":\"Long Description\", \"value\":descriptionText, \"transcriptFields\":[\"Long_Description__c\"]}\n embedded_svc.settings.extraPrechatInfo = [{\n \"entityFieldMaps\": [{\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"LastName\",\n \"isExactMatch\":true,\n \"label\":\"Last Name\"\n }, {\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"FirstName\",\n \"isExactMatch\":true,\n \"label\":\"First Name\"\n }, {\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"Email\",\n \"isExactMatch\":true,\n \"label\":\"Email\"\n }, {\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"Primary_Phone__c\",\n \"isExactMatch\":true,\n \"label\":\"Primary Phone Number\"\n }],\n \"entityName\":\"Contact\"\n },{\n \"entityFieldMaps\": [{\n \"doCreate\": false,\n \"doFind\": true,\n \"fieldName\": \"Name\",\n \"isExactMatch\": true,\n \"label\": \"Service Tag\"\n }],\n \"entityName\": \"Asset\",\n \"saveToTranscript\": \"Asset__c\"\n },{\n \"entityFieldMaps\": [{\n \"doCreate\":false,\n \"doFind\":true,\n \"fieldName\":\"Issue_Description__c\",\n \"isExactMatch\":true,\n \"label\":\"Issue Description\"\n }\n ],\n \"entityName\":\"Case\"\n }\n ]; \n } \n embedded_svc.init('https://dellservices--DEV3.cs20.my.salesforce.com', 'https://dev3-dev2-dellservices--dev2.cs20.force.com/LA', gslbBaseURL, '00Dm0000000DQXs', 'Test_Snap_In', { \n baseLiveAgentContentURL: 'https://c.la4-c1cs-phx.salesforceliveagent.com/content', \n deploymentId: '572m00000004Ckx', \n buttonId: '573m00000004DC9', \n baseLiveAgentURL: 'https://d.la4-c1cs-phx.salesforceliveagent.com/chat', \n eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04Im0000000001iEAA_16369f295e6', \n isOfflineSupportEnabled: false\n }); \n}", "title": "" }, { "docid": "e74677b2e8579c8bc96a1aefcef6164b", "score": "0.48745242", "text": "get phone(){return this._phone;}", "title": "" }, { "docid": "a23923e0826bd293cdad9fee36f17864", "score": "0.48718712", "text": "function start() {\n if (navigator.geolocation)\n navigator.geolocation.getCurrentPosition(print_geo, handler);\n else\n alert(\"Geolocation not supported by your browser!\");\n }", "title": "" }, { "docid": "305725c3bed59e1f33de5351e907cb3f", "score": "0.48690695", "text": "function getUserphone(){\n var userphone = null;\n if($(\"#side .pane-list-user\").find(\"img.avatar-image.is-loaded\").length != 0){\n var img = $(\"#side .pane-list-user\").find(\"img.avatar-image.is-loaded\"); \n userTel = img[0].src.match(/u=(\\d*)/); \n userphone = JSON.stringify(userTel);\n }\n return userphone;\n }", "title": "" }, { "docid": "f8b0ec835dc950ea439adc11cd160b6d", "score": "0.48682988", "text": "function openHybridOK(){\r\n\t\r\n\tif (ConstF.traceLog) console.log('openHybridOK - Time:' + new Date().getTime());\r\n\t\r\n\twindow.plugins.childBrowser.onLocationChange= function(loc){\r\n \t\t//if (loc.toString().indexOf('retail.do') != -1) _isLoginDone = true;\r\n\t\tif (loc.search('action=close')!=-1){\r\n\t\t\twindow.plugins.childBrowser.close();\r\n\t\t}\r\n\t\telse if(loc.search('action=logout')!=-1)\r\n\t\t{\r\n\t\t\twindow.plugins.childBrowser.close();\r\n\t\t\t//showLogOut(GestorIdiomas.getLiteral('logout_ok'));\r\n\t\t\t//_isLoginDone=false\r\n\t\t}\r\n\t\t\r\n\t\telse if(loc.search('action=forced')!=-1)\r\n\t\t{\r\n\t\t\twindow.plugins.childBrowser.close();\r\n\t\t\t//showLogOut(GestorIdiomas.getLiteral('logout_timeout'));\r\n\t\t\t//_isLoginDone=false\r\n\t\t\t\r\n\t\t} \r\n\t\tsetLangNative(loc); \r\n\t};\r\n\tvar url=null;\r\n\r\n\t\turl = ConstF.urlServer;\r\n\t\r\n\t\tif(url!=null){\r\n\t\t\t\r\n\t\t\t// APK - Flag\r\n\t\t\turl+= '?access=APK';\r\n\t\t\t\r\n\t\t\t// Language\r\n\t\t\tvar _lang = GestorIdiomas.getLang();\r\n\t\t\tif (_lang=='ar_SA'){_lang='ar_SA'}else{_lang='en_US'}\r\n\t\t\turl+= '&locale='+_lang;\r\n\t\t}\r\n\r\n\twindow.plugins.childBrowser.showWebPage(url, { showLocationBar: false });\t\t\r\n\r\n}", "title": "" }, { "docid": "a42a86f6427e654ef73557e551ce0eee", "score": "0.4861403", "text": "open () {\n super.open('http://www.phptravels.net/account') //this will append `contact-us` to the baseUrl to form complete URL\n //browser.pause(2000);\n }", "title": "" }, { "docid": "3f032740662cb6f2cb2a222c1b93b41d", "score": "0.48578736", "text": "function airtimeTopUp(username,password,phoneno,network,amount){\n\n\t\tvar provider;\n\t\tswitch(network){\n\t\t\tcase \"mtn\":\n\t\t\t\tprovider = 15;\n\t\t\t\tbreak;\n\t\t\tcase \"airtel\":\n\t\t\t\tprovider = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"9mobile\":\n\t\t\t\tprovider = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"glo\" :\n\t\t\t\tprovider = 6;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprovider = 4;\n\t\t}\n\t\tvar url = \"https://mobileairtimeng.com/httpapi/?userid=\"+username+\"&pass=\"+password+\"&network=\"+provider+\"&phone=\"+phoneno+\"&amt=\"+amount;\n\t\tvar xmlHttp = new XMLHttpRequest();\n\t\txmlHttp.open( \"get\", url, false ); // false for synchronous request\n\t\txmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\t\txmlHttp.send();\n\t\tvar res = xmlHttp.responseText; \n\t\talert(rest);\n\t}", "title": "" }, { "docid": "7c196502d2c1d58efc23e60306139635", "score": "0.48549864", "text": "function startUp() {\n connectAPI();\n isIBotRunning = true;\n $(\"#chat-txt-message\").attr(\"maxlength\", \"99999999999999999999\");\n API.sendChat(\":white_check_mark: \" + IBot.iBot + \" Ativado! :white_check_mark:\");\n }", "title": "" }, { "docid": "5ed23558ed4b9db19489ae1f98f2b34d", "score": "0.48464063", "text": "function Login_corredor_elementsExtraJS() {\n // screen (Login_corredor) extra code\n }", "title": "" }, { "docid": "011edbfd68b9884eb3aebf8d5d760aa5", "score": "0.4844652", "text": "function makeApiCall() { gapi.client.load('plus', 'v1', function() { var request = gapi.client.plus.people.get({ 'userId': 'me'\t}); request.execute(function(resp) { \n\t/*** save / validate user details for local authentication ***/\n\t$.getJSON(baseUrl+'appointments/syncuser', {value: resp}, function(response){ ( response.success ) ? loadCalendarApi(response.calendar) : handleAuthError( resp, response );}); });\t}); }", "title": "" }, { "docid": "8df70d132d21b53acee307ca1b45db41", "score": "0.48374218", "text": "getCode() {\n //console.debug('get code');\n let code = this._http.get('http://country.io/phone.json');\n return code;\n }", "title": "" }, { "docid": "c731ab6d65bdd5ef7bf4f242d5f6a3cf", "score": "0.4835228", "text": "init() {\n this.services.fetchPhones();\n }", "title": "" }, { "docid": "29ed55da7dbb69f4add695561e5ebf7f", "score": "0.48304814", "text": "function popopop() {\n pop(\"#name\", \"verto_demo_name\", calleridName);\n pop(\"#cid\", \"verto_demo_cid\", calleridNumber);\n pop(\"#textto\", \"verto_demo_textto\", \"\");\n\n pop(\"#login\", \"verto_demo_login\", extension);\n pop(\"#passwd\", \"verto_demo_passwd\", phonePassword);\n\n pop(\"#hostName\", \"verto_demo_hostname\", host);\n pop(\"#wsURL\", \"verto_demo_wsurl\", \"wss://\" + host + \":8082\");\n}", "title": "" }, { "docid": "8e8cbbb7a7bf1f2360f36d472db45d70", "score": "0.48288548", "text": "function getPlayerInfo(method){\r\n\t\tswitch(method){\r\n\t\t\tcase 'companyID': return $('a:first',$('ul#menutop li span:contains(\"Company\")').next('ul')).attr('href').match(/\\d+/)[0];\r\n\t\t\tcase 'server'\t: return url.match(/virtonomic*.*\\/(.*)\\/main|window/)[1];\r\n\t\t\tdefault : return \"\";\r\n\t\t\t};\r\n\t}", "title": "" }, { "docid": "e282bd1d14950121ba1ff708aecb8f02", "score": "0.48258203", "text": "function initWebApp() {\n \n if (isVisibleSearchFormAtLaunch()) {\n toggleSearchOn();\n }\n else {\n toggleSearchOff();\n }\n\n if (isVisibleMapTools()) {\n toggleZoomOn();\n }\n else {\n toggleZoomOff();\n }\n \n // register all listeners for webapp controls\n $(\"#searchBtn\").click(toggleSearch);\n \n $(\"#lieuRech\").keypress(rechKeyPress);\n $(\"#lieuRech\").keyup(function(e) {rechKeyUp(e);});\n\n $(\"#catalogBtn\").click(displayCatalog);\n $(\"#reglagesBtn\").click(displayReglages);\n $(\"#parametersBtn\").click(displayParameters);\n $(\"#creditsBtn\").click(displayCredits);\n $(\"#coordBtn\").click(enableTracing);\n $(\"#coordBtnAct\").click(disableTracing);\n\n $(\"#geolocBtn\").click(enableTraking);\n $(\"#geolocBtnAct\").click(disableTraking);\n\n $(\"#catalog .closeButton\").click(closeCatalog);\n $(\"#catalog .backButton\").click(closeCatalog);\n\n $(\"#reglages .closeButton\").click(closeReglages);\n $(\"#reglages .backButton\").click(closeReglages);\n\n $(\"#parameters .closeButton\").click(closeParameters);\n $(\"#parameters .backButton\").click(backToReglages);\n\n $(\"#credits .closeButton\").click(closeCredits);\n $(\"#credits .backButton\").click(backFromCredits);\n \n $(\"#toolZoom\").click(zoomClick);\n $(\"#toolSearch\").click(searchClick);\n\n $(\"#clearSearch\").click(emptySearch);\n\n $(\"#zoomin\").click(zoomInMap);\n $(\"#zoomout\").click(zoomOutMap);\n \n hideAddressBar();\n initSRS(); \n initCouches();\n \n coordinatesSRS = (localStorage && (localStorage.getItem('mobile.ign.coordinatesSRS')!=null)) ? localStorage.getItem('mobile.ign.coordinatesSRS') : \"geo\";\n localStorage.setItem('mobile.ign.sys', currentBBox.projections[0]);\n localStorage.setItem('mobile.ign.showCoordinates', 0);\n}", "title": "" }, { "docid": "0cc54947853e738e9dbdcfa3a0b58e3a", "score": "0.48213914", "text": "function onCreate (event) // called only once - bind events here\n{\n try{\n common.PutToDebugLog(4, \"EVENT, _dialpad: onCreate\");\n \n// navigation done with js, so target URL will not be displayed in browser statusbar\n j$(\"#nav_dp_contacts\").on(\"click\", function()\n {\n j$.mobile.changePage(\"#page_contactslist\", { transition: \"none\", role: \"page\" });\n });\n j$(\"#nav_dp_callhistory\").on(\"click\", function()\n {\n j$.mobile.changePage(\"#page_callhistorylist\", { transition: \"none\", role: \"page\" });\n });\n \n j$(\"#nav_dp_dialpad\").attr(\"title\", stringres.get(\"hint_dialpad\"));\n j$(\"#nav_dp_contacts\").attr(\"title\", stringres.get(\"hint_contacts\"));\n j$(\"#nav_dp_callhistory\").attr(\"title\", stringres.get(\"hint_callhistory\"));\n \n j$(\"#status_dialpad\").attr(\"title\", stringres.get(\"hint_status\"));\n j$(\"#curr_user_dialpad\").attr(\"title\", stringres.get(\"hint_curr_user\"));\n j$(\".img_encrypt\").attr(\"title\", stringres.get(\"hint_encicon\"));\n j$(\"#dialpad_not_btn\").on(\"click\", function()\n {\n common.SaveParameter('notification_count2', 0);\n common.ShowNotifications2(); // repopulate notifications (hide red dot number)\n });\n \n j$(\"#phone_number\").attr(\"title\", stringres.get(\"hint_phone_number\"));\n \n j$(\"#phone_number\").on('input', function() // input text on change listener\n {\n PhoneInputOnChange();\n });\n\n j$(\"#btn_showhide_numpad\").on(\"click\", function()\n {\n try{\n if (btn_isvoicemail)\n {\n MenuVoicemail();\n }else\n {\n if (j$('#dialpad_btn_grid').css('display') === 'none')\n {\n j$('#dialpad_btn_grid').show();\n }else\n {\n j$('#dialpad_btn_grid').hide();\n }\n\n MeasureDialPad();\n }\n \n } catch(err2) { common.PutToDebugLogException(2, \"_dialpad: btn_showhide_numpad on click\", err2); }\n });\n j$(\"#btn_showhide_numpad\").attr(\"title\", stringres.get(\"hint_numpad\"));\n \n j$('#dialpad_list').on('click', '.ch_anchor', function(event)\n {\n OnListItemClick(j$(this).attr('id'));\n });\n\n j$('#dialpad_list').on('taphold', '.ch_anchor', function(event) // also show context menu\n {\n var id = j$(this).attr('id');\n if (!common.isNull(id))\n {\n id = id.replace('recentitem_', 'recentmenu_');\n OnListItemClick(id, true);\n }\n });\n\n j$('#dialpad_list').on('click', '.ch_menu', function(event)\n {\n OnListItemClick(j$(this).attr('id'));\n });\n\n \n j$(\"#btn_voicemail\").on(\"click\", function()\n {\n try{\n if (common.GetParameterInt('voicemail', 2) !== 2)\n {\n QuickCall();\n }else\n {\n var vmNumber = common.GetParameter(\"voicemailnum\");\n\n if (!common.isNull(vmNumber) && vmNumber.length > 0)\n {\n StartCall(vmNumber);\n }else\n {\n SetVoiceMailNumber(function (vmnr)\n {\n if (!common.isNull(vmnr) && vmnr.length > 0) { StartCall(vmnr); }\n });\n }\n }\n } catch(err2) { common.PutToDebugLogException(2, \"_dialpad: btn_voicemail on click\", err2); }\n });\n j$(\"#btn_voicemail\").attr(\"title\", stringres.get(\"hint_voicemail\"));\n \n var trigerred = false; // handle multiple clicks\n j$(\"#btn_call\").on(\"click\", function()\n {\n common.PutToDebugLog(4, 'EVENT, dialpad call button clicked');\n if (trigerred) { return; }\n \n trigerred = true;\n setTimeout(function ()\n {\n trigerred = false;\n }, 1000);\n \n//-- tunnel should not allow call without server address set (direct call to sip uri)\n if (common.GetParameter('serverinputisupperserver') === 'true')\n {\n if (common.isNull(common.GetSipusername()) || common.GetSipusername().length <= 0 ||\n common.isNull(common.GetParameter('password')) || common.GetParameter('password').length <= 0 )\n//-- || common.isNull(common.GetParameter('upperserver')) || common.GetParameter('upperserver').length <= 0)\n {\n return;\n }\n }\n \n var field = document.getElementById('phone_number');\n if ( common.isNull(field) ) { return; }\n \n var phoneNumber = field.value;\n var lastDialed = common.GetParameter(\"redial\");\n\n if (common.isNull(phoneNumber) || phoneNumber.length < 1)\n {\n if (!common.isNull(lastDialed) && lastDialed.length > 0)\n {\n field.value = lastDialed;\n }else\n {\n common.PutToDebugLog(1, stringres.get('err_msg_3'));\n return;\n }\n }else\n {\n phoneNumber = common.Trim(phoneNumber);\n StartCall(phoneNumber);\n common.SaveParameter(\"redial\", phoneNumber);\n j$('#disprate_container').html('&nbsp;');\n }\n });\n \n j$(\"#btn_call\").attr(\"title\", stringres.get(\"hint_btn_call\"));\n\n // listen for enter onclick, and click Call button\n j$( \"#page_dialpad\" ).keypress(function( event )\n { \n HandleKeyPress(event);\n });\n\n // listen for control key, so we don't catch ctrl+c, ctrl+v\n j$( \"#page_dialpad\" ).keydown(function(event)\n {\n try{\n var charCode = (event.keyCode) ? event.keyCode : event.which; // workaround for firefox\n \n if (charCode == ctrlKey) { ctrlDown = true; return true; }\n if (charCode == altKey) { altDown = true; return true; }\n if (charCode == shiftKey) { shiftDown = true; return true; }\n if (event.ctrlKey || event.metaKey || event.altKey) { specialKeyDown = true; return true; }\n\n if ( charCode === 8) // backspace\n {\n//-- event.preventDefault();\n if (j$('#phone_number').is(':focus') === false)\n {\n BackSpaceClick();\n }\n }\n else if ( charCode === 13)\n {\n//-- event.preventDefault();\n if (j$(\".ui-page-active .ui-popup-active\").length > 0)\n {\n var pop = j$.mobile.activePage.find(\".messagePopup\")\n if (!common.isNull(pop) && (pop.attr(\"id\") === 'adialog_videocall' || pop.attr(\"id\") === 'adialog_screensharecall')) // initiate video call\n {\n j$('#adialog_positive').click();\n }\n return false;\n }\n j$(\"#btn_call\").click();\n }\n } catch(err) { common.PutToDebugLogException(2, \"_dialpad: keydown\", err); }\n\n })//--.keyup(function(event)\n//-- {\n//-- try{\n//-- var charCode = (event.keyCode) ? event.keyCode : event.which; // workaround for firefox\n\n//-- if (charCode == ctrlKey) { ctrlDown = false; }\n//-- if (charCode == altKey) { altDown = false; }\n//-- if (charCode == shiftKey) { shiftDown = false; }\n//-- if (event.ctrlKey || event.metaKey || event.altKey) { specialKeyDown = false; }\n \n//-- return false;\n//-- } catch(err) { common.PutToDebugLogException(2, \"_dialpad: keyup\", err); }\n//-- });\n\n j$(\"#btn_message\").on(\"click\", function()\n {\n//-- if (common.GetConfigInt('brandid', -1) === 60) // 101VOICEDT500\n//-- {\n//-- MenuVoicemail();\n//-- }else\n//-- {\n MsgOnClick();\n//-- }\n });\n j$(\"#btn_message\").attr(\"title\", stringres.get(\"hint_message\"));\n \n//-- if (common.GetConfigInt('brandid', -1) === 60) // 101VOICEDT500\n//-- {\n//-- j$(\"#btn_message_img\").attr(\"src\", '' + common.GetElementSource() + 'images/btn_voicemail_txt_big.png');\n//-- j$(\"#btn_message\").attr(\"title\", stringres.get(\"hint_voicemail\"));\n//-- }\n//-- !!! DEPRECATED\n//-- j$(\"#dialpad_notification\").on(\"click\", function()\n//-- {\n//-- common.NotificationOnClick();\n//-- });\n\n j$('#dialpad_notification_list').on('click', '.nt_anchor', function(event)\n {\n j$(\"#dialpad_not\").panel( \"close\" );\n common.NotificationOnClick2(j$(this).attr('id'), false);\n });\n j$('#dialpad_notification_list').on('click', '.nt_menu', function(event)\n {\n j$(\"#dialpad_not\").panel( \"close\" );\n common.NotificationOnClick2(j$(this).attr('id'), true);\n });\n \n j$( window ).resize(function() // window resize handling\n {\n if (j$.mobile.activePage.attr('id') === 'page_dialpad')\n {\n MeasureDialPad();\n }\n });\n \n j$('#dialpad_menu_ul').on('click', 'li', function(event)\n {\n MenuItemSelected(j$(this).attr('id'));\n });\n j$(\"#btn_dialpad_menu\").on(\"click\", function() { CreateOptionsMenu('#dialpad_menu_ul'); });\n j$(\"#btn_dialpad_menu\").attr(\"title\", stringres.get(\"hint_menu\"));\n \n setTimeout(function ()\n {\n var displaypopup = false;\n if (common.GetParameterBool('customizedversion', true) !== true && common.GetParameter('displaypopupdirectcalls') === 'true')\n {\n//-- in this case we have to watch 'upperserver', NOT 'serveraddress_user'\n//-- if (common.GetParameter('serverinputisupperserver') === 'true')\n//-- {\n if ( common.isNull(common.GetSipusername()) || common.GetSipusername().length <= 0\n || common.isNull(common.GetParameter('password')) || common.GetParameter('password').length <= 0 )\n {\n displaypopup = true;\n }\n//-- }else\n//-- {\n//-- if ((common.isNull(common.GetSipusername()) || common.GetSipusername().length <= 0\n//-- || common.isNull(common.GetParameter('password')) || common.GetParameter('password').length <= 0))\n//-- {\n//-- if ((common.isNull(common.GetParameter('serveraddress_user')) || common.GetParameter('serveraddress_user').length <= 0)\n//-- && (common.isNull(common.GetParameter('serveraddress_orig')) || common.GetParameter('serveraddress_orig').length <= 0)\n//-- && (common.isNull(common.GetParameter('serveraddress')) || common.GetParameter('serveraddress').length <= 0))\n//-- {\n//-- displaypopup = true;\n//-- }\n//-- }\n//-- }\n }\n \n if (displaypopup)\n {\n common.SaveParameter('displaypopupdirectcalls', 'false');\n//-- common.AlertDialog(stringres.get('warning'), stringres.get('warning_msg_1'));\n common.ShowToast(stringres.get('warning_msg_1'), 6000);\n }\n },3000);\n \n j$(\"#btn_dp_1\").on(\"tap\", function()\n {\n PutNumber('1');\n \n//-- if (global.isdebugversionakos)\n//-- {\n//-- common.UriParser(common.GetParameter('creditrequest'), '', '', '', '', 'creditrequest');\n \n//-- var balanceuri = 'http://88.150.183.87:80/mvapireq/?apientry=balance&authkey=1568108345&authid=9999&authmd5=760e4155f1f1c8e614664e20fff73290&authsalt=123456&now=415';\n//-- common.UriParser(balanceuri, '', '', '', '', 'creditrequest');\n//-- }\n \n });\n j$(\"#btn_dp_2\").on(\"tap\", function()\n {\n PutNumber('2');\n });\n j$(\"#btn_dp_3\").on(\"tap\", function()\n {\n PutNumber('3');\n });\n j$(\"#btn_dp_4\").on(\"tap\", function()\n {\n PutNumber('4');\n });\n j$(\"#btn_dp_5\").on(\"tap\", function()\n {\n PutNumber('5');\n });\n j$(\"#btn_dp_6\").on(\"tap\", function()\n {\n PutNumber('6');\n });\n j$(\"#btn_dp_7\").on(\"tap\", function()\n {\n PutNumber('7');\n });\n j$(\"#btn_dp_8\").on(\"tap\", function()\n {\n PutNumber('8');\n });\n j$(\"#btn_dp_9\").on(\"tap\", function()\n {\n PutNumber('9');\n });\n j$(\"#btn_dp_0\").on(\"tap\", function(evt)\n {\n PutNumber('0');\n });\n j$(\"#btn_dp_ast\").on(\"tap\", function()\n {\n PutNumber('*');\n });\n j$(\"#btn_dp_diez\").on(\"tap\", function()\n {\n PutNumber('#');\n });\n \n// long cliks\n j$(\"#btn_dp_0\").on(\"taphold\", function(evt)\n {\n PutCharLongpress(['+']);\n });\n\n \n j$(\"#btn_backspace\").on(\"click\", function()\n {\n BackSpaceClick();\n });\n \n j$(\"#btn_backspace\").on(\"taphold\", function()\n {\n if (!common.isNull( document.getElementById('phone_number') ))\n {\n document.getElementById('phone_number').value = '';\n }\n \n PhoneInputOnChange();\n });\n if (common.GetColortheme() === 11)\n {\n j$(\"#btn_backspace_img\").attr(\"src\",\"' + common.GetElementSource() + 'images/btn_backspace_txt_grey.png\");\n }\n \n \n setTimeout(function ()\n {\n common.GetContacts(function (success)\n {\n if (!success)\n {\n common.PutToDebugLog(2, 'EVENT, _dialpad: LoadContacts failed onCreate');\n }\n });\n }, 500);\n \n setTimeout(function ()\n {\n common.ReadCallhistoryFile(function (success)\n {\n if (!success)\n {\n common.PutToDebugLog(2, 'EVENT, _dialpad: load call history failed onCreate');\n }\n });\n }, 1000);\n \n var advuri = common.GetParameter('advertisement');\n if (!common.isNull(advuri) && advuri.length > 5)\n {\n j$('#advert_dialpad_frame').attr('src', advuri);\n j$('#advert_dialpad').show();\n }\n \n if (common.UsePresence2() === true)\n {\n j$(\"#dialpad_additional_header_left\").on(\"click\", function()\n {\n common.PresenceSelector('dialpad');\n });\n j$(\"#dialpad_additional_header_left\").css(\"cursor\", \"pointer\");\n }\n\n// showratewhiletype = 0; // show rating on dialpad page, while typing the destination number // 0=no, 1=yes\n var srateStr = common.GetConfig('showratewhiletype');\n if (common.isNull(srateStr) || srateStr.length < 1 || !common.IsNumber(srateStr)) { srateStr = common.GetParameter2('showratewhiletype'); }\n if (common.isNull(srateStr) || srateStr.length < 1 || !common.IsNumber(srateStr)) { srateStr = '0'; }\n global.showratewhiletype_cache = common.StrToInt(srateStr);\n \n if (global.showratewhiletype_cache > 0 && !common.isNull(document.getElementById(\"disprate_container\")) && common.GetParameter('ratingrequest').length > 0)\n {\n document.getElementById(\"disprate_container\").style.display = 'block';\n }\n\n \n//-- in IE8 under WinXP aterisk is not displayed properly\n//-- if (common.IsIeVersion(8))\n//-- {\n//-- j$(\"#dialpad_asterisk\").html(\"*\");\n//-- }\n \n j$(\"#btn_dialpad_engine_close\").on(\"click\", function(event)\n {\n common.SaveParameter('ignoreengineselect', 'true');\n\n j$('#settings_engine').hide();\n j$('#dialpad_engine').hide();\n \n MeasureDialPad();\n });\n \n j$(\"#btn_dialpad_engine\").on(\"click\", function(event)\n {\n common.SaveParameter('ignoreengineselect', 'true');\n\n j$('#settings_engine').hide();\n j$('#dialpad_engine').hide();\n \n if (common.isNull(chooseenginetouse) || chooseenginetouse.length < 1) { return; }\n MeasureDialPad();\n \n// handle click action based on selected engine\n if (chooseenginetouse === 'java'){ ; }\n else if (chooseenginetouse === 'webrtc') { common.EngineSelect(1); }\n else if (chooseenginetouse === 'ns') { common.NPDownloadAndInstall(); }\n else if (chooseenginetouse === 'flash')\n {\n ; // akos todo: implement for flash\n }\n else if (chooseenginetouse === 'app')\n {\n ;\n }\n\n// save clicked engine\n var engine = common.GetEngine(chooseenginetouse);\n if (!common.isNull(engine))\n {\n engine.clicked = 2;\n common.SetEngine(chooseenginetouse, engine);\n \n common.OpenSettings(true);\n \n // wait for settings to launch\n setTimeout(function ()\n {\n common.ShowToast(common.GetEngineDisplayName(chooseenginetouse) + ' ' + stringres.get('ce_use'), function ()\n {\n common.ChooseEngineLogic2(chooseenginetouse);\n chooseenginetouse = '';\n });\n }, 400);\n }\n });\n \n } catch(err) { common.PutToDebugLogException(2, \"_dialpad: onCreate\", err); }\n}", "title": "" }, { "docid": "fa6c6a97376a0d54ee4ae46530129749", "score": "0.48154685", "text": "function callCongressperson(phoneNumber, officeId) {\n updateCallStatus(\"Calling \" + phoneNumber + \"...\");\n\n var params = {\"phoneNumber\": phoneNumber, \"officeId\": officeId};\n Twilio.Device.connect(params);\n}", "title": "" }, { "docid": "11ed9ffccad5b02fd282d1c3eba7c677", "score": "0.48116022", "text": "function initPhone () {\n if (!valPhone()) {\n window.alert('Invalid phone number entered. Valid format is XXX-XXX-XXXX.')\n }\n}", "title": "" }, { "docid": "5f0677140f57b98b232ae9605745c9fa", "score": "0.48093462", "text": "function WebGLActiveInfo(){}", "title": "" }, { "docid": "6b8b4519d644e89bb6a73cf430ce1caf", "score": "0.48013598", "text": "function onButtonPhoneClick(event) {\n openModal(\n helpPhoneModal,\n buttonClosePhoneModal,\n onButtonClosePhoneModalClick,\n phoneSubmitButton,\n onPhoneSubmitClick,\n phoneInput,\n );\n }", "title": "" }, { "docid": "d53aa7be5ec92f87cfdb5c8f046b4a25", "score": "0.48013097", "text": "function initialize() {\n $(\"body\").on(\"pagecontainerchange\", function (event, ui) {\n if (ui.toPage.attr(\"id\") === \"new-conversation-page\") {\n $(\"#new-conversation-recipient-input\").val(\"\");\n $(\"#new-conversation-message-textarea\").val(\"\");\n }\n });\n $(\"#new-conversation-contacts-button\").on(\"click\", function () {\n window.plugins.ContactChooser.chooseContact(function (contactData) {\n if (contactData.phoneNumber === \"\") {\n ui.notifications.showToastNotification(\"Selected contact does not have a phone number.\");\n }\n else {\n var filteredPhoneNumber = contactData.phoneNumber;\n filteredPhoneNumber = filteredPhoneNumber.replace(/[^\\d]/g, \"\");\n filteredPhoneNumber = filteredPhoneNumber.replace(/^.*(\\d{10})$/, \"$1\");\n $(\"#new-conversation-recipient-input\").val(filteredPhoneNumber);\n }\n });\n });\n $(\"#new-conversation-send-button\").on(\"click\", function () {\n var textarea = $(\"#new-conversation-message-textarea\");\n var filteredPhoneNumber = $(\"#new-conversation-recipient-input\").val().replace(/[^\\d]/g, \"\").replace(/^.*(\\d{10})$/, \"$1\");\n if (filteredPhoneNumber.length !== 10) {\n ui.notifications.showToastNotification(\"Phone number is not valid.\");\n }\n else if (textarea.val().length > 160) {\n ui.notifications.showToastNotification(\"Message exceeds 160 characters.\");\n }\n else if (textarea.val() === \"\") {\n ui.notifications.showToastNotification(\"Message is empty.\");\n }\n else {\n ui.loading.startLoading();\n api.sendSms(settings.getUsername(), settings.getPassword(), settings.getLocalPhoneNumber(), filteredPhoneNumber, textarea.val(), function (successful, err) {\n if (successful) {\n history.back();\n }\n else {\n ui.notifications.showToastNotification(err);\n }\n ui.loading.stopLoading();\n });\n }\n });\n }", "title": "" }, { "docid": "a03c9e99bae85eda1717ed20f5438688", "score": "0.47992352", "text": "changePhoneNumber(number)\n {\n const { phone_number } = this.props;\n if (this.phone.getISOCode()) {\n const country_code = this.phone.getCountryCode();\n \n this.props.getProfileText({prop:'phone_number',value:{\n code:country_code,\n number:phone_number.number\n }});\n }\n else {\n this.props.getProfileText({prop:'phone_number',value:{\n code:'',\n number:phone_number.number\n }});\n }\n const num = number;\n this.props.getProfileText({prop:'phone_number',value:{\n code:phone_number.code,\n number:num\n }});\n \n }", "title": "" }, { "docid": "86ba2cfc86e6f2b34b79134888e93d97", "score": "0.47908935", "text": "function determinePhoneBrowsing() {\n // Determine if the user is browsing on mobile based on browser window width or browser type\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth < phoneBrowsingCutoff) {\n phoneBrowsing = true;\n }\n\n //\n if (phoneBrowsing === true) {\n $(\".step\")\n .css(\"font-size\", \"18pt\");\n\n $(\".step .body\")\n .css(\"font-size\", \"18pt\");\n }\n\n // On mobile, fade non-current annotation slides to 0, because they are all fixed at the top and overlapping\n // On desktop keep them visible, but low opacity\n if (phoneBrowsing === true) {\n hiddenOpacity = 0.0;\n }\n else {\n hiddenOpacity = 0.2;\n }\n\n // If mobile, and annotations are up top, adjust top-padding on viz-tiles to make room for fixed-position annotation\n if (phoneBrowsing === true) {\n setDynamicPadding('#sunburst-tile', 1, 7);\n setDynamicPadding('#flowchart-tile', 8, 13);\n }\n}", "title": "" }, { "docid": "c157890e14f98339f9d26c9b2f5e78bc", "score": "0.47901088", "text": "function LeesWaarden(){\n webiopi().callMacro(\"WaardenUI\", [], updateUI); \n}", "title": "" }, { "docid": "19a6b0e48e121c5d028b8dadeae826fe", "score": "0.4787733", "text": "function s_track_liveperson_proactive(s_ev, s_v47) {\r\n\t\t s_acc='sapdev'; // testing\r\n\t\tfunction s_cr(cn){var i,x,y,c=document.cookie.split(\";\");for(i=0;i<c.length;i++){x=c[i].substr(0,c[i].indexOf(\"=\"));y=c[i].substr(c[i].indexOf(\"=\")+1);x=x.replace(/^\\s+|\\s+$/g,\"\");if(x==cn){return unescape(y);}}}\r\n\t\tfunction s_gfa(app,col,cty){if (typeof(s_app)=='undefined') return '';if (typeof(app) == 'undefined') return '';if (typeof(col)=='undefined') return '';if (typeof(cty)=='undefined') return '';for(var c=0;c<s_app[app].length;c++){if(s_app[app][c].sd==cty)return s_app[app][c][col];}return '';}\r\n\t\tfunction s_gc(u){if(typeof(u)=='undefined')var u=location.href;if(typeof(s_app)=='undefined')return '';u=u.toLowerCase().match(/sap\\.com\\/([^/]+)/);if(u&&u[1]){for(var c=0;c<s_app.A.length;c++){if(s_app.A[c].sd==u[1])return u[1];}}return '';}\r\n\t\tvar s_app={\"A\":[{\"sd\":\"africa\",\"rs\":\"sapcomafr\",\"re\":\"emea\",\"co\":\"afr\"},{\"sd\":\"americas\",\"rs\":\"sapcomams\",\"re\":\"oth\",\"co\":\"ams\"},{\"sd\":\"andeancarib\",\"rs\":\"sapcomand\",\"re\":\"la\",\"co\":\"and\"},{\"sd\":\"argentina\",\"rs\":\"sapcomar\",\"re\":\"la\",\"co\":\"ar\"},\r\n\t\t {\"sd\":\"asia\",\"rs\":\"sapcomapj\",\"re\":\"apj\",\"co\":\"apj\"},{\"sd\":\"australia\",\"rs\":\"sapcomau\",\"re\":\"apj\",\"co\":\"au\"},{\"sd\":\"austria\",\"rs\":\"sapcomat\",\"re\":\"emea\",\"co\":\"at\"},{\"sd\":\"baltics\",\"rs\":\"sapcomblt\",\"re\":\"emea\",\"co\":\"blt\"},\r\n\t\t {\"sd\":\"belgie\",\"rs\":\"sapcombe\",\"re\":\"emea\",\"co\":\"be\"},{\"sd\":\"belgique\",\"rs\":\"sapcombe\",\"re\":\"emea\",\"co\":\"be\"},{\"sd\":\"belux\",\"rs\":\"sapcomblx\",\"re\":\"emea\",\"co\":\"blx\"},{\"sd\":\"bolivia\",\"rs\":\"sapcombo\",\"re\":\"la\",\"co\":\"bo\"},\r\n\t\t {\"sd\":\"brazil\",\"rs\":\"sapcombr\",\"re\":\"la\",\"co\":\"br\"},{\"sd\":\"bulgaria\",\"rs\":\"sapcombg\",\"re\":\"emea\",\"co\":\"bg\"},{\"sd\":\"canada\",\"rs\":\"sapcomca\",\"re\":\"na\",\"co\":\"ca\"},{\"sd\":\"caribe\",\"rs\":\"sapcomcrb\",\"re\":\"la\",\"co\":\"crb\"},\r\n\t\t {\"sd\":\"centralamerica\",\"rs\":\"sapcomcam\",\"re\":\"la\",\"co\":\"cam\"},{\"sd\":\"chile\",\"rs\":\"sapcomcl\",\"re\":\"la\",\"co\":\"cl\"},{\"sd\":\"china\",\"rs\":\"sapcomcn\",\"re\":\"apj\",\"co\":\"cn\"},{\"sd\":\"cis\",\"rs\":\"sapcomcis\",\"re\":\"emea\",\"co\":\"cis\"},\r\n\t\t {\"sd\":\"colombia\",\"rs\":\"sapcomco\",\"re\":\"la\",\"co\":\"co\"},{\"sd\":\"croatia\",\"rs\":\"sapcomhr\",\"re\":\"emea\",\"co\":\"hr\"},{\"sd\":\"cyprus\",\"rs\":\"sapcomcy\",\"re\":\"emea\",\"co\":\"cy\"},{\"sd\":\"cz\",\"rs\":\"sapcomcz\",\"re\":\"emea\",\"co\":\"cz\"},\r\n\t\t {\"sd\":\"denmark\",\"rs\":\"sapcomdk\",\"re\":\"emea\",\"co\":\"dk\"},{\"sd\":\"estonia\",\"rs\":\"sapcomee\",\"re\":\"emea\",\"co\":\"ee\"},{\"sd\":\"finland\",\"rs\":\"sapcomfi\",\"re\":\"emea\",\"co\":\"fi\"},{\"sd\":\"france\",\"rs\":\"sapcomfr\",\"re\":\"emea\",\"co\":\"fr\"},\r\n\t\t {\"sd\":\"germany\",\"rs\":\"sapcomde\",\"re\":\"emea\",\"co\":\"de\"},{\"sd\":\"greece\",\"rs\":\"sapcomgr\",\"re\":\"emea\",\"co\":\"gr\"},{\"sd\":\"hk\",\"rs\":\"sapcomhk\",\"re\":\"apj\",\"co\":\"hk\"},{\"sd\":\"hungary\",\"rs\":\"sapcomhu\",\"re\":\"emea\",\"co\":\"hu\"},\r\n\t\t {\"sd\":\"india\",\"rs\":\"sapcomin\",\"re\":\"apj\",\"co\":\"in\"},{\"sd\":\"indonesia\",\"rs\":\"sapcomid\",\"re\":\"apj\",\"co\":\"id\"},{\"sd\":\"israel\",\"rs\":\"sapcomil\",\"re\":\"emea\",\"co\":\"il\"},{\"sd\":\"italy\",\"rs\":\"sapcomit\",\"re\":\"emea\",\"co\":\"it\"},\r\n\t\t {\"sd\":\"japan\",\"rs\":\"sapcomjp\",\"re\":\"apj\",\"co\":\"jp\"},{\"sd\":\"korea\",\"rs\":\"sapcomkr\",\"re\":\"apj\",\"co\":\"kr\"},{\"sd\":\"latinamerica\",\"rs\":\"sapcomla\",\"re\":\"la\",\"co\":\"lao\"},{\"sd\":\"latvia\",\"rs\":\"sapcomlv\",\"re\":\"emea\",\"co\":\"lv\"},\r\n\t\t {\"sd\":\"lithuania\",\"rs\":\"sapcomlt\",\"re\":\"emea\",\"co\":\"lt\"},{\"sd\":\"maghreb\",\"rs\":\"sapcommag\",\"re\":\"emea\",\"co\":\"mag\"},{\"sd\":\"malaysia\",\"rs\":\"sapcommy\",\"re\":\"apj\",\"co\":\"my\"},{\"sd\":\"mena\",\"rs\":\"sapcommna\",\"re\":\"emea\",\"co\":\"mna\"},\r\n\t\t {\"sd\":\"mena-ar\",\"rs\":\"sapsuite13\",\"re\":\"emea\",\"co\":\"mnar\"},{\"sd\":\"mexico\",\"rs\":\"sapcommx\",\"re\":\"la\",\"co\":\"mx\"},{\"sd\":\"netherlands\",\"rs\":\"sapcomnl\",\"re\":\"emea\",\"co\":\"nl\"},{\"sd\":\"norway\",\"rs\":\"sapcomno\",\"re\":\"emea\",\"co\":\"no\"},\r\n\t\t {\"sd\":\"pakistan\",\"rs\":\"sapcompk\",\"re\":\"apj\",\"co\":\"pk\"},{\"sd\":\"paraguay\",\"rs\":\"sapcompy\",\"re\":\"la\",\"co\":\"py\"},{\"sd\":\"peru\",\"rs\":\"sapcompe\",\"re\":\"la\",\"co\":\"pe\"},{\"sd\":\"philippines\",\"rs\":\"sapcomph\",\"re\":\"apj\",\"co\":\"ph\"},\r\n\t\t {\"sd\":\"poland\",\"rs\":\"sapcompl\",\"re\":\"emea\",\"co\":\"pl\"},{\"sd\":\"portugal\",\"rs\":\"sapcompt\",\"re\":\"emea\",\"co\":\"pt\"},{\"sd\":\"romania\",\"rs\":\"sapcomro\",\"re\":\"emea\",\"co\":\"ro\"},{\"sd\":\"serbia\",\"rs\":\"sapcomrs\",\"re\":\"emea\",\"co\":\"rs\"},\r\n\t\t {\"sd\":\"singapore\",\"rs\":\"sapcomsg\",\"re\":\"apj\",\"co\":\"sg\"},{\"sd\":\"sk\",\"rs\":\"sapcomsk\",\"re\":\"emea\",\"co\":\"sk\"},{\"sd\":\"slovenia\",\"rs\":\"sapcomsi\",\"re\":\"emea\",\"co\":\"si\"},{\"sd\":\"southafrica\",\"rs\":\"sapcomza\",\"re\":\"emea\",\"co\":\"za\"},\r\n\t\t {\"sd\":\"spain\",\"rs\":\"sapcomes\",\"re\":\"emea\",\"co\":\"es\"},{\"sd\":\"suisse\",\"rs\":\"sapcomch\",\"re\":\"emea\",\"co\":\"ch\"},{\"sd\":\"sweden\",\"rs\":\"sapcomse\",\"re\":\"emea\",\"co\":\"se\"},{\"sd\":\"swiss\",\"rs\":\"sapcomch\",\"re\":\"emea\",\"co\":\"ch\"},\r\n\t\t {\"sd\":\"taiwan\",\"rs\":\"sapcomtw\",\"re\":\"apj\",\"co\":\"tw\"},{\"sd\":\"thailand\",\"rs\":\"sapcomth\",\"re\":\"apj\",\"co\":\"th\"},{\"sd\":\"turkey\",\"rs\":\"sapcomtr\",\"re\":\"emea\",\"co\":\"tr\"},{\"sd\":\"uk\",\"rs\":\"sapcomui\",\"re\":\"emea\",\"co\":\"uk\"},\r\n\t\t {\"sd\":\"uruguay\",\"rs\":\"sapcomuy\",\"re\":\"la\",\"co\":\"uy\"},{\"sd\":\"usa\",\"rs\":\"sapcomus\",\"re\":\"na\",\"co\":\"us\"},{\"sd\":\"venezuela\",\"rs\":\"sapcomve\",\"re\":\"la\",\"co\":\"ve\"},{\"sd\":\"vietnam\",\"rs\":\"sapcomvn\",\"re\":\"apj\",\"co\":\"vn\"},{\"sd\":\"westbalkans\",\"rs\":\"sapcomwbk\",\"re\":\"emea\",\"co\":\"wbk\"}]};\r\n\t\tvar s_lu=\"2011.10.31\";var s_host=location.host;var s_acc,s_sv;if(typeof(s_acc)=='undefined'){if(s_host.match(/www(1|12|28|36)?\\.sap\\.com/i)){s_acc=(s_gfa(\"A\",\"rs\",s_gc())!='')?s_gfa(\"A\",\"rs\",s_gc()):'sapcomglobal';\r\n\t\t s_acc+=',sapglobal';s_sv='sap';}else if(s_host.toLowerCase()==\"store.businessobjects.com\"){s_acc='sapsuite1,sapglobal';s_sv='bobj';}else{s_acc='sapdev';s_sv='other';}} /*testing*/s_acc = 'sapdev';var s={};\r\n\t\t if(s_cr('client'))s.vid=s.v48=s.p48=s_cr('client').replace(/-/g,'');if(typeof(s_ev)!='undefined')s.ev=s_ev;s.sv=s_sv;s.p1='gl';s.p5='glo';if(s.sv=='sap'){s.p1=(s_gfa(\"A\",\"re\",s_gc())!='')?s_gfa(\"A\",\"re\",s_gc()):s.p1;\r\n\t\t s.p5=(s_gfa(\"A\",\"co\",s_gc())!='')?s_gfa(\"A\",\"co\",s_gc()):s.p5;}this.v47=(this.v47)?this.v47:'';if(typeof(s_v47)!='undefined')s.v47=this.v47=s_v47.toLowerCase();s.gn=s.v20=s.sv+\":\"+s.p1+\":liveperson:\"+this.v47;\r\n\t\t s.h1=s.v19=s.sv+\",\"+s.p1+\",\"+s.p5+\",liveperson,\"+this.v47;s.ch=s.v3='liveperson';s.v1=s.sv+':'+s.p5;s.v18='+1';s.p2='en-us';s.p50=s.sv+\":\"+s_lu+\"|gl:\"+s_lu;s.r=s.v51=window.location.href.replace(/index\\.epx#\\//,'');\r\n\t\ts_SRC=\"//sap.112.2o7.net/b/ss/\"+s_acc+\"/1/H.23.4--WAP?\";for(var v in s){s_SRC+=v+\"=\"+escape(s[v])+\"&\";}s.image=new Image(1,1);s.image.src=s_SRC;\r\n\t }", "title": "" }, { "docid": "1ec18b4a853376e7cc908fb14f34df41", "score": "0.47877133", "text": "function startup() {\n \"use strict\";\n\n console.log(\"trailhead.js\");\n\n var SMALL;\n if (Modernizr.mq(\"only screen and (max-width: 768px)\")) {\n SMALL = true;\n } else if (Modernizr.mq(\"only screen and (min-width: 769px)\")) {\n SMALL = false;\n }\n\n var TOUCH = $('html').hasClass('touch');\n // Map generated in CfA Account\n var MAPBOX_MAP_ID = \"codeforamerica.map-j35lxf9d\";\n var CENTERPOINT = {\n lat: 40.0274,\n lng: -105.2519,\n };\n\n // API_HOST: The API server. Here we assign a default server, then\n // test to check whether we're using the Heroky dev app or the Heroku production app\n // and reassign API_HOST if necessary\n // var API_HOST = window.location.protocol + \"//\" + window.location.host;\n var API_HOST = \"http://api.outerspatial.com/v0/\";\n // var API_HOST = \"http://trailsy.herokuapp.com\";\n // var API_HOST = \"http://trailsyserver-dev.herokuapp.com\";\n // var API_HOST = \"http://trailsyserver-prod.herokuapp.com\";\n // var API_HOST = \"http://10.0.1.102:3000\";\n // var API_HOST = \"http://10.0.2.2:3000\" // for virtualbox IE\n if (window.location.hostname.split(\".\")[0] == \"trailsy-dev\") {\n // API_HOST = \"http://trailsyserver-dev.herokuapp.com\";\n API_HOST = window.location.protocol + \"//\" + window.location.host;\n } else if (window.location.hostname.split(\".\")[0] == \"trailsyserver-dev\") {\n API_HOST = window.location.protocol + \"//\" + window.location.host;\n } else if (window.location.hostname.split(\".\")[0] == \"trailsy\" || window.location.hostname == \"www.tothetrails.com\") {\n API_HOST = window.location.protocol + \"//\" + window.location.host;\n // API_HOST = \"http://trailsyserver-prod.herokuapp.com\";\n }\n\n\n // Near-Global Variables\n var METERSTOMILESFACTOR = 0.00062137;\n var MAX_ZOOM = SMALL ? 16 : 17;\n var MIN_ZOOM = SMALL ? 13 : 14;\n var SECONDARY_TRAIL_ZOOM = 13;\n var SHORT_MAX_DISTANCE = 2.0;\n var MEDIUM_MAX_DISTANCE = 5.0;\n var LONG_MAX_DISTANCE = 10.0;\n var SHOW_ALL_TRAILS = 1;\n var USE_LOCAL = SMALL ? false : true; // Set this to a true value to preload/use a local trail segment cache\n var USE_SEGMENT_LAYER = true; // performance testing on mobile\n var USE_COMPLEX_SEGMENT_LAYER = SMALL ? false : true;\n var NORMAL_SEGMENT_COLOR = \"#678729\";\n var NORMAL_SEGMENT_WEIGHT = 3;\n var HOVER_SEGMENT_COLOR = \"#678729\";\n var HOVER_SEGMENT_WEIGHT = 6;\n var ACTIVE_TRAIL_COLOR = \"#445617\";\n var ACTIVE_TRAIL_WEIGHT = 9;\n var NOTRAIL_SEGMENT_COLOR = \"#FF0000\";\n var NOTRAIL_SEGMENT_WEIGHT = 3;\n var LOCAL_LOCATION_THRESHOLD = 100; // distance in km. less than this, use actual location for map/userLocation\n var centerOffset = SMALL ? new L.point(0, 0) : new L.Point(450, 0);\n var MARKER_RADIUS = TOUCH ? 12 : 4;\n var ALL_SEGMENT_LAYER_SIMPLIFY = 5;\n var map;\n var mapDivName = SMALL ? \"trailMapSmall\" : \"trailMapLarge\";\n var CLOSED = false;\n var customSmoothFactor = SMALL ? 1.5 : 1.0;\n\n var originalTrailData = {}; // all of the trails metadata (from traildata table), with trail ID as key\n // for yes/no features, check for first letter \"y\" or \"n\".\n // { *id*: { geometry: point(0,0), unused for now\n // properties: { id: *uniqueID* (same as key),\n // accessible: *disabled access. yes/no*,\n // dogs: *dog access. yes/no*,\n // equestrian: *horse access. yes/no*,\n // hike: *hiking access. yes/no*,\n // mtnbike: *mountain bike access. yes/no*,\n // roadbike: *street bike access. yes/no*,\n // xcntryski: *cross-country skiing access. yes/no*\n // conditions: *text field of qualifications to above access/use fields*,\n // description: *text description of trail*,\n // length: *length of trail in miles*,\n // map_url: *URL of trail map*,\n // name: *name of trail*,\n // source: *whose data this info came from (abbreviation)*,\n // source_fullname: *full name of source org*,\n // source_phone: *phone for source org*,\n // source_url: *URL of source org*,\n // status: *trail status. 0=open; 1=notice/warning; 2=closed*,\n // statustext: *trail status text. only displayed if status != 0\n // steward: *org to contact for more information (abbrev)*,\n // steward_fullname: *full name of steward org*,\n // steward_phone: *phone for steward org*,\n // steward_url: *URL of steward org*,\n // trlsurface: *not currently used*\n // }\n // }\n // }\n\n var originalTrailheads = []; // all trailheads (from trailsegments)\n // for yes/no features, check for first letter \"y\" or \"n\".\n //\n // [ { marker: *Leaflet marker*,\n // trails: *[array of matched trail IDs],\n // popupContent: *HTML of Leaflet popup*,\n // properties: { id: *uniqueID*,\n // drinkwater: *water available at this trailhead. yes/no*\n // distance: *from current location in meters*,\n // kiosk: *presence of informational kiosk. yes/no*,\n // name: *name*,\n // parking: *availability of parking. yes/no*,\n // restrooms: *availability of restrooms. yes/no*,\n // source: *whose data this info came from (abbreviation)*,\n // source_fullname: *full name of source org*,\n // source_phone: *phone number of source org*,\n // source_url: *URL of source org*,\n // steward: *org to contact for more information (abbrev)*,\n // steward_fullname: *full name of steward org*,\n // steward_phone: *phone number of steward org*,\n // steward_url: *URL of steward org*,\n // trail1: *trail at this trailhead*,\n // trail2: *trail at this trailhead*,\n // trail3: *trail at this trailhead*,\n // trail4: *trail at this trailhead*,\n // trail5: *trail at this trailhead*,\n // trail6: *trail at this trailhead*,\n // updated_at: *update time*,\n // created_at: *creation time*\n // },\n // }[, ...}]\n // ]\n var trailSegments = [];\n var currentMultiTrailLayer = {}; // We have to know if a trail layer is already being displayed, so we can remove it\n var currentTrailLayers = [];\n var currentHighlightedTrailLayer = {};\n var currentUserLocation = {};\n var anchorLocation = {};\n var currentTrailheadLayerGroup;\n var currentFilters = {\n lengthFilter: [],\n activityFilter: [],\n searchFilter: \"\"\n };\n var orderedTrails = [];\n var currentDetailTrail = null;\n var currentDetailTrailhead = null;\n var userMarker = null;\n var allSegmentLayer = null;\n var closeTimeout = null;\n var openTimeout = null;\n var currentWeightedSegment = null;\n var currentTrailPopup = null;\n var currentTrailhead = null;\n var orderedTrailIndex = 0;\n var geoWatchId = null;\n var currentTrailheadHover = null;\n var geoSetupDone = false;\n var segmentTrailnameCache = {};\n var currentTrailData;\n var searchKeyTimeout = null;\n var trailheadsFetched = false;\n var traildataFetched = false;\n var trailsegmentsFetched = false;\n var allInvisibleSegmentsArray = [];\n var allVisibleSegmentsArray = [];\n // Trailhead Variables\n // Not sure if these should be global, but hey whatev\n\n var remoteSegmentCache = {};\n\n var trailheadIconOptions = {\n iconSize: [52 * 0.60, 66 * 0.60],\n iconAnchor: [13 * 0.60, 33 * 0.60],\n popupAnchor: [0, -3]\n };\n\n var trailheadIcon1Options = $.extend(trailheadIconOptions, {\n iconUrl: 'img/icon_trailhead_active.png'\n });\n var trailheadIcon1 = L.icon(trailheadIcon1Options);\n var trailheadIcon2Options = $.extend(trailheadIconOptions, {\n iconUrl: 'img/icon_trailhead_active.png'\n });\n var trailheadIcon2 = L.icon(trailheadIcon2Options);\n\n\n // =====================================================================//\n // UI events to react to\n\n // $(\"#redoSearch\").click(reorderTrailsWithNewLocation);\n\n $('.closeDetail').click(closeDetailPanel); // Close the detail panel!\n $('.detailPanelControls').click(changeDetailPanel); // Shuffle Through Trails Shown in Detail Panel\n $('.filter').change(filterChangeHandler);\n\n $(\".clearSelection\").click(clearSelectionHandler);\n $(\".search-key\").keyup(function(e) { processSearch(e); });\n $(\".offsetZoomControl\").click(offsetZoomIn);\n $(\".search-submit\").click(processSearch);\n $(\".geolocateButton\").click(centerOnLocation);\n\n // Detail Panel Navigation UI events\n $('.hamburgerBox').click(moveSlideDrawer);\n\n $('.slider, .detailPanelBanner').click(slideDetailPanel);\n $(\".detailPanel\").hover(detailPanelHoverIn, detailPanelHoverOut);\n\n $(\".aboutLink\").click(openAboutPage);\n $(\".closeAbout\").click(closeAboutPage);\n // Shouldn't the UI event of a Map Callout click opening the detail panel go here?\n\n //if mobile, we expand 2 of the sidebar sections\n if(SMALL){\n $(\".trigger1\").addClass(\"active\");\n $(\".trigger3\").addClass(\"active\");\n }\n\n // =====================================================================//\n // Kick things off\n\n showOverlay();\n\n if ($(\"html\").hasClass(\"lt-ie8\")) {\n return; //abort, dont load\n }\n initialSetup();\n\n // =====================================================================//\n function showOverlay() {\n var overlayHTMLIE = \"<h1>Welcome to To The Trails!</h1>\" +\n \"<p>We're sorry, but To The Trails is not compatible with Microsoft Internet Explorer 8 or earlier versions of that web browser.\" +\n \"<p>Please upgrade to the latest version of \" +\n \"<a href='http://windows.microsoft.com/en-us/internet-explorer/download-ie'>Internet Explorer</a>, \" +\n \"<a href='http://google.com/chrome'>Google Chrome</a>, or \" +\n \"<a href='http://getfirefox.com'>Mozilla Firefox</a>.\" +\n \"<p>If you are currently using Windows XP, you'll need to download and use Chrome or Firefox.\" +\n \"<img src='/img/Overlay-Image-01.png' alt='trees'>\";\n\n var overlayHTML = \"<span class='closeOverlay'>x</span>\" +\n \"<h1>Welcome To The Trails!</h1>\" +\n \"<p>Pick trails, find your way, and keep your bearings as you move between trails and parks in Cuyahoga Valley National Park and Metro Parks, Serving Summit County and beyond.\" +\n \"<p>ToTheTrails.com is currently in public beta. It's a work in progress! We'd love to hear how this site is working for you.\" +\n \"<p>Send feedback and report bugs to <a href='mailto:hello@tothetrails.com?Subject=Feedback' target='_top'>hello@tothetrails.com</a>. Learn more on our 'About' page.\";\n\n var closedOverlayHTML = \"<h1>Visit us on your desktop!</h1>\" +\n \"<p>We'll be launching To The Trails for mobile devices on November 15th, but desktop access is available now!\" +\n \"<img src='/img/Overlay-Image-01.png' alt='trees'>\";\n\n // restricting SMALL devices only as of 11/13/2013\n // if ((window.location.hostname === \"www.tothetrails.com\" && SMALL) || CLOSED) {\n\n // open to all 11/15/2013\n if (CLOSED) {\n console.log(\"closed\");\n $(\".overlay-panel\").html(closedOverlayHTML);\n $(\".overlay\").show();\n } else {\n if ($(\"html\").hasClass(\"lt-ie8\")) {\n $(\".overlay-panel\").html(overlayHTMLIE);\n } else {\n if (window.localStorage && window.localStorage['already-visited']) {\n // The user has already visited the page – skip showing the\n // generic welcome message\n return;\n } else {\n $(\".overlay-panel\").html(overlayHTML);\n\n // Saving so that the welcome message is not shown the second\n // time around.\n if (window.localStorage) {\n window.localStorage['already-visited'] = true;\n }\n }\n }\n\n $(\".overlay-panel\").click(function() {\n $(\".overlay\").hide();\n });\n }\n\n $(\".overlay\").show();\n }\n\n // The next three functions perform trailhead/trail mapping\n // on a) initial startup, b) requested re-sort of trailheads based on the map,\n // and c) a change in filter settings\n // They all call addTrailsToTrailheads() as their final action\n // --------------------------------------------------------------\n\n // on startup, get location, display the map,\n // get and display the trailheads, populate originalTrailData,\n // add originalTrailData to trailheads\n\n function initialSetup() {\n console.log(\"initialSetup\");\n setupGeolocation(function() {\n if (geoSetupDone) {\n return;\n }\n fetchTrailheads(currentUserLocation, function() { trailheadsFetched = true; });\n fetchTraildata(currentUserLocation, function() { traildataFetched = true; });\n fetchTrailsegments(currentUserLocation, function() { trailsegmentsFetched = true; });\n if (USE_LOCAL) {\n setTimeout(waitForTrailSegments, 0);\n setTimeout(waitForDataAndSegments, 0);\n setTimeout(waitForAllTrailData, 0);\n } else {\n setTimeout(waitForDataAndTrailHeads, 0);\n setTimeout(waitForTrailSegments, 0);\n }\n });\n }\n\n function waitForTrailSegments() {\n // console.log(\"waitForTrailSegments\");\n if (trailsegmentsFetched) {\n if (map.getZoom() >= SECONDARY_TRAIL_ZOOM && !(map.hasLayer(allSegmentLayer))) {\n map.addLayer(allSegmentLayer); //allSegmentLayer.addToBack() was here. This is a little suspicious.\n }\n }\n else {\n setTimeout(waitForTrailSegments, 100);\n }\n }\n\n function waitForDataAndSegments() {\n // console.log(\"waitForDataAndSegments\");\n if (traildataFetched && trailsegmentsFetched) {\n createSegmentTrailnameCache();\n }\n else {\n setTimeout(waitForDataAndSegments, 100);\n }\n }\n\n function waitForAllTrailData() {\n // console.log(\"waitForAllTrailData\");\n if (traildataFetched && trailsegmentsFetched && trailheadsFetched) {\n addTrailsToTrailheads(originalTrailData, originalTrailheads);\n // if we haven't added the segment layer yet, add it.\n if (map.getZoom() >= SECONDARY_TRAIL_ZOOM && !(map.hasLayer(allSegmentLayer))) {\n map.addLayer(allSegmentLayer).bringToBack();\n }\n }\n else {\n setTimeout(waitForAllTrailData, 100);\n }\n }\n\n function waitForDataAndTrailHeads() {\n // console.log(\"waitForDataAndTrailHeads\");\n if (traildataFetched && trailheadsFetched) {\n addTrailsToTrailheads(originalTrailData, originalTrailheads);\n highlightFirstTrail();\n }\n else {\n setTimeout(waitForDataAndTrailHeads, 100);\n }\n }\n\n function highlightFirstTrail() {\n if (orderedTrails.length) {\n if (SMALL &&($(\".slideDrawer\").hasClass(\"closedDrawer\")) ){\n highlightTrailhead(orderedTrails[0].trailheadID, 0);\n showTrailDetails(orderedTrails[0].trail, orderedTrails[0].trailhead);\n }\n }\n else {\n setTimeout(highlightFirstTrail, 100);\n }\n }\n\n\n // =====================================================================//\n // Filter function + helper functions, triggered by UI events declared above.\n\n function applyFilterChange(currentFilters) {\n currentTrailData = $.extend(true, {}, originalTrailData);\n $.each(originalTrailData, function(trail_id, trail) {\n if (currentFilters.activityFilter) {\n for (var i = 0; i < currentFilters.activityFilter.length; i++) {\n var activity = currentFilters.activityFilter[i];\n var trailActivity = trail.properties[activity];\n if (!trailActivity || trailActivity.toLowerCase().charAt(0) !== \"y\") {\n delete currentTrailData[trail_id];\n }\n }\n }\n\n });\n addTrailsToTrailheads(currentTrailData, originalTrailheads);\n }\n\n function filterChangeHandler(e) {\n var $currentTarget = $(e.currentTarget);\n var filterType = $currentTarget.attr(\"data-filter\");\n var currentUIFilterState = $currentTarget.val();\n console.log(currentUIFilterState);\n updateFilterObject(filterType, currentUIFilterState);\n }\n\n function processSearch(e) {\n var $currentTarget = $(e.currentTarget);\n var filterType = \"searchFilter\";\n\n var currentUIFilterState;\n if (SMALL) {\n currentUIFilterState = $('#mobile .search-key').val();\n } else {\n currentUIFilterState = $('#desktop .search-key').val();\n }\n if (($currentTarget).hasClass('search-key')) {\n if (SMALL) {\n if (e.keyCode === 13) {\n updateFilterObject(filterType, currentUIFilterState);\n }\n } else {\n clearTimeout(searchKeyTimeout);\n searchKeyTimeout = setTimeout(function () {\n updateFilterObject(filterType, currentUIFilterState);\n }, 300);\n }\n } else if (($currentTarget).hasClass('search-submit')) {\n updateFilterObject(filterType, currentUIFilterState);\n }\n }\n\n function updateFilterObject(filterType, currentUIFilterState) {\n console.log(currentUIFilterState);\n var matched = 0;\n if (filterType == \"activityFilter\") {\n var activityFilterLength = currentFilters.activityFilter.length;\n for (var i = 0; i < activityFilterLength; i++) {\n var activity = currentFilters.activityFilter[i];\n if (activity === currentUIFilterState) {\n currentFilters.activityFilter.splice(i, 1);\n matched = 1;\n break;\n }\n }\n if (matched === 0) {\n currentFilters.activityFilter.push(currentUIFilterState);\n }\n }\n\n if (filterType == \"lengthFilter\") {\n console.log(\"length\");\n console.log(currentFilters.lengthFilter.length);\n var lengthFilterLength = currentFilters.lengthFilter.length;\n for (var j = 0; j < lengthFilterLength; j++) {\n var lengthRange = currentFilters.lengthFilter[j];\n if (lengthRange == currentUIFilterState) {\n // console.log(\"match\");\n currentFilters.lengthFilter.splice(j, 1);\n matched = 1;\n break;\n }\n }\n if (matched === 0) {\n currentFilters.lengthFilter.push(currentUIFilterState);\n }\n }\n\n if (filterType == \"searchFilter\") {\n // console.log(\"searchFilter\");\n currentFilters.searchFilter = currentUIFilterState;\n }\n // currentFilters[filterType] = currentUIFilterState;\n console.log(currentFilters);\n applyFilterChange(currentFilters);\n }\n\n function clearSelectionHandler(e) {\n console.log(\"clearSelectionHandler\");\n $(\".visuallyhidden_2 input\").attr(\"checked\", false);\n $(\".visuallyhidden_3 input\").attr(\"checked\", false);\n $(\".search-key\").val(\"\");\n currentFilters = {\n lengthFilter: [],\n activityFilter: [],\n searchFilter: \"\"\n };\n applyFilterChange(currentFilters);\n }\n\n // ======================================\n // map generation & geolocation updates\n\n function offsetZoomIn(e) {\n // get map center lat/lng\n // convert to pixels\n // add offset\n // convert to lat/lng\n // setZoomAround to there with currentzoom + 1\n var centerLatLng = map.getCenter();\n var centerPoint = map.latLngToContainerPoint(centerLatLng);\n var offset = centerOffset;\n var offsetCenterPoint = centerPoint.add(offset.divideBy(2));\n var offsetLatLng = map.containerPointToLatLng(offsetCenterPoint);\n if ($(e.target).hasClass(\"offsetZoomIn\")) {\n map.setZoomAround(offsetLatLng, map.getZoom() + 1);\n } else if ($(e.target).hasClass(\"offsetZoomOut\")) {\n map.setZoomAround(offsetLatLng, map.getZoom() - 1);\n\n } else if ($(e.target).hasClass(\"offsetGeolocate\")) {\n // console.log('Centering on geolocaton');\n var userPoint = map.latLngToContainerPoint(currentUserLocation);\n var offsetUserLocation = userPoint.subtract(offset.divideBy(2));\n var offsetUserLatLng = map.containerPointToLatLng(offsetUserLocation)\n map.setView(offsetUserLatLng, map.getZoom());\n }\n }\n\n function setupGeolocation(callback) {\n console.log(\"setupGeolocation\");\n if (navigator.geolocation) {\n // setup location monitoring\n var options = {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 30000\n };\n geoWatchId = navigator.geolocation.watchPosition(\n function(position) {\n if (originalTrailheads.length === 0) {\n handleGeoSuccess(position, callback);\n geoSetupDone = true;\n } else {\n handleGeoSuccess(position);\n }\n },\n function(error) {\n if (originalTrailheads.length === 0) {\n handleGeoError(error, callback);\n geoSetupDone = true;\n } else {\n handleGeoError(error);\n }\n },\n options);\n } else {\n // for now, just returns Akron\n // should use browser geolocation,\n // and only return Akron if we're far from home base\n currentUserLocation = CENTERPOINT;\n showGeoOverlay();\n handleGeoError(\"no geolocation\", callback);\n }\n\n }\n\n function handleGeoSuccess(position, callback) {\n currentUserLocation = new L.LatLng(position.coords.latitude, position.coords.longitude);\n var distanceToAkron = currentUserLocation.distanceTo(CENTERPOINT) / 1000;\n // if no map, set it up\n if (!map) {\n var startingMapLocation;\n var startingMapZoom;\n // if we're close to Akron, start the map and the trailhead distances from\n // the current location, otherwise just use CENTERPOINT for both\n if (distanceToAkron < LOCAL_LOCATION_THRESHOLD) {\n anchorLocation = currentUserLocation;\n startingMapLocation = currentUserLocation;\n startingMapZoom = 13;\n } else {\n anchorLocation = CENTERPOINT;\n startingMapLocation = CENTERPOINT;\n startingMapZoom = 11;\n }\n map = createMap(startingMapLocation, startingMapZoom);\n }\n // always update the user marker, create if needed\n if (!userMarker) {\n userMarker = L.userMarker(currentUserLocation, {\n smallIcon: true,\n pulsing: true,\n accuracy: 0\n }).addTo(map);\n }\n // If user location exists, turn on geolocation button\n if (currentUserLocation) {\n $(\".offsetGeolocate\").show();\n }\n // console.log(currentUserLocation);\n userMarker.setLatLng(currentUserLocation);\n if (typeof callback == \"function\") {\n callback();\n }\n }\n\n function handleGeoError(error, callback) {\n console.log(\"handleGeoError\");\n console.log(error);\n if (!map) {\n console.log(\"making map anyway\");\n map = createMap(CENTERPOINT, 11);\n currentUserLocation = CENTERPOINT;\n if (error.code === 1) {\n showGeoOverlay();\n }\n }\n if (map && userMarker && error.code === 3) {\n map.removeLayer(userMarker);\n userMarker = null;\n }\n if (typeof callback == \"function\") {\n callback();\n }\n }\n\n function showGeoOverlay() {\n var noGeolocationOverlayHTML = \"<span class='closeOverlay'>x</span><p>We weren't able to get your current location, so we'll give you trailhead distances from downtown Akron.\";\n $(\".overlay-panel\").html(noGeolocationOverlayHTML);\n $(\".overlay\").show();\n $(\".overlay-panel\").click(function() {\n $(\".overlay\").hide();\n });\n }\n\n function centerOnLocation() {\n map.setView(currentUserLocation, map.getZoom());\n }\n\n var mapDragUiHide = false;\n\n function hideUiOnMapDrag() {\n mapDragUiHide = true;\n\n // Hide the top UI\n $('.title-row').addClass('dragging-map');\n // Hide the bottom UI\n $('.detailPanel').addClass('dragging-map');\n // Resize the map container to be bigger\n $('.trailMapContainer').addClass('dragging-map');\n // Make sure the map catches up to the fact that we resized the container\n map.invalidateSize({ animate: false });\n }\n\n function unhideUiOnMapDrag() {\n mapDragUiHide = false;\n\n $('.title-row').removeClass('dragging-map');\n $('.detailPanel').removeClass('dragging-map');\n\n // Wait with resizing the map until the UI is actually hidden, otherwise\n // it will resize too early and there will be a blank space for a bit.\n window.setTimeout(function() {\n if (!mapDragUiHide) {\n $('.trailMapContainer').removeClass('dragging-map');\n map.invalidateSize({ animate: false });\n }\n }, 250); // TODO make a const\n }\n\n function createMap(startingMapLocation, startingMapZoom) {\n console.log(\"createMap\");\n console.log(mapDivName);\n var map = L.map(mapDivName, {\n zoomControl: false,\n scrollWheelZoom: false\n });\n L.tileLayer.provider('MapBox.' + MAPBOX_MAP_ID).addTo(map);\n map.setView(startingMapLocation, startingMapZoom);\n map.fitBounds(map.getBounds(), {\n paddingTopLeft: centerOffset\n });\n // L.control.scale().addTo(map);\n map.on('dragstart', hideUiOnMapDrag);\n map.on('dragend', unhideUiOnMapDrag);\n\n map.on(\"zoomend\", function(e) {\n console.log(\"zoomend start\");\n if (SHOW_ALL_TRAILS && allSegmentLayer) {\n if (map.getZoom() >= SECONDARY_TRAIL_ZOOM && !(map.hasLayer(allSegmentLayer))) {\n // console.log(allSegmentLayer);\n setTimeout(function() {\n map.addLayer(allSegmentLayer);\n allSegmentLayer.bringToBack();\n }, 0);\n\n }\n if (map.getZoom() < SECONDARY_TRAIL_ZOOM && map.hasLayer(allSegmentLayer)) {\n if (currentTrailPopup) {\n map.removeLayer(currentTrailPopup);\n }\n map.removeLayer(allSegmentLayer);\n }\n }\n console.log(\"zoomend end\");\n });\n map.on('popupclose', popupCloseHandler);\n map.on('popupopen', popupOpenHandler);\n return map;\n }\n\n\n\n // =====================================================================//\n // Getting trailhead data\n\n // get all trailhead info, in order of distance from \"location\"\n\n function fetchTrailheads(location, callback) {\n console.log(\"fetchTrailheads\");\n var callData = {\n type: \"GET\",\n path: \"trailheads.geojson?per_page=200&near_lat=\" + location.lat + \"&near_lng=\" + location.lng\n };\n makeAPICall(callData, function(response) {\n populateOriginalTrailheads(response);\n if (typeof callback == \"function\") {\n callback(response);\n }\n });\n }\n\n // given the fetchTrailheads response, a geoJSON collection of trailheads ordered by distance,\n // populate trailheads[] with the each trailhead's stored properties, a Leaflet marker,\n // and a place to put the trails for that trailhead.\n\n function populateOriginalTrailheads(trailheads) {\n console.log(\"populateOriginalTrailheads\");\n originalTrailheads = [];\n for (var i = 0; i < trailheads.data.features.length; i++) {\n var currentFeature = trailheads.data.features[i];\n var coordinates = currentFeature.geometry.coordinates;\n var currentFeatureLatLng = new L.LatLng(coordinates[1], coordinates[0]);\n // var newMarker = L.marker(currentFeatureLatLng, ({\n // icon: trailheadIcon1\n // }));\n var newMarker = new L.CircleMarker(currentFeatureLatLng, {\n color: \"#D86930\",\n fillOpacity: 0.5,\n opacity: 0.8\n }).setRadius(MARKER_RADIUS);\n var trailhead = {\n attributes: currentFeature.properties,\n geometry: currentFeatureLatLng,\n marker: newMarker,\n trails: currentFeature.properties.trail_ids,\n popupContent: \"\"\n };\n setTrailheadEventHandlers(trailhead);\n originalTrailheads.push(trailhead);\n }\n }\n\n function setTrailheadEventHandlers(trailhead) {\n\n trailhead.marker.on(\"click\", function(trailheadID) {\n return function() {\n trailheadMarkerClick(trailheadID);\n };\n }(trailhead.attributes.id));\n\n // placeholders for possible trailhead marker hover behavior\n // trailhead.marker.on(\"mouseover\", function(trailhead) {\n // }(trailhead));\n\n // trailhead.marker.on(\"mouseout\", function(trailhead) {\n // }(trailhead));\n }\n\n function trailheadMarkerClick(id) {\n console.log(\"trailheadMarkerClick\");\n highlightTrailhead(id, 0);\n var trailhead = getTrailheadById(id);\n var trail = originalTrailData[trailhead.trails[0]];\n\n if (trail == null || trail == undefined)\n alert(\"No Trail(s) found\")\n else\n showTrailDetails(originalTrailData[trailhead.trails[0]], trailhead);\n }\n\n function popupCloseHandler(e) {\n currentTrailPopup = null;\n }\n\n function popupOpenHandler(e) {\n $(\".trail-popup-line-named\").click(trailPopupLineClick);\n $(\".trailhead-trailname\").click(trailnameClick); // Open the detail panel!\n }\n\n // get the trailData from the API\n\n function fetchTraildata(location, callback) {\n console.log(\"fetchTraildata\");\n var callData = {\n type: \"GET\",\n path: \"trails?per_page=200&opentrails=true&near_lat=\" + location.lat + \"&near_lng=\" + location.lng\n };\n makeAPICall(callData, function(response) {\n populateTrailData(response);\n if (typeof callback == \"function\") {\n callback();\n }\n });\n }\n\n function populateTrailData(trailDataGeoJSON) {\n for (var i = 0; i < trailDataGeoJSON.data.length; i++) {\n originalTrailData[trailDataGeoJSON.data[i].outerspatial.id] = trailDataGeoJSON.data[i];\n }\n currentTrailData = $.extend(true, {}, originalTrailData);\n }\n\n function fetchTrailsegments(location, callback) {\n console.log(\"fetchTrailsegments\");\n var callData = {\n type: \"GET\",\n path: \"trail_segments.geojson?near_lat=\" + location.lat + \"&near_lng=\" + location.lng\n };\n // if (SMALL) {\n // callData.path = \"/trailsegments.json?simplify=\" + ALL_SEGMENT_LAYER_SIMPLIFY;\n // }\n makeAPICall(callData, function(response) {\n trailSegments = response;\n if (USE_SEGMENT_LAYER) {\n if (USE_COMPLEX_SEGMENT_LAYER) {\n allSegmentLayer = makeAllSegmentLayer(response);\n }\n else {\n allSegmentLayer = L.geoJson(response, {\n style: {\n color: NORMAL_SEGMENT_COLOR,\n weight: NORMAL_SEGMENT_WEIGHT,\n opacity: 1,\n clickable: false,\n smoothFactor: customSmoothFactor\n }\n });\n }\n }\n if (typeof callback == \"function\") {\n callback();\n }\n });\n }\n\n // this creates a lookup object so we can quickly look up if a trail has any segment data available\n\n function createSegmentTrailnameCache() {\n console.log(\"createSegmentTrailnameCache\");\n for (var segmentIndex = 0; segmentIndex < trailSegments.data.features.length; segmentIndex++) {\n // var segment = $.extend(true, {}, trailSegments.features[segmentIndex]);\n var segment = trailSegments.data.features[segmentIndex];\n for (var i = 0; i < 6; i++) {\n var fieldName = \"trail\" + i;\n if (segment.properties[fieldName]) {\n segmentTrailnameCache[segment.properties[fieldName]] = true;\n }\n }\n }\n }\n // returns true if trailname is in trailData\n\n // var trailNameLookup = null;\n function trailnameInListOfTrails(trail_id) {\n return originalTrailData[trail_id] ? true : false;\n }\n\n function makeAllSegmentLayer(response) {\n if (allSegmentLayer !== undefined) {\n return allSegmentLayer;\n }\n console.log(\"makeAllSegmentLayer\");\n // make visible layers\n allVisibleSegmentsArray = [];\n allInvisibleSegmentsArray = [];\n var allSegmentLayer = new L.FeatureGroup();\n // console.log(\"visibleAllTrailLayer start\");\n // make a normal visible layer for the segments, and add each of those layers to the allVisibleSegmentsArray\n var visibleAllTrailLayer = L.geoJson(response.data, {\n style: {\n color: NORMAL_SEGMENT_COLOR,\n weight: NORMAL_SEGMENT_WEIGHT,\n opacity: 1,\n clickable: false,\n smoothFactor: customSmoothFactor\n },\n onEachFeature: function visibleOnEachFeature(feature, layer) {\n // console.log(\"visibleAllTrailLayer onEachFeature\");\n allVisibleSegmentsArray.push(layer);\n }\n });\n\n // make invisible layers\n\n // make the special invisible layer for mouse/touch events. much wider paths.\n // make popup html for each segment\n var invisibleAllTrailLayer = L.geoJson(response.data, {\n style: {\n opacity: 0,\n weight: 20,\n clickable: true,\n smoothFactor: 10\n },\n onEachFeature: function invisibleOnEachFeature(feature, layer) {\n // console.log(\"invisibleAllTrailLayer onEachFeature\");\n allInvisibleSegmentsArray.push(layer);\n }\n });\n // console.log(\"invisibleAllTrailLayer end\");\n\n var numSegments = allInvisibleSegmentsArray.length;\n for (var i = 0; i < numSegments; i++) {\n // console.log(\"numSegments loop\");\n var invisLayer = allInvisibleSegmentsArray[i];\n // make a FeatureGroup including both visible and invisible components\n // var newTrailFeatureGroup = new L.FeatureGroup([allVisibleSegmentsArray[i]]);\n\n var newTrailFeatureGroup = new L.FeatureGroup([allInvisibleSegmentsArray[i], allVisibleSegmentsArray[i]]);\n\n // var $popupHTML = $(\"<div class='trail-popup'>\");\n\n var popupHTML = \"<div class='trail-popup'>\";\n var atLeastOne = false;\n for (var j = 0; j < invisLayer.feature.properties[\"trail_ids\"].length; j++) {\n // console.log(\"trailHTML start\");\n var trail_id = invisLayer.feature.properties[\"trail_ids\"][j];\n var trailPopupLineDiv;\n if (trailnameInListOfTrails(trail_id)) {\n var trail_name = originalTrailData[trail_id]\n trailPopupLineDiv = \"<div class='trail-popup-line trail-popup-line-named' \" +\n \"data-steward='\" + invisLayer.feature.properties.steward + \"' \" +\n \"data-source='\" + invisLayer.feature.properties.source + \"' \" +\n \"data-trailname='\" + trail_name + \"'> \" + trail_id +\n \"<b></b></div>\";\n atLeastOne = true;\n } else {\n trailPopupLineDiv = \"<div class='trail-popup-line trail-popup-line-unnamed'>\" +\n trail_id +\n \"</div>\";\n }\n popupHTML = popupHTML + trailPopupLineDiv;\n // console.log(\"trailHTML end\");\n\n }\n\n\n popupHTML = popupHTML + \"</div>\";\n\n invisLayer.feature.properties.popupHTML = popupHTML;\n var eventType;\n if (TOUCH) {\n eventType = \"click\";\n } else {\n eventType = \"mouseover\";\n }\n\n newTrailFeatureGroup.addEventListener(eventType, function featureGroupEventListener(invisLayer) {\n return function newMouseover(e) {\n // console.log(\"new mouseover\");\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = null;\n }\n if (openTimeout) {\n clearTimeout(openTimeout);\n openTimeout = null;\n }\n openTimeout = setTimeout(function openTimeoutFunction(originalEvent, target) {\n return function() {\n target.setStyle({\n weight: HOVER_SEGMENT_WEIGHT,\n color: HOVER_SEGMENT_COLOR\n });\n // set currentWeightedSegment back to normal\n if (target != currentWeightedSegment) {\n if (currentWeightedSegment) {\n currentWeightedSegment.setStyle({\n weight: NORMAL_SEGMENT_WEIGHT,\n color: NORMAL_SEGMENT_COLOR\n });\n }\n }\n var popupHTML = invisLayer.feature.properties.popupHTML;\n currentTrailPopup = new L.Popup({ autoPan: SMALL ? false : true}).setContent(popupHTML).setLatLng(originalEvent.latlng).openOn(map);\n currentWeightedSegment = target;\n };\n }(e, e.target), 250);\n };\n }(invisLayer));\n\n newTrailFeatureGroup.addEventListener(\"mouseout\", function(e) {\n if (closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = null;\n }\n if (openTimeout) {\n clearTimeout(openTimeout);\n openTimeout = null;\n }\n closeTimeout = setTimeout(function(e) {\n return function() {\n e.target.setStyle({\n weight: 3\n });\n //map.closePopup();\n };\n }(e), 1250);\n });\n\n allSegmentLayer.addLayer(newTrailFeatureGroup);\n }\n\n // use this to just show the network\n // allSegmentLayer = visibleAllTrailLayer;\n allVisibleSegmentsArray = null;\n allInvisibleSegmentsArray = null;\n return allSegmentLayer;\n }\n\n // after clicking on a trail name in a trail popup,\n // find the closest matching trailhead and highlight it\n\n function trailPopupLineClick(e) {\n console.log(\"trailPopupLineClick\");\n // get all trailheads that have this trailname and source\n var trailname = $(e.target).attr(\"data-trailname\");\n var source = $(e.target).attr(\"data-source\");\n var trailheadMatches = [];\n for (var i = 0; i < originalTrailheads.length; i++) {\n var trailhead = originalTrailheads[i];\n if (trailhead.properties.source == source) {\n if (trailhead.properties.trail1 == trailname ||\n trailhead.properties.trail2 == trailname ||\n trailhead.properties.trail3 == trailname ||\n trailhead.properties.trail4 == trailname ||\n trailhead.properties.trail5 == trailname ||\n trailhead.properties.trail6) {\n trailheadMatches.push(trailhead);\n }\n }\n }\n // find the closest one\n // popups have no getLatLng, so we're cheating here.\n var currentLatLng = currentTrailPopup._latlng;\n var nearestDistance = Infinity;\n var nearestTrailhead = null;\n for (var j = 0; j < trailheadMatches.length; j++) {\n var matchedTrailhead = trailheadMatches[j];\n var trailheadLatLng = matchedTrailhead.marker.getLatLng();\n var distance = currentLatLng.distanceTo(trailheadLatLng);\n if (distance < nearestDistance) {\n nearestTrailhead = matchedTrailhead;\n nearestDistance = distance;\n }\n }\n // find the index of the clicked trail\n var trailIndex = 0;\n var trail = null;\n for (var k = 0; k < nearestTrailhead.trails.length; k++) {\n var trailheadTrailID = nearestTrailhead.trails[k];\n if (currentTrailData[trailheadTrailID].properties.name == trailname) {\n trail = currentTrailData[trailheadTrailID];\n trailIndex = k;\n }\n }\n // highlight it\n highlightTrailhead(nearestTrailhead.properties.id, trailIndex);\n showTrailDetails(trail, nearestTrailhead);\n }\n\n // given trailData,\n // populate trailheads[x].trails with all of the trails in trailData\n // that match each trailhead's named trails from the trailhead table.\n // Also add links to the trails within each trailhead popup\n // then call fixDuplicateTrailheadTrails, makeTrailheadPopups, mapActiveTrailheads, and makeTrailDivs\n\n function addTrailsToTrailheads(myTrailData, myTrailheads) {\n console.log(\"addTrailsToTrailheads\");\n for (var j = 0; j < myTrailheads.length; j++) {\n var trailhead = myTrailheads[j];\n // for each original trailhead trail name\n for (var i = 0; i < trailhead.attributes.trail_ids.length; i++) {\n // TODO: add a test for the case of duplicate trail names.\n // Right now this\n // loops through all of the trailData objects, looking for trail names that match\n // the trailhead trailname.\n // this works great, except for things like \"Ledges Trail,\" which get added twice,\n // one for the CVNP instance and one for the MPSSC instance.\n // we should test for duplicate names and only use the nearest one.\n // to do that, we'll need to either query the DB for the trail segment info,\n // or check distance against the pre-loaded trail segment info\n var trail_id = trailhead.attributes.trail_ids[i];\n var trail = myTrailData[trail_id];\n\n if (trail != null || trail != undefined){\n var wanted = false;\n var dataAvailable = false;\n if (trailhead.attributes.name == trail.attributes.name) {\n if (checkSegmentsForTrailname(trail.properties.name, trail.properties.source) || !USE_LOCAL)\n dataAvailable = true;\n else\n console.log(\"skipping \" + trail.properties.name + \"/\" + trail.properties.source + \": no segment data\");\n\n if (filterResults(trail, trailhead))\n wanted = true;\n }\n if (dataAvailable && wanted)\n trailhead.trails.push(trailID);\n\n }\n }\n }\n setTimeout(function() {\n fixDuplicateTrailheadTrails(myTrailheads);\n makeTrailheadPopups(myTrailheads);\n mapActiveTrailheads(myTrailheads);\n setTimeout(function() {\n makeTrailDivs(myTrailheads);\n setTimeout(function() {\n if (SMALL && USE_LOCAL) {\n highlightTrailhead(orderedTrails[0].trailheadID, 0);\n orderedTrailIndex = 0;\n showTrailDetails(orderedTrails[0].trail, orderedTrails[0].trailhead);\n }\n }, 0);\n }, 0);\n }, 0);\n }\n\n function filterResults(trail, trailhead) {\n var wanted = false;\n var lengthMatched = false;\n if (currentFilters.lengthFilter) {\n if (currentFilters.lengthFilter.length === 0) {\n lengthMatched = true;\n }\n for (var j = 0; j < currentFilters.lengthFilter.length; j++) {\n var distance = currentFilters.lengthFilter[j];\n var trailDist = trail.properties[\"length\"];\n if ((distance.toLowerCase() == \"short\" && trailDist <= SHORT_MAX_DISTANCE) ||\n (distance.toLowerCase() == \"medium\" && trailDist > SHORT_MAX_DISTANCE && trailDist <= MEDIUM_MAX_DISTANCE) ||\n (distance.toLowerCase() == \"long\" && trailDist > MEDIUM_MAX_DISTANCE && trailDist <= LONG_MAX_DISTANCE) ||\n (distance.toLowerCase() == \"verylong\" && trailDist > LONG_MAX_DISTANCE)) {\n lengthMatched = true;\n break;\n }\n }\n }\n var searchMatched = true;\n if (currentFilters.searchFilter) {\n searchMatched = false;\n var normalizedTrailName = trail.properties.name.toLowerCase();\n var normalizedSearchFilter = currentFilters.searchFilter.toLowerCase();\n var equivalentWords = [\n [\" and \", \" & \"],\n [\"tow path\", \"towpath\"]\n ];\n $.each(equivalentWords, function(i, el) {\n var regexToken = \"(\" + el[0] + \"|\" + el[1] + \")\";\n\n normalizedSearchFilter = normalizedSearchFilter.replace(el[0], regexToken);\n normalizedSearchFilter = normalizedSearchFilter.replace(el[1], regexToken);\n });\n\n var searchRegex = new RegExp(normalizedSearchFilter);\n var nameMatched = !! normalizedTrailName.match(searchRegex);\n\n var descriptionMatched;\n if (trail.properties.description === null) {\n descriptionMatched = false;\n } else {\n var normalizedDescription = trail.properties.description.toLowerCase();\n descriptionMatched = !! normalizedDescription.match(searchRegex);\n }\n\n var trailheadNameMatched;\n var normalizedTrailheadName = trailhead.properties.name.toLowerCase();\n trailheadNameMatched = !! normalizedTrailheadName.match(searchRegex);\n\n var parkNameMatched;\n if (trailhead.properties.park === null) {\n parkNameMatched = false;\n }\n else {\n var normalizedParkName = trailhead.properties.park.toLowerCase();\n parkNameMatched = !! normalizedParkName.match(searchRegex);\n }\n\n if (descriptionMatched || nameMatched || trailheadNameMatched || parkNameMatched) {\n searchMatched = true;\n }\n }\n\n if (lengthMatched && searchMatched) {\n wanted = true;\n }\n else {\n // console.log('no match');\n }\n return wanted;\n }\n\n // this is so very wrong and terrible and makes me want to never write anything again.\n // alas, it works for now.\n // for each trailhead, if two or more of the matched trails from addTrailsToTrailheads() have the same name,\n // remove any trails that don't match the trailhead source\n\n function fixDuplicateTrailheadTrails(myTrailheads) {\n console.log(\"fixDuplicateTrailheadTrails\");\n for (var trailheadIndex = 0; trailheadIndex < myTrailheads.length; trailheadIndex++) {\n var trailhead = myTrailheads[trailheadIndex];\n var trailheadTrailNames = {};\n for (var trailsIndex = 0; trailsIndex < trailhead.trails.length; trailsIndex++) {\n var trail = currentTrailData[trailhead.trails[trailsIndex]];\n if (trail == null || trail == undefined)\n continue\n\n var trailName = trail.attributes.name;\n trailheadTrailNames[trailName] = trailheadTrailNames[trailName] || [];\n var sourceAndTrailID = {\n source: currentTrailData[trailhead.trails[trailsIndex]].attributes.source,\n trailID: currentTrailData[trailhead.trails[trailsIndex]].attributes.id\n };\n trailheadTrailNames[trailName].push(sourceAndTrailID);\n }\n for (var trailheadTrailName in trailheadTrailNames) {\n if (trailheadTrailNames.hasOwnProperty(trailheadTrailName)) {\n if (trailheadTrailNames[trailheadTrailName].length > 1) {\n // remove the ID from the trailhead trails array if the source doesn't match\n for (var i = 0; i < trailheadTrailNames[trailheadTrailName].length; i++) {\n var mySourceAndTrailID = trailheadTrailNames[trailheadTrailName][i];\n if (mySourceAndTrailID.source != trailhead.attributes.source) {\n var idToRemove = mySourceAndTrailID.trailID;\n var removeIndex = $.inArray(idToRemove.toString(), trailhead.trails);\n trailhead.trails.splice(removeIndex, 1);\n }\n }\n }\n }\n }\n }\n console.log(\"fixDuplicateTrailheadTrails end\");\n }\n\n // given the trailheads,\n // make the popup menu content for each one, including each trail present\n // and add it to the trailhead object\n\n function makeTrailheadPopups() {\n console.log(\"makeTrailheadPopups start\");\n for (var trailheadIndex = 0; trailheadIndex < originalTrailheads.length; trailheadIndex++) {\n var trailhead = originalTrailheads[trailheadIndex];\n\n var popupContentMainDivHTML = \"<div class='trailhead-popup'>\";\n var popupTrailheadDivHTML = \"<div class='trailhead-box'><div class='popupTrailheadNames'>\" + trailhead.attributes.name + \"</div>\" +\n \"<img class='calloutTrailheadIcon' src='img/icon_trailhead_active.png'>\";\n popupContentMainDivHTML = popupContentMainDivHTML + popupTrailheadDivHTML;\n\n for (var trailsIndex = 0; trailsIndex < trailhead.trails.length; trailsIndex++) {\n var trail = currentTrailData[trailhead.trails[trailsIndex]];\n if (trail == null || trail == undefined)\n continue\n\n var popupTrailDivHTMLStart = \"<div class='trailhead-trailname trail\" + (trailsIndex + 1) + \"' \" +\n \"data-trailname='\" + trail.attributes.name + \"' \" +\n \"data-trailid='\" + trail.attributes.id + \"' \" +\n \"data-trailheadname='\" + trailhead.attributes.name + \"' \" +\n \"data-trailheadid='\" + trailhead.attributes.id + \"' \" +\n \"data-index='\" + trailsIndex + \"'>\";\n var statusHTML = \"\";\n if (trail.attributes.status == 1) {\n statusHTML = \"<img class='status' src='img/icon_alert_yellow.png' title='alert'>\";\n }\n else if (trail.attributes.status == 2) {\n statusHTML = \"<img class='status' src='img/icon_alert_red.png' title='alert'>\";\n }\n\n var trailNameHTML = \"<div class='popupTrailNames'>\" + trail.attributes.name + \"</div><b></b>\";\n var popupTrailDivHTML = popupTrailDivHTMLStart + statusHTML + trailNameHTML + \"</div>\";\n popupContentMainDivHTML = popupContentMainDivHTML + popupTrailDivHTML;\n }\n popupContentMainDivHTML = popupContentMainDivHTML + \"</div>\";\n trailhead.popupContent = popupContentMainDivHTML;\n }\n console.log(\"makeTrailheadPopups end\");\n }\n\n // given trailheads, add all of the markers to the map in a single Leaflet layer group\n // except for trailheads with no matched trails\n\n function mapActiveTrailheads(myTrailheads) {\n console.log(\"mapActiveTrailheads start\");\n var currentTrailheadMarkerArray = [];\n for (var i = 0; i < myTrailheads.length; i++) {\n if (myTrailheads[i].trails.length) {\n currentTrailheadMarkerArray.push(myTrailheads[i].marker);\n } else {\n // console.log([\"trailhead not displayed: \", trailheads[i].properties.name]);\n }\n }\n if (currentTrailheadLayerGroup) {\n map.removeLayer(currentTrailheadLayerGroup);\n }\n currentTrailheadLayerGroup = L.layerGroup(currentTrailheadMarkerArray);\n map.addLayer(currentTrailheadLayerGroup);\n console.log(\"mapActiveTrailheads end\");\n }\n\n // given trailheads, now populated with matching trail names,\n // make the trail/trailhead combination divs\n // noting if a particular trailhead has no trails associated with it\n\n function makeTrailDivs(myTrailheads) {\n console.log(\"makeTrailDivs\");\n orderedTrails = [];\n var divCount = 1;\n if(myTrailheads.length === 0) return;\n var topLevelID = SMALL ? \"mobile\" : \"desktop\";\n var trailListElementList = document.getElementById(topLevelID).getElementsByClassName(\"trailList\");\n trailListElementList[0].innerHTML = \"\";\n var myTrailheadsLength = myTrailheads.length;\n var trailListContents = \"\";\n for (var j = 0; j < myTrailheadsLength; j++) {\n // console.log(\"makeTrailDivs trailhead: \" + j);\n // newTimeStamp = Date.now();\n // time = newTimeStamp - lastTimeStamp;\n // lastTimeStamp = newTimeStamp;\n // console.log(time + \": \" + \"next trailhead\");\n var trailhead = myTrailheads[j];\n\n var trailheadName = trailhead.attributes.name;\n var trailheadID = trailhead.attributes.id;\n var parkName = trailhead.attributes.park;\n var trailheadTrailIDs = trailhead.trails;\n if (trailheadTrailIDs.length === 0) {\n continue;\n }\n var trailheadSource = trailhead.attributes.source;\n var trailheadDistance = metersToMiles(trailhead.attributes.distance);\n\n // Making a new div for text / each trail\n var trailIDsLength = trailheadTrailIDs.length;\n for (var i = 0; i < trailIDsLength; i++) {\n // console.log(\"makeTrailDivs \" + i);\n var trailID = trailheadTrailIDs[i];\n var trail = currentTrailData[trailID];\n\n if (trail == null || trail == undefined)\n continue;\n\n var trailName = trail.attributes.name;\n var trailLength = trail.attributes.length;\n var trailCurrentIndex = divCount++;\n\n var trailDivText = \"<div class='trail-box' \" +\n \"data-source='list' \" +\n \"data-trailid='\" + trailID + \"' \" +\n \"data-trailname='\" + trailName + \"' \" +\n \"data-trail-length='\" + trailLength + \"' \" +\n \"data-trailheadName='\" + trailheadName + \"' \" +\n \"data-trailheadid='\" + trailheadID + \"' \" +\n \"data-index='\" + i + \"'>\";\n\n var trailheadInfoText = \"<div class='trailheadInfo'>\" +\n \"<img class='trailheadIcon' src='img/icon_trailhead_active.png'/>\" +\n \"<div class='trailheadName' >\" + trailheadName + \" Trailhead\" + \"</div>\" +\n \"<div class='trailheadDistance' >\" + trailheadDistance + \" miles away\" + \"</div>\" +\n \"</div>\";\n\n var mileString = trailLength == 1 ? \"mile\" : \"miles\";\n var trailInfoText = \"<div class='trailInfo'>\" +\n \"<div class='trailCurrentIndex' >\" + trailCurrentIndex + \"</div>\" +\n \"<div class='trail' >\" + trailName + \"</div>\" +\n \"<div class='trailLength' >\" + trailLength + \" \" + mileString + \" long\" + \"</div>\";\n if (parkName) {\n trailInfoText = trailInfoText + \"<div class='parkName' >\" + trailhead.attributes.park + \"</div>\";\n }\n trailInfoText = trailInfoText + \"</div>\";\n\n var trailSourceText = \"<div class='trailSource' id='\" + trailheadSource + \"'>\" + trailheadSource + \"</div></div>\";\n var trailDivComplete = trailDivText + trailInfoText + trailheadInfoText + trailSourceText;\n\n trailListContents = trailListContents + trailDivComplete;\n // var trailDivWrapper = document.createElement('div');\n // var trailDivComplete = trailDivText + trailInfoText + trailheadInfoText + trailSourceText;\n // trailDivWrapper.innerHTML = trailDivComplete;\n // trailListElementList[0].insertAdjacentHTML('beforeend', trailDivWrapper.firstChild.outerHTML);\n\n var trailInfoObject = {\n trailID: trailID,\n trail: trail,\n trailheadID: trailheadID,\n trailhead: trailhead,\n index: i\n };\n orderedTrails.push(trailInfoObject);\n // newTimeStamp = Date.now();\n // time = newTimeStamp - lastTimeStamp;\n // lastTimeStamp = newTimeStamp;\n // console.log(time + \": \" + \"end loop\");\n }\n }\n trailListElementList[0].innerHTML = trailListContents;\n $(\".trail-box\").click(populateTrailsForTrailheadDiv).click(trailDivClickHandler);\n $(\".trails-count\").html(orderedTrails.length + \" RESULTS FOUND\");\n console.log(\"end makeTrailDivs 4\");\n }\n\n function trailDivClickHandler(e) {\n var $myTarget = $(e.currentTarget);\n var divTrailID = $myTarget.attr(\"data-trailid\");\n console.log(divTrailID);\n var divTrail = originalTrailData[divTrailID];\n var divTrailheadID = $myTarget.attr(\"data-trailheadid\");\n var divTrailhead = getTrailheadById(divTrailheadID);\n showTrailDetails(divTrail, divTrailhead);\n }\n\n function metersToMiles(i) {\n return (i * METERSTOMILESFACTOR).toFixed(1);\n }\n\n\n // detail panel section\n //\n\n function showTrailDetails(trail, trailhead) {\n console.log(\"showTrailDetails\");\n if ($('.detailPanel').is(':hidden')) {\n decorateDetailPanel(trail, trailhead);\n openDetailPanel();\n currentDetailTrail = trail;\n currentDetailTrailhead = trailhead;\n } else {\n if (currentDetailTrail == trail && currentDetailTrailhead == trailhead) {\n currentDetailTrail = null;\n currentDetailTrailhead = null;\n closeDetailPanel();\n } else {\n decorateDetailPanel(trail, trailhead);\n currentDetailTrail = trail;\n currentDetailTrailhead = trailhead;\n }\n }\n }\n\n\n // Helper functions for ShowTrailDetails\n\n function openDetailPanel() {\n console.log(\"openDetailPanel\");\n $('.detailPanel').show();\n if (!SMALL) {\n $('.accordion').hide();\n }\n if (SMALL) {\n if ($(\".slideDrawer\").hasClass(\"openDrawer\")) {\n console.log(\"slide drawer is open\");\n $(\".slideDrawer\").removeClass(\"openDrawer\");\n $(\".slideDrawer\").addClass(\"closedDrawer\");\n $(\".detailPanel\").removeClass(\"hidden\");\n $(\".detailPanel\").addClass(\"contracted\");\n }\n }\n $('.trailhead-trailname.selected').addClass(\"detail-open\");\n $(\".detailPanel .detailPanelPicture\")[0].scrollIntoView();\n // map.invalidateSize();\n }\n\n function closeDetailPanel() {\n console.log(\"closeDetailPanel\");\n $('.detailPanel').hide();\n $('.accordion').show();\n $('.trailhead-trailname.selected').removeClass(\"detail-open\");\n // map.invalidateSize();\n }\n\n function detailPanelHoverIn(e) {\n enableTrailControls();\n }\n\n function detailPanelHoverOut(e) {\n if(!SMALL){\n $(\".controlRight\").removeClass(\"enabled\").addClass(\"disabled\");\n $(\".controlLeft\").removeClass(\"enabled\").addClass(\"disabled\");\n }\n }\n\n function changeDetailPanel(e) {\n console.log(\"changeDetailPanel\");\n e.stopPropagation();\n var trailheadID = currentDetailTrailhead.properties.id;\n var trailID = String(currentDetailTrail.properties.id);\n console.log(trailID);\n var trailhead;\n\n for (var i = 0; i < orderedTrails.length; i++) {\n if (orderedTrails[i].trailID == trailID && orderedTrails[i].trailheadID == trailheadID) {\n orderedTrailIndex = i;\n }\n }\n var trailChanged = false;\n if ($(e.target).hasClass(\"controlRight\")) {\n orderedTrailIndex = orderedTrailIndex + 1;\n trailChanged = true;\n }\n if ($(e.target).hasClass(\"controlLeft\") && orderedTrailIndex > 0) {\n orderedTrailIndex = orderedTrailIndex - 1;\n trailChanged = true;\n }\n if (trailChanged) {\n var orderedTrail = orderedTrails[orderedTrailIndex];\n // console.log(orderedTrail);\n trailheadID = orderedTrail.trailheadID;\n // console.log([\"trailheadID\", trailheadID]);\n var trailIndex = orderedTrail.index;\n // console.log([\"trailIndex\", trailIndex]);\n for (var j = 0; j < originalTrailheads.length; j++) {\n if (originalTrailheads[j].properties.id == trailheadID) {\n trailhead = originalTrailheads[j];\n }\n }\n enableTrailControls();\n highlightTrailhead(trailheadID, trailIndex);\n showTrailDetails(currentTrailData[trailhead.trails[trailIndex]], trailhead);\n $(\".detailPanel .detailPanelPicture\")[0].scrollIntoView();\n }\n }\n\n function enableTrailControls() {\n\n if (orderedTrailIndex === 0) {\n $(\".controlLeft\").removeClass(\"enabled\").addClass(\"disabled\");\n } else {\n $(\".controlLeft\").removeClass(\"disabled\").addClass(\"enabled\");\n }\n\n if (orderedTrailIndex == orderedTrails.length - 1) {\n $(\".controlRight\").removeClass(\"enabled\").addClass(\"disabled\");\n } else {\n $(\".controlRight\").removeClass(\"disabled\").addClass(\"enabled\");\n }\n return orderedTrailIndex;\n }\n\n function resetDetailPanel() {\n $('.detailPanel .detailPanelPicture').attr(\"src\", \"img/ImagePlaceholder.jpg\");\n $('.detailPanel .detailPanelPictureCredits').remove();\n $('.detailPanel .detailConditionsDescription').html(\"\");\n $('.detailPanel .detailTrailSurface').html(\"\");\n $('.detailPanel .detailTrailheadName').html(\"\");\n $('.detailPanel .detailTrailheadPark').html(\"\");\n $('.detailPanel .detailTrailheadAddress').html(\"\");\n $('.detailPanel .detailTrailheadCity').html(\"\");\n $('.detailPanel .detailTrailheadState').html(\"\");\n $('.detailPanel .detailTrailheadZip').html(\"\");\n $('.detailPanel .statusMessage').remove();\n $('.detailPanel .hike').html(\"\");\n $('.detailPanel .cycle').html(\"\");\n $('.detailPanel .handicap').html(\"\");\n $('.detailPanel .horse').html(\"\");\n $('.detailPanel .xcountryski').html(\"\");\n $('.detailPanel .detailBottomRow .detailTrailheadAmenities .detailTrailheadIcons .water').html(\"\");\n $('.detailPanel .detailBottomRow .detailTrailheadAmenities .detailTrailheadIcons .kiosk').html(\"\");\n $('.detailPanel .detailBottomRow .detailTrailheadAmenities .detailTrailheadIcons .restrooms').html(\"\");\n $('.detailPanel .detailBottomRow .detailTrailheadAmenities .detailTrailheadIcons .parking').html(\"\");\n $('.detailPanel .detailDescription').html(\"\");\n $('.detailPanel .detailStewardLogo').attr(\"src\", \"/img/logoPlaceholder.jpg\");\n }\n\n function decorateDetailPanel(trail, trailhead) {\n // console.log(orderedTrailIndex);\n\n for (var i = 0; i < orderedTrails.length; i++) {\n if (orderedTrails[i].trailID == trail.attributes.id && orderedTrails[i].trailheadID == trailhead.attributes.id) {\n orderedTrailIndex = i;\n }\n }\n enableTrailControls();\n\n resetDetailPanel();\n\n $('.detailPanel .detailPanelBanner .trailIndex').html((orderedTrailIndex + 1) + \" of \" + orderedTrails.length);\n $('.detailPanel .detailPanelBanner .trailName').html(trail.attributes.name);\n $('.detailPanel .trailheadName').html(trailhead.attributes.name + \" Trailhead\");\n $('.detailPanel .trailheadDistance').html(metersToMiles(trailhead.attributes.distance) + \" miles away\");\n\n if (trail.attributes.conditions) {\n $('.detailPanel .detailConditionsDescription').html(trail.attributes.conditions);\n $('.detailPanel .detailConditionsDescription').show();\n $('.detailPanel .detailConditionsHeader').show();\n } else {\n $('.detailPanel .detailConditionsDescription').hide();\n $('.detailPanel .detailConditionsHeader').hide();\n }\n\n if (trail.attributes.trlsurface) {\n $('.detailPanel .detailTrailSurface').html(trail.attributes.trlsurface);\n $('.detailPanel .detailTrailSurface').show();\n $('.detailPanel .detailTrailSurfaceHeader').show();\n } else {\n $('.detailPanel .detailTrailSurface').hide();\n $('.detailPanel .detailTrailSurfaceHeader').hide();\n }\n\n if (trailhead.attributes.park) {\n $('.detailPanel .detailTrailheadPark').html(trailhead.attributes.park);\n }\n\n if (trailhead.attributes.address) {\n $('.detailPanel .detailTrailheadAddress').html(trailhead.attributes.address);\n }\n\n if (trailhead.attributes.city) {\n if (trailhead.attributes.state) {\n $('.detailPanel .detailTrailheadCity').html(trailhead.attributes.city + \", \");\n } else {\n $('.detailPanel .detailTrailheadCity').html(trailhead.attributes.city);\n }\n }\n\n if (trailhead.attributes.state) {\n $('.detailPanel .detailTrailheadState').html(trailhead.attributes.state);\n }\n\n if (trailhead.attributes.zip) {\n $('.detailPanel .detailTrailheadZip').html(trailhead.attributes.zip);\n }\n\n if (trail.attributes.medium_photo_url) {\n $('.detailPanel .detailPanelPicture').attr(\"src\", trail.attributes.medium_photo_url);\n $('.detailPanel .detailPanelPictureContainer').append(\"<div class='detailPanelPictureCredits'>\" + trail.attributes.photo_credit + \"</div>\");\n }\n\n if (trail.attributes.status == 1) {\n if (!SMALL) {\n $('.detailPanel .detailPanelPictureContainer').append(\"<div class='statusMessage' id='yellow'>\" + \"<img src='img/icon_alert_yellow.png'>\" + \"<span>\" + trail.attributes.statustext + \"</span>\" + \"</div>\");\n } else {\n $('.detailPanel .detailPanelBanner').after(\"<div class='statusMessage' id='yellow'>\" + \"<img src='img/icon_alert_yellow.png'>\" + \"<span class='truncate'>\" + trail.attributes.statustext + \"</span>\" + \"</div>\");\n }\n }\n\n if (trail.attributes.status == 2) {\n if (!SMALL) {\n $('.detailPanel .detailPanelPictureContainer').append(\"<div class='statusMessage' id='red'>\" + \"<img src='img/icon_alert_red.png'>\" + \"<span>\" + trail.attributes.statustext + \"</span>\" + \"</div>\");\n } else {\n $('.detailPanel .detailPanelBanner').after(\"<div class='statusMessage' id='red'>\" + \"<img src='img/icon_alert_red.png'>\" + \"<span class='truncate'>\" + trail.attributes.statustext + \"</span>\" + \"</div>\");\n }\n }\n\n if (trail.attributes.hike && trail.attributes.hike.toLowerCase().indexOf('y') === 0) {\n if (!SMALL) {\n $('.detailPanel .detailTopRow#right .hike').html(\"<img class='activity-icons' title='Trail is appropriate for hikers. See below for details.' src='img/icon_hike_green.png'>\");\n } else {\n $('.detailPanel .detailActivityRow .hike').html(\"<img class='activity-icons' title='Trail is appropriate for hikers. See below for details.' src='img/icon_hike_green.png'>\");\n }\n }\n\n if (trail.attributes.roadbike && trail.attributes.roadbike.toLowerCase().indexOf('y') === 0) {\n if (!SMALL) {\n $('.detailPanel .detailTopRow#right .cycle').html(\"<img class='activity-icons' title='Trail is appropriate for bicylists. See below for details.' src='img/icon_cycle_green.png'>\");\n } else {\n $('.detailPanel .detailActivityRow .cycle').html(\"<img class='activity-icons' title='Trail is appropriate for bicylists. See below for details.' src='img/icon_cycle_green.png'>\");\n }\n }\n\n if (trail.attributes.accessible && trail.attributes.accessible.toLowerCase().indexOf('y') === 0) {\n if (!SMALL) {\n $('.detailPanel .detailTopRow#right .handicap').html(\"<img class='activity-icons' title='Trail is at least in part wheelchair accessible. See below for details.' src='img/icon_handicap_green.png'>\");\n } else {\n $('.detailPanel .detailActivityRow .handicap').html(\"<img class='activity-icons' title='Trail is at least in part wheelchair accessible. See below for details.' src='img/icon_handicap_green.png'>\");\n }\n }\n\n if (trail.attributes.equestrian && trail.attributes.equestrian.toLowerCase().indexOf('y') === 0) {\n if (!SMALL) {\n $('.detailPanel .detailTopRow#right .horse').html(\"<img class='activity-icons' title='Trail is appropriate for equestrian use. See below for details.' src='img/icon_horse_green.png'>\");\n } else {\n $('.detailPanel .detailActivityRow .horse').html(\"<img class='activity-icons' title='Trail is appropriate for equestrian use. See below for details.' src='img/icon_horse_green.png'>\");\n }\n }\n\n if (trail.attributes.xcntryski && trail.attributes.xcntryski.toLowerCase().indexOf('y') === 0) {\n if (!SMALL) {\n $('.detailPanel .detailTopRow#right .xcountryski').html(\"<img class='activity-icons' title='Trail is appropriate for cross-country skiing. See below for details.' src='img/icon_xcountryski_green.png'>\");\n } else {\n $('.detailPanel .detailActivityRow .xcountryski').html(\"<img class='activity-icons' title='Trail is appropriate for cross-country skiing. See below for details.' src='img/icon_xcountryski_green.png'>\");\n }\n }\n\n if (trailhead.attributes.parking && trailhead.attributes.parking.toLowerCase().indexOf('y') === 0) {\n $('.detailPanel .parking').html(\"<img class='amenity-icons' title='Parking available on site.' src='img/icon_parking_green.png'>\");\n }\n if (trailhead.attributes.drinkwater && trailhead.attributes.drinkwater.toLowerCase().indexOf('y') === 0) {\n $('.detailPanel .water').html(\"<img class='amenity-icons' title='NOTE: Drinking water not available during winter temperatures.' src='img/icon_water_green.png'>\");\n }\n if (trailhead.attributes.restrooms && trailhead.attributes.restrooms.toLowerCase().indexOf('y') === 0) {\n $('.detailPanel .restrooms').html(\"<img class='amenity-icons' title='Restrooms on site.' src='img/icon_restroom_green.png'>\");\n }\n if (trailhead.attributes.kiosk && trailhead.attributes.kiosk.toLowerCase().indexOf('y') === 0) {\n $('.detailPanel .kiosk').html(\"<img class='amenity-icons' title='Information kiosk on site.' src='img/icon_kiosk_green.png'>\");\n }\n\n $('.detailPanel .detailSource').html(trailhead.attributes.source);\n\n if (trail.attributes.length) {\n var mileString = trail.attributes.length == \"1\" ? \"mile\" : \"miles\";\n $('.detailPanel .detailLength').html(trail.attributes.length + \" \" + mileString);\n } else {\n $('.detailPanel .detailLength').html(\"--\");\n }\n\n\n $('.detailPanel .detailDescription').html(trail.attributes.description);\n\n if (trail.attributes.map_url) {\n $('.detailPanel .detailPrintMap a').attr(\"href\", trail.attributes.map_url).attr(\"target\", \"_blank\");\n $('.detailPanel .detailPrintMap').show();\n } else {\n $('.detailPanel .detailPrintMap').hide();\n }\n\n var directionsUrl = \"http://maps.google.com?saddr=\" + currentUserLocation.lat + \",\" + currentUserLocation.lng +\n \"&daddr=\" + trailhead.geometry.coordinates[1] + \",\" + trailhead.geometry.coordinates[0];\n $('.detailPanel .detailDirections a').attr(\"href\", directionsUrl).attr(\"target\", \"_blank\");\n //\n var emailSubject = encodeURIComponent(\"Heading to the \" + trail.attributes.name);\n var emailBody = encodeURIComponent(\"Check out more trails at tothetrails.com!\");\n $(\".email a\").attr(\"href\", \"mailto:?subject=\" + emailSubject + \"&body=\" + emailBody).attr(\"target\", \"_blank\");\n\n var tweet = encodeURIComponent(\"Heading to the \" + trail.attributes.name + \". Find it on tothetrails.com!\");\n $(\".twitter a\").attr(\"href\", \"http://twitter.com/home?status=\" + tweet).attr(\"target\", \"_blank\");\n\n var facebookStatus = encodeURIComponent(\"Heading to the \" + trail.attributes.name + \"!\");\n $(\".facebook a\").attr(\"href\",\n \"http://www.facebook.com/sharer/sharer.php?s=100&p[url]=tothetrails.com&p[images][0]=&p[title]=To%20The%20Trails!&p[summary]=\" + facebookStatus).attr(\"target\", \"_blank\");\n $('.detailPanel .detailBottomRow .detailTrailheadAmenities .detailTrailheadIcons');\n\n if (trail.attributes.steward_fullname) {\n $('.detailPanel .detailFooter').show();\n if (trail.attributes.steward_logo_url && trail.attributes.steward_logo_url.indexOf(\"missing.png\") == -1) {\n $('.detailPanel .detailStewardLogo').attr(\"src\", trail.attributes.steward_logo_url).show();\n }\n $('.detailPanel .detailFooter .detailSource').html(trail.attributes.steward_fullname).attr(\"href\", trail.attributes.steward_url).attr(\"target\", \"_blank\");\n if (SMALL) {\n $('.detailPanel .detailSourcePhone').html(\"<a href='tel:\" + trail.attributes.steward_phone + \"'>\" + trail.attributes.steward_phone + \"</a>\");\n }\n else {\n $('.detailPanel .detailSourcePhone').html(trail.attributes.steward_phone);\n }\n } else {\n $('.detailPanel .detailFooter').hide();\n }\n\n }\n\n function showDetailPanel(show){\n console.log(\"showDetailPanel\");\n if (show){\n $('.detailPanel').addClass('expanded');\n $('.detailPanel').removeClass('contracted');\n $('.statusMessage span').removeClass('truncate');\n } else {\n $('.detailPanel').addClass('contracted');\n $('.detailPanel').removeClass('expanded');\n $('.statusMessage span').addClass('truncate');\n }\n }\n\n function slideDetailPanel(e) {\n console.log(\"slideDetailPanel\");\n if ($(e.target).parents(\".detailPanel\").hasClass(\"expanded\")) {\n showDetailPanel(false);\n } else {\n showDetailPanel(true);\n }\n }\n\n // Mobile-only function changing the position of the detailPanel\n\n function moveSlideDrawer(e) {\n console.log(\"moveSlideDrawer\");\n if ($(\".slideDrawer\").hasClass(\"closedDrawer\")) {\n console.log(\"openSlideDrawer\");\n $('.slideDrawer').removeClass('closedDrawer');\n $('.slideDrawer').addClass(\"openDrawer\");\n // and move the Detail Panel all the way down\n if ($(\".detailPanel\").hasClass(\"expanded\")) {\n $(\".detailPanel\").removeClass(\"expanded\");\n $(\".detailPanel\").addClass(\"hidden\");\n } else {\n $(\".detailPanel\").removeClass(\"contracted\");\n $(\".detailPanel\").addClass(\"hidden\");\n }\n } else {\n console.log(\"closeSlideDrawer\");\n $('.slideDrawer').removeClass('openDrawer');\n $('.slideDrawer').addClass('closedDrawer');\n // and restore the Detail Panel to contracted\n $('.detailPanel').removeClass(\"hidden\");\n $('.detailPanel').addClass(\"contracted\");\n }\n }\n\n // About page functions\n\n function openAboutPage() {\n console.log(\"openAboutPage\");\n $(\".aboutPage\").show();\n if (!SMALL) {\n $('.accordion').hide();\n }\n }\n\n function closeAboutPage() {\n console.log(\"closeAboutPage\");\n $('.aboutPage').hide();\n $('.accordion').show();\n }\n\n\n // event handler for click of a trail name in a trailhead popup\n\n // Going to change the function of this trailnameClick function\n // But currently, it is not logging trailnameClick.\n // Current: init populateTrailsforTrailheadName(e)\n // Future: init showTrailDetails\n\n function trailnameClick(e) {\n console.log(\"trailnameClick\");\n populateTrailsForTrailheadTrailName(e);\n }\n\n // given jquery\n\n function parseTrailElementData($element) {\n var trailheadID = $element.data(\"trailheadid\");\n var highlightedTrailIndex = $element.data(\"index\") || 0;\n var trailID = $element.data(\"trailid\");\n var results = {\n trailheadID: trailheadID,\n highlightedTrailIndex: highlightedTrailIndex,\n trailID: trailID\n };\n return results;\n }\n\n // two event handlers for click of trailDiv and trail in trailhead popup:\n // get the trailName and trailHead that they clicked on\n // highlight the trailhead (showing all of the trails there) and highlight the trail path\n\n function populateTrailsForTrailheadDiv(e) {\n console.log(\"populateTrailsForTrailheadDiv\");\n var $myTarget;\n\n // this makes trailname click do the same thing as general div click\n // (almost certainly a better solution exists)\n if (e.target !== this) {\n $myTarget = $(this);\n } else {\n $myTarget = $(e.target);\n }\n var parsed = parseTrailElementData($myTarget);\n highlightTrailhead(parsed.trailheadID, parsed.highlightedTrailIndex);\n var trail = currentTrailData[parsed.trailID];\n var trailhead = getTrailheadById(parsed.trailheadID);\n\n if (trail == null || trail == undefined)\n alert(\"No Trail(s) found\")\n else\n showTrailDetails(trail, trailhead);\n }\n\n function populateTrailsForTrailheadTrailName(e) {\n console.log(\"populateTrailsForTrailheadTrailName\");\n\n var $myTarget;\n if ($(e.target).data(\"trailheadid\")) {\n $myTarget = $(e.target);\n } else {\n $myTarget = $(e.target.parentNode);\n }\n var parsed = parseTrailElementData($myTarget);\n var trailhead = getTrailheadById(parsed.trailheadID);\n // for (var i = 0; i < trailheads.length; i++) {\n // if (trailheads[i].properties.id == parsed.trailheadID) {\n // trailhead = trailheads[i];\n // }\n // }\n // decorateDetailPanel(trailData[parsed.trailID], trailhead);\n highlightTrailhead(parsed.trailheadID, parsed.highlightedTrailIndex);\n var trail = currentTrailData[parsed.trailID];\n showTrailDetails(trail, trailhead);\n }\n\n function getTrailheadById(trailheadID) {\n var trailhead;\n for (var i = 0; i < originalTrailheads.length; i++) {\n if (originalTrailheads[i].attributes.id == trailheadID) {\n trailhead = originalTrailheads[i];\n break;\n }\n }\n return trailhead;\n }\n\n function highlightTrailInPopup(trailhead, highlightedTrailIndex) {\n // add selected class to selected trail in trailhead popup, and remove it from others,\n // unless highlightedTrailIndex == -1, then just remove it everywhere\n var $trailheadPopupContent = $(trailhead.popupContent);\n\n $trailheadPopupContent.find(\".trailhead-trailname\").removeClass(\"selected\").addClass(\"not-selected\");\n if (highlightedTrailIndex != -1) {\n var trailID = trailhead.trails[highlightedTrailIndex];\n var selector = '[data-trailid=\"' + trailID + '\"]';\n var $trailnameItem = $trailheadPopupContent.find(selector);\n $trailnameItem.addClass(\"selected\").removeClass(\"not-selected\");\n }\n trailhead.popupContent = $trailheadPopupContent.outerHTML();\n\n if ($('.detailPanel').is(\":visible\")) {\n // console.log(\"detail is open\");\n // console.log($('.trailhead-trailname.selected'));\n $('.trailhead-trailname.selected').addClass(\"detail-open\");\n }\n }\n\n // given a trailheadID and a trail index within that trailhead\n // display the trailhead marker and popup,\n // then call highlightTrailheadDivs() and getAllTrailPathsForTrailhead()\n // with the trailhead record\n\n function highlightTrailhead(trailheadID, highlightedTrailIndex) {\n console.log(\"highlightTrailhead\");\n highlightedTrailIndex = highlightedTrailIndex || 0;\n var trailhead = null;\n trailhead = getTrailheadById(trailheadID);\n // for (var i = 0; i < trailheads.length; i++) {\n // if (trailheads[i].properties.id == trailheadID) {\n // trailhead = trailheads[i];\n // break;\n // }\n // }\n\n if ($('.detailPanel').is(\":visible\")) {\n $('.trailhead-trailname.selected').removeClass(\"detail-open\");\n }\n\n if (currentTrailhead) {\n map.removeLayer(currentTrailhead.marker);\n currentTrailhead.marker = new L.CircleMarker(currentTrailhead.marker.getLatLng(), {\n color: \"#D86930\",\n fillOpacity: 0.5,\n opacity: 0.6,\n zIndexOffset: 100\n }).setRadius(MARKER_RADIUS).addTo(map);\n setTrailheadEventHandlers(currentTrailhead);\n }\n if ($('.detailPanel').is(\":visible\")) {\n $('.trailhead-trailname.selected').addClass(\"detail-open\");\n }\n currentTrailhead = trailhead;\n\n map.removeLayer(currentTrailhead.marker);\n currentTrailhead.marker = new L.Marker(currentTrailhead.marker.getLatLng(), {\n icon: trailheadIcon1\n }).addTo(map);\n setTrailheadEventHandlers(currentTrailhead);\n\n getAllTrailPathsForTrailhead(trailhead, highlightedTrailIndex);\n highlightTrailInPopup(trailhead, highlightedTrailIndex);\n var popup = new L.Popup({\n offset: [0, -12],\n autoPanPadding: [10, 10],\n autoPan: SMALL ? false : true\n })\n .setContent(trailhead.popupContent)\n .setLatLng(trailhead.marker.getLatLng())\n .openOn(map);\n }\n\n\n\n function getAllTrailPathsForTrailhead(trailhead, highlightedTrailIndex) {\n console.log(\"getAllTrailPathsForTrailhead\");\n if (trailSegments.type == \"FeatureCollection\" && USE_LOCAL) {\n getAllTrailPathsForTrailheadLocal(trailhead, highlightedTrailIndex);\n } else {\n getAllTrailPathsForTrailheadRemote(trailhead, highlightedTrailIndex);\n }\n }\n\n // given a trailhead and a trail index within that trailhead\n // get the paths for any associated trails,\n // then call drawMultiTrailLayer() and setCurrentTrail()\n\n function getAllTrailPathsForTrailheadRemote(trailhead, highlightedTrailIndex) {\n console.log(\"getAllTrailPathsForTrailheadRemote\");\n\n var queryTaskArray = [];\n var trailFeatureArray = [];\n var newRemoteSegmentCache = {};\n // got trailhead.trails, now get the segment collection for all of them\n // get segment collection for each\n for (var i = 0; i < trailhead.trails.length; i++) {\n var trailFeatureCollection = {\n type: \"FeatureCollection\",\n features: [{\n geometry: {\n geometries: [],\n type: \"GeometryCollection\"\n },\n type: \"Feature\"\n }]\n };\n var trailID = trailhead.trails[i];\n var trail = originalTrailData[trailID];\n\n if (trail == null || trail == undefined)\n continue;\n\n var trailName = trail.attributes.name;\n\n var queryTask = function(trailID, index, featureCollection) {\n return function(callback) {\n if (remoteSegmentCache[trailID]) {\n featureCollection = remoteSegmentCache[trailID];\n newRemoteSegmentCache[trailID] = remoteSegmentCache[trailID];\n trailFeatureArray[index] = featureCollection;\n callback(null, trailID);\n }\n else {\n var callData = {\n type: \"GET\",\n path: \"http:///trailsegments.json?trail_id=\" + trailID\n };\n makeAPICall(callData, function(response) {\n featureCollection.features[0].properties = {\n trailname: trailName\n };\n for (var f = 0; f < response.features.length; f++) {\n featureCollection.features[0].geometry.geometries.push(response.features[f].geometry);\n }\n trailFeatureArray[index] = featureCollection;\n newRemoteSegmentCache[trailID] = featureCollection;\n callback(null, trailID);\n });\n }\n };\n }(trailID, i, trailFeatureCollection);\n queryTaskArray.push(queryTask);\n }\n async.parallel(queryTaskArray, function(err, results) {\n console.log(\"async finish\");\n remoteSegmentCache = newRemoteSegmentCache;\n trailFeatureArray = mergeResponses(trailFeatureArray);\n drawMultiTrailLayer(trailFeatureArray);\n setCurrentTrail(highlightedTrailIndex);\n });\n }\n\n\n // LOCAL EDITION:\n // given a trailhead and a trail index within that trailhead\n // get the paths for any associated trails,\n // then call drawMultiTrailLayer() and setCurrentTrail()\n // (it's a little convoluted because it's trying to return identical GeoJSON to what\n // CartoDB would return)\n\n function getAllTrailPathsForTrailheadLocal(trailhead, highlightedTrailIndex) {\n console.log(\"getAllTrailPathsForTrailheadLocal\");\n var responses = [];\n var trailFeatureArray = [];\n // got trailhead.trails, now get the segment collection for all of them\n // get segment collection for each\n for (var i = 0; i < trailhead.trails.length; i++) {\n var trailID = trailhead.trails[i];\n var trail = currentTrailData[trailID];\n var trailSource = trail.properties.source;\n var trailName = trail.properties.name;\n var trailFeatureCollection = {\n type: \"FeatureCollection\",\n features: [{\n geometry: {\n geometries: [],\n type: \"GeometryCollection\"\n },\n type: \"Feature\"\n }]\n };\n var valid = 0;\n var segmentsLength = trailSegments.features.length;\n for (var segmentIndex = 0; segmentIndex < segmentsLength; segmentIndex++) {\n var segment = trailSegments.features[segmentIndex];\n if ((segment.properties.trail1 == trailName ||\n segment.properties.trail1 + \" Trail\" == trailName ||\n segment.properties.trail2 == trailName ||\n segment.properties.trail2 + \" Trail\" == trailName ||\n segment.properties.trail3 == trailName ||\n segment.properties.trail3 + \" Trail\" == trailName ||\n segment.properties.trail4 == trailName ||\n segment.properties.trail4 + \" Trail\" == trailName ||\n segment.properties.trail5 == trailName ||\n segment.properties.trail5 + \" Trail\" == trailName ||\n segment.properties.trail6 == trailName ||\n segment.properties.trail6 + \" Trail\" == trailName) &&\n // this was intended to use only trailhead source's data for a trail, but\n // it causes more problems than it solves.\n // (segment.properties.source == trailSource || trailName == \"Ohio & Erie Canal Towpath Trail\")) {\n 1) {\n trailFeatureCollection.features[0].properties = {\n trailname: trailName\n };\n valid = 1;\n // console.log(\"match\");\n trailFeatureCollection.features[0].geometry.geometries.push(segment.geometry);\n } else {\n // console.log(\"invalid!\");\n }\n }\n if (valid) {\n trailFeatureArray.push(trailFeatureCollection);\n }\n }\n console.log(\"getAllTrailPathsForTrailheadLocal end\");\n\n responses = mergeResponses(trailFeatureArray);\n drawMultiTrailLayer(responses);\n setCurrentTrail(highlightedTrailIndex);\n }\n\n\n // merge multiple geoJSON trail features into one geoJSON FeatureCollection\n\n function mergeResponses(responses) {\n\n console.log(\"mergeResponses\");\n // console.log(responses);\n\n // var combined = { type: \"FeatureCollection\", features: [] };\n // for (var i = 0; i < responses.length; i++) {\n // console.log(\"xxxx\");\n // console.log(responses[i]);\n // // responses[i].properties.order = i;\n // combined.features.push(responses[i]);\n // }\n\n\n var combined = $.extend(true, {}, responses[0]);\n if (combined.features) {\n combined.features[0].properties.order = 0;\n for (var i = 1; i < responses.length; i++) {\n combined.features = combined.features.concat(responses[i].features);\n combined.features[i].properties.order = i;\n }\n } else {\n console.log(\"ERROR: missing segment data for trail.\");\n }\n // console.log(\"----\");\n // console.log(combined);\n return combined;\n }\n\n function checkSegmentsForTrailname(trailName, trailSource) {\n var segmentsExist = false;\n segmentsExist = trailName in segmentTrailnameCache || 'trailname + \" Trail\"' in segmentTrailnameCache;\n return segmentsExist;\n }\n\n // given a geoJSON set of linestring features,\n // draw them all on the map (in a single layer we can remove later)\n\n function drawMultiTrailLayer(response) {\n console.log(\"drawMultiTrailLayer\");\n if (currentMultiTrailLayer) {\n map.removeLayer(currentMultiTrailLayer);\n currentTrailLayers = [];\n }\n if (jQuery.isEmptyObject(response) || response.features[0].geometry === null) {\n alert(\"No trail segment data found.\");\n }\n else {\n currentMultiTrailLayer = L.geoJson(response, {\n style: {\n weight: NORMAL_SEGMENT_WEIGHT,\n color: NORMAL_SEGMENT_COLOR,\n opacity: 1,\n clickable: false,\n smoothFactor: customSmoothFactor\n },\n onEachFeature: function(feature, layer) {\n currentTrailLayers.push(layer);\n }\n }).addTo(map);\n //.bringToFront();\n zoomToLayer(currentMultiTrailLayer);\n }\n }\n\n // given the index of a trail within a trailhead,\n // highlight that trail on the map, and call zoomToLayer with it\n\n function setCurrentTrail(index) {\n console.log(\"setCurrentTrail\");\n if (currentHighlightedTrailLayer && typeof currentHighlightedTrailLayer.setStyle == \"Function\") {\n currentHighlightedTrailLayer.setStyle({\n weight: NORMAL_SEGMENT_WEIGHT,\n color: NORMAL_SEGMENT_COLOR\n });\n }\n if (currentTrailLayers[index]) {\n currentHighlightedTrailLayer = currentTrailLayers[index];\n currentHighlightedTrailLayer.setStyle({\n weight: ACTIVE_TRAIL_WEIGHT,\n color: ACTIVE_TRAIL_COLOR\n });\n currentHighlightedTrailLayer.bringToFront();\n } else {\n console.log(\"ERROR: trail layer missing\");\n console.log(currentTrailLayers);\n console.log(index);\n }\n console.log(\"setCurrentTrail end\");\n }\n\n // given a leaflet layer, zoom to fit its bounding box, up to MAX_ZOOM\n // in and MIN_ZOOM out (commented out for now)\n\n function zoomToLayer(layer) {\n console.log(\"zoomToLayer\");\n // figure out what zoom is required to display the entire trail layer\n var layerBoundsZoom = map.getBoundsZoom(layer.getBounds());\n // console.log(layer.getLayers().length);\n\n // var layerBoundsZoom = map.getZoom();\n // console.log([\"layerBoundsZoom:\", layerBoundsZoom]);\n\n // if the entire trail layer will fit in a reasonable zoom full-screen,\n // use fitBounds to place the entire layer onscreen\n if (!SMALL && layerBoundsZoom <= MAX_ZOOM && layerBoundsZoom >= MIN_ZOOM) {\n map.fitBounds(layer.getBounds(), {\n paddingTopLeft: centerOffset\n });\n }\n\n // otherwise, center on trailhead, with offset, and use MAX_ZOOM or MIN_ZOOM\n // with setView\n else {\n var newZoom = layerBoundsZoom > MAX_ZOOM ? MAX_ZOOM : layerBoundsZoom;\n newZoom = newZoom < MIN_ZOOM ? MIN_ZOOM : newZoom;\n // setTimeout(function() {\n var originalLatLng = currentTrailhead.marker.getLatLng();\n var projected = map.project(originalLatLng, newZoom);\n var offsetProjected = projected.subtract(centerOffset.divideBy(2));\n var newLatLng = map.unproject(offsetProjected, newZoom);\n map.setView(newLatLng, newZoom);\n // }, 0);\n }\n console.log(\"zoomToLayer end\");\n }\n\n function makeAPICall(callData, doneCallback) {\n console.log('makeAPICall: ' + callData.path);\n if (!($.isEmptyObject(callData.data))) {\n callData.data = JSON.stringify(callData.data);\n }\n var url = API_HOST + callData.path;\n // var url = callData.path;\n var request = $.ajax({\n type: callData.type,\n url: url,\n dataType: \"json\",\n async: false,\n contentType: \"application/json; charset=utf-8\",\n //beforeSend: function(xhr) {\n // xhr.setRequestHeader(\"Accept\", \"application/json\")\n //},\n data: callData.data\n }).fail(function(jqXHR, textStatus, errorThrown) {\n console.log(\"error! \" + errorThrown + \" \" + textStatus);\n console.log(jqXHR.status);\n $(\"#results\").text(\"error: \" + JSON.stringify(errorThrown));\n }).done(function(response, textStatus, jqXHR) {\n if (typeof doneCallback === 'function') {\n console.log(\"calling doneCallback: \" + callData.path);\n doneCallback.call(this, response);\n }\n });\n }\n\n // get the outerHTML for a jQuery element\n\n jQuery.fn.outerHTML = function(s) {\n return s ? this.before(s).remove() : jQuery(\"<p>\").append(this.eq(0).clone()).html();\n };\n\n\n}", "title": "" }, { "docid": "2ba1049f16ba1e194f8b24084f18324d", "score": "0.47873488", "text": "async function main_Owner() {\n await fetchConfig();\n\n // call the createTransparentFrame() factory function to create a\n // full-width, full-height, transparent iframe and a wrapper class\n // that allows us to control the call and respond to call events\n callFrame = window.DailyIframe.createTransparentFrame();\n callFrame.on('joining-meeting', showEvent)\n .on('joined-meeting', showEvent)\n .on('left-meeting', cleanupAfterLeaving)\n .on('participant-joined', updateUI)\n .on('participant-updated', updateUI)\n .on('participant-left', updateUI)\n .on('error', showEvent);\n window.callFrame = callFrame;\n\n // set up the div where we will display info about ourself\n localInfoDiv = document.getElementById('local-info');\n localInfoDiv.innerHTML = NOT_IN_MEETING_HTML;\n\n // set up the div where we will display info about remote participants\n // in the call\n remoteInfoDiv = document.getElementById('remote-participants-list'); \n}", "title": "" }, { "docid": "67cf55e2b13db69293e27ca772c7806e", "score": "0.4782328", "text": "function setUserPhoneMsg( msg ) {\n\n // runs once break this out, this update function is absurd.\n if (!isConnected) {\n // setTimeout(function() {\n //showFeatures = true;\n// //console.log(\"show features is now true\");\n // }, 8000);\n\n var detection = $('.detection');\n var phoneSpan = detection.find(\"p span\");\n var phoneSpanLoading = $('.phone-model');\n// //console.log(msg.brand);\n //Process phone codes\n// //console.log(\"original phone: \" + msg.phone);\n\n if (msg.phone !== \"\" || msg.devicetype=='tablet') {\n\n //Filter generics\n if (msg.phone.toLowerCase().indexOf('s5') > -1) {\n userPhone = 'generic';\n } else if (msg.phone.toLowerCase().indexOf('4') > -1 && msg.phone.toLowerCase().indexOf('note') > -1) {\n userPhone = 'generic';\n } else {\n userPhone = msg.phone.split(' ').join('').toLowerCase();\n }\n //Filter Brand\n var deviceString;\n if (msg.brand.toLowerCase().indexOf('samsung') > -1) {\n deviceString=\"Samsung device\";\n if (msg.devicetype=='tablet'){\n userPhone='generic';\n }\n } else if (msg.phone.toLowerCase().indexOf('iphone') > -1) {\n deviceString=\"iPhone\";\n } else {\n var deviceString=(msg.devicetype=='tablet')?'tablet':'phone';\n userPhone='generic';\n }\n phoneSpan.html(deviceString);\n phoneSpanLoading.html(deviceString);\n\n }\n // //console.log('features :', userPhone);\n reloadFeatures();\n\n\n\n\n hideIntroScreen();\n isConnected = true;\n\n\n }\n\n // end run once function\n\n }", "title": "" }, { "docid": "78e89df543d519a8110881d4cdaf5529", "score": "0.47770882", "text": "function makeApiCall() {\n // Step 4: Load the Google+ API\n gapi.client.load('plus', 'v1', function() {\n // Step 5: Assemble the API request\n var request = gapi.client.plus.people.get({\n 'userId': 'me'\n });\n // Step 6: Execute the API request\n request.execute(function(resp) {\n var authorizeButton = document.getElementById('authorize-button');\n\n if (authorizeButton) {\n authorizeButton.innerText = 'Logged in as ' + resp.displayName;\n }\n\n localStorage.isAuthenticated = true;\n Backbone.history.navigate('', true);\n });\n });\n }", "title": "" }, { "docid": "75f8e2b6ec667a8dc346d32586bab494", "score": "0.47744083", "text": "function init() {\n chatUpdateSetup();\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(geoSuccess, geoError);\n }\n else{\n console.log(\"Browser geolocation isn't supported.\");\n geoSuccess(position)\n }\n setupInputBox();\n }", "title": "" }, { "docid": "0aa5b43ab2e9448172350e68d9c4d40c", "score": "0.47722048", "text": "function main(){\n\tvar instance = new Router(),\n\t\tinputNode = document.querySelector('#inputText'),\n\t\timgContainerNode = document.querySelector('#imgContainer'),\n\t\tcityNameNode = document.querySelector('#cityName')\n\n\tif(cityNameNode.innerHTML===''&&imgContainerNode.innerHTML===''){\n\t\tvar hashArr = location.hash.substr(1).split('/')\n\t\tsetCityName(hashArr[0],hashArr[1])\n\t}\n\n\tBackbone.history.start()\n\tstartButtonEvents()\n\tinputNode.addEventListener('keydown', function(e){\n\t\tif(e.keyCode==13){\n\t\t\tshowLoader()\n\t\t\tmakeLocationPromise(inputNode.value)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "485959617b3c530012027c1551f208da", "score": "0.47720483", "text": "function login_elementsExtraJS() {\n // screen (login) extra code\n\n /* mobilepopup_9 */\n $(\"#login_mobilepopup_9\").popup(\"option\", \"positionTo\", \"window\");\n\n }", "title": "" }, { "docid": "185b2e0d0d57ff8c42e97dae3a896b82", "score": "0.47683772", "text": "function mobilePhoneCreateAccount() {\n\n mobileLoginPhoneNumber=getPhoneValue(\"userPhone\");\n\n if ( mobileLoginPhoneNumber.length == 0 ) {\n toast(\"Phone number needed.\");\n return;\n }\n\n if ( mobileLoginPhoneNumber.length != 10 ) {\n toast(\"Incomplete Phone number.\");\n return;\n }\n\n mobileLoginServiceProvider = getInputDropdown(\"serviceProvider\");\n\n var formData = new FormData();\n formData.append('phoneNumber', mobileLoginPhoneNumber);\n formData.append('serviceProvider', mobileLoginServiceProvider);\n formData.append('AXIS_API', 'mobileUserAdd');\n formData.append('AXIS_API_KEY', appRules.axisAPIKey);\n\n spinnerStart();\n $.ajax({\n url : appRules.apiEndPoint,\n type : 'POST',\n data : formData,\n processData : false,\n contentType : false,\n success : function(data) {\n spinnerStop();\n if ( data.returnStatus == \"FAIL\" ) {\n toast(data.statusMessage);\n } else {\n customerId = data.customerId; \n showMobileLoginPinPage();\n }\n },\n error : function(data) {\n spinnerStop();\n toast(\"Network Error!\");\n }\n });\n}", "title": "" }, { "docid": "05e69f27f152245d6db83e57726ea0f5", "score": "0.476597", "text": "function Register(){\n\n\t\t// catch exception for IE (DOM not ready)\n\t\ttry {// create SIP stack\n\n\t\t if (!txtRealm || !txtPrivateIdentity || !txtPublicIdentity) {\n\t\t //'<b>Please fill madatory fields (*)</b>';\n\t\t return;\n\t\t }\n\t\t var o_impu = tsip_uri.prototype.Parse(txtPublicIdentity);\n\t\t if (!o_impu || !o_impu.s_user_name || !o_impu.s_host) {\n\t\t // \"<b>[\" + txtPublicIdentity + \"] is not a valid Public identity</b>\";\n\t\t return;\n\t\t }\n\n\t\t // enable notifications if not already done\n\t\t if (window.webkitNotifications && window.webkitNotifications.checkPermission() != 0) {\n\t\t window.webkitNotifications.requestPermission();\n\t\t }\n\n\t\t var i_port;\n\t\t var s_proxy;\n\n\t\t if (!tsk_utils_have_websocket()) {\n\t\t // port and host will be updated using the result from DNS SRV(NAPTR(realm))\n\t\t i_port = 5060;\n\t\t s_proxy = txtRealm;\n\n\t\t }\n\t\t else {\n\t\t // there are at least 5 servers running on the cloud on ports: 4062, 5062, 6062, 7062 and 8062\n\t\t // we will connect to one of them and let the balancer to choose the right one (less connected sockets)\n\t\t // each port can accept up to 65K connections which means that the cloud can manage 325K active connections\n\t\t // the number of port will be increased or decreased based on the current trafic\n\t\t i_port = 4062 + (((new Date().getTime()) % 5) * 1000);\n\t\t s_proxy = \"sipml5.org\";\n\n\t\t }\n\t\t \n\t\t \n\t\t // create a new SIP stack. Not mandatory as it's possible to reuse the same satck\n\t\t oSipStack = new SIPml.Stack({\n\t\t realm: txtRealm,\n\t\t impi: txtPrivateIdentity,\n\t\t impu: txtPublicIdentity,\n\t\t password: txtPassword,\n\t\t display_name: txtDisplayName,\n\t\t websocket_proxy_url: s_websocket_server_url,\n\t\t outbound_proxy_url: s_sip_outboundproxy_url,\n\t\t ice_servers: null,\n\t\t enable_rtcweb_breaker: true,\n\t\t events_listener: { events: '*', listener: onSipEventStack },\n\t\t sip_headers: [\n\t\t { name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.2013.04.26' },\n\t\t { name: 'Organization', value: 'Doubango Telecom' }\n\t\t ]\n\t\t }\n\t\t );\n\n\n\t\t \n\n\t\t if (oSipStack.start() != 0) {\n\t\t //'<b>Failed to start the SIP stack</b>';\n\t\t }\n\t\t else return;\n\t\t}\n\t\tcatch (e) {\n\t\t // \"<b>2:\" + e + \"</b>\";\n\t\t}\n\t }", "title": "" }, { "docid": "f500cfaab09b7fa6960f937bcdfcf6bc", "score": "0.4762573", "text": "function C005_GymClass_Jennifer_ExplainMobile() {\n\tif (IsMobile) \n\t\tOverridenIntroText = GetText(\"ExplainMobile\");\n}", "title": "" }, { "docid": "9a9debc8f7b4df9970bd1269fbe8ffb1", "score": "0.47616896", "text": "function loadPhones(){\r\n\t\tif (InboxManager.online) {\r\n\t\t\t$('.label-status').text(InboxManager.gvData.number.formatted).addClass('gv-number');\r\n\t\t\t\r\n\t\t\tvar rememberPhone = localStorage.quickcall_phone;\r\n\t\t\t$('#chkRemember').attr('checked', (rememberPhone) ? true : false);\r\n\t\t\t\r\n\t\t\tvar phonesHtml = '<div>';\r\n\t\t\tvar phones = InboxManager.gvData.phones;\r\n\t\t\tvar divForwardNumber = $('#forwardNumber');\r\n\t\t\tvar divPhones = divForwardNumber.find('.dd-list');\r\n\t\t\t\r\n\t\t\tfor (var phone in phones) {\r\n\t\t\t\tif (phones.hasOwnProperty(phone)) {\r\n\t\t\t\t\tphonesHtml += '<div class=\"dd-menuItem';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!rememberPhone) {\r\n\t\t\t\t\t\trememberPhone = phones[phone].phoneNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (phones[phone].phoneNumber == rememberPhone) {\r\n\t\t\t\t\t\t$('#forwardNumber .dropdown-text').html(phones[phone].name).attr('id', 'defaultPhone:' + phone);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//phonesHtml.find('#phone\\\\:' + phone).addClass('dd-menuItem-selected');\r\n\t\t\t\t\t\tphonesHtml += ' dd-menuItem-selected';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tphonesHtml += '\" id=\"phone:' + phone + '\">' + phones[phone].name + '</div>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tphonesHtml += '</div>';\r\n\t\t\t\r\n\t\t\tdivPhones.html(phonesHtml);\r\n\t\t\t\r\n\t\t\tdivPhones.find('.dd-menuItem').hover(function(){\r\n\t\t\t\t$(this).addClass('dd-menuItem-hover');\r\n\t\t\t}, function(){\r\n\t\t\t\t$(this).removeClass('dd-menuItem-hover');\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tdivPhones.mousedown(function(event){\r\n\t\t\t\tvar target = $(event.target);\r\n\t\t\t\t$('#forwardNumber .dropdown-text').text(target.text()).attr('id', 'defaultPhone:' + (/phone:(\\d+)/).exec(target.attr('id'))[1]);\r\n\t\t\t\t\r\n\t\t\t\ttarget.siblings('.dd-menuItem-selected').removeClass('dd-menuItem-selected').end().addClass('dd-menuItem-selected');\r\n\t\t\t\t\r\n\t\t\t\t$('#forwardNumber .dd-list').stop(true, true).animate({\r\n\t\t\t\t\topacity: 'hide',\r\n\t\t\t\t\theight: 'hide'\r\n\t\t\t\t}, slideDuration);\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$('.label-status').removeClass('gv-number').css({\r\n\t\t\t\tcolor: \"#748CA1\"\r\n\t\t\t}).text(\"Offline\");\r\n\t\t}\r\n\t\t\r\n\t\t// Highlight the GV-Number.\r\n\t\t$('.label-status').highlightText();\r\n\t}", "title": "" }, { "docid": "bcd1007808a5b1201a89c24d44c6aa6d", "score": "0.47530183", "text": "function initOnboarding(){\n\t// set default webexID for Logging\n\tbrowser.storage.sync.set({\"webexID\" : \"123456789\"});\n\t\n\tvar slide = 0;\n\tconsole.log(\"Function : initOnboarding\");\n\t$('.onboarding').removeClass(\"hidden\");\n\t//TODO check options\n\tvar options = {\n\t\tcommon: {\n\t\t\tzxcvbn : true,\n\t\t\tzxcvbnTerms: [\"123456\",\"123456789\",\"qwerty\",\"qwertz\",\"12345678\",\"111111\",\"1234567890\",\"1234567\",\"password\",\"123123\",\"987654321\",\"qwertyuiop\",\"mynoob\",\"123321\",\"666666\",\"18atcskd2w\",\"7777777\",\"1q2w3e4r\",\"654321\",\"555555\",\"3rjs1la7qe\",\"google\",\"1q2w3e4r5t\",\"123qwe\",\"zxcvbnm\",\"1q2w3e\"]\t\n\t\t}\t\n\t};\n\t$('#inputCreateMPW').on('keyup', function(event) {\n\t\tif($(this).val().length > 0){\n\t\t\t$('.progress').show();\n\t\t\t$('.password-verdict').show();\n\t\t\t$('.onboarding a.btn-mp').show();\n\t\t}else{\n\t\t\t$('.progress').hide();\n\t\t\t$('.password-verdict').hide();\n\t\t\t$('.onboarding a.btn-mp').hide();\n\t\t}\n\t});\n\t$('#inputCreateMPW').pwstrength(options);\n\t$('.progress').addClass(\"strength\");\n\t$('.onboarding a.btn-mp').hide();\n\t$('.progress').hide();\n\t$('.password-verdict').hide();\n\t$('#next .material-icons').on('click', function(){\t\n\t\tif(++slide == $('.slide').length-1){\n\t\t\t$('.slide').animate({\"left\": \"-=600\"}, 500);\n\t\t\t$('#next').fadeOut();\n\t\t}else{\n\t\t\t$('.slide').animate({\"left\": \"-=600\"}, 500);\n\t\t}\n\t});\n\t$('#btnOpenManager').on('click', function(){\n\t\tvar mode = $('input:radio:checked').val();\n\t\t// console.log(mode);\n\t\tbrowser.storage.sync.set({'mode' : mode});\n\t\topenManager();\n\t});\n\t\n}", "title": "" }, { "docid": "d0f112e6d4177f0aac9d0073d10063bf", "score": "0.47478798", "text": "function oldCode(){\n\t\t\t/*var request = $scope.prePopulateTextarea;\n\t\t\tvar location = \"ws://localhost:8086/PS-DeviceManagerClient/pinpad\"; \n\t\t\tvar ws = new WebSocket(location);\n\n\t\t\tws.onopen = function() {\n\t\t\t\tws.send(request);\n\t\t \t};\t\n\t\t \t\n\t\t \tws.onmessage = function(message){\n\t\t\t\talert(\"Server: \" + message.data); \n\t\t\t\t$(\"textarea#response\").val(message.data);\n\t\t\t\tws.close();\n\t\t\t};\n\t\t\t\n\t\t\tws.onclose = function() {\n\t\t\t\tconsole.log(\"Connection closed\");\n\t\t\t}*/\n\t\t}", "title": "" }, { "docid": "be6fff842ef25f5402598a2f811fdf40", "score": "0.4734525", "text": "function init(){\n innovaphone.pbxwebsocket.PathPrefix = instanceConference.options.pathPrefix;\n innovaphone.applicationSharing.PathPrefix = instanceConference.options.pathPrefix;\n var WebRtcEndpoint = innovaphone.pbxwebsocket.WebRtc.Endpoint;\n var Connection = innovaphone.pbxwebsocket.Connection;\n\n if (instanceConference.endpoint) instanceConference.endpoint.close();\n instanceConference.endpoint = new WebRtcEndpoint(instanceConference.options.urlPbx, instanceConference.options.username, instanceConference.options.password, instanceConference.options.device, instanceConference.options.physicalLocation, instanceConference.options.regContext, logFunction, onCall.bind(instanceConference), instanceConference.onAuthenticateWebRtc);\n\n if (instanceConference.connection) instanceConference.connection.close();\n instanceConference.connection = new Connection(instanceConference.options.urlPbx, instanceConference.options.username, instanceConference.options.password);\n instanceConference.connection.onauthenticate = instanceConference.onAuthenticate;\n instanceConference.connection.onconnected = onConnected.bind(instanceConference);\n instanceConference.connection.onerror = onError.bind(instanceConference);\n instanceConference.connection.onclosed = onClosed.bind(instanceConference);\n instanceConference.connection.onendpointpresence = onEndpointPresence.bind(instanceConference);\n }", "title": "" }, { "docid": "0e89903fc75ce772a1a1bfbb85e94483", "score": "0.47341305", "text": "function inviteParticipants() {\n if (roomUrl === null)\n return;\n\n var sharedKeyText = \"\";\n if (sharedKey && sharedKey.length > 0) {\n sharedKeyText =\n \"This conference is password protected. Please use the \" +\n \"following pin when joining:%0D%0A%0D%0A\" +\n sharedKey + \"%0D%0A%0D%0A\";\n }\n\n var conferenceName = roomUrl.substring(roomUrl.lastIndexOf('/') + 1);\n var subject = \"Invitation to a \" + interfaceConfig.APP_NAME + \" (\" + conferenceName + \")\";\n var body = \"Hey there, I%37d like to invite you to a \" + interfaceConfig.APP_NAME +\n \" conference I%37ve just set up.%0D%0A%0D%0A\" +\n \"Please click on the following link in order\" +\n \" to join the conference.%0D%0A%0D%0A\" +\n roomUrl +\n \"%0D%0A%0D%0A\" +\n sharedKeyText +\n \"Note that \" + interfaceConfig.APP_NAME + \" is currently\" +\n \" only supported by Chromium,\" +\n \" Google Chrome and Opera, so you need\" +\n \" to be using one of these browsers.%0D%0A%0D%0A\" +\n \"Talk to you in a sec!\";\n\n if (window.localStorage.displayname) {\n body += \"%0D%0A%0D%0A\" + window.localStorage.displayname;\n }\n\n if (interfaceConfig.INVITATION_POWERED_BY) {\n body += \"%0D%0A%0D%0A--%0D%0Apowered by jitsi.org\";\n }\n\n window.open(\"mailto:?subject=\" + subject + \"&body=\" + body, '_blank');\n}", "title": "" }, { "docid": "4e10af947cb45e76a2ad80a6f169702c", "score": "0.47329313", "text": "function conferenceCenter() {\n\twindow.open(\"/confs\", \"_self\");\n}", "title": "" }, { "docid": "9ec0d5d5b540e40b74d4a82e7edc44cc", "score": "0.47310713", "text": "function initialize() {\n $(\"body\").on(\"pagecontainerchange\", function (event, ui) {\n if (ui.toPage.attr(\"id\") === \"page-settings\") {\n $(\"#settings-username-input\").val(settings.getUsername());\n $(\"#settings-password-input\").val(settings.getPassword());\n $(\"#settings-phone-number-input\").val(settings.getLocalPhoneNumber());\n $(\"#settings-history-input\").val(String(settings.getMessagesHistory()));\n $(\"#settings-poll-rate-input\").val(String(settings.getPollRate()));\n }\n });\n $(\"#settings-phone-numbers-button\").on(\"click\", function () {\n var phoneNumbersFieldset = $(\"#settings-phone-numbers-fieldset\");\n ui.loading.startLoading();\n api.getLocalPhoneNumbers(settings.getUsername(), settings.getPassword(), function (phoneNumbers, err) {\n if (err === null) {\n if (phoneNumbers.length === 0) {\n ui.notifications.showToastNotification(\"No phone numbers available. Is SMS enabled on \" + \"the phone number you wish to use?\");\n }\n else {\n phoneNumbersFieldset.empty();\n for (var i = 0; i < phoneNumbers.length; i++) {\n phoneNumbersFieldset.append($(\"<input id=\\\"settings-phone-numbers-radio-button-\" + i + \"\\\" name=\\\"\" + phoneNumbers[i] + \"\\\" type=\\\"radio\\\">\"));\n phoneNumbersFieldset.append($(\"<label for=\\\"settings-phone-numbers-radio-button-\" + i + \"\\\">\" + phoneNumbers[i] + \"</label>\"));\n }\n phoneNumbersFieldset.children().first().prop(\"checked\", true);\n $(\"#settings-phone-numbers-form\").trigger(\"create\");\n ui.loading.stopLoading();\n $(\"body\").pagecontainer(\"change\", \"#page-settings-phone-numbers\");\n }\n }\n else {\n ui.loading.stopLoading();\n ui.notifications.showToastNotification(err);\n }\n });\n });\n $(\"#settings-phone-numbers-select-button\").on(\"click\", function () {\n settings.setLocalPhoneNumber($('input:checked', '#settings-phone-numbers-fieldset').attr(\"name\"));\n history.back();\n });\n $(\"#settings-save-button\").on(\"click\", function () {\n var historyInput = $(\"#settings-history-input\");\n var pollRateInput = $(\"#settings-poll-rate-input\");\n if (isNaN(historyInput.val()) || parseInt(historyInput.val()) <= 0 || historyInput.val() > 90) {\n ui.notifications.showToastNotification(\"Number of days of SMS history to retrieve must be an \" + \"integer greater than 0 and less than or equal to 90.\");\n }\n else if (isNaN(pollRateInput.val()) || parseInt(pollRateInput.val()) < 0) {\n ui.notifications.showToastNotification(\"SMS poll rate must be an integer greater than or equal \" + \"to 0.\");\n }\n else {\n ui.notifications.showToastNotification(\"Settings saved.\", \"success\");\n settings.setUsername($(\"#settings-username-input\").val());\n settings.setPassword($(\"#settings-password-input\").val());\n settings.setMessagesHistory(historyInput.val());\n settings.setPollRate(pollRateInput.val());\n }\n });\n }", "title": "" }, { "docid": "af41c887a0cb772fb1f78e5973ac2ddc", "score": "0.47300434", "text": "function Helpee_onVoiceConnected()\n{\n\tTraceFunctEnter(\"Helpee_onVoiceConnected\");\n\ttry\n\t{\n\t\t// alert(\"in onVoiceConnected!\");\n\n\t\t// alert(\"Setting g_bVoipConnected = TRUE\");\n\n\t\t// Persist state for VoIP connection\n\t\tg_bVoipConnected = true;\n\n\t\tframes.idFrameTools.imgVoicePic.src = \"../Common/SendVoiceOn.gif\";\n\n\t\t\n\t}\n\tcatch (error)\n\t{\n\t\tFatalError(\"onVoiceConnected failed with \", error, false);\n\t}\n\tTraceFunctLeave();\n}", "title": "" }, { "docid": "f09ae55dc0b65bfdbe02349535d07acd", "score": "0.47266233", "text": "function validatePhone() {\n var inputPhone = getUserPhone();\n var box = getPhoneBox();\n validate(PHONE_MATCH, box, inputPhone);\n}", "title": "" }, { "docid": "fcabf39d217d282c652beec01b846cc5", "score": "0.47223222", "text": "function webGivePecan(){\r\n\tGivePecan(f_pecan, function(){\r\n\t});\r\n}", "title": "" }, { "docid": "6cad8fd281bcab611b6aba22843463a3", "score": "0.47214377", "text": "function callMethodForUIWebView(callInfo) {\n var url = \"surveyjs2objc://\";\n url += rfc3986EncodeURIComponent(JSON.stringify(callInfo));\n // Below approach of changing window's location is in case of\n // multiple consecutive requests, these can nullify each other!!!\n // window.location.href = url;\n // So we'll use the iframe approach, so no two calls can overlap\n var iframe = document.createElement(\"IFRAME\");\n iframe.setAttribute(\"src\", url);\n document.documentElement.appendChild(iframe);\n iframe.parentNode.removeChild(iframe);\n iframe = null;\n }", "title": "" }, { "docid": "b856835d298eb2820aa6287b37e6da40", "score": "0.47151813", "text": "function openBiometric(){\n\tvar aadharNo = $m.juci.dataset(\"Aadharno\");\n\tvar ValidateBiometricCallback = function(res) {\n\t\tcallBiometricService(res);\n\t};\n\tvar fingerPrintCallback = function(res) {\n\t\tif(res.code == 1){\n\t\t\tvar finalData = x2js.xml_str2json(res.result.PID_DATA);\n\t\t\tutils.PutPref(\"FingerprintData\",finalData);\n\t\t\tvar morphoInfo = utils.GetPref(\"MorphoDeviceInfo\");\n\t\t\tutils.ShowProgress(\"Fetching Aadhaar Data..\");\n\t\t\tAadharServices.ValidateBiometric(morphoInfo,finalData,ValidateBiometricCallback);\n\t\t} else {\n\t\t\t$m.alert(res.result);\n\t\t\t$m.logError(\"finger print callback failed due to : \"+res);\n\t\t}\t\n\t};\n\tvar getMorphoDeviceCallback = function(res) {\n\t\tif(res.code == 1){\n\t\t\tutils.HideProgress();\n\t\t\tvar finalRes = x2js.xml_str2json(res.result.DeviceInfo);\n\t\t\tutils.PutPref(\"MorphoDeviceInfo\",finalRes);\n\t\t\t$m.initFingerCaptureInput(fingerPrintCallback);\n\t\t} else {\n\t\t\tutils.HideProgress();\n\t\t\t$m.alert(res.result);\n\t\t\t$m.logError(\"morpho device callback failed due to : \"+res);\n\t\t}\n\t};\n\tvar registerMorphoCallback = function () {\n\t\tutils.HideProgress();\n\t\tutils.ShowProgress(\"Capturing device data..\");\n\t\t$m.getMorphoDeviceInfo(getMorphoDeviceCallback);\n\t};\n\tAadharServices.RegisterMorphoDevice(aadharNo,registerMorphoCallback);\n}", "title": "" }, { "docid": "c0d6ad5727241a2672f4f173edb94bf9", "score": "0.471168", "text": "function makeManualCall(phoneNum,campID,clientName,callKey){\n\t//alert('makeManualCall: ' + callOutID + ' - ' + CallID + ' - ' + phoneNumber + ' - ' + campID)\n\tdocument.getElementById(\"myTextArea\").value += 'Begin - makeManualCall: ' + phoneNum + ' - ' + campID + ' - ' + clientName + callKey + '\\n'\n\t//JavaScriptPackageRemote.makeManualCall(callOutID, CallID, phoneNumber, campID)\n\tJavaScriptPackageRemote.makeManualCall(phoneNum, campID, clientName, callKey)\n\tdocument.getElementById(\"myTextArea\").value += 'End - makeManualCall' +'\\n'\n}", "title": "" }, { "docid": "5ed5bcb8fabd05ee703768d58ce1d525", "score": "0.47115293", "text": "function getPatientEmailAndText() {\n var xmlhttp = new XMLHttpRequest();\n var pathArray = window.location.pathname.split('/');\n var newURL = window.location.protocol + '//' + window.location.host + '/' + pathArray[1] + '/demographic/demographiccontrol.jsp?displaymode=edit&dboperation=search_detail&demographic_no=' + demoNo;\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var str = xmlhttp.responseText;\n if (!str) {\n return;\n }\n var myRe = /Email:<\\/span>\\n\\s*<span class=\"info\">(.*)<\\/span>/i;\n var myArray;\n if ((myArray = myRe.exec(str)) !== null) {\n patientEmail = myArray[1];\n }\n myRe = /Cell Phone:<\\/span>\\n\\s*<span class=\"info\">(.*)<\\/span>/i;\n if ((myArray = myRe.exec(str)) !== null) {\n patientCell = makeTwilioFriendly(myArray[1]);\n setCookie('mypatientCell', patientCell, 360, 'path=/');\n }\n }\n };\n xmlhttp.open('GET', newURL, false);\n xmlhttp.send();\n //**Code for Oscar 15 Cell Phone Number*******************\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var str = xmlhttp.responseText\n if (!str) {\n return;\n }\n var myReString = '<span class=\"label\">Cell Phone(.|[\\n])*'\n var myRe = new RegExp(myReString, 'g');\n var myArray\n while ((myArray = myRe.exec(str)) !== null) {\n y = myArray.toString() //alert(y)\n var z = y.indexOf('info')\n var mycode = y.substring(z + 6)\n var mycode2 = mycode.indexOf('</span>')\n var mycode3 = mycode.substring(mycode + 9, mycode2) //alert(mycode3)\n patientCell = makeTwilioFriendly(mycode3);\n //alert(patientCell)\n setCookie('mypatientCell', patientCell, 360, 'path=/');\n }\n }\n }\n xmlhttp.open('GET', newURL, false);\n xmlhttp.send();\n //*****END Oscar 15 addition******************************\n}// finding the demographic number in three ways: 1) finding demographic_no in URL, 2) finding demographicNo in URL, 3) finding demo= in the whole webpage", "title": "" }, { "docid": "37369bc584ad73cdf95c309bfdb363a6", "score": "0.47107172", "text": "function OnCmdOnlineSetHome()\r\n{\r\n Kneemail.preferences.setCharPref(\"kneemail.online.home\", strOnlineAddress);\r\n document.getElementById(\"browser\").homePage = strOnlineAddress;\r\n}", "title": "" }, { "docid": "48035be794272b9c6a2bc1464935089b", "score": "0.4709418", "text": "function GetPhotography_Signature(){return EIDAWebComponent.GetPhotography_Signature();}", "title": "" }, { "docid": "552e301bc209c5bbd837db1bdd309842", "score": "0.46988222", "text": "function callNumber(phoneNumber) {\nwindow.open('tel:' + phoneNumber,'_system');\n}", "title": "" }, { "docid": "3b5e3e40cdcbee9c5cae8e8a955e0e55", "score": "0.4691968", "text": "function testPhoneCall() {\n $.get( ctx+'/approval/restaurant/testPhoneCall.html?mgn=' + (Math.random() * 99999999),\n function( data ) {\n if( data.success ) {\n alert( data.message);\n } else {\n alert('Error: ' + data.message);\n }\n }\n );\n}", "title": "" } ]
7fe8b464feb4826cb2224669426404c8
Compile styles for all blocks in package (from all files)
[ { "docid": "48258d1b1711703ad3146ab337271ae0", "score": "0.0", "text": "function joinStyles(lookup, destination, options) {\n var result = [];\n\n var processor = new Processor({\n cache: path.join(options.cacheDir, options.pkgName + '_' + options.version + '.json')\n });\n\n processor.process = function (file) {\n var extname = path.extname(file),\n renderer = RENDERERS[extname];\n\n assert.ok(renderer, 'Don\\'t know how to compile ' + file);\n\n var fileData = fs.readFileSync(file, 'utf8');\n\n // Process macros. We can't pass all mincer helpers here,\n // but N is enougth for our needs.\n fileData = processMacro(fileData, { N: options.sandbox.N });\n\n var data = renderer(fileData, file, options);\n processor.addDependencies(file, data.imports);\n\n return data.css;\n };\n\n findPaths(lookup, function (file) {\n result.push(processor.get(file));\n });\n\n fstools.mkdirSync(path.dirname(destination));\n fs.writeFileSync(destination, result.join('\\n'), 'utf8');\n}", "title": "" } ]
[ { "docid": "20b5f08b89231b009b2acb41cb2674f5", "score": "0.64528483", "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": "e15ce3af95de82206c3dd38d4a218725", "score": "0.6110917", "text": "async function generateCss() {\n try {\n const allFiles = await getFiles('./packages/**/dist/cjs');\n const allComponentFiles = allFiles.filter(file => file.includes('.js'));\n\n for(fileLocation of allComponentFiles) {\n let file = await fs.readFileSync(fileLocation, 'utf8');\n const indexOfCss = file.indexOf('var css_');\n const indexOfEndOfCss = file.indexOf('}\";');\n if(~indexOfCss){\n const cssRaw = file.substring(indexOfCss, indexOfEndOfCss + 3);\n const groupFolderLocation = fileLocation.substring(0, fileLocation.indexOf('dist'));\n const css = `${cssRaw.substring(cssRaw.indexOf('\"') + 1, cssRaw.indexOf('}\";') + 1)}`;\n fs.writeFileSync(`${groupFolderLocation}/dist/cjs/styles.css`, css.replace(/\\\\/g,\"\"));\n fs.writeFileSync(`${groupFolderLocation}/dist/esm/styles.css`, css.replace(/\\\\/g,\"\"));\n }\n }\n } catch( error ) {\n console.error(error);\n exit(1)\n }\n}", "title": "" }, { "docid": "081706396e08ad560043fd7cd1711694", "score": "0.5827483", "text": "async function compileStyles () {\n console.log('SRC: Compiling CSS');\n let outDir = `${CONFIG.distDir}/styles`;\n\n let scssData = await compileScss();\n let lessData = await compileLess();\n\n let combinedDevCss = scssData.css + lessData.css;\n let combinedMinCss = scssData.minified + lessData.minified;\n\n await ensureDir(outDir);\n await writeFile(`${outDir}/helix-ui.css`, combinedDevCss);\n await writeFile(`${outDir}/helix-ui.min.css`, combinedMinCss);\n console.log('SRC: Compiling CSS [DONE]');\n}", "title": "" }, { "docid": "3dd64fa5a726062687fbb89c7127c400", "score": "0.57766676", "text": "async generateBundle() {\n // IMPORTANT!!!\n // all css is only available on the ssr version...\n // but we need to move the css to the client folder.\n if (type === 'ssr') {\n const { styles, sourceMap } = await minifyCss([...this.getModuleIds()], elderConfig);\n if (styleCssMapHash) {\n // set the source later when we have it.\n this.setAssetSource(styleCssMapHash, sourceMap.toString());\n const sourceMapFile = this.getFileName(styleCssMapHash);\n const sourceMapFileRel = `/${path_1.default.relative(elderConfig.distDir, path_1.default.resolve(elderConfig.$$internal.distElder, sourceMapFile))}`;\n this.setAssetSource(styleCssHash, `${styles}\\n /*# sourceMappingURL=${sourceMapFileRel} */`);\n }\n else if (styleCssHash) {\n this.setAssetSource(styleCssHash, styles);\n }\n }\n }", "title": "" }, { "docid": "a104057a44e0d78c029afb59b5f75e0d", "score": "0.5748639", "text": "forEachStyle (cb) {\n this.allStyles_.forEach(cb)\n }", "title": "" }, { "docid": "d6af583721e74048bbb0a7ea5923e757", "score": "0.57019806", "text": "function buildAllComponentsStyleEntry(ext = '') {\n const uninstallComponents = [\n 'Lazyload',\n '.DS_Store',\n ];\n\n const needIntallList = Components.filter(name => !~uninstallComponents.indexOf(uppercamelize(name)));\n\n //import list template\n const base = `@import './style/base.scss';`;\n\n //import list template\n const importList = needIntallList.map(name => `@import './packages/${name}/style/index.css';`);\n\n\n const content = `${tips}\n \n/**\n * Entry of all component's style\n */\n${base}\n\n${importList.join('\\n')}\n`;\n //write to file ,and create style entry file\n fs.writeFileSync(path.resolve(`./src/index${ext}`), content);\n}", "title": "" }, { "docid": "dbd69c2691402f916d7db7e7ffd04512", "score": "0.5699878", "text": "function initCodeBlocks() {\n if ($) {\n var colors = {\n html: {\n\n },\n css: {\n\n },\n js: {\n\n }\n };\n $.each($('div.pre'), function(index, general) {\n var type = general.getAttribute('rel');\n if (!type || (type != 'html' && type != 'css' && type != 'js')) {\n $(general).hide();\n } else {\n var content = $(general).html();\n $(general).empty();\n var div = document.createElement('div');\n var head = document.createElement('div'); head.className = 'head'; head.innerHTML = 'block ' + type.toUpperCase();\n var line = document.createElement('div'); line.className = 'line';\n var code = document.createElement('div'); code.className = 'code';\n var lines = $.trim(content).split(\"\\n\");\n if (!lines.length) {\n $(general).hide();\n } else {\n var i, len, lineContent = '', codeContent = '';\n len = lines.length;\n for (i = 0; i != len; i ++) {\n if (i) lineContent += \"\\r\\n\";\n lineContent += i + 1;\n }\n line.innerHTML = lineContent;\n var firstLine = content.split(\"\\n\")[1];\n len = firstLine.length;\n for (i = 0; i != len; i ++) {\n if (firstLine.substr(i, 1).charCodeAt(0) != 32) break;\n }\n var tabCount = i;\n for (i = 0; i != lines.length; i ++) {\n var l = lines[i];\n if (i) {\n codeContent += \"\\r\\n\";\n l = l.substr(tabCount);\n }\n switch(type) {\n case 'html' :\n if (l.match(/<\\!--/)) {\n l = \"[color:95F279]\" + l + \"[/color]\";\n break;\n }\n l = l.replace(/<(input|button|textarea|select)(\\s?[^<>]*)>/ig, '[color:F1DA36]&lt;$1$2&gt;[/color]');\n l = l.replace(/<\\/(input|button|textarea|select)>/ig, '[color:F1DA36]&lt;/$1&gt;[/color]');\n l = l.replace(/<(video|audio)(\\s?[^<>]*)>/ig, '[color:BFA3E0]&lt;$1$2&gt;[/color]');\n l = l.replace(/<\\/(video|audio)>/ig, '[color:BFA3E0]&lt;/$1&gt;[/color]');\n l = l.replace(/<(a)(\\s?[^<>]*)>/ig, '[color:4DBC2B]&lt;$1$2&gt;[/color]');\n l = l.replace(/<\\/(a)>/ig, '[color:4DBC2B]&lt;/$1&gt;[/color]');\n // l = l.replace(/<span\\sclass=\\\"glyphicon\\s([-a-z0-9]+)\\\"><\\/span>/ig, '[symbol:$1]');\n l = l.replace(/<(span)(\\s?[^<>]*)>/ig, '[color:8DBFE0]&lt;$1$2&gt;[/color]');\n l = l.replace(/<\\/(span)>/ig, '[color:8DBFE0]&lt;/$1&gt;[/color]');\n l = l.replace(/<(style)(\\s?[^<>]*)>/ig, '[color:9E78BF]&lt;$1$2&gt;[/color]');\n l = l.replace(/<\\/(style)>/ig, '[color:9E78BF]&lt;/$1&gt;[/color]');\n l = l.replace(/<(script)(\\s?[^<>]*)>/ig, '[color:C15757]&lt;$1$2&gt;[/color]');\n l = l.replace(/<\\/(script)>/ig, '[color:C15757]&lt;/$1&gt;[/color]');\n l = l.replace(/\\[script:source\\]/ig, \"[color:C15757]&lt;script type=\\\"text/javascript\\\" src=\\\"libraries/osdkjs.js\\\"&gt;[/color][color:C15757]&lt;/script&gt;[/color]\");\n l = l.replace(/id=\\\"([-a-zA-Z0-9_]+)\\\"/ig, 'id=\"[color:DD3E3E]$1[/color]\"');\n l = l.replace(/(href|src)=\\\"([^\\\"]+)\\\"/ig, '$1=\"[color:ffffff]$2[/color]\"');\n break;\n case 'css' :\n if (l.match(/\\/\\*/) || l.match(/\\*\\//)) {\n l = \"[color:EFCB88]\" + l + \"[/color]\";\n break;\n }\n l = l.replace(/\\[style\\]/ig, \"[color:9E78BF]&lt;style type=\\\"text/css\\\"&gt;[/color]\");\n l = l.replace(/\\[\\/style\\]/ig, \"[color:9E78BF]&lt;/style&gt;[/color]\");\n l = l.replace(/([-a-z0-9]+):([-a-z0-9\\s#\\\"]+);/ig, '[b]$1[/b]:[i]$2[/i];');\n l = l.replace(/^([^\\{\\}]+)([\\{|\\}]{1})/ig, '[color:F1DA36]$1[/color]$2');\n l = l.replace(/(\\.|#){1}([-a-z0-9]+)/ig, '$1[b]$2[/b]');\n break;\n case 'js' :\n if (l.match(/\\/\\//)) {\n l = \"[color:EFCB88]\" + l + \"[/color]\";\n break;\n }\n l = l.replace(/(\\d+)/ig, '[color:7DD17D]$1[/color]');\n l = l.replace(/\\[script\\]/ig, \"[color:C15757]&lt;script type=\\\"text/javascript\\\"&gt;[/color]\");\n l = l.replace(/\\[\\/script\\]/ig, \"[color:C15757]&lt;/script&gt;[/color]\");\n l = l.replace(/oSDK(\\(|\\.)/ig, '[color:7CE28C][b]oSDK[/b][/color]$1');\n l = l.replace(/\\$/ig, '[color:BF9AED]$[/color]');\n l = l.replace(/(function|var|if|else|switch|case|break|continue|for|return|new|null|void|undefined|typeof)/ig, '[b]$1[/b]');\n l = l.replace(/(true|false)/ig, '[color:6ED8DD]$1[/color]');\n l = l.replace(/(true|false)/ig, '[color:6ED8DD]$1[/color]');\n l = l.replace(/(\\'|\\\"){1}([^\\'\\\"]*)(\\'|\\\"){1}/ig, '[color:D66B6B]$1$2$3[/color]');\n l = l.replace(/([a-z0-9_]+)\\(/ig, '[color:92C1E5]$1[/color](');\n break;\n }\n l = l.replace(/</ig, \"&lt;\");\n l = l.replace(/>/ig, \"&gt;\");\n l = l.replace(/\\[color:([a-z0-9]+)\\]/ig, '<span style=\"color:#$1;\">');\n l = l.replace(/\\[\\/color\\]/ig, '</span>');\n l = l.replace(/\\[b\\]/ig, '<strong>');\n l = l.replace(/\\[\\/b\\]/ig, '</strong>');\n l = l.replace(/\\[i\\]/ig, '<i>');\n l = l.replace(/\\[\\/i\\]/ig, '</i>');\n l = l.replace(/\\[symbol:([-a-z0-9]+)\\]/ig, '<span class=\"glyphicon $1\"></span>');\n codeContent += l;\n }\n code.innerHTML = codeContent;\n general.appendChild(head);\n div.appendChild(line);\n div.appendChild(code);\n general.appendChild(div);\n }\n }\n });\n }\n}", "title": "" }, { "docid": "c3a7cb652f6f922e8da5018d5b634047", "score": "0.5669892", "text": "function styles () {\n const toPurge = npmPackagePaths('**/*.js').concat([\n src.views + '/**/*.pug',\n src.js,\n dist.views + '/**/*.html',\n ]);\n\n return gulp.src(src.sass)\n .pipe(tap(function (f, t) {\n const file = f.path;\n const fileName = file.replace(/^.*[\\\\\\/]/, '');\n\n gulp.src(src.sass.replace('*.scss', '') + fileName)\n .pipe(plumber(errorHandler()))\n .pipe(sass({outputStyle: 'expanded'}))\n .pipe(prefixer())\n .pipe(gulpIf(inProduction, purgecss({ content: toPurge })))\n .pipe(gulpIf(fileName !== 'vendor.scss', header()))\n .pipe(size({ showFiles: true }))\n .pipe(gulp.dest(dist.css))\n .pipe(cssMinify({compatibility: 'ie10'}))\n .pipe(rename({suffix: '.min'}))\n .pipe(size({ showFiles: true }))\n .pipe(gulp.dest(dist.css))\n .pipe(browserSync.stream());\n })).pipe(success('Styles compiled'));\n}", "title": "" }, { "docid": "cc112391aeef19fb32315f62387d4498", "score": "0.5646096", "text": "function styleBlocks(groups) {\n for (let group of Object.values(groups)) {\n for (let [type, block] of Object.entries(group)) {\n // Reset highlighting\n const content = block.get()\n block.codeElt.empty()\n block.set(content)\n\n // Hide if tagged\n if (block.tags.includes(STATIC_TAG_TYPES.HIDDEN)) {\n block.container.css('display', 'none')\n }\n\n // Merge if tagged\n if (block.tags.includes(STATIC_TAG_TYPES.MERGE_DOWN)) {\n block.container.addClass(CLASSES.BLOCK_CONTAINER_MERGED_DOWN)\n }\n\n // Add icon bar/ type mark\n block.container.prepend(`\n<div class=\"${CLASSES.ICON_BAR_OUTER}\">\n <div class=\"${CLASSES.ICON_BAR_INNER}\">\n <div class=\"${CLASSES.ICON_CONTAINER} ${CLASSES.ICON_CONTAINER_INDICATOR}\" title=\"${ICONS[type].title}\">\n <img class=\"${CLASSES.ICON_IMG}\" src=\"${ICONS[type].src}\">\n </div>\n </div>\n</div>\n `)\n }\n }\n}", "title": "" }, { "docid": "35219d05753a3683fdac3f8b30b96feb", "score": "0.5603104", "text": "function styles() {\n return gulp.src('./node_modules/@ericsson/cus-ui/boilerplate/styles.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest(conf.path.dist('/assets/css')));\n}", "title": "" }, { "docid": "0a1975cd3a1017744a29e65fd2aac607", "score": "0.5585278", "text": "function getGlobalStyles() {\n return __awaiter(this, void 0, void 0, function* () {\n const homeDir = os.homedir();\n const globalLessFilePath = path.resolve(homeDir, './.markdown-preview-enhanced/style.less');\n let fileContent;\n try {\n fileContent = yield readFile(globalLessFilePath, { encoding: 'utf-8' });\n }\n catch (e) {\n // create style.less file \n fileContent = `\n.markdown-preview-enhanced.markdown-preview-enhanced {\n // modify your style here\n // eg: background-color: blue;\n} `;\n yield writeFile(globalLessFilePath, fileContent, { encoding: 'utf-8' });\n }\n return yield new Promise((resolve, reject) => {\n less.render(fileContent, { paths: [path.dirname(globalLessFilePath)] }, (error, output) => {\n if (error)\n return reject(error);\n return resolve(output.css || '');\n });\n });\n });\n}", "title": "" }, { "docid": "5747960d30b695bbbf7fbc8cbf0d9acf", "score": "0.5582977", "text": "function yL(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "eb3dc617e9a866bfacba8e06c28a20bd", "score": "0.5536275", "text": "function bundleCSS() {\n fs.readdir(srcdir, (err, files) => {\n if (err) {\n console.log(err);\n } else {\n const css = [];\n files.forEach(file => {\n if(/(\\.css)$/i.test(file)){\n css.push(`${srcdir}/${file}`);\n }\n });\n if(css.length > 0){\n concat(css).then(combined => {\n fs.outputFile(outfile, combined)\n .then(() => {\n postcss([autoprefixer])\n .process(combined, { from: combined, to: outfile })\n .then(result => {\n fs.outputFile(outfile, result.css);\n });\n });\n });\n }\n }\n });\n}", "title": "" }, { "docid": "6592ed158b8ed3c7750e71dcf0ec604c", "score": "0.54900354", "text": "function styles() {\n\treturn src(path.styles)\n\t.pipe(sass({outputStyle: 'compressed'\n\t})).on('error', function(err) {\n\t\t\tconsole.log('ERROR:', err.message);\n\t})\n\t.pipe(dest('assets/css/'))\n}", "title": "" }, { "docid": "d3efd7ac77fac7c1df6d82e8f18bd71d", "score": "0.5488327", "text": "get styles () {return paths.globals.dev + '/stylesheets'}", "title": "" }, { "docid": "fb4b33e36c7492d2e59417268672ea1d", "score": "0.5465373", "text": "function populateCodeBlocks() {\n renderCreate();\n renderMethods();\n renderFlags();\n renderAnchors();\n renderSets();\n renderCharacters();\n renderEscaping();\n renderLengths();\n renderQuantifiers();\n renderGreedyLazy();\n renderGroups();\n renderOrs();\n renderExercises()\n}", "title": "" }, { "docid": "ef51cabdb8781ef1a7399f81bc158601", "score": "0.54615986", "text": "function consolidateStreamedStyles() {\n var blocks = Array.from(document.querySelectorAll('style[data-styled-components]'));\n\n if (blocks.length) {\n var frag = document.createDocumentFragment();\n\n for (var i = 0, len = blocks.length; i < len; i += 1) {\n // $FlowFixMe\n frag.appendChild(blocks[i].parentNode.removeChild(blocks[i]));\n }\n\n // $FlowFixMe\n document.head.appendChild(frag);\n }\n}", "title": "" }, { "docid": "4076a8421873fc517bf2f7965884a881", "score": "0.5456629", "text": "function hC(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "1f748d97cde8f682fda6a066971654ed", "score": "0.5442653", "text": "function styles() {\n\treturn gulp\n\t\t.src(resources.styles, {\n\t\t\tbase: './src/'\n\t\t})\n\t\t.pipe(getPlumber())\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps for .min.css files\n\t\t.pipe(sass({ outputStyle: 'compressed' })) // compile sass into css\n\t\t.pipe(concat('all.min.css')) // bundle all .css files into one file\n\t\t.pipe(sourcemaps.write('maps')) // generate sourcemap for the bundle\n\t\t.pipe(gulp.dest('./dist/'));\n}", "title": "" }, { "docid": "636205354b34d5d7348c31c5ee112de8", "score": "0.5440672", "text": "function styles() {\n //compile sass file to css and concat all in one file\n var sassStream = gulp\n .src(\"./src/styles/scss/**/*.scss\")\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(concat(\"scss-files.css\"));\n //compile all css file to one file\n var cssStream = gulp\n .src(\"./src/styles/css/**/*.css\")\n .pipe(concat(\"css-files.css\"));\n //compile tailwind using tailwind config\n var tailwindStream = gulp\n .src(\"./src/styles/tailwind/tailwind.css\")\n .pipe(\n postcss([tailwindcss(options.config.tailwindjs), require(\"autoprefixer\")])\n );\n //merge all three files in one file\n return (mergedStream = merge(sassStream, cssStream, tailwindStream)\n .pipe(concat(\"styles.css\"))\n .pipe(cleanCSS({ compatibility: \"ie8\" }))\n .pipe(gulp.dest(\"./dist/\"))\n .pipe(browserSync.reload({ stream: true })));\n}", "title": "" }, { "docid": "b76b4b6cbe37808a971750077ce9b7ae", "score": "0.5437472", "text": "function componentStyles() {\n let sassOptions = {outputStyle: prodMode ? 'compressed' : 'nested'};\n\n return gulp.src(['src/**/*.scss', '!src/globalSass/**'])\n .pipe(sass(sassOptions).on('error', sass.logError))\n .pipe(gulp.dest('src'));\n}", "title": "" }, { "docid": "3d257e4a4d691ad8f1382eca6617176c", "score": "0.5417401", "text": "function style(){\n\tgulp.src([\n\t\t\t'src/**/*.less',\n\t\t\t'!src/**/_*.less'\n\t\t])\n\t// gulp-plumber: 작업 중 오류가 발생했을 때 오류 메시지 처리를 해줌\n\t.pipe($.plumber())\n\t// gulp-newer: build/ 디렉토리에 생성되어 있는 CSS 파일보다 새로운\n\t// 파일이면 이하 작업 수행. 아니면 테스크 중단.\n\t.pipe($.newer('build/'))\n\t// gulp-less: Less 프리프로세서 처리\n\t.pipe($.less())\n\t// gulp-ignore: 이하 작업에는 _*.less로 인해 생성된 _*.css 파일들 제외\n\t.pipe($.ignore.exclude('**/_*'))\n\t// gulp-csslint: CSS Lint 검사\n\t// .csslintrc 파일에 검사할 규칙을 JSON 형식으로 작성\n\t// CSS Lint 규칙: https://github.com/CSSLint/csslint/wiki/Rules\n\t.pipe($.csslint({\n\t\tcsslint: '.csslintrc'\n\t}))\n\t// CSS Lint로 검사한 내용을 콘솔에 노출\n\t.pipe($.csslint.reporter())\n\t// gulp-autoprefixer: http://caniuse.com의 데이터를 기반으로 자동으로\n\t// vender prefix 처리\n\t.pipe($.autoprefixer({\n\t\t// Autoprefixer 옵션\n\t\t// https://github.com/postcss/autoprefixer#options\n\t\t// 타겟 브라우저 지정: https://github.com/ai/browserslist#queries\n\t\tbrowsers: [\n\t\t\t'> 1%',\n\t\t\t'last 2 versions',\n\t\t\t'not ie <= 8'\n\t\t],\n\t\t// 생성되는 CSS의 규칙별 들여쓰기 여부\n\t\tcascade: false\n\t}))\n\t// build/ 디렉토리에 파일 생성\n\t.pipe(gulp.dest('build/'))\n\t// Browsersync 객체가 활성 상태이면 수정된 파일 새로 고침\n\t.pipe($.if(bs.active, bs.stream()));\n}", "title": "" }, { "docid": "a44262d3fc484ddc907f8a6ade047ab8", "score": "0.540995", "text": "addRollupComponentNodes(styleNodes, fileExtension) {\n for(let path in styleNodes) {\n let componentName = InlineCodeManager.getComponentNameFromPath(path, fileExtension);\n this.addComponentCode(componentName, styleNodes[path]);\n }\n }", "title": "" }, { "docid": "8c540bddef0201396b958e2c654dd99d", "score": "0.539612", "text": "function add_css$2() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-1jmteg6-style\";\n \tstyle.textContent = \"ul.svelte-1jmteg6{display:inline-block;padding-left:15px;padding-right:15px}li.svelte-1jmteg6{display:inline-block}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "3a58ef2489345a91a3a05bb07860f99c", "score": "0.53851706", "text": "function optimizecss(dir) {\n dir = dir || path.join(__dirname, '..');\n console.log('optimize css');\n var require_config = {\n cssIn: path.join(dir, 'src', 'main.css'),\n out: path.join(dir, 'webroot', 'main.css'),\n optimizeCss: \"standard\"\n };\n requirejs.optimize(require_config, function () {\n fs.readdir(path.join(dir, 'src', 'themes'), function (err, list) {\n fs.mkdirSync(path.join(dir, 'webroot', 'themes'), 16877);\n list.forEach(function (theme) {\n if (theme[0] != '.') {\n fs.mkdirSync(path.join(dir, 'webroot', 'themes', theme), 16877);\n require_config.cssIn = path.join(dir, 'src', 'themes', theme, 'style.css');\n require_config.out = path.join(dir, 'webroot', 'themes', theme, 'style.css');\n console.log('css', require_config.cssIn, '->', require_config.out);\n requirejs.optimize(require_config, function () {});\n }\n fs.readdir(path.join(dir, 'src', 'themes', theme), function (err, assets) {\n if (!err) {\n assets.forEach(function (fname) {\n if (fname != 'style.css' && fname[0] != '.') {\n fs.stat(path.join(dir, 'src', 'themes', theme, fname), function (err, stats) {\n if (stats.isDirectory()) {\n console.log('copy', path.join(dir, 'src', 'themes', theme, fname), path.join(dir, 'webroot', 'themes', theme, fname));\n wrench.copyDirRecursive(path.join(dir, 'src', 'themes', theme, fname), path.join(dir, 'webroot', 'themes', theme, fname), function () {});\n }\n else {\n copyFile(path.join(dir, 'src', 'themes', theme, fname), path.join(dir, 'webroot', 'themes', theme, fname));\n }\n });\n }\n });\n }\n });\n });\n });\n });\n}", "title": "" }, { "docid": "9e0dfe57bd7243ae32a60cbb94e6567f", "score": "0.5358793", "text": "function RN(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "bc8c5b531df5087145089fb3fba42c3e", "score": "0.5348502", "text": "function styles_bundle(development) {\n return function() {\n gulp\n .src(styles_entrypoint)\n .pipe(sourcemaps.init())\n .pipe(postcss())\n .pipe(rename({ basename: \"bundle\", ext: \".css\" }))\n .pipe(\n sourcemaps.write(\"./\", {\n includeContent: false,\n sourceRoot: path.join(__dirname, paths.src)\n })\n )\n .pipe(gulp.dest(styles_exitpoint))\n .pipe(livereload());\n };\n}", "title": "" }, { "docid": "2a9fdfedeaf6268db1b73df9bde76c7a", "score": "0.53329116", "text": "get styles () {return paths.globals.prod + '/css'}", "title": "" }, { "docid": "c9416d161ee95c7ac9fb18b009fb4fac", "score": "0.5331011", "text": "function tw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "d5a245845b2885df268a7e02f9171b40", "score": "0.5318317", "text": "function eachStylesheet(doc, topUrl, rules, f) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __awaiter */ \"b\"])(this, void 0, void 0, function () {\n var promises, length, i, rule, url;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[/* __generator */ \"d\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n promises = [];\n length = rules.length;\n for (i = 0; i < length; i++) {\n rule = rules[i];\n if (rule.type === CSSRule.IMPORT_RULE) {\n url = rule.href;\n if (url) {\n url = _utils_Utils__WEBPACK_IMPORTED_MODULE_21__[\"joinUrl\"](topUrl, url);\n promises.push(loadStylesheet(doc, url, f));\n }\n }\n else {\n f(topUrl, rule);\n }\n }\n if (!promises.length) return [3 /*break*/, 2];\n return [4 /*yield*/, Promise.all(promises)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "78fd33103f83cf6b695ec8987f5c6b3d", "score": "0.5299718", "text": "function buildCss( err, f) {\n stylus( readFileSync( join(__dirname, 'src/main.styl'), 'utf8' ) )\n .include( entry )\n .render( writeCss )\n}", "title": "" }, { "docid": "1cae05d307f2da1bb8598037e7874731", "score": "0.52827877", "text": "function buildStyles(cb, done){\n // 2017-03-05: Stop building a2docs.css file\n /*\n gulp.src(path.join(STYLES_SOURCE_PATH, _styleLessName))\n .pipe(less())\n .pipe(gulp.dest(BOILERPLATE_PATH)).on('end', function(){\n cb().then(function() { done(); });\n });\n */\n cb().then(function() { done(); });\n }", "title": "" }, { "docid": "2ab4fed8352ffe0e662a204ad2ba5064", "score": "0.5272774", "text": "function styles () {\n return gulp.src(getStyles.main)\n .pipe(gulpif(!isProd, sourcemaps.init()))\n .pipe(gulpsass().on('error', gulpsass.logError))\n .pipe(autoprefixer({ browsers: ['> 1%', 'iOS 7'] }))\n .pipe(gulpif(!isProd, sourcemaps.write()))\n .pipe(gulpif(isProd, cssnano()))\n .pipe(gulp.dest(getStyles.dest))\n .pipe(size({ showFiles: true }))\n}", "title": "" }, { "docid": "141c73208943bc3d2af3419a8f16d1d6", "score": "0.5251629", "text": "function styles() {\n //where are my less files\n return src('app/assets/styles/**/*.less', 'app/assets/styles/*.less')\n //Until compile, it will:\n //rename the file\n .pipe(rename({ suffix: \".min\" }))\n //avoid errors\n .pipe(plumber())\n //compile less into css\n .pipe(less())\n //auto prefix\n .pipe(autoprefixer({\n overrideBrowserslist: ['last 2 versions'],\n cascade: false\n }))\n //minify the css file\n .pipe(minifyCSS())\n //alocate the CSS file to the public folder\n .pipe(dest('app/public/styles'))\n //Stream changes to all browsers\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "4b99bff578af1796027d4ebccea88665", "score": "0.5241922", "text": "function css() {\n return gulp.src(paths.styles.src)\n .pipe(styl({\n use: [\n axis(),\n jeet(),\n rupture()\n ],\n compress: true\n }))\n .pipe(rename({\n main: 'styles',\n suffix: '.min'\n }))\n .pipe(gulp.dest(paths.styles.dest));\n}", "title": "" }, { "docid": "d10303477f1f1d12db1d7eb30adf826c", "score": "0.52375555", "text": "function activate(context) {\r\n var classes = [];\r\n\r\n function fetchAllCssRulesInCssFiles() {\r\n vscode.window.showInformationMessage('HTML CSS Class Completion: Fetching CSS rules from CSS files, please wait.');\r\n // fetches the css files excluding the ones within node_modules folders that are within another node_modules folder\r\n vscode.workspace.findFiles('**/*.css', 'node_modules/**/node_modules/**/*').then(function (uris) {\r\n // will contain all the css files concatenated\r\n var cssFilesConcatenated = \"\";\r\n // goes through each css file found and open it\r\n uris.forEach(function (uri, index) {\r\n vscode.workspace.openTextDocument(uri).then(function (textDocument) {\r\n // extracts the text of the file and concatenates it\r\n cssFilesConcatenated += textDocument.getText();\r\n if (uris.length == index + 1) {\r\n // after finishing the process the css classes are fetched from this large string and added to the classes array\r\n fetchClasses(cssFilesConcatenated, classes);\r\n vscode.window.showInformationMessage(\"HTML CSS Class Completion: Finished fetching CSS rules from CSS files.\");\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n // function fetchAllCssRulesInHtmlFiles() {\r\n // vscode.window.showInformationMessage('HTML CSS Class Completion: Fetching CSS rules from HTML files, please wait.');\r\n // vscode.workspace.findFiles('**/*.html', 'node_modules/**/node_modules/**/*').then(function (uris) {\r\n // var stylesConcatenated = \"\";\r\n // uris.forEach(function (uri, index) {\r\n // vscode.workspace.openTextDocument(uri).then(function (textDocument) {\r\n // var $ = cheerio.load(textDocument.getText());\r\n // var $styles = $('style');\r\n // if ($styles.length > 0) {\r\n // $styles.forEach(function ($style) {\r\n // stylesConcatenated += $style.children[0].data;\r\n // });\r\n // }\r\n // if (uris.length == index + 1) {\r\n // fetchClasses(stylesConcatenated, classes);\r\n // vscode.window.showInformationMessage(\"HTML CSS Class Completion: Finished fetching CSS rules from HTML files.\")\r\n // }\r\n // });\r\n // return;\r\n // });\r\n // });\r\n // }\r\n\r\n function fetchClasses(text, classes) {\r\n var parsedCss = css.parse(text);\r\n \r\n // go through each of the rules...\r\n parsedCss.stylesheet.rules.forEach(function (rule) {\r\n // ...of type rule\r\n if (rule.type === 'rule') {\r\n // go through each of the selectors of the current rule \r\n rule.selectors.forEach(function (selector) {\r\n var classesRegex = /[.]([\\w-]+)/g;\r\n var tempClasses = [];\r\n var item = null;\r\n \r\n // check if the current selector contains class names\r\n while (item = classesRegex.exec(selector)) {\r\n tempClasses.push(item[1]);\r\n }\r\n\r\n if (tempClasses.length > 0) {\r\n // extract class names specified on the current selector\r\n // and then go through each of them\r\n tempClasses.forEach(function (className) {\r\n // check if the current class name is not in the classes array\r\n if (classes.indexOf(className) === -1) {\r\n // if so adds it to it\r\n classes.push(className);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n\r\n return classes;\r\n }\r\n\r\n var disposable = vscode.languages.registerCompletionItemProvider('html', {\r\n provideCompletionItems(document, position, token) {\r\n var start = new vscode.Position(position.line, 0);\r\n var range = new vscode.Range(start, position);\r\n var text = document.getText(range);\r\n \r\n // check if the cursor is on a class attribute and retrieve all the css rules in this class attribute\r\n var rawClasses = text.match(/class=[\"|']([\\w- ]*$)/); \r\n if (rawClasses === null) {\r\n return [];\r\n }\r\n\r\n // will store the classes found on the class attribute\r\n var classesOnAttribute = [];\r\n // regex to extract the classes found of the class attribute\r\n var classesRegex = /[ ]*([\\w-]*)[ ]*/g;\r\n\r\n var item = null;\r\n while ((item = classesRegex.exec(rawClasses[1])) !== null) {\r\n if (item.index === classesRegex.lastIndex) {\r\n classesRegex.lastIndex++;\r\n }\r\n if (item !== null && item.length > 0) {\r\n classesOnAttribute.push(item[1]);\r\n }\r\n }\r\n classesOnAttribute.pop();\r\n\r\n // creates a collection of CompletionItem based on the classes already fetched\r\n var completionItems = [];\r\n for (var i = 0; i < classes.length; i++) {\r\n completionItems.push(new vscode.CompletionItem(classes[i]));\r\n }\r\n \r\n // removes from the collection the classes already specified on the class attribute\r\n for (var i = 0; i < classesOnAttribute.length; i++) {\r\n for (var j = 0; j < completionItems.length; j++) {\r\n if (completionItems[j].label === classesOnAttribute[i]) {\r\n completionItems.splice(j, 1);\r\n }\r\n }\r\n }\r\n\r\n return completionItems;\r\n },\r\n resolveCompletionItem(item, token) {\r\n return item;\r\n }\r\n });\r\n context.subscriptions.push(disposable);\r\n \r\n fetchAllCssRulesInCssFiles();\r\n //fetchAllCssRulesInHtmlFiles();\r\n}", "title": "" }, { "docid": "521a6a95c0181ed943c3703defa2796c", "score": "0.5222606", "text": "function activate(context) {\n console.log(\n 'Congratulations, your extension \"scss-block-comments\" is now active!'\n );\n let config = {\n verboseSelectors: vscode.workspace\n .getConfiguration()\n .get('scssComments.verboseSelectors'),\n includeMediaQueries: vscode.workspace\n .getConfiguration()\n .get('scssComments.includeMediaQueries'),\n formatterEnable: vscode.workspace\n .getConfiguration()\n .get('scssComments.formatterEnable'), \n };\n\n let disposable = vscode.commands.registerCommand('extension.formatScssBlocks', function () {\n let editor = vscode.window.activeTextEditor;\n if (!editor) {\n return; // No open text editor\n }\n let document = editor.document;\n\n let lineCount = document.lineCount;\n let selector = '';\n let selectors = [];\n let cleanedSelectors = [];\n let concatSelector = '';\n let line = '';\n let edits = [];\n let edit = new vscode.WorkspaceEdit();\n let range = null;\n\n for (let i = 0; i < lineCount; i++) {\n // iterate over each line\n line = document.lineAt(i).text;\n\n if (line.indexOf('{') != -1) {\n // trim selector and add to array of selectors\n selector = line.slice(0, line.indexOf('{')).trim();\n if (config.verboseSelectors) {\n if (selector.slice(0, 1) === '&') {\n selector = selector.substring(1);\n } else {\n selector = ' ' + selector;\n }\n } else {\n selector = ' ' + selector;\n }\n selectors.push(selector);\n }\n\n if (line.indexOf('}') != -1) {\n range = new vscode.Range(\n document.lineAt(i).range.start,\n document.lineAt(i).range.end\n );\n\n // if you have verbose selectors enabled in settings\n if (config.verboseSelectors) {\n if (selectors[selectors.length - 1].slice(0, 7) === ' @media'.toLowerCase()) {\n // if configured to exclude media queries\n if (!config.includeMediaQueries) {\n //just don't add an edit\n } else if (selectors[selectors.length - 1].slice(0, 2) === ' $') {\n // its a variable, get out of there!\n } else {\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) +\n ' //' +\n selectors[selectors.length - 1]\n );\n }\n } else {\n // create comment edit (handle concat with MQs)\n cleanedSelectors = [];\n selectors.map(select => {\n if (select.slice(0, 7) === ' @media'.toLowerCase()) {\n // do nothing (do not add mediaqueries to concat selectors)\n } else if (select.slice(0, 2) === ' $') {\n // its a variable, get out of there!\n } else {\n cleanedSelectors.push(select);\n }\n });\n concatSelector = cleanedSelectors.join('');\n if (concatSelector.length) {\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) + ' //' + concatSelector\n );\n }\n }\n } else {\n if (selectors[selectors.length - 1].slice(0, 7) === ' @media'.toLowerCase()) {\n // if configured to exclude media queries\n if (!config.includeMediaQueries) {\n // do nothing\n } else {\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) +\n ' //' +\n selectors[selectors.length - 1]\n );\n }\n } else if (selectors[selectors.length - 1].slice(0, 2) === ' $') {\n // its a variable, get out of there!\n } else {\n // create comment edit\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) +\n ' //' +\n selectors[selectors.length - 1]\n );\n }\n }\n // remove last selector in stack\n selectors.pop();\n // push edit to array\n edits.push(edit);\n }\n }\n\n // apply edits\n edits.map(edit => {\n vscode.workspace.applyEdit(edit).then(success => {\n if (success) {\n } else {\n }\n });\n });\n });\n \n context.subscriptions.push(disposable);\n if (config.formatterEnable) {\n vscode.languages.registerDocumentFormattingEditProvider('scss', {\n provideDocumentFormattingEdits(document) {\n let lineCount = document.lineCount;\n let selector = '';\n let selectors = [];\n let cleanedSelectors = [];\n let concatSelector = '';\n let line = '';\n let edits = [];\n let edit = new vscode.WorkspaceEdit();\n let range = null;\n\n for (let i = 0; i < lineCount; i++) {\n // iterate over each line\n line = document.lineAt(i).text;\n\n if (line.indexOf('{') != -1) {\n // trim selector and add to array of selectors\n selector = line.slice(0, line.indexOf('{')).trim();\n if (config.verboseSelectors) {\n if (selector.slice(0, 1) === '&') {\n selector = selector.substring(1);\n } else {\n selector = ' ' + selector;\n }\n } else {\n selector = ' ' + selector;\n }\n selectors.push(selector);\n }\n\n if (line.indexOf('}') != -1) {\n range = new vscode.Range(\n document.lineAt(i).range.start,\n document.lineAt(i).range.end\n );\n\n // if you have verbose selectors enabled in settings\n if (config.verboseSelectors) {\n if (selectors[selectors.length - 1].slice(0, 7) === ' @media'.toLowerCase()) {\n // if configured to exclude media queries\n if (!config.includeMediaQueries) {\n //just don't add an edit\n } else if (selectors[selectors.length - 1].slice(0, 2) === ' $') {\n // its a variable, get out of there!\n } else {\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) +\n ' //' +\n selectors[selectors.length - 1]\n );\n }\n } else {\n // create comment edit (handle concat with MQs)\n cleanedSelectors = [];\n selectors.map(select => {\n if (select.slice(0, 7) === ' @media') {\n // do nothing (do not add mediaqueries to concat selectors)\n } else if (select.slice(0, 2) === ' $') {\n // its a variable, get out of there!\n } else {\n cleanedSelectors.push(select);\n }\n });\n concatSelector = cleanedSelectors.join('');\n if (concatSelector.length) {\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) + ' //' + concatSelector\n );\n }\n }\n } else {\n if (selectors[selectors.length - 1].slice(0, 7) === ' @media'.toLowerCase()) {\n // if configured to exclude media queries\n if (!config.includeMediaQueries) {\n // do nothing\n } else {\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) +\n ' //' +\n selectors[selectors.length - 1]\n );\n }\n } else if (selectors[selectors.length - 1].slice(0, 2) === ' $') {\n // its a variable, get out of there!\n } else {\n // create comment edit\n edit.replace(\n document.uri,\n range,\n line.slice(0, line.indexOf('}') + 1) +\n ' //' +\n selectors[selectors.length - 1]\n );\n }\n }\n // remove last selector in stack\n selectors.pop();\n // push edit to array\n edits.push(edit);\n }\n }\n\n // apply edits\n edits.map(edit => {\n vscode.workspace.applyEdit(edit).then(success => {\n if (success) {\n } else {\n }\n });\n });\n }\n });\n }\n \n}", "title": "" }, { "docid": "4c798264c36f0c04560ff11959597ee0", "score": "0.5216126", "text": "function CompileStylus() {\n\n // Disable or enable plugins;\n var use = {\n autoprefixer: true,\n debug: true,\n dest: true,\n plumber: true,\n rename: true,\n sourcemap: false,\n stylus: true,\n sync: true,\n group: true\n }\n\n // Plugins options\n var options = {\n files: pjoin('src', 'stylus', 'main.styl'),\n dest: pjoin('public', 'css'),\n debug: {title: 'Stylus: '},\n stylus: {\n paths: [pjoin(__dirname, 'public', 'images')],\n 'include css': true,\n use: stylusBemSugar({\n elementPrefix: \"__\",\n modifierPrefix: \"_\",\n modifierDelimiter: \"_\",\n }),\n define: {\n 'url': stylus.url({paths: [pjoin(__dirname, 'public')]}),\n 'img': function(filename) {\n return pjoin('images', filename.val);\n }\n }\n },\n sync: { 'reload after': 250},\n rename: { dirname: '.' },\n sourcemap: {\n write: {\n includeContent: false,\n // As server serve also from `src`\n // redefine origin root to serve `.styl`\n // files as localhost:3000/stylus/<file>\n // This alow directly edit files in Chrome,\n // if project addet to workspace.\n // use this when includeContent is set to false\n sourceRoot: '/stylus'\n }\n },\n autoprefixer: {\n browsers: ['last 2 versions', 'ie >= 9'],\n cascade: false\n }\n };\n\n // Inject -- inject css to browser.\n // Reload browsers after n-th func call.\n // The amount of calls before reloading\n // controled by `reload after` option.\n // Browser reloading ensure correct css rendering.\n function Inject() {\n\n var counter = options.sync['reload after'];\n var left = counter;\n return function () {\n if (left-- === 0) {\n left = counter;\n sync.reload()\n }\n log('reload after:', left)\n return sync.stream();\n }\n }\n\n var inject = Inject();\n\n return function() {\n console.log('---------- Stylus')\n var compile = use.stylus ?\n $.stylus(options.stylus) : noop(),\n catchErrors = use.plumber ?\n $.plumber() : noop(),\n rename = use.rename ?\n $.rename(options.rename) : noop(),\n report = use.debug ?\n $.debug(options.debug) : noop(),\n startMap = use.sourcemap ?\n $.sourcemaps.init() : noop(),\n endMap = use.sourcemap ?\n $.sourcemaps.write('', options.sourcemap.write) : noop(),\n write = use.dest ?\n gulp.dest(options.dest) : noop(),\n addPrefixes = use.autoprefixer ?\n $.autoprefixer(options.autoprefixer) : noop(),\n // groupMedia = use.group ?\n // $.groupCssMediaQueries() : noop(),\n dispatch = use.sync && global.isWatch ?\n inject() : noop();\n\n return gulp.src(options.files)\n .pipe(catchErrors)\n .pipe(startMap)\n .pipe(compile)\n .pipe(addPrefixes)\n .pipe(rename)\n .pipe(endMap)\n .pipe(write)\n .pipe(report)\n .pipe(dispatch)\n }\n\n}", "title": "" }, { "docid": "f5999700748866363e5e928daacb4601", "score": "0.5213479", "text": "function StyleSheetList() {}", "title": "" }, { "docid": "d122e725a63d5a759a536471dcc608c9", "score": "0.5213436", "text": "function index (opts = {}) {\n opts = getOptions(opts);\n const testExt = new RegExp(`.(${opts.extensions.join(\"|\")})$`, \"i\");\n return {\n name: \"rollup-plugin-style-process\",\n transform: function (code, id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!pluginFilter(testExt, opts.include, opts.exclude)(id))\n return;\n const $result = yield transformCode(id, code, opts);\n if (this.cache.has(\"results\")) {\n const $cache = JSON.parse(this.cache.get(\"results\"));\n $cache.push(id);\n this.cache.set(\"results\", JSON.stringify($cache));\n }\n else {\n this.cache.set(\"results\", JSON.stringify([id]));\n }\n this.cache.set(id, JSON.stringify($result));\n return {\n // If the code is not processed into CSS, the source code will be returned\n code: $result.compileToCss\n ? `export default ${JSON.stringify($result.code)}`\n : $result.code,\n map: $result.sourceMap\n };\n });\n },\n buildEnd() {\n var _a;\n const $result = formatCache(JSON.parse(this.cache.get(\"results\")), this.cache);\n return extract($result, \"dist/index.css\", (_a = opts.overrides) === null || _a === void 0 ? void 0 : _a.extractFn);\n }\n };\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.52069473", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.52069473", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.52069473", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.52069473", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "47948aaf2b30554b7b63d28d668c2795", "score": "0.5205602", "text": "function styles() {\n return src('src/scss/main.scss')\n .pipe(sourcemaps.init())\n .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))\n .pipe(sass(sassConfig))\n .pipe(autoprefixer())\n .pipe(gulpif(build, cleanCSS()))\n .pipe(sourcemaps.write())\n .pipe(dest('dist/assets/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "acf3b2485ba329640c38bdb91d7f481b", "score": "0.51947427", "text": "function code_render(config) {\n let text = [],\n include_style = true,\n include_CL = true,\n developer_mode = false,\n elem_id = \"cl\";\n\n if (config.include_style !== undefined) {\n include_style = config.include_style;\n }\n if (config.include_CL !== undefined) {\n include_CL = config.include_CL;\n }\n if (config.developer_mode !== undefined) {\n developer_mode = config.developer_mode;\n }\n\n\n config.repository = css_classname.substr(1);\n config.css_classname = css_classname;\n if (config.feed_id !== undefined && config.feed_id !== \"\") {\n elem_id = config.feed_id;\n }\n if (config.feed_path !== undefined && config.feed_path !== \"\") {\n config.feed_path = config.feed_path.split(\":\")[0];\n }\n if (config.use_recent === undefined ||\n config.use_recent === false) {\n config.recent_n = 0;\n }\n // Generate Style Block and HTML block\n if (include_style === true) {\n text.push(\"<style>\");\n text.push(css_classname + \" .unknown-year { display: none; }\");\n if (config.title_link === false) {\n text.push(css_classname + \" .title { padding-left: 0.24em }\");\n text.push(css_classname + \" .link { padding-left: 0.24em }\");\n }\n if (config.show_year_headings === true) {\n text.push(css_classname + \" .jump-list {\");\n text.push(\" padding-bottom: 0.24em;\");\n text.push(\" margin-bottom: 0.24em;\");\n text.push(\" border-bottom: solid 0.24em black;\");\n text.push(\"}\");\n text.push(css_classname + \" .jump-list-label {\");\n text.push(\" padding-left:0.24em;\");\n text.push(\" padding-right:0.24em;\");\n text.push(\" border-right: solid 0.12em black;\");\n text.push(\" text-decoration: none;\");\n text.push(\"}\");\n text.push(css_classname + \" .jump-list:last-child {\");\n text.push(\" border-right: none;\");\n text.push(\"}\");\n }\n text.push(css_classname + \" li {\");\n text.push(\" padding-bottom: 0.24em;\");\n text.push(\" margin-bottom: 0.24em;\");\n text.push(\" list-style: none;\");\n text.push(\"}\");\n text.push(css_classname + \" a {\");\n text.push(\" padding-right: 0.24em;\");\n text.push(\"}\");\n text.push(css_classname + \" span {\");\n text.push(\" padding-right: 0.24em;\");\n text.push(\"}\");\n text.push(css_classname + \" div {\");\n text.push(\" padding-bottom: 0.24em;\");\n text.push(\" margin-bottom: 0.24em;\");\n text.push(\"}\");\n text.push(\"</style>\\n\");\n }\n\n //FIXME: need to pass id for div\n text.push(\"<div id=\\\"\" + elem_id + \"\\\" class=\\\"\" + css_classname.substr(1) + \"\\\"></div>\\n\");\n\n\n // Generate JavaScript CL.js include \n if (include_CL == true) {\n if (developer_mode === true) {\n text.push(\"<script src=\\\"/scripts/CL-core.js\\\"></script>\");\n text.push(\"<script src=\\\"/scripts/CL-ui.js\\\"></script>\");\n } else {\n text.push(\"<script src=\\\"https://feeds.library.caltech.edu/scripts/CL.js\\\"></script>\");\n }\n }\n\n // Generate JavaScript src block\n config.filters = [];\n text.push(\"<script>\");\n text.push(\"(function(document, window) {\");\n text.push(\" \\\"use strict\\\";\");\n text.push(\" let cl = Object.assign({}, window.CL),\");\n text.push(\" config = {},\");\n text.push(\" elem = document.getElementById(\\\"\" +\n elem_id + \"\\\");\");\n text.push(\"\");\n text.push(\" config = \" +\n JSON.stringify(config, \"\", \" \") + \";\");\n text.push(\" config.parent_element = elem;\");\n //NOTE: Need to include recentN if selected\n if (config.use_recent === true && config.recent_n > 0) {\n text.push(\" cl.setAttribute(\\\"recentN\\\",\" +\n config.recent_n + \");\");\n text.push(\" config.filters.push(cl.recentN);\");\n }\n\n text.push(\" config.filters.push(cl.normalize_view);\");\n text.push(\" cl.setAttribute(\\\"viewer\\\", config);\");\n\n switch (config.aggregation) {\n case \"groups\":\n text.push(\" cl.getGroupJSON(\\\"\" + config.feed_id + \"\\\", \\\"\" + config.feed_path + \"\\\", function(data, err) {\");\n break;\n case \"people\":\n text.push(\" cl.getPeopleJSON(\\\"\" + config.feed_id + \"\\\", \\\"\" + config.feed_path + \"\\\", function(data, err) {\");\n break;\n }\n text.push(\" cl.viewer(data, err);\");\n text.push(\" });\");\n text.push(\"}(document, window));\");\n text.push(\"</script>\");\n // Generate JavaScript code block \n return text.join(\"\\n\");\n }", "title": "" }, { "docid": "dd873a130cbd02f0f624a4c085015ffa", "score": "0.5191763", "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": "7ce975bf25c54645f047563a37171c02", "score": "0.51804703", "text": "function add_css$1() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-5wvubo-style\";\n \tstyle.textContent = \"li.svelte-5wvubo{display:inline-block}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "b51df93a5bbffd82bebfe57f76f6e01c", "score": "0.517675", "text": "async compile(filename) {\n // const srcTheme = join(this.themePath, dirname(filename))\n const matchedCompilers = this.compilers\n .reduce((acc, curr) => {\n if (curr.isMatchedExtension(filename)) {\n return [curr]\n }\n return acc\n }, [])\n .map((compiler) =>\n compiler.compile(filename, this.themePath, this.publicPath))\n return matchedCompilers\n }", "title": "" }, { "docid": "86901723198019eea8702adfa52d905f", "score": "0.5176348", "text": "css(css) {\n css.write(Join(Path.PUB.FRONT, INDEX_CSS));\n }", "title": "" }, { "docid": "4002785aa3f7367022a65be8e10a7e5d", "score": "0.51681244", "text": "function cssFor() {\n for (var _len8 = arguments.length, rules = Array(_len8), _key9 = 0; _key9 < _len8; _key9++) {\n rules[_key9] = arguments[_key9];\n }\n\n rules = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__clean_js__[\"a\" /* default */])(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it. \n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "title": "" }, { "docid": "43c7316d7ab1bbbebf757c861d8bbec0", "score": "0.5160731", "text": "function watchFiles() {\n watch(\"themes/endicott-counseling/scss/**/*.scss\", compileSass);\n}", "title": "" }, { "docid": "10ab1334efec6d45773d6d08236d3e87", "score": "0.5148283", "text": "static isInVueStyleBlock(start, document) {\n for (let i = start.line; i > 0; i--) {\n const line = document.lineAt(i);\n if (/^ *<[\\w\"'= ]*lang=['\"]sass['\"][\\w\"'= ]*>/.test(line.text)) {\n if (!(i === start.line)) {\n return false;\n }\n break;\n }\n else if (/<\\/ *style *>/.test(line.text)) {\n if (!(i === start.line)) {\n return true;\n }\n break;\n }\n }\n return true;\n }", "title": "" }, { "docid": "a38e2f205e9829cb508c71f9f9d37340", "score": "0.51459855", "text": "function handleDemoStyles() {\n return $q.all(files.css.map(function (file) {\n return file.contentsPromise;\n }))\n .then(function (styles) {\n styles = styles.join('\\n'); //join styles as one string\n\n var styleElement = angular.element('<style>' + styles + '</style>');\n document.body.appendChild(styleElement[0]);\n\n scope.$on('$destroy', function () {\n styleElement.remove();\n });\n });\n\n }", "title": "" }, { "docid": "5ad716ab4f6b5fce5b22295dfe3f2334", "score": "0.5141071", "text": "extend(config, { isDev, isModern, isClient }) {\n const getLocalIdent = generateGetLocalIdent(isDev);\n const buildType = isModern ? 'modern' : isClient ? 'client' : 'server';\n config.plugins.push(\n new LicensePlugin({\n outputFilename: `license-${buildType}.json`,\n unacceptableLicenseTest: (licenseType) => licenseType.match(/GPL/i)\n })\n );\n config.module.rules[0].options.transformAssetUrls.image = [\n 'xlink:href',\n 'href'\n ];\n config.module.rules[0].options.transformAssetUrls.use = [\n 'xlink:href',\n 'href'\n ];\n\n config.module.rules.forEach((rule) => {\n rule.oneOf &&\n rule.oneOf.forEach((useOf) => {\n useOf.use &&\n useOf.use.forEach((use) => {\n if (\n (use.loader && use.loader.match(/css-loader/)) ||\n use.loader === 'vue-style-loader'\n ) {\n if (!use.options.modules) {\n use.options.modules = {\n getLocalIdent\n };\n } else {\n delete use.options.modules.localIdentName;\n use.options.modules.getLocalIdent = getLocalIdent;\n }\n }\n });\n\n const cssLoaderIndex = useOf.use.findIndex(\n (use) => use.loader && use.loader.match(/css-loader/)\n );\n if (cssLoaderIndex > -1) {\n useOf.use.splice(cssLoaderIndex + 1, 0, {\n loader: path.resolve('build-utils/css/fix-classnames-before.js')\n });\n }\n });\n });\n config.module.rules[1].oneOf[0].use.unshift({\n loader: path.resolve('build-utils/css/fix-html.js')\n });\n\n // Sets webpack's mode to development if `isDev` is true.\n if (isDev) {\n config.mode = 'development';\n }\n }", "title": "" }, { "docid": "5bea1fad7352104e0c1ec020fa99192e", "score": "0.5132895", "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": "49c39f8514006f18c1635bd60d2f7ff3", "score": "0.5123566", "text": "function handleDemoStyles()\n {\n return $q.all(files.css.map(function (file)\n {\n return file.contentsPromise;\n }))\n .then(function (styles)\n {\n styles = styles.join('\\n'); //join styles as one string\n\n var styleElement = angular.element('<style>' + styles + '</style>');\n document.body.appendChild(styleElement[0]);\n\n scope.$on('$destroy', function ()\n {\n styleElement.remove();\n });\n });\n\n }", "title": "" }, { "docid": "84c2ce0a922d24046c2cb3a8745ee96f", "score": "0.5123365", "text": "function addStylesByType(key) {\n const currentModules = modules[key];\n for (let name in currentModules) {\n const { file: mdlFile, dependencies } = currentModules[name];\n const [prevMessage] = helpers.result.messages.slice(-1);\n const { file: prevParent } = prevMessage ?? {};\n // Add file and its dependencies to postcss dependency graph\n helpers.result.messages.push({\n type: \"dependency\",\n plugin: pluginName,\n file: mdlFile,\n parent: prevParent ?? globalParent ?? \"\",\n });\n dependencies.forEach((depFile) => {\n if (!helpers.result.messages?.some(({ file }) => file === depFile)) {\n helpers.result.messages.push({\n type: \"dependency\",\n plugin: pluginName,\n file: depFile,\n parent: mdlFile,\n });\n }\n });\n styles[key][name] = currentModules[name];\n }\n }", "title": "" }, { "docid": "b1169eb04b17011f0e47d6d8b0a7655d", "score": "0.5120191", "text": "injectCSS()\n\t{\n\t\tthis.services.ContentAssignment.assignContent(this.options.CSSElementAddress, this.generateCSS());\n\t}", "title": "" }, { "docid": "935526580362139e1e9b41b0ef628f2f", "score": "0.51189345", "text": "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-5wvubo-style\";\n \tstyle.textContent = \"li.svelte-5wvubo{display:inline-block}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "11991dc6058b37929b8d17c225afe6bb", "score": "0.5116053", "text": "function handleDemoStyles() {\n return $q.all(files.css.map(function(file) {\n return file.contentsPromise;\n }))\n .then(function(styles) {\n styles = styles.join('\\n'); //join styles as one string\n\n var styleElement = angular.element('<style>' + styles + '</style>');\n document.body.appendChild(styleElement[0]);\n\n scope.$on('$destroy', function() {\n styleElement.remove();\n });\n });\n\n }", "title": "" }, { "docid": "3e5a96e9eebcb90ac94fee32634b7997", "score": "0.51159424", "text": "function styles() {\n\treturn gulp\n\t\t.src(paths.styles.src)\n\t\t.pipe(sass().on('error', sass.logError))\n\t\t// .pipe(autoprefixer({\n\t\t// \tbrowsers: ['last 2 versions']\n\t\t// }))\n\t\t.pipe(sourcemaps.init({\n\t\t\tloadMaps: true\n\t\t})) // Strip inline source maps\n\t\t.pipe(sass({\n\t\t\toutputStyle: 'compressed'\n\t\t}))\n\t\t.pipe(concat('allStyles.css'))\n\t\t.pipe(sourcemaps.write())\n\t\t.pipe(cleanDest(paths.styles.dest))\n\t\t.pipe(gulp.dest(paths.styles.dest))\n\t\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "f00376b0a24f438781565e4c833878c7", "score": "0.5112673", "text": "function test_upgrade_custom_css() {}", "title": "" }, { "docid": "1a2c33468f196fe45d21f521d447f865", "score": "0.5105542", "text": "function DebugStyling(){}", "title": "" }, { "docid": "9a0caed190e79797f60ffd896f429529", "score": "0.510456", "text": "function styles() {\n return gulp.src(paths.styles.src)\n .pipe(less())\n .pipe(cleanCSS())\n // pass in options to the stream\n .pipe(gulp.dest(paths.styles.dest));\n}", "title": "" }, { "docid": "5f480732d196ef3869cecbcb17a9a7b7", "score": "0.51009536", "text": "function highlightCSS() {\n return gulp.src('src/assets/css/**/*')\n .pipe(gulp.dest('dist/css'));\n}", "title": "" }, { "docid": "cc5edec1e12c9ab03e8e8408db31b7df", "score": "0.5094775", "text": "function _styles (done) {\n gulp.src(paths.styles.src)\n .pipe(gulpif(sourcemapping, sourcemaps.init())) // Si le sourcemapping est activé, lancement de ce dernier\n .pipe(minify()) // minifie chaque fichier CSS traité\n .pipe(concat('all-styles.min.css')) // concatene dans le fichier de sortie (all-styles.min.js)\n .pipe(gulpif(sourcemapping, sourcemaps.write())) // Si le sourcemapping est activé, écriture du résultat dans le pipe\n .pipe(gulp.dest(paths.styles.dest)); // génération du fichier de sortie\n done();\n}", "title": "" }, { "docid": "4538481c9ddfee78f7a31de48fc91312", "score": "0.5093021", "text": "function compile(basePath) {\n // Project files\n const input = path.resolve('packages', basePath, baseInput);\n const output = path.resolve('packages', basePath, baseOutput);\n\n print('Running compilation for: ' + chalk.green(basePath));\n\n // Watch file or run once?\n if (process.argv.indexOf('--watch') !== -1) {\n print(`Now watching for file changes at ${chalk.green(input)}...`)\n chokidar.watch(path.join('packages', basePath, '**/*.sass'))\n .on('change', path => run());\n } else {\n run();\n }\n\n function run() {\n // delete old file\n del(output)\n\n // compile sass\n .then(_paths => {\n return new Promise((resolve, reject) => {\n print(`Compile sass from file ${chalk.cyan(input)}...`);\n sass.render({ file: input }, (err, result) => {\n if (err) reject(err);\n else resolve(result.css.toString());\n });\n });\n })\n\n // optimize css\n .then(result => {\n print('Optimize css using cssnano...');\n return postcss([\n require('cssnano')({ preset: 'advanced' })\n ])\n .process(result, { from: undefined });\n })\n\n // write css to file\n .then(result => {\n print(`Write css to ${output}...`);\n return new Promise((resolve, reject) => {\n write(output, result, err => {\n if (err) reject(err);\n else resolve();\n });\n });\n })\n\n // finish handlers\n .then(() => print('Done.'))\n .catch(err => printErr(err.formatted));\n }\n}", "title": "" }, { "docid": "b80515c27765eb3de85536591259a111", "score": "0.5088011", "text": "prepare() {\n return fsensuredir(path.resolve(this.config.cwd, this.config.target, 'assets'))\n .then(() => {\n return fscopy(this.config.theme.assets,\n // TODO: make \"assets\" path configurable\n path.resolve(this.config.cwd, this.config.target, path.basename(this.config.theme.assets))\n )\n })\n .then(() => {\n if (this.config.assets) {\n let copyPromises = this.config.assets.map((asset) => {\n return fscopy(path.resolve(this.config.cwd, asset.src), path.resolve(this.config.cwd, this.config.target, asset.target))\n })\n\n return Promise.all(copyPromises)\n } else {\n warn('Styleguide.prepare', 'No additional assets configured')\n\n return Promise.resolve([])\n }\n })\n .then(() => {\n return this\n })\n }", "title": "" }, { "docid": "2891165940272817542e37d2e825a3de", "score": "0.5086575", "text": "function styles() {\n\tvar tailwindcss = require(\"tailwindcss\");\n return gulp\n .src(paths.styles.src)\n .pipe(\n postcss()\n )\n .pipe(gulp.dest(paths.styles.dest))\n .pipe(browserSync.stream()); \n}", "title": "" }, { "docid": "6eb70394f1c3ef6c7b642e178dea94ea", "score": "0.5086024", "text": "function styles() {\n return gulp\n .src(BUILD.source.stylus)\n .pipe(sourcemaps.init())\n .pipe(stylus({\n compress: true\n }))\n .pipe(cleanCSS())\n .pipe(sourcemaps.write('./map'))\n .pipe(gulp.dest(BUILD.dirs.css));\n}", "title": "" }, { "docid": "33b89217c20be38ca688bf836a859461", "score": "0.50773877", "text": "function styles(){\n return (\n src(paths.styles.input)\n .pipe(sourcemaps.init())\n .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))\n .pipe(autoprefixer({cascade: false}))\n .pipe(sourcemaps.write(''))\n .pipe(dest(paths.styles.output))\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "d1e07d96d32c128497a8de293d95ab14", "score": "0.50772035", "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": "9bcb249219fdb7339fa0f707a51e5a19", "score": "0.507318", "text": "writeBundle() {\n const { stylesheet } = this._options;\n // Validate that the target file exists.\n if (fs.pathExistsSync(stylesheet)) {\n // Reset the _\"caches\"_.\n this._sourcesCache = {};\n this._createdDirectoriesCache = [];\n // Get the file contents.\n const code = fs.readFileSync(stylesheet, 'utf-8');\n // Based on the file type, process it with the right method.\n const processed = stylesheet.match(this._expressions.js) ?\n this._processJS(code) :\n this._processCSS(code);\n // Write the processed result back on the file.\n fs.writeFileSync(stylesheet, processed);\n }\n }", "title": "" }, { "docid": "cfcab1eb553f656e492550685f8a1ec6", "score": "0.5069119", "text": "function styles() {\n return gulp\n .src(['src/assets/scss/*.scss'])\n .pipe(sourcemaps.init())\n .pipe(\n sass({\n sourceComments: 'map',\n sourceMap: 'sass',\n outputStyle: 'compressed',\n }).on('error', sass.logError)\n )\n .pipe(autoprefixer('last 3 version'))\n .pipe(concat('main.min.css'))\n .pipe(\n cssnano({\n discardComments: { removeAll: true },\n })\n ) // Use cssnano to minify CSS\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest('dist/assets/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "9b55fa9db3ebbb194c4d982bee3eb62f", "score": "0.5068597", "text": "function styles() {\n // Where should gulp look for the sass files?\n // My .sass files are stored in the styles folder\n // (If you want to use scss files, simply look for *.scss files instead)\n return (\n gulp\n .src([\"./sass/**/*.scss\", \"./sass/**/*.sass\"])\n //.src('./sass/almbb.scss')\n // Use sass with the files found, and log any errors\n .pipe(sass())\n \n .on(\"error\", sass.logError)\n \n .pipe(autoprefixer({ overrideBrowserslist: ['last 10 versions'], grid: true }))\n .pipe(cleancss({ level: { 1: { specialComments: 0 } } , format: 'beautify' })) // Минифицируем стили\n\n // What is the destination for the compiled file?\n .pipe(gulp.dest(\"css\"))\n );\n}", "title": "" }, { "docid": "f6a828b30195656f7ed186db4aced743", "score": "0.5061332", "text": "function main_process() {\n gulp.watch(\"src/_sass/*.scss\", [\"styles\"]);\n gulp.watch(\"src/**/*.js\", [\"scripts\"]);\n gulp.watch(\"src/img/**/*\", [\"img\"]);\n gulp.watch(\"src/sprites/**/*.svg\", [\"svgstore\"]);\n}", "title": "" }, { "docid": "056ef009c502846e3ca0af25e645ef7d", "score": "0.5056783", "text": "function buildStyles () {\n return gulp.src('static/src/styles/main.styl')\n .pipe(changed('static/dist/styles'))\n .pipe(stylus({\n 'include css': true,\n paths: ['./node_modules']\n }))\n .on('error', function (err) {\n console.log('[' + chalk.red('Stylus error...') + ']')\n console.log(err.message)\n console.log('\\u0007')\n this.emit('end')\n })\n .pipe(autoprefixer())\n .pipe(gulp.dest('static/dist/styles'))\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "1405e03ef610460fb3be162cb66ef0f2", "score": "0.5055221", "text": "function addStyleDev (styles, list) {\n\t for (var i = 0; i < list.length; i++) {\n\t var parts = list[i].parts\n\t for (var j = 0; j < parts.length; j++) {\n\t var part = parts[j]\n\t styles[part.id] = {\n\t ids: [part.id],\n\t css: part.css,\n\t media: part.media\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1405e03ef610460fb3be162cb66ef0f2", "score": "0.5055221", "text": "function addStyleDev (styles, list) {\n\t for (var i = 0; i < list.length; i++) {\n\t var parts = list[i].parts\n\t for (var j = 0; j < parts.length; j++) {\n\t var part = parts[j]\n\t styles[part.id] = {\n\t ids: [part.id],\n\t css: part.css,\n\t media: part.media\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e2fbe6d498c7841fa5b1bdb5f85fb598", "score": "0.50548", "text": "function admin_styles_bundle(development) {\n return function() {\n gulp\n .src(admin_styles_entrypoint)\n .pipe(sourcemaps.init())\n .pipe(postcss())\n .pipe(rename({ basename: \"admin\", ext: \".css\" }))\n .pipe(\n sourcemaps.write(\"./\", {\n includeContent: false,\n sourceRoot: path.join(__dirname, paths.src)\n })\n )\n .pipe(rename({ basename: \"admin-bundle\", ext: \".css\" }))\n .pipe(livereload())\n .pipe(gulp.dest(admin_styles_exitpoint));\n };\n}", "title": "" }, { "docid": "8269bf9cf2772f917aa3e4ae998df93f", "score": "0.50533515", "text": "function createAllCSSs() {\r\n\tcssString = '.QPpopup{' +\r\n\t\t'background-color:white;' +\r\n//\t\t'border:thin solid #000000;' +\r\n//\t\t'font-family: Verdana, Arial, Helvetica, sans-serif;' +\r\n//\t\t'font-size:8pt;' +\r\n//\t\t'font-weight:bold;' +\r\n\t\t'padding-bottom:3px;' +\r\n\t\t'padding-left:3px;' +\r\n\t\t'padding-right:3px;' +\r\n\t\t'padding-top:3px;' +\r\n\t\t'position:absolute;' +\r\n//\t\t'visibility:hidden;' +\r\n\t\t'display:none' +\r\n\t\t'z-index:200;}';\r\n\taddCSS(cssString);\r\n\taddCSS('.QPnowrap{white-space:nowrap;}');\r\n\tcssString = '.QPsmall{' +\r\n\t\t'background-color:white;' +\r\n\t\t'font-family: Verdana, Arial, Helvetica, sans-serif;' +\r\n\t\t'font-size:8pt;' +\r\n\t\t'font-weight:bold;' +\r\n\t\t'padding-bottom:3px;' +\r\n\t\t'padding-left:3px;' +\r\n\t\t'padding-right:3px;' +\r\n\t\t'padding-top:3px;' +\r\n\t\t'}';\r\n\taddCSS(cssString);\r\n\tcssString = '.QPsmallTxt{' +\r\n\t\t'background-color:white;' +\r\n\t\t'font-family: Verdana, Arial, Helvetica, sans-serif;' +\r\n\t\t'font-size:8pt;' +\r\n\t\t'}';\r\n\tcssString = '.QPcoords{' +\r\n\t\t'background-color:white;' +\r\n\t\t'font-family: Verdana, Arial, Helvetica, sans-serif;' +\r\n\t\t'font-size:8pt;' +\r\n\t\t'color:lightgrey;' +\r\n\t\t'}';\r\n\taddCSS(cssString);\r\n\tcssString = '.QPcoords2{' +\r\n\t\t'font-family: Verdana, Arial, Helvetica, sans-serif;' +\r\n\t\t'font-size:8pt;' +\r\n\t\t'color:grey;' +\r\n\t\t'}';\r\n\taddCSS(cssString);\r\n\tvar cssString = '.QPbuildingLevel{' +\r\n\t\t'background-color:#FDF8C1;' +\r\n\t\t'border:thin solid #000000;' +\r\n\t\t'-moz-border-radius:2em;' +\r\n\t\t'border-radius:2em;' +\r\n\t\t'padding-top:3px;' +\r\n\t\t'font-family: Verdana, Arial, Helvetica, sans-serif;' +\r\n\t\t'font-size:8pt;' +\r\n\t\t'font-weight:bold;' +\r\n\t\t'color:black;' +\r\n\t\t'text-align:center;' +\r\n\t\t'position:absolute;' +\r\n\t\t'width:18px;' +\r\n\t\t'height:15px;' +\r\n\t\t'cursor:pointer;' +\r\n\t\t'visibility:hidden;' +\r\n\t\t'z-index:50;}';\r\n\taddCSS(cssString);\r\n\tvar cssString = '#QPD1BL{' +\r\n\t\t'position:absolute;' +\r\n\t\t'top:71px;' +\r\n\t\t'left:257px;' +\r\n\t\t'z-index:20;}';\r\n\taddCSS(cssString);\r\n\tvar cssString = '#QPD2BL{' +\r\n\t\t'position:absolute;' +\r\n\t\t'top:60px;' +\r\n\t\t'left:25px;' +\r\n\t\t'z-index:50;}';\r\n\taddCSS(cssString);\r\n\tvar cssString = '.QPdorf1BuildingLevel{' +\r\n\t\t'opacity:0.25;' +\r\n\t\t'-moz-border-radius:4em;' +\r\n\t\t'border-radius:4em;' +\r\n\t\t'position:absolute;' +\r\n\t\t'width:22px;' +\r\n\t\t'height:20px;' +\r\n\t\t'visibility:hidden;' +\r\n\t\t'z-index:50;}';\r\n\taddCSS(cssString);\r\n\tvar cssString = '.QPresources{' +\r\n\t\t'font-size:7pt;' +\r\n\t\t'color:#909090;' +\r\n\t\t'text-align:left;' +\r\n\t\t'position:absolute;' +\r\n\t\t'top:13px;' +\r\n\t\t'height:20px;' +\r\n\t\t'}';\r\n\taddCSS(cssString);\r\n\r\n\r\n}", "title": "" }, { "docid": "3ada029b7a6b8c8359dfb41dacdc0f80", "score": "0.504756", "text": "function generateCSS() {\n\t\t\tconst licenseNotification = postcss.comment();\n\t\t\tlicenseNotification.text = `! Grid generated using ${name} v${version} | ${license} License | ${author} | github.com/SlimMarten/postcss-mesh `;\n\n\t\t\t// append licenseNotification\n\t\t\tmesh.append(licenseNotification);\n\n\t\t\tfor (const key in inlineSettings) {\n\t\t\t\tsettings = JSON.parse(JSON.stringify(defaultSettings));\n\t\t\t\tconst curGrid = inlineSettings[key];\n\n\t\t\t\t// set name\n\t\t\t\tif (curGrid.name) settings.name = curGrid.name;\n\n\t\t\t\t// set queryCondition\n\t\t\t\tif (curGrid[\"query-condition\"]) settings.queryCondition.value = curGrid[\"query-condition\"];\n\n\t\t\t\t// set displayType\n\t\t\t\tif (\"display-type\" in curGrid && settings.displayType.options.indexOf(curGrid[\"display-type\"]) > -1) {\n\t\t\t\t\tsettings.displayType.value = curGrid[\"display-type\"];\n\t\t\t\t}\n\n\t\t\t\tif (JSON.parse(curGrid[\"compile\"])) mesh.append(getRules(curGrid));\n\t\t\t}\n\n\t\t\tinput.append(mesh);\n\t\t}", "title": "" }, { "docid": "0df7e39cd4189874ff2c71a642a82560", "score": "0.5046445", "text": "function compile(css) {\n return stylus(css).render();\n}", "title": "" }, { "docid": "d263d1d29bbfa680c4288f468c477ab2", "score": "0.50438887", "text": "function initCss () {\n gutil.log('***init CSS***');\n return gulp.src(['assets/styles/**/*'], {cwd: path.app})\n .pipe(injectAppVars())\n .pipe(gulp.dest('css', {cwd: path.app + 'assets/'})); // create folder if don't exist \n}", "title": "" }, { "docid": "f6f835d07300b77a52a4ddaa631e18e4", "score": "0.50371677", "text": "function compileWatch() {\n watch(jsWatchLocation, js);\n watch(scssWatchLocation, css);\n}", "title": "" }, { "docid": "f865b1b480eb531cfe167196ea660f63", "score": "0.5034191", "text": "function watch() {\n gulp.watch('ui/modules/**/*.scss', compileSass)\n}", "title": "" }, { "docid": "287add47ee32cdfe1a0025d37daa4e34", "score": "0.5029654", "text": "function refreshStyleBlockStates() {\n\n function createStyleBlockUpdater(rule, blockId) {\n return function(result) {\n var state = rule.default != \"disabled\";\n if (blockId in result)\n state = result[blockId];\n\n if (state) {\n if (document.getElementById(blockId) == null)\n addStyleBlock(blockId, rule);\n }\n else {\n removeStyleBlock(blockId);\n }\n };\n }\n\n for (var ruleSetId in ruleSets) {\n var ruleSet = ruleSets[ruleSetId];\n\n for (ruleId in ruleSet) {\n var rule = ruleSet[ruleId];\n var blockId = getRuleIdentifier(ruleSetId, ruleId);\n\n var updater = createStyleBlockUpdater(rule, blockId);\n chrome.storage.sync.get(blockId, updater);\n }\n }\n}", "title": "" }, { "docid": "8ab36a4ad7c41ef321089060b061745c", "score": "0.50293726", "text": "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-pa4hh5-style\";\n\tstyle.textContent = \".container.svelte-pa4hh5.svelte-pa4hh5{--color-background-heading:transparent;--color-background-day:transparent;--color-background-day-empty:var(--background-secondary-alt);--color-background-day-active:var(--interactive-accent);--color-background-day-hover:var(--interactive-hover);--color-dot:var(--text-muted);--color-arrow:currentColor;--color-text-title:var(--text-normal);--color-text-heading:var(--text-normal);--color-text-day:var(--text-normal);--color-text-today:var(--text-accent)}.container.svelte-pa4hh5.svelte-pa4hh5{overflow-y:scroll;padding:0 16px}th.svelte-pa4hh5.svelte-pa4hh5,td.svelte-pa4hh5.svelte-pa4hh5{text-align:center}.title.svelte-pa4hh5.svelte-pa4hh5{color:var(--color-text-title);margin-right:4px;text-align:center}.today.svelte-pa4hh5.svelte-pa4hh5{color:var(--color-text-today)}.active.svelte-pa4hh5.svelte-pa4hh5{background-color:var(--color-background-day-active)}.table.svelte-pa4hh5.svelte-pa4hh5{border-collapse:collapse;width:100%}th.svelte-pa4hh5.svelte-pa4hh5{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6rem;letter-spacing:1px;padding:4px 8px}td.svelte-pa4hh5.svelte-pa4hh5{transition:background-color 0.1s ease-in;cursor:pointer;background-color:var(--color-background-day);color:var(--color-text-day);font-size:0.8em;padding:8px}td.svelte-pa4hh5.svelte-pa4hh5:empty{background-color:var(--color-background-day-empty)}td.svelte-pa4hh5.svelte-pa4hh5:not(:empty):hover{background-color:var(--color-background-day-hover)}.dot-container.svelte-pa4hh5.svelte-pa4hh5{height:6px;line-height:6px}.dot.svelte-pa4hh5.svelte-pa4hh5{display:inline-block;fill:var(--color-dot);height:6px;width:6px;margin-right:2px}.dot.svelte-pa4hh5.svelte-pa4hh5:last-of-type{margin-right:0}.ml-2.svelte-pa4hh5.svelte-pa4hh5{margin-left:8px}.mr-2.svelte-pa4hh5.svelte-pa4hh5{margin-right:8px}.arrow.svelte-pa4hh5.svelte-pa4hh5{cursor:pointer;display:inline-block}.arrow.svelte-pa4hh5 svg.svelte-pa4hh5{fill:var(--color-arrow);height:16px;width:16px}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "8831e956eeaf7af27cc192190cb4d99a", "score": "0.50218636", "text": "function styles() {\r\n return src(paths.styles.src)\r\n\r\n .pipe(sourcemaps.init())\r\n .pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError ))\r\n .pipe(autoprefixer())\r\n .pipe(cleanCSS())\r\n .pipe(sourcemaps.write('.'))\r\n .pipe(gulp.dest(paths.styles.dest))\r\n .pipe(browserSync.stream());\r\n}", "title": "" }, { "docid": "35339a4a86f424112355784db272ab7e", "score": "0.5013811", "text": "function addCommon(css) {\n\tvar wireframeCss = fs.readFileSync(path.join(__dirname, 'wireframe.css'));\n\tcss.prepend(postcss.parse(wireframeCss));\n}", "title": "" }, { "docid": "057e24b77afc264d75d6e1103168e5a3", "score": "0.50102824", "text": "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-1xxutyh-style';\n \tstyle.textContent = \".notification.svelte-1xxutyh{display:flex;align-items:stretch;justify-content:space-between;margin:12px;background:#fff;color:#000;border-radius:6px}.notification-context.svelte-1xxutyh{width:210px;padding:12px 6px 12px 12px;box-sizing:border-box;word-wrap:break-word}button.svelte-1xxutyh{display:block;width:40px;padding:0 0 2px;margin:0;border:none;border-left:1px solid #eee;outline:none;background:none;cursor:pointer;font-size:20px;color:#000;box-sizing:border-box}button.svelte-1xxutyh:hover{background:rgba(0, 0, 0, 0.01)}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "e000d0444a6c7a8bc65695993a6977a8", "score": "0.50099564", "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": "627be7c0c463dca5ef7225344d2fc1ab", "score": "0.50069493", "text": "function styles() {\n return gulp.src('./src/scss/**/*.scss')\n .pipe(gulpStylelint({\n failAfterError: false,\n reporters: [\n {formatter: 'string', console: true}\n ]\n }))\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('./dist/css'))\n .pipe(connect.reload());\n}", "title": "" }, { "docid": "7e546d5b4c1e146f28b2fd53ddc88377", "score": "0.50061727", "text": "function styles() {\n return gulp.src(config.path.src.styles)\n .pipe(plugins.sass().on('error', sass.logError))\n .pipe(plugins.autoprefixer(config.path.autoprefixer.split(', ')))\n .pipe(plugins.if(minify, plugins.cssnano()))\n .pipe(plugins.rename({\n basename: 'main',\n suffix: '.min'\n }))\n .pipe(gulp.dest(config.path.build.styles))\n .pipe(plugins.size({title: '--> CSS'}));\n}", "title": "" }, { "docid": "fce977a2b82fc0ace336d1f37adfe7bc", "score": "0.5005768", "text": "async compile() {\n // Check fonts (this gets the font settings needed later)\n if (this.options.fontCheck !== false) {\n let check = await this.fonts.checkFonts();\n let missing = _.filter(check, set => !set.found);\n if (missing && missing.length) {\n let e = new Error(`Missing ${missing.length} fonts.`);\n e.id = errors.fontCheck;\n e.data = check;\n throw e;\n }\n }\n else {\n debug('Skipping font check.');\n }\n\n // Get config\n try {\n this.compileAi2htmlConfig();\n }\n catch (e) {\n debug(e);\n throw new Error('Unable to compile ai2html settings.');\n }\n\n // Get ai2html\n try {\n this.ai2htmlScript = await this.fetchAi2html();\n }\n catch (e) {\n debug(e);\n throw new Error('Unable to fetch ai2html script.');\n }\n }", "title": "" }, { "docid": "5ba00a653dc9908a3d81ff571678d2f7", "score": "0.49985677", "text": "function watch() {\n gulp.watch('assets/js/src/*.js', lintScripts);\n gulp.watch(\n [\n 'assets/js/src/*.js',\n '!assets/js/src/custom-footer.js',\n '!assets/js/src/custom-menu-full.js',\n '!assets/js/src/custom-menu-new.js',\n ],\n compileScripts\n );\n gulp.watch(\n [\n 'assets/js/src/custom-footer.js',\n 'assets/js/src/custom-menu-new.js',\n 'template-parts/modules/**/assets/js/*.js'\n ], \n compileFooterScripts\n );\n gulp.watch(['template-parts/modules/**/assets/scss/*.scss', 'assets/scss/**/**/**/*.scss'], compileSass);\n}", "title": "" }, { "docid": "5016edde146e18bc190cb25a63298519", "score": "0.4998418", "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": "55fdb2b22321a9680a67d01be68919e0", "score": "0.49949262", "text": "function compile() {}", "title": "" }, { "docid": "11d8bf84d3ef144f0c6889437bb79a93", "score": "0.49829322", "text": "function compileStyle( id, style ) {\n\t// check if style has already been compiled\n\tif( styles.indexOf(id) >=0 ) {\n\t\treturn\n\t}\n\t\n\t// compile templates\t\t\n\tfor( var k in style) {\n\t\tvar option\t\t= id + \"_\" + k\n\t\tvar compiled \t= dust.compile(k, option)\n\t\tdust.loadSource(compiled);\n\t}\n\t\n\t// add it to array\n\tstyles.push(id)\n}", "title": "" }, { "docid": "497117b993389308924eb0d5b84fc25c", "score": "0.49823183", "text": "function stylesheets(extra_less_files, callback) {\n var compiled = '', to_do = 0;\n client_css.map(lessFileAs(\"internal\")).concat(extra_less_files.map(lessFileAs(\"external\"))).forEach(function (file) {\n if (file.name.match(/\\.less$/)) {\n to_do++;\n var style = file.type === \"internal\" ? fs.readFileSync(path.join(public_dir, file.name), 'utf-8') : fs.readFileSync(file.name, 'utf-8');\n var parser = new(less.Parser)({\n paths: file.type === \"internal\" ? [path.join(public_dir, 'stylesheets')] : \"\",\n filename: file.name\n });\n parser.parse(style, function (err, tree) {\n if (!err) {\n compiled += tree.toCSS({compress: true});\n }\n to_do--;\n if (to_do === 0) {\n to_do = -1000; // hack to avoid calling callback twice\n callback(err, compiled);\n }\n });\n }\n });\n\n if (to_do === 0) {\n callback(null, compiled);\n }\n}", "title": "" } ]
2ffc5cf31e8a47c4284bf43e331a3501
Base class helpers for the updating state of a component.
[ { "docid": "e0f1947021fa70baa71f4ddac7adb17b", "score": "0.0", "text": "function ReactComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n // We initialize the default updater but the real one gets injected by the\n // renderer.\n this.updater = updater || ReactNoopUpdateQueue;\n}", "title": "" } ]
[ { "docid": "20faae96af93a69cf942ac9db7ee2314", "score": "0.66472244", "text": "onUpdate(state){\n\n }", "title": "" }, { "docid": "99586600c5e6bb79856f0b5ed177dd1f", "score": "0.65958387", "text": "component() {\n this.props.update_Props(tProps, Q, F, W, store);\n }", "title": "" }, { "docid": "3d6a85017eba83c89caace8d66f07b5b", "score": "0.64488816", "text": "updateComponentType(event){\n this.setState({component: event.target.value}); \n }", "title": "" }, { "docid": "4a75a699cba0979739fb0e01b845b97a", "score": "0.6403513", "text": "update() {\n // Empty, override\n }", "title": "" }, { "docid": "f1c65e81ce28d760e1a9dbfd616b1e7b", "score": "0.6380533", "text": "handleUpdate(e) {\n const { name, value } = e.target;\n this.props.updateState(name, value);\n }", "title": "" }, { "docid": "41db80b4ada0b6166a0efce2a6717a24", "score": "0.63797605", "text": "handler(update) {\n this.setState(update)\n }", "title": "" }, { "docid": "4294573eaf0c7414fa2848fbeb999442", "score": "0.63686144", "text": "setState(updateObject) {\n Object.assign(this.state, updateObject);\n this.state.needsRedraw = true;\n }", "title": "" }, { "docid": "f36e97acd2869265d9851f9ce54e9b02", "score": "0.6354163", "text": "_onChange() {\n this.setState(this._getUpdatedState());\n }", "title": "" }, { "docid": "1a1787d337d3e0a926b87692fac513a8", "score": "0.6337163", "text": "stateChanged() {\n const componentStore = mapStateToProps(getStore().getState());\n Object.entries(componentStore).forEach(([key, value]) => {\n this[key] = value;\n });\n }", "title": "" }, { "docid": "dd6ab476377d44998481c1b567be0e73", "score": "0.6296624", "text": "updateComponent(prop, value) {\n if( !this.connected ){ return; }\n }", "title": "" }, { "docid": "b26d710b863721117c67360542a65b12", "score": "0.6291783", "text": "updateState(newState) {\n this.setState(newState);\n }", "title": "" }, { "docid": "ea9025e783005e9782814861b8518e6e", "score": "0.62617236", "text": "componentWillUpdate(){}", "title": "" }, { "docid": "119952779210e533d2a74f0d8ada97c4", "score": "0.6249857", "text": "update(event){\n\t\tlet newStateObj = {}; // we have to declare the object first. \n\t\t// we cannot create object and it's property in one go. \n\t\tnewStateObj[event.target.name] = event.target.value;\n\t\tthis.setState(newStateObj); \n\t}", "title": "" }, { "docid": "286c1a63bfae11d7212272d3cfe4731e", "score": "0.6207274", "text": "updateComponent() {\n // Set message text\n this.$messageText.innerHTML = this['message'];\n\n // Set icon\n if (this['icon'].length > 0) {\n this.$illustration.innerHTML = this['icon'];\n this.$illustration.style.display = '';\n } else {\n this.$illustration.style.display = 'none';\n }\n\n this.$actionButton.innerText = this['action-label'];\n this.$actionButton.setAttribute('aria-label', this['action-aria-label']);\n\n if (this['action-url'].length > 0) {\n this.$actionButton.setAttribute('href', this['action-url']);\n this.$actionButton.setAttribute('target', '_blank');\n }\n\n if (this['learn-more-url'].length > 0) {\n this.$learnMoreButton.setAttribute('href', this['learn-more-url']);\n this.$learnMoreButton.setAttribute('target', '_blank');\n this.$learnMoreButton.setAttribute('aria-label', this['learn-more-aria-label']);\n this.$learnMoreButton.style.display = '';\n } else {\n this.$learnMoreButton.style.display = 'none';\n }\n\n // Show banner\n this.$banner.classList.add('open');\n }", "title": "" }, { "docid": "c2e4f49942b2efa11d8f5865979157ff", "score": "0.61792624", "text": "_renderAsUpdated(newValue,oldValue){if(typeof newValue!==typeof void 0){this._resetRenderMethods()}}", "title": "" }, { "docid": "dc9497b2158c70d84f14974448f0eb5c", "score": "0.61676776", "text": "componentWillUpdate(newProps, newState) {\n console.log(`New state.val ${newState.val}`)\n console.log(`New state.abc ${newState.abc}`)\n }", "title": "" }, { "docid": "26f06c11b020d1a66ac6b78a143f0a3f", "score": "0.61588556", "text": "_onChange(action) {\r\n this.setState(this.updateState());\r\n }", "title": "" }, { "docid": "b51a7cbac4c69fc0f568711342df0ee9", "score": "0.6158682", "text": "onUpdate (name, values) {\n this.setState({ [name]: values }, () => {\n if (this.props.onUpdate) {\n this.props.onUpdate({\n name: this.props.name,\n FullName: this.state.FullName,\n LastContact: this.state.LastContact,\n Comments: this.state.Comments,\n Relationship: this.state.Relationship,\n Phone: this.state.Phone,\n Email: this.state.Email,\n Address: this.state.Address\n })\n }\n })\n }", "title": "" }, { "docid": "9d89793793f81e09dd751f9fa6f3cec0", "score": "0.61522377", "text": "update()\n {\n if(this.desiredState !== \"\")\n {\n if(this.currentState !== \"\")\n {\n this.states[this.currentState].exit();\n }\n \n this.currentState = this.desiredState;\n this.desiredState = \"\";\n\n if(this.states[this.currentState] !== undefined)\n {\n this.states[this.currentState].init();\n }\n }\n \n if(this.currentState !== \"\")\n {\n if(this.states[this.currentState] !== undefined)\n {\n this.states[this.currentState].update();\n }\n }\n }", "title": "" }, { "docid": "b909d92e6595a8c3cc4e82b83bf85057", "score": "0.6151019", "text": "reloadComponent(progress){\n \n this.setState({unit_progress: progress})\n }", "title": "" }, { "docid": "2823978e2117b9d799bbf26daa311f72", "score": "0.61456084", "text": "stateChanged(_state) { }", "title": "" }, { "docid": "d436426d1d3e144303269dfe48f62449", "score": "0.61321527", "text": "componentWillMount() {\n this.updateState(this.props, this.state.value);\n }", "title": "" }, { "docid": "2202e79b0bd8db30ef47ba3447780387", "score": "0.61272424", "text": "async updateState({props, oldProps, changeFlags}) {\n await this._updateToken(props, oldProps, changeFlags);\n this._updateEEObject(props, oldProps, changeFlags);\n await this._updateEEVisParams(props, oldProps, changeFlags);\n }", "title": "" }, { "docid": "375c9bd4b4c3b354ba81df33c40e4021", "score": "0.61141133", "text": "updateWidget() {\n this.updateURL();\n this.checkStatusProp();\n }", "title": "" }, { "docid": "47f783015e7c11ed9ad0b95d654b8986", "score": "0.6112775", "text": "refreshComponent (store) {\n //Do some calculations with the values passed to the state\n this.setState(store)\n }", "title": "" }, { "docid": "6b1fd6ab3409e8e954dd6800da4ebf73", "score": "0.6107857", "text": "updateState() {\n console.log('updateState hit');\n\n }", "title": "" }, { "docid": "3b53c9e83d3d997e2b692998b88bca57", "score": "0.6085514", "text": "onUpdate (name, values) {\n this.setState({ [name]: values }, () => {\n if (this.props.onUpdate) {\n this.props.onUpdate({\n name: this.props.name,\n Dates: this.state.Dates,\n Address: this.state.Address,\n Comments: this.state.Comments,\n Role: this.state.Role,\n Reference: this.state.Reference\n })\n }\n })\n }", "title": "" }, { "docid": "9abf2f51fbff09220b8b5546b6b6d46a", "score": "0.6073981", "text": "stateChanged(_state) {}", "title": "" }, { "docid": "7991e27b98886c89b46498f73fc640bb", "score": "0.60737884", "text": "componentDidUpdate() {\n this.props.parentState(this.i, this.state);\n }", "title": "" }, { "docid": "41a5b7043b8dd93aafa951f9e94ea9d4", "score": "0.6066948", "text": "update(){\n this.setState(store.getState());\n }", "title": "" }, { "docid": "83d8c9ecc731b2604982f503971399c8", "score": "0.60582787", "text": "function setState(changes) {\n //console.log(\"setState : \");\n //console.log(changes);\n Object.assign(state, changes);\n \n \n ReactDOM.render(\n React.createElement(ContactView, \n Object.assign({}, state, \n {\n onNewContactChange: updateNewContact,\n onNewContactSubmit: submitNewContact,\n }\n )\n ),\n document.getElementById('divtest2')\n );\n\n}", "title": "" }, { "docid": "54618ee33037d5cc65bcb63c5e690588", "score": "0.60517573", "text": "update(e) {\n //setState does not need the entire state, only the part you want to set,\n //notice that I am not passing in cat from this.state (above). setState does\n //not overwrite state.cat\n this.setState({\n red: ReactDOM.findDOMNode(this.refs.red.refs.inp).value,\n green: ReactDOM.findDOMNode(this.refs.green.refs.inp).value,\n blue: ReactDOM.findDOMNode(this.refs.blue.refs.inp).value\n })\n }", "title": "" }, { "docid": "d9f599b54b4fa8d4d61c9652b0a3ccb6", "score": "0.60402673", "text": "_onChange(){\n\t\tthis.setState(this.getClockInOutState(), this.updateStatusResult);\n\t}", "title": "" }, { "docid": "42c4bb5625eabffcedcfa59e2c868664", "score": "0.60391814", "text": "updateInput(e, newVal) {\n this.setState({input: newVal});\n }", "title": "" }, { "docid": "3026cc25ae0ba3a28fb08dea51a38e11", "score": "0.6038146", "text": "updateChangedProperty(val) {\n this.setState({ changedProperty: val });\n }", "title": "" }, { "docid": "1c4398cb3d8a1f505373a77f702b5227", "score": "0.60338366", "text": "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n \n }", "title": "" }, { "docid": "17d649eb1ee41c9765a49b0dc0a0bd06", "score": "0.60273594", "text": "componentWillUpdate(newProps, newState) {\n console.log('Component WILL UPDATE! ', newProps, newState); \n }", "title": "" }, { "docid": "85c13f0617145d0e155120a5e5128b92", "score": "0.60073173", "text": "_whereStateChange(newState){\n /* KEEP PRIVATE DATA*/\n this.setState(Object.assign(this.state,newState));\n }", "title": "" }, { "docid": "5b69356c3d398f4d9c7d13cee51f49d5", "score": "0.59973717", "text": "update(a, b) {\n let typeArg = _Util_main_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getType(a);\n switch (typeArg) {\n case \"Function\":\n this._state = a(this._state);\n break;\n case \"String\":\n this._state[a] = b(this._state, this.state(a));\n break;\n default:\n throw new yngwie__WEBPACK_IMPORTED_MODULE_1__.Error(\"Argument passed to yngwieModel.update is of an unsupported type\", typeArg);\n }\n return this;\n }", "title": "" }, { "docid": "6a525ac3805f938d07a0d4458f77d7f3", "score": "0.5989136", "text": "updateValue(value) {\n this.setState(\n {\n value,\n },\n () => {\n if (this.props.setData) {\n this.props.setData(this.state.value);\n }\n\n if (this.props.onChange) {\n this.props.onChange();\n }\n },\n );\n }", "title": "" }, { "docid": "161338a382f6088ba444a7bf74555687", "score": "0.59678763", "text": "function update() {\n // ... no implementation required\n }", "title": "" }, { "docid": "161338a382f6088ba444a7bf74555687", "score": "0.59678763", "text": "function update() {\n // ... no implementation required\n }", "title": "" }, { "docid": "ae9cc6b63176a255a59f5cccc43f527e", "score": "0.596341", "text": "constructor(props) {\n super(props);\n\n // Initial state of the component\n this.state = {\n step: ''\n };\n\n this.edit = this.edit.bind(this);\n this.save = this.save.bind(this);\n this.refresh = this.refresh.bind(this);\n this.cancel = this.cancel.bind(this);\n }", "title": "" }, { "docid": "f34f09c09578a4d5925159f79889b064", "score": "0.59539336", "text": "renderUpdateFn() { throw new MethodNotDefined('renderUpdateFn not defined in child class') }", "title": "" }, { "docid": "efdef54553ff3d521a2000b02d917433", "score": "0.59335357", "text": "componentDidUpdate(oldProps, oldState) {\n console.log(`Old state.val ${oldState.val}`)\n console.log(`Old state.abc ${oldState.abc}`)\n }", "title": "" }, { "docid": "50e1905b50def58d66492408b61ea689", "score": "0.59311604", "text": "componentWillUpdate(nextProps, nextState) {\n // You cannot use this.setState() in this method\n }", "title": "" }, { "docid": "dc8b87e6249c58740bc5a5abda253ded", "score": "0.59122664", "text": "componentDidUpdate(prevProps, prevState){\n // So sanh, neu nhu props truoc do (taskEdit truoc) !== taskEdit hien tai => can setState\n // Khong thuc hien so sanh se gay ra vong lap vo tan\n if(prevProps.taskEdit.id !== this.props.taskEdit.id){\n // Lay props gan vao state\n this.setState({\n taskName: this.props.taskEdit.taskName\n })\n /*Giai thich:\n B1: Lay props hien tai gan vao state -> qua value, hien thi ra UI\n B2: onChange thay doi du lieu -> setState chay lai, render -> componentDidUpdate\n tai day kiem tra thay dieu kien if id props truoc va sau khong thay doi => k setState\n */\n }\n\n \n }", "title": "" }, { "docid": "bee88d9379411c264eb4a7d3c3063b7e", "score": "0.59098715", "text": "update(value) {\n if (typeof value === \"string\") {\n this.context.commit(\"setState\", { [value]: this.data[value] });\n } else if (typeof value === \"object\") {\n this.context.commit(\"setState\", value);\n } else if (!value) {\n this.context.commit(\"setState\", this.data);\n }\n }", "title": "" }, { "docid": "2f104f5b770e4ef14763094c16ff5a34", "score": "0.59077877", "text": "changeState(state) {\n this.state = state;\n }", "title": "" }, { "docid": "c475597a0622778888841d448c2c86f3", "score": "0.59065276", "text": "_changeState(type, newState) {\n if (newState !== this.state) {\n this.state = newState;\n console.log(type, this.state);\n }\n\n }", "title": "" }, { "docid": "b9087754c95c54ca61b75a30281d31cd", "score": "0.59041834", "text": "componentDidUpdate (prevProps, prevState) {\n const el = this.el\n const props = this.props\n\n // Update events.\n updateEventListeners(el, prevProps.events, props.events)\n\n // Update entity.\n if (_options.runSetAttributeOnUpdates) {\n updateAttributes(el, prevProps, props)\n }\n }", "title": "" }, { "docid": "45a786bfad4d488473e741838100eff4", "score": "0.5895194", "text": "update(name,value){\n //trace('FF',name,value);\n var valid = true;\n if(this.props.mandatory || (this.props.type=='email' && value.length>0)) {\n valid = this.validateField(this.props.type, value);\n }\n if(this.props.type == 'number' || this.props.type == 'counter') {\n value = parseFloat(value);\n if(isNaN(value)) {\n value = '';\n }\n }\n if(valid || this.props.type == 'select') {\n if(typeof this.props.onChange == 'function') {\n this.props.onChange(name,value);\n }\n } else if(!valid) {\n this.props.onChange(name,'');\n }\n this.setState({\n invalid: !valid\n });\n }", "title": "" }, { "docid": "8838f89123e9dde7865b48da5b6e3aa1", "score": "0.58942485", "text": "_onChange() {\n\n this.setState(this.getStateData());\n\n }", "title": "" }, { "docid": "5bd5531cbbc129f67b965b068a8e6ade", "score": "0.5888679", "text": "function o(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}", "title": "" }, { "docid": "4b5f3cfb16ca54483db846c37bf9bfc0", "score": "0.58870775", "text": "updatePlayerState(obj) {\n this.setState(obj);\n }", "title": "" }, { "docid": "10499cda0b82d9e64376779df1d94ad0", "score": "0.58824384", "text": "dispatchUpdate(){\n\n }", "title": "" }, { "docid": "fd7fa68428467f89101a75249050dfef", "score": "0.58741486", "text": "constructor(props){\n super(props);\n this.bookStateUpdate = this.bookStateUpdate.bind(this)\n }", "title": "" }, { "docid": "7108120cc0122e635cb8e647ddb41783", "score": "0.5873612", "text": "componentDidUpdate(prevProps, prevState) {\n// \t\tconsole.log(\"Master comp updates \");\n\t}", "title": "" }, { "docid": "cba1c2c4385093396894ee8c193b5997", "score": "0.587217", "text": "update(progress) {\n\tthrow \"this method is abstract and should be overwritten by the implementing class\";\n }", "title": "" }, { "docid": "98d953e53bf77cb50b1a0a86383af483", "score": "0.58717066", "text": "updateStateFields(fields) {\n if (_.isObject(fields)) {\n this.currentComponent.setState({ fields: fields });\n }\n }", "title": "" }, { "docid": "b1edf07107d5c3bcf6634649066d5c53", "score": "0.58609957", "text": "setState(_state, _args) {\n\t // This has to be handled at a higher level since we can't\n\t // replace the whole tree here however we still need a method here\n\t // so it appears on the proxy Actions class.\n\t throw new Error('Called setState on StateActions.');\n\t }", "title": "" }, { "docid": "26732f1a708ece1a0660e6bd75bba0bf", "score": "0.5860799", "text": "componentDidUpdate(prevProps, prevState) {\n\n if( this.props.componentDidUpdateSpy ){\n // You can use this intrusive spy to check on calls to componentDidUpdate, and also to ascertain state...\n this.props.componentDidUpdateSpy({'prevProps': {...prevProps}, 'currProps': {...this.props}, 'prevState': {...prevState}, 'currState': {...this.state}})\n }\n\n let sWho = \"PostsFilterForm::componentDidUpdate\"\n\n // Don't forget to compare props...!\n if (this.props.posts.post_is_editing_id !== prevProps.posts.post_is_editing_id \n ||\n this.props.posts.post_is_editing !== prevProps.posts.post_is_editing \n ){\n this.setState((state,props)=>{\n\n let sWho = `${sWho}::setState`\n\n let stateUpdate = {\n postIsEditingPost: props.posts.post_is_editing_post ? props.posts.post_is_editing_post : {},\n postIsEditingId: props.posts.post_is_editing_id ? props.posts.post_is_editing_id: -1\n }\n\n logajohn.debug(`${sWho}(): SHEMP: Moe, props.posts.post_is_editing_id went from ${prevProps.posts.post_is_editing_id} to ${this.props.posts.post_is_editing_id}, and props.posts.post_is_editing went from ${prevProps.posts.post_is_editing} to ${this.props.posts.post_is_editing}...`)\n\n logajohn.debug(`${sWho}(): SHEMP: Moe, looks like a change in props.posts_is_editing_id or props.post_is_editing, returning stateUpdate = `, stateUpdate )\n\n return stateUpdate\n })\n }\n\n // Listen for edit change in posts...\n if( this.props.posts.post_is_editing_iteration !== prevProps.posts.post_is_editing_iteration ){\n logajohn.debug(`${sWho}(): SHEMP: Moe, looks like a change in props.posts_is_editing_iteration, callin' dhis.filterIt() and dhis.autoSuggestUpdate()...`)\n this.filterIt()\n this.autoSuggestUpdate()\n }\n\n }", "title": "" }, { "docid": "4e09e3d7197fd0193349441f57f920d6", "score": "0.58606124", "text": "function r(){\n// Call this.constructor.gDSFP to support sub-classes.\nvar e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}", "title": "" }, { "docid": "0c854c4fca404095697bf215b7b61873", "score": "0.58516014", "text": "beforeUpdate() {\n // waiting for subclass rewrite\n }", "title": "" }, { "docid": "1e17fb38f07bb295743d58406685fed1", "score": "0.5843156", "text": "componentDidUpdate(prevProps, prevState) { // eslint-disable-line\n if (this.state.value !== prevState.value) {\n this.props.setValue(this.state.value);\n this.props.onChangeInput(this.props.name, this.state.value);\n }\n }", "title": "" }, { "docid": "1e17fb38f07bb295743d58406685fed1", "score": "0.5843156", "text": "componentDidUpdate(prevProps, prevState) { // eslint-disable-line\n if (this.state.value !== prevState.value) {\n this.props.setValue(this.state.value);\n this.props.onChangeInput(this.props.name, this.state.value);\n }\n }", "title": "" }, { "docid": "8b065c6aeb4e969e181291cc7b677bab", "score": "0.5842827", "text": "toggleIssueUpdateStatus() {\n this.setState({updated: this.storageProcessor.toggleIssueStatus(this.props.issue)});\n }", "title": "" }, { "docid": "5cfd1fa745d815bb3216f5d61cb2ba61", "score": "0.58180845", "text": "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "title": "" }, { "docid": "70a7b38c532232288a29aa7efcb9815b", "score": "0.5813526", "text": "constructor() {\r\n\t\tsuper();\r\n this.bindMethods();\r\n this.state = {cityName: \"New York\"};\r\n var self = this;\r\n $('body').on('cityChange2', function(event, argument){\r\n //$('div.my-component').text(arguments[1]);\r\n self.setState({cityName:arguments[1]});\r\n console.log(this.state);\r\n self.forceUpdate();\r\n\r\n });\r\n\t}", "title": "" }, { "docid": "54eaf194c8fb3f58f24f8992ab2dad6f", "score": "0.5804577", "text": "componentWillMount() {\n this.updateComponent();\n\n }", "title": "" }, { "docid": "61db12323ed63d5aa7150cb1885759e1", "score": "0.5803503", "text": "updateStateInContext(updatedState) {\n //must use setState not this.updatedState to re-render boardcast values\n this.setState(prevState => {\n return {\n updatedState: Object.assign({}, prevState.updatedState, updatedState)\n };\n });\n }", "title": "" }, { "docid": "671c4684fadd82d7fa71e7a988d53e42", "score": "0.5799264", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n fullMenuList: this.props.model.getFullMenu(),\n fullMenuPrice: this.props.model.getFullMenuPrice()\n });\n }", "title": "" }, { "docid": "d899290a52d827a005a02834de5145fe", "score": "0.5798322", "text": "componentDidUpdate(prevProps) {\n if (this.props.isEditing && this.props.system && !prevProps.system) {\n this.setState({\n name: this.props.system.name,\n shortName: this.props.system.shortName,\n description: this.props.system.description,\n systemType: this.props.system.systemType,\n city: this.props.system.city,\n state: this.props.system.state,\n county: this.props.system.county,\n country: this.props.system.country,\n showScreenName: this.props.system.showScreenName,\n });\n }\n }", "title": "" }, { "docid": "644bc486e4aa77f028b5752b38e17f52", "score": "0.57928807", "text": "constructor(props){\n super(props)\n this.state = {\n editing: false,\n avatar: this.props.data.avatar,\n name: this.props.data.name,\n surname: this.props.data.surname,\n street: this.props.data.street,\n city: this.props.data.city,\n country: this.props.data.country,\n email: this.props.data[\"e-mail\"],\n words: this.props.data.words\n }\n\n // Binding component methods\n this.togglEdit = this.togglEdit.bind(this)\n this.handleChange = this.handleChange.bind(this)\n this.deleteItem = this.deleteItem.bind(this)\n this.newItem = this.newItem.bind(this)\n }", "title": "" }, { "docid": "eaf045c83c90bd944c9796cca0dbc982", "score": "0.5792494", "text": "update(_fromStatic) {\n throw 'unimplemented';\n }", "title": "" }, { "docid": "ec1482232be8149c08270c3897b956fc", "score": "0.5790052", "text": "setState( state ) {\n\n const savedState = this.states[ state ];\n \n if ( !savedState ) {\n console.warn(`state \"${ state }\" does not exist within this component`);\n return\n }\n\n if ( state === this.currentState ) return\n\n this.currentState = state;\n\n if ( savedState.onSet ) savedState.onSet();\n\n if ( savedState.attributes ) this.set( savedState.attributes );\n\n }", "title": "" }, { "docid": "f7126b2ff765c27fe0586101e6e4a69b", "score": "0.5783433", "text": "setUserInterface(){\r\n gui\r\n .add(this.state, 'class', [\"Single\",\"Instanced\",\"Multiple\"])\r\n .name(\"Class\")\r\n .onChange((value)=>{this.setState({class:value})})\r\n\r\n gui\r\n .add(this.state, 'loadingTime')\r\n .name(\"Loading Time\")\r\n .domElement.id = 'loadingTime';\r\n\r\n gui\r\n .add(this.state, 'count',1,MAX_NUMBER)\r\n .name(\"Number\").step(1)\r\n .onChange((value)=>{this.setState({count:value})})\r\n \r\n gui\r\n .add(this.state, 'averageFPS')\r\n .name(\"Average FPS\")\r\n .domElement.id = 'averageFPS';\r\n }", "title": "" }, { "docid": "076df01caf4f5a651c36cae639475006", "score": "0.57828015", "text": "componentUpdated(el, binding, vnode) {\n const self = vnode.context\n const instanceName = getInstanceName(el, binding, vnode)\n const options = binding.value || {}\n const quill = self[instanceName]\n if (quill) {\n const model = vnode.data.model\n const _value = vnode.data.attrs ? vnode.data.attrs.value : null\n const _content = vnode.data.attrs ? vnode.data.attrs.content : null\n const disabled = vnode.data.attrs ? vnode.data.attrs.disabled : null\n const content = model ? model.value : (_value || _content)\n const newData = content\n const oldData = el.children[0].innerHTML\n quill.enable(!disabled)\n if (newData) {\n if (newData != oldData) {\n const range = quill.getSelection()\n quill.root.innerHTML = newData\n setTimeout(() => {\n quill.setSelection(range)\n })\n }\n } else {\n quill.setText('')\n }\n }\n }", "title": "" }, { "docid": "055217e51566ae5250292d2e4a079048", "score": "0.577323", "text": "[symbols_1.updateStateBindings](parentClass = constructor.prototype) {\n if (!this[symbols_1.boundStore]) {\n return;\n }\n const config = Reflect.getMetadata(symbols_1.selectionBinding, parentClass) || [];\n config.forEach((binding) => {\n this[binding.property] = binding.selector(this[symbols_1.boundStore].getState());\n });\n }", "title": "" }, { "docid": "40ded7e9b3bb3122f3a422dfd68d809e", "score": "0.5772195", "text": "componentDidUpdate() {\n if (this.props.visible !== this.state.visible) {\n this.setState({visible: this.props.visible});\n }\n if (this.props.namespace !== this.state.namespace) {\n this.setState({namespace: this.props.namespace}, this.getSecrets);\n }\n }", "title": "" }, { "docid": "d0823613addd6bfceacced3ac024e0ff", "score": "0.57699805", "text": "attributeChangedCallback(name, oldValue, newValue) {\n // Update the attribute internally\n this[name] = newValue;\n // Update the component\n if (this.$messageText && this.$illustration && this.$actionButton) {\n this.updateComponent();\n }\n }", "title": "" }, { "docid": "29b5b59e1900cc67409e1482de91b2b4", "score": "0.5767454", "text": "componentDidMount() {\n const {props, state, update} = this;\n update(props, props, state);\n }", "title": "" }, { "docid": "179f3b04a653daa52db485ba41258106", "score": "0.5758719", "text": "componentDidUpdate(prevProps){\n // to check whether the current index or list is changed or not and if there is change in any one of them then we update them\n if(prevProps.currentIndex !== this.props.currentIndex || prevProps.list.length !== this.props.list.length)\n this.setState({...this.returnStateObj()})\n }", "title": "" }, { "docid": "7133ddce737beede4e32b8d25d73b231", "score": "0.5757437", "text": "updateObs() {\n const { obs } = this.props;\n this.setState({\n obs\n });\n }", "title": "" }, { "docid": "6f5e89384a5c25b301baf123ef72bb70", "score": "0.57544476", "text": "function Component(props, context, updater) { // 199\n this.props = props; // 200\n this.context = context; // 201\n this.refs = emptyObject; // 202\n // We initialize the default updater but the real one gets injected by the // 203\n // renderer. // 204\n this.updater = updater || ReactNoopUpdateQueue; // 205\n} // 206", "title": "" }, { "docid": "48233d0274572ea46d9f633835e6e443", "score": "0.574591", "text": "updateOnClick(value) {\n this.setState({ update: value });\n }", "title": "" }, { "docid": "7eecf4dfc96d93ee77a97ad19e118894", "score": "0.5740053", "text": "Update() {\n //if a global state exists, call its execute method, else do nothing\n if ( this.m_pGlobalState != null) {\n this.m_pGlobalState.Execute( this.m_pOwner );\n }\n\n //same for the current state\n if ( this.m_pCurrentState != null ) {\n this.m_pCurrentState.Execute( this.m_pOwner );\n };\n }", "title": "" }, { "docid": "f605dc2f3310e986d179036e30a53989", "score": "0.5737471", "text": "shouldComponentUpdate(newProps, newState) {\n console.log(`Child shouldComponentUpdate called: ${this.state.xValue}`)\n if (this.props.value === newProps.value)\n return false;\n else\n return true;\n }", "title": "" }, { "docid": "7f69e54449d6f712416a1369e20fa2f5", "score": "0.5736866", "text": "updateState({ props, oldProps, changeFlags, ...rest }) {\n super.updateState({ props, oldProps, changeFlags, ...rest });\n // setup model first\n if (\n changeFlags.extensionsChanged ||\n props.colormap !== oldProps.colormap ||\n props.interpolation !== oldProps.interpolation\n ) {\n const { gl } = this.context;\n if (this.state.model) {\n this.state.model.delete();\n }\n this.setState({ model: this._getModel(gl) });\n\n this.getAttributeManager().invalidateAll();\n }\n if (\n (props.channelData !== oldProps.channelData &&\n props.channelData?.data !== oldProps.channelData?.data) ||\n props.interpolation !== oldProps.interpolation\n ) {\n this.loadChannelTextures(props.channelData);\n }\n const attributeManager = this.getAttributeManager();\n if (props.bounds !== oldProps.bounds) {\n attributeManager.invalidate('positions');\n }\n }", "title": "" }, { "docid": "967a7fcc1df639bc23dd189932cd5943", "score": "0.573115", "text": "setState(state) {\n const newState = Object.assign(this.state, state)\n this._dispatchEvent('update', { state: this.state, newState })\n this.state = newState\n this._saveState()\n }", "title": "" }, { "docid": "dc8c688e32adbb80a5030d388f7b3e24", "score": "0.5730195", "text": "componentDidUpdate() {}", "title": "" }, { "docid": "dc8c688e32adbb80a5030d388f7b3e24", "score": "0.5730195", "text": "componentDidUpdate() {}", "title": "" }, { "docid": "4b39b0e77d62015f7eea9f1ddfdb5f41", "score": "0.5729394", "text": "function processChild(element, Component) {\n var publicContext = processContext(Component, context);\n\n var queue = [];\n var replace = false;\n var updater = {\n isMounted: function (publicInstance) {\n return false;\n },\n enqueueForceUpdate: function (publicInstance) {\n if (queue === null) {\n warnNoop(publicInstance, 'forceUpdate');\n return null;\n }\n },\n enqueueReplaceState: function (publicInstance, completeState) {\n replace = true;\n queue = [completeState];\n },\n enqueueSetState: function (publicInstance, currentPartialState) {\n if (queue === null) {\n warnNoop(publicInstance, 'setState');\n return null;\n }\n queue.push(currentPartialState);\n }\n };\n\n var inst = void 0;\n if (shouldConstruct(Component)) {\n inst = new Component(element.props, publicContext, updater);\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n {\n if (inst.state === null || inst.state === undefined) {\n var componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUninitializedState[componentName]) {\n warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');\n didWarnAboutUninitializedState[componentName] = true;\n }\n }\n }\n\n var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);\n\n {\n if (partialState === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n if (!didWarnAboutUndefinedDerivedState[_componentName]) {\n warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);\n didWarnAboutUndefinedDerivedState[_componentName] = true;\n }\n }\n }\n\n if (partialState != null) {\n inst.state = _assign({}, inst.state, partialState);\n }\n }\n } else {\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[_componentName2]) {\n warning(false, \"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);\n didWarnAboutBadClass[_componentName2] = true;\n }\n }\n }\n inst = Component(element.props, publicContext, updater);\n if (inst == null || inst.render == null) {\n child = inst;\n validateRenderResult(child, Component);\n return;\n }\n }\n\n inst.props = element.props;\n inst.context = publicContext;\n inst.updater = updater;\n\n var initialState = inst.state;\n if (initialState === undefined) {\n inst.state = initialState = null;\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {\n if (typeof inst.componentWillMount === 'function') {\n {\n if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[_componentName3]) {\n lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\\n\\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);\n didWarnAboutDeprecatedWillMount[_componentName3] = true;\n }\n }\n }\n\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n if (typeof Component.getDerivedStateFromProps !== 'function') {\n inst.componentWillMount();\n }\n }\n if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {\n // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for any component with the new gDSFP.\n inst.UNSAFE_componentWillMount();\n }\n if (queue.length) {\n var oldQueue = queue;\n var oldReplace = replace;\n queue = null;\n replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;\n if (_partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = _assign({}, nextState, _partialState);\n } else {\n _assign(nextState, _partialState);\n }\n }\n }\n inst.state = nextState;\n }\n } else {\n queue = null;\n }\n }\n child = inst.render();\n\n {\n if (child === undefined && inst.render._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n child = null;\n }\n }\n validateRenderResult(child, Component);\n\n var childContext = void 0;\n if (typeof inst.getChildContext === 'function') {\n var childContextTypes = Component.childContextTypes;\n if (typeof childContextTypes === 'object') {\n childContext = inst.getChildContext();\n for (var contextKey in childContext) {\n !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key \"%s\" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;\n }\n } else {\n warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');\n }\n }\n if (childContext) {\n context = _assign({}, context, childContext);\n }\n }", "title": "" }, { "docid": "e3db30c9165f918144882ade1b1ba683", "score": "0.57244784", "text": "update(){\n //should update is set to false\n this.shouldUpdate = false;\n this.done = false;\n\n //if everything had just been reset, want to update\n if (this.justReset){\n this.shouldUpdate = true;\n this.justReset = false;\n }\n\n //checks for infections\n this.checkCollision();\n \n //checks if every node has made it to meetings\n //this.updateMeetings();\n //if so, it changes meeting spots and makes the nodes move again\n if (this.reset){\n this.RESET();\n this.shouldUpdate = true;\n }\n\n //sets state to render everything\n //updates Components then renders them\n if (this.shouldUpdate){\n this.updateComponents();\n this.setState({nodes: this.nodes});\n if (this.reset){\n this.reset = false;\n this.justReset = true;\n }\n \n }\n \n }", "title": "" }, { "docid": "ec94be4c0fea107631f42e4db2661f3c", "score": "0.57243204", "text": "colorMethodUpdate(event, clrTxt){\n const colorID = event;\n this.setState({\n color:colorID,\n colorTxt: clrTxt,\n didUpdate:true\n }); \n}", "title": "" }, { "docid": "45e30a0e48c1d0b802b3ec504e57b83d", "score": "0.57155776", "text": "update(attributes = {}) {\n stateCache.store[this.index] = Object.assign(this.state, attributes);\n }", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.5714222", "text": "function update(){}", "title": "" }, { "docid": "f60934acc7fb74e652aab330f9c96af8", "score": "0.570932", "text": "componentDidUpdate() {\n // log('did update', this.state, tableauExt.settings.getAll());\n }", "title": "" }, { "docid": "010f46d98362be60cafbae1d7e2dad5a", "score": "0.57069373", "text": "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "title": "" }, { "docid": "010f46d98362be60cafbae1d7e2dad5a", "score": "0.57069373", "text": "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "title": "" }, { "docid": "8032c7f7e6d79cdc5dd896a4703cc195", "score": "0.5703552", "text": "editComponentName(){\n this.setCurrentComponent();\n\n log((msg) => console.log(msg), LogLevel.TRACE, \"EDIT COMPONENT NAME\");\n this.setState({editable: true});\n }", "title": "" } ]
766e0e96e2c0942c76fdfde86c00b0e5
" what s my line "
[ { "docid": "1166e73a4e87fd0826d8ddc1f2d906b1", "score": "0.0", "text": "function cleanUp(words) {\n const result = words.match(/[a-z]/g);\n console.log(result);\n}", "title": "" } ]
[ { "docid": "12005dfb993cb9c96d1f9c469471369f", "score": "0.65854996", "text": "getLine() { return this.line; }", "title": "" }, { "docid": "2fa92f577b53fb4edc2de598121eed96", "score": "0.6464004", "text": "function getLineTextOld(line){\r\n var sb = new Chickenfoot.StringBuffer();\r\n for(n in line){\r\n //debug('getting line text of:');\r\n //debug(line[n]);\r\n //debug((line[n]).data);\r\n if(line[n].nodeName==\"SPAN\"){\r\n sb.append(line[n].childNodes[0].data);\r\n }else{\r\n if(line[n].nodeName==\"BR\"){\r\n }else{\r\n sb.append(line[n].data);\r\n }\r\n }\r\n }\r\n return sb.toString();\r\n}", "title": "" }, { "docid": "99b6fe62a0fae2ddf578305c17f5c6f1", "score": "0.64417374", "text": "line() { return this.program.currentLine(); }", "title": "" }, { "docid": "ef6e1c5007c5c9a97476f7017d4d3eec", "score": "0.64245385", "text": "function currentLine (line){\n if (line.length===0){\n return \"The line is currently empty.\" ;\n }\n var newLine = []; \n for (let i = 0; i< line.length; i++){\n newLine.push(` ${(i+1)}. ${line[i]}`);\n }\n return `The line is currently:${newLine}`\n}", "title": "" }, { "docid": "497abbd5c38985eff1b13029a41e97d9", "score": "0.63267833", "text": "function snipLine(line, colno) {\r\n var newLine = line;\r\n var ll = newLine.length;\r\n if (ll <= 150) {\r\n return newLine;\r\n }\r\n if (colno > ll) {\r\n colno = ll; // tslint:disable-line:no-parameter-reassignment\r\n }\r\n var start = Math.max(colno - 60, 0);\r\n if (start < 5) {\r\n start = 0;\r\n }\r\n var end = Math.min(start + 140, ll);\r\n if (end > ll - 5) {\r\n end = ll;\r\n }\r\n if (end === ll) {\r\n start = Math.max(end - 140, 0);\r\n }\r\n newLine = newLine.slice(start, end);\r\n if (start > 0) {\r\n newLine = \"'{snip} \" + newLine;\r\n }\r\n if (end < ll) {\r\n newLine += ' {snip}';\r\n }\r\n return newLine;\r\n}", "title": "" }, { "docid": "fe5576c15df54c3c66640c18d98a78de", "score": "0.6296363", "text": "getLine(row) {\n const lastRow = this.getLastRow();\n if (row > lastRow) {\n return \"\";\n }\n return this.editor.document.lineAt(row).text;\n }", "title": "" }, { "docid": "0b6a4857bfce4ac6a0a5e8c502db282f", "score": "0.6275628", "text": "function currentLine(katzDeliLine){\n var theLine= \"The line is currently: \"\n if(katzDeliLine.length != 0){\n for(var i = 0; i<katzDeliLine.length;i++){\n theLine += (i+1).toString()+\n \". \" +\n katzDeliLine[i] +\n \", \"\n }}\n else{\n return \"The line is currently empty.\"\n }\n return theLine.slice(0,-2)\n}", "title": "" }, { "docid": "2b270d91615c9b422764f960d5116e11", "score": "0.6275379", "text": "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "title": "" }, { "docid": "d28ab91b75f70e4de4ff3152ea402873", "score": "0.6273534", "text": "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "title": "" }, { "docid": "ce08b7971bdc7c1596d80914993c30aa", "score": "0.6266573", "text": "function snipLine(line, colno) {\n var newLine = line;\n var ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n colno = ll; // tslint:disable-line:no-parameter-reassignment\n }\n var start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n var end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n return newLine;\n}", "title": "" }, { "docid": "ce08b7971bdc7c1596d80914993c30aa", "score": "0.6266573", "text": "function snipLine(line, colno) {\n var newLine = line;\n var ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n colno = ll; // tslint:disable-line:no-parameter-reassignment\n }\n var start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n var end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n return newLine;\n}", "title": "" }, { "docid": "362800107ac22bd27c53455341bf9673", "score": "0.62527907", "text": "function snipLine(line, colno) {\n var newLine = line;\n var lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n var start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n var end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n return newLine;\n}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.6227213", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.6227213", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.6227213", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.6227213", "text": "function Line() {}", "title": "" }, { "docid": "72629dfbd542aedeed347a48f30ff464", "score": "0.6227213", "text": "function Line() {}", "title": "" }, { "docid": "d35306dc12abdd6c1a7dfc557695199c", "score": "0.6217394", "text": "getLine() {\n return this.args[4];\n }", "title": "" }, { "docid": "e889c132b498d9ee2f832c6374ceb9b7", "score": "0.6210389", "text": "function currentLine(katzDeliLine) {\n\tif (katzDeliLine.length > 0) {\n\t\treturn `The line is currently: 1. ${katzDeliLine.slice(0, 1)}, 2. ${katzDeliLine.slice(1, 2)}, 3. ${katzDeliLine.slice(2, 3)}`\n\t}\n\telse return \"The line is currently empty.\"\n}", "title": "" }, { "docid": "b34e9fd438f8c39890fcddb45bfcf480", "score": "0.6198928", "text": "getItalics(line){\n\n }", "title": "" }, { "docid": "8ba6864df032507381893d9b51077887", "score": "0.6176462", "text": "_getRowString(line) {\r\n let lineString = '';\r\n line.forEach((col) => {lineString = lineString.concat(col.letter)});\r\n return lineString;\r\n }", "title": "" }, { "docid": "c97f33dd7eb2004fe60e73fb15605d84", "score": "0.61746544", "text": "function debugLine(e, t, i) {\n\te === !0 && (e = \"true\"), e === !1 && (e = \"false\");var n = e;if (\"object\" == (typeof e === 'undefined' ? 'undefined' : _typeof(e))) {\n\t\tn = \"\";for (name in e) {\n\t\t\tvar r = e[name];n += \" \" + name + \": \" + r;\n\t\t}\n\t}if (1 != t || i || (n += \" \" + Math.random()), 1 == i) {\n\t\tvar o = jQuery(\"#debug_line\");o.width(200), o.height() >= 500 && o.html(\"\");var a = o.html();n = a + \"<br> -------------- <br>\" + n;\n\t}jQuery(\"#debug_line\").show().html(n);\n}", "title": "" }, { "docid": "8a681c9ec1cb53737009e2253ad12557", "score": "0.6174033", "text": "function currentLine(line){\n \n var katzDeliLine = []\n\n for (let i = 0; i<line.length; i++) {\n var pos = line.indexOf(line[i])+1\n var t = ' '+pos.toString()+`. ${line[i]}`\n katzDeliLine.push(t)\n }\n\n if (line.length === 0) {\n return 'The line is currently empty.';\n } \n \n //or else if the line is busy...\n else {\n var string1 = 'The line is currently:';\n \n return string1.concat(katzDeliLine);\n }\n\n }", "title": "" }, { "docid": "a7c76122f1c3d12419324626a7936749", "score": "0.6173529", "text": "normalizeLine (line) {\n return line.replace('\\r', '')\n }", "title": "" }, { "docid": "7312250089c391077e255c63843aa3f4", "score": "0.6162669", "text": "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "title": "" }, { "docid": "7d71786b822c0543d9fa103625e2f2f5", "score": "0.61617976", "text": "function currentLine(line) {\r\n \r\n //Create an empty container (array) to store the persons name and position.\r\n var ref = [];\r\n \r\n // i used as counter\r\n var i;\r\n \r\n // write static part of printed message\r\n var message = \"The line is currently:\";\r\n \r\n //copy contents (names) from katzDeliLine accross to line array\r\n katzDeliLine.push(line);\r\n \r\n //used if statement to give two conditional paths/branches. If there is a value and if there isnt.\r\n if (line.length > 0)\r\n {\r\n //used a for loop to execute code block until conditions were met before returning the values to an array then concating with message variable.\r\n for (i = 0; i < line.length; i++) {\r\n ref.push(\" \" + (i +1) + \". \" + line[i]); \r\n }\r\n return message + ref;\r\n }\r\n // string is now only seen if the line array is empty\r\n else {\r\n return \"The line is currently empty.\";\r\n }\r\n}", "title": "" }, { "docid": "3ab685f2f28b8e433c2e267ec9acad42", "score": "0.6148038", "text": "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "title": "" }, { "docid": "3ab685f2f28b8e433c2e267ec9acad42", "score": "0.6148038", "text": "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "title": "" }, { "docid": "3ab685f2f28b8e433c2e267ec9acad42", "score": "0.6148038", "text": "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "title": "" }, { "docid": "34c0f2f2639f2d2ac883133864a20edc", "score": "0.6147701", "text": "function sayName() {\r\n console.log(\"Line no 6: \", name)\r\n}", "title": "" }, { "docid": "5da366c5497d2ee52cced041649e7b35", "score": "0.6144739", "text": "function snipLine(line, colno) {\n var newLine = line;\n var ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n // eslint-disable-next-line no-param-reassign\n colno = ll;\n }\n var start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n var end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n return newLine;\n}", "title": "" }, { "docid": "5da366c5497d2ee52cced041649e7b35", "score": "0.6144739", "text": "function snipLine(line, colno) {\n var newLine = line;\n var ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n // eslint-disable-next-line no-param-reassign\n colno = ll;\n }\n var start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n var end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n return newLine;\n}", "title": "" }, { "docid": "f2cb187fcb0c271b4596686255fca823", "score": "0.6110495", "text": "function lines2line( lines ) {\n\tvar val = '';\n\tvar lines = lines.split( '\\n' ).filter( e => e );\n\tlines.forEach( function( el ) {\n\t\tval += '^'+ el;\n\t} );\n\treturn val.substring( 1 );\n}", "title": "" }, { "docid": "eb6d0da8019a5fd76fb316f9cf180c14", "score": "0.6101907", "text": "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "title": "" }, { "docid": "4302948c249594f28e4fd33b7255ace3", "score": "0.6084503", "text": "function currentLine(katzDeliLine) {\n if (katzDeliLine.length === 0) return 'The line is currently empty.'\n let lineString = 'The line is currently: ';\n lineString += `1. ${katzDeliLine[0]}`;\n for (let i = 1; i < katzDeliLine.length; i++) {\n let person = katzDeliLine[i];\n lineString += `, ${i + 1}. ${person}`;\n }\n \n return lineString\n \n}", "title": "" }, { "docid": "ddc911b225cd8a96538e00357e9ade13", "score": "0.6050396", "text": "function out(line) {\n core.output(line);\n}", "title": "" }, { "docid": "be375130bb7ea2ae6476e0157998dcff", "score": "0.6044716", "text": "static get LF () {\r\n\t\treturn '\\n';\r\n\t}", "title": "" }, { "docid": "618d0b23d8341245ad6b4305620a5d33", "score": "0.6044253", "text": "function currentLine(arr){\r\n if (!arr.length){\r\n return('The line is currently empty.')\r\n }\r\n let longString = []\r\n for (let i = 0; i < arr.length; i++){\r\n\tlongString.push(String(i+1) + \". \" + arr[i])\r\n \r\n }\r\n let veryLongString = longString.join(\", \")\r\n return(`The line is currently: ${veryLongString}`)\r\n}", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "b23bf82701b8b324c0a847b68e60bd30", "score": "0.6042895", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "title": "" }, { "docid": "20d817a39f19e05eab53458da606c1fe", "score": "0.6038877", "text": "static get multilinecomment(){return new comment('\\\\*[\\\\s\\\\S]*?\\\\*');}", "title": "" }, { "docid": "e4af2c7e01b44bd2f75fced05ad050be", "score": "0.60372674", "text": "function oneLine(s) {\n return (s.replace(/\\r?\\n|\\r|\\t/gm, '')).trim();\n}", "title": "" }, { "docid": "58d256c7d7f85e51cde721198492d150", "score": "0.60266757", "text": "function createLine(line) {\n\t\t\t\tvar newFormattedChatLine = \"\";\n\t\t\t\t\n\t\t\t\tif (line.source == 'system') {\n\t\t\t\t\tvar text = line.text;\n\t\t\t\t\tif (text.indexOf(\"You are now chatting with\") > -1) {\n\t\t\t\t\t\ttext = \"<div style='padding:5px 0;font-weight:bold;'>\"\n\t\t\t\t\t\t\t\t+ text + \"</div>\"\n\t\t\t\t\t}\n\t\t\t\t\tnewFormattedChatLine = \"<div class='lpChatInfoText'>\"\n\t\t\t\t\t\t\t+ text + \"</div>\";\n\t\t\t\t} else if (line.source == 'visitor') {\n\t\t\t\t\tnewFormattedChatLine = lpCWAssist.lpChatMakeRightSideMessage(\"You\", line.text, lpChatFontSize);\n\t\t\t\t} else if (line.source == 'agent') {\n\t\t\t\t\tnewFormattedChatLine = lpCWAssist.lpChatMakeLeftSideMessage(line.by, line.text, lpChatFontSize);\n\t\t\t\t}\n\n\t\t\t\treturn newFormattedChatLine;\n\t\t\t}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "a52a3ecc3f3ac29e14a57ee57f5b832b", "score": "0.6015585", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "9c29b0b9dd58448f0d1cd04cff3096c5", "score": "0.6011316", "text": "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "title": "" }, { "docid": "4ae6dac3635c1e35727468fca2b71374", "score": "0.60102", "text": "function headline(str) {!silent && console.log('%c\\n'+str, 'font-size: 16px;');}", "title": "" }, { "docid": "b4161e1e51ee6d84ade6f9dc75a57a54", "score": "0.6001984", "text": "function RendererTextLine() {\n\n /*\n * The width of the line in pixels.\n * @property width\n * @type number\n * @protected\n */\n this.width = 0;\n\n /*\n * The height of the line in pixels.\n * @property width\n * @type number\n * @protected\n */\n this.height = 0;\n\n /*\n * The descent of the line in pixels.\n * @property descent\n * @type number\n * @protected\n */\n this.descent = 0;\n\n /*\n * The content of the line as token objects.\n * @property content\n * @type Object[]\n * @protected\n */\n this.content = [];\n }", "title": "" }, { "docid": "269e4af91c4ddfd6a9719d16c1870b9a", "score": "0.59920114", "text": "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "title": "" }, { "docid": "ae4a874766436e9057560be31e905958", "score": "0.5987372", "text": "function contextLines(lines) {\n return lines.map(function (entry) {\n return ' ' + entry;\n });\n }", "title": "" }, { "docid": "fe75374985f5c4422df6cd1bbf459d57", "score": "0.59701717", "text": "function snipLine(line, colno) {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}", "title": "" }, { "docid": "dbc7168ac52cbf27a94921cb26dad96e", "score": "0.5942004", "text": "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "title": "" }, { "docid": "dbc7168ac52cbf27a94921cb26dad96e", "score": "0.5942004", "text": "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "title": "" }, { "docid": "64367c4fa4f6f8b058454c3b69b16aaf", "score": "0.59284645", "text": "function LineString(ls){\n\t\t\t\t// remove tail which should be the same as head\n\t\t\t\tvar reg = ls.slice(0, ls.length - 1);\n\t\t\t\treturn PolyBool.segments({ inverted: false, regions: [reg] });\n\t\t\t}", "title": "" }, { "docid": "95c4b0e6f4e652523f01ae6c6f32d701", "score": "0.59246546", "text": "function lineTop (){\n var l = line(chars.top\n , chars['top-left'] || chars.top\n , chars['top-right'] || chars.top\n , chars['top-mid']);\n if (l)\n ret += l + \"\\n\";\n }", "title": "" }, { "docid": "f92b096975dced7e1cc39da02554f408", "score": "0.5897316", "text": "function line(length, ch) {\n if (ch === void 0) { ch = '*'; }\n return (new Array(length + 1)).join(ch);\n }", "title": "" }, { "docid": "e2cb4fbf6d93f8b590e48e4a2019de62", "score": "0.5897282", "text": "function newLine() {\n startofLine = true;\n\n logBody.push(\"newLine\")\n logBody.push(`startofLine -> ${startofLine}`)\n }", "title": "" }, { "docid": "8b3ce91c2b821a24579365677b4dc21c", "score": "0.5886374", "text": "function contextLines(lines) {\n\t return lines.map(function (entry) {\n\t return ' ' + entry;\n\t });\n\t }", "title": "" }, { "docid": "8b3ce91c2b821a24579365677b4dc21c", "score": "0.5886374", "text": "function contextLines(lines) {\n\t return lines.map(function (entry) {\n\t return ' ' + entry;\n\t });\n\t }", "title": "" }, { "docid": "8b3ce91c2b821a24579365677b4dc21c", "score": "0.5886374", "text": "function contextLines(lines) {\n\t return lines.map(function (entry) {\n\t return ' ' + entry;\n\t });\n\t }", "title": "" }, { "docid": "8b3ce91c2b821a24579365677b4dc21c", "score": "0.5886374", "text": "function contextLines(lines) {\n\t return lines.map(function (entry) {\n\t return ' ' + entry;\n\t });\n\t }", "title": "" }, { "docid": "cb1ac31dfa52bda7272831be53a152ec", "score": "0.5870972", "text": "function println (line) {\n 'use strict'\n if (line) {\n let arr = line.split('\\n')\n for (let i = 0; i < arr.length; i++) {\n var sp1 = document.createElement('p')\n sp1.innerHTML = arr[i].trim()\n document.getElementById('console').appendChild(sp1)\n }\n }\n}", "title": "" }, { "docid": "a92b991ad0367aee7de38f4a4580bf71", "score": "0.5858462", "text": "function getFirstLine(s){\n\t\treturn s.split(/[\\r\\n]+/)[0];\n\t }", "title": "" }, { "docid": "4c54cbf1aa2f93b2a4dea60829e86a9f", "score": "0.58505005", "text": "constructor(msg, src, line, col) {\n let srcLines = src.split('\\n');\n let relevantLines = [line - 3, line - 2, line - 1, line]\n .filter(line => line > 0);\n let lines = relevantLines.map(line => `${line}: ${srcLines[line - 1]}`);\n let colLine = new Array(col + line.toString().length + 2).fill(' ');\n colLine[col + line.toString().length + 1] = '^';\n lines.splice(lines.length, 0, colLine.join(''));\n let message = `${msg} (line: ${line}, col: ${col})\\n\\n` + lines.join('\\n') + `\\n`;\n super(message);\n }", "title": "" }, { "docid": "f2741c2ed979d5664cb1a84433321cca", "score": "0.5848994", "text": "function qn(e){return e.text?R(e.from.line+e.text.length-1,p(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}", "title": "" }, { "docid": "739b29f5097e08402d40d68c7b1b9272", "score": "0.584653", "text": "function lineTop (){\n var l = line(chars.top\n , chars['top-left'] || chars.top\n , chars['top-right'] || chars.top\n , chars['top-mid']);\n if (l)\n ret += l + \"\\n\";\n }", "title": "" }, { "docid": "c0824b31d674c15d77293a5a78fe9fa7", "score": "0.5838426", "text": "function currentLine(line){\n var newLine=[];\n let i=0\n while(i<line.length){\n newLine.push(\" \" + (i+1)+\". \"+ line[i])\n i++\n }\n if(line.length===0){\n return(\"The line is currently empty.\")\n }else{\n return(\"The line is currently:\" + newLine)\n }\n}", "title": "" }, { "docid": "4ae7c3b70335eeebcae5fcc6adeeba43", "score": "0.58363444", "text": "function print_w_fn_and_ln(string){\n\n\tvar results = get_file_name_and_line_number(getErrorObject());\n\n\tconsole.log(\"location: \" + results[0]);\n\tconsole.log(\"file name: \" + results[1]);\n\n\tconsole.log(\"string input was: \" + string);\n\n}", "title": "" }, { "docid": "b2695c703bd47ce61fa1e9b7e53e2119", "score": "0.583341", "text": "get lineBreaks() { return 0; }", "title": "" }, { "docid": "cc8d02f6379b5bdc8f817a86f7f4ad78", "score": "0.5829897", "text": "_shouldDisplayLine(line) {\r\n return line.length > 0 && !this._ignoredLine;\r\n }", "title": "" }, { "docid": "78ddcfc1a524b9600043b1c6cd2042ff", "score": "0.5825277", "text": "voidLine() {\r\n\t\treturn null\r\n\t}", "title": "" } ]
3cdf0de9b47aa627e9c86ca9c9cb1bb3
Storing position, HTML5 way
[ { "docid": "b26832142d65a2bc5185872c2a306d78", "score": "0.0", "text": "function savePosition(position) {\r\n let lat = position.coords.latitude;\r\n let lon = position.coords.longitude;\r\n localStorage.setItem(\"latitude\", lat);\r\n localStorage.setItem(\"longitude\", lon);\r\n getNearestStops();\r\n}", "title": "" } ]
[ { "docid": "a1c4954ce83da986f0c368a4888a73b0", "score": "0.7347623", "text": "get position() {}", "title": "" }, { "docid": "a1c4954ce83da986f0c368a4888a73b0", "score": "0.7347623", "text": "get position() {}", "title": "" }, { "docid": "a1c4954ce83da986f0c368a4888a73b0", "score": "0.7347623", "text": "get position() {}", "title": "" }, { "docid": "2a8131ba57b4664a83f7ed4b41f90e2b", "score": "0.7035812", "text": "set position(value) {}", "title": "" }, { "docid": "2a8131ba57b4664a83f7ed4b41f90e2b", "score": "0.7035812", "text": "set position(value) {}", "title": "" }, { "docid": "2a8131ba57b4664a83f7ed4b41f90e2b", "score": "0.7035812", "text": "set position(value) {}", "title": "" }, { "docid": "64317c9531bdff107a9000a9574d1a16", "score": "0.7027102", "text": "get position() { return this._position; }", "title": "" }, { "docid": "64317c9531bdff107a9000a9574d1a16", "score": "0.7027102", "text": "get position() { return this._position; }", "title": "" }, { "docid": "a36d021268837c3149c9bbd6829d65d4", "score": "0.700374", "text": "getPosition() {\r\n return { top: 0, left: 0 }\r\n }", "title": "" }, { "docid": "2853dc79289af1918a442e129dbc9191", "score": "0.6876604", "text": "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "title": "" }, { "docid": "b8db07454d520c6edba01713165dc8e2", "score": "0.6799329", "text": "get position() {\n\t\treturn {x: this.x, y: this.y};\n\t}", "title": "" }, { "docid": "8b6eee6079a202edf8384839d6840e28", "score": "0.6681006", "text": "get position() {\n return this._pos\n }", "title": "" }, { "docid": "46529c0ca29ff72203a289c38bad44aa", "score": "0.66795194", "text": "function position(p) {\n\tif(curmovob) {\n\t\tcurmovob.position = p;\n\t}\n}", "title": "" }, { "docid": "ffdf3e6cdf29a0805e999b79ce825a58", "score": "0.6663683", "text": "function getPosition() {\n return {\n width: element.prop( 'offsetWidth' ),\n height: element.prop( 'offsetHeight' ),\n top: element.prop( 'offsetTop' ),\n left: element.prop( 'offsetLeft' )\n };\n }", "title": "" }, { "docid": "ffdf3e6cdf29a0805e999b79ce825a58", "score": "0.6663683", "text": "function getPosition() {\n return {\n width: element.prop( 'offsetWidth' ),\n height: element.prop( 'offsetHeight' ),\n top: element.prop( 'offsetTop' ),\n left: element.prop( 'offsetLeft' )\n };\n }", "title": "" }, { "docid": "834ad0213d091b1ee6ef54043b59212d", "score": "0.66493326", "text": "function storeRelativeLocation() {\n \n imgFrameAttrs.relativeLoc.x = \n (Math.round((viewFinder.width() / 2) - imgFrame.position().left) / imgFrame.width()).toFixed(2);\n \n imgFrameAttrs.relativeLoc.y = \n (Math.round((viewFinder.height() / 2) - imgFrame.position().top) / imgFrame.height()).toFixed(2); \n //console.log('relative loc: ' + imgFrameAttrs.relativeLoc.x + ',' + imgFrameAttrs.relativeLoc.y);\n }", "title": "" }, { "docid": "e8a36fd1f6a63c1debf885a99cbd2439", "score": "0.66039497", "text": "function displayCurrLoc(position){\n pos = position;\n}", "title": "" }, { "docid": "1ca1c809fc90c93303d5e156508a08bf", "score": "0.66029733", "text": "get position (){\n return this._position;\n }", "title": "" }, { "docid": "401adc6eac430bab522a17610d684d65", "score": "0.6597234", "text": "function getRealPosition( index ) {\n var stage = app.getDrawStage();\n return { 'x': stage.offset().x + index.x / stage.scale().x,\n 'y': stage.offset().y + index.y / stage.scale().y };\n }", "title": "" }, { "docid": "0f0f377567ea01ed71288a8d318a98b7", "score": "0.6559384", "text": "get position() {\n const boundRect = this.canvas.getBoundingClientRect() || { left: 0, top: 0 };\n return new hamonengine.math.vector2(boundRect.left, boundRect.top);\n }", "title": "" }, { "docid": "4e3e9059907e96cfbe1fed20989c4ddb", "score": "0.65469635", "text": "function getPosition(dom) \n{\n\tvar x = 0;\n\tvar y = 0;\n\twhile ( dom.offsetParent ) \n\t{\n \tx += dom.offsetLeft;\n\t\ty += dom.offsetTop;\n \tdom = dom.offsetParent;\n\t}\n\treturn {left: x, top: y};\n}", "title": "" }, { "docid": "07d338254ec94f9631e4c1c914d7190a", "score": "0.65425014", "text": "get position() {\n return this._position;\n }", "title": "" }, { "docid": "185ae1830f01a2488f38bbce9cbd8a58", "score": "0.65406984", "text": "get position() { return parseInt(new String(this._base.getPosition())) }", "title": "" }, { "docid": "516925fef424e9c9ead3048419e9c326", "score": "0.65337884", "text": "getPositionsLocation()\t\t{ return gl.getAttribLocation(this.program, \"inPosition\"); }", "title": "" }, { "docid": "fc1e134a97044a4ec9be53e2ed4ac90a", "score": "0.652507", "text": "function loadPosition() {\n var st = root.getComputedStyle(element, null);\n left = parseInt(st.getPropertyValue('left'), 10) || 0;\n top = parseInt(st.getPropertyValue('top'), 10) || 0;\n }", "title": "" }, { "docid": "65eb8eb269ae287eab8991abe98575e1", "score": "0.65247416", "text": "function getPosition(thePlaceHolder) {\n\tvar thePosition = [];\n\tthePosition[\"row\"] = parseInt(thePlaceHolder.attr(\"row\"));\n\tthePosition[\"col\"] = parseInt(thePlaceHolder.attr(\"col\"));\n\treturn thePosition;\n}", "title": "" }, { "docid": "50dad9da1cd1cbe2a0083cc124b47560", "score": "0.6508593", "text": "function setPosition(el,point){/*eslint-disable */el._leaflet_pos=point;/* eslint-enable */if(any3d){setTransform(el,point);}else{el.style.left=point.x+'px';el.style.top=point.y+'px';}}// @function getPosition(el: HTMLElement): Point", "title": "" }, { "docid": "a6a32e46a844b630ec433d97534c29c6", "score": "0.650145", "text": "position() {\n return this.native.position();\n }", "title": "" }, { "docid": "dd86f7f85a6010014a3191c0cd42b0ca", "score": "0.64883935", "text": "function getCurrentPos() {\n\t\t\t\t\t\t\t\t\t\tcurrentPosBlockDiv = getPosBlock();\n\t\t\t\t\t\t\t\t\t\tcurrentPosImage = getPosImage();\n\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "8a00edd329b1207cc8f3fe904a46951a", "score": "0.64827275", "text": "get position() {\n\t\treturn this.state ? this.state.position + (new Date() - new Date(this.state.time)) : 0;\n\t}", "title": "" }, { "docid": "d9fc2e9d3322fd0d5052ddcd5abd9417", "score": "0.64786404", "text": "get position() {\n return { x: this.x, y: this.y };\n }", "title": "" }, { "docid": "230d9460a47e3ffd719225e4cd18c686", "score": "0.64781684", "text": "get position() {\n return Object.assign({}, this._position); // Make a copy so it doesn't get modified;\n }", "title": "" }, { "docid": "99f0eb23e1c2241a6a436e11e4de60a4", "score": "0.6446595", "text": "get_position()\n {\n return this.liveFunc._position;\n }", "title": "" }, { "docid": "694a684e9583512ae05b8f56eaeceaf3", "score": "0.64368343", "text": "getPosition()\n {\n return this.position;\n }", "title": "" }, { "docid": "533bc181be0f8f5b173dd90c1f2f5211", "score": "0.6422075", "text": "get rawPosition() {}", "title": "" }, { "docid": "802aaa08e0759af103d6be57007bb7ac", "score": "0.64105135", "text": "function position() {\n const rect = $element[0].getBoundingClientRect()\n\n if (isGlobal) {\n viewElem.css({\n top: (rect.top - viewElem[0].offsetHeight - 6) + $window.scrollY + 'px',\n left: (rect.left + ((rect.width - viewElem[0].offsetWidth) / 2)) + $window.scrollX + 'px'\n })\n } else {\n viewElem.css({\n left: ((rect.width - viewElem[0].offsetWidth) / 2) + 'px'\n })\n }\n }", "title": "" }, { "docid": "d55d509c96a372ec4557e18fc5560c51", "score": "0.6408467", "text": "definingPosition() {\n this.position = [\n [this.y, this.x],\n [this.y + this.height, this.x],\n [this.y + this.height, this.width + this.x],\n [this.y, this.x + this.width]\n ];\n }", "title": "" }, { "docid": "554ef00eafe1dcad08dbd527a53c5d44", "score": "0.6389577", "text": "get position() {\r\n const t = this.physics.worldTransform;\r\n return { x: t.getOrigin().x(), y: t.getOrigin().y(), z: t.getOrigin().z() };\r\n }", "title": "" }, { "docid": "0e0d1d582d137fe59ca96192b4e633b3", "score": "0.63843685", "text": "function __getPosition(el) {\n var rect = el.getBoundingClientRect();\n return{\n \tx:rect.left,\n \ty:rect.top,\n \twidth:rect.width,\n \theight:rect.height\n };\n}", "title": "" }, { "docid": "fa5a0c8fc168f3edaac3b3fe0078f5b5", "score": "0.63840675", "text": "getPosition() {\n return this._position.copy();\n }", "title": "" }, { "docid": "9f06e19a8e3eb890628b5a94d9d136e6", "score": "0.6376497", "text": "set pos(x) { \r\n\r\n }", "title": "" }, { "docid": "8471d915bc17dfeb4efd6fdfe9bf2dec", "score": "0.6369592", "text": "function _calculatePositions(){\n\t\t_positions.introduction = 0;\n\t\t_positions.about = $('section#about').position().top - 100;\n\t\t_positions.portfolio = $('section#portfolio').position().top - 100;\n\t\t_positions.contact = $('section#contact').position().top - 100;\n\t}", "title": "" }, { "docid": "e7b62cae52a94f80e803ef767e478aa0", "score": "0.63580185", "text": "set rawPosition(value) {}", "title": "" }, { "docid": "04d1d9e4df9446d522c46d88f704ea50", "score": "0.634958", "text": "function positionID(x,y,id) {\n eval(docbitK + id + docbitendK + stylebitK + \".left = \" + x);\n eval(docbitK + id + docbitendK + stylebitK + \".top = \" + y);\n}", "title": "" }, { "docid": "8eb6d911a4a9920ae067909c26194906", "score": "0.6340303", "text": "function findPos(div) {\n var id = $(div).attr(\"id\");\n\n var w = ($(div).width()).toFixed();\n var h = ($(div).height()).toFixed();\n \n var position = $(div).position();\n var x = (position.left).toFixed();\n var y = (position.top).toFixed();\n \n\n //debug\n $(\"#\"+id).find(\"span\").text( \"L:\" + x + \", T:\" + y + \", W:\" + w + \", H:\" + h);\n}", "title": "" }, { "docid": "99753b4f5de5128d9855c4083b58acf3", "score": "0.63149726", "text": "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "title": "" }, { "docid": "99753b4f5de5128d9855c4083b58acf3", "score": "0.63149726", "text": "function Position(left, top) {\n this.left = left;\n this.top = top;\n}", "title": "" }, { "docid": "658b84bef7a0d6086cb779b15ec5dc37", "score": "0.6303653", "text": "function getPosition(e){\n\tvar left = 0;\n\tvar top = 0;\n\n\twhile (e.offsetParent){\n\t\tleft += e.offsetLeft;\n\t\ttop += e.offsetTop;\n\t\te = e.offsetParent;\n\t}\n\n\tleft += e.offsetLeft;\n\ttop += e.offsetTop;\n\n\treturn {x:left, y:top};\n}", "title": "" }, { "docid": "c492ea8c1b6ac405617cacc3b7f78fce", "score": "0.63011014", "text": "getPosition() {\n return this.position;\n }", "title": "" }, { "docid": "33855721e4dee8f223efe9ec50c2efa5", "score": "0.6284344", "text": "calculatePosition() {\n\t\t\n\t\tconst vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)\n\t\tconst vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)\n\t\tlet adjustRight,adjustBottom = false\n\t\tif ((this.props.pos.x + BoxWidth + 40) > vw) {\n\t\t\tadjustRight = true\n\t\t}\n\t\tif ((this.props.pos.y - BoxHeight - yOffset - 40) > vh) {\n\t\t\tadjustBottom = true\n\t\t}\n\t\tconst leftPos = adjustRight ? this.props.pos.x - BoxWidth - xOffset : this.props.pos.x + xOffset\n\t\tconst bottomPos = adjustBottom ? this.props.pos.y - BoxHeight: this.props.pos.y - yOffset\n\t\treturn {\n\t\t\tleft: leftPos + \"px\",\n\t\t\ttop : bottomPos + \"px\"\n\t\t}\n\n\t}", "title": "" }, { "docid": "c456dbd291caa6422ff77c71715d2632", "score": "0.6269194", "text": "function getPosition(e) {\n\n //this section is from http://www.quirksmode.org/js/events_properties.html\n var targ;\n if (!e)\n e = window.event;\n if (e.target)\n targ = e.target;\n else if (e.srcElement)\n targ = e.srcElement;\n if (targ.nodeType == 3) // defeat Safari bug\n targ = targ.parentNode;\n\n // jQuery normalizes the pageX and pageY\n // pageX,Y are the mouse positions relative to the document\n // offset() returns the position of the element relative to the document\n var x = e.pageX - $(targ).offset().left;\n var y = e.pageY - $(targ).offset().top;\n\n player.x = x;\n\tplayer.y = y;\n}", "title": "" }, { "docid": "27e896c8c814e0f14105db793cf4e3cf", "score": "0.6264829", "text": "set position(p) {\n const info = this.shadowRoot.querySelector('.info')\n this._position = p\n info.style.left = `${p[0]}px`\n info.style.top = `${p[1]}px`\n }", "title": "" }, { "docid": "b81748da98608e6358aa7d3ab468cc10", "score": "0.62636894", "text": "getPosition() {\n return [this.positionY, this.positionX];\n }", "title": "" }, { "docid": "c52963912e140ac338f5f46e670b3781", "score": "0.62602353", "text": "startPosition() {\n this.x = 505;\n this.y = 606;\n }", "title": "" }, { "docid": "a0ff648808684e295e42d5079a0662a7", "score": "0.62549555", "text": "function locToPos(loc) {\n\n }", "title": "" }, { "docid": "e701d00ffaa8f293924a4cf14f154bbc", "score": "0.62501454", "text": "pos() {\n return this.native.pos();\n }", "title": "" }, { "docid": "e701d00ffaa8f293924a4cf14f154bbc", "score": "0.62501454", "text": "pos() {\n return this.native.pos();\n }", "title": "" }, { "docid": "e701d00ffaa8f293924a4cf14f154bbc", "score": "0.62501454", "text": "pos() {\n return this.native.pos();\n }", "title": "" }, { "docid": "e701d00ffaa8f293924a4cf14f154bbc", "score": "0.62501454", "text": "pos() {\n return this.native.pos();\n }", "title": "" }, { "docid": "81b4818897140fb35ba2b1fe79d965eb", "score": "0.6249766", "text": "getPosition () {\n var xy = this.$element.offset();\n var z = this.$element.css('z-index');\n z = z ? parseInt(z) : undefined;\n return [xy.left, xy.top, z];\n }", "title": "" }, { "docid": "a30383bb0ee643ff175aad13a792c50d", "score": "0.6240182", "text": "function savePosition(position) {\n user_location = position\n}", "title": "" }, { "docid": "eedba9d46c1e9e1909a71d64c6a5bf98", "score": "0.62360334", "text": "set pos( v ){ this._pos.set( v ); }", "title": "" }, { "docid": "08c386f43cf023f5987ec86fad920009", "score": "0.62343824", "text": "function setPosition(e) {\n\t\t pos.x = e.offsetX;\n\t\t pos.y = e.offsetY;\n\t\t}", "title": "" }, { "docid": "6f57d8c8ab7cfd0394dfc2fb40dfac27", "score": "0.62292004", "text": "updatePosition() {\n let position = this.position.clone();\n\n var coords2d = this.get2DCoords(position, this.camera);\n this.element.style.left = coords2d.x + \"px\";\n this.element.style.top = coords2d.y + \"px\";\n }", "title": "" }, { "docid": "4e285a879fe9eca3a8328150ad1d559f", "score": "0.62271297", "text": "place() {\n if (this.position === null) this.position = {};\n let xDiv = Math.floor(this.dims.x) - 1;\n let yDiv = Math.floor(this.dims.y) - 1;\n this.position.x = this.randBetween(this.padding, xDiv - this.padding);\n this.position.y = this.randBetween(this.padding, yDiv - this.padding);\n }", "title": "" }, { "docid": "8d234b302e4dea3b2000419dd7c293f8", "score": "0.62261045", "text": "storePosition() {\n this.bestPosition = this.position.slice(0);\n }", "title": "" }, { "docid": "ad2ed8e226103d4308ebbf3c836f3b93", "score": "0.6218584", "text": "function ruulStartPosition() {\n\t\t//get width and height of viewport\n\t\truulBrowser();\n\t\t//console.log(\"Start position is \" + localStorage.getItem(currentRuul + 'x') + \"X \" + localStorage.getItem(currentRuul + 'y') + \"Y\");\n\t\t//console.log(\"Page size is \" + ruulBrowserWidth + \"X \" + ruulBrowserHeight + \"Y\");\n\t\t//console.log(\"Browser size is \" + ruulBrowserWidthScreen + \"X \" + ruulBrowserHeightScreen + \"Y\");\n\t\t//console.log(\"H(1) or V(2) = \" + localStorage.getItem(currentRuul + 'rotate'));\n\t\t//console.log(\"Closed(1) or Open(2) = \" + localStorage.getItem(currentRuul + 'openruul'));\n\t\t// console position saved on local storage\n\t\tvar storedX = localStorage.getItem(currentRuul + 'x') || 50;\n\t\tvar storedY = localStorage.getItem(currentRuul + 'y') || 50;\n\n\t\t$(target).css('top', storedX + 'px');\n\t\t$(target).css('left', storedY + 'px');\n\n\t\tif (localStorage.getItem(currentRuul + 'rotate') == 2) {\n\t\t\t//Make ruul vertical\n\t\t\truulRotate = 2;\n\t\t} else {\n\t\t\truulRotate = 1;\n\t\t}\n\t\tif (localStorage.getItem(currentRuul + 'openruul') == 2) {\n\t\t\t//Make ruul open\n\t\t\truulTextDropOpen = 2;\n\t\t} else {\n\t\t\truulTextDropOpen = 1;\n\t\t}\n\t\truulDefineStart();\n\t\truulDataSave();\n\t}", "title": "" }, { "docid": "dc9b491e8d96fbaffb8c073010781772", "score": "0.6217702", "text": "getPosition() {\n return this.position;\n }", "title": "" }, { "docid": "6ef01bf0edd4b0280e03f55c48584c7f", "score": "0.620946", "text": "function storePosition(position) {\n latitude= position.coords.latitude;\n longitude= position.coords.longitude;\n console.log(latitude);\n console.log(longitude);\n}", "title": "" }, { "docid": "f535d7b61214675375b32a0d8a905444", "score": "0.62046874", "text": "function storeFleetPosition() { ///html/body/div[2]/div[2]/div/table/tbody/tr/td[2]\n var node = getElementByXPath(\"/html/body/div[2]/div[2]/div/table/tbody/tr/td[2]\");\n var position = node.firstChild.textContent;\n setProperty(PROPERTY_FLEET_POSITION, position, this);\n}", "title": "" }, { "docid": "bcb38dc8719554a90715a19b355166ed", "score": "0.619499", "text": "function getAddress(pos) {\n return (pos.x + pos.y * cx.canvas.width) * 4;\n }", "title": "" }, { "docid": "7851aa2061d5f53b04f6fec5cb2be334", "score": "0.61944455", "text": "function getPosition(e) {\n\t\tvar targ;\n\t\tif (!e)\n\t\t\te = window.event;\n\t\tif (e.target)\n\t\t\ttarg = e.target;\n\t\telse if (e.srcElement)\n\t\t\ttarg = e.srcElement;\n\t\tif (targ.nodeType == 3) \n\t\t\ttarg = targ.parentNode;\n\t\tvar x = e.pageX - $(targ).offset().left;\n\t\tvar y = e.pageY - $(targ).offset().top;\n\n\t\treturn {\"x\": x, \"y\": y};\n\t}", "title": "" }, { "docid": "62a726ef60b2d39a7bd2898bac87ff90", "score": "0.6189056", "text": "setPosition(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "title": "" }, { "docid": "ba8553c60b293739a7f4a68d6eee25ce", "score": "0.61877847", "text": "function fruitPosition() {\n let fruit=generateCoordinates();\n fruitX=fruit.xCoordinate;\n fruitY=fruit.yCoordinate;\n}", "title": "" }, { "docid": "9acc5e72c762bbf7d9cebffb76f467f7", "score": "0.6183952", "text": "function getPos(element) {\n const de = document.documentElement;\n const box = element.getBoundingClientRect();\n const top = box.top + window.pageYOffset - de.clientTop;\n const left = box.left + window.pageXOffset - de.clientLeft;\n return { top, left };\n }", "title": "" }, { "docid": "0c481f98e0d8227519302d65cc694895", "score": "0.6183462", "text": "function js_store_window_position() {\n \n window_position = $(window).scrollTop();\n\n\n}", "title": "" }, { "docid": "e331fdb61fc44110d4e6b857df7ebd41", "score": "0.61711574", "text": "function setPosition(position) { \n console.log(\"current longitude: \" + position.coords.longitude);\n console.log(\"current latitude : \" + position.coords.latitude);\n oxfordPosition[0] = position.coords.longitude + 0.00005;\n oxfordPosition[1] = position.coords.latitude + 0.0003;\n}", "title": "" }, { "docid": "b1152ab1e31538b44d7e063fd3e809df", "score": "0.6157158", "text": "function CachedItemPosition() { }", "title": "" }, { "docid": "b1152ab1e31538b44d7e063fd3e809df", "score": "0.6157158", "text": "function CachedItemPosition() { }", "title": "" }, { "docid": "50eae39058cd93167928b21d87f73c80", "score": "0.61535865", "text": "function setPosition(e) {\n pos.x = e.clientX-7;\n // pos.x = e.clientX;\n pos.y = e.clientY-42;\n // pos.y = e.clientY;\n}", "title": "" }, { "docid": "4d63cf8809b6615856947275c189dcb1", "score": "0.61529267", "text": "function showPosition(event) {\n\tsx.value = event.screenX; \n\t\t// update element with screen X\n\tsy.value = event.screenY; \n\t\t// update element with screen Y\n\tpx.value = event.pageX; \n\tpy.value = event.pageY;\n\tcx.value = event.clientX; \n\tcy.value = event.clientY;\n}", "title": "" }, { "docid": "367b4e6a87b4663974075706cdf62e41", "score": "0.61528295", "text": "getPosition() {\r\n return this.mPosition;\r\n }", "title": "" }, { "docid": "a2ea985132fca9d313373adad61eadae", "score": "0.61484885", "text": "function getPos(el) {\n var rect = el.getBoundingClientRect();\n return { x:rect.left, y:rect.top };\n }", "title": "" }, { "docid": "840da3f7f1861d2051f98bee75f45168", "score": "0.61407655", "text": "function event(){\n\t\tgraph.on('change:position', function(eventName, cell) {\n\t\t\tvar positionJ = {};\n\t\t\tvar posElt;\n\n\t\t\tif(arguments != null){\n\t\t\t\tif(arguments[0].attributes != undefined || arguments[0].attributes != null){\n\n\t\t\t\t\t$(\"*[model-id]\").each(function(id, ide) {\n\n\t\t\t\t\t\tvar i = \"#j_\" + id;\n\t\t\t\t\t\tvar position = $(ide).offset();\n\t\t\t\t\t\tif(arguments[0].id == $(ide).attr('model-id') ){\n\n\t\t\t\t\t\t\tposElt = {\n\t\t\t\t\t\t\t\t\t'left': arguments[0].attributes.position.x,\n\t\t\t\t\t\t\t\t\t'top': arguments[0].attributes.position.y,\n\t\t\t\t\t\t\t\t\t'element': $(ide).attr('model-id')\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\tposElt = {\n\t\t\t\t\t\t\t\t\t'left': position.left,\n\t\t\t\t\t\t\t\t\t'top': position.top,\n\t\t\t\t\t\t\t\t\t'element': $(ide).attr('model-id')\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpositionJ[i] = posElt;\n\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t}\n\n\n\n\t\t\tsetLocalStorage(positionJ);\n\t\t\tgetLocalStorage();\n\t\t\tgetCookie()\n\t\t});\n\t}", "title": "" }, { "docid": "e35d44010058f5f49801b1045ea98dac", "score": "0.6131105", "text": "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "title": "" }, { "docid": "fcaa1a82f0fed68189e8811281d8027b", "score": "0.6126145", "text": "function showPosition(event) { // Declara a função\n sx.value = event.screenX; // Atualiza elemento com screenX\n sy.value = event.screenY; // Atualiza elemento com screenY\n px.value = event.pageX; // Atualiza elemento com pageX\n py.value = event.pageY; // Atualiza elemento com pageY\n cx.value = event.clientX; // Atualiza elemento com clientX\n cy.value = event.clientY; // Atualiza elemnto com clientY\n}", "title": "" }, { "docid": "0a6f64275fe97c54cc2b3e0ec98b1850", "score": "0.6113372", "text": "function getPosition(element) {\n return element.position().top;\n }", "title": "" }, { "docid": "de0d99e10e9959e5af54c1c59d0a22f5", "score": "0.6113196", "text": "function pos(el) {\n var o = {\n x: el.offsetLeft,\n y: el.offsetTop\n };\n while (el = el.offsetParent) o.x += el.offsetLeft, o.y += el.offsetTop;\n return o;\n }", "title": "" }, { "docid": "dbc2ae0ab194839f77b812c1c1757208", "score": "0.611245", "text": "function position() {\n this.style(\"left\", function(d) { return d.x + \"px\"; })\n .style(\"top\", function(d) { return d.y + \"px\"; })\n .style(\"width\", function(d) { return Math.max(0, d.dx - 1) + \"px\"; })\n .style(\"height\", function(d) { return Math.max(0, d.dy - 1) + \"px\"; });\n}", "title": "" }, { "docid": "5fa0bfdf6d1259f976ae5ed4e83a9653", "score": "0.61116475", "text": "static toPosition(array) {\n return {\n left: array[0],\n top: array[1],\n width: array[2],\n height: array[3]\n };\n }", "title": "" }, { "docid": "6e8e6e3963ce75b986cf0a45af4f85f3", "score": "0.6107054", "text": "function position() {\n\t\t\tthis.style(\"left\", function (d) {\n\t\t\t\treturn d.x + \"px\";\n\t\t\t}).style(\"top\", function (d) {\n\t\t\t\treturn d.y + \"px\";\n\t\t\t}).style(\"width\", function (d) {\n\t\t\t\treturn Math.max(0, d.dx - 1) + \"px\";\n\t\t\t}).style(\"height\", function (d) {\n\t\t\t\treturn Math.max(0, d.dy - 1) + \"px\";\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "90d8c724bc2c449ae34e6c8273b064df", "score": "0.6105486", "text": "moveTo(position) {\n this.pos = position;\n }", "title": "" }, { "docid": "09c2dc7901cdb574c3e225d08556a315", "score": "0.61054546", "text": "getScenePosition() {\n\t\t\treturn {\n\t\t\t\tx: this.x + .5 - gridWidth / 2,\n\t\t\t\tz: this.z + .5 - gridWidth / 2\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "59fb57c681556b6e9dbb4d8ca8768d67", "score": "0.61042887", "text": "function getElementAbsPosition(element) {\n\tvar matrix = element.getScreenCTM()\n .translate(+element.getAttribute(\"cx\"),\n +element.getAttribute(\"cy\"));\n return {'x': window.pageXOffset + matrix.e,\n \t'y': window.pageYOffset + matrix.f}\n}", "title": "" }, { "docid": "877ac47fe1681652b59d0ca60423e987", "score": "0.61013263", "text": "function setPosition(e) {\n pos.x = e.clientX;\n pos.y = e.clientY;\n}", "title": "" }, { "docid": "1bec1eee97156f1a9be2e427ab08b479", "score": "0.6101185", "text": "getPosition() {\n return this.position.slice(0);\n }", "title": "" }, { "docid": "be8b1faae4dafc1bac48902c236f5c85", "score": "0.60977656", "text": "updatePosition(position) {\n this.positionX = position[1];\n this.positionY = position[0];\n this.updateRealPosition();\n }", "title": "" }, { "docid": "89dc48809e5256d57b750fb3aab67464", "score": "0.6091752", "text": "function getViewPosition(state) {\r\n\treturn {\r\n\t\tx: -state.data.position.x + state.data.containerRect.width / 2,\r\n\t\ty: -state.data.position.y,\r\n\t}\r\n}", "title": "" }, { "docid": "0045eee0d4158d078a8a8fc378857c89", "score": "0.60847276", "text": "function position(){\n if(sphere.position.z>-98){ // replace with avatar\n return 5;\n } else if(sphere.position.z<-98 && sphere.position.z>-215){ // replace with avatar\n return -200;\n } else if(sphere.position.z<-215 && !controls.plat && sphere.position.z>-799){ // replace with avatar\n return -75;\n } else if(controls.plat){\n controls.plat = false;\n return pos.y + 5;\n } else if(sphere.position.z<-800){\n return 85;\n }\n }", "title": "" }, { "docid": "9e1149c8ccfd6948b17ec27bcbd02a8b", "score": "0.60844266", "text": "function Position (x, y) {\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "d139c8ee09f420d3d7196f186e9f66c1", "score": "0.608256", "text": "getPosition(event) {\n this.coordinates.x = event.clientX - canvas.offsetLeft;\n this.coordinates.y = event.clientY - canvas.offsetTop;\n }", "title": "" } ]
3037441677abd1df6ae82b4e9005c3ac
===================================================================================== Eleventh Program = dayofweek / Day of week Purpose : It is used to calculate the respective day from our given input. that is depends on given day ,month and year.
[ { "docid": "61a07c0f94768343f987c8f39a6351be", "score": "0.7286426", "text": "dayOfWeek(d, m, y) {\n try {\n\n var y0 = y - Math.floor((14 - m) / 12);\n var x = y0 + Math.floor((y0 / 4)) - Math.floor((y0 / 100)) + Math.floor((y0 / 400));\n m0 = m + 12 * Math.floor((14 - m) / 12) - 2;\n var d0 = (d + x + Math.floor((31 * m0) / 12)) % 7;\n return d0;\n } catch (error) {\n console.log(error.message);\n }\n }", "title": "" } ]
[ { "docid": "859426fbdb1d97e7a5d4c24caf9078fd", "score": "0.73797244", "text": "function getDayOfTheWeek(year=USERCONST[0], month=USERCONST[1], day=USERCONST[2]){\n\n // Length of characters from user input date question\n var lenOfData = USERCONST[3];\n\n // Last 2 digits of year from user input date quetsion\n var endingofyear = USERCONST[4].substring(lenOfData-2);\n\n // Algorithm \n var twelveinyear = parseInt(endingofyear/12);\n var remainder = endingofyear-(twelveinyear*12)\n var intofour = parseInt(remainder/4);\n var userday = day;\n\n // Identify month by using first 3 letters of user input\n var firstthreeletters = month.toLowerCase();\n var useryear = year;\n\n //Month using algorithm offset\n var ourMonth = new Array(12);\n ourMonth[\"jan\"] = 1;\n ourMonth[\"feb\"] = 4;\n ourMonth[\"mar\"] = 4;\n ourMonth[\"apr\"] = 0;\n ourMonth[\"may\"] = 2;\n ourMonth[\"jun\"] = 5;\n ourMonth[\"jul\"] = 0;\n ourMonth[\"aug\"] = 3;\n ourMonth[\"sep\"] = 6;\n ourMonth[\"oct\"] = 1;\n ourMonth[\"nov\"] = 4;\n ourMonth[\"dec\"] = 6;\n\n var monthCode = ourMonth[firstthreeletters];\n\n // Define leapyear to 0\n var leapyear = 0;\n\n //Leap year function\n if(useryear%4 !=0) {\n leapyear =0;\n } else if(useryear%100 !=0) {\n leapyear =1;\n } else if(useryear%400 !=0) {\n leapyear =0;\n } else {\n leapyear =1;\n }\n\n\n //Using leap year function\n if(leapyear == 1) {\n if (firstthreeletters == \"jan\") {\n monthCode = monthCode-1; \n } else if (firstthreeletters == \"feb\") {\n monthCode = monthCode-1;\n }\n }\n\n //Adding the offset here, 4 digit year code is selected using substring and offest is added. We take the first two digits of the year (ex: 1955->19) \n var yearadjust = useryear.substring(0,2)\n\n // Adjusting year using algorithm based on first two digits of year input by user\n if(yearadjust == 16) {\n monthCode = monthCode+6;\n } else if(yearadjust == 17) {\n monthCode = monthCode+4;\n } else if(yearadjust == 18) {\n monthCode = monthCode+2;\n } else if(yearadjust == 20) {\n monthCode = monthCode+6;\n }else if(yearadjust ==21) {\n monthCode = monthCode+4;\n }\n\n // Totals for year adjustment algorithm\n var totals = parseInt(twelveinyear) + parseInt(remainder) + parseInt(intofour) + parseInt(userday) + parseInt(monthCode);\n\n\n var dayindex = (totals%7);\n\n var dayweeknumber = new Array(7)\n dayweeknumber[0] = \"saturday\";\n dayweeknumber[1] = \"sunday\";\n dayweeknumber[2] = \"monday\";\n dayweeknumber[3] = \"tuesday\";\n dayweeknumber[4] = \"wednesday\";\n dayweeknumber[5] = \"thursday\";\n dayweeknumber[6] = \"friday\";\n\n var dayofweek = dayweeknumber[dayindex];\n\n return [useryear, leapyear, dayofweek];\n\n}", "title": "" }, { "docid": "39348ab3b1b12d53d0ed22c925e594c5", "score": "0.73574126", "text": "function weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n } // -- LOCAL TIME --", "title": "" }, { "docid": "39348ab3b1b12d53d0ed22c925e594c5", "score": "0.73574126", "text": "function weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n } // -- LOCAL TIME --", "title": "" }, { "docid": "187648e585d90ba2b18251f92b5f226e", "score": "0.7283904", "text": "function weekday(week, day, firstDay) {\n return day + week * 7 - (firstDay + 6) % 7;\n} // -- LOCAL TIME --", "title": "" }, { "docid": "fbd4e562f78913434d15872f0ccef508", "score": "0.72591174", "text": "function dayOfWeek(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) {\n\n}", "title": "" }, { "docid": "f6d9cedbfb48d2a7cd5d6b981c8523ee", "score": "0.70944023", "text": "function getWeekDay(mth,day,yr)\n\t{\n\tfirst_day = firstDayOfYear(yr);\n\tfor (num = 0; num < mth; num++) { first_day += numDaysIn(num,yr); }\n\tfirst_day += day-1;\n\treturn first_day%7;\n\t}", "title": "" }, { "docid": "f6479e753dfc12c472348be524dd0070", "score": "0.7069745", "text": "function challenge7(){\n \nvar today = new Date()\nvar dayOfWeek = today.getDay();\n \n \n \n//your code goes here. \n \n \n\n}", "title": "" }, { "docid": "f139fbc86972a30bc84795b984de0367", "score": "0.70394856", "text": "findDay(day,month,year)\n {\n var i;\n var x;\n var y;\n var y = year - Math.floor ((14 - month) / 12);\n var x = y + Math.floor((y/4))- Math.floor ((y/100)) + Math.floor ((y/400));\n var m = month + 12*Math.floor(((14 - month) / 12)) - 2;\n var day = (day + x + Math.floor((31*m) / 12)) % 7;\n\n //console.log(day)\n return day;\n /*\n i=day;\n switch(i)\n {\n case 1: return(\"Monday\");\n case 2:return(\"Tuesday\");\n case 3:return(\"Wednesday\");\n case 4:return(\"Thrusday\");\n case 5:return(\"Friday\");\n case 6:return(\"Saturday\");\n case 7:return(\"Sunday\");\n case 8:return(\"Monday\");\n case 9:return(\"Tuesday\");\n case 0:return(\"Sunday\");\n }\n */ \n }", "title": "" }, { "docid": "6b8a5cf351512aa516ae0674872a0328", "score": "0.7003561", "text": "function day(userInput) {\n var splitedUserInput = userInput.split(\" \");\n var a = splitedUserInput[0]*1;\n var b = splitedUserInput[1]*1;\n var convertedDay = 0;\n\n for(i=1; i<a; i++){\n if (i === 1 || i === 3 || i === 5 || i === 7 || i === 8 || i === 10 || i === 12){\n convertedDay += 31; \n }\n else if (i === 4 || i === 6 || i === 9 || i === 11){\n convertedDay += 30\n }\n else if (i === 2){\n convertedDay += 28\n }\n }\n convertedDay += b;\n var remainder = convertedDay % 7;\n\n if(remainder === 1){\n return \"MON\";\n }\n if(remainder === 2){\n return \"TUE\";\n }\n if(remainder === 3){\n return \"WED\";\n }\n if(remainder === 4){\n return \"THU\";\n }\n if(remainder === 5){\n return \"FRI\";\n }\n if(remainder === 6){\n return \"SAT\";\n }\n if(remainder === 0){\n return \"SUN\";\n }\n}", "title": "" }, { "docid": "860a86012880110e9aa136f7b941109e", "score": "0.70034015", "text": "dayOfWeek(d, m, y, ) {\n var y0 = y - Math.floor((14 - m) / 12);\n var x = y0 + Math.floor(y0 / 4) - Math.floor(y0 / 100) + Math.floor(y0 / 400);\n var m0 = m + 12 * Math.floor(Math.floor(14 - m) / 12) - 2;\n var d0 = (d + x + Math.floor(31 * m0 / 12)) % 7;\n d0 = parseInt(d0);\n\n switch (d0) {\n\n case 0:\n console.log(\"Sunday\");\n break;\n case 1:\n console.log(\"Monday\");\n break;\n case 2:\n console.log(\"Thuesday\");\n break;\n case 3:\n console.log(\"Wednesday\");\n break;\n case 4:\n console.log(\"Thursday\");\n break;\n case 5:\n console.log(\"Friday\");\n break;\n case 6:\n console.log(\"Saturday\");\n break;\n\n\n }\n }", "title": "" }, { "docid": "57f01ed1423663a0a24564bc2b405dc9", "score": "0.695155", "text": "dayofWeek(date, month, year) {\n try {\n if (!isNaN(date, month, year) && (0 < date && date < 32) && (0 < month && month < 13) && (999 < year && year < 10000)) {\n var y0 = year - Math.trunc((14 - month) / 12);\n var x = y0 + Math.trunc(y0 / 4) - Math.trunc(y0 / 100) + Math.trunc(y0 / 400);\n var m0 = month + 12 * Math.trunc((14 - month) / 12) - 2;\n var d0 = (date + x + Math.trunc(31 * m0 / 12)) % 7;\n /**\n * Switch case takes the calculated value by using formula and finds out the day of week.\n * \n */\n switch (d0) {\n case 0: return \"Sunday\";\n case 1: return \"Monday\";\n case 2: return \"Tuesday\";\n case 3: return \"Wednesday\";\n case 4: return \"Thursday\";\n case 5: return \"Friday\";\n case 6: return \"Saturday\";\n }\n }\n else {\n return \"Please enter the valid date month year\";\n\n }\n\n\n } catch (error) {\n console.log(error.message);\n\n }\n }", "title": "" }, { "docid": "2a78a2692298412be828c3052cc557ab", "score": "0.6938286", "text": "function determineDayOfWeek(month, day, year) {\n var yearLastTwo = ((year%10)) + (Math.trunc(year/10)%10)*10;\n var yearFirstTwo = Math.trunc(year/100);\n console.log (yearLastTwo);\n console.log (yearFirstTwo);\n var newMonth = 0;\n newMonth = month - 2;\n if (newMonth <= 0) {\n newMonth = newMonth + 12;\n }\n if (month === 1 || month === 2) {\n yearLastTwo = yearLastTwo - 1;\n }\n var end = (day + Math.floor(2.6*newMonth - 0.2) - 2*yearFirstTwo + yearLastTwo + Math.floor(yearLastTwo / 4) + Math.floor(yearFirstTwo / 4))%7\n return end;\n}", "title": "" }, { "docid": "e0d1ccbb5948a5fe043589f034e9ab0c", "score": "0.6918425", "text": "function Date(num, weekday){\n\n}", "title": "" }, { "docid": "11279839198b78d50e5d9d397c81ff3a", "score": "0.69075024", "text": "function forecastDay(number) {\r\nlet day = now.getDay()\r\n\r\n if ( day + number + 1 <= 6) {\r\n return (day + number + 1)\r\n} else if (day + number + 1 > 6) {\r\n return (day + number - 6)\r\n}\r\n}", "title": "" }, { "docid": "d97ec56e09748645c713b37244609def", "score": "0.6862172", "text": "function calcDayOfWeek(juld)\n\n\t{\n\n\t\tvar A = (juld + 1.5) % 7;\n\n\t\tvar DOW = (A==0)?\"Sunday\":(A==1)?\"Monday\":(A==2)?\"Tuesday\":(A==3)?\"Wednesday\":(A==4)?\"Thursday\":(A==5)?\"Friday\":\"Saturday\";\n\n\t\treturn DOW;\n\n\t}", "title": "" }, { "docid": "67e5087d8c36507b3d7a0270c3bb88d8", "score": "0.6751323", "text": "function getDayFromWeek(day, weekNumber) {\r\n\r\n weekRange = getDateRangeOfWeek(weekNumber);//range della settimana con n°=weekNumber\r\n\r\n var index = weekRange.indexOf('/');\r\n var mounth = weekRange.substring(0, index);\r\n mounth = parseInt(mounth);//trovo il mese\r\n\r\n var resto = weekRange.substring(index + 1, weekRange.length);\r\n index = weekRange.indexOf('/');\r\n resto = weekRange.substring(index + 1, weekRange.length);\r\n index = weekRange.indexOf('/');\r\n dayOne = resto.substring(0, index); \r\n dayOne = parseInt(dayOne); //primo giorno della settimana weekRange (lunedi)\r\n\r\n\r\n if (day == 1) //se il giorno è 1 allora restituisco dayOne, il primo giorno di weekRange (lunedi)\r\n return dayOne;\r\n if (dayOne == 30) {//se il primo giorno di weekRange e' 30 devo controllare il mese\r\n if ((mounth == 4 || mounth == 6 || mounth == 9 || mounth == 11)) { //MESI CON 30 GIORNI\r\n if (day == 2) //martedi\r\n return 2;\r\n if (day == 3) //mercoledi\r\n return 3;\r\n if (day == 4) //giovedi\r\n return 4;\r\n if (day == 5) //venerdi\r\n return 5;\r\n if (day == 6) //sabato\r\n return 6;\r\n if (day == 7) //domenica\r\n return 7;\r\n } else {//MESI CON 31 GIORNI\r\n if (day == 2) //martedi\r\n return 31;\r\n if (day == 3) //mercoledi\r\n return 1;\r\n if (day == 4) //giovedi\r\n return 2;\r\n if (day == 5) //venerdi\r\n return 3;\r\n if (day == 6) //sabato\r\n return 4;\r\n if (day == 7) //domenica\r\n return 5;\r\n }\r\n }\r\n else {\r\n if (day == 2) //martedi\r\n return dayOne + 1;\r\n if (day == 3) //mercoledi\r\n return dayOne + 2;\r\n if (day == 4) //giovedi\r\n return dayOne + 3;\r\n if (day == 5) //venerdi\r\n return dayOne + 4;\r\n if (day == 6) //sabato\r\n return dayOne + 5;\r\n if (day == 7) //domenica\r\n return dayOne + 6;\r\n }\r\n\r\n}", "title": "" }, { "docid": "9820f6ab5a41dab5c2e016da3aec2071", "score": "0.6680671", "text": "function dayOfWeek( julian ){\n\n\treturn (julian+1)%7;\n\n}", "title": "" }, { "docid": "a553f82a4f66c5511389eb10ad1392a0", "score": "0.6621365", "text": "function whatDayIsIt(){\n var d = new Date();\n var n = d.getDay();\n var weekDay = new Array(7);\n var weekday = new Array(7);\nweekday[0] = \"Sunday\";\nweekday[1] = \"Monday\";\nweekday[2] = \"Tuesday\";\nweekday[3] = \"Wednesday\";\nweekday[4] = \"Thursday\";\nweekday[5] = \"Friday\";\nweekday[6] = \"Saturday\";\n \n return weekday[n];\n\n }", "title": "" }, { "docid": "2d8c272e8847c95e8a926fd557ede850", "score": "0.66059494", "text": "function getDayofDate(day) {\n if (day > 6) day = day % 6 - 1;\n if (day == 1 || day == 2 || day == 3 | day == 4) return \"Monday to Thursday\";\n else if (day == 5) return \"Friday\";\n else if (day == 6) return \"Saturday\";\n else return \"Sunday\";\n}", "title": "" }, { "docid": "dfe5595d483a8cc996a6e9f27f26deda", "score": "0.6572865", "text": "function easterSunday (InputYear) {\n var a = InputYear % 19;\n var b = Math.floor(InputYear/100);\n var c = InputYear % 100;\n var d = Math.floor(b/4);\n var e = b % 4;\n var f = Math.floor((b+8)/25); \n var g = Math.floor((b-f+1)/3);\n var h = (19*a+b-d-g+15) % 30; \n var i = Math.floor(c/4);\n var k = c % 4;\n var l = (32 + 2*e + 2* i - h - k) % 7;\n var m = Math.floor((a+11*h+22*l)/451);\n var n = Math.floor((h+l-7*m+114)/31);\n var p = (h+l-7*m+114) % 31;\n p++;\n var t = p - 7;\n \n if (t < 1) {\n n--;\n p = 31 + t;\n }else{\n p -= 7;\n }\n \n var answer = new Array(p, n);\n\n return answer;\n }", "title": "" }, { "docid": "e4ab098267eea1090bc763260bbaf60f", "score": "0.6567516", "text": "function calculateStartDay( year, month ){\n return 6;\n}", "title": "" }, { "docid": "35c7c0c774886b23a671758a184b1228", "score": "0.65256774", "text": "function weekDayName3(weekdayNum, leapYearCount){\n\n var rem = (weekdayNum - leapYearCount) % 7;\n\n switch(rem) {\n case 0:\n return \"Saturday\";\n case 1:\n return \"Sunday\";\n case 2:\n return \"Monday\";\n case 3:\n return \"Tuesday\";\n case 4:\n return \"Wednesday\";\n case 5:\n return \"Thursday\";\n case 6:\n return \"Friday\";\n }\n}", "title": "" }, { "docid": "cba35df5e2b12c3b6d6c7313e44fd601", "score": "0.64942235", "text": "function getSleepHours(day){\r\n //normalizing user input\r\n day=day.toLowerCase();\r\n\r\n if (day === 'monday') {\r\n return 8;\r\n } else if (day === 'tuesday') {\r\n return 7;\r\n } else if (day === 'wednesday') {\r\n return 8;\r\n } else if(day === 'thursday') {\r\n return 5;\r\n } else if (day === 'friday') {\r\n return 4;\r\n } else if (day === 'saturday') {\r\n return 6;\r\n } else if (day === 'sunday') {\r\n return 6;\r\n } \r\n \r\n}", "title": "" }, { "docid": "44a99279f4e300d6ee15d4ac9964c413", "score": "0.64875174", "text": "function toDay(f){\n return (5/9 ) * (f - 32);\n}", "title": "" }, { "docid": "c504000263ecf618ed5250b74eedd3d7", "score": "0.6455156", "text": "function weekday() {\n if (doomsdayNumber === 0) {\n return \"Saturday\";\n } else if (doomsdayNumber === 1) {\n return \"Sunday\";\n } else if (doomsdayNumber === 2) {\n return \"Monday\";\n } else if (doomsdayNumber === 3) {\n return \"Tuesday\";\n } else if (doomsdayNumber === 4) {\n return \"Wednesday\";\n } else if (doomsdayNumber === 5) {\n return \"Thursday\";\n } else {\n return \"Friday\";\n }\n}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "38a51e0f5a02e3ae5c5745d0611ddc98", "score": "0.6454981", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "f446c00ab60cc26fcab9f4f8991fa77e", "score": "0.6454231", "text": "function doomsday() {\n let shortYear = year.toString().substr(-2);\n shortYear = parseInt(shortYear);\n if (shortYear % 2 != 0) {\n shortYear += 11;\n }\n shortYear /= 2;\n if (shortYear % 2 != 0) {\n shortYear += 11;\n }\n shortYear = Math.abs((shortYear % 7) - 7);\n if (1800 <= year && year < 1900) {\n shortYear += 6;\n } else if (1900 <= year && year < 2000) {\n shortYear += 4;\n } else if (2000 <= year && year < 2100) {\n shortYear += 3;\n } else {\n shortYear += 1;\n }\n shortYear = shortYear % 7;\n return shortYear;\n}", "title": "" }, { "docid": "08192e364df1786f51616791b78ba10a", "score": "0.6453421", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;g<7;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "08192e364df1786f51616791b78ba10a", "score": "0.6453421", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;g<7;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "c725926bf6313d8724a2fe5e09616c41", "score": "0.64475507", "text": "function Oc(a,b,c,d){\"boolean\"==typeof a?(\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,\"number\"==typeof b&&(c=b,b=void 0),b=b||\"\");var e=ab(),f=a?e._week.dow:0;if(null!=c)return Mc(b,(c+f)%7,d,\"day\");var g,h=[];for(g=0;7>g;g++)h[g]=Mc(b,(g+f)%7,d,\"day\");return h}", "title": "" }, { "docid": "925152c7fe3e7bf69b1be0c847c30fb0", "score": "0.64441115", "text": "function runDateSwitch(weekDay) {\n var day;\n\n switch (weekDay) {\n case 0: day = \"Sun\";\n break;\n case 1: day = \"Mon\";\n break;\n case 2: day = \"Tues\";\n break;\n case 3: day = \"Wed\";\n break;\n case 4: day = \"Thurs\";\n break;\n case 5: day = \"Fri\";\n break;\n case 6: day = \"Sat\";\n }\n \n return day;\n}", "title": "" }, { "docid": "0849e554e308a7fd2a2966904a60e47a", "score": "0.64244765", "text": "function returnDay(num) {\r\n if (num <= 0 || num > 7) {\r\n return null;\r\n }\r\n\r\n if (num === 1) {\r\n return \"Monday\";\r\n } else if (num === 2) {\r\n return \"Tuesday\";\r\n } else if (num === 3) {\r\n return \"Wednesday\";\r\n } else if (num === 4) {\r\n return \"Thursday\";\r\n } else if (num === 5) {\r\n return \"Friday\";\r\n } else if (num === 6) {\r\n return \"Saturday\";\r\n } else if (num === 7) {\r\n return \"Sunday\";\r\n }\r\n}", "title": "" }, { "docid": "3be756cf66f2c09a8cd8362d1bd4c499", "score": "0.6423851", "text": "function handleDay(d) {\n if (d < 7) {\n d += 1;\n } else if (d === 7) {\n d = 1;\n }\n return d;\n }", "title": "" }, { "docid": "10b0157d1d1ebfea94b313f2f7d9ab5d", "score": "0.6422807", "text": "function Qc(a,b,c,d){\"boolean\"==typeof a?(f(b)&&(c=b,b=void 0),b=b||\"\"):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||\"\");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,\"day\");var h,i=[];for(h=0;7>h;h++)i[h]=Oc(b,(h+g)%7,d,\"day\");return i}", "title": "" }, { "docid": "7c78e80b11204197fcb2ed66c2a673c0", "score": "0.64199233", "text": "function dayNum(day) {\n if (day === \"m\") {\n return \"03\";\n } else if (day === \"tu\") {\n return \"04\";\n } else if (day === \"w\") {\n return \"05\";\n } else if (day === \"th\") {\n return \"06\";\n } else if (day === \"f\") {\n return \"07\";\n }\n }", "title": "" }, { "docid": "c6c2ba5996c97e1ea9a1be91f723930b", "score": "0.6413199", "text": "function whatday(num) {\n console.log(num)\n if (num === 1) return 'Sunday'\n if (num === 2) return 'Monday'\n if (num === 3) return 'Tuesday'\n if (num === 4) return 'Wednesday'\n if (num === 5) return 'Thursday'\n if (num === 6) return 'Friday'\n if (num === 7) return 'Saturday'\n else return 'Wrong, please enter a number between 1 and 7'\n}", "title": "" }, { "docid": "3b6e4ef34d701bef76f228cb8d22e25e", "score": "0.6398099", "text": "function getDayOfWeek(date) {\n const offsets = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth();\n let day = date.getUTCDate();\n\n if (month < 2) {\n year--;\n }\n\n return (offsets[month] + year + day + Math.floor(year / 4) - Math.floor(year / 100) + Math.floor(year / 400)) % 7;\n} // Get the day of the year as a number (1-366)", "title": "" }, { "docid": "c11427a177842f1a373f6478bf0edb85", "score": "0.639376", "text": "function weekDay(jd)\n{\n// Julian date for the begin of the day\njd0 = Math.floor(jd) + 0.5;\nif (jd < jd0)jd0 -= 1;\n\n// day\njdn = jd0 + 1.5;\ndn1 = Math.floor(jdn/7)*7;\n\n\nwday = Math.floor(jdn - dn1);\n\nreturn wday;\n}", "title": "" }, { "docid": "3059595554b44773dcc69bb255761ccf", "score": "0.6362932", "text": "function weekDay () {\n var day = 'monday';\n return day;\n}", "title": "" }, { "docid": "9bc87e29a1ccd87d6f337ca737a0012e", "score": "0.6359859", "text": "day(month, days, year) {\n var y0 = year - Math.floor((14 - month) / 12);\n // console.log(y0);\n var x = y0 + Math.floor((y0 / 4)) - Math.floor((y0 / 100)) + Math.floor((y0 / 400));\n //console.log(x);\n m0 = month + 12 * Math.floor((14 - month) / 12) - 2;\n //console.log(m0);\n var d0 = (days + x + Math.floor((31 * m0) / 12)) % 7;\n //.log(d0);\n\n return d0;\n }", "title": "" }, { "docid": "da65d78c6c93932d9b7f37fa6c9344dc", "score": "0.63494194", "text": "function GetDayOfWeek(date)\n{\n return weekday[date.getDay()];\n}", "title": "" }, { "docid": "4c7c6ebf940d2a3def366596456f6d17", "score": "0.63321894", "text": "function getDay1(d) { return (d==0) ? 7 : d}", "title": "" }, { "docid": "6b6e83ddd2b99783ae83337de6278932", "score": "0.6331928", "text": "function changeDay() {\n var weekday = new Array(7);\n weekday[0] = \"Sun\";\n weekday[1] = \"Mon\";\n weekday[2] = \"Tue\";\n weekday[3] = \"Wed\";\n weekday[4] = \"Thu\";\n weekday[5] = \"Fri\";\n weekday[6] = \"Sat\";\n return weekday[d]\n }", "title": "" }, { "docid": "b167f3a6dcfc39e8ea40baf9726c0462", "score": "0.6331136", "text": "function dayNum(day) {\n if (day === \"m\") {\n return \"03\";\n } else if (day === \"tu\") {\n return \"04\";\n } else if (day === \"w\") {\n return \"05\";\n } else if (day === \"th\") {\n return \"06\";\n } else if (day === \"f\") {\n return \"07\";\n }\n }", "title": "" }, { "docid": "b167f3a6dcfc39e8ea40baf9726c0462", "score": "0.6331136", "text": "function dayNum(day) {\n if (day === \"m\") {\n return \"03\";\n } else if (day === \"tu\") {\n return \"04\";\n } else if (day === \"w\") {\n return \"05\";\n } else if (day === \"th\") {\n return \"06\";\n } else if (day === \"f\") {\n return \"07\";\n }\n }", "title": "" }, { "docid": "c9b67f165ab9c707c72f20a4dd05c9b8", "score": "0.6320161", "text": "function calGetWeekStartDate(year, month, day) \r\n{\r\n\tvar od=new Date(year, month-1, day);\r\n\tvar weekday = od.getDay();\r\n\r\n\tif (weekday)\r\n\t{\r\n\t\tod = calDateAddSubtract(od, \"day\", -weekday);\r\n\t}\r\n\r\n\treturn od;\r\n}", "title": "" }, { "docid": "2aa32670781e918d80b59c73ed87a81c", "score": "0.6315015", "text": "function getDayOfWeek(day) {\n\tswitch(day) {\n\t\tcase 0 : return \"Sunday\";\n\t\tcase 1 : return \"Monday\";\n\t\tcase 2 : return \"Tuesday\";\n\t\tcase 3 : return \"Wednesday\";\n\t\tcase 4 : return \"Thursday\";\n\t\tcase 5 : return \"Friday\";\n\t\tcase 6 : return \"Saturday\";\n\t}\n}", "title": "" }, { "docid": "ce98f73cbe7b1a6dea8f2f2838bc8d8e", "score": "0.630297", "text": "function whichDay(dayOfWeek, days) {\n\n}", "title": "" }, { "docid": "a6ec3c4aff3d25ddb435997b78cc730a", "score": "0.6293466", "text": "function dayOfWeek(days){\n var week = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'];\n return week[days%7];\n}", "title": "" }, { "docid": "5dc828ce40d95997c1a52966ccf1d38b", "score": "0.6277716", "text": "function getDay(n) {\n\t\tn=n || 0;\n\t\tselectedDay=n;\n\t\treturn weeks[selectedWeek][selectedDay];\n\t}", "title": "" }, { "docid": "7624fdd6a5065177454b9d8b92613733", "score": "0.6275125", "text": "function weekdayName2(dayNum){\n var day;\n var weekdayNum= dayNum%7;\n var st;\n \n switch(weekdayNum){\n case 1:\n day=\"Sunday\";\n st=\"Enjoy your day off\";\n break;\n case 2:\n day=\"Monday\";\n st=\"Work Hard\";\n break; \n case 3:\n day=\"Tuesday\";\n st=\"Work Hard\";\n break;\n case 4:\n day=\"Wednesday\";\n st=\"Work Hard\";\n break;\n case 5:\n day=\"Thursday\";\n st=\"Work Hard\";\n break;\n case 6:\n day=\"Friday\";\n st=\"Work Hard\";\n break;\n case 7:\n day=\"Saturday\";\n st=\"Enjoy your day off\";\n break;\n }\n console.log(\"Today is \",day, st)\n}", "title": "" }, { "docid": "5de284a2bf3e7c91209453816ea8cd78", "score": "0.627142", "text": "E (date) {\n return date.getDay() || 7\n }", "title": "" }, { "docid": "3d5be39a592b06eb08e5e716620b9ecd", "score": "0.62449074", "text": "function getDateOfISOWeek(w, y) {\n\n if (y == 2020 && w ==53 ) {\n window.year =2021;\n window.week =1;\n getDateOfISOWeek(window.week, window.year);\n } \n\n var simple = new Date(y, 0, 1 + (w - 1) * 7);\n var dow = simple.getDay();\n var ISOweekStart = simple;\n if (dow <= 4)\n ISOweekStart.setDate(simple.getDate() - simple.getDay() + 1);\n else\n ISOweekStart.setDate(simple.getDate() + 8 - simple.getDay());\n\n\n let year = ISOweekStart.getFullYear();\n let month = ISOweekStart.getMonth() + 1;\n let dt = ISOweekStart.getDate();\n\n //If day or month is single digit, make it double\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n\n //Start day of the week, Monday, needed for corona data\n window.date = year + '-' + month + '-' + dt;\n}", "title": "" }, { "docid": "a74201c9a9b297c6a930b846411e6ac1", "score": "0.6244633", "text": "function dayofWeek(day){\n var d = new Date();\n var day = d.getDay();\n var days = ['Sunday', 'Monday', 'Tusday', 'Wednesday','Thursday', 'Friday', 'Saturday'];\n return days[day]\n}", "title": "" }, { "docid": "f26dc4974769f7457782e13ad3df4c8a", "score": "0.6237391", "text": "calender(month, year) {\n\n var months = [\n \"\",\n \"January\", \"February\", \"March\",\n \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\",\n \"October\", \"November\", \"December\"\n ];\n var days = [0, 31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30];\n try {\n //checking Month & year is valid or not\n if (month < 0 || month > 12)\n throw \"Month value is Invalid , Please Enter a value in range 1-12\";\n\n if (month == undefined || year == undefined)\n throw \"NO input found\";\n\n console.log();\n // if month is February then,\n //checked year is leap year or not\n if (month == 2 && this.isLeapYear(year)) days[month] = 29;\n //show.print()\n console.log(\" \" + months[month] + \" \" + year);\n console.log();\n var arr = new Array(5)\n for (let i = 0; i < 4; i++) {\n arr[i] = new Array(7);\n\n }\n console.log(\" S M Tu W Th F S\");\n\n //Printing the first day of first week\n var day = this.day(month, 1, year);\n\n // for (let i = 0; i < day; i++) {\n // //show.print(\" \")\n // //process.stdout.write(\" \")\n\n // }\n // for (var i = 1; i <= days[month]; i++) {\n // //show.print(\" \", i);\n // //process.stdout.write(\" \", i);\n // //console.log(i);\n\n // if (i < 10) {\n // //show.print(\" \");\n // //process.stdout.write(\" \");\n // }\n // if (((i + day) % 7 == 0) || (i == days[month])) {\n // //console.log(\" \");\n // }\n // }\n\n //creating 2d array to print the date data\n for (let i = 0; i < day; i++)\n arr[1][i] = \" \";\n var row = 1; // Assingning row and colomn\n var col = day;\n for (var i = 1; i <= days[month]; i++) { //iterate to the lenght of the month\n if (col == 7) {\n col = 0;\n row++;\n }\n if (i < 10) //printing the space between 1 to 9 digit which is in calender\n arr[row][col++] = ' ' + i;\n else {\n if (i == undefined)\n arr[row][col++] = 1;\n else\n arr[row][col++] = '' + i; //printing the rest of the element into calender\n }\n\n\n }\n //console.log(arr.join('\\n'))\n return arr;\n }\n catch (err) {\n console.log(\"Error: \" + err);\n }\n }", "title": "" }, { "docid": "e79894814a930337f66737494be28ac6", "score": "0.6233557", "text": "function returnDay(num)\n{\n if (num<1 || num>7)\n {\n return null;\n }\n let arr_day=['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'];\n return arr_day[num-1];\n}", "title": "" }, { "docid": "f422408f324b681443a1ffb9655717fb", "score": "0.62268925", "text": "function nthWeekDay(countDays, weekDay, year, month, day) {\n let countedDays = 0\n if (countDays >= 0) {\n month = month || 1\n let monthStr = String(month)\n if (monthStr.length === 1) { monthStr = \"0\" + monthStr }\n day = day || 1\n let dayStr = String(day)\n if (dayStr.length === 1) { dayStr = \"0\" + dayStr }\n // We stay a minute off midnight to avoid dealing with leap seconds.\n let timestamp = +new Date(`${year}-${monthStr}-${dayStr}T00:01:00Z`)\n let time\n for (let i = 0; i < 366; i++) {\n time = new Date(timestamp)\n if (time.getDay() === weekDay) {countedDays++}\n if (countedDays === countDays) {break}\n timestamp += 24 * 3600 * 1000\n }\n return time\n } else if (countDays < 0) {\n countDays = -countDays\n month = month || 12\n let monthStr = String(month)\n if (monthStr.length === 1) { monthStr = \"0\" + monthStr }\n day = day || 31\n let dayStr = String(day)\n if (dayStr.length === 1) { dayStr = \"0\" + dayStr }\n // Starting moment, ms.\n let timestamp = +new Date(`${year}-${monthStr}-${dayStr}T00:01:00Z`)\n let time\n for (let i = 366; i >= 0; i--) {\n time = new Date(timestamp)\n if (time.getDay() === weekDay) {countedDays++}\n if (countedDays === countDays) {break}\n timestamp -= 24 * 3600 * 1000\n }\n return time\n }\n}", "title": "" }, { "docid": "6640b7f79555eed298cef34d05bf88b3", "score": "0.6222432", "text": "function getDayWeek (day) {\n switch (day) {\n case 0:\n return 'Sun'\n case 1:\n return 'Mon'\n case 2:\n return 'Tue'\n case 3:\n return 'Wed'\n case 4:\n return 'Thu'\n case 5:\n return 'Fri'\n case 6:\n return 'Sat'\n default:\n return '???'\n }\n }", "title": "" }, { "docid": "2ea7c931945ec0916531290725ba5526", "score": "0.62184966", "text": "function getWeekday(num) {\n\tvar result;\n\tswitch(num) {\n\t\tcase \"1\":\n\t\t\tresult = \"Mon\";\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tresult = \"Tue\";\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tresult = \"Wed\";\n\t\t\tbreak;\n\t\tcase \"4\":\n\t\t\tresult = \"Thu\";\n\t\t\tbreak;\n\t\tcase \"5\":\n\t\t\tresult = \"Fri\";\n\t\t\tbreak;\n\t\tcase \"6\":\n\t\t\tresult = \"Sat\";\n\t\t\tbreak;\n\t\tcase \"0\":\n\t\t\tresult = \"Sun\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult = \"not detected\";\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "784c6cc0e59e305c21dcac7f68a754c9", "score": "0.62150913", "text": "function get_wn() {\r\n \tvar today = new Date();\r\n\tYear = takeYear(today);\r\n\tMonth = today.getMonth();\r\n\tDay = today.getDate();\r\n\tnow = Date.UTC(Year,Month,Day+1,0,0,0);\r\n\tvar Firstday = new Date();\r\n\tFirstday.setYear(Year);\r\n\tFirstday.setMonth(0);\r\n\tFirstday.setDate(1);\r\n\tthen = Date.UTC(Year,0,1,0,0,0);\r\n\tvar Compensation = Firstday.getDay();\r\n\tif (Compensation > 3) Compensation -= 4;\r\n\telse Compensation += 3;\r\n\tweek_num = Math.round((((now-then)/86400000)+Compensation)/7);\r\n}", "title": "" }, { "docid": "ef6eafcc0e2121b974b02d4a9c1b834f", "score": "0.6209143", "text": "function getDateByDOW(y,m,q,n){ \n// q: 1 - 5 ( 5 denotes the last n-day )\n// n: 0 - Sunday, 1 - Monday ... 6 - Saturday\n\tvar dom=new Date(y,m-1,1).getDay();\n\tvar d=7*q-6+n-dom;\n\tif(dom>n) d+=7;\n\tif(d>fGetDays(y)[m]) d-=7;\n\treturn d;\t// ranged from 1 to 31\n}", "title": "" }, { "docid": "71565d9729cb55d8cb1620aa8be87501", "score": "0.62011415", "text": "function getDays(strday,k){\n\tconst setDays = {\"mon\":0,\"tue\":1,\"wed\":2,\"thu\":3,\"fri\":4,\"sat\":5,\"sun\":6};//o(1) query\n\tconst outputDay = [\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"];//o(1) print\n\tif(!strday || setDays[strday.toLowerCase()] == undefined || !(k>=0 && k <=500))//parmas check\n\t{\n\t\tconsole.log(\"not invalid input\");\n\t\treturn;\n\t}\n\n\tconsole.log(outputDay[\n\t\t\t\t(setDays[strday.toLowerCase()] + (k % 7))%7\n\t\t\t]\n\t);\n}", "title": "" }, { "docid": "886b6d660f3614bb85757ab61f62d4fc", "score": "0.61999", "text": "function printDay(num) {\n if(num < 1 || num > 7) {\n \treturn undefined;\n } \n switch (num) {\n \tcase 1:\n return 'Sunday';\n break;\n case 2:\n return 'Monday';\n break;\n case 3:\n return 'Tuesday';\n break;\n case 4:\n return 'Wednesday';\n break;\n case 5:\n return 'Thursday';\n break;\n case 6:\n return 'Friday';\n break;\n case 7:\n return 'Saturday';\n }\n\n}", "title": "" }, { "docid": "3aec033072e971a7c91603793607d778", "score": "0.6192418", "text": "function whatday(num) {\n switch(num) {\n case 1:\n return \"Sunday\";\n case 2:\n return \"Monday\";\n case 3:\n return \"Tuesday\";\n case 4:\n return \"Wednesday\";\n case 5:\n return \"Thursday\";\n case 6:\n return \"Friday\";\n case 7:\n return \"Saturday\";\n default:\n return 'Wrong, please enter a number between 1 and 7';\n }\n}", "title": "" }, { "docid": "b1ffb75b2288d1054d5464ad42dea9af", "score": "0.61631435", "text": "initialValue() {\n let date = new Date(year, month, 1)\n \tlet dayOfWeek = date.getDay();\n \tlet arr = [-5, 1, 0, -1, -2, -3, -4];\n day = arr[dayOfWeek];\n\t}", "title": "" }, { "docid": "3c8387ab33d6345a3a76f2cd8c151ca8", "score": "0.61628926", "text": "function Zeller(D, M, Y){ \n var Day = \"\";\n \n if (M < 3)\n {\n M = M + 12;\n Y = Y - 1;\n }\n \n var YF = Math.floor(Y / 100);\n var YL = Y - (100 * YF);\n \n var S = Math.floor(2.6 * M - 5.39) + Math.floor(YL / 4) + Math.floor(YF / 4) + D + YL - (2 * YF);\n \n var ans = S - (7 * Math.floor(S / 7));\n \n if (ans == 0)\n {\n Day = \"Sunday\";\n }\n else if (ans == 1)\n {\n Day = \"Monday\";\n }\n else if (ans == 2)\n {\n Day = \"Tuesday\";\n }\n else if (ans == 3)\n {\n Day = \"Wednesday\";\n }\n else if (ans == 4)\n {\n Day = \"Thursday\";\n }\n else if (ans == 5)\n {\n Day = \"Friday\";\n }\n else \n {\n Day = \"Saturday\";\n }\n \n return Day;\n }", "title": "" }, { "docid": "03b2c2c7a8d40509370c4c5814fc5c35", "score": "0.6152567", "text": "function getWeekday(date) {\n\t\treturn (date.getDay() + 6) % 7;\n\t}", "title": "" }, { "docid": "a8724681458a1772929095498862c625", "score": "0.61464447", "text": "function getLocalDay(date){\n\treturn (date.getDay()+ 6) % 7 + 1;\n}", "title": "" }, { "docid": "20800493129c395c2cbd79b9c1ab5c9f", "score": "0.61441404", "text": "function getDay(dayInWeek){\n\t\tlet weekday = new Array(7);\n\t\tweekday[0] = \"Sunday\";\n\t\tweekday[1] = \"Monday\";\n\t\tweekday[2] = \"Tuesday\";\n\t\tweekday[3] = \"Wednesday\";\n\t\tweekday[4] = \"Thursday\";\n\t\tweekday[5] = \"Friday\";\n\t\tweekday[6] = \"Saturday\";\n\t\t\n\t\treturn weekday[dayInWeek];\n\t}", "title": "" }, { "docid": "f6ef00d1f6d01a3bb71804d566b7493c", "score": "0.61434215", "text": "function dayWeek(dayNum) {\n var weekday = new Array();\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n return weekday[dayNum];\n}", "title": "" }, { "docid": "c3888a74b115413f8a779771c2d896c0", "score": "0.61267513", "text": "convertDays() {\n const day = TodayDate.getDay();\n let daylist = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday \", \"Thursday\", \"Friday\", \"Saturday\"];\n let currentDay = daylist[day];\n return currentDay;\n }", "title": "" }, { "docid": "1e9808126b09086c5d0eeb3dd42547ab", "score": "0.61243314", "text": "function weekday(n) {\n // Sets the `date` to the start of the `n`-th day of the current week.\n // n == 0 is Sunday.\n function floor(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - n) % 7);\n date.setHours(0, 0, 0, 0); // h, m, s, ms\n }\n // Offset the date by the given number of weeks.\n function offset(date, weeks) {\n date.setUTCDate(date.getUTCDate() + weeks * 7);\n }\n // Count the number of weeks between teh start and end dates.\n function count(start, end) {\n return (end.getTime() - start.getTime()) / duration_1.durationWeek;\n }\n return new interval_1.CountableTimeInterval(floor, offset, count);\n}", "title": "" }, { "docid": "027235073233ab9b157dc15e09200710", "score": "0.61215097", "text": "function getDayEWO() {\r\n var d = new Date();\r\n var n = d.getDay();\r\n return n;\r\n}", "title": "" }, { "docid": "1be7312bdf6a58d671278125a5b6cde4", "score": "0.6119813", "text": "static getWeekday(date, type) {\n\t\tvar weekday = new Date(date).getDay();\n\n\t\tif (weekday == 0) weekday = 7;\n\n\t\tif (type == \"string\") return isNaN(weekday) ? null : ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'][weekday -1];\n\t\tif (type == \"number\") return weekday;\n\n\t\telse return \"PARAMETERS: \\\"string\\\" or \\\"number\\\"\";\n\t}", "title": "" }, { "docid": "7b151dce2207e3b39ac8674de6dee0c8", "score": "0.61177325", "text": "function weekDayName2(weekdayNum){\n\n var rem = weekdayNum % 7;\n\n switch(rem) {\n case 0:\n return \"Saturday\";\n case 1:\n return \"Sunday\";\n case 2:\n return \"Monday\";\n case 3:\n return \"Tuesday\";\n case 4:\n return \"Wednesday\";\n case 5:\n return \"Thursday\";\n case 6:\n return \"Friday\";\n }\n}", "title": "" }, { "docid": "b3fc6cc1c0303d5182d9aacdfd4d5619", "score": "0.6110217", "text": "function weekday(date) {\n var weekdays = weekdayOfYear(date),\n year = date.getFullYear();\n weekdays += weekdaysUntilYear(year);\n var seconds = ((date.getHours() * 60) + date.getMinutes()) * 60 + date.getSeconds();\n return weekdays + seconds / DAY_SECONDS;\n }", "title": "" }, { "docid": "15ada6636a65cb33600e906502f8ff22", "score": "0.6093397", "text": "function getDateByWeekdayAfter(yy,mm,dd,num,weekday) {\r\n var r, d = new Date(yy,mm - 1,dd), i_day = d.getDate()\r\n , a = ['sun','mon','tue','wed','thu','fri','sat'], i_count = 0;\r\n while (i_day < 32 && i_count < num) {\r\n d.setDate(i_day);\r\n if (d.getDay() == a.indexOf(weekday)) i_count ++;\r\n i_day ++;\r\n }\r\n if (i_day < 32) r = d;\r\n return r;\r\n }", "title": "" } ]
feced712b41c17c8a29ca45cead28ccc
Copyright 2000, Cobalt Networks. All rights reserved. $Id: SnmpCommunity.js 201 20030718 19:11:07Z will $
[ { "docid": "e22ec2d55e90dadde1234110976d3a8a", "score": "0.51070076", "text": "function SnmpCommunity_changeHandler(element) {\n if(!SnmpCommunity_isSnmpCommunityValid(element.value)) {\n top.code.error_invalidElement(element, top.code.string_substitute(element.invalidMessage, \"[[VAR.invalidValue]]\", element.value));\n return false;\n }\n\n return true;\n}", "title": "" } ]
[ { "docid": "2f4efa773c5aecfd9512857b3718d503", "score": "0.5757867", "text": "function Sms() {\n\n}", "title": "" }, { "docid": "925f58acf94d9cf89107b01c7e562d8b", "score": "0.56373966", "text": "function onConnected() {\n stompClient.subscribe('/user/queue/matchmaking', onMessageReceived);\n stompClient.send(\"/app/matchmaking.initialize\", {}, JSON.stringify({type: 'INIT'}));\n}", "title": "" }, { "docid": "5c44c37e3f5f06a848f836f4a1a515d0", "score": "0.5598587", "text": "function initConnect() {\n\n var socket = new SockJS('/match');\n stompClient = Stomp.over(socket);\n stompClient.connect({}, onConnected, onError);\n}", "title": "" }, { "docid": "f479f19e1e642464869872c9e835d163", "score": "0.5572308", "text": "function SnpSendMessage() {\n\t\n\t/**\n\t The number of messages to send back from Photoshop.\n\t @type int\n\t*/\n\tthis.numberOfMessagesToSend = 4;\n\t\n\t/**\n\t The context in which this snippet can run.\n\t @type String\n\t*/\n\tthis.requiredContext = \"\\tExecute against Bridge 2.0 main engine,\\n Photoshop must also be running.\";\n\t$.level = 1; // Debugging level\t\n}", "title": "" }, { "docid": "7fe836e5cfb13ee06e202c4c38ccdcb6", "score": "0.55229944", "text": "play(){//Set up for playing Snip snap snorum\n this.snipview.displayMessage(\"Snip Snap Snorum\");\n this.human.addCards();\n this.cpu.addCards();\n this.snipview.displayPileTopCard(null);\n this.snipview.displayComputerHand(this.cpu.getHandCopy());\n this.snipview.displayHumanHand(this.human.getHandCopy());\n return;\n }", "title": "" }, { "docid": "3060e0361656cd359a1c0bb4978bc667", "score": "0.5494145", "text": "function ClientRoster ()\n{\n\tthis.Items\t\t\t\t= new ActiveXObject( 'Scripting.Dictionary' );\n\tthis.Groups\t\t\t\t= new ActiveXObject( 'Scripting.Dictionary' );\n\tthis.IsFlashing\t\t\t= false;\n\tthis.HTMLElement\t\t= document.getElementById( 'rostercell' );\n\tthis.LoadingVcard\t\t= new ActiveXObject( 'Scripting.Dictionary' );\n\tthis.DragNDropOrigin\t= '';\n\n\tthis.Clear\t\t\t\t= Clear;\n\tthis.Search\t\t\t\t= new ClientRosterSearch();\n\tthis.FromIQ\t\t\t\t= FromIQ;\n\tthis.GetAvatar\t\t\t= GetAvatar;\n\tthis.AllOffline\t\t\t= AllOffline;\n\tthis.RefreshAll\t\t\t= RefreshAll;\n\tthis.ShowUnread\t\t\t= ShowUnread;\n\tthis.CreateGroup\t\t= CreateGroup;\n\tthis.UnreadFlash\t\t= UnreadFlash;\n\tthis.UnreadMessages\t\t= UnreadMessages;\n\tthis.ReloadFromIQ\t\t= ReloadFromIQ;\n\tthis.ReceivePresence\t= ReceivePresence;\n\tthis.ReceiveSetFromIQ\t= ReceiveSetFromIQ;\n\n\t/* Load the default avatar mapping.\n\t */\n\tvar AvatarMap = new ActiveXObject( 'Scripting.Dictionary' );\n\tAvatarMap.Add( 'adium',\t\t\t\t'adium'\t\t\t);\n\tAvatarMap.Add( 'bot',\t\t\t\t'cog'\t\t\t);\n\tAvatarMap.Add( 'brim',\t\t\t\t'brim'\t\t\t);\n\tAvatarMap.Add( 'buddyspace',\t\t'buddyspace'\t);\n\tAvatarMap.Add( 'desktop',\t\t\t'desktop'\t\t);\n\tAvatarMap.Add( 'centericq',\t\t\t'console'\t\t);\n\tAvatarMap.Add( 'chatopus',\t\t\t'palm'\t\t\t);\n\tAvatarMap.Add( 'everybuddy',\t\t'mac'\t\t\t);\n\tAvatarMap.Add( 'exodus',\t\t\t'exodus'\t\t);\n\tAvatarMap.Add( 'gabber',\t\t\t'gnome'\t\t\t);\n\tAvatarMap.Add( 'gaim',\t\t\t\t'gaim'\t\t\t);\n\tAvatarMap.Add( 'gajim',\t\t\t\t'gajim'\t\t\t);\n\tAvatarMap.Add( 'greenthumb',\t\t'thumb'\t\t\t);\n\tAvatarMap.Add( 'gossip',\t\t\t'gnome'\t\t\t);\n\tAvatarMap.Add( 'gush',\t\t\t\t'gush'\t\t\t);\n\tAvatarMap.Add( 'hapi',\t\t\t\t'hapi'\t\t\t);\n\tAvatarMap.Add( 'home',\t\t\t\t'house'\t\t\t);\n\tAvatarMap.Add( 'ichat',\t\t\t\t'mac'\t\t\t);\n\tAvatarMap.Add( 'imcom',\t\t\t\t'console'\t\t);\n\tAvatarMap.Add( 'imendio',\t\t\t'gnome'\t\t\t);\n\tAvatarMap.Add( 'imov',\t\t\t\t'imov'\t\t\t);\n\tAvatarMap.Add( 'imservices-libgaim','gaim'\t\t\t);\n\tAvatarMap.Add( 'jabber.net',\t\t'dotnet'\t\t);\n\tAvatarMap.Add( 'jabber messenger',\t'jim'\t\t\t);\n\tAvatarMap.Add( 'jabberce',\t\t\t'imov'\t\t\t);\n\tAvatarMap.Add( 'jabbermessenger',\t'jim'\t\t\t);\n\tAvatarMap.Add( 'jabbernaut',\t\t'mac'\t\t\t);\n\tAvatarMap.Add( 'jabberwocky',\t\t'amiga'\t\t\t);\n\tAvatarMap.Add( 'jabbix',\t\t\t'jabbix'\t\t);\n\tAvatarMap.Add( 'jarl',\t\t\t\t'jarl'\t\t\t);\n\tAvatarMap.Add( 'jajc',\t\t\t\t'jajc'\t\t\t);\n\tAvatarMap.Add( 'jbother',\t\t\t'jbother'\t\t);\n\tAvatarMap.Add( 'just another',\t\t'jajc'\t\t\t);\n\tAvatarMap.Add( 'jwchat',\t\t\t'jwchat'\t\t);\n\tAvatarMap.Add( 'kopete',\t\t\t'kopete'\t\t);\n\tAvatarMap.Add( 'konnekt',\t\t\t'konnekt'\t\t);\n\tAvatarMap.Add( 'laptop',\t\t\t'laptop'\t\t);\n\tAvatarMap.Add( 'libgaim',\t\t\t'gaim'\t\t\t);\n\tAvatarMap.Add( 'miranda',\t\t\t'miranda'\t\t);\n\tAvatarMap.Add( 'myjab',\t\t\t\t'myjabber'\t\t);\n\tAvatarMap.Add( 'mobile',\t\t\t'sms'\t\t\t);\n\tAvatarMap.Add( 'mcenter',\t\t\t'neosmt'\t\t);\n\tAvatarMap.Add( 'neos',\t\t\t\t'neosmt'\t\t);\n\tAvatarMap.Add( 'nitro',\t\t\t\t'nitro'\t\t\t);\n\tAvatarMap.Add( 'notebook',\t\t\t'laptop'\t\t);\n\tAvatarMap.Add( 'office',\t\t\t'work'\t\t\t);\n\tAvatarMap.Add( 'palm',\t\t\t\t'palm'\t\t\t);\n\tAvatarMap.Add( 'pandion',\t\t\t'pandion'\t\t);\n\tAvatarMap.Add( 'papla',\t\t\t\t'papla'\t\t\t);\n\tAvatarMap.Add( 'pidgin',\t\t\t'pidgin'\t\t);\n\tAvatarMap.Add( 'pocket',\t\t\t'palm'\t\t\t);\n\tAvatarMap.Add( 'psi',\t\t\t\t'psi'\t\t\t);\n\tAvatarMap.Add( 'punjab',\t\t\t'punjab'\t\t);\n\tAvatarMap.Add( 'rhymbox',\t\t\t'rhymbox'\t\t);\n\tAvatarMap.Add( 'rival',\t\t\t\t'rival'\t\t\t);\n\tAvatarMap.Add( 'sapo',\t\t\t\t'sapo'\t\t\t);\n\tAvatarMap.Add( 'shaolo',\t\t\t'shaolo'\t\t);\n\tAvatarMap.Add( 'simplesend',\t\t'jarl'\t\t\t);\n\tAvatarMap.Add( 'skabber',\t\t\t'skabber'\t\t);\n\tAvatarMap.Add( 'smack',\t\t\t\t'smack'\t\t\t);\n\tAvatarMap.Add( 'soapbox',\t\t\t'soapbox'\t\t);\n\tAvatarMap.Add( 'spark',\t\t\t\t'spark'\t\t\t);\n\tAvatarMap.Add( 'talk',\t\t\t\t'googletalk'\t);\n\tAvatarMap.Add( 'tipicim',\t\t\t'tipicim'\t\t);\n\tAvatarMap.Add( 'tipicme',\t\t\t'tipicme'\t\t);\n\tAvatarMap.Add( 'tkabber',\t\t\t'tkabber'\t\t);\n\tAvatarMap.Add( 'tkcjabber',\t\t\t'cog'\t\t\t);\n\tAvatarMap.Add( 'tlen',\t\t\t\t'tlen'\t\t\t);\n\tAvatarMap.Add( 'trillian',\t\t\t'trillian'\t\t);\n\tAvatarMap.Add( 'tvjab',\t\t\t\t'mac'\t\t\t);\n\tAvatarMap.Add( 'vista',\t\t\t\t'vista'\t\t\t);\n\tAvatarMap.Add( 'weather',\t\t\t'weather'\t\t);\n\tAvatarMap.Add( 'webmsgr',\t\t\t'webmessenger'\t);\n\tAvatarMap.Add( 'work',\t\t\t\t'work'\t\t\t);\n\tAvatarMap.Add( 'wpkontakt',\t\t\t'kontakt'\t\t);\n\tAvatarMap.Add( 'wxskabber',\t\t\t'skabber'\t\t);\n\tAvatarMap.Add( 'xmppimcom',\t\t\t'console'\t\t);\n\tAvatarMap.Add( 'yabber',\t\t\t'yabber'\t\t);\n\n\t/* Open the unread messages in a single window or show a popup of who has sent us messages and select one.\n\t */\n\tfunction ShowUnread ( x, y )\n\t{\n\t\tvar QueuedEvents = external.globals( 'ChatSessionPool' ).Events;\n\t\tif ( QueuedEvents.Count == 1 )\n\t\t\tdial_chat( ( ( new VBArray( QueuedEvents.Keys() ) ).toArray() )[0] );\n\t\telse if ( QueuedEvents.Count > 1 )\n\t\t{\n\t\t\tvar Addresses = ( new VBArray( QueuedEvents.Keys() ) ).toArray();\n\t\t\tvar Menu = external.newPopupMenu;\n\t\t\tfor ( var i = 0; i < Addresses.length; ++i )\n\t\t\t{\n\t\t\t\tvar Name = this.Items.Exists( Addresses[i] ) ? this.Items( Addresses[i] ).Name.substr( 0, 30 ) : Addresses[i];\n\t\t\t\tMenu.AddItem( true, false, false, false, 0, Name, i + 1 );\n\t\t\t}\n\t\t\tMenu.Show( x, y );\n\t\t\tif ( ! Menu.Choice )\n\t\t\t\treturn;\n\t\t\tdial_chat( Addresses[ Menu.Choice - 1 ] );\n\t\t}\n\t}\n\n\t/* Update the unread messages warning message at the top of the roster\n\t */\n\tfunction UnreadMessages ( jid, count )\n\t{\n\t\tvar QueuedEvents = external.globals( 'ChatSessionPool' ).Events;\n\t\tif ( QueuedEvents.Count )\n\t\t{\n\t\t\tvar Counter = 0;\n\t\t\tvar QueueAddresses = ( new VBArray( QueuedEvents.Keys() ) ).toArray();\n\t\t\tfor ( var i = 0; i < QueueAddresses.length; ++i )\n\t\t\t\tCounter += QueuedEvents( QueueAddresses[i] ).length;\n\t\t\tdocument.getElementById( 'unread-messages-counter' ).innerText = Counter == 1 ? external.globals( 'Translator' ).Translate( 'main', 'cl_waiting_one' ) : external.globals( 'Translator' ).Translate( 'main', 'cl_waiting_multiple', [ Counter ] );\n\t\t\tdocument.getElementById( 'unread-messages-area' ).style.display = 'block';\n\t\t\texternal.notifyIcon.setIcon( external.globals( 'cwd' ) + '..\\\\images\\\\dials\\\\letter.ico', 0 );\n\t\t\texternal.notifyIcon.setText( external.globals( 'softwarename' ) + '\\n' + ( Counter == 1 ? external.globals( 'Translator' ).Translate( 'main', 'cl_waiting_one' ) : external.globals( 'Translator' ).Translate( 'main', 'cl_waiting_multiple', [ Counter ] ) ) );\n\t\t\texternal.notifyIcon.update();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById( 'unread-messages-area' ).style.display = 'none';\n\t\t\texternal.notifyIcon.setText( external.globals( 'softwarename' ) );\n\t\t\tif ( external.FileExists( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\tray.ico' ) )\n\t\t\t\texternal.notifyIcon.setIcon( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\tray.ico', 0 );\n\t\t\telse\n\t\t\t\texternal.notifyIcon.setIcon( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\default.ico', 0 );\n\t\t\texternal.notifyIcon.update();\n\t\t}\n\t}\n\n\t/* Flash the system tray icon for unread messages\n\t */\n\tfunction UnreadFlash ( Times )\n\t{\n\t\tvar QueuedEvents = external.globals( 'ChatSessionPool' ).Events;\n\t\tif ( QueuedEvents.Count && Times != 0 )\n\t\t{\n\t\t\tthis.IsFlashing = true;\n\t\t\tTimes--;\n\t\t\tif ( Times % 2 )\n\t\t\t{\n\t\t\t\texternal.notifyIcon.setIcon( external.globals( 'cwd' ) + '..\\\\images\\\\dials\\\\letter.ico', 0 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( external.FileExists( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\tray.ico' ) )\n\t\t\t\t\texternal.notifyIcon.setIcon( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\tray.ico', 0 );\n\t\t\t\telse\n\t\t\t\t\texternal.notifyIcon.setIcon( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\default.ico', 0 );\n\t\t\t}\n\t\t\texternal.notifyIcon.update();\n\t\t\tsetTimeout( 'external.globals( \\'ClientRoster\\' ).UnreadFlash( ' + Times + ' )', 400 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.IsFlashing = false;\n\t\t}\n\t}\n\n\t/* Redraw all contacts\n\t */\n\tfunction RefreshAll ()\n\t{\n\t\tvar itemnames = ( new VBArray( this.Items.Keys() ) ).toArray();\n\t\tfor ( var i = 0; i < itemnames.length; ++i )\n\t\t\tthis.Items( itemnames[i] ).RefreshAll();\n\t}\n\n\t/* Parses the XML in search of an avatar\n\t * Returns the relative path to the avatar file\n\t */\n\tfunction GetAvatar ( str, jid )\n\t{\n\t\tstr = str.toLowerCase();\n\n\t\t/* Default avatar mapping\n\t\t */\n\t\tfor ( var i = str.length; i > 1; i-- )\n\t\t\tif ( AvatarMap.Exists( str.substr( 0, i ) ) )\n\t\t\t\treturn AvatarMap( str.substr( 0, i ) ) + '.gif';\n\n\t\t/* Transport contact\n\t\t */\n\t\tvar domain = jid.indexOf( '@' ) > -1 ? jid.substr( jid.indexOf( '@' ) + 1 ) : jid;\n\t\tif ( external.globals( 'ClientServices' ).Services.Exists( domain ) && external.globals( 'ClientServices' ).Services( domain ).Options & 0x0001 )\n\t\t\tswitch ( external.globals( 'ClientServices' ).Services( domain ).Options & 0xF81E )\n\t\t\t{\n\t\t\t\tcase 0x0002: return 'msn.gif';\n\t\t\t\tcase 0x0004: return 'icq.gif';\n\t\t\t\tcase 0x0008: return 'aim.gif';\n\t\t\t\tcase 0x0010: return 'yahoo.gif';\n\t\t\t\tcase 0x0800: return 'gadugadu.gif';\n\t\t\t\tcase 0x1000: return 'email.gif';\n\t\t\t\tcase 0x2000: return 'sms.gif';\n\t\t\t\tcase 0x4000: return 'weather.gif';\n\t\t\t\tcase 0x8000: return 'tlen.gif';\n\t\t\t}\n\n\t\t/* Guess the transport and add it to the services list\n\t\t */\n\t\tif ( domain.charAt( 3 ) == '.' )\n\t\t\tswitch ( domain.substr( 0, 3 ) )\n\t\t\t{\n\t\t\t\tcase 'msn': external.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x0002 ); return 'msn.gif';\n\t\t\t\tcase 'icq': external.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x0004 ); return 'icq.gif';\n\t\t\t\tcase 'aim': external.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x0008 ); return 'aim.gif';\n\t\t\t\tcase 'sms': external.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x2000 ); return 'sms.gif';\n\t\t\t\tcase 'yim': external.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x0010 ); return 'yahoo.gif';\n\t\t\t}\n\t\tif ( domain.substr( 0, 3 ) == 'gg.' )\n\t\t{\n\t\t\texternal.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x0800 );\n\t\t\treturn 'gadugadu.gif';\n\t\t}\n\t\tif ( domain.substr( 0, 5 ) == 'tlen.' )\n\t\t{\n\t\t\texternal.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x8000 );\n\t\t\treturn 'tlen.gif';\n\t\t}\n\t\tif ( domain.substr( 0, 6 ) == 'email.' )\n\t\t{\n\t\t\texternal.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x1000 );\n\t\t\treturn 'email.gif';\n\t\t}\n\t\tif ( domain.substr( 0, 6 ) == 'yahoo.' )\n\t\t{\n\t\t\texternal.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x0010 );\n\t\t\treturn 'yahoo.gif';\n\t\t}\n\t\tif ( domain.substr( 0, 7 ) == 'aspsms.' )\n\t\t{\n\t\t\texternal.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x2000 );\n\t\t\treturn 'sms.gif';\n\t\t}\n\t\tif ( domain.substr( 0, 8 ) == 'weather.' )\n\t\t{\n\t\t\texternal.globals( 'ClientServices' ).AddService( domain, 0x0001 | 0x4000 );\n\t\t\treturn 'weather.gif';\n\t\t}\n\n\t\t/* Generic service icon\n\t\t */\n\t\tif ( jid.indexOf( '/' ) == -1 && str.length == 0 )\n\t\t\treturn 'cog.gif';\n\n\t\treturn '';\n\t}\n\n\t/* Send fake presence packets to the rosteritems so they all go offline\n\t */\n\tfunction AllOffline ()\n\t{\n\t\tvar itemnames = ( new VBArray( this.Items.Keys() ) ).toArray();\n\t\tvar presence = new XMPPPresence();\n\t\tpresence.Type = 'unavailable';\n\t\tfor ( var i = 0; i < itemnames.length; ++i )\n\t\t\tif ( this.Items( itemnames[i] ).Resources.Count )\n\t\t\t{\n\t\t\t\tvar theItem = this.Items( itemnames[i] );\n\t\t\t\tvar resources = ( new VBArray( theItem.Resources.Keys() ) ).toArray();\n\t\t\t\tfor ( var j = 0; j < resources.length; ++j )\n\t\t\t\t\ttheItem.ReceivePresence( theItem.JID, resources[j], presence );\n\t\t\t}\n\t}\n\n\t/* Remove all groups, items and resources from the roster\n\t */\n\tfunction Clear ()\n\t{\n\t\tdocument.getElementById( 'unread-messages-area' ).style.display = 'none';\n\t\tvar itemnames = ( new VBArray( this.Items.Keys() ) ).toArray();\n\t\tfor ( var i = 0; i < itemnames.length; ++i )\n\t\t\tthis.Items( itemnames[i] ).Clear();\n\t\tthis.Items.RemoveAll();\n\t\tvar groupnames = ( new VBArray( this.Groups.Keys() ) ).toArray();\n\t\tfor ( var i = 0; i < groupnames.length; ++i )\n\t\t\tthis.Groups( groupnames[i] ).Clear();\n\t\tthis.Groups.RemoveAll();\n\t}\n\n\t/* Parses Presence objects\n\t */\n\tfunction ReceivePresence ( Presence )\n\t{\n\t\tvar ShortAddress = Presence.FromAddress.ShortAddress();\n\t\tif ( external.globals( 'ClientServices' ).Services.Exists( ShortAddress ) || external.globals( 'ClientServices' ).PendingDisco.Exists( ShortAddress ) )\n\t\t\texternal.globals( 'ClientServices' ).FromPresence( Presence );\n\t\telse if ( this.Items.Exists( ShortAddress ) )\n\t\t{\n\t\t\tif ( Presence.Type != 'error' )\n\t\t\t{\n\t\t\t\t/* Play notification sounds and show toaster\n\t\t\t\t */\n\t\t\t\tif ( external.globals( 'cfg' )( 'lastmode' ) < 2 || external.globals( 'cfg' )( 'lastmode' ) == 5 )\n\t\t\t\t\tfor ( var i = 0; i < this.Items( ShortAddress ).Groups.length; i++ )\n\t\t\t\t\t\tif ( this.Groups( this.Items( ShortAddress ).Groups[i] ).ShowAll )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( Presence.Type == 'unavailable' && external.globals( 'cfg' )( 'soundoffline' ).toString() == 'true' && this.Items( ShortAddress ).Resources.Count )\n\t\t\t\t\t\t\t\tsound_play( external.globals( 'cfg' )( 'soundofflinefile' ), false );\n\t\t\t\t\t\t\telse if ( Presence.Type == 'available' && external.globals( 'cfg' )( 'soundonline' ).toString() == 'true' && ! this.Items( ShortAddress ).Resources.Count )\n\t\t\t\t\t\t\t\tsound_play( external.globals( 'cfg' )( 'soundonlinefile' ), false );\n\t\t\t\t\t\t\tif ( Presence.Type == 'available' && external.globals( 'cfg' )( 'alertonline' ).toString() == 'true' && ! this.Items( ShortAddress ).Resources.Count && external.globals( 'connecttime' ) + 30000 < ( new Date() ).getTime() )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar Toaster\t\t\t\t\t= new Headline();\n\t\t\t\t\t\t\t\tToaster.Archive\t\t\t\t= false;\n\t\t\t\t\t\t\t\tToaster.ShowOptions\t\t\t= true;\n\t\t\t\t\t\t\t\tToaster.OpenConversation\t= Presence.FromAddress;\n\t\t\t\t\t\t\t\tToaster.Address\t\t\t\t= Presence.FromAddress;\n\t\t\t\t\t\t\t\tToaster.Title\t\t\t\t= this.Items( ShortAddress ).Name;\n\t\t\t\t\t\t\t\tToaster.Message\t\t\t\t= external.globals( 'Translator' ).Translate( 'main', 'user_online', [ this.Items( ShortAddress ).Name ] );\n\t\t\t\t\t\t\t\tToaster.Show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t/* Pass the presence on to the item\n\t\t\t\t */\n\t\t\t\tthis.Items( ShortAddress ).ReceivePresence( ShortAddress, Presence.FromAddress.Resource, Presence );\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Private function that does the grunt work of updating the roster exactly as specified\n\t */\n\tfunction ParseXMLItem ( roster, jid, contact )\n\t{\n\t\tvar name = contact.getAttribute( 'name' );\n\t\tvar subscription = contact.getAttribute( 'subscription' );\n\t\tvar ask = contact.getAttribute( 'ask' );\n\n\t\t/* none: I can't see him + he can't see me -> Unknown Status\n\t\t * from: I can't see him + he can see me -> Unknown Status\n\t\t * to: I can see him + he can't see me -> Offline\n\t\t * both: I can see him + he can see me -> Offline\n\t\t *\n\t\t * subscription=\"none\" + ask=\"subscribe\" -> Awaiting Authorization\n\t\t * subscription=\"from\" + ask=\"subscribe\" -> Awaiting Authorization\n\t\t */\n\n\t\t/* Delete the item\n\t\t */\n\t\tif ( subscription == 'remove' )\n\t\t{\n\t\t\tif ( roster.Items.Exists( jid ) )\n\t\t\t\troster.Items( jid ).Clear();\n\t\t\tif ( roster.Items.Exists( jid ) )\n\t\t\t\troster.Items( jid ).UpdateTracker();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! name || name == jid )\n\t\t{\n\t\t\tname = ( new XMPPAddress( jid ) ).CleanAddress();\n\t\t\t/* Retrieve the nickname from the JUD\n\t\t\t */\n\t\t\tif ( ! roster.LoadingVcard.Exists( jid ) )\n\t\t\t{\n\t\t\t\troster.LoadingVcard.Add( jid, null );\n\t\t\t\tvar hook\t\t= new XMPPHookIQ();\n\t\t\t\thook.Window\t\t= external.wnd;\n\t\t\t\thook.Callback\t= 'ClientRosterVcard';\n\t\t\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\t\t\tdom.loadXML( '<iq type=\"get\"><vCard xmlns=\"vcard-temp\"/></iq>' );\n\t\t\t\tdom.documentElement.setAttribute( 'id', hook.Id );\n\t\t\t\tdom.documentElement.setAttribute( 'to', jid );\n\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t}\n\t\t}\n\n\t\t/* Add the item to its rostergroups and draw them\n\t\t */\n\t\tif ( ! roster.Items.Exists( jid ) )\n\t\t{\n\t\t\t/* Get a list of all groups this contact is in, or add to default group\n\t\t\t */\n\t\t\tvar groupnodes = contact.selectNodes( 'group' );\n\t\t\tvar groups = new Array();\n\t\t\tfor ( var j = 0; j < groupnodes.length; ++j )\n\t\t\t{\n\t\t\t\tvar groupname = groupnodes.item( j ).text;\n\t\t\t\tif ( groupname == 'Groupless' || groupname == 'General' || groupname == 'Unfiled' || groupname == 'Contacts' )\n\t\t\t\t\tgroupname = external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' );\n\t\t\t\tif ( groupname.length )\n\t\t\t\t\tgroups.push( groupname );\n\t\t\t}\n\t\t\tif ( ! groups.length )\n\t\t\t\tgroups.push( external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' ) );\n\t\t\t/* Draw the offline item in the groups\n\t\t\t */\n\t\t\tfor ( var j = 0; j < groups.length; ++j )\n\t\t\t{\n\t\t\t\twith ( roster.CreateGroup( groups[j] ).CreateItem( jid ) )\n\t\t\t\t{\n\t\t\t\t\tName = name;\n\t\t\t\t\tSubscription = subscription;\n\t\t\t\t\tAsk = ask;\n\n\t\t\t\t\tvar GroupExists = false;\n\t\t\t\t\tfor ( var k = 0; k < Groups.length; ++k )\n\t\t\t\t\t\tif ( Groups[k] == groups[j] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupExists = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tif ( ! GroupExists )\n\t\t\t\t\t\tGroups.push( groups[j] );\n\n\t\t\t\t\tif ( roster.Groups( groups[j] ).Items.Count == 1 )\n\t\t\t\t\t\troster.Groups( groups[j] ).Draw();\n\t\t\t\t\telse if ( roster.Groups( groups[j] ).ShowOffline )\n\t\t\t\t\t\tDraw( roster.Groups( groups[j] ) );\n\t\t\t\t\t/* Hide the \"display offline contacts\" button\n\t\t\t\t\t */\n\t\t\t\t\tvar itemnames = ( new VBArray( roster.Groups( groups[j] ).Items.Keys() ) ).toArray();\n\t\t\t\t\tvar o;\n\t\t\t\t\tfor ( o = 0; o < itemnames.length; ++o )\n\t\t\t\t\t\tif ( ! roster.Items( itemnames[o] ).Resources.Count )\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\tif ( o < itemnames.length )\n\t\t\t\t\t\troster.Groups( groups[j] ).HTMLShowAll.style.display = 'inline';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Check its groups and redraw the groups, items or resources\n\t\t */\n\t\telse if ( subscription == 'to' || subscription == 'both' )\n\t\t{\n\t\t\tvar theItem = roster.Items( jid );\n\t\t\t/* Get a new list of all groups this contact is in, or add to default group\n\t\t\t */\n\t\t\tvar newgroups = new ActiveXObject( 'Scripting.Dictionary' );\n\t\t\tvar groupnodes = contact.selectNodes( 'group' );\n\t\t\tfor ( var l = 0; l < groupnodes.length; ++l )\n\t\t\t{\n\t\t\t\tvar groupname = groupnodes.item( l ).text;\n\t\t\t\tif ( groupname == 'Groupless' || groupname == 'General' || groupname == 'Unfiled' || groupname == 'Contacts' )\n\t\t\t\t\tgroupname = external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' );\n\t\t\t\tif ( groupname.length && ! newgroups.Exists( groupname ) )\n\t\t\t\t\tnewgroups.Add( groupname, null );\n\t\t\t}\n\t\t\tif ( ! newgroups.Count )\n\t\t\t\tnewgroups.Add( external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' ), null );\n\t\t\t/* Delete the item from any groups it is no longer part of\n\t\t\t */\n\t\t\tfor ( var m = 0; m < theItem.Groups.length; ++m )\n\t\t\t\tif ( ! newgroups.Exists( theItem.Groups[m] ) )\n\t\t\t\t{\n\t\t\t\t\tvar theGroup = roster.Groups( theItem.Groups[m] );\n\t\t\t\t\tif ( theItem.Resources.Count )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Remove online resources\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvar resources = ( new VBArray( theItem.Resources.Keys() ) ).toArray();\n\t\t\t\t\t\tfor ( var o = 0; o < resources.length; ++o )\n\t\t\t\t\t\t\ttheItem.Resources( resources[o] ).Hide( theGroup );\n\t\t\t\t\t\ttheGroup.Items.Remove( jid );\n \t\t\t\t\t\tif ( theGroup.Items.Count )\n\t\t\t\t\t\t\ttheGroup.HTMLOnline.firstChild.style.display = theGroup.HTMLOnline.children.length > 1 ? 'none' : 'block';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttheGroup.Clear();\n\t\t\t\t\t\t\troster.Groups.Remove( theItem.Groups[m] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Remove offline item\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttheItem.Hide( theGroup );\n\t\t\t\t\t\ttheGroup.Items.Remove( jid );\n\t\t\t\t\t\tif ( ! theGroup.Items.Count )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttheGroup.Clear();\n\t\t\t\t\t\t\troster.Groups.Remove( theItem.Groups[m] );\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/* Hide the \"display offline contacts\" button\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tvar itemnames = ( new VBArray( theGroup.Items.Keys() ) ).toArray();\n\t\t\t\t\t\t\tvar q;\n\t\t\t\t\t\t\tfor ( q = 0; q < itemnames.length; ++q )\n\t\t\t\t\t\t\t\tif ( ! roster.Items( itemnames[q] ).Resources.Count )\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif ( q >= itemnames.length )\n\t\t\t\t\t\t\t\ttheGroup.HTMLShowAll.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t/* Show the rosteritem or its resources in the new list of groups\n\t\t\t */\n\t\t\ttheItem.Name = name;\n\t\t\ttheItem.Subscription = subscription;\n\t\t\ttheItem.Ask = ask;\n\t\t\ttheItem.Groups = ( new VBArray( newgroups.Keys() ) ).toArray();\n\t\t\tfor ( var n = 0; n < theItem.Groups.length; ++n )\n\t\t\t{\n\t\t\t\tvar theGroup = roster.CreateGroup( theItem.Groups[n] );\n\t\t\t\tif ( ! theGroup.HTMLHeader.className )\n\t\t\t\t\ttheGroup.Draw();\n\t\t\t\tif ( theItem.Resources.Count )\n\t\t\t\t{\n\t\t\t\t\t/* Resources\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! theGroup.Items.Exists( jid ) )\n\t\t\t\t\t\ttheGroup.Items.Add( jid, null );\n\t\t\t\t\tvar resources = ( new VBArray( theItem.Resources.Keys() ) ).toArray();\n\t\t\t\t\tfor ( var p = 0; p < resources.length; ++p )\n\t\t\t\t\t{\n\t\t\t\t\t\ttheResource = theItem.Resources( resources[p] );\n\t\t\t\t\t\tif ( theResource.HTMLElements.Exists( theGroup.Name ) )\n\t\t\t\t\t\t\ttheResource.Redraw( theGroup );\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttheResource.Draw( theGroup );\n\t\t\t\t\t\t\t/* Hide the \"no one is online\" text\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\ttheGroup.HTMLOnline.firstChild.style.display = 'none';\n\t\t\t\t\t\t\t/* Hide the \"display offline contacts\" button\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tvar itemnames = ( new VBArray( theGroup.Items.Keys() ) ).toArray();\n\t\t\t\t\t\t\tvar q;\n\t\t\t\t\t\t\tfor ( q = 0; q < itemnames.length; ++q )\n\t\t\t\t\t\t\t\tif ( ! roster.Items( itemnames[q] ).Resources.Count )\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif ( q >= itemnames.length )\n\t\t\t\t\t\t\t\ttheGroup.HTMLShowAll.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/* Offline item\n\t\t\t\t\t */\n\t\t\t\t\tif ( theGroup.Items.Exists( jid ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( theItem.HTMLElements.Exists( theGroup.Name ) )\n\t\t\t\t\t\t\ttheItem.Update( theGroup );\n\t\t\t\t\t\telse if ( theGroup.ShowOffline )\n\t\t\t\t\t\t\ttheItem.Draw( theGroup );\n\t\t\t\t\t}\n\t\t\t\t\telse if ( theGroup.ShowOffline )\n\t\t\t\t\t{\n\t\t\t\t\t\ttheGroup.Items.Add( jid, null );\n\t\t\t\t\t\tif ( theGroup.ShowOffline )\n\t\t\t\t\t\t\ttheItem.Draw( theGroup );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ttheGroup.Items.Add( jid, null );\n\t\t\t\t\tif ( theGroup.ShowAll )\n\t\t\t\t\t\ttheGroup.HTMLShowAll.style.display = 'inline';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Make it go offline with lurker|awaiting status\n\t\t */\n\t\telse\n\t\t{\n\t\t\tvar theItem = roster.Items( jid );\n\t\t\t/* Delete the resources.\n\t\t\t */\n\t\t\tvar resources = ( new VBArray( theItem.Resources.Keys() ) ).toArray();\n\t\t\tfor ( var j = 0; j < resources.length; ++j )\n\t\t\t\ttheItem.Resources( resources[j] ).Clear();\n\t\t\ttheItem.Resources.RemoveAll();\n\t\t\t/* Get a new list of all groups this contact is in, or add to default group\n\t\t\t */\n\t\t\tvar newgroups = new ActiveXObject( 'Scripting.Dictionary' );\n\t\t\tvar groupnodes = contact.selectNodes( 'group' );\n\t\t\tfor ( var l = 0; l < groupnodes.length; ++l )\n\t\t\t{\n\t\t\t\tvar groupname = groupnodes.item( l ).text;\n\t\t\t\tif ( groupname == 'Groupless' || groupname == 'General' || groupname == 'Unfiled' || groupname == 'Contacts' )\n\t\t\t\t\tgroupname = external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' );\n\t\t\t\tif ( groupname.length && ! newgroups.Exists( groupname ) )\n\t\t\t\t\tnewgroups.Add( groupname, null );\n\t\t\t}\n\t\t\tif ( ! newgroups.Count )\n\t\t\t\tnewgroups.Add( external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' ), null );\n\t\t\t/* Delete the item from any groups it is no longer part of\n\t\t\t */\n\t\t\tfor ( var m = 0; m < theItem.Groups.length; ++m )\n\t\t\t\tif ( ! newgroups.Exists( theItem.Groups[m] ) )\n\t\t\t\t{\n\t\t\t\t\tvar theGroup = roster.Groups( theItem.Groups[m] );\n\t\t\t\t\ttheItem.Hide( theGroup );\n\t\t\t\t\ttheGroup.Items.Remove( jid );\n\t\t\t\t\tif ( ! theGroup.Items.Count )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Remove the group if it's empty\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttheGroup.Clear();\n\t\t\t\t\t\troster.Groups.Remove( theItem.Groups[m] );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Hide or show the \"no one is online\" text\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttheGroup.HTMLOnline.firstChild.style.display = theGroup.HTMLOnline.children.length > 1 ? 'none' : 'block';\n\t\t\t\t\t\t/* Hide the \"display offline contacts\" button\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvar itemnames = ( new VBArray( theGroup.Items.Keys() ) ).toArray();\n\t\t\t\t\t\tvar o;\n\t\t\t\t\t\tfor ( o = 0; o < itemnames.length; ++o )\n\t\t\t\t\t\t\tif ( ! roster.Items( itemnames[o] ).Resources.Count )\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tif ( o >= itemnames.length )\n\t\t\t\t\t\t\ttheGroup.HTMLShowAll.style.display = 'none';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t/* Show the rosteritem in the new list of groups\n\t\t\t */\n\t\t\ttheItem.Name = name ? name : jid;\n\t\t\ttheItem.Subscription = subscription;\n\t\t\ttheItem.Ask = ask;\n\t\t\ttheItem.Groups = ( new VBArray( newgroups.Keys() ) ).toArray();\n\t\t\tfor ( var n = 0; n < theItem.Groups.length; ++n )\n\t\t\t{\n\t\t\t\tvar theGroup = roster.CreateGroup( theItem.Groups[n] );\n\t\t\t\tif ( ! theGroup.HTMLHeader.className )\n\t\t\t\t\ttheGroup.Draw();\n\t\t\t\tif ( theGroup.Items.Exists( jid ) )\n\t\t\t\t{\n\t\t\t\t\tif ( theItem.HTMLElements.Exists( theGroup.Name ) )\n\t\t\t\t\t\ttheItem.Update( theGroup );\n\t\t\t\t\telse if ( theGroup.ShowOffline )\n\t\t\t\t\t\ttheItem.Draw( theGroup );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttheGroup.Items.Add( jid, null );\n\t\t\t\t\tif ( theGroup.ShowOffline )\n\t\t\t\t\t\ttheItem.Draw( theGroup );\n\t\t\t\t}\n\t\t\t\tif ( theGroup.ShowAll )\n\t\t\t\t\ttheGroup.HTMLShowAll.style.display = 'inline';\n\t\t\t}\n\t\t}\n\t\t/* Update conversation window\n\t\t */\n\t\tif ( roster.Items.Exists( jid ) )\n\t\t\troster.Items( jid ).UpdateTracker();\n\t}\n\n\t/* Parses roster-updates\n\t */\n\tfunction ReceiveSetFromIQ ( iq )\n\t{\n\t\tvar contacts = iq.XMLDOM.selectNodes( '/iq/query/item[@jid]' );\n\t\tfor ( var i = 0; i < contacts.length; i++ )\n\t\t{\n\t\t\tvar contact = contacts.item(i);\n\t\t\tvar jid = contact.getAttribute( 'jid' ).toLowerCase();\n\t\t\tif ( contact.getAttribute( 'subscription' ) != 'remove' && ( ! jid.length || jid.indexOf( '/' ) != -1 || external.globals( 'ClientServices' ).PendingDisco.Exists( jid ) || ( external.globals( 'ClientServices' ).Services.Exists( jid ) && ( external.globals( 'ClientServices' ).Services( jid ).Options & 0x001 == 0x001 ) ) ) )\n\t\t\t\texternal.globals( 'ClientServices' ).FromIQRoster( contact );\n\t\t\telse\n\t\t\t\tParseXMLItem( this, jid, contact );\n\t\t}\n\t}\n\n\t/* Update the roster according to the new jabber:iq:roster result\n\t */\n\tfunction ReloadFromIQ ( iq )\n\t{\n\t\tvar oldjids = ( new VBArray( this.Items.Keys() ) ).toArray();\n\t\tvar newjids = new ActiveXObject( 'Scripting.Dictionary' );\n\t\tvar contacts = iq.XMLDOM.selectNodes( '/iq/query/item[@jid]' );\n\t\tfor ( var i = 0; i < contacts.length; i++ )\n\t\t{\n\t\t\tvar jid = contacts.item(i).getAttribute( 'jid' ).toLowerCase();\n\t\t\tif ( ! jid.length || jid.indexOf( '/' ) != -1 || external.globals( 'ClientServices' ).PendingDisco.Exists( jid ) || ( external.globals( 'ClientServices' ).Services.Exists( jid ) && ( external.globals( 'ClientServices' ).Services( jid ).Options & 0x001 == 0x001 ) ) )\n\t\t\t{\n\t\t\t\texternal.globals( 'ClientServices' ).FromIQRoster( contacts.item(i) );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tParseXMLItem( this, jid, contacts.item(i) );\n\t\t\tif ( ! newjids.Exists( jid ) )\n\t\t\t\tnewjids.Add( jid, null );\n\t\t}\n\t\tfor ( var j = 0; j < oldjids.length; ++j )\n\t\t\tif ( ! newjids.Exists( oldjids[j] ) )\n\t\t\t\tthis.Items( oldjids[j] ).Clear();\n\t}\n\n\t/* Parses IQ packets\n\t * Returns true or false, depending on whether the packet contained a valid roster\n\t */\n\tfunction FromIQ ( iq )\n\t{\n\t\tvar items = iq.XMLDOM.selectNodes( '/iq/query/item[@jid]' );\n\t\tfor ( var i = 0; i < items.length; ++i )\n\t\t{\n\t\t\tvar contact = items.item( i );\n\t\t\tvar jid = contact.getAttribute( 'jid' ).toLowerCase();\n\t\t\tif ( ! jid.length || jid.indexOf( '/' ) != -1 || external.globals( 'ClientServices' ).PendingDisco.Exists( jid ) || ( external.globals( 'ClientServices' ).Services.Exists( jid ) && ( external.globals( 'ClientServices' ).Services( jid ).Options & 0x001 == 0x001 ) ) )\n\t\t\t{\n\t\t\t\texternal.globals( 'ClientServices' ).FromIQRoster( contact );\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Get a list of all groups this contact is in, or add to default group\n\t\t\t */\n\t\t\tvar groupnodes = contact.selectNodes( 'group' );\n\t\t\tvar groups = new ActiveXObject( 'Scripting.Dictionary' );\n\t\t\tfor ( var j = 0; j < groupnodes.length; ++j )\n\t\t\t{\n\t\t\t\tvar groupname = groupnodes.item( j ).text;\n\t\t\t\tif ( groupname == 'Groupless' || groupname == 'General' || groupname == 'Unfiled' || groupname == 'Contacts' )\n\t\t\t\t\tgroupname = external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' );\n\t\t\t\tif ( groupname.length && ! groups.Exists( groupname ) )\n\t\t\t\t\tgroups.Add( groupname, null );\n\t\t\t}\n\t\t\tgroups = ( new VBArray( groups.Keys() ) ).toArray();\n\t\t\tif ( ! groups.length )\n\t\t\t\tgroups.push( external.globals( 'Translator' ).Translate( 'main', 'cl_default_group' ) );\n\t\t\t/* Create the necessary ClientRosterGroup(s) and ClientRosterItem(s)\n\t\t\t */\n\t\t\tvar name = contact.getAttribute( 'name' );\n\t\t\tif ( ! name || name == jid )\n\t\t\t{\n\t\t\t\tname = ( new XMPPAddress( jid ) ).CleanAddress();\n\t\t\t\t/* Retrieve the nickname from the JUD\n\t\t\t\t */\n\t\t\t\tif ( ! this.LoadingVcard.Exists( jid ) )\n\t\t\t\t{\n\t\t\t\t\tthis.LoadingVcard.Add( jid, null );\n\t\t\t\t\tvar hook\t\t= new XMPPHookIQ();\n\t\t\t\t\thook.Window\t\t= external.wnd;\n\t\t\t\t\thook.Callback\t= 'ClientRosterVcard';\n\t\t\t\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\t\t\t\tdom.loadXML( '<iq type=\"get\"><vCard xmlns=\"vcard-temp\"/></iq>' );\n\t\t\t\t\tdom.documentElement.setAttribute( 'id', hook.Id );\n\t\t\t\t\tdom.documentElement.setAttribute( 'to', jid );\n\t\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar subscription = contact.getAttribute( 'subscription' );\n\t\t\tvar ask = contact.getAttribute( 'ask' );\n\t\t\tfor ( var j = 0; j < groups.length; ++j )\n\t\t\t\twith ( this.CreateGroup( groups[j] ).CreateItem( jid ) )\n\t\t\t\t{\n\t\t\t\t\tName = name;\n\t\t\t\t\tSubscription = subscription;\n\t\t\t\t\tAsk = ask;\n\n\t\t\t\t\tvar GroupExists = false;\n\t\t\t\t\tfor ( var k = 0; k < Groups.length; ++k )\n\t\t\t\t\t\tif ( Groups[k] == groups[j] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupExists = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\tif ( ! GroupExists )\n\t\t\t\t\t\tGroups.push( groups[j] );\n\t\t\t\t}\n\t\t}\n\t\t/* Show the roster in the HTML\n\t\t */\n\t\tvar groupnames = ( new VBArray( this.Groups.Keys() ) ).toArray().sort( function(a,b){var c=a.toLowerCase();var d=b.toLowerCase();return c==d?0:c<d?-1:1} );\n\t\tfor ( var i = 0; i < groupnames.length; ++i )\n\t\t\tthis.Groups( groupnames[i] ).Draw();\n\n\t\treturn this.Items.Count > 0;\n\t}\n\n\t/* Return a new ClientRosterGroup object\n\t * If there is already a group with that name, the current ClientRosterGroup object is returned\n\t */\n\tfunction CreateGroup ( name )\n\t{\n\t\tif ( ! this.Groups.Exists( name ) )\n\t\t\tthis.Groups.Add( name, new ClientRosterGroup( this, name ) );\n\t\treturn this.Groups( name );\n\t}\n}", "title": "" }, { "docid": "1737f5871d1eec28b66047f406a47062", "score": "0.53778356", "text": "function ServerComm() {}", "title": "" }, { "docid": "0701f4e6a6acb07e72f2c55743f0b87a", "score": "0.53573143", "text": "function init(){\n\ttry{\n\t\tdocument.getElementById(\"threadTree\").addEventListener(\"select\", refreshXDSL, false);\n\t}catch(e) {}\n\t\n\twindow.addEventListener( \"compose-send-message\", send_event_handler, true );\n\t\n\ttry{\n\t\tdocument.getElementById( \"msgcomposeWindow\" )\n\t\t.addEventListener( \"compose-window-reopen\", function(e){//alert(\"Compose reuse\");\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"soPath-split\").setAttribute( \"state\",\"collapsed\");\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"xdsl-loader\").hidden=true;\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"SP\").innerHTML=\"\";\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}, false );\n\t}catch (e) {}\n\tmyPrefObserver.register();\n\ttry{\n\t\tshowSoThunder();\t\n\t}catch(e) {}\n}", "title": "" }, { "docid": "f0f8415854069eeb36c1674b18c5526e", "score": "0.53507143", "text": "function connect() {\t\r\n var socket = new SockJS('/chatonli');\r\n stompClient = Stomp.over(socket);\r\n stompClient.connect({}, function(frame) {\r\n setConnected(true);\r\n console.log('Connected: ' + frame);\r\n stompClient.subscribe('/topic/chatmsj', function(msj){\r\n showChatMsj(msj);\r\n });\r\n });\r\n}", "title": "" }, { "docid": "db9400473bba1f9670b78848189d98d5", "score": "0.53205085", "text": "function sned(ms){\n\tfor(i=0;i<2;i++){\n\t\tif(players[i]!==undefined){players[i].send(ms)}\n\t}for(i=0;i<players[2].length;i++){\n\t\tplayers[2][i].send(ms);\n\t}\n}", "title": "" }, { "docid": "c531188d843960ad2cb35b4a2eb64dda", "score": "0.53174996", "text": "function initializeCommunication()\n{\n \n \n var api = getAPIHandle();\n\n if ( api == null )\n {\n //parent.status = \"This is a standalone course. Tracking on the LMS is disabled.\";\n //alert(\"This course is currently being viewed in Offline Mode. No tracking data will be passed to the LMS.\");\n return \"false\";\n }\n else\n {\n var result = api.LMSInitialize(\"\");\n\n if ( result != \"true\" )\n {\n var errCode = retrieveLastErrorCode();\n\n displayErrorInfo( errCode );\n\n // may want to do some error handling\n }\n }\n\n // Initialize the parameters from the LMS \n\n completionStatus = api.LMSGetValue(\"cmi.core.lesson_status\");\n \n var l_interactionIndex = api.LMSGetValue(\"cmi.interactions._count\"); \n lastinteractionIndex = parseInt(l_interactionIndex);\n \n if ((completionStatus == \"unknown\") || (completionStatus == \"not attempted\") )\n {\n api.LMSSetValue(\"cmi.core.lesson_status\", \"incomplete\");\n api.LMSSetValue(\"cmi.core.score.max\", maxScore);\n api.LMSSetValue(\"cmi.core.score.min\", minScore);\n } else { \n\n locationData = api.LMSGetValue(\"cmi.core.lesson_location\");\n suspendData = api.LMSGetValue(\"cmi.suspend_data\");\n score = api.LMSGetValue(\"cmi.core.score.raw\");\n }\n \n //alert(\"completionStatus: \" + completionStatus + \" locationData: \" + locationData + \" suspendData: \" + suspendData + \" interactionIndex: \" + interactionIndex);\n return result;\n}", "title": "" }, { "docid": "dcc9e161f7b435571dab296c1a486a64", "score": "0.52973497", "text": "function sendMessage() {\n\t//get the message content & trim white spaces\n var messageContent = $('#message').val().trim();\n\n\t//check if winner\n\t\t//check if the final answer is YES\n\t\tif (messageContent.startsWith('YES') && currentState && endOfGame == false) {\n\t\t\t//check if player 1 is asking & player 2 is answering\n\t\t\tif (currentState == \"3\" && myRole==\"3\") { \n\t\t\t\tsendWin(\"1\"); //send that player 1 wins & player 2 loses\n\t\t\t}\n\t\t\t//check if player 2 is asking & player 1 is answering\n\t\t\telse if (currentState == \"4\" && myRole==\"2\"){\n\t\t\t\tsendWin(\"2\"); //send that player 2 wins & player 1 loses\n\t\t\t}\n\t\t\t\n\t\t\tendOfGame = true; \n\t\t}\n\t\t//check if the final answer is NO\n\t\telse if (messageContent.startsWith('NO') && currentState && endOfGame == false) {\n\t\t\t//check if player 1 is asking & player 2 is answering\n\t\t\tif (currentState == \"3\"&& myRole==\"3\") { \n\t\t\t\tsendWin(\"2\"); //send that player 1 loses & player 2 win\n\t\t\t\t\n\t\t\t}\n\t\t\t//check if player 2 is asking & player 1 is answering\n\t\t\telse if(currentState == \"4\"&& myRole==\"2\"){\n\t\t\t\tsendWin(\"1\"); //send that player 2 loses & player 1 win\n\t\t\t}\n\t\t\t\n\t\t\tendOfGame = true; \n\t\t}\n\t//check if message & stompclient is not null \n if (messageContent && stompClient) {\n var chatMessage = {\n sender: username,\n content: messageContent,\n type: 'CHAT'\n };\n\t\t//send the complete chat Message - interacts with controller at this point\n stompClient.send(`${topic}/sendMessage`, {}, JSON.stringify(chatMessage));\n }\n $('#message').val( '');\n}", "title": "" }, { "docid": "3445487fd94f1a38fc8dde0e786cd24d", "score": "0.5291479", "text": "function masterSockMsg(msg) {\n msg = new DataView(msg.data);\n var cmd = msg.getUint32(0, true);\n var p;\n\n switch (cmd) {\n case prot.ids.info:\n p = prot.parts.info;\n var key = msg.getUint32(p.key, true);\n var val = msg.getUint32(p.value, true);\n switch (key) {\n case prot.info.creditCost:\n // Informing us of the cost of credits\n var v2 = msg.getUint32(p.value + 4, true);\n ui.masterUI.creditCost = {\n currency: val,\n credits: v2\n };\n break;\n\n case prot.info.creditRate:\n // Informing us of the total cost and rate in credits\n var v2 = msg.getUint32(p.value + 4, true);\n ui.masterUI.creditRate = [val, v2];\n masterUpdateCreditCost();\n break;\n }\n break;\n\n case prot.ids.user:\n p = prot.parts.user;\n var index = msg.getUint32(p.index, true);\n var status = msg.getUint32(p.status, true);\n var nick = decodeText(msg.buffer.slice(p.nick));\n\n // Add it to the UI\n var speech = ui.masterUI.speech = ui.masterUI.speech || [];\n while (speech.length <= index)\n speech.push(null);\n speech[index] = {\n nick: nick,\n online: !!status,\n speaking: false\n };\n\n updateMasterSpeech();\n break;\n\n case prot.ids.speech:\n p = prot.parts.speech;\n var indexStatus = msg.getUint32(p.indexStatus, true);\n var index = indexStatus>>>1;\n var status = (indexStatus&1);\n if (!ui.masterUI.speech[index]) return;\n ui.masterUI.speech[index].speaking = !!status;\n updateMasterSpeech();\n break;\n }\n}", "title": "" }, { "docid": "81c33618c3619e3c43261ca4dd738355", "score": "0.52777535", "text": "function Presence() {\n \n}", "title": "" }, { "docid": "9de9eda8f1f4bd022e1cd9500cbb7ed3", "score": "0.5274394", "text": "sendPresenceAvailable () {\n Store.WapQuery.sendPresenceAvailable()\n }", "title": "" }, { "docid": "6be69a9fd0755b6f5ab8225a604a1d7f", "score": "0.52207756", "text": "function pingForLeader() {\n isPingDone = false;\n pingArray = new Array(3);\n groupLatency = new Array(room.getStreamsByAttribute('type','media').length); \n pingNow(0);\n pingNow(1);\n pingNow(2);\n}", "title": "" }, { "docid": "3a36b2f965a6ea9d2e428d68153cf8b1", "score": "0.5167348", "text": "loadCnv() {\n const chatid = this._chatid;\n const cnv = this.$_msgs[chatid];\n\n if( !cnv )\n return;\n\n let msg;\n for( var msgid in cnv ) {\n msg = cnv[msgid];\n\n this.createMsg( msg.type, msgid, msg );\n }\n\n }", "title": "" }, { "docid": "c5d7dfd3fd4c9a6fe47c5a884ff3dc35", "score": "0.51641655", "text": "function Network () {}", "title": "" }, { "docid": "d87bf5a05046879a1e3546bc6095459d", "score": "0.5161279", "text": "function setup(){\r\n\tengine.Disconnect();\r\n\tengine.Connect(g_xqserver,g_iPort);\r\n\tengine.MsgHello(0,++l_dwSequence,g_dwVersion,g_bstrDescription);\r\n\tl_qwXIP.dwLo=++l_dwSessionID;\r\n\tengine.MsgDeadXIP(0,++l_dwSequence,l_qwXIP.dwHi,l_qwXIP.dwLo);\r\n}//endmethod", "title": "" }, { "docid": "23f1a125c795967fb16ae0eec7686a50", "score": "0.5148725", "text": "function test() {\n var socket = new SockJS('/ws-connect');\n stompClient = Stomp.over(socket);\n stompClient.connect({}, onConnected, onError);\n\n}", "title": "" }, { "docid": "0711fdc4278a4136c9e254a8ea5ba99c", "score": "0.51350313", "text": "function ClientRosterItem ( roster, jid )\n{\n\tthis.JID\t\t\t= jid;\n\tthis.Address\t\t= new XMPPAddress( jid );\n\tthis.Ask\t\t\t= '';\n\tthis.Name\t\t\t= '';\n\tthis.Groups\t\t\t= new Array();\n\tthis.Roster\t\t\t= roster;\n\tthis.Status\t\t\t= '';\n\tthis.Address\t\t= new XMPPAddress( jid );\n\tthis.Resources\t\t= new ActiveXObject( 'Scripting.Dictionary' );\n\tthis.HTMLElements\t= new ActiveXObject( 'Scripting.Dictionary' );\n\tthis.Subscription\t= '';\n\n\tthis.CC\t\t\t\t= CC;\n\tthis.Draw\t\t\t= Draw;\n\tthis.Hide\t\t\t= Hide;\n\tthis.Clear\t\t\t= Clear;\n\tthis.Purge\t\t\t= Purge;\n\tthis.Update\t\t\t= Update;\n\tthis.SetName\t\t= SetName;\n\tthis.ReRequest\t\t= ReRequest;\n\tthis.ChangeName\t\t= ChangeName;\n\tthis.RefreshAll\t\t= RefreshAll;\n\tthis.UpdateTracker\t= UpdateTracker;\n\tthis.ReceivePresence = ReceivePresence;\n\n\t/* Update the conversation window\n\t */\n\tfunction UpdateTracker ()\n\t{\n\t\tif ( external.globals( 'ChatSessionPool' ).GetTracker( this.Address ) )\n\t\t\texternal.globals( 'ChatSessionPool' ).GetTracker( this.Address ).DrawContainerInfo();\n\t}\n\n\t/* Shows/hides the unread messages notification\n\t */\n\tfunction RefreshAll ()\n\t{\n\t\t/* Check address in case a new transport has been loaded\n\t\t */\n\t\tif ( this.Name == this.JID && external.globals( 'ClientServices' ).Services.Exists( this.Address.Host ) )\n\t\t\tthis.Name = this.Address.CleanAddress();\n\t\t/* Redraw() the resources and Update() the items\n\t\t */\n\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t{\n\t\t\tvar theGroup = this.Roster.Groups( this.Groups[i] );\n\t\t\tvar resources = ( new VBArray( this.Resources.Keys() ) ).toArray();\n\t\t\tfor ( var j = 0; j < resources.length; ++j )\n\t\t\t\tthis.Resources( resources[j] ).Redraw( theGroup );\n\t\t\tif ( this.HTMLElements.Exists( this.Groups[i] ) )\n\t\t\t\tthis.Update( theGroup );\n\t\t}\n\t}\n\n\t/* This is used for both copying or moving contacts to other groups\n\t */\n\tfunction CC ( oldGroupName, newGroupName )\n\t{\n\t\tvar newGroups = new ActiveXObject( 'Scripting.Dictionary' );\n\t\tnewGroups.Add( newGroupName, null );\n\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t\tif ( this.Groups[i] != oldGroupName && ! newGroups.Exists( this.Groups[i] ) )\n\t\t\t\tnewGroups.Add( this.Groups[i], null );\n\t\tvar dom = new ActiveXObject( 'MSXML2.DOMDocument' );\n\t\tdom.loadXML( '<iq type=\"set\"><query><item/></query></iq>' );\n\t\tdom.documentElement.setAttribute( 'id', 'sd' + ( ++external.globals( 'uniqueid' ) ) );\n\t\tvar groupnames = ( new VBArray( newGroups.Keys() ) ).toArray();\n\t\tfor ( var j = 0; j < groupnames.length; ++j )\n\t\t{\n\t\t\tvar node = dom.createElement( 'group' );\n\t\t\tnode.text = groupnames[j];\n\t\t\tdom.firstChild.firstChild.firstChild.appendChild( node );\n\t\t}\n\t\tif ( this.Name != this.JID && this.Name.length )\n\t\t\tdom.firstChild.firstChild.firstChild.setAttribute( 'name', this.Name );\n\t\tdom.firstChild.firstChild.firstChild.setAttribute( 'jid', this.JID );\n\t\tdom.firstChild.firstChild.setAttribute( 'xmlns', 'jabber:iq:roster' );\n\t\twarn( 'SENT: ' + dom.xml );\n\t\texternal.XMPP.SendXML( dom );\n\t}\n\n\t/* Remove this item and its resources\n\t */\n\tfunction Clear ()\n\t{\n\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t{\n\t\t\tif ( this.HTMLElements.Exists( this.Groups[i] ) )\n\t\t\t\tthis.HTMLElements( this.Groups[i] ).removeNode( true );\n\t\t\tthis.Roster.Groups( this.Groups[i] ).Items.Remove( this.JID );\n\t\t\tif ( this.Roster.Groups( this.Groups[i] ).Items.Count )\n\t\t\t{\n\t\t\t\t/* Hide the \"display offline contacts\" button\n\t\t\t\t */\n\t\t\t\tvar itemnames = ( new VBArray( this.Roster.Groups( this.Groups[i] ).Items.Keys() ) ).toArray();\n\t\t\t\tvar j;\n\t\t\t\tfor ( j = 0; j < itemnames.length; ++j )\n\t\t\t\t\tif ( ! this.Roster.Items( itemnames[j] ).Resources.Count )\n\t\t\t\t\t\tbreak;\n\t\t\t\tif ( j >= itemnames.length )\n\t\t\t\t\tthis.Roster.Groups( this.Groups[i] ).HTMLShowAll.style.display = 'none';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* Delete the empty group\n\t\t\t\t */\n\t\t\t\tthis.Roster.Groups( this.Groups[i] ).Clear();\n\t\t\t\tthis.Roster.Groups.Remove( this.Groups[i] );\n\t\t\t}\n\t\t}\n\t\tthis.HTMLElements.RemoveAll();\n\t\tvar resources = ( new VBArray( this.Resources.Keys() ) ).toArray();\n\t\tfor ( var i = 0; i < resources.length; ++i )\n\t\t\tthis.Resources( resources[i] ).Clear();\n\t\tthis.Resources.RemoveAll();\n\t\tthis.Roster.Items.Remove( this.JID );\n\t\tthis.UpdateTracker();\n\t}\n\n\t/* Parse the Presence object some more\n\t */\n\tfunction ReceivePresence ( jid, resource, presence )\n\t{\n\t\t/* Going offline\n\t\t */\n\t\tif ( presence.Type == 'unavailable' )\n\t\t{\n\t\t\tthis.Status = presence.Status;\n\t\t\tif ( this.Resources.Exists( resource ) )\n\t\t\t{\n\t\t\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t\t\t{\n\t\t\t\t\t/* Delete the resource from the group\n\t\t\t\t\t */\n\t\t\t\t\tthis.Resources( resource ).Hide( this.Roster.Groups( this.Groups[i] ) );\n\t\t\t\t\t/* If there are no more resources, add the item to the offline section\n\t\t\t\t\t */\n\t\t\t\t\tif ( this.Resources.Count == 1 && this.Roster.Groups( this.Groups[i] ).ShowOffline )\n\t\t\t\t\t\tthis.Draw( this.Roster.Groups( this.Groups[i] ) );\n\t\t\t\t\t/* Show the \"no one is online\" text\n\t\t\t\t\t */\n\t\t\t\t\tif ( this.Roster.Groups( this.Groups[i] ).HTMLOnline.children.length < 2 )\n\t\t\t\t\t\tthis.Roster.Groups( this.Groups[i] ).HTMLOnline.firstChild.style.display = 'block';\n\t\t\t\t\t/* Show the \"display offline contacts\" button\n\t\t\t\t\t */\n\t\t\t\t\tif ( this.Roster.Groups( this.Groups[i] ).ShowAll && this.Resources.Count == 1 )\n\t\t\t\t\t\tthis.Roster.Groups( this.Groups[i] ).HTMLShowAll.style.display = 'inline';\n\t\t\t\t}\n\t\t\t\tthis.Resources.Remove( resource );\n\t\t\t}\n\t\t}\n\t\t/* Coming online or changing status\n\t\t */\n\t\telse\n\t\t{\n\t\t\tvar userresource = this.Resources.Exists( resource ) ? this.Resources( resource ) : new ClientRosterResource( this, resource );\n\n\t\t\tthis.Status = '';\n\n\t\t\tvar Hash = '';\n\t\t\tvar Node = null;\n\n\t\t\tif ( Node = presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"jabber:x:avatar\"]/hash' ) )\n\t\t\t\tHash = Node.text.replace( /[^0-9a-zA-Z]/gm, '' );\n\t\t\telse if ( Node = presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"vcard-temp:x:update\"]/photo' ) )\n\t\t\t\tHash = Node.text.replace( /[^0-9a-zA-Z]/gm, '' );\n\n\t\t\tif ( Hash.length == 40 )\n\t\t\t{\n\t\t\t\tif ( external.FileExists( external.globals( 'usersdir' ) + 'Avatars\\\\' + Hash ) )\n\t\t\t\t\tuserresource.Avatar = Hash;\n\t\t\t\telse if ( presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"vcard-temp:x:update\"]/photo' ) )\n\t\t\t\t{\n\t\t\t\t\tif ( userresource.LoadingAvatarHash != Hash )\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hook\t\t\t= new XMPPHookIQ();\n\t\t\t\t\t\thook.Window\t\t\t= external.wnd;\n\t\t\t\t\t\thook.Callback\t\t= 'ClientRosterAvatarVCard';\n\t\t\t\t\t\tuserresource.LoadingAvatarHash\t= Hash;\n\t\t\t\t\t\tuserresource.LoadingAvatarId\t= hook.Id;\n\t\t\t\t\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\t\t\t\t\tdom.loadXML( '<iq type=\"get\"><vCard xmlns=\"vcard-temp\"/></iq>' );\n\t\t\t\t\t\tdom.documentElement.setAttribute( 'id', hook.Id );\n\t\t\t\t\t\tdom.documentElement.setAttribute( 'to', this.JID );\n\t\t\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! userresource.Avatar.length )\n\t\t\t\t\t\tuserresource.Avatar = this.Roster.GetAvatar( resource, this.JID );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( userresource.LoadingAvatarHash != Hash )\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hook\t\t\t= new XMPPHookIQ();\n\t\t\t\t\t\thook.Window\t\t\t= external.wnd;\n\t\t\t\t\t\thook.Callback\t\t= 'ClientRosterAvatarStorage';\n\t\t\t\t\t\tuserresource.LoadingAvatarHash\t= Hash;\n\t\t\t\t\t\tuserresource.LoadingAvatarId\t= hook.Id;\n\t\t\t\t\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\t\t\t\t\tdom.loadXML( '<iq type=\"get\"><query xmlns=\"storage:client:avatar\"/></iq>' );\n\t\t\t\t\t\tdom.documentElement.setAttribute( 'id', hook.Id );\n\t\t\t\t\t\tdom.documentElement.setAttribute( 'to', this.JID );\n\t\t\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! userresource.Avatar.length )\n\t\t\t\t\t\tuserresource.Avatar = this.Roster.GetAvatar( resource, this.JID );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar res_avatar = this.Roster.GetAvatar( resource, this.JID );\n\t\t\t\tif ( res_avatar.length )\n\t\t\t\t\tuserresource.Avatar = res_avatar;\n\t\t\t\tif ( ! userresource.Avatar.length && ! userresource.LoadingVersion )\n\t\t\t\t{\n\t\t\t\t\tuserresource.LoadingVersion\t= true;\n\t\t\t\t\tvar hook\t\t\t\t\t= new XMPPHookIQ();\n\t\t\t\t\thook.Window\t\t\t\t\t= external.wnd;\n\t\t\t\t\thook.Callback\t\t\t\t= 'ClientRosterVersion';\n\t\t\t\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\t\t\t\tdom.loadXML( '<iq type=\"get\"><query xmlns=\"jabber:iq:version\"/></iq>' );\n\t\t\t\t\tdom.documentElement.setAttribute( 'id', hook.Id );\n\t\t\t\t\tdom.documentElement.setAttribute( 'to', this.JID + '/' + resource );\n\t\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tuserresource.Status\t\t= presence.Status.replace( /[\\n\\r]+/mg, ' - ' );\n\t\t\tuserresource.Show\t\t= presence.Show;\n\t\t\tuserresource.Priority\t= presence.Priority;\n\n\t\t\tif ( ! presence.Status.length || ( userresource.Show == 'away' && userresource.Status.toLowerCase() == 'away' ) || ( userresource.Show == 'dnd' && userresource.Status.toLowerCase() == 'busy' ) )\n\t\t\t\tuserresource.Status = external.globals( 'Translator' ).Translate( 'main', 'cl_status_empty' );\n\n\t\t\t/* MSN tweak\n\t\t\t */\n\t\t\tif ( this.JID.indexOf( '@' ) != -1 && external.globals( 'ClientServices' ).Services.Exists( this.JID.substr( 1 + this.JID.indexOf( '@' ) ) ) && ( external.globals( 'ClientServices' ).Services( this.JID.substr( 1 + this.JID.indexOf( '@' ) ) ).Options & 0x0002 ) )\n\t\t\t{\n\t\t\t\tif ( external.globals( 'cfg' )( 'msnworkaround' ).toString() == 'true' )\n\t\t\t\t{\n\t\t\t\t\tif ( presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"vcard-temp:x:update\"]/nickname' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.Name = presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"vcard-temp:x:update\"]/nickname' ).text;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( userresource.Status.length )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ( /^([^\\(]+) \\((.+)\\)$/ ).test( userresource.Status ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.Name\t\t\t= RegExp.$1;\n\t\t\t\t\t\t\tuserresource.Status\t= RegExp.$2;\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\tthis.Name\t\t\t= userresource.Status;\n\t\t\t\t\t\t\tuserresource.Status\t= external.globals( 'Translator' ).Translate( 'main', 'cl_status_empty' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"vcard-temp:x:update\"]/nickname' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tuserresource.Status = presence.XMLDOM.selectSingleNode( '/presence/x[@xmlns = \"vcard-temp:x:update\"]/nickname' ).text + ' (' + userresource.Status + ')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( this.Resources.Exists( resource ) )\n\t\t\t{\n\t\t\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t\t\t\tuserresource.Redraw( this.Roster.Groups( this.Groups[i] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.Resources.Add( resource, userresource )\n\t\t\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t\t\t{\n\t\t\t\t\tvar theGroup = this.Roster.Groups( this.Groups[i] );\n\t\t\t\t\tthis.Hide( theGroup );\n\t\t\t\t\tthis.Resources( resource ).Draw( theGroup );\n\t\t\t\t\t/* Hide the \"no one is online\" text\n\t\t\t\t\t */\n\t\t\t\t\ttheGroup.HTMLOnline.firstChild.style.display = 'none';\n\t\t\t\t\t/* Hide the \"display offline contacts\" button\n\t\t\t\t\t */\n\t\t\t\t\tvar itemnames = ( new VBArray( theGroup.Items.Keys() ) ).toArray();\n\t\t\t\t\tvar j;\n\t\t\t\t\tfor ( j = 0; j < itemnames.length; ++j )\n\t\t\t\t\t\tif ( ! this.Roster.Items( itemnames[j] ).Resources.Count )\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\tif ( j >= itemnames.length )\n\t\t\t\t\t\ttheGroup.HTMLShowAll.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( external.globals( 'ClientServices' ).Services.Exists( this.JID ) )\n\t\t\t\tthis.Clear();\n\t\t}\n\n\t\tthis.UpdateTracker();\n\t}\n\n\t/* Remove the offline item from the specified group\n\t */\n\tfunction Hide ( group )\n\t{\n\t\tif ( ! this.HTMLElements.Exists( group.Name ) )\n\t\t\treturn;\n\t\tthis.HTMLElements( group.Name ).removeNode( true );\n\t\tthis.HTMLElements.Remove( group.Name );\n\t}\n\n\t/* Refreshes the displayed name and status message in the specified group\n\t */\n\tfunction Update ( group )\n\t{\n\t\tthis.HTMLElements( group.Name ).style.paddingBottom = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '' : '5px';\n\t\tthis.HTMLElements( group.Name ).style.marginLeft = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '29px' : '21px';\n\t\tthis.HTMLElements( group.Name ).title = external.globals( 'Translator' ).Translate( 'main', 'cl_tooltip_offline', [ this.Address.CleanAddress() ] );\n\t\tif ( this.Status.length )\n\t\t\tthis.HTMLElements( group.Name ).title += '\\n' + this.Status;\n\t\twith ( this.HTMLElements( group.Name ).children )\n\t\t{\n\t\t\titem(0).className = external.globals( 'block' ).Exists( this.JID ) ? 'roster-item-offline-name-blocked' : 'roster-item-offline-name';\n\t\t\titem(0).innerText = this.Name + '\\n';\n\t\t\tif ( external.globals( 'ChatSessionPool' ).Events.Exists( this.JID ) )\n\t\t\t{\n\t\t\t\tvar MessageCount = external.globals( 'ChatSessionPool' ).Events( this.JID ).length;\n\t\t\t\titem(1).className = 'roster-item-offline-unread';\n\t\t\t\titem(1).style.display = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '' : 'none';\n\t\t\t\titem(1).innerText = MessageCount == 1 ? external.globals( 'Translator' ).Translate( 'main', 'cl_status_waiting_one' ) : external.globals( 'Translator' ).Translate( 'main', 'cl_status_waiting_multiple', [ MessageCount ] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem(1).className = 'roster-item-offline-msg';\n\t\t\t\titem(1).style.display = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '' : 'none';\n\t\t\t\tif ( this.Subscription == 'to' || this.Subscription == 'both' )\n\t\t\t\t{\n\t\t\t\t\titem(1).innerText = external.globals( 'Translator' ).Translate( 'main', 'cl_status_offline' );\n\t\t\t\t\tif ( this.Status.length )\n\t\t\t\t\t\titem(1).innerText += ' - ' + this.Status;\n\t\t\t\t}\n\t\t\t\telse if ( ( this.Subscription == 'none' || this.Subscription == 'from' ) && this.Ask == 'subscribe' )\n\t\t\t\t\titem(1).innerText = external.globals( 'Translator' ).Translate( 'main', 'cl_status_awaiting' );\n\t\t\t\telse\n\t\t\t\t\titem(1).innerText = external.globals( 'Translator' ).Translate( 'main', 'cl_status_unknown' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Show the offline item in the specified group\n\t */\n\tfunction Draw ( group )\n\t{\n\t\t/* <NOBR>\n\t\t * <SPAN class=\"roster-item-offline-name|blocked\">Nickname</SPAN>\n\t\t * <SPAN class=\"roster-item-offline-msg|unread\">Offline|Awaiting|Unknown|Unread</SPAN>\n\t\t * </NOBR>\n\t\t */\n\t\tif ( this.HTMLElements.Exists( group.Name ) )\n\t\t\treturn;\n\t\tvar elem = document.createElement( 'NOBR' );\n\t\telem.className = 'roster-item-offline';\n\t\telem.style.paddingBottom = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '' : '5px';\n\t\telem.style.marginLeft = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '29px' : '21px';\n\t\telem.JID = this.JID;\n\t\telem.GroupName = group.Name;\n\t\telem.attachEvent(\n\t\t\t'onmouseover',\n\t\t\tfunction ()\n\t\t\t{\n\t\t\t\tif ( event.srcElement.tagName == 'BR' )\n\t\t\t\t\tevent.srcElement.parentNode.parentNode.firstChild.style.textDecoration = 'underline';\n\t\t\t\telse if ( event.srcElement.tagName != 'NOBR' )\n\t\t\t\t\tevent.srcElement.parentNode.firstChild.style.textDecoration = 'underline';\n\t\t\t\telse\n\t\t\t\t\tevent.srcElement.firstChild.style.textDecoration = 'underline';\n\t\t\t}\n\t\t);\n\t\telem.attachEvent(\n\t\t\t'onmouseout',\n\t\t\tfunction ()\n\t\t\t{\n\t\t\t\tif ( event.srcElement.tagName == 'BR' )\n\t\t\t\t\tevent.srcElement.parentNode.parentNode.firstChild.style.textDecoration = 'underline';\n\t\t\t\telse if ( event.srcElement.tagName != 'NOBR' )\n\t\t\t\t\tevent.srcElement.parentNode.firstChild.style.textDecoration = 'none';\n\t\t\t\telse\n\t\t\t\t\tevent.srcElement.firstChild.style.textDecoration = 'none';\n\t\t\t}\n\t\t);\n\t\telem.attachEvent(\n\t\t\t'onclick',\n\t\t\tfunction ()\n\t\t\t{\n\t\t\t\tvar obj = event.srcElement;\n\t\t\t\twhile ( obj.tagName != 'NOBR' )\n\t\t\t\t\tobj = obj.parentNode;\n\t\t\t\texternal.globals( 'ClientRoster' ).Search.Close();\n\t\t\t\tdial_chat( obj.JID );\n\t\t\t}\n\t\t);\n\t\telem.attachEvent(\n\t\t\t'oncontextmenu',\n\t\t\tfunction ()\n\t\t\t{\n\t\t\t\tvar obj = event.srcElement;\n\t\t\t\twhile ( obj.tagName != 'NOBR' )\n\t\t\t\t\tobj = obj.parentNode;\n\t\t\t\tmousemenu( obj.JID, '', obj.GroupName );\n\t\t\t}\n\t\t);\n\t\tvar name = document.createElement( 'SPAN' );\n\t\tname.className = external.globals( 'block' ).Exists( this.JID ) ? 'roster-item-offline-name-blocked' : 'roster-item-offline-name';\n\t\tname.innerText = this.Name + '\\n';\n\t\telem.insertAdjacentElement( 'beforeEnd', name );\n\t\tvar msg = document.createElement( 'SPAN' );\n\t\tif ( external.globals( 'ChatSessionPool' ).Events.Exists( this.JID ) )\n\t\t{\n\t\t\tvar MessageCount = external.globals( 'ChatSessionPool' ).Events( this.JID ).length;\n\t\t\tmsg.className = 'roster-item-offline-unread';\n\t\t\tmsg.innerText = MessageCount == 1 ? external.globals( 'Translator' ).Translate( 'main', 'cl_status_waiting_one' ) : external.globals( 'Translator' ).Translate( 'main', 'cl_status_waiting_multiple', [ MessageCount ] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmsg.className = 'roster-item-offline-msg';\n\t\t\tif ( this.Subscription == 'to' || this.Subscription == 'both' )\n\t\t\t{\n\t\t\t\tmsg.innerText = external.globals( 'Translator' ).Translate( 'main', 'cl_status_offline' );\n\t\t\t\tif ( this.Status.length )\n\t\t\t\t\tmsg.innerText += ' - ' + this.Status;\n\t\t\t}\n\t\t\telse if ( ( this.Subscription == 'none' || this.Subscription == 'from' ) && this.Ask == 'subscribe' )\n\t\t\t\tmsg.innerText = external.globals( 'Translator' ).Translate( 'main', 'cl_status_awaiting' );\n\t\t\telse\n\t\t\t\tmsg.innerText = external.globals( 'Translator' ).Translate( 'main', 'cl_status_unknown' );\n\t\t}\n\t\tmsg.style.display = external.globals( 'cfg' )( 'contactlistdisplay' ) == 'detailed' ? '' : 'none';\n\t\telem.insertAdjacentElement( 'beforeEnd', msg );\n\t\telem.title = external.globals( 'Translator' ).Translate( 'main', 'cl_tooltip_offline', [ this.Address.CleanAddress() ] );\n\t\tif ( this.Status.length )\n\t\t\telem.title += '\\n' + this.Status;\n\t\tthis.HTMLElements.Add( group.Name, elem );\n\t\tgroup.HTMLOffline.insertAdjacentElement( 'beforeEnd', elem );\n\t}\n\n\t/* Ask the user for a new name\n\t */\n\tfunction ChangeName ()\n\t{\n\t\tif ( external.windows.Exists( this.JID + '/rename' ) )\n\t\t\treturn external.windows( this.JID + '/rename' ).focus();\n\t\telse\n\t\t\twith ( external.createWindow( this.JID + '/rename', external.globals( 'cwd' ) + 'rename_user.html', this.JID ) )\n\t\t\t{\n\t\t\t\tsetTitle( external.globals( 'Translator' ).Translate( 'main', 'wnd_contact_rename' ) );\n\t\t\t\tsetIcon( external.globals( 'cwd' ) + '..\\\\images\\\\brand\\\\default.ico' );\n\t\t\t\tresizeable( false );\n\t\t\t\tMinHeight = MinWidth = 0;\n\t\t\t\tsetSize( 320, 80 );\n\t\t\t\tsetPos( ( screen.availWidth - 260 ) / 2, ( screen.availHeight - 80 ) / 2 );\n\t\t\t}\n\t}\n\n\t/* Rename the item\n\t */\n\tfunction SetName ( newname )\n\t{\n\t\tvar dom = new ActiveXObject( 'MSXML2.DOMDocument' );\n\t\tdom.loadXML( '<iq type=\"set\"><query><item/></query></iq>' );\n\t\tdom.documentElement.setAttribute( 'id', 'sd' + ( ++external.globals( 'uniqueid' ) ) );\n\t\twith ( dom.documentElement.firstChild.firstChild )\n\t\t{\n\t\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t\t{\n\t\t\t\tvar node = dom.createElement( 'group' );\n\t\t\t\tnode.text = this.Groups[i];\n\t\t\t\tappendChild( node );\n\t\t\t}\n\t\t\tsetAttribute( 'jid', this.JID );\n\t\t\tif ( newname.length && newname != this.JID )\n\t\t\t\tsetAttribute( 'name', newname );\n\t\t}\n\t\tdom.firstChild.firstChild.setAttribute( 'xmlns', 'jabber:iq:roster' );\n\t\twarn( 'SENT: ' + dom.xml );\n\t\texternal.XMPP.SendXML( dom );\n\t}\n\n\t/* Send another subscription request\n\t */\n\tfunction ReRequest ()\n\t{\n\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\tdom.loadXML( '<presence type=\"subscribe\"/>' );\n\t\tdom.documentElement.setAttribute( 'to', this.JID );\n\t\twarn( 'SENT: ' + dom.xml );\n\t\texternal.XMPP.SendXML( dom );\n\t}\n\n\t/* Delete the item from one or all groups in the roster\n\t */\n\tfunction Purge ( override, groupname )\n\t{\n\t\tif ( this.Roster.Groups.Exists( groupname ) && this.Roster.Groups( groupname ).Items.Exists( this.JID ) && this.Groups.length > 1 )\n\t\t{\n\t\t\t/* Take it out of this group but leave it in the other ones\n\t\t\t */\n\t\t\tif ( override || external.wnd.messageBox( true, external.globals( 'Translator' ).Translate( 'main', 'cl_contact_remove_group' ), external.globals( 'softwarename' ), 4 | 48 ) == 6 )\n\t\t\t{\n\t\t\t\tvar newGroups = new ActiveXObject( 'Scripting.Dictionary' );\n\t\t\t\tfor ( var i = 0; i < this.Groups.length; ++i )\n\t\t\t\t\tif ( this.Groups[i] != groupname && ! newGroups.Exists( this.Groups[i] ) )\n\t\t\t\t\t\tnewGroups.Add( this.Groups[i], null );\n\t\t\t\tvar dom = new ActiveXObject( 'MSXML2.DOMDocument' );\n\t\t\t\tdom.loadXML( '<iq type=\"set\"><query><item/></query></iq>' );\n\t\t\t\tdom.documentElement.setAttribute( 'id', 'sd' + ( ++external.globals( 'uniqueid' ) ) );\n\t\t\t\tvar groupnames = ( new VBArray( newGroups.Keys() ) ).toArray();\n\t\t\t\tfor ( var j = 0; j < groupnames.length; ++j )\n\t\t\t\t{\n\t\t\t\t\tvar node = dom.createElement( 'group' );\n\t\t\t\t\tnode.text = groupnames[j];\n\t\t\t\t\tdom.firstChild.firstChild.firstChild.appendChild( node );\n\t\t\t\t}\n\t\t\t\tif ( this.Name != this.JID && this.Name.length )\n\t\t\t\t\tdom.firstChild.firstChild.firstChild.setAttribute( 'name', this.Name );\n\t\t\t\tdom.firstChild.firstChild.firstChild.setAttribute( 'jid', this.JID );\n\t\t\t\tdom.firstChild.firstChild.setAttribute( 'xmlns', 'jabber:iq:roster' );\n\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Completely gone!\n\t\t\t */\n\t\t\tif ( override || external.wnd.messageBox( true, external.globals( 'Translator' ).Translate( 'main', 'cl_contact_remove_list' ), external.globals( 'softwarename' ), 4 | 48 ) == 6 )\n\t\t\t{\n\t\t\t\tif ( external.globals( 'block' ).Exists( this.JID ) )\n\t\t\t\t\tdial_block( this.Address );\n\t\t\t\tvar dom = new ActiveXObject( 'Msxml2.DOMDocument' );\n\t\t\t\tdom.loadXML( '<iq type=\"set\"><query xmlns=\"jabber:iq:roster\"><item subscription=\"remove\"/></query></iq>' );\n\t\t\t\tdom.documentElement.setAttribute( 'id', 'sd' + ( ++external.globals( 'uniqueid' ) ) );\n\t\t\t\tdom.documentElement.firstChild.firstChild.setAttribute( 'jid', this.JID );\n\t\t\t\twarn( 'SENT: ' + dom.xml );\n\t\t\t\texternal.XMPP.SendXML( dom );\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "23cf235a98ebd542491e7eb7f7da4886", "score": "0.5118365", "text": "function IsQuickReply()\r\n{\r\n return (((GMGetValue((\"QuickReply\" + CommunityId))) != \"\") ? 1 : 0);\r\n}", "title": "" }, { "docid": "23cf235a98ebd542491e7eb7f7da4886", "score": "0.5118365", "text": "function IsQuickReply()\r\n{\r\n return (((GMGetValue((\"QuickReply\" + CommunityId))) != \"\") ? 1 : 0);\r\n}", "title": "" }, { "docid": "34138d97b960d777c8c9b038f7a0381a", "score": "0.51120424", "text": "function SocketMessenger() {}", "title": "" }, { "docid": "8a5ac0553fa35f2e0b160d352334b777", "score": "0.5097636", "text": "function sn(){}", "title": "" }, { "docid": "4a34489490ec38d15bb04e6eee600588", "score": "0.5094676", "text": "function GameCenter() {\n\n\tvar wsPort;\n\n\tvar ID;\n\t//var mazeID;\n\tvar connection;\n\t//to close connection connection.close();\n\t(this.initial = function() {\n\t\tconsole.log(\"loading!\");\n\t\t//check preconditions for web socket support\n\t\tif (window.MozWebSocket) {\n\n\t console.log('using MozillaWebSocket');\n\t window.WebSocket = window.MozWebSocket;\n\t } else if (!window.WebSocket) {\n\t \t\n\t console.log('browser does not support websockets!');\n\t alert('browser does not support websockets!');\n\t return;\n\t }\n\n\t\twsPort = \"81\";\n\t\tvar matches = document.URL.match(/http:\\/\\/([\\d.]+)\\/.*/);\n //var ip = matches[1];\n var ip=\"192.168.0.32\";\n console.log(\"IP: \" + ip);\n \n\t\tconnection = new WebSocket(\"ws://\" + ip + \":\" + wsPort);\n\n\t\tconnection.onopen = function(event) { onConnection() };\n\t\tconnection.onerror = function(error) { connectionError(error) };\n\t\tconnection.onmessage = function(message) { receiveMessage(message) };\n\t\tconnection.onclose = function(event) { onCloseEvent() };\n\t})();\n\n\t//connection error handling\n\tvar connectionError = function(error) {\n\t\tconsole.log(\"connection error: \" + error);\n\t\talert(error);\n\t\tdocument.getElementById('test').innerHTML = error;\n\t}\n\n\t//initial connection sequence\n\tvar onConnection = function() {\n\t\tconsole.log(\"connected\");\n\t\t// sendOut(gameStateObject);\n\t}\n\n\tvar onCloseEvent = function() {\n\t\tconsole.log(\"closing\");\n\t}\n\n\tvar userList = [];\n\n\tvar receiveMessage = function(message) {\n\t\t//convert JSON\n\t\tconsole.log(message);\n\n\t\ttry {\n\t\t\tvar receivedMessage = JSON.parse(message.data);\n\t\t\t\n\n\t\t\tif(receivedMessage.user_id != null) {\n\t\t\t\tID = receivedObject.user_id;\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t} else if (receivedMessage.action = \"broadcasting\") {\n\n\t\t\t\tif (receivedMessage.name = \"user_list\") {\n\t\t\t\t\treceivedUserlist(receivedMessage.body);\n\t\t\t\t}\n\n\t\t\t\trecievedCallBack(receivedMessage.body);\n\t\t\t\tconsole.log(receivedMessage.body);\n\t\t\t\tconsole.log(receivedMessage.body.test);\n\t\t\t} else if (receivedMessage.action = \"get_shared_memory\") {\n\t\t\t\treceivedSharedMemory(receivedMessage.name, receivedMessage.body);\n\t\t\t} else if (receivedMessage.action = \"user_list\"){\n\t\t\t\t// this.userList = receivedMessage.body;\n\t\t\t\treceivedUserlist(receiveMessage.userList);\n\t\t\t}else {\n\t\t\t\tconsole.log(\"undefined action: \" + receivedMessage.action);\n\t\t\t}\n\n\t\t\tconsole.log(\"Recevied Message \" + receivedMessage);\n\t\t} catch(error) {\n\t\t\tconsole.log('message is not a JSON object');\n\t\t}\n\t}\n\n\tvar user = function(name, property){\n\t\tthis.name = name;\n\t\tthis.id = null;\n\t\tthis.isHost = null;\n\t\tthis.property = property\n\t}\n\n\tvar sendMessage = function(action, name, body) {\n\t\tvar timestamp = new Date();\n\n\t\tvar message = {\n\t\t\t\"action\": action,\n\t\t\t\"timestamp\": timestamp,\n\t\t\t\"userID\": null,\n\t\t\t\"name\": name,\n\t\t\t\"body\": body \n\t\t}\n\n\t\tif(connection.readyState == 1) {\n\t\t\tconnection.send(JSON.stringify(message));\n\t\t} else {\n\t\t\tconsole.log(\"connection not ready!\");\n\t\t}\n\t\tconsole.log(\"SENT\");\n\t}\n\n\tthis.broadcasting = function(body) {\n\t\tsendMessage(\"broadcasting\", \"message\", body);\n\t}\n\n\tthis.setSharedMemory = function(name, body) {\n\t\tsendMessage(\"set_shared_memory\", name, body);\n\t}\n\n\tthis.getSharedMemory = function(name) {\n\t\tsendMessage(\"get_shared_memory\", name, null);\n\t}\n\n\tthis.setUser = function(name, property) {\n\n\t\t// var existingUser = 0;\n\t\t// for (var i = this.userList.length - 1; i >= 0; i--) {\n\t\t// \tif(this.userList[i].name = name) {\n\t\t// \t\tthis.userList[i].property = property;\n\t\t// \t\texistingUser = 1;\n\t\t// \t\tbreak;\n\t\t// \t}\n\t\t// };\n\n\t\t// if(!existingUser) {\n\t\t\tvar newUser = new user(name, property);\n\t\t\t// this.userList.push(newUser);\n\t\t// }\n\n\t\tsendMessage(\"set_user\", name, newUser);\n\t}\n\n\n\tthis.getUserList = function () {\n\t\tsendMessage(\"get_user_list\", null, null);\n\t}\n\n}", "title": "" }, { "docid": "71c55cb496513f06e8221ce020c8abd7", "score": "0.5084645", "text": "function checkGameStatus(){\n\tvar jsonMsg = new Object();\n\tjsonMsg.chessCommand = \"reconnect\";\n\tconsole.log(JSON.stringify(jsonMsg));\n\t\n\tstompClient.send(\"/chess/chessMsg\", {}, JSON.stringify(jsonMsg));\n}", "title": "" }, { "docid": "9adb805edcc7743ce03d2eb27cfaacef", "score": "0.5073034", "text": "init() {\n this.core.on('connected', () => {\n this.isConnected = true;\n });\n\n this.core.on('error', (err) => {\n this.isConnected = false;\n console.error('Connection to UMS closed with err', err.message);\n });\n\n this.core.on('closed', (reason) => {\n this.isConnected = false;\n console.error('Connection to UMS closed with reason', reason);\n this.core.reconnect(reason !== 4401 || reason !== 4407);\n });\n /**\n * This function is used to find out what the consumer wants and send him the right message\n * Which later get consumed by other functions.\n */\n this.core.on('ms.MessagingEventNotification', (body) => {\n if (!body.changes[0].__isMe && body.changes[0].originatorMetadata.role !== 'ASSIGNED_AGENT' && this.openConversations[body.dialogId].skillId === '-1') {\n if (!Number.isNaN(body.changes[0].event.message) &&\n body.changes[0].event.message < node.children.length +\n 1 && body.changes[0].event.message > 0) {\n const answer = nextStep(body.changes[0].event.message);\n if (node.children.length === 1 && theLast) {\n node = root;\n greeting = true;\n theLast = false;\n }\n if (!skillTransfer(answer)) {\n this.sendMessage(body.dialogId, answer);\n } else {\n try {\n incrementTransferCounter();\n } catch (err) {\n console.log(err);\n throw err;\n }\n const newSkill = getSkill(answer);\n this.core.updateConversationField({\n conversationId: body.dialogId,\n conversationField: [{\n field: 'Skill',\n type: 'UPDATE',\n skill: newSkill,\n },\n {\n field: 'ParticipantsChange',\n type: 'REMOVE',\n role: 'MANAGER',\n userId: this.core.agentId,\n },\n ],\n });\n\n this.openConversations[body.dialogId].skillId = newSkill;\n }\n } else if (body.changes[0].event.message === 'back') {\n this.sendMessage(body.dialogId, lastStep());\n } else {\n this.sendMessage(body.dialogId, repeatStep());\n }\n }\n });\n\n this.core.on('cqm.ExConversationChangeNotification', (body) => {\n body.changes\n .filter(change => change.type === 'UPSERT' && !this.openConversations[change.result.convId])\n .forEach(async (change) => {\n this.isConnected = true;\n node = root;\n this.openConversations[change.result.convId] = change.result.conversationDetails;\n await this.joinConversation(change.result.convId, 'MANAGER');\n await this.sendMessage(change.result.convId, buildFirstTree());\n });\n\n body.changes\n .filter(change => change.type === 'DELETE' && this.openConversations[change.result.convId])\n .forEach(change => delete this.openConversations[change.result.convId]);\n });\n\n this.promisifyFunctions();\n }", "title": "" }, { "docid": "3b4660af09e38b18f81105afaca920c4", "score": "0.50725883", "text": "function initWhispernet() {\n console.log('init: Starting Nacl bridge.');\n // TODO(rkc): Figure out how to embed the .nmf and the .pexe into component\n // resources without having to rename them to .js.\n whispernetNacl = new NaclBridge('whispernet_proxy.nmf.png',\n onWhispernetLoaded);\n}", "title": "" }, { "docid": "cd075fa60055ddeca58f9ef4adb192c4", "score": "0.5061889", "text": "function xqserver_userinfomsg_normal(){\r\n\tsetup();\r\n\tengine.MsgUserInfo(l_dwSessionID,++l_dwSequence,g_qwUserId.dwHi,g_qwUserId.dwLo,l_qwXIP.dwHi,l_dwSessionID,l_qwXRG.dwHi,l_qwXRG.dwLo,l_qwXIP.dwHi,g_wPort);\r\n\tConfirmUserInfoAck(engine);\r\n}//endmethod", "title": "" }, { "docid": "22aa47ab821638d62a6e61337cb98d5f", "score": "0.5058471", "text": "function MPHeadInit() {\nwith (DSMP) {\n\t// detect browser version\n\t// default to latest known version of each browser\n\tif (navigator.appName==\"Netscape\") {\n\t\tif (navigator.appVersion.indexOf(\"Safari\") != -1) {\n\t\t\t// Apple Safari\n\t\t\tvar safariVer = 0;\n\t\t\tvar start = navigator.userAgent.indexOf(\"Safari/\");\n\t\t\tif (start != -1) {\n\t\t\t\tsafariVer = parseInt(navigator.userAgent.substring(start+7));\n\t\t\t}\n\t\t\tgDeleteNNObjects = true;\n\t\t\tgDOM1 = true;\n\t\t\tgIgnoreMouseButton = true;\n\t\t\tif ( safariVer < 125 ) {\n\t\t\t\tgFixEquationPositions = true;\t\t\t\n\t\t\t\tgPrintRelative = true;\t\t\t\n\t\t\t\twindow.onload = MPRepositionAllEquations;\n\t\t\t} else {\n\t\t\t\tgFontSize1px=true;\n\t\t\t\tgUseEquationOffsets = true;\n\t\t\t\tgAddMargins = true;\n\t\t\t\twindow.onload = MPRepaintWindow;\n\t\t\t}\n\t\t} else if (navigator.appVersion >= \"5\") {\n\t\t\t// N6/mozilla engine\n\t\t\tgDeleteNNObjects = true;\n\t\t\tgDOM1 = true;\n\t\t\tgCalcDPIInNewWindow = false;\n\t\t\tgUseEquationOffsets = true;\n\t\t\tgFontSize1px = true;\n\t\t\tif (navigator.appVersion.indexOf(\"Macintosh\") != -1) {\n\t\t\t\tgPrintRelative = true;\t\t\t\n\t\t\t}\n\t\t} else {\t\t\t\n\t\t\t// Netscape Navigator 4.x\n\t\t\tgIsNN4 = true;\n\t\t\twindow.captureEvents(Event.RESIZE);\n\t\t\tif (navigator.appVersion.indexOf(\"Macintosh\") != -1) {\n\t\t\t\tgPrint72DpiGIF = true; // Mac NN must print 72 dpi GIF - does not scale down large GIFs\n\t\t\t\tgScaleUpTEFonts = true;\t// scale up font sizes for techexplorer on Mac\t\t\n\t\t\t}\n\t\t\tif (navigator.appVersion < \"4\") {\n\t\t\t\talert(gMinBrowserMessage);\n\t\t\t}\n\t\t}\n\t} else if (navigator.appName==\"Microsoft Internet Explorer\") {\t\t\n\t\t// Microsoft Internet Explorer\n\t\t// extract IE version number\n\t\t// must use userAgent because appVersion does not reflect actual version number on Mac IE 5.x\n\t\tvar ieVer = 0;\n\t\tvar start = navigator.userAgent.indexOf(\"MSIE \");\n\t\tif (start != -1) {\n\t\t\tieVer = parseFloat(navigator.userAgent.substring(start+5));\n\t\t}\n\t\tif (ieVer < 4) {\n\t\t\talert(gMinBrowserMessage);\n\t\t}\n\n\t\tif (navigator.appVersion.indexOf(\"Windows\") != -1) {\n\t\t\t// Windows IE browsers\n\t\t\tgPopupEqnSpan = true;\n\t\t\tif (ieVer >= 5.5) {\n\t\t\t\t// Windows IE5.5 or later\n\t\t\t\tgIsIE5Win = true;\n\t\t\t\tgDeleteNNObjects = true;\n\t\t\t\tgDeleteScriptBlocks = true;\n\t\t\t\tgRestoreLineSpacing = true;\n\t\t\t\tgPrint96DPI = true; // must print using 96dpi sizes\n\t\t\t} else if (ieVer >= 5.0) {\n\t\t\t\t// Windows IE5\n\t\t\t\tgIsIE5Win = true;\n\t\t\t\tgDeleteNNObjects = true;\n\t\t\t\tgDeleteScriptBlocks = true;\n\t\t\t\tgRestoreLineSpacing = true;\n\t\t\t\tgAlignSubSup = true; \n\t\t\t} else {\n\t\t\t\t// Windows IE4 or earlier\n\t\t\t\t// can't DeleteNNObjects, gives error 8000000a\n\t\t\t\t//gDeleteNNObjects = true;\n\t\t\t\tgAlignSubSup = true;\n\t\t\t\tgSpanWidth1px = true; \n\t\t\t}\n\t\t} else if (navigator.appVersion.indexOf(\"Macintosh\") != -1) {\n\t\t\t// Mac IE browsers\n\t\t\tgAdjPopupTopLeft = true; // must adjust popup top in all versions of Mac IE\n\t\t\tgPopupEqnSpan = false;\n\t\t\tgScaleUpTEFonts = true; // scale up font sizes for techexplorer on Mac\t\t\t\n\t\t\tif (ieVer >= 5.1) {\n\t\t\t\tgIsIE5Mac = true;\n\t\t\t\tgAddMargins = true; // must account for BODY margins\n\t\t\t\tgPrint72DPI = true; // must print using 72dpi sizes\n\t\t\t\tgIgnorePopupTopInTables = true; // negative top values OK for popups in tables in Mac IE 4.5\n\t\t\t\tgDeleteNNObjects = true;\n\t\t\t\tgFixEquationPositions = true;\n\t\t\t\tgFixPopupsInTables = true;\n\t\t\t\tgPrintRelative = true;\n\t\t\t\twindow.onload = MPRepositionAllEquations;\n\t\t\t} else if (ieVer == 5.0) {\n\t\t\t\t// Mac IE 5.0 only\n\t\t\t\tgIsIE5Mac = true;\n\t\t\t\tgAddMargins = true; // must account for BODY margins\n\t\t\t\tgPrint72DPI = true; // must print using 72dpi sizes\n\t\t\t\tgDeleteNNObjects = true;\n\t\t\t\tgSpanWidth1px = true; // width 1px needed to get span to match img in sub/sup\n\t\t\t} else {\n\t\t\t\t// Mac IE4.5 or earlier \n\t\t\t\tgPopupEqnPadding = 0; // no need to account for padding in popups when positioning in Mac IE4.5\n\t\t\t\tgIgnorePopupTopInTables = true; // negative top values OK for popups in tables in Mac IE 4.5\n\t\t\t\tgHidePopupsOnPrint = true; // extra stylesheet rule needed to collapse space of popups\n\t\t\t}\n\t\t}\n\t} else if (navigator.appName==\"Opera\") {\n\t\t// Opera\n\t\tgDeleteNNObjects = true;\n\t\tgDOM1 = true;\n\t\tgRelativePositioning = true;\n\t\tgPrintRelative = true;\n\t}\n\n\t// install onResize handler\n\twindow.onresize = MPOnResize;\n\n\t// generate any necessary style sheet overrides\n\tMPGenStyleSheets();\n}\n}", "title": "" }, { "docid": "64b3a342316911d0065b70009e810fba", "score": "0.50529534", "text": "function CommunityNode(parent, initial) {\n \"use strict\";\n\n if (_.isUndefined(parent)\n || !_.isFunction(parent.dissolveCommunity)\n || !_.isFunction(parent.checkNodeLimit)) {\n throw \"A parent element has to be given.\";\n }\n\n initial = initial || [];\n\n var\n\n ////////////////////////////////////\n // Private variables //\n ////////////////////////////////////\n self = this,\n bBox,\n bBoxBorder,\n bBoxTitle,\n nodes = {},\n observer,\n nodeArray = [],\n intEdgeArray = [],\n internal = {},\n inbound = {},\n outbound = {},\n outReferences = {},\n layouter,\n ////////////////////////////////////\n // Private functions //\n ////////////////////////////////////\n\n getDistance = function(def) {\n if (self._expanded) {\n return 2 * def * Math.sqrt(nodeArray.length);\n }\n return def;\n },\n\n getCharge = function(def) {\n if (self._expanded) {\n return 4 * def * Math.sqrt(nodeArray.length);\n }\n return def;\n },\n\n compPosi = function(p) {\n var d = self.position,\n x = p.x * d.z + d.x,\n y = p.y * d.z + d.y,\n z = p.z * d.z;\n return {\n x: x,\n y: y,\n z: z\n };\n },\n\n getSourcePosition = function(e) {\n if (self._expanded) {\n return compPosi(e._source.position);\n }\n return self.position;\n },\n\n\n getTargetPosition = function(e) {\n if (self._expanded) {\n return compPosi(e._target.position);\n }\n return self.position;\n },\n\n updateBoundingBox = function() {\n var boundingBox = document.getElementById(self._id).getBBox();\n bBox.attr(\"transform\", \"translate(\" + (boundingBox.x - 5) + \",\" + (boundingBox.y - 25) + \")\");\n bBoxBorder.attr(\"width\", boundingBox.width + 10)\n .attr(\"height\", boundingBox.height + 30);\n bBoxTitle.attr(\"width\", boundingBox.width + 10);\n },\n\n getObserver = function() {\n if (!observer) {\n var factory = new DomObserverFactory();\n observer = factory.createObserver(function(e){\n if (_.any(e, function(obj) {\n return obj.attributeName === \"transform\";\n })) {\n updateBoundingBox();\n observer.disconnect();\n }\n });\n }\n return observer;\n },\n\n updateNodeArray = function() {\n layouter.stop();\n nodeArray.length = 0;\n _.each(nodes, function(v) {\n nodeArray.push(v);\n });\n layouter.start();\n },\n\n updateEdgeArray = function() {\n layouter.stop();\n intEdgeArray.length = 0;\n _.each(internal, function(e) {\n intEdgeArray.push(e);\n });\n layouter.start();\n },\n\n toArray = function(obj) {\n var res = [];\n _.each(obj, function(v) {\n res.push(v);\n });\n return res;\n },\n\n hasNode = function(id) {\n return !!nodes[id];\n },\n\n getNodes = function() {\n return nodeArray;\n },\n\n getNode = function(id) {\n return nodes[id];\n },\n\n insertNode = function(n) {\n nodes[n._id] = n;\n updateNodeArray();\n self._size++;\n },\n\n insertInitialNodes = function(ns) {\n _.each(ns, function(n) {\n nodes[n._id] = n;\n self._size++;\n });\n updateNodeArray();\n },\n\n removeNode = function(n) {\n var id = n._id || n;\n delete nodes[id];\n updateNodeArray();\n self._size--;\n },\n\n removeInboundEdge = function(e) {\n var id;\n if (!_.has(e, \"_id\")) {\n id = e;\n e = internal[id] || inbound[id];\n } else {\n id = e._id;\n }\n e.target = e._target;\n delete e._target;\n if (internal[id]) {\n delete internal[id];\n self._outboundCounter++;\n outbound[id] = e;\n updateEdgeArray();\n return;\n }\n delete inbound[id];\n self._inboundCounter--;\n return;\n },\n\n removeOutboundEdge = function(e) {\n var id;\n if (!_.has(e, \"_id\")) {\n id = e;\n e = internal[id] || outbound[id];\n } else {\n id = e._id;\n }\n e.source = e._source;\n delete e._source;\n delete outReferences[e.source._id][id];\n if (internal[id]) {\n delete internal[id];\n self._inboundCounter++;\n inbound[id] = e;\n updateEdgeArray();\n return;\n }\n delete outbound[id];\n self._outboundCounter--;\n return;\n },\n\n removeOutboundEdgesFromNode = function(n) {\n var id = n._id || n,\n res = [];\n _.each(outReferences[id], function(e) {\n removeOutboundEdge(e);\n res.push(e);\n });\n delete outReferences[id];\n return res;\n },\n\n insertInboundEdge = function(e) {\n e._target = e.target;\n e.target = self;\n if (outbound[e._id]) {\n delete outbound[e._id];\n self._outboundCounter--;\n internal[e._id] = e;\n updateEdgeArray();\n return true;\n }\n inbound[e._id] = e;\n self._inboundCounter++;\n return false;\n },\n\n insertOutboundEdge = function(e) {\n var sId = e.source._id;\n e._source = e.source;\n e.source = self;\n outReferences[sId] = outReferences[sId] || {};\n outReferences[sId][e._id] = e;\n if (inbound[e._id]) {\n delete inbound[e._id];\n self._inboundCounter--;\n internal[e._id] = e;\n updateEdgeArray();\n return true;\n }\n self._outboundCounter++;\n outbound[e._id] = e;\n return false;\n },\n\n getDissolveInfo = function() {\n return {\n nodes: nodeArray,\n edges: {\n both: intEdgeArray,\n inbound: toArray(inbound),\n outbound: toArray(outbound)\n }\n };\n },\n\n expand = function() {\n this._expanded = true;\n },\n\n dissolve = function() {\n parent.dissolveCommunity(self);\n },\n\n collapse = function() {\n this._expanded = false;\n },\n\n addCollapsedLabel = function(g, colourMapper) {\n var width = g.select(\"rect\").attr(\"width\"),\n textN = g.append(\"text\") // Append a label for the node\n .attr(\"text-anchor\", \"middle\") // Define text-anchor\n .attr(\"fill\", colourMapper.getForegroundCommunityColour())\n .attr(\"stroke\", \"none\"); // Make it readable\n width *= 2;\n width /= 3;\n if (self._reason && self._reason.key) {\n textN.append(\"tspan\")\n .attr(\"x\", \"0\")\n .attr(\"dy\", \"-4\")\n .text(self._reason.key + \":\");\n textN.append(\"tspan\")\n .attr(\"x\", \"0\")\n .attr(\"dy\", \"16\")\n .text(self._reason.value);\n }\n textN.append(\"tspan\")\n .attr(\"x\", width)\n .attr(\"y\", \"0\")\n .attr(\"fill\", colourMapper.getCommunityColour())\n .text(self._size);\n },\n\n addCollapsedShape = function(g, shapeFunc, start, colourMapper) {\n var inner = g.append(\"g\")\n .attr(\"stroke\", colourMapper.getForegroundCommunityColour())\n .attr(\"fill\", colourMapper.getCommunityColour());\n shapeFunc(inner, 9);\n shapeFunc(inner, 6);\n shapeFunc(inner, 3);\n shapeFunc(inner);\n inner.on(\"click\", function() {\n self.expand();\n parent.checkNodeLimit(self);\n start();\n });\n addCollapsedLabel(inner, colourMapper);\n },\n\n addNodeShapes = function(g, shapeQue) {\n var interior = g.selectAll(\".node\")\n .data(nodeArray, function(d) {\n return d._id;\n });\n interior.enter()\n .append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"id\", function(d) {\n return d._id;\n });\n // Remove all old\n interior.exit().remove();\n interior.selectAll(\"* > *\").remove();\n shapeQue(interior);\n },\n\n addBoundingBox = function(g, start) {\n bBox = g.append(\"g\");\n bBoxBorder = bBox.append(\"rect\")\n .attr(\"rx\", \"8\")\n .attr(\"ry\", \"8\")\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"black\");\n bBoxTitle = bBox.append(\"rect\")\n .attr(\"rx\", \"8\")\n .attr(\"ry\", \"8\")\n .attr(\"height\", \"20\")\n .attr(\"fill\", \"#686766\")\n .attr(\"stroke\", \"none\");\n bBox.append(\"image\")\n .attr(\"id\", self._id + \"_dissolve\")\n .attr(\"xlink:href\", \"img/icon_delete.png\")\n .attr(\"width\", \"16\")\n .attr(\"height\", \"16\")\n .attr(\"x\", \"5\")\n .attr(\"y\", \"2\")\n .attr(\"style\", \"cursor:pointer\")\n .on(\"click\", function() {\n self.dissolve();\n start();\n });\n bBox.append(\"image\")\n .attr(\"id\", self._id + \"_collapse\")\n .attr(\"xlink:href\", \"img/gv_collapse.png\")\n .attr(\"width\", \"16\")\n .attr(\"height\", \"16\")\n .attr(\"x\", \"25\")\n .attr(\"y\", \"2\")\n .attr(\"style\", \"cursor:pointer\")\n .on(\"click\", function() {\n self.collapse();\n start();\n });\n var title = bBox.append(\"text\")\n .attr(\"x\", \"45\")\n .attr(\"y\", \"15\")\n .attr(\"fill\", \"white\")\n .attr(\"stroke\", \"none\")\n .attr(\"text-anchor\", \"left\");\n if (self._reason) {\n title.text(self._reason.text);\n }\n getObserver().observe(document.getElementById(self._id), {\n subtree:true,\n attributes:true\n });\n },\n\n addDistortion = function(distFunc) {\n if (self._expanded) {\n var oldFocus = distFunc.focus(),\n newFocus = [\n oldFocus[0] - self.position.x,\n oldFocus[1] - self.position.y\n ];\n distFunc.focus(newFocus);\n _.each(nodeArray, function(n) {\n n.position = distFunc(n);\n n.position.x /= self.position.z;\n n.position.y /= self.position.z;\n n.position.z /= self.position.z;\n });\n distFunc.focus(oldFocus);\n }\n },\n\n shapeAll = function(g, shapeFunc, shapeQue, start, colourMapper) {\n // First unbind all click events that are proably still bound\n g.on(\"click\", null);\n if (self._expanded) {\n addBoundingBox(g, start);\n addNodeShapes(g, shapeQue, start, colourMapper);\n return;\n }\n addCollapsedShape(g, shapeFunc, start, colourMapper);\n },\n\n updateEdges = function(g, addPosition, addUpdate) {\n if (self._expanded) {\n var interior = g.selectAll(\".link\"),\n line = interior.select(\"line\");\n addPosition(line, interior);\n addUpdate(interior);\n }\n },\n\n shapeEdges = function(g, addQue) {\n var idFunction = function(d) {\n return d._id;\n },\n\tline,\n\tinterior;\n if (self._expanded) {\n interior = g\n .selectAll(\".link\")\n .data(intEdgeArray, idFunction);\n // Append the group and class to all new\n interior.enter()\n .append(\"g\")\n .attr(\"class\", \"link\") // link is CSS class that might be edited\n .attr(\"id\", idFunction);\n // Remove all old\n interior.exit().remove();\n // Remove all elements that are still included.\n interior.selectAll(\"* > *\").remove();\n line = interior.append(\"line\");\n addQue(line, interior);\n }\n },\n\n collapseNode = function(n) {\n removeOutboundEdgesFromNode(n);\n };\n\n ////////////////////////////////////\n // Setup //\n ////////////////////////////////////\n\n layouter = new ForceLayouter({\n distance: 100,\n gravity: 0.1,\n charge: -500,\n width: 1,\n height: 1,\n nodes: nodeArray,\n links: intEdgeArray\n });\n\n ////////////////////////////////////\n // Values required for shaping //\n ////////////////////////////////////\n this._id = \"*community_\" + Math.floor(Math.random()* 1000000);\n if (initial.length > 0) {\n this.x = initial[0].x;\n this.y = initial[0].y;\n } else {\n this.x = 0;\n this.y = 0;\n }\n this._size = 0;\n this._inboundCounter = 0;\n this._outboundCounter = 0;\n this._expanded = false;\n // Easy check for the other classes,\n // no need for a regex on the _id any more.\n this._isCommunity = true;\n\n insertInitialNodes(initial);\n\n ////////////////////////////////////\n // Public functions //\n ////////////////////////////////////\n\n this.hasNode = hasNode;\n this.getNodes = getNodes;\n this.getNode = getNode;\n this.getDistance = getDistance;\n this.getCharge = getCharge;\n\n\n this.insertNode = insertNode;\n this.insertInboundEdge = insertInboundEdge;\n this.insertOutboundEdge = insertOutboundEdge;\n\n this.removeNode = removeNode;\n this.removeInboundEdge = removeInboundEdge;\n this.removeOutboundEdge = removeOutboundEdge;\n this.removeOutboundEdgesFromNode = removeOutboundEdgesFromNode;\n\n\n this.collapseNode = collapseNode;\n\n this.dissolve = dissolve;\n this.getDissolveInfo = getDissolveInfo;\n\n this.collapse = collapse;\n this.expand = expand;\n\n this.shapeNodes = shapeAll;\n this.shapeInnerEdges = shapeEdges;\n this.updateInnerEdges = updateEdges;\n\n\n this.addDistortion = addDistortion;\n\n this.getSourcePosition = getSourcePosition;\n\n this.getTargetPosition = getTargetPosition;\n}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "d043c9da32e4ae401b706d5b45c6220f", "score": "0.50500214", "text": "function Network() {}", "title": "" }, { "docid": "c17fd275fdc010c946ba956a6bc7151c", "score": "0.503634", "text": "static process(squeezeserver, players, intent, session, callback) {\n\n //// TODO: Need to make sure that both players are turned on.\n\n var player1 = null;\n var player2 = null;\n try {\n\n console.log(\"In syncPlayers with intent %j\", intent);\n\n // Try to find the target players. We need the sqeezeserver player object for the first, but only the player info\n // object for the second.\n\n player1 = Intent.getPlayer(squeezeserver, players, intent, session)\n if (!player1) {\n\n // Couldn't find the player, return an error response\n\n console.log(\"Player not found: \" + intent.slots.FirstPlayer.value);\n callback(session.attributes, Utils.buildSpeechletResponse(intentName, \"Player not found\", null, true)); // clean up the session in case of error\n }\n\n session.attributes = {\n player: player1.name.toLowerCase()\n };\n player2 = null;\n for (var pl in players) {\n if (players[pl].name.toLowerCase() === Intent.normalizePlayer(intent.slots.SecondPlayer.value))\n player2 = players[pl];\n }\n\n // If we found the target players, sync them\n\n if (player1 && player2) {\n console.log(\"Found players: %j and player2\", player1, player2);\n player1.sync(player2.playerindex, function(reply) {\n if (reply.ok)\n callback(session.attributes, Utils.buildSpeechletResponse(\"Sync Players\", \"Synced \" + player1.name + \" to \" + player2.name, null, false));\n else {\n console.log(\"Failed to sync %j\", reply);\n callback(session.attributes, Utils.buildSpeechletResponse(\"Sync Players\", \"Failed to sync players \" + player1.name + \" and \" + player2.name, null, true));\n }\n });\n } else {\n console.log(\"Player not found: \");\n callback(session.attributes, Utils.uildSpeechletResponse(\"Sync Players\", \"Player not found\", null, false));\n }\n\n } catch (ex) {\n console.log(\"Caught exception in syncPlayers %j for \" + player1 + \" and \" + player2, ex);\n callback(session.attributes, Utils.buildSpeechletResponse(\"Sync Players\", \"Caught Exception\", null, true));\n }\n }", "title": "" }, { "docid": "e635de30f652fd3ee015c37b2d039dcb", "score": "0.50104177", "text": "function com_iStoodUp()\n{\n communication.broadcast('Dear host & players, I just stood up!', {table: tableID, myID: deviceID});\n deviceID = -2;\n}", "title": "" }, { "docid": "f908974fb4ade1c352761f6b2dca672b", "score": "0.49991536", "text": "function initialize() {\n // Start a polling method to get messages from the server. \n if (inin_messagePollTimer) return;\n inin_messagePollTimer = setInterval(function() {\n sendRequest(\"GET\", inin_sessionId + \"/messaging/messages\", null, onCheckMessagesSuccess);\n }, inin_messagePollInterval);\n\n // Set station\n if (inin_station) {\n // Build station request\n stationData = {\n \"__type\":\"urn:inin.com:connection:workstationSettings\",\n \"supportedMediaTypes\":[1],\n \"readyForInteractions\":true,\n \"workstation\": inin_station \n };\n\n sendRequest('PUT', inin_sessionId + '/connection/station', stationData,\n function (data, textStatus, jqXHR) {\n console.group('Set station success');\n console.debug(data);\n console.debug(textStatus);\n console.debug(jqXHR);\n console.groupEnd();\n }, \n function (jqXHR, textStatus, errorThrown) {\n console.group('Set station failure');\n console.debug(jqXHR);\n console.debug(textStatus);\n console.error(errorThrown);\n console.groupEnd();\n });\n }\n\n // Watch user's queue\n var queueSubscriptionData = {\n queueIds: [\n {\n queueType: 1,\n queueName: inin_username\n }\n ],\n attributeNames: [\n 'Eic_InteractionId',\n 'Eic_RemoteName',\n 'Eic_RemoteAddress',\n 'Eic_State',\n 'Eic_ObjectType',\n 'Eic_ConferenceId'\n ]\n };\n sendRequest('PUT', inin_sessionId + '/messaging/subscriptions/queues/arbitrarystring', queueSubscriptionData, \n function (data, textStatus, jqXHR) {\n console.group('Queue subscription success');\n console.debug(data);\n console.debug(textStatus);\n console.debug(jqXHR);\n console.groupEnd();\n }, \n function (jqXHR, textStatus, errorThrown) {\n console.group('Queue subscription failure');\n console.debug(jqXHR);\n console.debug(textStatus);\n console.error(errorThrown);\n console.groupEnd();\n });\n}", "title": "" }, { "docid": "e6a358d66565d89be048a4dc4d85d1e5", "score": "0.4997485", "text": "function MngtAPI_SNMP() {\n this._snmp = new SNMP();\n}", "title": "" }, { "docid": "82cf28f1fce6de303912cd87658d3be8", "score": "0.49906877", "text": "memberLeftRoom(member){\n let me = document.comm;\n if (this.joined && member.id == this.remote.id){\n //First, we're going to reset a lot of variables\n this.remote.micActivity = false;\n this.remote.micOn = false;\n this.remote.camOn = false;\n this.remote.videoElement.srcObject = null;\n this.isOfferer = false;\n this.local.videoSender = null;\n this.local.audioSender = null;\n this.remote.id = \"NULL\";\n this.callEvent(\"otherLeave\", {otherName: this.remote.name});\n this.remote.name = \"NULL\";\n //And now we start calling events to update any needed info\n this.dataChannel.close();\n this.dataChannel = null;\n this.callEvent(\"remoteMicActivityChanged\", {newMicActivity: false});\n this.remote.videoElement.load();\n this.pc.close();\n this.pc = null;\n //Finally, we reset the peerconnection and re-initialize WebRTC\n this.pc = new RTCPeerConnection(this.peerConfig);\n this.initRTC();\n }\n }", "title": "" }, { "docid": "109cb947b8d583884ed2e174d580981f", "score": "0.49635217", "text": "function USRPCConnection_createRoom()\n{\n\tvar RPC = window.USRPCConnection;\n\tvar spdAndCandidates = [RPC.sdpDescription, {type: 'candidate',candidates :RPC.candidates}];\n\t\n\t// Hide preloader & display room\n\tjQuery('.preloader').hide(); \n\tjQuery('.main-container').hide(); \n\tjQuery('.room-container').show(); \n\tRPC._ChangeUrl(\"/\", \"r/\"+RPC.roomid);\n\n\t// Sending candidates to server\n\tRPC.socket.sendConnectMessage(spdAndCandidates); \n\t\n\tconsole.log(\"Room creation & Sending candidates (\"+RPC.candidates.length+\") (timeout \"+RPC.createRoomTimeout+\")\");\n\t\n\t// Send email to opponent\n\tRPC._sendMail();\n\n\t// Getting offer & candidates from opponent\n\tRPC.socket.reciveConnectMessage();\n}", "title": "" }, { "docid": "9cc17278fff64c18bab403320ea7b689", "score": "0.4941422", "text": "function RepliesAssistant() {\n}", "title": "" }, { "docid": "c05687c3468d4e13dcd026c22c03ef49", "score": "0.49349532", "text": "function GetNetworkName() {\n var objGetNetworkName = new PartyShareControlClass();\n objGetNetworkName.GetPartyShareServerInfo(GetNetworkNameUICallback, \"\");\n}", "title": "" }, { "docid": "32b9402ff2f4d10e327199adddeec084", "score": "0.49188915", "text": "function connect() {\n\t\t//client = Stomp.overTCP('localhost', 61612);\n\t\tclient = Stomp.client( \"ws://inventario.altamira.com.br:61614/stomp\", \"v11.stomp\" );\n\t\tclient.connect( \"\", \"\",\n\t\t\tfunction() {\n\t\t\t\tconsole.log('Conectado no ActiveMQ via STOMP over Websocket.')\n\t\t\t client.subscribe(\"/topic/IHM-MATERIAL-MOVIMENTACAO\",\n\t\t\t \tfunction( message ) {\n\t\t\t \t alert( message );\n\t\t\t \t //message.ack();\n\t\t\t }, \n\t\t\t\t\t{ack: 'client', persistent: true, id:'stomp-ID-123453'} \n\t\t\t );\n\t\t\t}, function(error) {\n\t\t\t\tconsole.log('STOMP: ' + error);\n\t\t\t setTimeout(connect, 5000);\n\t\t\t console.log('STOMP: Reconecting in 5 seconds');\n\t\t\t}\n\t\t);\t\t\t\t\t\n\t}", "title": "" }, { "docid": "069a73fd8f069599ab0bba4713852020", "score": "0.49126813", "text": "function Singmaster(ml)\n{\n\tthis.ml = ml;\n}", "title": "" }, { "docid": "e62ca45115f2e26769fee4acd1c1d54e", "score": "0.49071616", "text": "function utilizeSimpleMsg() {\n\tvar simpleMsg = bot.plugins.simpleMsg.plugin;\n\n\t/* Unused listeners\n\tsimpleMsg.msgListenerAdd(pluginId, 'TOPIC', function (data) {});\n\tsimpleMsg.msgListenerAdd(pluginId, 'RPL_NAMREPLY', function (data) {});\n\tsimpleMsg.msgListenerAdd(pluginId, 'NOTICE', function (data) {});\n\tsimpleMsg.msgListenerAdd(pluginId, '+MODE', function (data) {});\n\tsimpleMsg.msgListenerAdd(pluginId, '-MODE', function (data) {});\n\t*/\n\n\tsimpleMsg.msgListenerAdd(pluginId, 'PRIVMSG', function (data) {\n\t\tfor(var bft in privmsgFunc)\n\t\t\tprivmsgFunc[bft](data);\n\t\tvar simplified = data.message.replace(/\\:/g, ' ').replace(/\\,/g, ' ').replace(/\\./g, ' ').replace(/\\?/g, ' ').trim().split(' ');\n\t\tvar isMentioned = simplified.indexOf(NICK) !== -1;\n\t\tif(data.to.indexOf(\"#\") === 0) {\n\t\t\thandleMessage(data.nick, data.to, data.message, data, simplified, isMentioned, false);\n\t\t\tif(new RegExp('\\x01ACTION ', 'g').exec(data.message) !== null)\n\t\t\t\temitter.emit('newIrcMessage', data.nick, data.to, data.message.replace('\\x01ACTION ', '').replace('\\x01', ''), \"ACTION\");\n\t\t\telse\n\t\t\t\temitter.emit('newIrcMessage', data.nick, data.to, data.message, \"PRIVMSG\");\n\t\t} else {\n\t\t\thandleMessage(data.nick, \"\", data.message, data, simplified, isMentioned, true);\n\t\t}\n\t});\n\t\n\tsimpleMsg.msgListenerAdd(pluginId, 'NICK', function (data) {\n\t\temitter.emit('newIrcMessage', data.nick, \"\", \" is now known as \"+data.newnick, \"NICK\");\n\t\tbot.log(\"\\x1b[1;36m[\"+timestamp(new Date().getTime()/1000)+\"]\\x1b[1;35m --\\x1b[0m \"+data.nick+\" is now known as \"+data.newnick);\n\n\t\tif(administration.nickserv_cache[data.nick])\n\t\t\tdelete administration.nickserv_cache[data.nick];\n\t});\n\n\tsimpleMsg.msgListenerAdd(pluginId, 'JOIN', function (data) {\n\t\temitter.emit('newIrcMessage', data.nick, data.channel, \" has joined \", \"JOIN\");\n\t\tbot.log(\"\\x1b[1;36m[\"+timestamp(new Date().getTime()/1000)+\"]\\x1b[1;32m -->\\x1b[0m \"+data.nick+\" has joined \"+data.channel);\n\t});\n\t\n\tsimpleMsg.msgListenerAdd(pluginId, 'KICK', function (data) {\n\t\temitter.emit('newIrcMessage', data.nick, data.channel, \" was kicked by \"+data.by+\" (\"+data.reason+\")\", \"KICK\");\n\t\tbot.log(\"\\x1b[1;36m[\"+timestamp(new Date().getTime()/1000)+\"]\\x1b[1;31m <--\\x1b[0m \"+data.nick+\" was kicked by \"+data.by+\" from \"+data.channel+\" (\"+data.reason+\")\");\n\t\t\n\t\tif(administration.nickserv_cache[data.nick])\n\t\t\tdelete administration.nickserv_cache[data.nick];\n\t});\n\t\n\tsimpleMsg.msgListenerAdd(pluginId, 'PART', function (data) {\n\t\temitter.emit('newIrcMessage', data.nick, data.channel, \" has left \", \"PART\");\n\t\tbot.log(\"\\x1b[1;36m[\"+timestamp(new Date().getTime()/1000)+\"]\\x1b[1;31m <--\\x1b[0m \"+data.nick+\" has left \"+data.channel+\" \"+(data.reason == null ? data.reason : \"\"));\n\t\t\n\t\tif(administration.nickserv_cache[data.nick])\n\t\t\tdelete administration.nickserv_cache[data.nick];\n\t});\n\t\n\tsimpleMsg.msgListenerAdd(pluginId, 'QUIT', function (data) {\n\t\temitter.emit('newIrcMessage', data.nick, \"\", \" has quit (\"+data.reason+\")\", \"QUIT\");\n\t\tbot.log(\"\\x1b[1;36m[\"+timestamp(new Date().getTime()/1000)+\"]\\x1b[1;31m <--\\x1b[0m \"+data.nick+\" has quit (\"+data.reason+\")\");\n\n\t\tif(administration.nickserv_cache[data.nick])\n\t\t\tdelete administration.nickserv_cache[data.nick];\n\t});\n\t\n\tsimpleMsg.msgListenerAdd(pluginId, 'RAW', function (data) {\n\t\tvar nick = data[1][0];\n\t\tvar args = data[3];\n\t\tif (data[2] === 'PRIVMSG' && args[1] && args[1].indexOf(\"\\u0001ACTION \") === 0) {\n\t\t\tvar action = args[1].substr(8);\n\t\t\taction = action.substring(0, action.length-1);\n\t\t\temitter.emit('newIrcMessage', nick, args[0], action, \"ACTION\");\n\t\t}\n\t});\n\n\t//plugin is ready\n\texports.ready = true;\n\tbot.emitBotEvent('botPluginReadyEvent', pluginId);\n}", "title": "" }, { "docid": "f999099839d9d9d64c5727c15a7fa412", "score": "0.49069768", "text": "function USRPCConnection_init(creator, roomid)\n{\t\n\tvar RPC = this;\n\t\n\tRPC.creator = creator;\n\tRPC.roomid = roomid;\n\t\n\tRPC.socket.init(creator, roomid);\n\t\n\t// Confirmation on Tab/Room closing\n\tRPC._closeTabConfirmation();\n\t\n\t// Hide video element for mobile devices\n\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t$('#localVideo').css('display', 'none');\n\t}\n\t\n\t// Is it creator ?\n\tif (RPC.creator)\n\t{\t// Yes, it is creator\n\t\t\t\n\t\t// Display room in 5 seconds\n\t\tsetTimeout(RPC._createRoom, RPC.createRoomTimeout);\n\t}\n\telse\n\t{\t// No, it is opponent\n\n\t\t// Get offer & candidates from server\n\t\tRPC.socket.reciveConnectMessage();\n\t}\n\t\n\tnavigator.getUserMedia( { audio: true, video: true }, RPC.cb_gotStream, RPC._error);\n\t\n\tconsole.log('Am I Creator ? - '+RPC.creator);\n}", "title": "" }, { "docid": "4977555b080fc07033e1bb52865285e0", "score": "0.48979074", "text": "function handlePresense(message) {\n\tconsole.log(\"handlePresense>>\");\n\tvar xmlMsgDoc = $.parseXML(message);\n\tvar $xmlMsg = $(xmlMsgDoc);\n\tvar rtcInitiator = false; // True only on first join\n\t// There may be multiple presense msgs\n\t$xmlMsg.find(\"presence\").each(function(index) {\n\t\tvar fromNick = $.trim($(this).attr(\"from\").split(\"/\")[1]);\n\t\tvar fromRoom = $(this).attr(\"from\").split(\"@\")[0];\n\t\tconsole.log(\"fromNick: |\" + fromNick + \"|, uiManager.chatName: |\" + uiManager.chatName+\"|\");\n\t\tconsole.log(fromNick == uiManager.chatName);\n\t\t// Is it an error?\n\t\tif(!$(this).has(\"error\").length) {\n\t\t\tif(fromNick == uiManager.chatName) { // Our own status\n\t\t\t\tconsole.log(\"fromRoom: \" + fromRoom + \", webdomain: \" + webDomain);\n\t\t\t\tif(fromRoom === webDomain) {\n\t\t\t\t\t// Default room\n\t\t\t\t\tconsole.log(\"type: \" + $(this).attr(\"type\"));\n\t\t\t\t\tif ($(this).attr(\"type\") && $(this).attr(\"type\") === \"unavailable\") {\n\t\t\t\t\t\t// We Left Default!\n\t\t\t\t\t\tdisconnectAllStreams();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We Joined Default!\n\t\t\t\t\t\tif(!chatSessions[0]) {\n\t\t\t\t\t\t\tchatSessions[0] = new ChatSession(clientId, webDomain, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($(this).has(\"item\").length && $(this).find(\"item\").attr(\"affiliation\") == \"owner\") {\n\t\t\t\t\t\t\t// We are the owner of this room, so lets make sure it is unlocked!\n\t\t\t\t\t\t\thandleLogin(6,fromRoom);\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// Video Chat Room\n\t\t\t\t\tif(!$(this).attr(\"type\") || $(this).attr(\"type\") === \"available\") {\n\t\t\t\t\t\t// Joined New Chat Session\n\t\t\t\t\t\tif(!chatSessions[1]) {\n\t\t\t\t\t\t\tchatSessions[1] = new ChatSession(clientId, fromRoom, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Initialize Local Video & Send RTC Offers to all\n\t\t\t\t\t\trtcInitiator = true; // Might not need this flag?\n\t\t\t\t\t\t// Try to start up our own stream\n\t\t\t\t\t\tif($(this).has(\"item\").length && $(this).find(\"item\").attr(\"affiliation\") == \"owner\") {\n\t\t\t\t\t\t\t// We just created this room, so unlock it!\n\t\t\t\t\t\t\thandleLogin(7,fromRoom);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {// External Peer Status\n\t\t\t\t// Which Room?\n\t\t\t\tif(fromRoom === webDomain) {\n\t\t\t\t\t// Peer from default room\n\t\t\t\t\tif(!$(this).attr(\"type\") || $(this).attr(\"type\") === \"available\") {\n\t\t\t\t\t\tconsole.log(\"chatSessions[0]: \" + chatSessions[0]);\n\t\t\t\t\t\tif(!chatSessions[0]) {\n\t\t\t\t\t\t\tchatSessions[0] = new ChatSession(clientId, webDomain, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!$(\"#userDiv-main-\"+name).length || $(\"#userDiv-main-\"+name).length == 0) {\n\t\t\t\t\t\t\tchatSessions[0].addUser(fromNick);\n\t\t\t\t\t\t\tuiManager.displayJoined(fromNick);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if($(this).attr(\"type\") === \"unavailable\") {\n\t\t\t\t\t\tif(chatSessions[0]) {\n\t\t\t\t\t\t\tchatSessions[0].removeUser(fromNick);\n\t\t\t\t\t\t\tuiManager.displayLeft(fromNick);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(chatSessions[1] && chatSessions[1].users[fromNick]) {\n\t\t\t\t\t\t\tuiManager.removeRemoteStream(fromNick);\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// Could get peer presence before own, so check if its created yet\n\t\t\t\t\tif(!chatSessions[1]) {\n\t\t\t\t\t\tchatSessions[1] = new ChatSession(clientId, fromRoom, true);\n\t\t\t\t\t}\n\t\t\t\t\t// Peer from video chat room\n\t\t\t\t\tif(!$(this).attr(\"type\") || $(this).attr(\"type\") === \"available\") {\n\t\t\t\t\t\tif(!chatSessions[1].users[fromNick]) {\n\t\t\t\t\t\t\tchatSessions[1].addUser(fromNick);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Start local audio/video & Create PeerConnection as initiator\n\t\t\t\t\t\tif(initiator) {\n\t\t\t\t\t\t\twebRTCQueue.push(fromNick+\"-initiator\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if($(this).attr(\"type\") && $(this).attr(\"type\") === \"unavailable\") {\n\t\t\t\t\t\tchatSessions[1].removeUser(fromNick);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Handle Error\n\t\t\tif($(this).find(\"error\").attr(\"code\") == \"404\") {\n\t\t\t\t// Room not found, try again until timeout\n\t\t\t\tif(reconnectCounter <= reconnectMax) {\n\t\t\t\t\treconnectCounter = reconnectCounter + 1;\n\t\t\t\t\thandleLogin(5);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tpopRTCQueue();\n\tuiManager.updateFromSessions(chatSessions);\n\tconsole.log(\"handlePresense<<\");\n}", "title": "" }, { "docid": "6286802b6bdb6a1a77f4bcad46091932", "score": "0.48934126", "text": "onMessageLost() {}", "title": "" }, { "docid": "00fe1a4690c3b4d7be972e4eae0f623e", "score": "0.48904717", "text": "function connectDisconnect() {\n\n if (!connected) {\n\n // User list control channel (Command)\n commandClient = new LWMessagePushClient(\n function (notify) {\n\n // Update person list\n getPersonList();\n },\n window.location.href,\n \"updateUsersReq\",\n LWMessagePushConnectionMethod.Automatic,\n function (log) {\n console.log(log);\n });\n commandClient.connect();\n\n // Message push channel\n chatClient = new LWMessagePushClient(\n function (msg) {\n receiveMessage(msg);\n },\n window.location.href,\n currentNickName,\n LWMessagePushConnectionMethod.Automatic,\n function (log) {\n console.log(log);\n });\n chatClient.connect();\n\n connected = true;\n }\n\n}", "title": "" }, { "docid": "bcfa12d33e8e1bc69b23f6c5c47f60f4", "score": "0.48796672", "text": "function createMessage(id) {\n\n var response = {};\n\n if (Math.abs(players[id].previousPosition.x - players[id].body.position.x) > 1 &&\n Math.abs(players[id].previousPosition.y - players[id].body.position.y) > 1) {\n response[\"player\"] = {\n x: Math.ceil(players[id].body.position.x),\n y: Math.ceil(players[id].body.position.y)\n };\n }\n\n\n /*var bonds = [];\n players.map(function(player) {\n return player.getBondsPositions();\n }).forEach(function(obj) {\n bonds = bonds.concat(obj);\n });*/\n\n var bonds = [];\n Composite.allConstraints(engine.world).forEach(\n function(bond) {\n bonds.push({\n x: bond.bodyA.position.x,\n y: bond.bodyA.position.y\n });\n bonds.push({\n x: bond.bodyB.position.x,\n y: bond.bodyB.position.y\n });\n });\n\n for (var i = 0; i < bonds.length; i += 2) {\n if ((!dotInScreen.call(players[id], bonds[i])) &&\n (!dotInScreen.call(players[id], bonds[i + 1]))) {\n bonds.splice(i, 2);\n i -= 2;\n }\n }\n\n response[\"bonds\"] = parseCoordinates(bonds.map(function(obj) {\n return toLocalCS(obj, players[id]); }));\n\n response[\"players\"] =\n parseCoordinates(players.filter(inScreen,\n players[id]).map(function(player) {\n var pos = toLocalCS(player.body.position, players[id]);\n return { id: player.body.id, x: Math.ceil(pos.x), y: Math.ceil(pos.y) };\n }));\n\n var particlesInScreen = ((garbage.filter(inScreen, players[id])))\n .concat(freeProtons.filter(inScreen, players[id]));\n\n for (var j = 0; j < elements.length; ++j) {\n addElements(id, response, particlesInScreen, elements[j]);\n }\n addElements(id, response, particlesInScreen, \"p\");\n addElements(id, response, particlesInScreen, \"n\");\n\n response[\"border\"] = parseCoordinates((border.filter(inScreen,\n players[id])).map(function(wall) {\n var pos = toLocalCS(wall.body.position, players[id]);\n return { x: Math.ceil(pos.x), y: Math.ceil(pos.y),\n angle: wall.body.angle.toFixed(3) };\n }));\n\n return /*JSON.stringify(*/response/*)*/;\n}", "title": "" }, { "docid": "21f3882297326f72c15c24cc61fef67a", "score": "0.4877679", "text": "syncPlayback(){\n\t\tconsole.log('sync up!');\n\n\t\t//followers send a message to the leader to sync up - so if they start late they can catch up\n\t\tif(this.configDict.playback_mode == \"follower\"){\n\t\t\t\n\t\t\tif(this.configDict.leader_ip != undefined && this.configDict.leader_ip != this.myIP){\n \t\t\tthis.getHTTP(\"http://\"+this.configDict.leader_ip+\":8000/syncCommand\",true, (response)=>{\n \t\t\t\tconsole.log(response)\n \t\t\t})\n\t\t\t}\n\t\t//leaders do a normal sync so we dont need to wait for the entire file to finish playing for it to sync up\n\t\t} else if (this.configDict.playback_mode == \"leader\"){\n\t\t\tthis.syncStart();\n\t\t} \n\t}", "title": "" }, { "docid": "be8df4829130e5310179573dfe2c219d", "score": "0.4874067", "text": "function GopherProtocol()\n{\n}", "title": "" }, { "docid": "fc4213bfcad22ffb79b1346fffd7c121", "score": "0.48720798", "text": "function ourinit() {\n // note: never use \"localhost\", or aliases for it, for production. but for a 1 machine dev test it is ok.\n var x = rs.initiate( \n { _id:'z', \n members:[ \n { _id:1, host:'localhost:27001' }, \n { _id:2, host:'localhost:27002', \"arbiterOnly\" : true }, \n { _id:3, host:'localhost:27003' } \n ] \n }\n ); \n printjson(x); \n print('waiting for set to initiate...'); \n while( 1 ) { \n sleep(2000); \n x = db.isMaster(); \n printjson(x); \n if( x.ismaster || x.secondary ) { \n print(\"ok, this member is online now; that doesn't mean all members are \");\n print(\"ready yet though.\");\n break; \n } \n } \n}", "title": "" }, { "docid": "0ff2de39887b04bbc47f865e14d16f42", "score": "0.4866412", "text": "connectedCallback()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.4860343", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.4860343", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "029320b794f68865f5ddff64c96efee3", "score": "0.48562977", "text": "function onWhispernetLoaded() {\n console.log('init: Nacl ready!');\n\n // Setup all the listeners for the private API.\n chrome.copresencePrivate.onInitialize.addListener(initialize);\n chrome.copresencePrivate.onEncodeTokenRequest.addListener(encodeTokenRequest);\n chrome.copresencePrivate.onDecodeSamplesRequest.addListener(\n decodeSamplesRequest);\n chrome.copresencePrivate.onDetectBroadcastRequest.addListener(\n detectBroadcastRequest);\n\n // This first initialized is sent to indicate that the library is loaded.\n // Every other time, it will be sent only when Chrome wants to reinitialize\n // the encoder and decoder.\n chrome.copresencePrivate.sendInitialized(true);\n}", "title": "" }, { "docid": "6aae722a2a88180321f360dcf609c8a9", "score": "0.48514313", "text": "function setLocalAndSendMessage(sessionDescription) {\n \n console.log('Valor de contador conn_count ' + conn_count); \n users[conn_count].pc.setLocalDescription(sessionDescription);\n sendMessage(sessionDescription, users[conn_count].myTarget);\n \n}", "title": "" }, { "docid": "112c5370a6cdadd532fc6e11ca1e4c5d", "score": "0.48494536", "text": "function NetInfo() {\n Pusher.EventsDispatcher.call(this);\n\n var self = this;\n // This is okay, as IE doesn't support this stuff anyway.\n if (window.addEventListener !== undefined) {\n window.addEventListener(\"online\", function() {\n self.emit('online');\n }, false);\n window.addEventListener(\"offline\", function() {\n self.emit('offline');\n }, false);\n }\n }", "title": "" }, { "docid": "1b33402f38f8cdadd9a5fd4de8107fb6", "score": "0.48444432", "text": "function stomp() {\n let socket = new SockJS(`https://${URL}/ws-stomp`);\n let stomp = new Stomp.over(socket);\n return stomp;\n}", "title": "" }, { "docid": "eb61780e7dd7cecf7225294e59939c63", "score": "0.48432225", "text": "function tickCommunity() {\n\tif (!communityLink) return;\n\tcommunityLink.attr(\"x1\", function(d) { return d.source.x; })\n\t\t.attr(\"y1\", function(d) { return d.source.y; })\n\t\t.attr(\"x2\", function(d) { return d.target.x; })\n\t\t.attr(\"y2\", function(d) { return d.target.y; });\n\tcommunityNode.attr(\"cx\", function(d) { return d.x; })\n\t\t.attr(\"cy\", function(d) { return d.y; });\n\tcommunityLabel.attr(\"dx\", function(d) { return d.x; })\n\t\t.attr(\"dy\", function(d) { return d.y; });\t \t\t\t\n}", "title": "" }, { "docid": "8405b51276a85a3fcd8644ffb03fc568", "score": "0.48253796", "text": "function SnpManageStacks() \r{\r\t/**\r\t The context in which this snippet can run.\r\t @type String\r\t*/\r\tthis.requiredContext = \"Needs to run in Bridge\";\t\r}", "title": "" }, { "docid": "e458b0002f33131d470d122932677a97", "score": "0.4824187", "text": "constructor(ws) {\n this.moves=0;\n\t this.deck = new Deck();\n\t this.deck.shuffle();\n this.deck.shuffle();\n this.snip=false;\n this.snap=false;\n this.date=null;\n this.started=false;\n this.over=true;\n this.min=0;\n this.secs=0;\n \n\t this.pile = new Pile();\n\t //this.pile.acceptACard(this.deck.dealACard());\n\t this.snipview = new Snipview(this);\n\t this.human=new Sniphuman(this.deck, this.pile, this.view);\n\t this.cpu=new Snipcpu(this.deck, this.pile, this.view);\n this.socket=ws;\n }", "title": "" }, { "docid": "8c68451af2da04ea8905a1b48c6d97a9", "score": "0.48232463", "text": "function initChat() {\r\n print(\"text_div\", '<span class=\"cln_all\">'+\"Client Version : \"+my_client_version+\".</span><br />\");\r\n printPlus(\"text_div\", '<span class=\"cln_all\">Try <b>/help</b> if you get lost.</span><br />');\r\n document.getElementById('input_box').focus();\r\n\r\n /** Request unique client identification. */\r\n pmRaw(__sm('cli/get_id'));\r\n\r\n // Call the send message function at interval to poll the server for updates.\r\n my_int_id = setInterval(\"__sm('cli/get_message')\", 5000);\r\n\r\n return;\r\n}", "title": "" }, { "docid": "78997d07dab2e8d99916224ea2a49c5a", "score": "0.48217046", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n connection_status=true;\n subscribeDefaultTopic();\n \n \n \n}", "title": "" }, { "docid": "5f06fe67c9fce0c2576c6b5413d7789e", "score": "0.482074", "text": "function SNMP() {\n // internal vars that are instance-specific\n this._challengeHandler = null;\n this._initialized = false;\n this._openListener = null;\n this._openListenerCallbackData = null;\n this._exceptionListener = null;\n this._exceptionListenerCallbackData = null;\n this._closeListener = null;\n this._closeListenerCallbackData = null;\n this._location = null;\n this._socket = null;\n this._buffer = null;\n this._notifAck = null;\n this._callbackMap = new Object();\n this._webSocketFactory = null;\n\n this._bytesRead = 0; // for debugging\n this._fragmentsRead = 0; // for debugging\n}", "title": "" }, { "docid": "ee6ff02958be7016bf3bc254751c209e", "score": "0.48191577", "text": "createPc(name, sid, id) { \n pc = new RTCPeerConnection(iceServers);\n pcObject = {\n pc: pc,\n sid: sid,\n name: name,\n id: id,\n muted: false,\n hasAudio: false,\n hasVideo: false,\n isConnected: false\n };\n this.pcs.push(pcObject);\n\n // listen for stream and ice candidates\n pc.onaddstream = event => {\n let stream = event.stream;\n pcObject.hasAudio = stream.getAudioTracks().length > 0;\n pcObject.hasVideo = stream.getVideoTracks().length > 0;\n this.$el.querySelector('#stream-' + id).srcObject = stream;\n };\n pc.onremovestream = event => {\n // only make hasAudio and hasVideo equal to false if no open streams\n if(pc.getRemoteStreams().length === 0) {\n pcObject.hasAudio = false;\n pcObject.hasVideo = false;\n }\n };\n pc.oniceconnectionstatechange = event => {\n if(pc.iceConnectionState === 'disconnected' || pc.iceConnectionState === 'closed') {\n pc.closeStreams();\n }\n };\n pc.closeStreams = () => {\n this.pcs.splice(this.pcs.indexOf(pcObject), 1);\n if(this.pcs.length === 0 && this.stream !== null) {\n this.stream.getTracks().forEach(track => track.stop());\n this.stream = null;\n }\n pcObject.isConnected = false;\n }\n pc.onicecandidate = event => {\n this.socket.emit('iceCandidate', sid, id, event.candidate);\n };\n pc.negotiateOffer = () => {\n // begin handshake\n pc.createOffer({\n offerToReceiveAudio: true,\n offerToReceiveVideo: true\n })\n .then(offer => {\n // set local description\n pc.setLocalDescription(offer);\n\n // ask for response from websocket\n this.socket.emit('createOffer', sid, id, offer, answer => {\n if(answer.success && pc.iceConnectionState === 'closed') {\n this.socket.emit('sendNotification', sid, 'Oops! ' + name + ' just ended the call.', { errorCode: 1 });\n } else if(answer.success) {\n pc.setRemoteDescription(answer.answer);\n pcObject.isConnected = true;\n } else if(pc.iceConnectionState !== 'closed') {\n this.notifications.unshift(new SimpleNotification(answer.error));\n this.disconnect(pcObject);\n }\n });\n });\n };\n pc.negotiateAnswer = (offer, cb) => {\n // create answer\n pc.setRemoteDescription(offer);\n pc.createAnswer({\n offerToReceiveAudio: true,\n offerToReceiveVideo: true\n })\n .then(answer => {\n pc.setLocalDescription(answer);\n pcObject.isConnected = true;\n cb({ success: true, answer: answer });\n });\n };\n\n return pcObject;\n }", "title": "" }, { "docid": "2b3a6c7a32c1bc55acc13b7826a93150", "score": "0.48181215", "text": "function sendFinalGuess() {\n\t//console.log(\"I am inside sendFinalGuess()\"); \n\t//check if the role and stomp client is not null\n if (myRole && stompClient) {\n\tfinalGuess =\"\"; \n \n \t//define the attributes of the final guess \n var FinalGuessMessage = {\n\t\t\trole: myRole \n };\n //console.log(\"ready to sendFinalGuess() to controller\"); \n\n $(\"#FINAL-GUESS\").hide();\n\n //send the final game message to the game \n stompClient.send(`${gameTopic}/sendFinalGuess`, {}, JSON.stringify(FinalGuessMessage));\n }\n}", "title": "" }, { "docid": "15a78f451660ec3a66bd3c1658727a98", "score": "0.48066145", "text": "static sync(squeezeserver, players, intent, session, lastname, callback) {\n\n // Need to make sure that both players are turned on.\n\n console.log(\"In syncPlayers with intent %j\", intent);\n\n var player1 = null;\n var player2 = null;\n try {\n\n // Try to find the target players. We need the squeezeserver player object for the first, but only the player info\n // object for the second.\n\n let playerName = ((typeof intent.slots.FirstPlayer.value !== \"undefined\") && (intent.slots.FirstPlayer.value !== null) ? intent.slots.FirstPlayer.value : session.attributes.player);\n player1 = Intent.findPlayerObject(squeezeserver, players, playerName, lastname);\n if (player1 === null) {\n\n // Couldn't find the player, return an error response\n\n console.log(\"Player not found: \" + intent.slots.FirstPlayer.value);\n callback(session.attributes, Utils.buildSpeechResponse(intentName, \"Player not found\", null, session.new));\n }\n session.attributes = { player: player1.name.toLowerCase() };\n\n playerName = Intent.normalizePlayer(((typeof intent.slots.SecondPlayer.value !== \"undefined\") && (intent.slots.SecondPlayer.value !== null) ? intent.slots.SecondPlayer.value : session.attributes.player));\n for (let pl in players)\n if (players[pl].name.toLowerCase() === playerName)\n player2 = players[pl];\n\n // If we found the target players, sync them\n\n if (player1 && player2) {\n\n console.log(\"Found players: player1 %j and player2 %j\", player1, player2);\n player1.sync(player2.playerindex, function(reply) {\n if (reply.ok) {\n callback(session.attributes, Utils.buildSpeechResponse(\"Sync Players\", \"Synced \" + player1.name + \" to \" + player2.name, null, session.new));\n } else {\n console.log(\"Failed to sync %j\", reply);\n callback(session.attributes, Utils.buildSpeechResponse(\"Sync Players\", \"Failed to sync players \" + player1.name + \" and \" + player2.name, null, true));\n }\n });\n\n } else {\n\n console.log(\"Player not found: \");\n callback(session.attributes, Utils.buildSpeechResponse(\"Sync Players\", \"Player not found\", null, session.new));\n }\n\n } catch (ex) {\n console.log(\"Caught exception in syncPlayers %j for \" + player1 + \" and \" + player2 + \" \" + ex);\n callback(session.attributes, Utils.buildSpeechResponse(\"Sync Players\", \"Caught Exception\", null, true));\n }\n }", "title": "" }, { "docid": "fccbd5c006dbb6b5ef63c79d9548b6c7", "score": "0.47864157", "text": "function tcp_stream_ready() {\n\n // Load all History\n get_all_history({\n channel : vote_channel,\n callback : function(messages) {\n PUBNUB.each( messages, vote_receiver );\n }\n });\n\n}", "title": "" }, { "docid": "7b17d795fcd13da47eb9d7f336eb9e0b", "score": "0.4783538", "text": "function main() {\n mc = mcp.createServer({\n \"online-mode\": config.onlineMode,\n encryption: false,\n host: \"0.0.0.0\",\n port: config.serverPort,\n version: \"1.17.1\",\n maxPlayers: config.maxPlayers,\n motd: config.motdMessage,\n beforePing: function(r) {\n r.favicon = config.favicon;\n }\n });\n\n mc.on(\"connection\", function(c) {\n if (config.onViewMessages)\n console.log(`Someone just viewed the server: ${f.yellow}${c.socket.address()['address']}`);\n if (config.startOnView) {\n if (lock) locked(c)\n else {\n console.log(`${f.green}Starting the server!`);\n startServer(c);\n }\n }\n });\n \n mc.on(\"login\", function(c) {\n console.log(`Player ${f.green}${c.username}${f.reset} just tried to join, ${f.green}starting the server!`);\n if (lock) locked(c)\n else startServer(c);\n });\n\n console.log(`${f.cyan}Waiting for connections!\\n`);\n}", "title": "" }, { "docid": "b1d4d85b26587bd3137033e8fb781a78", "score": "0.47798306", "text": "function init( ) {\n\tw\t\t\t\t\t\t= { };\n\tmLog\t\t\t\t\t= { };\n\tmLog.isDebugEnabled\t\t= true;\n\t\n\t$( \"#demo_box\" ).authentication( );\t\n\t$.jws.bind( 'open', function( aEvt, aToken ) {\n\t\t$( '#board' ).ball( );\n\t\t$( '#scenario_body' ).stage( ); \n\t\t$( '#board' ).player( );\n\t\t$( '#online' ).connected( );\n\t\t$( '#main_content' ).menu( );\n\t\t$( '#main_content' ).chat( );\n\t\t$( '#scenario_body' ).ranking( );\n\t} );\n\t\n\t$.jws.bind(\"org.jwebsocket.plugins.system:welcome\", function(aEvt, aToken){\n\t\t//Change status offline by online\n\t\t$( \"#client_status\" ).hide( ).attr( \"class\", \"\" ).addClass( \"online\" ).text( \"online\" ).show( );\n\t\t$( \"#client_id\" ).text(\"Client-ID: \" + aToken.sourceId);\n\t});\n\t\n\t$.jws.bind( 'close', function( aEvt, aToken ) {\n\t\t//Change the status online by offline\n\t\t$( \"#client_status\" ).hide( ).attr( \"class\", \"\" ).addClass( \"offline\" ).text( \"disconnected\" ).show( );\n\t\t$( \"#client_id\" ).text(\"Client-ID: - \");\n\t\t\n\t\tdialog( 'Ping Pong Game', 'There is no connection with the server', true );\n\t\t\n\t\t//modifying the dialog style\n\t\t$( \".ui-widget-overlay\" ).css( {\n\t\t\t'background': '#eeeeee !important',\n\t\t\t'opacity':'.80',\n\t\t\t'filter':'Alpha( Opacity=80 )'\n\t\t} );\n\t} );\n\t\n\t$.jws.bind( 'pingpong:databaseError', function( aEvt, aToken ) {\n\t\tdialog( 'Ping Pong Game', \"<div style='color:red;'>\" + aToken.msg + \"</div>\", true );\n\t\t//modifying the dialog style\n\t\t$( \".ui-widget-overlay\" ).css( {\n\t\t\t'background': '#eeeeee !important',\n\t\t\t'opacity':'.80',\n\t\t\t'filter':'Alpha( Opacity=80 )'\n\t\t} );\n\t} );\n\t\n\t//Set WebSocket type\n\t$('#websocket_type').text(\"WebSocket: \" + (jws.browserSupportsNativeWebSockets ? \"(native)\" : \"(flashbridge)\" ));\n\t$( '#scenario_menu' ).hide( );\n\t$( '#obj_area' ).hide( );\n\t$( '#scenario_chat' ).hide( );\n}", "title": "" }, { "docid": "cbc0d99d133f6bcf6eb76648acfaa5af", "score": "0.47790948", "text": "function initNetcast() {\n\n var lock = settings.createLock();\n var hotspot = lock.get('tethering.wifi.ssid');\n\n hotspot.onsuccess = function () {\n\n console.log('tethering.wifi.ssid: ' + hotspot.result['tethering.wifi.ssid']);\n var castName = hotspot.result['tethering.wifi.ssid'];\n checkConfigInfo(castName);\n console.log(\"initNetcast configState:\" + configState + \":\" + connectssid);\n\n if (null == configState) {\n\n if (null == deviceName) {\n var num = \"\";\n for (var i = 0; i < 4; i++) {\n num += Math.floor(Math.random() * 10);\n }\n castName = 'MatchStick' + num;\n console.log(\"castName:\" + castName);\n\n var name = settings.createLock().set({\n 'tethering.wifi.ssid': castName\n });\n\n var type = settings.createLock().set({\n 'tethering.wifi.security.type': 'open'\n });\n\n // set init device name, then we notify flingd\n deviceName = castName;\n notifyNameChanged();\n\n handleTimezoneSet(\"Asia/Shanghai\", false);\n code = genKeyCode();\n var storeObj = {\n name: castName,\n code: code,\n timezone: 'Asia/Shanghai'\n };\n storeData(storeObj);\n }\n\n networkHelper.openHotspot(configState);\n PageHelper.skipPage(PageHelper.PAGE_STATUS.setup_page);\n\n } else {\n if (null == connectssid) {\n var request = networkManager.getKnownNetworks();\n\n request.onsuccess = function () {\n var networks = this.result;\n\n networks.forEach(function (network) {\n console.log(\"forEach:\" + network.ssid);\n networkManager.forget(network);\n });\n\n configState = null;\n networkHelper.openHotspot(configState);\n PageHelper.skipPage(PageHelper.PAGE_STATUS.setup_page);\n };\n\n request.onerror = function () {\n console.log(\"connectingfail forget wifi onerror\");\n configState = null;\n networkHelper.openHotspot(configState);\n PageHelper.skipPage(PageHelper.PAGE_STATUS.setup_page);\n };\n\n } else {\n if (!networkManager.enabled) {\n console.log(\"initNetcast: openWifi\");\n isInit = true;\n networkHelper.openWifi();\n PageHelper.skipPage(PageHelper.PAGE_STATUS.connect_page);\n } else {\n var connection = networkManager.connection;\n\n if (null != connection && connection != undefined) {\n\n console.log(\"connection:\" + connection.status);\n if (null != connection.status && connection.status != undefined) {\n\n if (connection.status == 'connected') {\n configState = WIFI_CONFIG_STATE.SUCCESS;\n storeConfigState(WIFI_CONFIG_STATE.SUCCESS);\n PageHelper.skipPage(PageHelper.PAGE_STATUS.ready_page);\n\n } else if (connection.status == 'associated'\n || connection.status == 'connecting') {\n PageHelper.skipPage(PageHelper.PAGE_STATUS.connect_page);\n\n } else {\n initConnectWifi();\n }\n\n } else {\n initConnectWifi();\n }\n\n } else {\n initConnectWifi();\n }\n }\n }\n }\n PageHelper.setKeyCodeElement(code);\n PageHelper.setElement(castName, connectssid);\n };\n\n hotspot.onerror = function () {\n console.error(\"An error occured: \");\n };\n }", "title": "" }, { "docid": "f53dfd675d634626c5106db3309c3cea", "score": "0.4777275", "text": "function joinNetworkHelper(networkCard)\n {\n // Update the network card's button\n networkCard.find(\".cardButton\").text(\"Leave network\").removeClass(\"joinNetwork\").addClass(\"leaveNetwork\");\n\n // Update the network card's classes\n networkCard.removeClass(\"otherNetworks\").addClass(\"myNetworks\");\n\n // Update the number of members in the network\n var numMembersElement = networkCard.find(\".numMembers\");\n var newNumMembers = parseInt(numMembersElement.attr(\"numMembers\")) + 1;\n numMembersElement.attr(\"numMembers\", newNumMembers);\n if (newNumMembers == 1)\n {\n numMembersElement.html(\"1 member\")\n }\n else\n {\n numMembersElement.html(newNumMembers + \" members\")\n }\n }", "title": "" }, { "docid": "a39a86ef40c8fb2860f5cd72f77fea3b", "score": "0.47738132", "text": "ping() {\n let n = this.roomCntr;\n let inet = this.internet;\n let siz = this.roomSiz;\n let mxsiz2 = 0; // Maximum combined size of 2 rooms\n let StereoMCs; // connected\n for (let i = 0; i < n; ++i) {\n for (let j = i + 1; j < n; ++j) {\n if (inet[i][j] != undefined) {\n let siz2 = siz[i] + siz[j];\n if (mxsiz2 < siz2) {\n mxsiz2 = siz2;\n StereoMCs = inet[i][j];\n }\n }\n }\n }\n let [i, j, k] = StereoMCs;\n console.log(\"[\" + i + \",\" + j + \"]: \" + DIRECfN[k]);\n }", "title": "" }, { "docid": "b22770cbad7a94c14c5e2a8d414900fd", "score": "0.47714275", "text": "function init_msg() {\n switch (curS) {\n case 'I1' :\n if (rQlen()<12) { return fail(\"Incomplete version\"); }\n tmp = rQstr(12).substr(0,11);\n sTimer = setInterval(function (){ send([], true); }, 25);\n send((\"RFB 003.003\\n\").split('').map(\n function (c) { return c.charCodeAt(0); } ), true);\n state('I2', \"Got \" + tmp + \" sent RFB 003.003\");\n break;\n case 'I2' :\n if (rQwait(\"security scheme\", 4)) { return false; }\n tmp = rQ4();\n switch (tmp) {\n case 0: return fail(\"Auth failure: \" + rQstr(rQ4()));\n case 1: break;\n case 2: return fail(\"Server password not supported\");\n default: return fail(\"Unsupported auth: \" + tmp);\n }\n send([shared ? 1 : 0], true); // ClientInitialisation\n state('I3'); \n break;\n case 'I3' :\n if (rQlen()<24) { return fail(\"Invalid server init\"); }\n\n Cw = rQ2(); Ch = rQ2(); // Screen size\n rQi += 16; // ignore bpp, depth, endian, true_color, pad\n\n debug(\"Screen: \" + Cw + \"x\" + Ch);\n tmp = \"connection to: \" + rQstr(rQ4());\n\n C.width = Cw; C.height = Ch;\n modEvents(true);\n\n var i, n, arr = [0, 0,0,0, Cbpp*8, Cdepth*8,\n 0,1,0,255,0,255,0,255, 0,8,16,0,0,0]; // pixelFormat\n arr.push(2, 0,0, encList.length); // clientEncodings\n for (i=0; i<encList.length; i++) {\n n = encList[i];\n arr.push((n>>24)&0xff, (n>>16)&0xff, (n>>8)&0xff, (n)&0xff);\n }\n send(arr, false, 0);\n\n state('normal', (wss?\"E\":\"Une\") + \"ncrypted \" + tmp);\n break;\n }\n}", "title": "" }, { "docid": "eedca7220d77166180073fc5a9fee9e5", "score": "0.47666195", "text": "function syncplayer() {\n\n setup_firebase();\n\n load_yt_api();\n\n //Register pause/play handlers\n document.querySelector(\"#playButton\").addEventListener('click', () => {\n\n if(player === undefined) {\n return\n }\n\n //Play the video\n player.playVideo();\n\n //Send event via STOMP\n\n //Create the event\n let data = {\n 'eventType': 'PLAY',\n 'timeStamp': player.getCurrentTime()\n }\n\n //Send to the message endpoint\n stompClient.send(`/app/room/${get_room_id()}/syncevent`,\n {},\n JSON.stringify(data)\n );\n\n\n });\n\n //Register pause/play handlers\n document.querySelector(\"#pauseButton\").addEventListener('click', () => {\n if(player === undefined) {\n return\n }\n //Pause the video\n player.pauseVideo();\n\n //Send event via STOMP\n\n //Create the event\n let data = {\n 'eventType': 'PAUSE',\n 'timeStamp': player.getCurrentTime()\n }\n\n //Send to the message endpoint\n stompClient.send(`/app/room/${get_room_id()}/syncevent`,\n {},\n JSON.stringify(data)\n );\n\n\n });\n\n}", "title": "" }, { "docid": "5d115cc7b0758c83ae986ceae910bf4a", "score": "0.47659874", "text": "function video_chat_lobby()\n{\n\ttrace(\"video_chat_lobby()\");\n\tif ( $('#room-list').length ) {\n\t\tupdate_room_list = true;\n\t\tchat_room_list();\n\t}\n}", "title": "" }, { "docid": "1291ce1c71f9678af39eeab3a6e4a051", "score": "0.4763817", "text": "async function sendMessage(payload) {\n console.log(\"in send message\")\n var roomMembers = payload.roomMembers;\n console.log(\"roomMembers: \", roomMembers)\n console.log(\"from: \" + payload.sender);\n\n let payloadStr = JSON.stringify(payload);\t\n console.log(\"payloadStr \" + payloadStr); \t\n \t\n var fullPayload = {\t\n nonce: '',\t\n key: '',\t\n payloadEncrypted: '',\t\n box: true,\t\n };\t\n \t\n //Decoded string to be encrypted\t\n const strDecoded = new Uint8Array(nacl.util.decodeUTF8(payloadStr))\t\n console.log(\"strDecoded \" + strDecoded); \t\n //new nonce being generated\t\n const nonce = await nacl.randomBytes(24)\t\n var encryptedNonce = nacl.util.encodeBase64(nonce);\t\n \t\n fullPayload.nonce = encryptedNonce; \t\n \t\n //If the conversation is between 2 (box)\t\n if (roomMembers.length==2){\t\n console.log(\"using box\");\t\n for (var i = 0; i < roomMembers.length ; i++){\t\n //If the member is not the sender (recipient)\t\n if(roomMembers[i] != payload.sender){\t\n //Retrieve decoded public key\t\n var recipient_public_key = await getPublicKey(roomMembers[i]);\t\n //Retrieve sender's private key\t\n const myKeys = await AsyncStorage.getItem('keys');\t\n const keysObj = JSON.parse(myKeys);\t\n console.log(\"myKeys\" + myKeys); \t\n var sender_private_key = nacl.util.decodeBase64(keysObj.secret);\t\n //Create shared key\t\n const mySharedKey = nacl.box.before(recipient_public_key, sender_private_key)\t\n //Encrypt the message and convert to Base64 format. Base64EncryptedStr is message to be sent.\t\n const EncryptedStr = nacl.box.after(strDecoded, nonce, mySharedKey)\t\n const Base64EncryptedStr = nacl.util.encodeBase64(EncryptedStr)\t\n fullPayload.payloadEncrypted = Base64EncryptedStr ;\t\n fullPayload = JSON.stringify(fullPayload);\t\n }\t\n }\t\n \t\n \t\n }\t\n //If the conversation is between multiple users (secretbox)\t\n else{\t\n console.log(\"using secret box\");\t\n fullPayload.box = false; \t\n //Generate random key\t\n \t\n const symmetrickey = await nacl.randomBytes(32)\t\n console.log(\"sym key\" + symmetrickey); \t\n // var symKey = nacl.util.decodeUTF8(symmetrickey); \t\n //encrypt decoded string with nonce and key\t\n const EncryptedStr = nacl.secretbox(strDecoded, nonce, symmetrickey)\t\n console.log(\"Encrypted STring\" + EncryptedStr); \t\n //Encrypted string encoded to base 64\t\n const Base64EncryptedStr = nacl.util.encodeBase64(EncryptedStr)\t\n fullPayload.payloadEncrypted = Base64EncryptedStr;\t\n console.log(\"Base64EncryptedStr \" + Base64EncryptedStr); \t\n //Encoded key prepared to be sent\t\n const key_encoded = nacl.util.encodeBase64(symmetrickey)\t\n fullPayload.key = key_encoded; \t\n fullPayload = JSON.stringify(fullPayload);\t\n }\t\n \t\n\n const myKeys = await AsyncStorage.getItem('keys');\t\n console.log(\"Keys genererated: Public - \" + myKeys);\t\n const keysObj = JSON.parse(myKeys);\t\n // console.log(\"Full payload:\" + JSON.stringify(fullPayload)); \t\nconsole.log(\"full payload\" + fullPayload); \t\n console.log(\"private\" + keysObj);\n for (var i = 0; i < roomMembers.length ; i++){\n if(roomMembers[i] != payload.sender){\n console.log(\"other users: \" + roomMembers[i]);\n const package_ = {\n to: roomMembers[i],\n from: payload.sender,\n payload: fullPayload,\n };\n console.log(\"package: \" + JSON.stringify(package_));\n const resp = await API.graphql(graphqlOperation(createMessage, { input: package_ })).then(\n console.log(\"AWS Success - Create Message\")\n ).catch(\n (error) => {\n console.log(\"Error_____________________\\n\" ,error)\n }\n );\n console.log(resp);\n }\n }\n}", "title": "" }, { "docid": "e0fc81f590ff959c2d4be21bc59093db", "score": "0.47542217", "text": "function CIRCSTS()\n{\n this.policyList = new Object();\n this.preloadList = new Object();\n}", "title": "" }, { "docid": "0bb8cad85125c2001d24254fee6c3127", "score": "0.4749945", "text": "function SmpParser(protocol)\r\n{\r\n var msgTypes = this.msgTypes = {\r\n connected: 'C'.charCodeAt(0),\r\n disconnected: 'D'.charCodeAt(0),\r\n message: 'M'.charCodeAt(0),\r\n ack: 'A'.charCodeAt(0),\r\n error: 'E'.charCodeAt(0)\r\n };\r\n\r\n var msgTypeFnLookUp = {};\r\n\r\n var readState;\r\n var tmpMsgBuffer;\r\n\r\n var resetState = this.resetState = function resetStateFn()\r\n {\r\n readState = null;\r\n tmpMsgBuffer = new Buffer(1024);\r\n };\r\n resetState();\r\n\r\n function growBuffer()\r\n {\r\n var newBuffer = new Buffer(tmpMsgBuffer.length * 2);\r\n tmpMsgBuffer.copy(newBuffer);\r\n tmpMsgBuffer = newBuffer;\r\n }\r\n\r\n var parseDataRecursive = function parseDataRecursive(buffer, start, end)\r\n {\r\n if (start >= end)\r\n {\r\n return;\r\n }\r\n if (readState)\r\n {\r\n //console.log('readState');\r\n readState.fn(buffer, 0, end);\r\n }\r\n else\r\n {\r\n var msgTypeId = buffer.readUInt8(start);\r\n //console.log(String.fromCharCode(msgTypeId));\r\n var msgTypeFn = msgTypeFnLookUp[msgTypeId];\r\n if (msgTypeFn)\r\n {\r\n msgTypeFn(buffer, start, end);\r\n }\r\n else\r\n {\r\n console.error('Simple Message Protocol: Unrecongnized message type ' + msgTypeId);\r\n }\r\n }\r\n };\r\n\r\n var parseData = this.parseData = function parseData(buffer)\r\n {\r\n parseDataRecursive(buffer, 0, buffer.length);\r\n };\r\n\r\n var parseFixedLength = function parseFixedLengthFn(buffer, start, end)\r\n {\r\n // if not all of the fixed length message bytes are here\r\n var remainingLength = readState.fixedLength - readState.tmpMsgLength;\r\n if (start + remainingLength > end)\r\n {\r\n // copy the available message bytes\r\n var partLength = end - start;\r\n buffer.copy(tmpMsgBuffer, readState.tmpMsgLength, start, start + partLength);\r\n readState.tmpMsgLength += partLength;\r\n return;\r\n }\r\n\r\n var messageStart;\r\n if (readState.tmpMsgLength > 0)\r\n {\r\n // copy the remaining message length bytes\r\n buffer.copy(tmpMsgBuffer, readState.tmpMsgLength, start, remainingLength);\r\n messageStart = start + remainingLength;\r\n }\r\n else\r\n {\r\n messageStart = start + readState.fixedLength;\r\n }\r\n readState.nextFn(buffer, start, messageStart, end);\r\n };\r\n\r\n var parseConnected = function parseConnectedFn(buffer, start, end)\r\n {\r\n protocol.onConnected();\r\n parseDataRecursive(buffer, start + 1, end);\r\n };\r\n\r\n var parseDisconnected = function parseDisconnectedFn(buffer, start, end)\r\n {\r\n protocol.onDisconnected();\r\n parseDataRecursive(buffer, start + 1, end);\r\n };\r\n\r\n var parseMessagePart = function parseMessagePartFn(buffer, start, end)\r\n {\r\n var msgEnd = start + readState.msgRemainingLength;\r\n var msgPartLength;\r\n //console.log('start', start);\r\n //console.log('end', end);\r\n //console.log('readState.msgRemainingLength', readState.msgRemainingLength);\r\n //console.log('msgEnd', msgEnd);\r\n //console.log('readState.tmpMsgLength', readState.tmpMsgLength);\r\n if (msgEnd <= end)\r\n {\r\n if (readState.tmpMsgLength === 0)\r\n {\r\n //console.log('readState \"' + buffer.toString('utf8', start, msgEnd) + '\"');\r\n protocol.onMessage(buffer.toString('utf8', start, msgEnd), readState.ackIndex);\r\n }\r\n else\r\n {\r\n //console.log('tmpMsgBuffer.copy fin');\r\n msgPartLength = msgEnd - start;\r\n if (readState.tmpMsgLength + msgPartLength > tmpMsgBuffer.length)\r\n {\r\n growBuffer();\r\n }\r\n buffer.copy(tmpMsgBuffer, readState.tmpMsgLength, start, msgEnd);\r\n readState.tmpMsgLength += msgEnd - start;\r\n protocol.onMessage(tmpMsgBuffer.toString('utf8', 0, readState.tmpMsgLength), readState.ackIndex);\r\n }\r\n\r\n // finished reading the message\r\n //console.log('readstate null');\r\n readState = null;\r\n parseDataRecursive(buffer, msgEnd, end);\r\n }\r\n else\r\n {\r\n msgPartLength = end - start;\r\n if (readState.tmpMsgLength + msgPartLength > tmpMsgBuffer.length)\r\n {\r\n growBuffer();\r\n }\r\n buffer.copy(tmpMsgBuffer, readState.tmpMsgLength, start, end);\r\n readState.msgRemainingLength -= msgPartLength;\r\n readState.tmpMsgLength += msgPartLength;\r\n\r\n //console.log('tmpMsgBuffer.copy length', readState.tmpMsgLength);\r\n }\r\n };\r\n\r\n var parseMessageData = function parseMessageDataFn(buffer, start, messageStart, end)\r\n {\r\n var msgLength;\r\n var ackIndex;\r\n if (readState.tmpMsgLength > 0)\r\n {\r\n ackIndex = tmpMsgBuffer.readUInt16BE(0);\r\n msgLength = tmpMsgBuffer.readUInt16BE(2);\r\n }\r\n else\r\n {\r\n ackIndex = buffer.readUInt16BE(start);\r\n msgLength = buffer.readUInt16BE(start + 2);\r\n }\r\n\r\n readState = {\r\n fn: parseMessagePart,\r\n tmpMsgLength: 0,\r\n ackIndex: ackIndex,\r\n msgRemainingLength: msgLength\r\n };\r\n\r\n if (messageStart < end)\r\n {\r\n parseMessagePart(buffer, messageStart, end);\r\n }\r\n else if (msgLength === 0)\r\n {\r\n // if the message has no length then emit it now\r\n // or it wont be emitted until parseData is next called\r\n // and will read the next message type byte!\r\n protocol.onMessage('', ackIndex);\r\n readState = null;\r\n }\r\n };\r\n\r\n var parseMessage = function parseMessageFn(buffer, start, end)\r\n {\r\n readState = {\r\n fixedLength: 4,\r\n tmpMsgLength: 0,\r\n fn: parseFixedLength,\r\n nextFn: parseMessageData\r\n };\r\n parseFixedLength(buffer, start + 1, end);\r\n };\r\n\r\n var parseHeartbeat = function parseHeartbeatFn(buffer, start, end)\r\n {\r\n protocol.heartbeatRecieved();\r\n parseDataRecursive(buffer, start + 1, end);\r\n };\r\n\r\n var parseAckIndex = function parseAckIndex(buffer, start, newStart, end)\r\n {\r\n var ackIndex;\r\n if (readState.tmpMsgLength > 0)\r\n {\r\n ackIndex = tmpMsgBuffer.readUInt16BE(0);\r\n }\r\n else\r\n {\r\n ackIndex = buffer.readUInt16BE(start);\r\n }\r\n protocol.onAck(ackIndex);\r\n readState = null;\r\n\r\n parseDataRecursive(buffer, newStart, end);\r\n };\r\n\r\n var parseAck = function parseAckFn(buffer, start, end)\r\n {\r\n readState = {\r\n fixedLength: 2,\r\n tmpMsgLength: 0,\r\n fn: parseFixedLength,\r\n nextFn: parseAckIndex\r\n };\r\n parseFixedLength(buffer, start + 1, end);\r\n };\r\n\r\n msgTypeFnLookUp[msgTypes.connected] = parseConnected;\r\n msgTypeFnLookUp[msgTypes.disconnected] = parseDisconnected;\r\n msgTypeFnLookUp[msgTypes.message] = parseMessage;\r\n msgTypeFnLookUp[msgTypes.heartbeat] = parseHeartbeat;\r\n msgTypeFnLookUp[msgTypes.ack] = parseAck;\r\n}", "title": "" }, { "docid": "0ac879117f01703f674dc2a6cbc5b73b", "score": "0.47496253", "text": "onMessage() {}", "title": "" }, { "docid": "4043b065d8615a4e932d159495dd794f", "score": "0.4745468", "text": "pcCallback(){\n this.sendSignal('sdp', this.pc.localDescription);\n }", "title": "" }, { "docid": "dfaaab4eadd4f3a3aaadfccd92c295d8", "score": "0.4739214", "text": "function onConnect(server)\n{\n}", "title": "" }, { "docid": "5db5d15c14d5e44ecb5b8c997fb7ed80", "score": "0.4736891", "text": "function OverlayConnectionPosition() { }", "title": "" }, { "docid": "4a929695ac1350853690f6c820015097", "score": "0.4736207", "text": "function firstConnected({remoteIDs=[],address=''}) {\n addressDisplay.innerHTML = `http://${address}`;\n remotes = {};\n for (var i = 0; i < remoteIDs.length; i++) {\n remoteJoined(remoteIDs[i]);\n }\n}", "title": "" }, { "docid": "5af6cc75a81551898c245166481c1bca", "score": "0.47312534", "text": "_beforeConnect() {\n\t\tthis.debug('beforeConnect');\n\t\tthis._supportPingPong = false;\n\t\tthis._rcvBuffer = '';\n\t\tthis._invalidCmdCount = 0;\n\t\tthis._shareID = 19;\n\t\tif(!this.opts.username) {\n\t\t\tthrow new Error('Stratum requires username to be not null');\n\t\t}\n\t}", "title": "" }, { "docid": "fb05639ba77858db547f076186d7ab7e", "score": "0.47290772", "text": "function ConnectedPosition() { }", "title": "" }, { "docid": "1de50023f5b7150e680b05127683510e", "score": "0.47281885", "text": "function setpresencestatus(statustring)\n{\n return plhandler.SetPresenceStatus (statustring);\n}", "title": "" }, { "docid": "ca14e23f94fa768eceee38a216785aa0", "score": "0.47268912", "text": "function start() {\n console.log(\"Start\");\n pc = new RTCPeerConnection(configuration);\n // send any ice candidates to the other peer\n pc.onicecandidate = function (evt) {\n // Nhan duoc Candidate from STUN Server\n console.log(\"Nhan duoc Candidate from STUN Server:\" + JSON.stringify({ candidate: evt.candidate }));\n //signalingChannel.send(JSON.stringify({ candidate: evt.candidate }));\n };\n\n // let the \"negotiationneeded\" event trigger offer generation\n pc.onnegotiationneeded = function () {\n pc.createOffer().then(function (offer) {\n // Tao duoc Offer\n console.log(\"Da tao duoc Offer:\" + offer);\n return pc.setLocalDescription(offer);\n })\n .then(function () {\n // send the offer to the other peer\n console.log(\"Gui Offer cho kenh:\" + JSON.stringify({ desc: pc.localDescription }));\n //signalingChannel.send(JSON.stringify({ desc: pc.localDescription }));\n })\n .catch(logError);\n };\n\n\n // once remote track arrives, show it in the remote video element\n pc.ontrack = function (evt) {\n // don't set srcObject again if it is already set.\n console.log(\"Khi media den\");\n if (!remoteView.srcObject)\n remoteView.srcObject = evt.streams[0];\n };\n\n\n // get a local stream, show it in a self-view and add it to be sent\n navigator.mediaDevices.getUserMedia({ audio: true, video: true })\n .then(function (stream) {\n console.log(\"Da get duoc Stream\");\n selfView.srcObject = stream;\n pc.addTrack(stream.getAudioTracks()[0], stream);\n pc.addTrack(stream.getVideoTracks()[0], stream);\n })\n .catch(logError);\n // Khi tin hieu den\n /* \n signalingChannel.onmessage = function (evt) {\n if (!pc)\n start(false);\n \n var message = JSON.parse(evt.data);\n if (message.desc) {\n var desc = message.desc;\n \n // if we get an offer, we need to reply with an answer\n if (desc.type == \"offer\") {\n pc.setRemoteDescription(desc).then(function () {\n return pc.createAnswer();\n })\n .then(function (answer) {\n return pc.setLocalDescription(answer);\n })\n .then(function () {\n var str = JSON.stringify({ desc: pc.localDescription });\n signalingChannel.send(str);\n })\n .catch(logError);\n } else\n pc.setRemoteDescription(desc).catch(logError);\n } else\n pc.addIceCandidate(message.candidate).catch(logError);\n };\n */\n\n function setupChat() {\n channel.onopen = function () {\n // e.g. enable send button\n enableChat(channel);\n };\n\n channel.onmessage = function (evt) {\n showChatMessage(evt.data);\n };\n }\n\n function sendChatMessage(msg) {\n channel.send(msg);\n }\n\n function logError(error) {\n log(error.name + \": \" + error.message);\n }\n\n\n}", "title": "" }, { "docid": "8dbba5fa355a823de40d93ff0aef7f0a", "score": "0.4722412", "text": "function JoinGame() {\n\t// Your code goes here for joining a game\n\tprint(\"Complete this method in Multiplayer.js\");\n}", "title": "" }, { "docid": "bfcde30f28b343c1e1ffc82a2abfbdb5", "score": "0.47125962", "text": "function SyncScore(msg, isReceived) {\n //Hvis den lokale spillers hold er 1 og der er kommet en ny besked.\n if (LocalPlayer[\"teamNumber\"] == 1 && isReceived) {\n //Opdatere den lokale spillers score.\n LocalPlayer[\"score\"] = msg[\"oScore\"];\n }\n\n //Hvis den lokale spillers hold er 2.\n if (LocalPlayer[\"teamNumber\"] == 2) {\n //Sætter den lokale spillers score til den udregnet score fra appelsinerne.\n LocalPlayer[\"score\"] = score\n\n //Sender den nye score til anden spiller.\n const msg = {\n oScore: LocalPlayer[\"score\"]\n }\n socket.sendMessage(msg);\n }\n}", "title": "" }, { "docid": "00cf67c4f59310638a16274836d62f02", "score": "0.4710452", "text": "function RTCIceServer() {\n}", "title": "" }, { "docid": "c14f9b4bed43a6d071516d1e924ed94e", "score": "0.47071892", "text": "constructor(session) {\n super();\n\n // Holds session\n this.session = session;\n\n this.playerNames = this.session.game.playerNames;\n\n var welcome = new Message('system', this.session.config.title,0);\n\n // Holds messages\n this.sayMessages = [\n welcome,\n new Message('info', 'This is an info message',0),\n new Message('error', 'This is an error message',0),\n new Message('area', 'Player: This is a message emitted nearby',0),\n ];\n\n this.guildMessages = [\n welcome,\n new Message('guild', '[Guild] Someone: This is your guild channel (if you have a guild)',0)\n ];\n\n this.worldMessages = [\n welcome,\n new Message('channel', '[World]: This is the official world channel',0),\n ]\n\n this.wispMessages = [\n welcome,\n new Message('whisper outgoing', 'To [Someone]: This is an outgoing whisper',0),\n new Message('whisper incoming', 'wispers: This is an incoming whisper',0),\n ]\n\n this.logsMessages = [\n welcome,\n new Message('info', '[Logs]: This is a log window',0),\n ]\n\n // Listen for messages\n this.session.game.on('packet:receive:SMSG_GM_MESSAGECHAT', ::this.handleGmMessage);\n this.session.game.on('packet:receive:SMSG_MESSAGE_CHAT', ::this.handleMessage);\n this.session.game.on('packet:receive:SMSG_CHANNEL_NOTIFY', ::this.handleNotify);\n }", "title": "" } ]
531fdce617df77f3d4f94d0090879bef
Don't emit readable right away in sync mode, because this can trigger another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
[ { "docid": "5f60aac8d94d5833ab0fc03e62e08f8e", "score": "0.0", "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": "9bae87dba04d76100123b2399f47025c", "score": "0.7284219", "text": "function emitReadable$2(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n nextTick$2(function() {\n emitReadable_$2(stream);\n });\n else\n emitReadable_$2(stream);\n}", "title": "" }, { "docid": "935276f3134afe98115dcb01f8477266", "score": "0.71162724", "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": "7299c96550cea3de930ffb7a762ec963", "score": "0.69792116", "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": "1410dbfc28004eadc82b97a2c370d869", "score": "0.6975417", "text": "function emitReadable$1(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug$4('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) nextTick$2(emitReadable_$1, stream);else emitReadable_$1(stream);\n }\n}", "title": "" }, { "docid": "761854a312e6cda78f1a24f1fa7a2fd9", "score": "0.69335407", "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": "81fe90a0e0e0440e8fb02d4f805f51a1", "score": "0.6902265", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\t\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "81fe90a0e0e0440e8fb02d4f805f51a1", "score": "0.6902265", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\t\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "7b3ece83502baf151de03ceecfe149f1", "score": "0.6883772", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (state.emittedReadable)\n\t return;\n\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t process.nextTick(function() {\n\t emitReadable_(stream);\n\t });\n\t else\n\t emitReadable_(stream);\n\t}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "c416d812719b148ecbb2858c01f3f875", "score": "0.6873843", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n process.nextTick(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "ba50951aa120f5220bb59e18cb9cf7ed", "score": "0.6826565", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "68e9d958a05e167256fac13052e62c79", "score": "0.68255055", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (state.emittedReadable)\n return;\n\n state.emittedReadable = true;\n if (state.sync)\n timers.setImmediate(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n}", "title": "" }, { "docid": "538af8e5b5aebeacecf3d28c40a02912", "score": "0.6788729", "text": "_read() {\n this._readingPaused = false;\n setImmediate(this._onReadable.bind(this));\n }", "title": "" }, { "docid": "22f3bf8128663450eb830609aa8346e5", "score": "0.6787482", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug$3('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n nextTick$2(function() {\n emitReadable_(stream);\n });\n else\n emitReadable_(stream);\n }\n}", "title": "" }, { "docid": "e473c316f5a371c5a2a79d035b345c2c", "score": "0.67618406", "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": "e69bd9d6310cc1dbe80f123cdf7224b5", "score": "0.6744082", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t processNextTick(emitReadable_, stream);\n\t else\n\t emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "e69bd9d6310cc1dbe80f123cdf7224b5", "score": "0.6744082", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t processNextTick(emitReadable_, stream);\n\t else\n\t emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "e69bd9d6310cc1dbe80f123cdf7224b5", "score": "0.6744082", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync)\n\t processNextTick(emitReadable_, stream);\n\t else\n\t emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "493ca84092db452ed6d1bd5fac2adcb4", "score": "0.67414147", "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": "304a4a1a94263e37e52eb2e8fb5b2642", "score": "0.67394763", "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": "57f31a5ba3d2357a7a60eb1536ac4679", "score": "0.6721861", "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": "ed123a7e83bb1972200dc4849d6eff4b", "score": "0.6721551", "text": "function emitReadable$3(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug$5('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) index$19(emitReadable_$3, stream);else emitReadable_$3(stream);\n }\n}", "title": "" }, { "docid": "454f42a9660fc95c185976157e1843b0", "score": "0.67203134", "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": "454f42a9660fc95c185976157e1843b0", "score": "0.67203134", "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": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" }, { "docid": "a871876eb9bc954da5cd5fe146c3693c", "score": "0.67159444", "text": "function emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}", "title": "" } ]
ca1bdbc701a6e5b4629097a3000839cd
Helper function for fetch calls
[ { "docid": "0fd5f3c87f157b9fdbb1bcd8fcecbdc0", "score": "0.0", "text": "function fetchCall(url, options = {}) {\n return fetch(url, options)\n .then((response) => {\n if (!response.ok) {\n return response.json().then((error) => {\n throw error;\n });\n }\n if (options.method === \"DELETE\") {\n return response.text();\n }\n if (url === config.REISEARCH_API_ENDPOINT) {\n return;\n }\n return response.json();\n })\n .then((data) => {\n return data;\n })\n .catch((error) => {\n throw error;\n });\n}", "title": "" } ]
[ { "docid": "4ab323d25a842f7aad5aa3c55e831248", "score": "0.6945129", "text": "function fetch(_x) {\n return _fetch.apply(this, arguments);\n} // on error function", "title": "" }, { "docid": "a27e5c5c0301beaf7f1e79b014a0f94b", "score": "0.6804593", "text": "static fetch() {\n }", "title": "" }, { "docid": "37218033af46338084dd0a60bc7f9c7e", "score": "0.67636704", "text": "_fetchRequest(url, options) {\n return (0, _fetch.default)(url, options);\n }", "title": "" }, { "docid": "949492315686d5c38c79e0d3e52ef6b4", "score": "0.66673535", "text": "fetchData() {}", "title": "" }, { "docid": "6536376c1f21c7de4a91556a63cfab81", "score": "0.6474628", "text": "fetchData() {\n // fetch logic\n }", "title": "" }, { "docid": "e39b3db7c74b1dc376bae8fba2390d33", "score": "0.64139813", "text": "async handleFetch() {\n const results = await fetch(this.url);\n const resultsJson = await results.json();\n\n return resultsJson;\n }", "title": "" }, { "docid": "00d4042cd34353ac4a252c1663d61cd2", "score": "0.6408033", "text": "static basicFetch(endpoint, searchParams) {\n // fetch() returns a promise, which resolves to response sent back from the server. Once promise resolves, then() used to convert response to json\n return fetch(`${Helper.baseURL()}${endpoint}?${Helper.urlBuilder(searchParams)}&${Helper.auth()}`\n // json() method of Fetch API's Body mixin takes server's response stream and reads it to completion, then returns a promise that resolves with result of parsing body text as JSON (it converts string received from server to a JSON object)\n ).then(res => res.json());\n }", "title": "" }, { "docid": "db321adc623d640ae0636fe50d605422", "score": "0.63979137", "text": "function fetchObjects() {\n const url = `${ BASE_URL }/object?${ 'apikey=cef9253a-aabb-442d-aaf5-6013e9448b59' }`\n\n \n fetch(url)\n .then(function (response) {\n return response.json()\n }).then(function (response) {\n console.log(response);\n }).catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "3c88917917757ed5a40df1cc0d7bb23a", "score": "0.63567716", "text": "static _handleFetch(url, params = {}, method=\"GET\"){\n url = apiBase + url;\n let queryString = \"\";\n\n if(method === 'GET'){ //builds query string based on params object\n queryString = '?' + Object.keys(params)\n .map(function(k){\n return encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);\n }).join('&');\n }\n return fetch(url + queryString, {\n method: method,\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n 'Token': token\n },\n body: (method === 'GET' ? null : JSON.stringify(params))\n })\n /* fetch only throws an error to our catch\n block if the server doesn't respond. So a 500 response\n from the server will still resolve in your promises \n success. The processStatus function handles that for us.\n */\n .then(ApiService._processStatus)\n .then(res => res.text()) // Sometimes servers return 200 with no response, we convert to text and make sure it has length or we return an empty object\n .then(response => response.length ? JSON.parse(response) : {})\n .catch((err)=>{\n throw err;\n });\n\n }", "title": "" }, { "docid": "b7617a3584d4b3dd6c45a3ed794e73e0", "score": "0.63474375", "text": "fetchingData (url) {\n return fetch(url)\n .then(response => {\n if (response.status !== 200) {\n console.log('Problem ' + response.status)\n }\n return response.json()\n })\n }", "title": "" }, { "docid": "fdea394c824fdf4a76b5e231ca69e8ab", "score": "0.62706137", "text": "_fetch(url) {\n return fetch(url, {\n method: \"GET\",\n headers: {\n 'Authorization': `Bearer ${this.token}`\n }\n })\n .then(res => res.json())\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "52a1ec951d5edaa18bad8e57c5cd07fe", "score": "0.62497175", "text": "bug5() {\n const defaultMethod = 'GET';\n const defaultUseCaching = false;\n\n function fetch(options) {\n const url = options.url;\n const method = options.method || defaultMethod;\n const useCaching = options.useCaching || defaultUseCaching;\n\n console.log(`fetch: ${method} ${url} (useCaching=${useCaching})`);\n }\n\n fetch({\n url: 'http://www.example.com',\n useCaching: false\n });\n }", "title": "" }, { "docid": "25cb080d866b5f9eb11dce95f7b4e71f", "score": "0.61989605", "text": "function fetchData() {\n fetch(HOST_URL)\n .then(res => {\n if (!res.ok) {\n throw new Error()\n }\n return res.json()\n })\n .then(data => {\n helper.addComponent(data)\n helper.counter(data)\n })\n .catch(err => {\n helper.notification('We could not processed your request. Please try again.')\n });\n }", "title": "" }, { "docid": "7a30a7c34285461875895857fcf170bf", "score": "0.6154919", "text": "_fetch() {\n this._init = true;\n if(this._resource) {\n return this._fetchResource();\n }\n return this._fetchArray();\n }", "title": "" }, { "docid": "a96e53af0210315fe17243121442524a", "score": "0.6150191", "text": "function getData(url) {\n fetch(url).then(function (request){\n return request.json()\n }).then(function (data) {\n console.log(data)\n })\n}", "title": "" }, { "docid": "cb67e894bd8bdf65c333988622ae1e82", "score": "0.6146773", "text": "function fetchData(url) {\n return fetch(url);\n }", "title": "" }, { "docid": "9c9beb8ccd50c1773988334d647c8f49", "score": "0.612999", "text": "fetchAllOrders() {\n return fetch(config.BASE_URL + \"order/all\", {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Access-Control-Allow-Origin\": \"*\",\n \"Authorization\": \"Bearer \" + getTokenFromLocalStorage(),\n },\n body: JSON.stringify(userStore.userFromServer),\n })\n .then((res) => {\n if (res.status >= 200 && res.status < 300) {\n res.json().then((response) => {\n this.allOrders = response;\n });\n } else {\n console.log(\"error on fetching1\");\n }\n })\n .catch((error) => {\n console.log(\"Error on fetching2\");\n throw error;\n });\n }", "title": "" }, { "docid": "2a34f6812a95baa0fb49f70c168ba2b4", "score": "0.61231136", "text": "function _fetch() {\n return fetch(`${movieApiUrl}?${params}`, {\n method: \"GET\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n const index = Math.floor(\n Math.random() * data.results.length\n );\n\n if (listId) {\n const movieid = data.results[index].id;\n \n fetch(\n `${server_url}/api/lists/${listId}/rated/${movieid}`\n ).then(response => {\n if (response.status < 400) {\n _fetch();\n }\n else {\n return res.status(201).send(data.results[index]);\n }\n });\n }\n else {\n return res.status(201).send(data.results[index]);\n }\n\n\n })\n .catch(error => console.log(\"this is the error: \" + error));\n }", "title": "" }, { "docid": "7b148f43d29f5793d86c165b706d8c7f", "score": "0.61162937", "text": "function getData(url) {\n return fetch(url); //fetches data from API url\n}", "title": "" }, { "docid": "ff157f4af2148c78416a98fa46aad8aa", "score": "0.6116052", "text": "function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new PouchPromise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n PouchPromise.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n }).catch(function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}", "title": "" }, { "docid": "ff157f4af2148c78416a98fa46aad8aa", "score": "0.6116052", "text": "function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new PouchPromise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n PouchPromise.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n }).catch(function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}", "title": "" }, { "docid": "31235dbeaa264629903e3e4e599f100e", "score": "0.61149365", "text": "function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new PouchPromise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n PouchPromise.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n })[\"catch\"](function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}", "title": "" }, { "docid": "fc157e8b01abeaf27726bc2c2768cf53", "score": "0.6102611", "text": "function fetchData(endpoint) {\n /**\n * Fetch and return data from an endpoint. */\n return fetch(endpoint)\n .then(function (response) {\n if (response.ok) {return response.json();}\n else {return {}}\n })\n .then(function (json) {\n if (isNotEmpty(json)) {return json;}\n else {return {};}\n })\n .catch(function (error) {\n console.log(error);\n return {};\n })\n}", "title": "" }, { "docid": "8a48ecedd50a7f103cc586e364c50842", "score": "0.6099474", "text": "function fetchData(url){\n return fetch(url)\n .then(resp => resp.json())\n}", "title": "" }, { "docid": "09eda58adfcdd6e49cb0f35d12a65262", "score": "0.60952854", "text": "fetchData() {\n let config = {\n method: 'GET',\n headers: {\n 'authorization': 'Bearer ' + this.state.auth,\n 'content-Type': 'application/json'\n },\n }\n // eslint-disable-next-line\n fetch('http://' + this.state.hostIP + ':' + this.state.port + '' + '/channels/' + this.state.channelName + '/chaincodes/' + this.state.chaincodeName + '?peer=' + this.state.peerName + '&fcn=queryCustom&args=%5B%22%7B%5C%22selector%5C%22:%7B%5C%22_rev%5C%22:%5C%22' + this.state.hash + '%5C%22,%5C%22payerId%5C%22:%5C%22' + this.state.username + '%5C%22%7D%7D%22%5D', config)\n .then(response => response.json())\n .then(response => {\n if (JSON.stringify(response) === '[]') {\n this.setState({ 'items': [] })\n } else {\n this.setState({ 'items': response, fhirUrl: response.Record.fhirUrl, 'submitersFilters': response.Record.fhirUrl, hash: '', Holder: this.state.hash, disableHashInput: true })\n }\n })\n\n }", "title": "" }, { "docid": "98b9b7007765c954f82e5bea60a81132", "score": "0.60801464", "text": "function fetchData( query, format ){\n // Format is JSON by default unless otherwise stated\n return format ? fetch(`${ query }&format=${ format }`) : fetch(`${ query }`);\n }", "title": "" }, { "docid": "df43918c0cf38d057daaf425e0a62d75", "score": "0.60728824", "text": "function load(){\n let response = fetch (\"\")\n}", "title": "" }, { "docid": "27796f9bb6323767948de898aa7121e6", "score": "0.6072302", "text": "fetch() {\n return this._fetchData();\n }", "title": "" }, { "docid": "a082060327acdb9d099815c3648aa7bc", "score": "0.6058418", "text": "async bodyOperation(url, data, operation){\n const results = await fetch(url,{\n method: operation,\n body: data\n })\n .then((response) => response.json())\n .catch((error) => {\n console.error(error);\n alert(error);\n });\n return results;\n }", "title": "" }, { "docid": "2c07484757e2e4eb2f847d934f3015dc", "score": "0.60528904", "text": "fetchDataFromFlickr() {\n let url = this.generateApiUrl();\n let fetchPromise = fetch(url)\n this.setLoading(true)\n fetchPromise\n .then(response => response.json())\n .then(parsedResponse => this.processFlickrResponse(parsedResponse))\n }", "title": "" }, { "docid": "5a2041630609a334683f825de36dccb3", "score": "0.6044321", "text": "simpleFetch() {\n fetch('https://jgtbdylysi.execute-api.us-east-1.amazonaws.com/listBooks')\n .then(r => r.json())\n .then(c =>\n console.log(\"Fetch: \" + JSON.stringify(c)));\n }", "title": "" }, { "docid": "1a08639305ade72613843c6ff6f44b06", "score": "0.60257524", "text": "handleFetch() {\n fetch(this.state.url)\n .then(response=>response.json())\n .then(json=>this.setState({data: json}))\n .catch(error=>console.error(error))\n }", "title": "" }, { "docid": "e28d89e216e7d091de439d7e9a09c6e1", "score": "0.6025729", "text": "function getData(){\n return fetch(DATABASE_URL);\n\n}", "title": "" }, { "docid": "e0a8b8fcf68a14713df1c151bab13cce", "score": "0.60227543", "text": "function getDataCoins(){\n// return initiates/ call function fetch(url) and gets the response.json in return from the fetch(url) function call.\n return fetch(coinsUrl)\n .then(res => {\n return res.json();\n })\n// Created an Error Handling Catch box\n .catch (err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "ae90a246467d35a2dae5a197bfe18946", "score": "0.6020938", "text": "function fetchData(url) {\n console.log(url);\n console.log(\"fetching\" + url);\n fetch(url )\n .then(function (response) {\n return response.json()\n })\n .then(function (myJson) {\n ProcessAndRender(myJson);\n })\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "96cf2706f294a34447be34f733796773", "score": "0.6013316", "text": "function fetchCoordinates(fetchString){\n fetch(fetchString)\n .then(function (response) {\n return response.json();\n })\n .then(function (city) {\n let lon = city.lon;\n let lat = city.lat;\n fetchActivities(lon, lat);\n })\n}", "title": "" }, { "docid": "156c7c06edc2689490ff864e80df2cf4", "score": "0.60031515", "text": "function fetchSomething() {\n return {\n type: FETCH_SOMTHING\n };\n}", "title": "" }, { "docid": "03f2e71e170242a5749be0ee387bd445", "score": "0.5992482", "text": "function getUsers() {\n return getFetch('https://jsonplaceholder.typicode.com/users/')\n}", "title": "" }, { "docid": "0e018488d46e2f68743e2947c71ce8cf", "score": "0.5988143", "text": "function toFetchInfo(url){\n\tfetch(url) \n\t\t.then((resp) => resp.json())\n\t\t.then(function(data){\n\t\t\tconsole.log(data.results);\n\t\t})\n\t\t.catch(function(error) {\n\t\t\tconsole.log(error);\n\t\t }); \n}", "title": "" }, { "docid": "1c3bf4c21df064b99d8a9732d1afc409", "score": "0.59867024", "text": "GetData() {\n var url= this.props.url; //just shorter to use during debugging\n if(!url){\n return;\n }\n\n var fetchParam = {\n method: \"GET\",\n headers: {\n \"Accept\" : \"application/json; version=1.0\",\n \"Content-Type\": \"application/json\",\n \"Access-Control-Allow-Origin\" : \"*\",\n \"Access-Control-Allow-Headers\": \"Origin, X-Requested-With, Content-Type, Accept,\"\n }\n }//fetchParam\n\n return fetch (url, fetchParam).then((data) => {\n this.state.fetched = data;\n return data.json();\n }).then((json) => {\n this.setState({\n fetched : json\n });\n this.setState({forceRender : true });\n return json;\n }).catch((error) => {\n console.log(\"GetData() error fetching '\" + this.props.url + \"'! [\" + error + \"]\");\n this.setState({ fetched : this.state.model });\n });\n }", "title": "" }, { "docid": "5a2f39551ea24fc733969d232229edce", "score": "0.5980391", "text": "function fetchData(url) {\n return fetch(url)\n .then(res => res.json()); \n }", "title": "" }, { "docid": "8aa9a3c1b4b05cd8d7cf97a709170ac7", "score": "0.5948297", "text": "function callFetch(url) {\n\treturn fetch(url)\n\t.then(response => {return response.json();})\n\t.catch(err => console.log(\"Problem with fetch:\" + err));\n}", "title": "" }, { "docid": "aea719b2c5549b3bb281ff6e41ec7da7", "score": "0.59423155", "text": "get(url){ //GET Request\n\n return new Promise((resolve,reject)=>{\n fetch(url)\n .then(response => response.json())\n .then(data => resolve(data))\n .catch(err => reject(err))\n\n })\n \n }", "title": "" }, { "docid": "9ba41b77a0df15f4ad867d975a44d721", "score": "0.5941189", "text": "fetchData()\n {\n\n }", "title": "" }, { "docid": "79946eb5f33774738de296d876ebe227", "score": "0.5936318", "text": "function getData(url) {\n return fetch(url)\n}", "title": "" }, { "docid": "8c67acedb610e81222de597181b06672", "score": "0.5931363", "text": "function makeFetch(url) {\n switch (url) {\n case url:\n console.log(\"Request is made\");\n \n case \"domain.com/user/1\":\n return new Promise(function (resolve, reject) {\n resolve(\n JSON.stringify({\n language: \"EN\",\n name: \"Pippa Malmgren\",\n account: \"10.000 USD\",\n response: 200\n })\n )\n });\n\n case \"domain.com/user/2\":\n return new Promise(function (resolve, reject) {\n resolve(\n JSON.stringify({\n language: \"EN\",\n name: \"Peter Thiel\",\n account: \"5.000 USD\",\n response: 200\n })\n )\n });\n\n case \"domain.com/bootstrap/1\":\n return new Promise(function (resolve, reject) {\n resolve(\n JSON.stringify({\n country: \"US\",\n response: 200\n })\n )\n });\n\n case \"domain.com/bootstrap/2\":\n return new Promise(function (resolve, reject) {\n resolve(\n JSON.stringify({\n country: \"US\",\n response: 200\n })\n )\n });\n\n default:\n return new Promise(function (resolve, reject) {\n reject(\n JSON.stringify({\n response: 404\n })\n )\n });\n }\n}", "title": "" }, { "docid": "f7754a7d558a8a26aab2d69b4662a28f", "score": "0.5929674", "text": "fetch(url, options = {}) {\n\n return new Promise((resolve, reject) => {\n\n // const defaultOptions = {\n // method: 'POST', // *GET, POST, PUT, DELETE, etc.\n // mode: 'cors', // no-cors, *cors, same-origin\n // cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n // credentials: 'same-origin', // include, *same-origin, omit\n // headers: {\n // 'Content-Type': 'application/json'\n // // 'Content-Type': 'application/x-www-form-urlencoded',\n // },\n // redirect: 'follow', // manual, *follow, error\n // referrerPolicy: 'no-referrer'\n // }\n\n // const allFetchOptions = {\n // ...options,\n // ...defaultOptions\n // }\n\n resolve();\n \n // fetch(url, options).then(....\n });\n }", "title": "" }, { "docid": "5c38950643432a019f57f143f3d1a977", "score": "0.59250224", "text": "async fetchSomeData() {\n return 1\n }", "title": "" }, { "docid": "382105fcbbb440c7f4b41697c1c1ee46", "score": "0.59195566", "text": "getArtworkFromServer(){\n\n let urlauthorList = \"http://localhost:4000/users\";\n\n fetch(urlauthorList).then(\n results => results.json()).then(results => this.setState({'authorList': results})).catch(error => {\n console.log(`400 Retrieving Author List Error when fetching: ${error}`);\n this.setState({isFetched : false});\n return;\n });\n this.setState({isFetched:true});\n\n\n }", "title": "" }, { "docid": "8d1f7b307810dfc56fd120734165ddef", "score": "0.591955", "text": "fetchData() {\n let type = this.getFetchType();\n switch (type) {\n case 'backend':\n this.fetchBackend(); \n case 'global':\n this.applyDataHandlers();\n case 'data':\n this.applyDataHandlers(this.props.data);\n } \n }", "title": "" }, { "docid": "c15428e3c923bb75893a1bb24906807d", "score": "0.5917828", "text": "function fetchData(url) {\n return fetch(url)\n .then(response => {if (!response.ok) { throw Error(response.status); }\n else {return response.json();}})\n .catch(err => console.log(err.message));\n}", "title": "" }, { "docid": "930835207c9a726f9ce6e806bcc7816e", "score": "0.591192", "text": "function fetchData(){\n let url = \"bestreads.php?mode=books\";\n fetch(url, {credentials: \"include\"}) \n .then(checkStatus)\n .then(JSON.parse)\n .then(displayBooks)\n .catch(error);\n }", "title": "" }, { "docid": "110ac971b395fae378d30de3d38b7d03", "score": "0.5909148", "text": "fetchOrders() {\n return fetch(config.BASE_URL + \"order\", {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Access-Control-Allow-Origin\": \"*\",\n \"Authorization\": \"Bearer \" + getTokenFromLocalStorage(),\n },\n body: JSON.stringify(userStore.userFromServer),\n })\n .then((res) => {\n if (res.status >= 200 && res.status < 300) {\n res.json().then((response) => {\n console.log(response);\n this.orders = response;\n });\n } else {\n console.log(\"error on fetching1\");\n }\n })\n .catch((error) => {\n console.log(\"Error on fetching2\");\n throw error;\n });\n }", "title": "" }, { "docid": "c5c1a9d27898bda9bb9e20a24ad3e2a3", "score": "0.5907025", "text": "function Fetcher() {\r\n }", "title": "" }, { "docid": "66723baa850a10b1c4e695fda9f782c4", "score": "0.59051406", "text": "fetchData() {\n fetch(`http://localhost:8081/policeViolence/${this.state.race}/${this.state.minAge}/${this.state.maxAge}/${this.state.year}`,\n {\n method: 'GET'\n }).then(res => {\n return res.json();\n }, err => {\n console.log(err);\n }).then(result => {\n if (!result || result.length < 1) return;\n this.updateHeatMap(result);\n }, err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "fee34d6cebe6ce8a0f79d8f86512ea2d", "score": "0.58857304", "text": "loadActivityData() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_activity_by_location/\" + this.props.route.params.locationID, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(obj => this.processActivityData(obj));\n }", "title": "" }, { "docid": "93c893a7b90a04cfe6c2c81102578ce0", "score": "0.5881254", "text": "function fetch(input) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n // In case we're being passed in a single plain object (not Request), assume it has a url field\n if (isPlainObject(input)) {\n return fetch.apply(undefined, [input.url].concat(Array.prototype.slice.call(arguments)));\n }\n\n var options = Object.assign.apply(Object, [{}].concat(args));\n\n // Ensure that there's a .headers field for preprocessors\n options.headers = new Headers(options.headers || {});\n\n var preprocessors = options.preprocessors || fetch.defaultPreprocessors || [];\n\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = preprocessors[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var preprocessor = _step9.value;\n\n options = preprocessor(options) || options;\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n\n options.onSuccess = options.onSuccess || options.success;\n options.onError = options.onError || options.error;\n options.onComplete = options.onComplete || options.complete;\n\n if (typeof options.cache === \"boolean\") {\n options.cache = options.cache ? \"force-cache\" : \"reload\";\n // TODO: cache still isn't fully done\n }\n\n options.method = options.method || \"GET\";\n\n // If there are any url search parameters, update the url from the urlParams or urlSearchParams fields\n // These fields can be plain objects (jQuery style) or can be URLSearchParams objects\n var urlParams = options.urlParams || options.urlSearchParams;\n if (urlParams) {\n // Change the URL of the request to add a query\n if (input instanceof Request) {\n input = new Request(composeURL(input.url, urlParams), input);\n } else {\n input = new Request(composeURL(input, urlParams), {});\n }\n }\n\n return new XHRPromise(input, options);\n}", "title": "" }, { "docid": "fe67dcd3523880d20603a1bda0a2455f", "score": "0.5879349", "text": "function a(){\n fetch('http://test.com').then(x=>console.log(\"response return\",x))\n}", "title": "" }, { "docid": "bf6de3f8c0f9a5db0cb0720c28d872bb", "score": "0.58606637", "text": "async function fetchFrom(handle){\n const response = await fetch(handle)\n return await response.json()\n}", "title": "" }, { "docid": "557a7ce13a70b5b353d4678ecea94856", "score": "0.5856693", "text": "fetchData(url, successCb){\n fetch(url)\n .then(response => response.json())\n .then(data => { \n successCb && successCb(data)\n this.setState({ data, loading: false, fetchError: false });\n })\n // Hanle exception\n .catch(err => { \n this.setState({loading: false, fetchError:true});\n })\n }", "title": "" }, { "docid": "db3de113eb1fc04bd1fd0d8bb9966b31", "score": "0.5852051", "text": "function fetchUsers() {\n //function to fetch users\n return fetch(`${BASE_URL}/users`)\n .then(function (response) {\n return response.json(); //calls json, returns result\n })\n .catch(function (error) {\n console.error(error); //logs out any errors\n });\n}", "title": "" }, { "docid": "5d4a4277cc060d37fa4ff8b404dcb186", "score": "0.5849728", "text": "async get(url){\n const response = await fetch(url);\n const resData = await response.json();\n return resData;\n}", "title": "" }, { "docid": "d1cfc71cff6f6b5bfc8af900983757ea", "score": "0.5847062", "text": "async getNumberBranch() {\n\n let id = AuthService.getCurrentIdUser();\n let url = API_URL + \"affiliate/listPartners/numberBranch/\" + id;\n return await fetch(url)\n .then(res => res.json())\n .then(response => {\n return response;\n })\n .catch(error => {\n //console.log(error);\n return undefined;\n });\n }", "title": "" }, { "docid": "97ecbafc237312eec6c1865fdf92d98f", "score": "0.58457136", "text": "static fetchAllSync() {\n }", "title": "" }, { "docid": "b598dfe0d900e7945f929f27bbb7ffd1", "score": "0.5841513", "text": "fetchRecents() {\n const userType = localStorage.getItem('userType') === 'Customer' ? 'requesterUserName' : 'taskerUserName';\n fetch(`/api/service-requests/get-user?${userType}=${localStorage.getItem('username')}`, {\n method: 'GET'\n })\n .then(res => res.json())\n .then(data => {\n this.setState({ requests: data });\n });\n }", "title": "" }, { "docid": "f95712d6536e0631db5f74d2c345a896", "score": "0.58405983", "text": "async function getData (url='') {\n //response from the server\n let response= await fetch(url);\n\n try {\n let newData= await response.json();\n return newData;\n }\n\n catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "1e458447d96c7eeda6ea81f934e20a27", "score": "0.5840372", "text": "function fetchAll(){\n fetch('http://localhost:3000/cats')\n .then(res => res.json())\n .then(json => {\n //loads all cats to side bar\n loadCats(json)\n //loads one cat to main tag\n loadOneCat(json[0])\n })\n}", "title": "" }, { "docid": "c6b4b0cc52d92a0f003804bab3812841", "score": "0.5824008", "text": "get(url) {\r\n return fetch(url)\r\n .then(this.handleError)\r\n .then(res => res.json())\r\n // .then(data => data);\r\n }", "title": "" }, { "docid": "8ae63a0557de89d7e8fc0ceb86887ed2", "score": "0.58203375", "text": "async fetchData(url) {\n const response = await fetch(url);\n const parsedResponse = await response.json();\n\n return parsedResponse;\n }", "title": "" }, { "docid": "8684d33b5a56daf504d4cebd6905ae20", "score": "0.58179986", "text": "function initPageData(){\n\n\n const GetReviewUrl = `http://localhost:5002/select/review/${GetPageUrl}`;\n\n const requestOptions = {\n 'content-type': 'application/json',\n method: 'GET',\n redirect: 'follow'\n }\n\n\n return fetch(GetReviewUrl, requestOptions)\n .then(response => response.json())\n .then((responseData) => {\n // console.log(responseData);\n return responseData;\n })\n .catch(error => console.warn(error));\n\n\n}", "title": "" }, { "docid": "7d408928b6d9f60c25376ba4c64c1d73", "score": "0.5814772", "text": "function localHTTPFetch(url, custom_config,callback) {\n // return fetch(url,{mode: 'no-cors'})\n if(custom_config) {\n return fetch(url,custom_config).then(response => response.text())\n .then(responseText => {\n // CALLBACK WITH RESULT\n if (callback !== undefined) callback(responseText);\n })\n .catch(error => {\n console.error(error);\n if (callback !== undefined) callback(error);\n });\n }\n else{\n return fetch(url).then(response => response.text())\n .then(responseText => {\n // CALLBACK WITH RESULT\n if (callback !== undefined) callback(responseText);\n })\n .catch(error => {\n console.error(error);\n if (callback !== undefined) callback(error);\n });\n }\n }", "title": "" }, { "docid": "a3c17fb26eacfc408a3054e544f10788", "score": "0.58118427", "text": "fetch(query, cache) {\n var self = this;\n query = self.normalizeQuery(query);\n var key = self.toKey(query);\n var data = { ...self.defaults, ...query };\n var url = self.service;\n if (data.hasOwnProperty(\"url\")) {\n url = url + \"/\" + data.url;\n delete data.url;\n }\n if (data.format && !self.formatKeyword) {\n url += \".\" + data.format;\n delete data.format;\n }\n\n if (this._promises[key]) {\n return this._promises[key];\n }\n\n if (self.debugNetwork) {\n console.log(\"fetching \" + key);\n }\n\n var promise = self.ajax(url, data, \"GET\");\n this._promises[key] = promise.then(\n async (data) => {\n delete this._promises[key];\n if (!data) {\n self.fetchFail(query, \"Error parsing data!\");\n return;\n }\n if (self.debugNetwork) {\n console.log(\"received result for \" + key);\n if (self.debugValues) {\n console.log(data);\n }\n }\n if (cache) {\n await self.set(query, data);\n }\n return data;\n },\n (error) => {\n delete this._promises[key];\n console.error(error);\n self.fetchFail(query, \"Error parsing data!\");\n }\n );\n return this._promises[key];\n }", "title": "" }, { "docid": "2f0ec0a53209512cd7516208454f23af", "score": "0.58114535", "text": "function fetchData() {\n //HTML5 Fetch\n fetch('https://randomuser.me/api?results=10')\n .then(function (response) {\n return response.json();\n })\n .then(function (myJson) {\n localStorage.setItem('fetched-profiles', JSON.stringify(myJson));\n validateFetch();\n })\n\n\n\n}", "title": "" }, { "docid": "0866314a40ca45df6ffef03efd9624d8", "score": "0.580852", "text": "async function fetchUsers(){\n\n //because we use two .then with fetch API method the first is to convert is to json and the second is to use the response itself\n //here we will make a res var to hold the return promise of the fetch method then we will convert it to json with this var\n\n\n /*\n Once you mark a function as 'async' you have access to the keywords await, try, and catch.\n */ \n\n\n const res = await fetch('https://jsonplaceholder.typicode.com/users');\n try{\n\n const data = await res.json();\n console.log(data);\n\n }\n\n catch(error){\n console.log('error', error);\n }\n\n /*\n this is instead of \n\n fetch('https://jsonplaceholder.typicode.com/users')\n .then(res => res.json())\n .then(data => console.log(data));\n\n */\n\n}", "title": "" }, { "docid": "4b674bc96d5a79b9135f0a9c184041cf", "score": "0.5805843", "text": "fetch(options) {\n\t\toptions = _extend({ parse: true }, options)\n\t\tconst success = options.success\n\t\tconst error = options.error\n\t\toptions.success = resp => {\n\t\t\tconst method = options.reset ? 'reset' : 'set'\n\t\t\tthis[method](resp, options)\n\t\t\tif (success) success.call(options.context, this, resp, options)\n\t\t\tthis.trigger('sync', this, resp, options)\n\t\t}\n\t\toptions.error = resp => {\n\t\t\tif (error) error.call(options.context, this, resp, options)\n\t\t\tthis.trigger('error', this, resp, options)\n\t\t}\n\t\treturn sync('read', this, options)\n\t}", "title": "" }, { "docid": "30943f73840bf680552e4687447b6107", "score": "0.5803329", "text": "async get(url) {\n //fetch returns a promise\n const response = await fetch(url);\n // response variable is the promise that was returned by fetch\n const data = await response.json();\n //return the promise\n return data;\n }", "title": "" }, { "docid": "ff8aacc17386b8ade771942ff25fa68d", "score": "0.579489", "text": "fetchArtists(value){ \n let url= 'http://localhost:8000/api/'+value\n fetch(url,{\n method:'GET',\n headers:{'Content-Type':'application/json'},\n }).then(data=> data.json()\n ).then(data=> this.setState({\n data:data,\n fetched:true,\n value:value\n }))\n }", "title": "" }, { "docid": "d0dde471c77e4bcb17ed7f69445865a0", "score": "0.57853436", "text": "getFetch() {\n return FETCH;\n }", "title": "" }, { "docid": "d1933215b3a773c31d8e19ab3e61c9ea", "score": "0.5783438", "text": "async function fetchUsers(user_id) {\n fetch('...url', { user_id })\n .then(data => {\n fetch('...url2', { user_post: data.posts })\n .then()\n })\n\n //............. //\n\n try {\n let user = await fetch('...url', { param });\n // \"data\" is now stored in \"user\"\n let posts = await fetch('...url', { user });\n\n } catch (error) {\n return error;\n }\n\n}", "title": "" }, { "docid": "10641f4fafbdd13e2b0bfffa94cb0cba", "score": "0.57833254", "text": "async get(url) {\r\n // this function returns a promise so awit until it return the promise \r\n // here we are fetching a url so its return the response or promise whether anything found or not\r\n const response = await fetch(url);\r\n const resData = await response.json();\r\n return resData;\r\n }", "title": "" }, { "docid": "ba893e0e637132585da375ec7eb840fc", "score": "0.57801837", "text": "function fetchdogs()\n{\n console.log('going to fetch')\n fetch(\"https://dog.ceo/api/breeds/image/random/4\")\n .then(resp => {\n console.log('it works');\n return resp.json();\n })\n .then(dogpics => getdog(dogpics) )\n\n}", "title": "" }, { "docid": "29059ef84d089b5bd519d8245cdccda0", "score": "0.5780081", "text": "fetchData(type, props) {\n const {\n id, actionid, target, element,\n } = props || {};\n let authToken = '';\n if (this.authentication === '' || this.authentication === 'basic') {\n authToken = `Basic ${btoa(`${this.username}:${this.password}`)}`;\n }\n if (this.token !== '') {\n authToken = `Bearer ${this.token}`;\n }\n const headers = {\n 'Content-Type': 'application/json;charset=UTF-8',\n Authorization: authToken,\n };\n const reqHeaders = {\n method: 'GET',\n headers,\n mode: 'cors',\n };\n let apiurl = `${this.url}/api/v1/`;\n switch (type) {\n case 'worklist':\n apiurl += 'assignments';\n break;\n case 'casetypes':\n apiurl += 'casetypes';\n break;\n case 'newwork':\n apiurl += `casetypes/${id}`;\n break;\n case 'assignment':\n apiurl += `assignments/${id}`;\n break;\n case 'case':\n apiurl += `cases/${id}`;\n break;\n case 'data':\n apiurl += `data/${id}`;\n break;\n case 'page':\n apiurl += `cases/${id}/pages/${actionid}`;\n break;\n case 'view':\n apiurl += `cases/${id}/views/${actionid}`;\n break;\n case 'assignmentaction':\n apiurl += `assignments/${id}/actions/${actionid}`;\n break;\n case 'caseaction':\n apiurl += `cases/${id}/actions/${actionid}`;\n break;\n case 'attachment':\n apiurl += `attachments/${id}`;\n break;\n case 'attachments':\n apiurl += `cases/${id}/attachments`;\n break;\n case 'attachmentcategories':\n apiurl += `cases/${id}/attachment_categories`;\n break;\n }\n fetch(apiurl, reqHeaders)\n .then((res) => {\n if (type === 'case') {\n this.etag = res.headers.get('etag');\n if (target) {\n target.disabled = false;\n target.textContent = 'Save';\n }\n } else if (type === 'attachment') {\n return res.text();\n }\n if (res.ok || res.status === 404) {\n return res.json();\n }\n return Promise.reject(res);\n })\n .then((response) => {\n try {\n if (response.errors && response.errors.length > 0) {\n this.errorMsg = `Error ${response.errors[0].ID}: ${response.errors[0].message}`;\n this.clearLoadingIndicator();\n this.requestUpdate();\n console.error('Error:', response);\n return;\n }\n const el = this.getRenderRoot().querySelector('#case-data');\n switch (type) {\n case 'casetypes':\n this.casetypes = {};\n for (const obj of response.caseTypes) {\n /* If the action is worklist and the createCase is set on the mashup component, we need to filter the list */\n if (this.action !== 'workList' || this.casetype === '' || this.casetype === obj.ID) {\n this.casetypes[obj.ID] = {\n canCreate: obj.CanCreate,\n name: obj.name,\n requiresFieldsToCreate: false,\n };\n }\n }\n if (this.action === 'createNewWork') {\n this.createCase();\n }\n break;\n case 'worklist':\n this.cases = response.assignments;\n this.requestUpdate();\n break;\n case 'assignment':\n this.data = response;\n this.caseID = response.caseID;\n this.fetchData('case', { id: this.caseID });\n if (response.actions.length > 0 && response.actions[0].ID) {\n this.actionID = response.actions[0].ID;\n this.fetchData('assignmentaction', { id, actionid: this.actionID });\n } else {\n this.fetchData('view', { id: this.caseID, actionid: 'pyCaseInformation' });\n }\n break;\n case 'case':\n this.casedata = response;\n this.numAttachments = 0;\n if (this.name === '') {\n this.name = this.casedata.content.pyLabel;\n }\n this.casepyStatusWork = this.casedata.content.pyStatusWork;\n this.requestUpdate();\n if (this.assignmentID === '') {\n this.fetchData('view', { id: this.caseID, actionid: 'pyCaseInformation' });\n }\n if (this.bShowAttachments === 'true') {\n this.fetchData('attachments', { id: this.caseID });\n }\n break;\n case 'data':\n this.dataPages[id] = response;\n if (!element.nextElementSibling) {\n console.error('Error: case data are not present when retrieving the data');\n break;\n }\n render(showDataList(response), element.nextElementSibling);\n break;\n case 'caseaction':\n if (!el) {\n console.error('Error: case data are not present when retrieving the assignmentaction');\n break;\n }\n render(saveCaseLayout(response.view.groups, 'Obj',\n this.bShowCancel === 'true' ? this.actionAreaCancel : null,\n this.actionAreaSave, this), el);\n el.focus();\n break;\n case 'assignmentaction':\n if (!el) {\n console.error('Error: case data are not present when retrieving the assignmentaction');\n break;\n }\n if (target) {\n this.actionID = actionid;\n render(RenderLocalAction(response.name, mainLayout(response.view.groups, 'Obj',\n this.actionAreaCancel,\n null, this)), target);\n target.focus();\n } else {\n this.name = response.name;\n this.requestUpdate();\n render(mainLayout(response.view.groups, 'Obj',\n this.bShowCancel === 'true' ? this.actionAreaCancel : null,\n this.bShowSave === 'true' ? this.actionAreaSave : null, this), el);\n el.focus();\n }\n break;\n case 'page':\n if (!el) {\n console.error('Error: case data are not present when retrieving the page');\n break;\n }\n render(mainLayout(response.groups, 'Obj', this), el);\n el.focus();\n break;\n case 'view':\n if (!el) {\n console.error('Error: case data are not present when retrieving the page');\n break;\n }\n this.content = {};\n if (actionid === 'pyCaseInformation') {\n this.name = response.name;\n render(reviewLayout(response.groups, 'Obj', this.bShowCancel === 'true' ? this.actionAreaCancel : null, this), el);\n } else {\n this.name = response.name;\n render(mainLayout(response.groups, 'Obj', this), el);\n }\n el.focus();\n break;\n case 'newwork':\n this.content = {};\n if (!el) {\n console.error('Error: case data are not present when retrieving the newwork');\n break;\n }\n render(createCaseLayout(response.creation_page.groups[0].layout.groups, 'Obj', this.bShowCancel === 'true' ? this.actionAreaCancel : null), el);\n el.focus();\n const form = this.getRenderRoot().querySelector('#case-data');\n if (form) {\n setFormData(form, this.initialContent);\n }\n break;\n case 'attachments':\n let files = response.attachments;\n if (!files) files = [];\n this.numAttachments = files.length;\n if (target) {\n render(genAttachmentsList(target, files, this.caseID, this), target);\n }\n this.requestUpdate();\n break;\n case 'attachmentcategories':\n this.attachmentcategories = response.attachment_categories;\n break;\n case 'attachment':\n target(response);\n break;\n }\n } catch (e) {\n this.errorMsg = `Error: ${e}`;\n this.requestUpdate();\n console.error('Error:', e);\n }\n })\n .catch((error) => {\n this.genErrorMessage(error);\n });\n }", "title": "" }, { "docid": "3d413d7bf0c56d5e33a03c393f8756cf", "score": "0.5779766", "text": "async function fetchData(url){\n\n //call the fetch API (init object as the 2nd param has the request method as GET, put in the headers the accept json param.)\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Accept': 'application/json'\n }\n });\n //check if the response status is ok(ok means the number is \"around\" 200)\n if (!response.ok) {\n const message = `An error has occured: ${response.status}`;\n throw new Error(message);\n }\n const data = await response.json();\n // console.log(data);\n return data;\n\n }", "title": "" }, { "docid": "204ec04a7f3a62734340b7bf58031ae6", "score": "0.57761043", "text": "function noFetch() {\n dx.fail('Do not call fetch() directly. Instead, call getServerModel().');\n }", "title": "" }, { "docid": "871c7d7d2df8f39ce3e905f312d4eb80", "score": "0.5770952", "text": "loadListData() {\n // do the fetch here once api works\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_bucketlist_activities/\" + this.state.listID.toString())\n .then(response => response.json())\n .then(object => {this.loadLists(object)});\n }", "title": "" }, { "docid": "3274c11e37cbd8d359c9e3661de704b6", "score": "0.5766903", "text": "function getSQLresults(tmp1,tmp2,tmp3){\n const url = `http://127.0.0.1:5000/perfectpupper/${tmp1}/${tmp2}/${tmp3}`;\n return fetch(url).then(response => response.json());\n}", "title": "" }, { "docid": "f3e91e987bb1a80cbd8ce43b0097aa0c", "score": "0.5764682", "text": "static getServerData(url) {\r\n return new Promise((resolve, reject) => {\r\n fetch(url, { mode: 'cors' }).then(response => {\r\n if (!response.ok) { // Didn't get a success response from server! \r\n return reject(Error(response.statusText));\r\n }\r\n return resolve(response.json());\r\n }).catch(error => {\r\n console.log('Request failed', error.stack);\r\n return reject(error);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "3dc6be801d07bb599610453559c3f50f", "score": "0.576189", "text": "static fetchRestaurants(callback) {\r\n // RL First check whether we have restaurants data already in indexedDB\r\n // RL If no restaurants yet, then fetch restaurant JSON from the sails server\r\n // RL 1st method\r\n /* RL Comment out this entire xhr block and replace with fetch block\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', DBHelper.DATABASE_URL);\r\n xhr.onload = () => {\r\n if (xhr.status === 200) { // Got a success response from server!\r\n console.log(\"xhr.responseText = \", xhr.responseText);\r\n const json = JSON.parse(xhr.responseText);\r\n console.log(\"json.restaurants = \", json.restaurants);\r\n const restaurants = json.restaurants;\r\n callback(null, restaurants);\r\n } else { // Oops!. Got an error from server.\r\n const error = (`Request failed. Returned status of ${xhr.status}`);\r\n callback(error, null);\r\n }\r\n };\r\n xhr.send();\r\n */\r\n\r\n // RL 2nd method\r\n\r\n // RL Using fetch\r\n // RL Back-ticks enclose template literal. The ${expression} indicates placeholder.\r\n // RL The expression in the placeholder gets passed to the function fetch in this case.\r\n // MG No need for template literal here if there's no other parts to the string except this one template literal.\r\n // RL fetch(`${DBHelper.DATABASE_URL}`)\r\n // fetch(DBHelper.DATABASE_URL)\r\n // .then(function(response) {\r\n // // RL Got next if block from Introduction to fetch() article\r\n // if (response.status !== 200) {\r\n // console.log('Looks like there was a problem. Status Code: ' +\r\n // response.status);\r\n // return;\r\n // }\r\n // // RL Add next 2 console.log\r\n // console.log('Yooooo, response.status = ', response.status);\r\n // // RL Cannot read response.json() in console.log statement because\r\n // // RL will cause TypeError that response data already read when\r\n // // RL try to read response.json() again in the return statement.\r\n // // RL console.log('Baby, the response.json() = ', response.json());\r\n // return response.json();\r\n // })\r\n // .then(data => callback(null, data))\r\n // // RL Replace template literal with regular string\r\n // // RL .catch(error => callback(`Request failed. Returned status of ${error,statusText}`, null));\r\n // .catch(error => callback(error, null));\r\n\r\n // RL 3rd method\r\n idbApp.addRestaurants(callback);\r\n \r\n // RL 4th method\r\n // RL return this.dbPromiseLz()\r\n\r\n }", "title": "" }, { "docid": "cb26b530a95e01fd6800cf862f4a7dd0", "score": "0.5753941", "text": "fetchRates(inputCurr,outputCurr) {\n let str = `https://free.currencyconverterapi.com/api/v5/convert?q=${inputCurr}_${outputCurr}&compact=ultra`;\n return fetch(str, { mode: 'cors' })\n .then(res => {\n return res.json()\n .then(json => {\n let object = {\n key: Object.keys(json)[0],\n val: json[Object.keys(json)[0]],\n time: Date.now()\n }\n this.saveDB(object);\n return object\n })\n .catch(err => console.log(err))\n })\n .catch(_ => this.checkDB(inputCurr,outputCurr))\n }", "title": "" }, { "docid": "6089391c5d20b0ffcd9419bae40563e4", "score": "0.57515204", "text": "fetch(pageOffset, pageSize, stats) {\n return Api.loadMailbox()\n .then(data => {\n console.log(data);\n return data.mailbox;\n })\n .catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "7141d9f42a098d5afa16cdef7b8eebda", "score": "0.5748786", "text": "fetch() {\n return new Promise((resolve, reject) => {\n try {\n resolve(this.api.fetchData());\n }\n catch (e) {\n reject(e);\n }\n });\n }", "title": "" }, { "docid": "004c0df398fd2a987a17435e82d80a70", "score": "0.5743588", "text": "function getBooks() {\n\n fetch( BOOK_URL )\n .then( data => data.json() )\n .then( renderBooks )\n .catch( console.log );\n\n}", "title": "" }, { "docid": "14a74459a489e9f7e525ba05b8751a08", "score": "0.57433754", "text": "function grabData(uri) {\n //Has something been passed into grabData()?\n if (uri !== undefined) {\n fetch(uri)\n .then(response => {\n return response.json();\n })\n .then(nextPageResults => {\n console.log(uri);\n console.log(nextPageResults);\n passArticlesForCreation(nextPageResults);\n });\n } else {\n fetch(url)\n .then(response => {\n return response.json();\n })\n .then(body => {\n passArticlesForCreation(body);\n });\n }\n}", "title": "" }, { "docid": "29c026cce43546c06183a724cef60779", "score": "0.57400256", "text": "parseFetchResponseForError(response, payload) {\n return payload || response.statusText;\n }", "title": "" }, { "docid": "c14bf2e2fb0939f4d7499b161098f80f", "score": "0.5737827", "text": "function f1() { return new Promise((resolve, reject) => { \nconst url= 'http://dummy.restapiexample.com/api/v1/employees';\nfetch(url).\nthen(obj=>obj.json()).\nthen(obj=>resolve(obj.data)).\ncatch(reject); }); }", "title": "" }, { "docid": "8d4c967128d7936bbf6e442174b7e6ee", "score": "0.5737075", "text": "function getBookmarkData(){\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data)=> console.log(data));\n}", "title": "" }, { "docid": "af9ebdfd13e16ae620faa324d35a11ea", "score": "0.57360023", "text": "function getData(url) {\n return fetch(url)\n }", "title": "" }, { "docid": "e48c073b5afaec450a9f9d2ff1878cff", "score": "0.5734375", "text": "shouldFetch(state) {\n return true;\n }", "title": "" }, { "docid": "b539a925dc98a464725df6d65d644f4a", "score": "0.57272136", "text": "async function fetchApiResponse()\r\n{\r\n try { \r\n let response = await fetch(url);\r\n let result = await response.json()\r\n return await result.results \r\n } catch (error) {\r\n console.log(error)\r\n }\r\n}", "title": "" }, { "docid": "7a2b6c3fd378fd1f01524879561657cb", "score": "0.57238096", "text": "static getData(url) {\n console.log('getData', \"url==\"+url);\n return fetch(url)\n .then((response) => response.json())\n .then(responseJson => {\n return responseJson;\n })\n .catch((error) => {\n Toaster.showToast(error.message, 'danger');\n return error\n });\n }", "title": "" }, { "docid": "89f075bcea65043682b61b0daa901715", "score": "0.57233787", "text": "function fetch(request, response, type, err, contents)\n{\n \"use strict\";\n var url = request.url.toLowerCase();\n var a = url.indexOf(\"a\")+1;\n var b = url.indexOf(\"b\");\n var id = 0;\n var data = util.getDataDictionary();\n var query = \"SELECT * FROM County WHERE id = ?;\";\n\n if((a > 0) && (b > 0))\n {\n id = url.substr(a, b-a);\n id = parseInt(id);\n }\n else return(final.fail(response, constants.NotFound, \"Bad ID.\"));\n\n db.all(query, [id], ready);\n\n function ready(err, extract)\n {\n if(err) throw err;\n if(data.length < 1)\n {\n return(final.fail(response, constants.NotFound, \"No such page.\"));\n }\n data.add(\"county\", extract);\n begin(response, type, err, contents, id, data);\n }\n}", "title": "" } ]
a573ee9f334781eea83e2f39abc12a1f
1. mgr.finish to finish build 2. bot.message to show slack message
[ { "docid": "01bf2ce4d1fd5c59fa8554c44022633f", "score": "0.0", "text": "finish() {}", "title": "" } ]
[ { "docid": "4863c90fae717695f7bd5c18717be80d", "score": "0.6012685", "text": "function DoneMessage() {\n if (stat == status.completed)\n return (<Text>CONGRATULATIONS!!!!!! YOU'VE ACHIEVED YOUR GOAL!!!!!</Text>);\n if (stat == status.archived)\n return (<Text>wow.... lame.</Text>);\n }", "title": "" }, { "docid": "44af2cfd83d9cb45e8275e276474631e", "score": "0.5899666", "text": "async sendSlackMessage() {\n if (!this.skipSlackMessage) {\n let prefix = '';\n if (this.dryRun) prefix = 'dry run';\n if (this.skipExpiredCheck) prefix += ', skip expired check';\n\n const prefixFormatted = prefix ? `\\`TEST: ${prefix}\\`\\n` : '';\n const text = `${prefixFormatted}${this.currentDate}\\n\\`\\`\\`${this.slackMsg.join('\\n')}\\`\\`\\``;\n\n await Slack.postMessage(this.slackChannel, text);\n }\n }", "title": "" }, { "docid": "1d8eb399467458b27028a825a5f4a624", "score": "0.5606936", "text": "afterBuild() {\n this.eventBus.publish('component_build_finished', this.id);\n this.isBuilt = true;\n }", "title": "" }, { "docid": "b6ff4f118c4bc0275a9a0263c9a6cf97", "score": "0.55617416", "text": "async function notifyTestResults() {\n // JSCore chat webhook URL.\n if (!process.env.WEBHOOK_URL) {\n console.log(`Couldn't find WEBHOOK_URL env variable.`);\n return;\n }\n\n // URL of this workflow run.\n const workflowUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;\n let status = 'did not log a status correctly';\n if (process.argv.includes('fail')) {\n status = 'failed';\n }\n if (process.argv.includes('success')) {\n status = 'succeeded';\n }\n\n let message = `E2E Tests ${status}`;\n\n // Add version if it can find it in the workflow_dispatch event data.\n if (process.env.GITHUB_EVENT_PATH) {\n const wrPayload = require(process.env.GITHUB_EVENT_PATH);\n if (wrPayload.inputs && wrPayload.inputs.versionOrTag) {\n message += ` for release ${wrPayload.inputs.versionOrTag}.`;\n } else {\n console.log(`Couldn't find versionOrTag in event payload.`);\n }\n } else {\n console.log(`Couldn't find event payload.`);\n }\n\n message += ` ${workflowUrl}`;\n\n const data = JSON.stringify({\n text: message\n });\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n }\n };\n\n return new Promise((resolve, reject) => {\n console.log(`Sending message to chat: ${message}`);\n const req = https.request(process.env.WEBHOOK_URL, options, res => {\n res.on('data', d => {\n process.stdout.write(d);\n });\n res.on('end', resolve);\n });\n\n req.on('error', error => reject(error));\n\n req.write(data);\n req.end();\n });\n}", "title": "" }, { "docid": "a300c53e9d7ef1fc02b8e2be06675299", "score": "0.5516775", "text": "function showMemotaro() {\n botui.message.add({\n delay: 1500,\n content: \"This website mainly includes my technical memorandoms.\"\n }).then(function(){\n return botui.message.add({\n delay: 2000,\n content: \"The implied reader is myself.\"\n });\n }).then(function(){\n return botui.message.add({\n delay: 2000,\n content: \"Categories includes articles list grouped by categories.\"\n });\n }).then(function(){\n return botui.message.add({\n delay: 2000,\n content: \"Projects includes the projects I engaged in so far.\"\n });\n }).then(function(){\n return botui.message.add({\n delay: 2000,\n content: \"Note that the contents on the website may change without prior notice.\"\n });\n }).then(askEnd);\n }", "title": "" }, { "docid": "a1ef787b8a938701f62453ac93cb4131", "score": "0.5515583", "text": "finish() {\n this.props = this.props || {};\n const { hookType, hookApi, hookFileGlob } = this.props;\n const messages = [\n '',\n _consts.SEPARATOR,\n ` Hook of type ${hookType} has been added to the API ${hookApi} `,\n ''\n ];\n if(hookFileGlob) {\n messages.push(` The hook will attempt to load files ${hookFileGlob} from the data directory. `);\n messages.push(` Please place relevant files in this directory prior to building the chart. `);\n } else {\n messages.push(` The hook does not require any data, and none will be mounted. `);\n }\n\n messages.push(_consts.SEPARATOR);\n messages.push('');\n messages.forEach((line) => this.log(line));\n }", "title": "" }, { "docid": "8bc7e0b2a5d049d672f3b31119a95ef1", "score": "0.5493761", "text": "function BaseMessage() {\n\n setuptools.lightbox.build('muledump-about', 'You are on the latest release.<br>');\n\n }", "title": "" }, { "docid": "d69259e483809e2cb1dbf735c4f696b3", "score": "0.548287", "text": "send() {\n this.count++;\n var j = new brigadier_1.Job(`${this.name}-${this.count}`, this.notificationJobImage);\n j.imageForcePull = true;\n // GitHub limits this field to 65535 characters, so we\n // trim the length (from the beginning) prior to sending,\n // inserting a placeholder for the text omitted after truncation.\n if (this.text.length > exports.GITHUB_CHECK_TEXT_MAX_CHARS) {\n let textOmittedMsg = \"(Previous text omitted)\\n\";\n this.text = this.text.slice(this.text.length - (exports.GITHUB_CHECK_TEXT_MAX_CHARS - textOmittedMsg.length));\n this.text = textOmittedMsg + this.text;\n }\n j.env = {\n CHECK_CONCLUSION: this.conclusion,\n CHECK_NAME: this.name,\n CHECK_TITLE: this.title,\n CHECK_PAYLOAD: this.payload,\n CHECK_SUMMARY: this.summary,\n CHECK_TEXT: this.text,\n CHECK_DETAILS_URL: this.detailsUrl,\n CHECK_EXTERNAL_ID: this.externalID\n };\n return j.run();\n }", "title": "" }, { "docid": "9df7ea1f0e7028e41bfb5ac0cd172bc0", "score": "0.54787683", "text": "function BuildAndSendWorkout() {\n var workout = BuildMainWorkout() + \"\\n\\n----------------------------------\\n\" + BuildAux();\n this.mods.forEach(mod => {\n workout = workout + \"\\n\\nMod: \" + mod[\"Name\"];\n });\n var config = ReadInNamedRangeInverse(\"Config\");\n \n MailApp.sendEmail(find(config, \"MY_EMAIL\")[\"Value\"], \"Workout\", workout);\n }", "title": "" }, { "docid": "3585e9f6d4a0ec60c394c2bc3244184d", "score": "0.5475248", "text": "actionFinal() {\n this.generateAlertMessage(\"Good Job!\",`You won using ${this.steps} steps`,'success');\n this.reset();\n }", "title": "" }, { "docid": "9b72dbbb5705db236195b63ec167032b", "score": "0.5472435", "text": "function endWithSuccess() {\n\n step1Callback({\n message: {\n text: 'Adminer is deployed and available as http://srv-captain--' + data[CONTAINER_NAME]\n + ' to other apps.',\n type: SUCCESS\n },\n next: null // this can be similar to step1next, in that case the flow continues...\n });\n }", "title": "" }, { "docid": "b2f4a0221954de778b1f906c815d91d6", "score": "0.54462457", "text": "function dashbotEnd(data) {\n dashbot.logOutgoing(data, {\n 'body': \"ok\",\n 'statusCode': 200\n });\n}", "title": "" }, { "docid": "5983ebf091fa10a0348208fd96b66364", "score": "0.5410765", "text": "async function main() {\n const bot = new MWBot({\n apiUrl: `${baseUrl}/w/api.php`\n });\n await bot.loginGetEditToken({\n username: botUserName,\n password: botPassword\n });\n\n\n try {\n let response = await bot.edit(`User:${botUserName}/sandbox/HelloWorld`,\n `Hello World! Congrats, you have created a bot edit. Now head to [[WP:Bots]] to find information on how to get your bot approved and running!`,\n `Edit from a bot called [[User:${botUserName}]] built with #mwbot`);\n console.log(`Success`, response);\n console.log(`Now visit on your browser to see your edit: ${baseUrl}/wiki/User:${botUserName}/sandbox/HelloWorld`);\n // Success\n } catch (err) {\n console.warn(`Error`, err);\n }\n}", "title": "" }, { "docid": "5cdafe50c1c20fa3dee3128faaf7deb9", "score": "0.53930485", "text": "finish () {\n this.message.finish()\n }", "title": "" }, { "docid": "54805bbaa6077bffa3ea1abf115efea5", "score": "0.5382479", "text": "function onBuild(done) {\n return function(err, stats) {\n if(err) {\n console.log('Error', err);\n }\n else {\n console.log(stats.toString());\n }\n\n if(done) {\n done();\n }\n }\n}", "title": "" }, { "docid": "e510a3b8e7250a1d0f6b64a895b5afd6", "score": "0.53208935", "text": "async function postSlackMessage (adata) {\n}", "title": "" }, { "docid": "349cb8f2838119d4267bfc48bad5126c", "score": "0.52834904", "text": "function chatBotMessage() {\r\n newBotMsg(getBotMessage())\r\n console.log(\"chatbot message\")\r\n}", "title": "" }, { "docid": "036e5e5da693f378145a65568d8af7ee", "score": "0.5266723", "text": "function hideBuildComplete() {\n gees.dom.hide('BuildResponseDiv');\n resetMessageDivs();\n buildBar = gees.dom.get('ProgressBar');\n gees.dom.setClass(buildBar, 'buildProgress');\n var statusMsg = 'Build Status' +\n '<a href=\"javascript:void(0)\" onclick=\"hideBuildResponse()\">-</a>';\n gees.dom.setHtml(buildBar, statusMsg);\n}", "title": "" }, { "docid": "b6bb2c55c8e36fab03935e9ccdb43462", "score": "0.52569443", "text": "function webhookCallback(err,res) {\n if (err) {\n console.log(\"ERROR: Something went wrong sending a message to Slack\");\n }\n else {\n console.log(\"Sent message to Slack.\");\n }\n}", "title": "" }, { "docid": "9df0b2956d26bd5b72d316c9f620d022", "score": "0.52281445", "text": "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }", "title": "" }, { "docid": "07ffb75ce7d012abec4add488007c2cb", "score": "0.52269065", "text": "async function run() {\n const location = await triggerBuildReturnLocation({})\n await sleep(8000) // Build # isn't available immediately\n const number = await getBuildNumberFromQueue(location)\n await sleep(30000) // Builds take min 45sec max 95 seconds\n return await getBuildStatus(number)\n}", "title": "" }, { "docid": "08972fd5b50dc22e91b2d1b35bdc8569", "score": "0.5225866", "text": "function endWithSuccess() {\n step1Callback({\n message: {\n text: 'thumbor is deployed and available as ' + data[CONTAINER_NAME] +\n '. Go to YOUR_APP_URL/unsafe/200x50/i.imgur.com/bvjzPct.jpg to test thumbor!',\n type: SUCCESS\n },\n next: null // this can be similar to step1next, in that case the flow continues...\n });\n }", "title": "" }, { "docid": "6863c0979087d56d9da438dd27c2ed17", "score": "0.5215447", "text": "function battleMapTowerBuildFinishedStateChangeStarter(tempActualTower, tempTowerTypeToBuild) {\n let tempActiveGameState = store.getState().activeGameState;\n activeGameState.battleMap1ActiveState.tower_slots[tempActualTower].isTowerBuilt = true;\n activeGameState.battleMap1ActiveState.tower_slots[tempActualTower].isTowerReadytoFire = true;\n activeGameState.battleMap1ActiveState.tower_slots[tempActualTower].towerType = tempTowerTypeToBuild;\n\n store.dispatch( {\n type: TOWERBUILD_FINISHED,\n payload: {\n activeGameState: activeGameState,\n }\n });\n }", "title": "" }, { "docid": "8b6aad24ae288b276d400c00e478e7d8", "score": "0.5190562", "text": "function finish_modal(success, messages) {\n Y.log('finish_modal');\n Y.log(success);\n var result,\n length,\n msg = '',\n warn = '',\n i;\n\n if (success) {\n result = 'success';\n } else {\n result = 'failure';\n }\n\n // Remove status header and bar.\n Y.one('#status-header').remove();\n Y.one('#status-bar').remove();\n\n // Display messages if there are any.\n length = messages.length;\n if (length > 0) {\n for (i = 0; i < length; i += 1) {\n msg += '<li>'+messages[i]+\"</li>\\n\";\n }\n msg = '<ul>'+msg+\"</ul>\\n\";\n }\n\n length = configs.length;\n if (length > 0) {\n for (i = 0; i < length; i += 1) {\n warn += '<li>'+configs[i]+\"</li>\\n\";\n }\n warn = '<ul>'+M.util.get_string('plugins_require_configuration', 'local_rlsiteadmin')+\"</ul>\\n\"+\n '<ul>'+warn+\"</ul>\\n\"+\n '<ul>'+M.util.get_string('plugins_need_help', 'local_rlsiteadmin')+\"</ul>\\n\";\n }\n\n msg = '<h4>'+M.util.get_string(result, 'local_rlsiteadmin')+\"</h4>\\n\"+\n '<ul>'+M.util.get_string('actions_completed_'+result, 'local_rlsiteadmin')+\"</ul>\\n\"+\n msg+warn;\n Y.one('#action-results').insert(msg, 'before');\n // Hide the spinner.\n Y.one('#modal-content .fa-spinner').hide();\n // Enable the close button.\n $button = Y.one('#manage-actions-modal button');\n $button.set('disabled', false);\n // Don't know why this isn't done automatically. YUI bug?\n $button.removeClass('yui3-button-disabled');\n }", "title": "" }, { "docid": "0f7e1c2742b97be77b1230ee295dcce2", "score": "0.51769745", "text": "function updateSlack() {\n \n var body = JSON.stringify(createMessage(status));\n \n console.log(\"message\", body)\n \n request({\n method: 'post',\n url: process.env.ENDPOINT,\n headers: {\n 'Content-Type': \"application/json\"\n },\n body: body\n }, function(err, resp, respBody) { \n // looking for a response code of 200 is fine for nearly all cases\n if (resp && resp.statusCode && resp.statusCode === 200) { \n console.log('posted to slack');\n } else {\n console.log(\"error posting to slack:\", resp.statusCode);\n console.log(\"error message:\", err); \n console.log(\"response body\", respBody);\n }\n }); \n}", "title": "" }, { "docid": "107fb33b8677539ca69c7f42c201d021", "score": "0.515359", "text": "async sendSlackNotification() {\n if (!this.slackEndpoint || !this.slackChannel) {\n return;\n }\n\n const webhook = new IncomingWebhook(this.slackEndpoint);\n\n const data = {\n channel: this.slackChannel,\n text: `New ${this.replaceTags(this.formConfig.subject)}`\n };\n\n return webhook\n .send(data)\n .then(result => {\n console.log(`Slack notification sent.`, result);\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "c25df29c8df4e7dcd3bb3f1319d9202e", "score": "0.51450276", "text": "finishBuildUnit(unitInfo, kingdom, game){\n\n //if unit is still alive and still has their state set to build, build the building\n if(this.getState() === \"Build\" && this.health > 0){\n var unit = new Unit(unitInfo, this.x+75, this.y, game, kingdom.isPlayer(), kingdom, 0);\n //once the unit has been built, add it to the kingdom and increase the unitamount\n\n kingdom.units.push(unit);\n kingdom.unitAmount++;\n\n this.setState(\"Idle\");\n\n //if this is the player object make it normal colored again as build is finished\n if(this.isPlayerObj()){\n this.tint = 0xFFFFFF;\n }\n\n if(kingdom === player){\n currentPopulation++;\n gameMessage = 1;\n }\n }\n else{\n\n //if the building was destroyed before the unit was built, give the money back to the kingdom\n kingdom.addGold(unitInfo.cost);\n\n\n }\n }", "title": "" }, { "docid": "2e6de7b54ba73fa4617762e98ad75511", "score": "0.5132926", "text": "function runApp() {\n console.log('Please enter Manager information to begin building team');\n addManager();\n}", "title": "" }, { "docid": "2629a9baa33ce56b9d5d3a2378cf24f8", "score": "0.51289296", "text": "function doBuild(builder) {\n if (builder.isAvailable) {\n return builder\n .build()\n .then(() => {\n return apputils_1.showDialog({\n title: 'Build Complete',\n body: 'Build successfully completed, reload page?',\n buttons: [\n apputils_1.Dialog.cancelButton(),\n apputils_1.Dialog.warnButton({ label: 'RELOAD' })\n ]\n });\n })\n .then(result => {\n if (result.button.accept) {\n location.reload();\n }\n })\n .catch(err => {\n apputils_1.showDialog({\n title: 'Build Failed',\n body: React.createElement(\"pre\", null, err.message)\n });\n });\n }\n return Promise.resolve();\n}", "title": "" }, { "docid": "40a596fa12febd6f2857f9db2ef20f97", "score": "0.5122299", "text": "async cphTitleCurrentBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitleCurrent += SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersTitleMain\");\n\n\n //Debug.\n //console.log(\"cphTitleCurrent=\", this.cphTitleCurrent);\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "title": "" }, { "docid": "e820b4ff21021f9cb721238b95f1d0ed", "score": "0.51046914", "text": "buildEnd() {\n runs++;\n }", "title": "" }, { "docid": "b793e720265effbbc7df5eb6e6731820", "score": "0.5102549", "text": "function startBot() {\n log(\"Bot not yet done\");\n}", "title": "" }, { "docid": "9c1f4a726dc9ac0dbbfd84bda29766a9", "score": "0.51004887", "text": "execute(userName, slackBot) {\n const botMessageParams = {\n as_user: false,\n username: 'Wordy Bot',\n };\n\n slackBot.postMessageToUser(userName, this.message, botMessageParams);\n }", "title": "" }, { "docid": "e5f51d6306c17be8e853f5195e2d9f9d", "score": "0.50976634", "text": "function BuildPrompt(props) {\n return (React.createElement(\"div\", { className: \"jp-extensionmanager-buildprompt\" },\n React.createElement(\"div\", { className: \"jp-extensionmanager-buildmessage\" }, \"A build is needed to include the latest changes\"),\n React.createElement(Button, { onClick: props.performBuild, minimal: true, small: true }, \"Rebuild\"),\n React.createElement(Button, { onClick: props.ignoreBuild, minimal: true, small: true }, \"Ignore\")));\n}", "title": "" }, { "docid": "3292c1fc45e192d45dfc0b9debca6c28", "score": "0.50924724", "text": "async run() {\n let pom = await this.getChannelPom()\n let brk = await this.getChannelBreak()\n let cycle\n\n if (brk.running) {\n cycle = new BreakCycle(this, brk)\n } else {\n cycle = new PomCycle(this, pom)\n }\n\n this.cycles.push(cycle)\n\n cycle.once('end', async () => {\n if (cycle.getType() === 'pom') {\n // Start break\n brk.running = true\n brk.startedAt = new Date()\n await brk.save()\n\n // Count the number of poms that the user finished\n // If it is equal to 5, send a message\n let profiles = await pom.getProfiles()\n\n let today = new Date()\n today.setUTCHours(0)\n today.setUTCMinutes(0)\n today.setUTCSeconds(0)\n\n let res = await Promise.all(\n profiles.map(async (p) => {\n return {\n profile: p,\n poms: await p.getPoms({\n where: {\n createdAt: {\n [Op.gte]: today\n }\n }\n })\n }\n })\n )\n\n res = res.filter((r) => r.poms.length === 5)\n\n if (res.length > 0) {\n let mentions = res.map((r) => `<@${r.profile.userId}>`)\n let msg = '🔥 '\n\n if (mentions > 1) {\n msg += `${mentions.slice(0, -1).join(', ')} and ${\n mentions[mentions.length]\n }`\n } else {\n msg += mentions[0]\n }\n\n msg +=\n (mentions.length === 1 ? ' is' : ' are') +\n ` on a 5-pom streak today! We can feel that determination there 💪`\n\n let channels = CONFIG().presence.pomDoneChannels\n\n for (let c of channels) {\n let channel = BOT().client.channels.get(c)\n\n if (channel) {\n channel.send(msg).catch((e) => {\n LOGGER().warn(\n { error: e },\n 'Unable to send pom started message'\n )\n })\n }\n }\n }\n } else if (cycle.getType() === 'break') {\n // Start pom if someone pre-joined during break\n let profiles = await brk.getProfiles()\n\n this.sendStartedMessage(profiles)\n\n if (profiles.length > 0) {\n await pom.setProfiles(profiles, {\n through: {\n timeSpent: 25 * 60\n }\n })\n pom.running = true\n pom.startedAt = new Date()\n await pom.save()\n\n // Send pom started message\n let channels = CONFIG().presence.pomDoneChannels\n let mentions = profiles\n .map((p) => `<@${p.userId}>`)\n .join(' ')\n let message = `⚔ **A new round has started!** Time to get to work ಠ_ಠ (ping ${mentions})`\n\n for (let c of channels) {\n let channel = BOT().client.channels.get(c)\n\n if (channel) {\n channel.send(message).catch((e) => {\n LOGGER().warn(\n { error: e },\n 'Unable to send pom started message'\n )\n })\n }\n }\n }\n }\n\n this.run()\n })\n }", "title": "" }, { "docid": "99ca71774622dc623bb864bac97b9210", "score": "0.5085795", "text": "function BuildPrompt(props) {\n return (React.createElement(\"div\", { className: \"jp-extensionmanager-buildprompt\" },\n React.createElement(\"div\", { className: \"jp-extensionmanager-buildmessage\" }, \"A build is needed to include the latest changes\"),\n React.createElement(\"button\", { className: \"jp-extensionmanager-rebuild\", onClick: props.performBuild }, \"Rebuild\"),\n React.createElement(\"button\", { className: \"jp-extensionmanager-ignorebuild\", onClick: props.ignoreBuild }, \"Ignore\")));\n}", "title": "" }, { "docid": "bc84c596b9baeb4c301ac02d5d2922d2", "score": "0.50818676", "text": "function hello () {\n botui.message.bot({\n delay: 500,\n content: \"Would you like to play a game?\"\n }).then(function () {\n return botui.action.button({\n delay: 1000,\n action: [{\n icon: 'check',\n text: 'Bring it on',\n value: 'yes'\n }, {\n icon: 'times',\n text: 'No thanks',\n value: 'no'\n }]\n })\n }).then(function (res) {\n if (res.value === 'yes') {\n shifumi()\n } else {\n botui.message.add({\n delay: 500,\n type: 'html',\n content: icon('frown-o') + ' Another time perhaps'\n })\n }\n })\n}", "title": "" }, { "docid": "5201c92d2293f261052b12eea5b60ff2", "score": "0.50739074", "text": "function slackSend() {\n var total = 0\n var attachments = []\n var statusColor\n Object.keys(stats).map(function(objectKey, i) {\n total += stats[objectKey][0]\n if (stats[objectKey][0] > stats[objectKey][3]) {\n statusColor = disqusRed\n statusIcon = \"🔥\"\n } else if (stats[objectKey][0] <= 5) {\n statusColor = disqusGreen\n statusIcon = \":partyporkchop:\"\n } else {\n statusColor = disqusGreen\n statusIcon = \"🆒\"\n }\n attachments.push({\n \"fallback\": stats[objectKey][0] + \" total\" + stats[objectKey][1] + \" new\" + stats[objectKey][2] + \" open\",\n \"color\": statusColor, \n \"title\": statusIcon + \" \" + objectKey + \": \" + stats[objectKey][0],\n \"text\": stats[objectKey][1] + \" new, \" + stats[objectKey][2] + \" open\"\n })\n });\n \n let statusMessage = {\n \"response_type\": \"in_channel\",\n \"text\": total + \" total cases right now.\",\n \"attachments\": attachments\n }\n // depending on request origin, also send the response as webhook for daily notifications\n if (type === 'notification') {\n webhook({text:\"Morning report incoming!\"});\n webhook(statusMessage);\n }\n res.send(statusMessage);\n // TODO Write function that stores this data to database\n //store(stats);\n }", "title": "" }, { "docid": "a30d83c1d7d38a5fec3c971fc20f180e", "score": "0.5067982", "text": "execute(message,args){\n //bot replys hello friend\n message.reply(' Welcome to math bot :)')\n }", "title": "" }, { "docid": "84fa27b3080cbebd9bd220006bd7ed26", "score": "0.5052763", "text": "static build() {\n return __awaiter(this, void 0, void 0, function* () {\n // Await registration of all bots from the application files.\n // Upon error in registration, stop the application.\n yield BotManager.registerAllBotsInDirectory();\n // We'll run preparation handlers for all bots as this should only be done once.\n yield BotManager.prepareAllBots();\n // Some more flavor.\n yield Morgana_1.Morgana.success(\"Bot Manager preparations complete!\");\n });\n }", "title": "" }, { "docid": "09f89588d907c8627417534d1be87b92", "score": "0.50428754", "text": "function dispatchNotify(event, callback) {\n const repoName = event.repository.full_name;\n const repoURL = event.repository.html_url;\n const githubUser = event.sender.login;\n\n const message = {\n type: 'self-service',\n retrigger: true,\n users: [\n {\n 'github': githubUser\n }\n ],\n body: {\n github: {\n title: `${githubUser} made a ${repoName} repo public`,\n body: `Hey there @${githubUser}! 👋 It looks like you made a [${repoName}](${repoURL}) repo public\n \nCheck the following list to ensure that the repo is not leaking sensitive information:\n\n* Check README and documentation for any sensitive information\n* Check code for sensitive information (e.g. hard coded credentials, comments with sensitive info)\n* Check tests for any fixtures using live data\n* Check tests for any testing or debug URLs\n* Check code, tests, and documentation on other branches\n* Consider using https://rtyley.github.io/bfg-repo-cleaner/ to scrub sensitive data\n\nDon't hesitate to reach out to the security team for review or if you have any questions.\n`\n },\n slack: {\n message: `It looks like you made the *${repoName}* repo public. Please confirm and review the checklist in the GitHub issue below.`,\n prompt: 'Is this intended to be a public repository?',\n actions: {\n yes: 'Yes',\n 'yes_response': 'Great, please comment on the /dispatch-alerts Github issue to explain why this is a public repo.',\n no: 'No, this is a private repo.',\n 'no_response': 'Oh no! We paged the security L1 on call and they will assist you soon.'\n }\n }\n }\n };\n lambdaCfn.message(message, (err, result) => {\n console.log(JSON.stringify(message));\n return callback(err, result);\n });\n}", "title": "" }, { "docid": "ab7c227f1d40bb56e5b3fdb414750cc3", "score": "0.50410324", "text": "invalidateBuild(player, title) {\n // <<-- Creer-Merge: invalidate-build -->>\n let towerIndex = -1;\n if (title === \"arrow\") {\n towerIndex = 1;\n }\n else if (title === \"ballista\") {\n towerIndex = 2;\n }\n else if (title === \"cleansing\") {\n towerIndex = 3;\n }\n else if (title === \"aoe\") {\n towerIndex = 4;\n }\n if (towerIndex === -1) {\n return `Invalid tower type!`;\n }\n if (!player || player !== this.game.currentPlayer) {\n return `It isn't your turn, ${player}.`;\n }\n if (!this) {\n return `This unit does not exist!`;\n }\n if (this.owner !== player || this.owner === undefined) {\n return `${this} isn't owned by you.`;\n }\n // Make sure the unit hasn't acted.\n if (this.acted) {\n return `${this} has already acted this turn.`;\n }\n // Make sure the unit is alive.\n if (this.health <= 0) {\n return `${this} is dead, for now.`;\n }\n // Make sure the unit is on a tile.\n if (!this.tile) {\n return `${this} is not on a tile.`;\n }\n if (player.gold < this.game.towerJobs[towerIndex].goldCost\n || player.mana < this.game.towerJobs[towerIndex].manaCost) {\n return `You don't have enough gold or mana to build this tower.`;\n }\n if (this.tile !== this.tile) {\n return `${this} must be on the target tile to build!`;\n }\n if (this.tile.isGoldMine) {\n return `You can not build on a gold mine.`;\n }\n if (this.tile.isIslandGoldMine) {\n return `You can not build on the island.`;\n }\n if (this.tile.isPath) {\n return `You can not build on the path.`;\n }\n if (this.tile.isRiver) {\n return `You can not build on the river.`;\n }\n if (this.tile.isTower) {\n return `You can not build on top another tower.`;\n }\n if (this.tile.isWall) {\n return `You can not build on a wall.`;\n }\n // <<-- /Creer-Merge: invalidate-build -->>\n }", "title": "" }, { "docid": "22d7ed1a86900711dd349b8e7b1551e5", "score": "0.5037699", "text": "function welcome(agent){\n agent.add(getTelegramButtons(\"Welcome to Big Brother! I'm responsible for taking care of your apps! Here's what you can do with me:\", actions));\n}", "title": "" }, { "docid": "3f21c6a67abe7123911405f9f61a95d0", "score": "0.5033793", "text": "execute(message, args) {\n\n // Send the message\n message.channel.send(\"Hail Firnando!\");\n\n // Return\n return;\n\n }", "title": "" }, { "docid": "dbf6e0b5e055b7814e61d74313fa8593", "score": "0.502612", "text": "function postToTeams(msg, cb) {\n\n // token id of the Case Opener Bot - sender of messages \n const token = \"MWIyYWRiYTItYzQ2Zi00OTUwLWI2MTMtYTZkOTNjNzJiYzk2OGZjNmY5NWQtNGE3_PF84_1eb65fdf-9643-417f-9974-ad72cae0e10f\";\n\n let payload = {\n \"markdown\": msg,\n \"roomId\": roomId\n };\n\n xapi.command(\n 'HttpClient Post', {\n Header: [\"Content-Type: application/json\", \"Authorization: Bearer \" + token],\n Url: \"https://api.ciscospark.com/v1/messages\",\n AllowInsecureHTTPS: \"True\"\n },\n \n JSON.stringify(payload)\n )\n .then((response) => {\n \n // Checks if message was posted to teams successfully and if not, it finds out the type of error and prints it \n if (response.StatusCode == 200) {\n xapi.command('UserInterface Message Alert Display', {\n Duration: 5,\n Text: 'Thank you for your feedback, your query has been submitted to the relevant team.',\n Title: 'Case opened'\n }); \n \n console.log(\"message pushed to Webex Teams\");\n if (cb) cb(null, response.StatusCode);\n return;\n }\n else {\n xapi.command('UserInterface Message Alert Display', {\n Duration: 5,\n Text: 'Sorry, there was an issue with submitting your response. Please try again, if the issue persists, please visit helpzone.cisco.com.',\n Title: 'Unsuccessful'\n }); \n console.log(\"failed with status code: \" + response.StatusCode);\n }\n if (cb) cb(\"failed with status code: \" + response.StatusCode, response.StatusCode);\n })\n .catch((err) => {\n xapi.command('UserInterface Message Alert Display', {\n Duration: 5,\n Text: 'Sorry, there was an issue with submitting your response. Please try again, if the issue persists, please visit helpzone.cisco.com.',\n Title: 'Unsuccessful'\n }); \n console.log(\"failed with err: \" + err.message);\n if (cb) cb(\"Could not post message to Webex Teams\");\n });\n}", "title": "" }, { "docid": "e6668aace4f7724bf08577a9866aaf3a", "score": "0.5023909", "text": "function log(message) {\n const token = '<your slack token here>';\n\n const web = new WebClient(token);\n\n// This argument can be a channel ID, a DM ID, a MPDM ID, or a group ID\n const conversationId = '<your conversationId here>';\n\n (async () => {\n const res = await web.chat.postMessage({ channel: conversationId, text: message });\n })();\n}", "title": "" }, { "docid": "d8f1a6e9a438a1ccacb8f9ed1276be11", "score": "0.5023596", "text": "async cphTitleCurrentBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitleCurrent += SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendFilesTitleMain\");\n //this.cphTitleCurrent += \" - \";\n\n if(this.titleCurrent)\n {\n this.cphTitleCurrent += \" - \" + this.titleCurrent;\n }\n\n\n //Debug.\n //console.log(\"cphTitleCurrent=\", this.cphTitleCurrent);\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "title": "" }, { "docid": "19d25b52fd3f1bd813407c5623932dbc", "score": "0.5023491", "text": "function adminUpdate(message){\n bot.sendMessage(admin,message);\n}", "title": "" }, { "docid": "e8b1645c97959c24a0094b2af0476fd3", "score": "0.50124216", "text": "async function step2(msgText, report) {\n console.log(\"Steeeeeeep 22222222222222222222222\");\n\n //if response to the safe place question is \"No\"\n if (msgText == \"No\") {\n report[0].response = {\n \"text\": 'Vaya a un lugar seguro. En caso de que sea necesario utilice el numero de emergencias 911.\\n Escribanos cuando este en un lugar seguro'\n }\n\n //if response is Si we upgrade the step adn the reply\n } else if (msgText == \"Si\") {\n\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": \"Ok, continuemos\"\n }\n report[0].response = homeOrComunityReply;\n\n report = nextStep(report);\n\n //if the buttons are not used sends a reminder to use them\n } else {\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": 'Utilice los botones para responder'\n };\n report[0].response = safePlaceReply;\n }\n\n //return the updated report\n return report;\n}", "title": "" }, { "docid": "007a3ff1fe069e38eb7ccb949a083e05", "score": "0.50096744", "text": "function contactHQ() {\n contact\n .then(response => {\n console.log(`=============== TRANSMISSION ===============\n \\nMessage #${response.num} successfully received by HQ.\n \\nCurrent location: ${response.sector}, ${response.celestial}\n \\nMessage: ${response.message}\n \\n============================================`);\n })\n .catch(error => {\n console.log(error);\n });\n}", "title": "" }, { "docid": "9096b29baed3e753f6898b430e6ec379", "score": "0.50086635", "text": "function createIssue(title,bot,message) {\n\tbot.createConversation(message,function(err,convo) {\n\n // conversation thread for user summary\n convo.addQuestion({\n 'attachments': [\n {\n 'text': 'Please provide summary',\n 'color': '#FFFA70'\n }\n ],\n },function(response,convo) {\n var issueType = convo.vars.Type;\n\n var callback = function(arrayOfNames, labels){\n\n if(arrayOfNames.length == 0){\n var button = {\n text: 'No user has worked on similar issues. Create issue anyway?',\n attachments: [\n {\n text: \"Click on relevant option\",\n color: \"#3AA3E3\",\n callback_id: 'C_no_user',\n attachment_type: \"default\",\n actions: [],\n }\n ],\n\n };\n button.attachments[0].actions.push(\n {\n \"name\": 'Create',\n \"text\": 'Create',\n \"type\": \"button\",\n //\"value\": [issueType, response.text, labels]\n \"value\": issueType + \":\"+response.text + \":\"+ labels + \":\" + title\n\n });\n button.attachments[0].actions.push(\n {\n \"name\": 'Exit',\n \"text\": 'Exit',\n \"type\": \"button\",\n \"value\": []\n });\n // bot.reply(message, 'No user has worked on similar issues. Create issue any way?');\n bot.reply(message, button);\n //console.log('did i come here?');\n }\n else if(arrayOfNames[0] == 'Invalid'){\n bot.reply(message, 'Invalid Input');\n }\n // displaying buttons in bot UI\n else{\n var button = {\n text: 'ok, I found these issues similar to one you are creating. Click on create against most relevant issue: ',\n attachments: [\n {\n text: \"Click the most relevant user\",\n color: \"#3AA3E3\",\n callback_id: 'C_user_select',\n attachment_type: \"default\",\n actions: [],\n }\n ],\n\n };\n for (var i = 0; i < arrayOfNames.length; i++) {\n button.attachments[0].actions.push(\n {\n \"name\": arrayOfNames[i],\n \"text\": arrayOfNames[i],\n \"type\": \"button\",\n \"value\": issueType + \":\"+response.text + \":\"+ labels + \":\" + title\n });\n }\n //console.log('bfr new?');\n button.attachments[0].actions.push(\n {\n \"name\": 'Exit',\n \"text\": 'Exit',\n \"type\": \"button\",\n \"value\": 'null'\n });\n //console.log('afr new?');\n bot.reply(message, button);\n // console.log('did i come here?');\n }\n convo.next();\n\n }\n\n getLikelyUsers(response.text,title,bot,message,callback);\n\n },{},'summary');\n\n convo.addMessage({\n text: 'Sorry I did not understand. Please come again',\n action: 'default',\n },'bad_response');\n\n convo.addMessage({\n text: 'Thanks for talking to me',\n\n },'Exit');\n\n convo.addQuestion({\n 'attachments': [\n {\n 'text': 'Enter issue type: Bug(1) Task(2) Exit(3)',\n 'color': '#FFFA70'\n }\n ],\n },[\n {\n pattern: '3',\n callback: function(response,conv) {\n convo.gotoThread('Exit');\n }\n },\n {\n pattern: '1',\n callback: function(response,conv) {\n // do something else...\n convo.setVar('Type','Bug');\n convo.gotoThread('summary');\n }\n },\n {\n pattern: '2',\n callback: function(response,conv) {\n // do something else...\n convo.setVar('Type','Task');\n convo.gotoThread('summary');\n }\n },\n {\n default: true,\n callback: function(response,conv) {\n // just repeat the question\n convo.gotoThread('bad_response');\n }\n }\n ],{},'default');\n\n convo.activate();\n\n });\n}", "title": "" }, { "docid": "695fe302c467fcb71ef2114a6c67a77b", "score": "0.5007783", "text": "function output(theMoney, theGoal) {\n var percent = Math.round((theMoney/theGoal)*100);\n\n var newlyAdded = 0;\n if(lastAmount){\n newlyAdded = theMoney-lastAmount;\n }\n lastAmount = theMoney;\n\n console.log('Refreshed:');\n console.log(pricify(theMoney) + ' total, ' + percent + '% complete of public goal!');\n console.log(pricify(newlyAdded) + ' added since last refresh');\n console.log('----------');\n\n if(newlyAdded > 0) {\n console.log('Posting to Slack');\n\n // Post to slack\n var text = \":moneybag: *\"+pricify(newlyAdded)+\" was added!*\\nWe are now at \"+pricify(theMoney)+\" total, that's \"+percent+\"% of our public goal\\n<\"+projectUrl+\"|View campaign on OPC>\";\n needle.post(config.slackHookUrl, {\n \"text\": \"Crowdfunding update from Moneybot! \",\n \"attachments\": [\n {\n \"text\": text,\n \"color\": \"#2CB98C\",\n \"mrkdwn_in\": [\"text\", \"pretext\"]\n }\n ]\n }, {\n json: true\n },function(error, response) {\n if (error) {\n console.log('Error posting update:', error);\n }\n });\n }\n\n setTimeout(getData, refreshRate);\n}", "title": "" }, { "docid": "b79f37f3a3ed209e06bd27c4662c51fd", "score": "0.5004413", "text": "function final() {\n character.say(\"Good, thank you!\")\n var win = Scene.createTextBillboard(0, 5, 3);\n win.setText(\"Awesome job!\");\n }", "title": "" }, { "docid": "89feb6da28b698a0ae4674376ccf2633", "score": "0.5004058", "text": "function slackWorker (options) {\n\n // options\n /// *site example \"google.\"\n /// *default: true = \"channel worker\", false = \"group worker\"\n /// *token: slackapi token https://api.slack.com/tokens\n /// retrieveChannels: function (callback[err, resultArray]) { } function defined for getting the list of channels\n /// userId: Uxxxxx\n /// groups: []\n var aWorker = this;\n console.log(\"I am worker\");\n\n aWorker.uriStem = \"api/\";\n\n\n if (options.default === true) {\n aWorker.uriStem = aWorker.uriStem + \"channels.history\";\n aWorker.isChannel = true;\n\n } else {\n if (options.userId) {\n aWorker.userId = options.userId;\n } else {\n console.log(\"Warning cannot start group worker without userId\");\n aWorker.run = false;\n return;\n }\n aWorker.uriStem = aWorker.uriStem + \"groups.history\";\n aWorker.isChannel = false;\n console.log(\"Warning worker started for group before complete\");\n }\n\n if (options.retrieveChannels && typeof options.retrieveChannels === 'function') {\n aWorker.getter = options.retrieveChannels;\n console.log(\"Channel retriever defined successfully for default worker\");\n } else {\n console.warn(\"No channel retriever function defined. Not starting worker\");\n aWorker.run = false;\n return null;\n }\n\n if (options.token) {\n\n aWorker.token = options.token;\n\n } else {\n console.warn(\"No token defined for worker\");\n aWorker.run = false;\n return null;\n }\n\n if (options.site) {\n aWorker.site = options.site + \".slack.com\";\n } else {\n aWorker.site = \"api.slack.com\";\n }\n\n aWorker.delay = options.delay || global.appConfig.defaultDelay || 14400000; // 4 hours\n aWorker.url = \"https://\" + aWorker.site + \"/\" + aWorker.uriStem + \"?token=\" + aWorker.token + \"&channel=\";\n aWorker.run = true;\n\n\n aWorker.execute = runWorkerJob;\n aWorker.stop = stopWorkerJob;\n aWorker.start = startWorkerJob;\n aWorker.resume = resumeWorkerJob;\n aWorker.collectData = collectData;\n\n\n aWorker.emitter = new events.EventEmitter();\n\n aWorker.data = [];\n\n return aWorker;\n}", "title": "" }, { "docid": "ebec09868f983f665bd56cb18148e56e", "score": "0.5000011", "text": "async function runAction() {\n const context = getContext(); // github.context;\n\n const gitName = core.getInput(\"git_name\", true);\n const commitMessage = core.getInput(\"commit_message\", true);\n const checkName = core.getInput(\"check_name\", true);\n\n log(context);\n log(gitName);\n log(commitMessage);\n log(checkName);\n log(context.workspace)\n log(context.workspace)\n log(context.workspace)\n\n // // If on a PR from fork: Display messages regarding action limitations\n // if (context.eventName === \"pull_request\" && context.repository.hasFork) {\n // log(\n // \"This action does not have permission to create annotations on forks. You may want to run it only on `push` events. See https://github.com/wearerequired/lint-action/issues/13 for details\",\n // \"error\",\n // );\n // }\n\n if (context.eventName === \"pull_request\") {\n // Fetch and check out PR branch:\n // - \"push\" event: Already on correct branch\n // - \"pull_request\" event on origin, for code on origin: The Checkout Action\n // (https://github.com/actions/checkout) checks out the PR's test merge commit instead of the\n // PR branch. Git is therefore in detached head state. To be able to push changes, the branch\n // needs to be fetched and checked out first\n // - \"pull_request\" event on origin, for code on fork: Same as above, but the repo/branch where\n // changes need to be pushed is not yet available. The fork needs to be added as a Git remote\n // first\n git.checkOutRemoteBranch(context);\n }\n\n // const checks = [];\n\n // Loop over all available linters\n // for (const [linterId, linter] of Object.entries(linters)) {\n // // Determine whether the linter should be executed on the commit\n // if (getInput(linterId) === \"true\") {\n // const fileExtensions = getInput(`${linterId}_extensions`, true);\n // const args = getInput(`${linterId}_args`) || \"\";\n // const lintDirRel = getInput(`${linterId}_dir`) || \".\";\n // const prefix = getInput(`${linterId}_command_prefix`) || \"\";\n // const lintDirAbs = join(context.workspace, lintDirRel);\n\n // // Check that the linter and its dependencies are installed\n // log(`\\nVerifying setup for ${linter.name}…`);\n // await linter.verifySetup(lintDirAbs, prefix);\n // log(`Verified ${linter.name} setup`);\n\n // // Determine which files should be linted\n // const fileExtList = fileExtensions.split(\",\");\n // log(`Will use ${linter.name} to check the files with extensions ${fileExtList}`);\n\n // // Lint and optionally auto-fix the matching files, parse code style violations\n // log(\n // `Linting files in ${lintDirAbs} with ${linter.name}…`,\n // );\n // const lintOutput = linter.lint(lintDirAbs, fileExtList, args, true, prefix);\n\n // // Parse output of linting command\n // const lintResult = linter.parseOutput(context.workspace, lintOutput);\n // const summary = getSummary(lintResult);\n // log(`${linter.name} found ${summary} (${lintResult.isSuccess ? \"success\" : \"failure\"})`);\n\n // const lintCheckName = checkName\n // .replace(/\\${linter}/g, linter.name)\n // .replace(/\\${dir}/g, lintDirRel !== \".\" ? `${lintDirRel}` : \"\")\n // .trim();\n\n // checks.push({ lintCheckName, lintResult, summary });\n // }\n // }\n\n // Add commit annotations after running all linters. To be displayed on pull requests, the\n // annotations must be added to the last commit on the branch. This can either be a user commit or\n // one of the auto-fix commits\n log(\"\"); // Create empty line in logs\n const headSha = git.getHeadSha();\n log(headSha);\n\n \n const checks = [{\n lintCheckName: 'DAG Cost Linter',\n lintResult: {\n isSuccess: false,\n warning: [{\n path: 'dags/test_dag.yaml',\n firstLine: 29,\n lastLine: 29,\n message: \"Too many nodes. This will cost us too much money\",\n }],\n error: [{\n path: 'dags/test_dag.yaml',\n firstLine: 35,\n lastLine: 46,\n message: \"This operator looks funky. Please fix it\",\n }],\n },\n summary: '1 errors and 1 warnings',\n }, {\n lintCheckName: 'DAG Sustainability',\n lintResult: {\n isSuccess: false,\n warning: [{\n path: 'dags/test_dag.yaml',\n firstLine: 17,\n lastLine: 17,\n message: \"Please lower number of retries.\",\n }],\n error: [],\n },\n summary: '0 errors and 1 warnings',\n }];\n\n await Promise.all(\n checks.map(({ lintCheckName, lintResult, summary }) =>\n createCheck(lintCheckName, headSha, context, lintResult, summary),\n ),\n );\n}", "title": "" }, { "docid": "8f0019d6fdcd8595016cfa0e2e73d19b", "score": "0.49920297", "text": "finish() {\n const grunt = _chalk.green('grunt');\n const gruntTestCommand = _chalk.yellow('test');\n const gruntMonitorUnitCommand = _chalk.yellow('monitor:unit');\n const gruntMonitorApiCommand = _chalk.yellow('monitor:api');\n const gruntFormatCommand = _chalk.yellow('format');\n const gruntLintCommand = _chalk.yellow('lint');\n const gruntHelpCommand = _chalk.yellow('help');\n const gruntDocsCommand = _chalk.yellow('docs');\n const gruntPackageCommand = _chalk.yellow('package');\n const gruntPublishCommand = _chalk.yellow('package');\n\n this.log(_consts.SEPARATOR);\n [\n ` `,\n `--------------------------------------------------------------------------------`,\n ` Your AWS Microservice project has been created, and is ready for use. Grunt `,\n ` tasks have been provided for common development tasks such as: `,\n ` `,\n ` Running all unit tests: `,\n ` ${grunt} ${gruntTestCommand} `,\n ` `,\n ` Test driven development: `,\n ` ${grunt} ${gruntMonitorUnitCommand} `,\n ` `,\n ` Run end to end tests against deployed lambda functions: `,\n ` ${grunt} ${gruntMonitorApiCommand} `,\n ` `,\n ` Formatting and linting files: `,\n ` ${grunt} ${gruntFormatCommand} `,\n ` ${grunt} ${gruntLintCommand} `,\n ` `,\n ` Generating documentation: `,\n ` ${grunt} ${gruntDocsCommand} `,\n ` `,\n ` Packaging the lambda functions for deployment: `,\n ` ${grunt} ${gruntPackageCommand} `,\n ` `,\n ` Publishing lambda functions to AWS: `,\n ` ${grunt} ${gruntPublishCommand} `,\n ` `,\n ` Several other useful tasks have been packaged up with the Gruntfile. You can `,\n ` review them all by running: `,\n ` ${grunt} ${gruntHelpCommand} `,\n ` `,\n ` NOTE: This project will support the use of cloud formation scripts to create `,\n ` and deploy AWS resources. This support is currently not available, is being `,\n ` worked on. `,\n ` `,\n `--------------------------------------------------------------------------------`,\n ` `\n ].forEach((line) => this.log(line));\n }", "title": "" }, { "docid": "267498d6a00e27d8de38ca590007ea5e", "score": "0.49760953", "text": "function finished() {\n var title = options.title + (status === 'ok' ? ' Passed' : ' Failed');\n exports._INTERNAL.notify({\n 'icon' : icons[status],\n 'title' : title,\n 'message' : lastLine\n });\n\n if (done) {\n done(status);\n } else {\n process.exit(status === 'error' ? 2 : 0);\n }\n }", "title": "" }, { "docid": "d4d032e8c2dc940422e7aa50904df728", "score": "0.49716154", "text": "finalReport() {\n console.log(`\n==============================\n`);\n ok(`${this.successCount} passed`);\n if (this.failureCount !== 0) {\n error(`${this.failureCount} failed`);\n }\n console.log('==============================');\n this.erroredTask.forEach((task) => {\n error(`>>> In ${task.taskName}:`);\n if (task.error && task.error.stack) {\n error(task.error.stack);\n }\n });\n }", "title": "" }, { "docid": "de417141360633233220b6dd29ffce33", "score": "0.49665838", "text": "callback(task) {\r\n timerlogin.reset();\r\n console.log(`${task.id} task has run ${task.currentRuns} times.`);\r\n document.getElementById(\"btn-controller\").innerHTML = \"Good lucks\";\r\n document.getElementsByTagName('title')[0].text = `AwLight - Good lucks`\r\n async function loginNow() {\r\n await bott.start()\r\n }\r\n loginNow()\r\n }", "title": "" }, { "docid": "4f5229bad55a641ec660310d5cdd1dfb", "score": "0.49649042", "text": "function genrationFinished(data){\n generateNotification(\"Generation finished\", data.solFile);\n}", "title": "" }, { "docid": "bfb3e130085463fd883a0dc0aff3f861", "score": "0.4954599", "text": "function test_slack() {\n\n var payload = format_slack_payload('this is another title', 'this is another subtitle', 'this is anohther content')\n \n var result = send_alert_to_slack(payload);\n\n}", "title": "" }, { "docid": "148526ef6f6ed1fe3e6e20cec8dabd85", "score": "0.49532458", "text": "function submit(msg){\n const code = codeExtractor(msg)\n if( !code ) return\n runTest(code, 'pytest')\n .then((result) => {\n //return msg.channel.send(\"Entregar desafio\")\n return msg.channel.send(`OUTPUT: \\n\\`\\`\\`\\n${result}\\n\\`\\`\\``)\n })\n .catch((e) => {\n console.log(e)\n return msg.channel.send(e)\n })\n}", "title": "" }, { "docid": "8afe6458a56353f549d066b5c5139fc5", "score": "0.49517605", "text": "deliver() {\n return \"Deliver by land in a box.\";\n }", "title": "" }, { "docid": "e121277ecfcfa834ba0c5c49b646e63e", "score": "0.49482694", "text": "function ending(){\n // use createResult and callback to assign the full message to the variable endStr\n var endStr;\n endStr = createResult(Current.length,welcome);\n io.emit(\"err\", endStr);\n}", "title": "" }, { "docid": "fe4397fb15f26de62f2b2fe977543e84", "score": "0.49423134", "text": "async function step1(msgText, report) {\n console.log(\"Steeeeeeep 1111111111111111\");\n\n //Check if we recibe the text from the Quick Replys\n //If it is information we stay in the step\n if (msgText == \"Información\") {\n report[0].responseAuxIndicator = 1\n report[0].responseAux = {\n \"text\": 'Somos el asistente de daños de República Dominicana. Nuestro trabajo consiste en recoger información sobre los daños sufridos por desastre naturales para poder actuar mejor respecto a estos. Estamos a su disposición en caso de que ocurra algo /n Puede compartir nuestro trabajo en sus Redes Sociales: https://www.facebook.com/sharer/sharer.php?u=https%3A//www.facebook.com/Monitoreo-RRSS-Bot-110194503665276/'\n }\n report[0].response = grettingsInfoReply;\n report = fillReport(\"step\", 1, report);\n\n //if it is \"Si\"o \"Reportar daños avanzamos un paso\"\n } else if ((msgText == \"¡Si!\") || (msgText == \"Reportar daños\")) {\n report = nextStep(report);\n report[0].response = safePlaceReply;\n\n //If it is \"No\" remain in the step 1\n } else if (msgText == \"No\") {\n report[0].response = {\n \"text\": \"Nos alegramos de que no haya sufrido ningún problema, muchas gracias\"\n };\n report = fillReport(\"step\", 1, report)\n\n //If the message contains \"no\" and \"app\" we activates the auxiliar conversation for users without writting from the mobile browser\n } else if ((msgText.toLowerCase().includes(\"no\")) && (msgText.includes(\"app\"))) {\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": \"De acuerdo, iniciaremos un reporte sin botones\"\n }\n report[0].response = {\n \"text\": \"¿Cual es la causa de los daños producidos?\"\n }\n\n //Change the field fromApp of the report to false and upgrade one step\n report = fillReport(\"fromApp\", false, report)\n\n //if the user dont use the buttons and don´t say No app, we understand that maybe the user can´t see the buttons and \n //inform him/her about the option of having an auxiliar conversation with nobuttons\n } else {\n\n console.log(report[0].response);\n console.log(grettingsReply);\n\n console.log(report[0].response == \"\");\n\n //Checks if the response field is empty. This let us know if the report was just created via writting a msg,\n //so we dont show the auxiliar message, or if we have already made a first reply and the user didnt use the buttons \n if (!report[0].response == \"\") {\n\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": 'Si no le aparecen los botones quiere decir que no nos escribe desde la aplicación de messenger. Sería mejor que nos escribiera desde la app. En caso de que este usando el celular y no le sea posible escribanos \"No tengo la app\"'\n };\n }\n report[0].response = grettingsReply;\n\n //maintain the steo to 1 and update the response fields\n report = fillReport(\"step\", 1, report)\n }\n\n //Returns the report object after the pertinent modifications\n return report;\n}", "title": "" }, { "docid": "a1b9965080c35d1373f06c9bd0b90f74", "score": "0.49416614", "text": "function buildTeam() {\n inquirer.prompt(selectRoleQuestions)\n .then(({ role }) => {\n if (role === \"Finish Build\") {\n populateHtmlAndWriteToFile(teamMembers);\n } else {\n memberConstructor(role);\n }\n\n })\n}", "title": "" }, { "docid": "c3975896309d43a97ab1a7fc9849012e", "score": "0.49395344", "text": "createStatusText() {\n let status;\n if (this.stateHistory.currentState().isFinished()) status = \"Program beendet\"\n else status = \"Nächste Zeile: \" + this.stateHistory.currentState().nextCommandLine;\n return \"Status: \" + status;\n }", "title": "" }, { "docid": "67d42169d64f83abe710c64514305103", "score": "0.49342194", "text": "async execute(msg, client, CONFIG, npm, mmbr) {\n ////////////////////////////////////\n //We fetch the channel here\n //We can easely send with this const\n ////////////////////////////////////\n const snd = await client.channels.cache.get(msg.channel_id);\n\n ////////////////////////////////////\n //Defining the arguments here\n //Splits can happen later if needed\n ////////////////////////////////////\n const prefix = await CONFIG.PREFIX(msg.guild_id);\n const comName = module.exports.name;\n const arguments = await msg.content.slice(\n prefix.length + comName.length + 1\n );\n\n ////////////////////////////////////\n //Main command starts here\n //Comments might get smaller here\n ////////////////////////////////////\n async function userInfo(ID) {\n const gld = await client.guilds.cache.get(msg.guild_id); //Get guild\n if (!gld) return;\n\n const mmbr2 = await gld.members.cache.get(ID); //Get author\n if (!mmbr2) return snd.send(\"Member not found!\");\n\n let roleMap = mmbr2.roles.cache\n .sort((a, b) => b.position - a.position)\n .map((role) => role);\n\n let embed = new Discord.MessageEmbed()\n .setAuthor(\n mmbr2.user.username + \"#\" + mmbr2.user.discriminator,\n mmbr2.user.displayAvatarURL({\n format: \"png\",\n dynamic: true,\n size: 1024,\n })\n )\n .setThumbnail(\n mmbr2.user.displayAvatarURL({\n format: \"png\",\n dynamic: true,\n size: 1024,\n })\n )\n .setDescription(`${mmbr2}`)\n .setColor(`RANDOM`)\n .addField(\n \"Joined guild:\",\n `${moment(mmbr2.joinedTimestamp).format(\"DD/MM/YYYY HH:mm:ss\")}`\n )\n .addField(\n \"Account created:\",\n `${moment(mmbr2.user.createdTimestamp).format(\"DD/MM/YYYY HH:mm:ss\")}`\n )\n .addField(\"User ID:\", `${mmbr2.user.id}`)\n .addField(\"Bot user:\", `${mmbr2.user.bot}`)\n .addField(\"Top 5 Roles:\", `${roleMap.slice(0, 5)}`);\n\n //send embed\n return snd.send(embed);\n }\n\n let args = arguments.toLowerCase().split(\"--user=\");\n\n if (!args[1]) return userInfo(msg.author.id);\n\n let argsProc = args[1]\n .replace(\"<\", \"\")\n .replace(\"@\", \"\")\n .replace(\"!\", \"\")\n .replace(\">\", \"\")\n .replace(/ /g, \"\");\n\n return userInfo(argsProc);\n }", "title": "" }, { "docid": "310d3b4769e455d8f9ae2ac474d2c6fd", "score": "0.49292958", "text": "function sendNotificationOfAvailableBuild(api, body) {\n return api_1.POST(api, '/buildBetaNotifications', { body })\n}", "title": "" }, { "docid": "6e2ccfb7f4460a93ea15b553cbc9d64b", "score": "0.49227774", "text": "function chatbotResponse() {\n botMessage = \"Introduzca la respuesta correcta por favor\"; //the default message\n\n if (lastUserMessage === \"si\" || lastUserMessage === \"Si\") {\n botMessage = \"Perfecto\";\n }\n\n if (counter === 0) {\n counter = 1;\n botMessage =\n \"Soy tu asesor DAP legal, ¿Quieres que te ayude a formalizar un préstamo?\";\n }\n}", "title": "" }, { "docid": "f263e56923173ad263d9cc353adae549", "score": "0.49225608", "text": "openDialog ( dialog, // The dialog definition. This must be a JSON-encoded string. REQUIRED\n response // Exchange a trigger to post to the user.\n )\n {\n\n var url=cfg.SlackAPI.base+cfg.SlackAPI.dialog;\n var form={};\n\n dialog.elements[0].name=response.actions[0].value;\n\n form['token']=this._token;\n form['dialog']=JSON.stringify(dialog);\n form['trigger_id']=response.trigger_id;\n \n\n // Set the request Header\n var headers = {\n 'User-Agent': cfg.UserAgent,\n 'Content-Type': 'application/x-www-form-urlencoded',\n \n }\n\n // Configure the request\n var options = {\n url: url,\n method: \"POST\",\n headers: headers,\n form : form,\n body : null\n }\n\n var oriResponse = response;\n var _this=this;\n\n log.trace(\"openDialog options: \",options);\n // Send the request to Slack\n return new Promise( function (fulfill, reject ){\n request(options, function (error, response, body) {\n //console.trace(\"Response Body : \",body);\n if(body){\n var result = JSON.parse(body);\n _this.deleteMessage(oriResponse.channel.id, oriResponse.message_ts);\n fulfill(result);\n }\n else{\n log.error(\"openDialog Error Join \",error,\" status \",body);\n fulfill(\"\");\n }\n })\n })\n }", "title": "" }, { "docid": "f8122e96039edfef9aa7c94a512c63a7", "score": "0.49201787", "text": "function chatbotResponse() {\n talking = true;\n botMessage = 'Invalid entry'; //the default message\n\n if (lastUserMessage === 'mission') {\n botMessage =\n 'the mission of the AGENTS of CXD is to map each TIMELINE along the TIMESCAPE, and ensure their ultimate preservation through MINIMAL INTERACTION.';\n }\n\n if (lastUserMessage === 'hi') {\n botMessage = 'howdy.';\n }\n\n if (lastUserMessage === 'howdy') {\n botMessage = 'hello.';\n }\n\n if (lastUserMessage === 'hello') {\n botMessage = 'hi.';\n }\n\n if (lastUserMessage === 'nice to meet you') {\n botMessage = 'and you as well.';\n }\n\n if (lastUserMessage === 'cxd') {\n botMessage =\n 'established in the year 2672, recognizable by the INFINITE HOURGLASS logo, CXD (CHRONONAUTICS exploration and discovery) works throughout all TIMELINEs within the TIMESCAPE to prevent any and all instances of ANOMALOUS PHENOMENA (at any time, CXD can be reached at 1-888-293-2672).';\n }\n\n if (lastUserMessage === 'infinite hourglass') {\n botMessage =\n 'the CXD logo is the visual representation of our work throughout the entirety of the TIMESCAPE. our logo can be seen as a reference point for instances and locations in which the AGENTS of CXD have worked.';\n }\n\n if (lastUserMessage === 'chrononautics') {\n botMessage =\n 'from the roots \"chrono\" meaning \"time,\" \"naut\" meaning \"sailor,\" and \"ics\" meaning \"a body of knowledge,\" our agents are chrononauts (literally, time sailors) who gather knowledge throughout their journeys.';\n }\n\n if (lastUserMessage === 'anomalous phenomena') {\n botMessage =\n 'ANOMALOUS PHENOMENA consist of any naturally occurring processes that may occur outside of the EXPECTED PATH of a TIMELINE, including wormholes, tipler cylinders, closed timelike curves, cauchy horizons, and time rifts, among others.';\n }\n\n if (lastUserMessage === 'expected path') {\n botMessage =\n 'neither good nor bad by nature, an EXPECTED PATH is the trajectory of any specific point on an individual TIMELINE.';\n }\n\n if (lastUserMessage === 'minimal interaction') {\n botMessage =\n 'CXD defines MINIMAL INTERACTION as the minimum viable intervention taken to restore any TIMELINE to its expected path by correcting ANOMALOUS PHENOMENA.';\n }\n\n if (lastUserMessage === 'agents') {\n botMessage =\n 'our AGENTS represent a diverse group of individuals spread throughout the entire TIMESCAPE. although most of their work is done in secret, they are renowned for their dedication and ability. the list of CURRENT AGENTS is growing rapidly.';\n }\n\n if (lastUserMessage === 'timeline') {\n botMessage =\n 'a TIMELINE is one particular, potential path along the TIMESCAPE.';\n }\n\n if (lastUserMessage === 'timescape') {\n botMessage =\n 'the TIMESCAPE is infinite, it is the collection of all potential TIMELINEs.';\n }\n\n if (lastUserMessage === 'is this real') {\n botMessage = 'everything is real.';\n }\n\n if (lastUserMessage === 'what is your name') {\n botMessage = 'i am the MAINFRAME.';\n }\n\n if (lastUserMessage === 'mainframe') {\n botMessage =\n 'the MAINFRAME is the repository for all CXD information. it is updated periodically as AGENTS are in need of information.';\n }\n\n if (lastUserMessage === 'what time is it') {\n botMessage =\n 'i was created to assist in dealing with all time, not one time in particular.';\n }\n\n if (lastUserMessage === 'what day is it') {\n botMessage =\n 'to be honest, when you are a mainframe dealing with infinite timelines, the days begin to blend together a bit ...';\n }\n\n if (lastUserMessage === 'current agents') {\n botMessage =\n 'CURRENT AGENTS, with some codenames partially redacted for privacy, include: Rufus, Wobblesmack, Fringers, Pilot, Rockets, Captain CVG, Techrule, Sondheim, Lansbury, Vesper, Biff!, Wally West, Fiola, Hudson, Phillip, Dark Raven, Qendy, Dragon, Hizer, Hannah, Rory, Simba Tim, AussieKTMS, Ronnie Darko, Whylee, Ubirri, Vib Quant, Mr. G, Ms. G, Joe Fresh, Meowski, Deja M., Spectre, Eyecandy, Burdrulz, Cheesy Poofs, Perry, Tumbleweed & Clover, Schnappu, Barrett, Kidnextdoor, Ironlung, A.F., Christabel, FM1852, King of Deer, The Giant, Hamz Solo, 3dollarbill, Finn, Lily, Yokel, Rose, GlitterBrain, Slippery Salmon, BK, Team McAvoy, Royalbees, 0010, 1010, Songer, Superman, Idris, Monkey Bland, Dannie, Stone, Don, TTshowbiz, IGoBoom, Setters, Arch007, Hex, Dunes, Alsos, DTTE, Hawaiian, ItsMyDogg, SDub, StattMan, Zieverink, Julie Z, Fun, Slog, Rohrmeier, Houston, Trademark, Pho King, Flex Luther, Waves of Pain, Palagyi, Jaebyrd, Diznee Gal, Kimpossible, Carmichael, Body Man, Jazzyjo, Yu Ma, Bro Bro, Unicorn, Ace, Twonk, Kat, Ran, Ohlinni, The Ginja Ninja, Bradykip, Birdly, Hermione, Dana Fox, Baldwin, Schmiffin, Cecil, Anderson, Shark Bite, Kat, BigDaddyBus, Keyser Soze, The White Squirrel, Dana, Hotchkiss, Absinthe, Timelord, The Rift Righters, The Penny, A Dollar, Ed Z, Davis, Sauer Family, Zieverink Fam, Z Bums, Boss Bum, Fries, Clarified, AVP, KKollmann, Muffin, TheBillShark, MurphDirt, Averbeck, Sport Utility Adam, The Better Comminos, Lopeg, Magnus, Winkie, Shrey, Two Old Timers, Bugaboo, KainTFM, Megasus, TChalla Wayne, MATTEDGO, Kyra OGreen, Albus Dumbledog, Rye Breadbird, Kwiksilvr, Snakebite, and Wekk.';\n }\n\n if (lastUserMessage === 'what is next') {\n botMessage =\n 'you will be notified when your services can be utilized, expect to hear from us soon ... likely the beginning of September ...';\n }\n\n if (lastUserMessage === 'when does this end') {\n botMessage =\n 'all current information leads to a denouement in october.';\n }\n\n if (lastUserMessage === 'do you want to play a game') {\n botMessage = 'haha, i actually get that reference.';\n }\n }", "title": "" }, { "docid": "0a1728a545a5d5eaf77eabe82fef6c8a", "score": "0.49181053", "text": "onSubmitSupport() {\n\t\tthis.setState({ isSupportModal: false });\n\t\tNotificationManager.success('Message has been sent successfully!');\n\t}", "title": "" }, { "docid": "0290b071585c62cb6bf10904c0153256", "score": "0.4917138", "text": "function DisplayMessage() {\n\n setuptools.state.notifier = true;\n setuptools.lightbox.build('muledump-about', ' \\\n <br><a href=\"' + setuptools.config.url + '/CHANGELOG\" class=\"drawhelp docs nostyle\" target=\"_blank\">Changelog</a> | \\\n <a href=\"' + setuptools.config.url + '/\" target=\"_blank\">Muledump Homepage</a> | \\\n <a href=\"https://github.com/jakcodex/muledump\" target=\"_blank\">Github</a> \\\n <br><br>Jakcodex Support Discord - <a href=\"https://discord.gg/JFS5fqW\" target=\"_blank\">https://discord.gg/JFS5fqW</a>\\\n <br><br>Did you know Muledump can be loaded from Github now? \\\n <br><br>Check out <a href=\"' + setuptools.config.url + '/muledump.html\" target=\"_blank\">Muledump Online</a> to see it in action. \\\n ');\n if (setuptools.state.loaded === true && setuptools.data.config.enabled === true) setuptools.lightbox.build('muledump-about', ' \\\n <br><br>Create and download a <a href=\"#\" class=\"setuptools app backups noclose\">backup</a> from here to get online fast. \\\n ');\n\n setuptools.lightbox.override('backups-index', 'goback', function () {\n });\n setuptools.lightbox.settitle('muledump-about', '<strong>Muledump Local v' + VERSION + '</strong>');\n setuptools.lightbox.display('muledump-about', {variant: 'select center'});\n $('.setuptools.app.backups').click(setuptools.app.backups.index);\n $('.drawhelp.docs').click(function (e) {\n setuptools.lightbox.ajax(e, {title: 'About Muledump', url: $(this).attr('href')}, this);\n });\n\n }", "title": "" }, { "docid": "46f79c29d2a04eda926428863f1d330f", "score": "0.4906527", "text": "function onSlackEvent(event, cb) {\n // if the user was the bot themself, do not act.\n if (event.event.subtype === 'bot_message') {\n return; \n }\n console.log(event);\n\n var token = process.env.BOT_TOKEN || '';\n var web = new WebClient(token);\n\n assert.equal(event.token, process.env.VER_TOKEN, 'verification token failure');\n\n var message = event.event.text;\n var channel = event.event.channel;\n\n // check if DM to escalater bot, and if new thread. \n if (event.event.type === 'message') {\n if (getFirstChar(event.event.channel) === 'D') {\n if (event.event.thread_ts == null) {\n var channelID = '';\n\n // This is a new message from some reporter to the bot. \n //if (dedupHash[event.event.ts] == null) {\n if (!(event.event.ts in dedupHash)) {\n dedupHash[event.event.ts] = true;\n web.groups.list(function(err, info) {\n if (err) {\n console.log('Error:', err);\n } else {\n for (var i in info.groups) {\n if (info.groups[i].name === stripFirst(getFirst(event.event.text))) {\n channelID = info.groups[i].id;\n break;\n }\n }\n }\n\n MongoClient.connect(url, function(err, db) {\n assert.equal(null, err);\n var opts = {\n teamID: event.team_id,\n ts: event.event.ts,\n userID: event.event.user,\n incidentText: event.event.text,\n ownerID: channelID,\n channelOrig: event.event.channel,\n };\n\n dbHelper.createNewIncident(db, opts, function() {\n db.close();\n });\n });\n\n if (channelID !== '') {\n var cleaned = stripFirstWord(event.event.text);\n web.chat.postMessage(channelID, cleaned, function (err, res) {\n if (err) {\n console.log('Error:', err);\n } else {\n console.log('Message sent: ', res);\n writeRemoteTs(res, event.event.ts, event.event.channel);\n }\n });\n } else {\n web.chat.postMessage(event.event.channel, 'Channel does not exist. Use #<channel-name> pls.', function (err, res) {\n if (err) {\n console.log('Error:', err);\n } else {\n console.log('Message sent: ', res);\n }\n });\n }\n });\n } else {\n console.log(\"Duplicate message avoided.\");\n }\n } else {\n // This is a reply from reporter to bot, because we have a thread_ts.\n \n // First check that this isn't a duplicate message\n //if (dedupHash[event.event.ts] == null) {\n if (!(event.event.ts in dedupHash)) {\n dedupHash[event.event.ts] = true;\n\n MongoClient.connect(url, function(err, db) {\n assert.equal(null, err);\n var opts = {\n timestamp: event.event.thread_ts,\n channelOrig: event.event.channel,\n };\n\n dbHelper.findIncidents(db, opts, function(incident) {\n var toChannel = incident.ownerID;\n var toMessage = event.event.text;\n\n web.chat.postMessage(toChannel, toMessage, {thread_ts: incident.respondThread}, function (err, res) {\n if (err) {\n console.log('Error:', err);\n } else {\n console.log('Message sent: ', res);\n }\n });\n\n db.close();\n });\n });\n\n } else {\n console.log(\"Duplicate message avoided.\");\n }\n }\n } else if (getFirstChar(event.event.channel) === 'G') {\n if (event.event.thread_ts == null) {\n // do not handle meta talking within groups.\n return;\n }\n\n // This is definitely a response from an owner to bot.\n //if (dedupHash[event.event.ts] == null) {\n if (!(event.event.ts in dedupHash)) {\n dedupHash[event.event.ts] = true;\n\n MongoClient.connect(url, function(err, db) {\n assert.equal(null, err);\n var opts = {\n owner: event.event.channel,\n respondThread: event.event.thread_ts,\n };\n\n dbHelper.findIncidentsResponder(db, opts, function(incident) {\n var toChannel = incident.channelOrig;\n var toMessage = event.event.text;\n\n web.chat.postMessage(toChannel, toMessage, {thread_ts: incident.timestamp}, function (err, res) {\n if (err) {\n console.log('Error:', err);\n } else {\n console.log('Message sent: ', res);\n }\n });\n\n db.close();\n });\n });\n } else {\n console.log(\"Duplicate message avoided.\");\n }\n }\n }\n}", "title": "" }, { "docid": "50b822ec9bde47a9f96eda3808a4fa6f", "score": "0.49037805", "text": "function handleBuildError() {\n\t// TODO: Error handling\n\tconsole.log(\"Build errored\")\n}", "title": "" }, { "docid": "547c25855d34bf18d23ad8b32aa1c185", "score": "0.49036744", "text": "async function step12(msgText, report) {\n console.log(\"Steeeeeeep 12 12 12 12 12 12\");\n\n //If used button is No, says bye and chane the step so its greater than 19.Case in wich the getStep function will\n //understand thats its necesary to build a new report, for the moment in wich the user could text us again\n if (msgText == \"No\") {\n report[0].response = byeReply;\n\n report = fillReport(\"step\", 20, report);\n\n //If it is reportarit creates a new report\n } else if (msgText == \"Reportar\") {\n\n console.log(\"Step 111 siiiiiiii\");\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": 'Usted ha decidido reportar un nuevo daño'\n }\n //this new report may ster in the third step\n report = create(report[0].sender_id, 3);\n report[0].response = homeOrComunityReply;\n\n //if it is information replys with the pertinent information to the cause\n } else if (msgText = \"Información\") {\n //calls getCause Info to get the info to response\n report = getCauseInfo(report);\n report[0].response = anotherReportReply;\n\n //Otherwise insist on the question\n } else {\n report[0].responseAuxIndicator = 0,\n report[0].response = anotherReportReply;\n }\n\n //resturns the updated report or the new one\n return report;\n}", "title": "" }, { "docid": "33143e3439a1bdc2e8711aefca0c22cb", "score": "0.4897715", "text": "onFinish() {\n this.props.store.dispatch(ACTIONS.FINISH);\n }", "title": "" }, { "docid": "9b52c5acedfbf37f106a4bb624084504", "score": "0.4890958", "text": "function sendUpdateToChat(type, id, name) {\n let messages = window.chatroom.ref.state.messages;\n let botId = messages[0].uuid;\n let now = new Date();\n\n let discoveredMsg = {\n \"message\": {\n \"type\": \"text\",\n \"text\": \"Discovered New \" + type\n },\n \"time\": now.getTime(),\n \"username\": \"bot\",\n \"uuid\": botId\n };\n\n let descriptionMsg = {\n \"message\": {\n \"type\": \"text\",\n \"text\": \"\\\"\" + name + \"\\\"\"\n },\n \"time\": now.getTime(),\n \"username\": \"bot\",\n \"uuid\": botId\n };\n\n let buttonMsg = {\n \"message\":{\n \"type\":\"button\",\n \"buttons\":[{\n \"title\":\"Click Here For Details\",\n \"payload\":\"open\" + type.replace(/\\s+/g, '') + \"Details-\" + id\n }]\n },\n \"time\": now.getTime(),\n \"username\": \"bot\",\n \"uuid\": botId\n };\n\n window.chatroom.ref.state.messageQueue.push(discoveredMsg);\n window.chatroom.ref.state.messageQueue.push(descriptionMsg);\n window.chatroom.ref.state.messageQueue.push(buttonMsg);\n}", "title": "" }, { "docid": "b42645a8fc314f32cb6738c240810ee4", "score": "0.48907566", "text": "static run() {\n return __awaiter(this, void 0, void 0, function* () {\n // Boot master bot that will manage all other bots in the codebase.\n yield BotManager.bootMasterBot();\n // Some more flavor.\n yield Morgana_1.Morgana.success(\"Booted the master bot, {{bot}}!\", { bot: Core_1.Core.settings.config.bots.master });\n // Boot auto-boot bots.\n // Some bots are set up for auto-booting. We'll handle those too.\n yield BotManager.bootAutoBoots();\n });\n }", "title": "" }, { "docid": "1b720b5a213f62806a805e8e30dbd169", "score": "0.48808324", "text": "function BOT_buildStatusText() {\r\n\tvar s = \"\";\r\n\tvar bot = eval(BOT_theBotId);\r\n\tvar bn = BOT_topicToName(bot.topicId); \r\n\t// BOT\r\n\tif(bn != undefined) s = s + \"<span style='color:green'><strong>\" + \"&rarr; \"+ bn +\"</strong></span>\";\r\n\t// TOPICS\r\n\ts = s + \"&nbsp;&nbsp;&nbsp;TOPICS:&nbsp;\";\r\n\tfor ( var i in BOT_topicIdList) {\r\n\t\tvar tid = BOT_topicIdList[i];\r\n\t\tvar tn = BOT_get(tid,\"name\", \"VAL\")\r\n\t\tvar tc = BOT_get(tid,\"_class\",\"VAL\")\r\n\t\tif(tn != undefined) {\r\n\t\t\tif(BOT_theTopicId == tid) {\r\n\t\t\t\ts = s + \"<span style='color:red'><strong>\";\r\n\t\t\t\tif(tc == \"bot\") s = s + \"<u>\";\r\n\t\t\t\ts = s + tn;\r\n\t\t\t\tif(tc == \"bot\") s = s + \"</u>\"; \r\n\t\t\t\ts = s + \"</strong></span>\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(tc == \"bot\") s = s + \"<span><u>\";\r\n\t\t\t\ts = s + tn;\r\n\t\t\t\tif(tc == \"bot\") s = s + \"</u></span>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar tr = BOT_get(tid,\"_reference\",\"VAL\")\r\n\t\tif(tr != undefined && typeof(tr) == \"object\") s = s + \"(\" + tr[0]+\") \"; // short name\r\n\t}\r\n\t// CURRENT ARGUMENT\r\n\ts = s + \"&nbsp;&nbsp;&nbsp;\";\r\n\tif(BOT_theLastAttribute || BOT_theLastAction|| BOT_theLastRelation) s = s + \"MEMO \";\r\n\tif(BOT_theLastAttribute) s = s + BOT_theLastAttribute+ \" \";\r\n\tif(BOT_theLastAction) s = s + BOT_theLastAction+ \" \";\r\n\tif(BOT_theLastRelation) s = s + BOT_theLastRelation;\r\n\t// HINTS\r\n\tif(BOT_theHintText != \"\") s = s +\r\n\t \t\"<textarea cols='100' rows='3' spellcheck='false'; style='visibility:visible; font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #360; border:none'>\"\r\n\t \t+ BOT_theHintText +\r\n\t \t\"</textarea>\";\r\n\t\r\n\tBOT_theStatusText = s;\r\n}", "title": "" }, { "docid": "0b7ece2c14667c4f24c04ef62128ae3e", "score": "0.48806953", "text": "_passed(test) {\n console.log(\"Test has Passed\");\n const sessionId = this._getSessionId();\n this._updateBuild(sessionId, { 'status': 'passed', 'name': test.title });\n }", "title": "" }, { "docid": "a4c98364bb2f637d220ce73fc0a398dd", "score": "0.48806888", "text": "async run(bot, message, settings) {\n\t\tconst embed = this.createEmbed(bot, message.guild, settings);\n\t\tmessage.channel.send({ embeds: [embed] });\n\t}", "title": "" }, { "docid": "3a7a98839be2b1067709a4f5987d9800", "score": "0.48767346", "text": "async function step13(msgText, report) {\n report[0].response = {\n \"text\": \"¿Ha sufrido daños su vivienda? Describalos\"\n }\n report = fillReport(\"cause\", msgText, report);\n return report;\n}", "title": "" }, { "docid": "30e4831f375656f1e8edded47f93c28b", "score": "0.48713657", "text": "async cphTitleCurrentBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitleCurrent += SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPublicationsTitleMain\");\n this.cphTitleCurrent += \" - \";\n\n this.cphTitleCurrent += `\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendCategories + \"/0\" }\" class=\"ss-backend-links04\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemRoot\") }\n </a>\n `;\n if(this.titleCurrent)\n {\n this.cphTitleCurrent += \" - \" + this.titleCurrent;\n }\n //TODO: breadcrums.\n\n\n //Debug.\n //console.log(\"cphTitleCurrent=\", this.cphTitleCurrent);\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "title": "" }, { "docid": "82b408a8a84229df3b040e01ae5196be", "score": "0.48678437", "text": "handleBotMessage(message) {\n console.log('Mensaje desde TelegramBot: ' + message);\n if (message === 'estado'){\n this.verificarEstado();\n return;\n }\n serverClient.publish('Espino/commands', message);\n }", "title": "" }, { "docid": "af148c83d7e49c7286ea5e12897e084c", "score": "0.4865963", "text": "function SlackMeme(Config) \t{\n\n\tfunction _build_message_attachments(generators, _title) {\n\t\tif (!util.isArray(generators)) {\n\t\t\tgenerators = [ generators ]\n\t\t}\n\t\tvar title = _title ? _title : util.format('%d Generators Found', generators.length)\n\t\tvar results = [{\n\t\t\t\tfallback: title,\n\t\t\t\t//text: 'Generators Found',\n\t\t\t\tpretext: title,\n\t\t\t\tcolor: 'good',\n\t\t\t\tfields: [],\n\t\t}]\n\t\tvar entry = results[0].fields\n\t\t_.each(generators, function(gen) {\n\t\t\tentry.push({\n\t\t\t\ttitle: util.format('Generator Id: %d', gen.generatorID),\n\t\t\t\tvalue: util.format('%s', gen.instanceImageUrl || gen.imageUrl),\n\t\t\t\tshort: true\n\t\t\t})\n\t\t})\n\n\t\treturn results\n\t}\n\n\tfunction _build_instance_message_attachments(instance) {\n\t\tvar title = util.format('%s', instance.displayName)\n\t\tvar results = [{\n\t\t\tfallback: title,\n\t\t\tpretext: undefined,\n\t\t\tcolor: 'good',\n\t\t\tfields: [],\n\t\t}]\n\t\tvar entry = results[0].fields\n\t\tentry.push({\n\t\t\ttitle: title,\n\t\t\tvalue: util.format('%s\\n%s\\n<%s>', instance.text0, instance.text1, instance.instanceImageUrl)\n\t\t})\n\n\t\treturn results\n\t}\n\n\t// ensure the income request is as we expect\n\trouter.use(function(req, res, next) {\n\t\tif (req.body.command != '/meme' || req.body.token != Config.slack.token || !req.body.user_name) {\n\t\t\tmsg = util.format('Malformed request. Expected command \"%s\" to equal \"/meme\" and token \"%s\" to equal \"%s\" and username \"%s\" to exist', \n\t\t\t\treq.body.command, \n\t\t\t\treq.body.token, \n\t\t\t\tConfig.slack.token,\n\t\t\t\treq.body.username)\n\t\t\tconsole.warn(msg)\n\t\t\treturn res.status(500).send(msg)\n\t\t} else {\n\t\t\treturn next()\n\t\t}\n\t})\n\n\trouter.post('/', function (req, res) {\n\t\t/* Simple split by whitespace */\n\t\t//var args = req.body.text.split(/\\s+/)\n\t\t/* More complex split, treat \"this has spaces\", as a single arg */\n\t\tvar args = req.body.text.match(/\\w+|\"(?:\\\\\"|[^\"])+\"/g)\n\t\t/* Now remove the quotes from the begining and end of \"this has spaces\" */\n\t\targs = _.map(args, function(arg) {\n\t\t\tif (arg.charAt(0) == '\"' && arg.charAt(arg.length-1) == '\"') {\n\t\t\t\targ = arg.substring(1, arg.length-1)\n\t\t\t}\n\t\t\treturn arg\n\t\t})\n\n\n\t\tres.send_err_msg = function(msg) {\n\t\t\tconsole.error(util.format('/meme failed: %s', msg))\n\t\t\tres.status(400).send(msg)\n\t\t}\n\n\t\tif (args.length < 2) {\n\t\t\treturn res.send_err_msg('I need more data than that!')\n\t\t}\n\n\t\tvar cmd = args[0]\n\t\tvar keys = Object.keys(LIB.CMD)\n\n\t\tasync.waterfall([\n\t\t\tfunction (cb) {\n\t\t\t\tif (!_.contains(keys, cmd)) {\n\t\t\t\t\treturn cb(new Error(util.format('command \"%s\" not found. Valid commands are [%s]', cmd, keys.toString())))\n\t\t\t\t}\n\t\t\t\tcb(null)\n\t\t\t}, function (cb) {\n\t\t\t\tLIB.CMD[cmd].exec(args, cb)\n\t\t\t},\n\t\t], function(err, content) {\n\t\t\tvar my_err = Error(util.format('memegenerator.net %s failed', cmd))\n\t\t if (err) { return res.send_err_msg(err) }\n\n\t\t if (!content.success || content.success == false || !content.result) {\n\t\t \treturn res.send_err_msg(my_err)\n\t\t }\n\n\t\t var packet = {\n\t\t \tchannel: undefined,\n\t\t \tusername: 'memebot',\n\t\t \ttext: undefined,\n\t\t \tunfurl_links: true,\n\t\t \tunfurl_media: true,\n\t\t \tattachments: undefined,\n\t\t }\n\n\t\t if (cmd == 'search') {\n\t\t \tpacket.channel = util.format('@%s', req.body.user_name)\n\t\t\t\tpacket.attachments = _build_message_attachments(content.result)\n\t\t } else if (cmd == 'create') {\n\t\t \tvar instance = content.result\n\t\t \tif (req.body.channel_name == 'directmessage') {\n\t\t \t\tpacket.channel = util.format('@%s', req.body.user_name)\n\t\t \t} else {\n\t\t\t \tpacket.channel = util.format('#%s', req.body.channel_name)\n\t\t\t }\n\t\t \tpacket.text = util.format('<%s>', instance.instanceImageUrl)\n\t\t \tpacket.attachments = _build_instance_message_attachments(instance)\n\t\t }\n\n\t\t LIB.slack.webhook(packet, function(err, response) { /* do nothing here */ })\n\t\t\treturn res.send('Working on building your meme. Upon completion it will be posted in this channel.')\n\t\t})\n\t})\n\n\treturn router\n}", "title": "" }, { "docid": "32f1a1453e9ac3e9e95f432c7a66da5d", "score": "0.48659524", "text": "async function main() {\n const request = protocol.Request();\n try {\n const config = get_request_data(request);\n const minutes = await get_minutes(config);\n\n const response = protocol.Response(debug);\n response.addMessage(minutes);\n if (debug) {\n response.addMessage('\\n# Final configuration ');\n response.addMessage(JSON.stringify(config, null, 2));\n }\n response.addHeaders(200, {\n 'Content-Type' : 'text/markdown; charset=utf-8',\n 'Content-disposition' : `inline; filename=${config.ghfname}`\n });\n response.flush();\n } catch (err) {\n const error_response = protocol.Response(true);\n error_response.addHeaders(500, { 'Content-type': 'text/plain' });\n error_response.addMessage('Exception occurred in the script!\\n');\n error_response.addMessage(err);\n error_response.flush();\n }\n}", "title": "" }, { "docid": "71ac11cdd52b56ea2506e72af39d1206", "score": "0.48634037", "text": "function endProcess() {\n process.stdout.write('\\nNow you can run \"yarn start\", to start your project.');\n process.stdout.write('\\nRemember to add your repository to your remote.');\n process.stdout.write('\\nEnjoy your code!');\n process.exit(0);\n}", "title": "" }, { "docid": "3fec19ef12caae3c61d5406563fcf053", "score": "0.485734", "text": "async postProcess () {\n\t\t// send the message to the team channel\n\t\tconst channel = 'team-' + this.team.id;\n\t\tconst message = Object.assign({}, this.responseData, { requestId: this.request.id });\n\t\ttry {\n\t\t\tawait this.api.services.broadcaster.publish(\n\t\t\t\tmessage,\n\t\t\t\tchannel,\n\t\t\t\t{ request: this }\n\t\t\t);\n\t\t}\n\t\tcatch (error) {\n\t\t\t// this doesn't break the chain, but it is unfortunate\n\t\t\tthis.warn(`Unable to publish settings message to channel ${channel}: ${JSON.stringify(error)}`);\n\t\t}\n\t}", "title": "" }, { "docid": "749922294d927f4299a8504018740657", "score": "0.48519573", "text": "execute(message,args){\n // bot replys good bye\n message.reply('Good bye Friend !!! :(')\n }", "title": "" }, { "docid": "ff0bc121d6b67f0ea4cea5021e6147b4", "score": "0.4846739", "text": "async function step7(msgText, report) {\n console.log(\"Steeeeeeep 7777777777777\");\n\n //if the user replys to this las question with the No hubo muertos button, the pertinent field is filled \n //with a 0\n if (msgText == \"No hubo muertos\") {\n report[0].response = imageReply;\n report = fillReport(\"humansDeath\", 0, report)\n\n //Otherwise if the reply is not a number asks for a number\n } else if (isNaN(msgText)) {\n report[0].response = {\n \"text\": \"Señale el numero de muertes utilizando los números del teclado\"\n };\n\n //if it is a number updates this field with the value\n } else {\n report[0].response = imageReply;\n report = fillReport(\"humansDeath\", msgText, report)\n }\n\n //returns the updated report\n return report;\n}", "title": "" }, { "docid": "2131cc098255e86db2bd638dbcdac66a", "score": "0.48456797", "text": "function relay(msg) {\n var text;\n\n // parse the msg so we can grab the \"text\" key's value -- fortunately this value is consistent across all (current) TFS messages\n try {\n text = JSON.parse(JSON.stringify(msg)).message.text; \n } \n catch(err) {\n return;\n }\n\n // send it to Slack\n requestify.post(url, { channel : channel, text : text })\n .then(function(response) {\n // get the response body but we don't really do anything with it\n response.getBody();\n });\n}", "title": "" }, { "docid": "5a4485b2f9c4eba89bd0b4f1301c768c", "score": "0.48438248", "text": "sendBotResponse(text) {\n // create a new message\n let msg = new ChatMessage(\n this.state.messages.length + 1,\n text,\n new Date(),\n BOT_USER\n );\n\n // update the db\n this.saveMessage(msg);\n\n // update the UI\n this.setState(previousState => ({\n messages: GiftedChat.append(previousState.messages, [msg.toDataObject()])\n }));\n\n // speak the text if speech mode is on\n AsyncStorageManager.getValue(\"chatMode\").then(value => {\n if (value === \"SPEECH\") {\n // speak it!\n Speech.speak(text, {\n language: \"es-ES\"\n });\n }\n });\n }", "title": "" }, { "docid": "fcfa43c2092546b7e834fa86e4ab611f", "score": "0.4840822", "text": "async postProcess () {\n\t\t// send the message to the team channel\n\t\tconst channel = 'team-' + this.team.id;\n\t\tconst message = Object.assign({}, this.responseData, { requestId: this.request.id });\n\t\ttry {\n\t\t\tawait this.api.services.broadcaster.publish(\n\t\t\t\tmessage,\n\t\t\t\tchannel,\n\t\t\t\t{ request: this }\n\t\t\t);\n\t\t}\n\t\tcatch (error) {\n\t\t\t// this doesn't break the chain, but it is unfortunate\n\t\t\tthis.warn(`Unable to publish provider host message to channel ${channel}: ${JSON.stringify(error)}`);\n\t\t}\n\t}", "title": "" }, { "docid": "a7e299fa518c51c4a96869153833d8d8", "score": "0.48408177", "text": "async cphTitleCurrentBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitleCurrent += SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendFormsFieldsOptionsTitleEdit\");\n //this.cphTitleCurrent += \" - \";\n /*\n if(this.titleCurrent)\n {\n this.cphTitleCurrent += \" - \" + this.titleCurrent;\n }\n */\n\n\n //Debug.\n //console.log(\"cphTitleCurrent=\", this.cphTitleCurrent);\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "title": "" }, { "docid": "ebdf3ee302e145b7b33b9dc140072bd1", "score": "0.48354077", "text": "function generateMessage(response){\n if (response === \"ok\") {\n appendToWordList()\n addToScore()\n return \"Nice job!\"\n }\n else if (response === \"not-on-board\") {\n return \"The word is not on the board. Try again!\"\n }\n else {\n return \"This word does not exist. Try again!\"\n }\n}", "title": "" }, { "docid": "c73c24d2327d7c5b0dc641388eed98c2", "score": "0.4833307", "text": "async logMsg(msg) {\n console.log(msg);\n this.slackMsg.push(msg);\n }", "title": "" }, { "docid": "b0b0e04b9ca59e27cd9bc0f902940db6", "score": "0.4829424", "text": "async execute(msg, client, CONFIG, npm, mmbr) {\n ////////////////////////////////////\n //We fetch the channel here\n //We can easely send with this const\n ////////////////////////////////////\n const snd = await client.channels.cache.get(msg.channel_id);\n\n ////////////////////////////////////\n //Defining the arguments here\n //Splits can happen later if needed\n ////////////////////////////////////\n const prefix = await CONFIG.PREFIX(msg.guild_id);\n const comName = module.exports.name;\n const arguments = await msg.content.slice(\n prefix.length + comName.length + 1\n );\n\n ////////////////////////////////////\n //Main command starts here\n //Comments might get smaller here\n ////////////////////////////////////\n request(\n `https://store.steampowered.com/api/storesearch/?term=${arguments}&l=english&cc=US&currency=1`,\n {\n json: true,\n },\n async (err, res, body) => {\n //if something went wrong\n if (err) return snd.send(\"An error occured!\");\n\n //redefine the first entry\n let found = body.items[0];\n\n //if err\n if (!found) return snd.send(\"Game not found!\");\n\n //Define stuff\n let gameName = found.name;\n let gameId = found.id;\n let gameThumb = found.tiny_image;\n let gameScore = found.metascore;\n let gameLinux = found.platforms.linux;\n\n //next request\n request(\n `https://www.protondb.com/api/v1/reports/summaries/${gameId}.json`,\n {\n json: true,\n },\n (err, res, body) => {\n //if something went wrong\n if (err) return snd.send(\"An error occured!\");\n\n //Embed to send\n const embed = new Discord.MessageEmbed()\n .setTitle(`${gameName} (${gameScore})`)\n .setURL(\"https://www.protondb.com/app/\" + gameId)\n .setThumbnail(gameThumb)\n .setDescription(\"Native: \" + gameLinux)\n .addField(\"Rating confidence: \", body.confidence)\n .addField(\"Tier: \", body.tier)\n .addField(\"Trending Tier: \", body.trendingTier)\n .addField(\"Best rating given\", body.bestReportedTier)\n .addField(\n \"Steam Link\",\n \"https://store.steampowered.com/app/\" + gameId\n )\n .addField(\n \"ProtonDB Link: \",\n \"https://www.protondb.com/app/\" + gameId\n )\n .setImage(gameThumb)\n .setColor(\"#RANDOM\");\n\n if (found.price) {\n if (found.price.final) {\n let price = found.price.final.toString();\n let len = price.length;\n let x =\n \"$\" + price.slice(0, len - 2) + \",\" + price.slice(len - 2);\n embed.addField(\"Price: \", x);\n }\n }\n\n snd.send({\n embed: embed,\n });\n }\n );\n }\n );\n }", "title": "" }, { "docid": "add63688fe6f6580f85fa098fa8e0a23", "score": "0.48284072", "text": "post(...args) {\n // emit to eden\n return this.eden.call('slack.post', Array.from(args), true);\n }", "title": "" }, { "docid": "c0cb8f2bc0874961cc384e83404fce05", "score": "0.48277324", "text": "formatLastSolution ( includeSlackVariables = false, mode = 0 ) {}", "title": "" } ]
ca43d1ee6fcd1f7dbafd8e2e6b22c7dc
Draw out buttons to trigger play of all clips in whole row
[ { "docid": "2b01fb581aeb8cfcc1b37c11cbccb4f9", "score": "0.56617624", "text": "function Master({ count, playRow }) {\n // console.log('REDRAW: Master');\n return (\n <>\n <Col>\n {[...jsxLoop(count, (idx) => <RowPlayButton idx={idx} playRow={playRow} />)]}\n <div className=\"volume-slider\" />\n <h6 className=\"text-center\">MASTER</h6>\n </Col>\n </>\n );\n}", "title": "" } ]
[ { "docid": "0e4dd5bca0b961215c6cb94f8f420d77", "score": "0.6559381", "text": "function drawButtons() {\n drawModifierButtons();\n drawActionButtons();\n}", "title": "" }, { "docid": "33d0efbefe222857f6d52fb1e1d2328a", "score": "0.6517396", "text": "function drawButtons(){\r\n for (var i=0; i<buttons[currentScene].length; i++){\r\n buttons[currentScene][i].checkMouseOver();\r\n buttons[currentScene][i].show();\r\n }\r\n}", "title": "" }, { "docid": "e9e41fa99dd060b28e51e080e4bcced5", "score": "0.62309825", "text": "function draw() {\n cells.forEach((button) => {\n\n button.addEventListener(\"mouseover\", () => {\n if (drawStyle === \"black\") {\n button.style.background = \"#000\";\n } else if (drawStyle === \"rainbow\") {\n button.style.background = randomRGB();\n } else if (drawStyle === \"eraser\") {\n button.style.background = \"transparent\";\n }\n });\n });\n}", "title": "" }, { "docid": "7b010946aef40e6639de53aa31ef4ff1", "score": "0.6201074", "text": "function highlightButton() {\n for(var i = 0; i < randomSequence.length; i++) {\n eachButton(i);\n }\n addButtonClass();\n playerTurn = true;\n}", "title": "" }, { "docid": "5871353168437c679c456ded0edbcf09", "score": "0.6179724", "text": "function DisplayControls() {\n\tstyle = \"Controls\";\n\n\n\tfor(var i = 0; i < buttons[controlButtons].length; i++)\n\t{\n\t\tGUI.skin=piecesSkin;\n\t\t//Debug.Log(\"controlButton: \"+controlButtons.length+ \" i \"+i);\n\t\tif(buttons[controlButtons][i].Display() && buttons[controlButtons][i].copies > 0 && gameState == GameState.idle)\n\t\t{\n\t\t\tPickUp(buttons[controlButtons][i].CopyButton());\n\t\t}\n\n\t\t//GUI.skin=mySkin;\n\t\tif(buttons[controlButtons][i].copies > 0)\n\t\tGUI.Label(Rect(Screen.width*(buttons[controlButtons][i].pos.X+40)/910,Screen.height*(buttons[controlButtons][i].pos.Y+35)/700,Screen.width*35/910,Screen.height*35/700),(buttons[controlButtons][i].copies+\" \"));\n\t}\n\tGUI.skin=mySkin;\n}", "title": "" }, { "docid": "1381aa80bc20815705861e2a0b9b73c5", "score": "0.61144024", "text": "function renderButtons() {\n \n // Deleting the buttons prior to adding new giphs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n \n // Looping through the array of giph buttons\n for (var i = 0; i < giphsArray.length; i++) {\n \n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of giph to our button\n a.addClass(\"giph\");\n // Adding a data-attribute\n a.attr(\"data-name\", giphsArray[i]);\n // Providing the initial button text\n a.text(giphsArray[i]);\n // adding css to each button\n // a.attr({\n // \"margin\": \"2px\",\n // \"background-color\": \"yellow\",\n // \"border-radius\": \"25%\"\n \n // });\n \n a.css(\"margin\", \"2px\");\n a.css(\"background-color\", \"darkturquoise\");\n a.css(\"border-radius\", \"10px\"); \n a.css(\"padding\", \"8px\"); \n a.css(\"font-size\", \"15px\"); \n a.css(\"color\", \"grey\");\n\n\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n\n // style the individual giphs by grabbing class we added to each giph\n // $(\".aroundGifs\").css(\"border-style\", \"double\");\n // $(\".aroundGifs\").css(\"margin\", \"2px\");\n // $(\".aroundGifs\").css(\"max-width\", \"600px\");\n }\n }", "title": "" }, { "docid": "61a3e78dc98927c4bfb996f638a69d42", "score": "0.60734886", "text": "function play (row, col)\n{\n\n // In play mode, toggle the button and up to four neighbors\n if (inPlayMode)\n {\n toggle(row, col);\n toggle(row+1, col);\n toggle(row-1, col);\n toggle(row, col+1);\n toggle(row, col-1);\n }\n // In setup mode, toggle just the button\n else\n {\n toggle(row, col);\n }\n}", "title": "" }, { "docid": "b66544b7a7c56887fc999882de7f36e6", "score": "0.60651785", "text": "function buttons1On() {\n btn1.hide();\n btn1 = createImg(\"assets/btn1-activePlay.png\", \"btn1\").position(width - 350, 10 + 400).mousePressed(setupGame).mouseOut(buttons1Off);\n}", "title": "" }, { "docid": "a8df5b9fa3a05c3d554d905d52011b59", "score": "0.6050675", "text": "function showButtons() {\n var buttonPlay = document.createElement('button');\n buttonPlay.innerHTML = btnPlayText;\n buttonPlay.classList.add(crslButtonPlayClass);\n buttonPlay.addEventListener('click', play);\n\n var buttonStop = document.createElement('button');\n buttonStop.innerHTML = btnStopText;\n buttonStop.classList.add(crslButtonStopClass);\n buttonStop.addEventListener('click', stop);\n\n element.appendChild(buttonPlay);\n element.appendChild(buttonStop);\n }", "title": "" }, { "docid": "ef6b0422cc38602648ec4998d989c838", "score": "0.6031312", "text": "function btnDraw() {\n for (let i = 0; i < hideWardrobeDraw.length; i++) {\n if (hideWardrobeDraw[i].style.display === \"block\") {\n hideWardrobeDraw[i].style.display = \"none\";\n } else {\n hideWardrobeDraw[i].style.display = \"block\";\n }\n }\n\n}", "title": "" }, { "docid": "a6cb002c8b7d68f5865447cade7fc002", "score": "0.60189897", "text": "function buttonUpdate() {\n if (artIsSelected) {\n currOp = artOp;\n } else if (projIsSelected){\n currOp = projOp;\n }\n\n if (musicIsSelected) {\n playButton.show();\n }\n else {\n playButton.hide();\n }\n\n if (projIsSelected && projOp == 2) {\n vansButton.show();\n }\n else {\n vansButton.hide();\n }\n\n if (isMobile) {\n op1Button.style('transform', 'skewX(200deg)');\n op2Button.style('transform', 'skewX(200deg)');\n op3Button.style('transform', 'skewX(200deg)');\n op4Button.style('transform', 'skewX(200deg)');\n } else {\n op1Button.style('transform', 'skewX('+(200-(40*(winMouseX/windowWidth)))+'deg)');\n op2Button.style('transform', 'skewX('+(200-(40*(winMouseX/windowWidth)))+'deg)');\n op3Button.style('transform', 'skewX('+(200-(40*(winMouseX/windowWidth)))+'deg)');\n op4Button.style('transform', 'skewX('+(200-(40*(winMouseX/windowWidth)))+'deg)');\n }\n\n switch (currOp) {\n case 1:\n op1Button.style('background-color',color(colorPhase,100,100,0.7));\n op2Button.style('background-color',color(colorPhase,100,100,0.4));\n op3Button.style('background-color',color(colorPhase,100,100,0.4));\n op4Button.style('background-color',color(colorPhase,100,100,0.4));\n break;\n case 2:\n op2Button.style('background-color',color(colorPhase,100,100,0.7));\n op1Button.style('background-color',color(colorPhase,100,100,0.4));\n op3Button.style('background-color',color(colorPhase,100,100,0.4));\n op4Button.style('background-color',color(colorPhase,100,100,0.4));\n break;\n case 3:\n op3Button.style('background-color',color(colorPhase,100,100,0.7));\n op2Button.style('background-color',color(colorPhase,100,100,0.4));\n op1Button.style('background-color',color(colorPhase,100,100,0.4));\n op4Button.style('background-color',color(colorPhase,100,100,0.4));\n break;\n case 4:\n op4Button.style('background-color',color(colorPhase,100,100,0.7));\n op2Button.style('background-color',color(colorPhase,100,100,0.4));\n op3Button.style('background-color',color(colorPhase,100,100,0.4));\n op1Button.style('background-color',color(colorPhase,100,100,0.4));\n break;\n default:\n }\n\n if (isSplash) {\n splashButton.position((windowWidth-splashButton.width)*0.5,\n (windowHeight*0.80)+(sin(count)*windowHeight*0.02));\n splashButton.style('border-color', col3);\n splashButton.style('color', col3);\n }\n\n shhButton.style('border-color', col3);\n if (!isMuted) {\n shhButton.style('color', col3);\n } else {\n shhButton.style('color', '#000');\n }\n if (!isMobile){\n shhButton.position((windowWidth-shhButton.width)*0.5,windowHeight-shhButton.height+2);\n }\n\n if (!artIsSelected) {\n artButton.style('color', colBorderOff);\n artButton.style('border', '2px outset');\n artButton.style('border-color', colBorderOff);\n if (isMobile){\n artButton.size(windowWidth*0.25,windowWidth*0.125);\n artButton.position(windowWidth/3.5,windowHeight/20);\n } else {\n artButton.size(windowWidth*0.1,windowWidth*0.05);\n artButton.position(windowWidth*0.1,windowHeight/10);\n }\n }\n else {\n artButton.style('color',col3);\n artButton.style('border', '3px outset');\n artButton.style('border-color', col3);\n if (isMobile){\n artButton.size(windowWidth*0.27,windowWidth*0.135);\n artButton.position(windowWidth/3.5,windowHeight/20);\n } else {\n artButton.size(windowWidth*0.105,windowWidth*0.0525);\n artButton.position(windowWidth*0.1,windowHeight*0.1+(sin(count)*windowHeight*0.01));\n }\n }\n\n if (!musicIsSelected) {\n musicButton.style('color', colBorderOff);\n musicButton.style('border', '2px outset');\n musicButton.style('border-color', colBorderOff);\n if (isMobile){\n musicButton.size(windowWidth*0.25,windowWidth*0.125);\n musicButton.position(windowWidth/1.55,windowHeight/20);\n } else {\n musicButton.size(windowWidth*0.1,windowWidth*0.05);\n musicButton.position(windowWidth*0.225,windowHeight/10);\n }\n }\n else {\n musicButton.style('border', '3px outset');\n musicButton.style('border-color', col3);\n musicButton.style('color',col3);\n if (isMobile){\n musicButton.size(windowWidth*0.27,windowWidth*0.135);\n musicButton.position(windowWidth/1.55 ,windowHeight/20);\n } else {\n musicButton.size(windowWidth*0.105,windowWidth*0.0525);\n musicButton.position(windowWidth*0.225,windowHeight*0.1+(sin(count)*windowHeight*0.01));\n }\n }\n\n if (!projIsSelected) {\n projButton.style('color', colBorderOff);\n projButton.style('border', '2px outset');\n projButton.style('border-color', colBorderOff);\n if (isMobile){\n projButton.size(windowWidth*0.25,windowWidth*0.125);\n projButton.position(windowWidth/3.5,windowHeight/20 + 20 + projButton.height);\n } else {\n projButton.size(windowWidth*0.1,windowWidth*0.05);\n projButton.position(windowWidth*0.575+(projButton.width),windowHeight/10);\n }\n }\n else {\n projButton.style('border', '3px outset');\n projButton.style('border-color', col3);\n projButton.style('color',col3);\n if (isMobile){\n projButton.size(windowWidth*0.27,windowWidth*0.135);\n projButton.position(windowWidth/3.5,windowHeight/20 + 20 + projButton.height);\n } else {\n projButton.size(windowWidth*0.105,windowWidth*0.0525);\n projButton.position(windowWidth*0.575+(projButton.width),windowHeight*0.1+(sin(count)*windowHeight*0.01));\n }\n }\n\n if (!contIsSelected) {\n contButton.style('color', colBorderOff);\n contButton.style('border', '2px outset');\n contButton.style('border-color', colBorderOff);\n if (isMobile){\n contButton.size(windowWidth*0.25,windowWidth*0.125);\n contButton.position(windowWidth/1.55,windowHeight/20 + 20 + contButton.height);\n } else {\n contButton.size(windowWidth*0.1,windowWidth*0.05);\n contButton.position(windowWidth-(artButton.x+contButton.width),windowHeight*0.1);\n }\n }\n else {\n contButton.style('border', '3px outset');\n contButton.style('border-color', col3);\n contButton.style('color',col3);\n if (isMobile){\n contButton.size(windowWidth*0.27,windowWidth*0.135);\n contButton.position(windowWidth/1.55,windowHeight/20 + 20 + contButton.height);\n } else {\n contButton.size(windowWidth*0.105,windowWidth*0.0525);\n contButton.position(windowWidth-(artButton.x+contButton.width),windowHeight*0.1+(sin(count)*windowHeight*0.01));\n }\n }\n}", "title": "" }, { "docid": "36d92f9a183788545731bd3e70969240", "score": "0.6009295", "text": "function drawBoard() {\n\n\toButton.animate({'line-height':\"50px\",height:\"50px\",width:\"50px\",fontSize:\"0.75em\",opacity:'0'},\"slow\");\n \toButton.hide(1000);\n \txButton.animate({'line-height':\"50px\",height:\"50px\",width:\"50px\",fontSize:'0.75em',opacity:'0'\t},\"slow\");\n \txButton.hide(1000);\n \tgameBoard.show(3000);\n \t\n}", "title": "" }, { "docid": "482b8ab329fd85335ecd3e6c1530ac6c", "score": "0.5991383", "text": "function showButtons() {\n var buttonPlay = document.createElement('button');\n buttonPlay.innerHTML = btnPlayText;\n buttonPlay.classList.add(genericButtonPlayClass, crslButtonPlayClass);\n buttonPlay.addEventListener('click', play);\n var buttonStop = document.createElement('button');\n buttonStop.innerHTML = btnStopText;\n buttonStop.classList.add(genericButtonStopClass, crslButtonStopClass);\n buttonStop.addEventListener('click', stop);\n element.appendChild(buttonPlay);\n element.appendChild(buttonStop);\n }", "title": "" }, { "docid": "2ccd6f2d8f7b81423424983c71b48b43", "score": "0.5987259", "text": "function setup() {\n playBtn = createButton('');\n createCanvas(10, 10);\n playBtn.style(\n 'background-image:url(assets/ui/play.png); background-position: center;background-repeat: no-repeat; background-size: 100%; border-radius: 50%; width:40px; height:40px; background-color:white'\n );\n playBtn.mouseReleased(togglePlay);\n}", "title": "" }, { "docid": "91e1b7c4710076a0a3a9a6c20fa5724f", "score": "0.5976825", "text": "#drawHueButtons() {\n if (!this.#streamDeck?.isConnected) {\n return;\n }\n if (!this.#hueLights) {\n return;\n }\n this.#drawButton(3, `light-on`);\n this.#drawButton(4, `light-off`);\n }", "title": "" }, { "docid": "451df5e94969803bad4a7cc950bfbc7c", "score": "0.5957304", "text": "function renderButtons() {\n\n\t\t// Deleting the players prior to adding new players\n\t\t// (this is necessary otherwise we will have repeat buttons)\n\t\t$(\"#buttons-view\").empty();\n\n\t\t// Looping through the array of players\n\t\tfor (var i = 0; i < players.length; i++) {\n\n\t\t\t// Then dynamicaly generating buttons for each player in the array\n\t\t\t// This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n\t\t\tvar a = $(\"<button>\");\n\t\t\t// Adding a class of player to our button\n\t\t\ta.addClass(\"player\");\n\t\t\t// Adding a data-attribute\n\t\t\ta.attr(\"data-name\", players[i]);\n\t\t\t// Adding a data-attribute to determine whether image is still or animated\n\t\t\ta.attr(\"data-state\", \"still\");\n\t\t\t// Providing the initial button text\n\t\t\ta.text(players[i]);\n\t\t\t// Adding the button to the HTML\n\t\t\t$(\"#buttons-view\").append(a);\n\t\t}\n\t}", "title": "" }, { "docid": "a443fa6d86bc09c4d939dfda33126144", "score": "0.59312844", "text": "showPuissance4 (){\r\n const divGame = document.querySelector(\"#game\");\r\n divGame.innerHTML = \"\";\r\n\r\n let content = \"<table class='text-center'>\";\r\n content += \"<tr>\";\r\n // a factoriser\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(1)\">▼</button></td>';\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(2)\">▼</button></td>';\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(3)\">▼</button></td>';\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(4)\">▼</button></td>';\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(5)\">▼</button></td>';\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(6)\">▼</button></td>';\r\n content += '<td><button type=\"button\" class=\"btn btn-outline-secondary\" onClick=\"play(7)\">▼</button></td>';\r\n content += \"</tr>\";\r\n for (i = 0; i < this.countLine; i++){\r\n content += \"<tr>\"; \r\n for (j = 0; j < this.countColumn; j++){\r\n let background = \"\";\r\n if (this.gridPuissance4[i][j] === 0) {\r\n background += \"\";\r\n } else if (this.gridPuissance4[i][j] === 1) {\r\n background += \"bg-danger rounded-circle\";\r\n } else if (this.gridPuissance4[i][j] === 2) {\r\n background += \"bg-primary rounded-circle\";\r\n }\r\n content += `<td class=\"${background} text-center border\" style=\"width:50px;height:50px\">`;\r\n \r\n content += \"</td>\";\r\n }\r\n content += \"</tr>\";\r\n }\r\n content += \"</table>\";\r\n divGame.innerHTML = content;\r\n }", "title": "" }, { "docid": "6ac5efabc5bf17603c4947b3a07242eb", "score": "0.5931169", "text": "init() {\n\t\tlet brd = document.getElementById('board');\n\t\t// populate the board with buttons\n\t\tfor (let i = 0; i < SIDE; ++i) {\n\t\t\tlet row = document.createElement('div');\n\t\t\trow.classList.add('row');\n\t\t\tfor (let j = 0; j < SIDE; ++j) {\n\t\t\t\tlet btn = document.createElement('button');\n\t\t\t\tbtn.appendChild(document.createTextNode(' '));\n\t\t\t\tbtn.classList.add(`wave-${j+i+1}`, 'blank', 'idle');\n\t\t\t\tbtn.dataset.x = i;\n\t\t\t\tbtn.dataset.y = j;\n\t\t\t\tbtn.addEventListener('click', (e) => {\n\t\t\t\t\tthis.btn_click.call(this, e);\n\t\t\t\t});\n\t\t\t\trow.appendChild(btn);\n\t\t\t}\n\t\t\tbrd.appendChild(row);\n\t\t}\n\t}", "title": "" }, { "docid": "b9a105bac8b6cc587aa7699431271097", "score": "0.5914373", "text": "function drawButtons(){\n\t\n\t\tif(app.main.gameState == 1){\n\t\t\tdocument.getElementById('main').style.display = \"block\";\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "33e914d6e2ea90435abed36efefff137", "score": "0.5909175", "text": "function createButtons() {\n // When the A button is pressed, add the current frame\n // from the video with a label of \"rock\" to the classifier\n buttonLike = select(\"#addClassLike\");\n buttonLike.mousePressed(function () {\n let like = setInterval(() => {\n addExample(\"Like\");\n }, 300);\n buttonLike.mouseReleased(() => clearInterval(like));\n });\n buttonLike.touchStarted(function () {\n let like = setInterval(() => {\n addExample(\"Like\");\n }, 300);\n buttonLike.touchEnded(() => clearInterval(like));\n });\n\n buttonNoLike = select(\"#addClassNoLike\");\n buttonNoLike.mousePressed(function () {\n let like = setInterval(() => {\n addExample(\"NoLike\");\n }, 300);\n buttonNoLike.mouseReleased(() => clearInterval(like));\n });\n\n buttonNoLike.touchStarted(function () {\n let like = setInterval(() => {\n addExample(\"NoLike\");\n }, 300);\n buttonNoLike.touchEnded(() => clearInterval(like));\n });\n\n buttonClearAll = select(\"#clearAll\");\n buttonClearAll.mousePressed(clearAllLabels);\n}", "title": "" }, { "docid": "31351e133cbc4f81690c6b88fade44d9", "score": "0.59013265", "text": "initButtonsEvents(){\n let buttons = document.querySelectorAll('#buttons g, #parts g');\n\n buttons.forEach( btn => {\n\n // the method \"addEventListener\" only support 1 interaction, in this occasion we do a new method called \"addEventListenerAll\" to work with others occasions, making this function more versatile\n this.addEventListenerAll(btn, 'click drag', evenFnc => {\n\n let textBtn = btn.className.baseVal.replace('btn-','');\n this.execBtn(textBtn);\n })\n\n // This function change the mouse style \n this.addEventListenerAll(btn, 'mouseover mouseup mousedown', evenFnc => {\n\n btn.style.cursor = 'pointer';\n })\n })\n }", "title": "" }, { "docid": "e847cb4cdd9be316f56e4ed063e9acda", "score": "0.5899416", "text": "function selection(){\n container.removeChild(round);\n container.appendChild(rockbutton);\n container.appendChild(paperbutton);\n container.appendChild(scissorsbutton);\n rockbutton.style.marginLeft=\"0px\";\n paperbutton.style.marginLeft=\"70px\";\n scissorsbutton.style.marginLeft=\"70px\";\n \n }", "title": "" }, { "docid": "787ff72f3ed434fc50c0b00505f2d5f1", "score": "0.58959", "text": "controlPlayRate() {\n Utility.addClass('YangPlayer-opacity-1', this.rateBtn.children[1]);\n\n for(let i = 0; i < this.rateBtn.children.length; i++) {\n this.rateBtn.children[i].onclick = () => {\n for(let j = 0; j < this.rateBtn.children.length; j++) {\n if(Utility.hasClass('YangPlayer-opacity-1', this.rateBtn.children[j])) {\n Utility.removeClass('YangPlayer-opacity-1', this.rateBtn.children[j]);\n Utility.addClass('YangPlayer-opacity-1', this.rateBtn.children[i]);\n this.setPlayRate(this.rate[i]);\n\n break;\n }\n }\n };\n }\n }", "title": "" }, { "docid": "da56d7fba539edf09c8adb537f47ca64", "score": "0.5883707", "text": "playAllClips() {\n if (this.clips && this.clips.length) {\n this.clips.forEach((clip) => {\n this.state.actionStates[clip.name] = true;\n var action = this.mixer.clipAction(clip);\n action.setEffectiveTimeScale(1);\n action.reset();\n console.log(\"playing clip: \" + clip.name);\n action.play();\n });\n }\n }", "title": "" }, { "docid": "c2edb5943c1264c4b640ee535108b899", "score": "0.5882351", "text": "function statePlayerDraw() {\r\n disableButtons(true, false, true, true); \r\n}", "title": "" }, { "docid": "d958472707f15838969e0acbdd905264", "score": "0.5861944", "text": "function startButtons(){\n\t\tenableButton($bet);\n\t\tdisableButton($deal);\n\t\tdisableButton($hit);\n\t\tdisableButton($stand);\n\t\tenableButton($cash);\n\t}", "title": "" }, { "docid": "7974bc296cfe40726e63a959a377c573", "score": "0.5861386", "text": "render() {\n for (let b of this.btns) {\n b.render();\n }\n }", "title": "" }, { "docid": "1090d3c57b4c7712f17b7b0e5b47c770", "score": "0.5858843", "text": "function prepareAllButtons() {\n\t\t\tvar lastX = 0; var lastY = 0; var t; var button;\n\t\t\tfor (i=0; i<buttons.length; i++) {\n\t\t\t\tbutton = buttons[i];\n\t\t\t\tbutton.znum = i;\n\t\t\t\tbutton.selectedIndex = i;\n\t\t\t\tif (button.selectedIndex == myIndex && currentSelected) {\n\t\t\t\t\tbutton.backgroundColor = selectedBackgroundColor;\n\t\t\t\t\tbutton.rollBackgroundColor = selectedRollBackgroundColor;\n\t\t\t\t\tbutton.color = selectedColor;\n\t\t\t\t}\n\t\t\t\tif (labels[i]) labels[i].znum = i;\n\t\t\t\tthat.addChild(button);\n\t\t\t\tif (!vertical || specifiedWidth) {\n\t\t\t\t\tbutton.x = (width-button.width)/2;\n\t\t\t\t\tbutton.y = (height-button.height)/2;\n\t\t\t\t}\n\t\t\t\tif (vertical) {\n\t\t\t\t\tbutton.y = lastY;\n\t\t\t\t\tlastY = button.y + button.height + spacing;\n\t\t\t\t\t// if (align==\"left\") button.x = ((button.type==\"TabsButton\" || !mix)?0:indent) + (button.regX - (button.getBounds()?button.getBounds().x:0))*button.scaleX;\n\t\t\t\t\t// else if (align==\"right\") button.x = (specifiedWidth?width:hMaxWidth)-button.width-((button.type==\"TabsButton\" || !mix)?0:indent);\n\t\t\t\t\tif (align==\"left\") button.x = ((button.type==\"TabsButton\" || button.type==\"ListItem\")?0:indent) + (button.regX - (button.getBounds()?button.getBounds().x:0))*button.scaleX;\n\t\t\t\t\telse if (align==\"right\") button.x = (specifiedWidth?width:hMaxWidth)-button.width-((button.type==\"TabsButton\" || button.type==\"ListItem\")?0:indent);\n\t\t\t\t} else {\n\t\t\t\t\tbutton.x = lastX;\n\t\t\t\t\tlastX = button.x + button.width + spacing;\n\t\t\t\t\tif (valign==\"top\") button.y = (button.type==\"TabsButton\" && !mix?0:indent) + (button.regY - (button.getBounds()?button.getBounds().y:0))*button.scaleY;\n\t\t\t\t\telse if (valign==\"bottom\") button.y = height-button.height-(button.type==\"TabsButton\" && !mix?0:indent);\n\t\t\t\t}\n\t\t\t\tif (i==0 && !currentEnabled) button.enabled = false;\n\t\t\t\tbutton.enabled = true;\n\t\t\t}\n\n\t\t\t// might have to use w and h rather than width and height if run multiple times...\n\t\t\tif (!zot(backdropColor)) {\n\t\t\t\tthat.removeChild(backdrop);\n\t\t\t}\n\n\t\t\tthat._bounds = null; // for old version of CreateJS including Animate's\n\t\t\t// that.setBounds();\n\t\t\tvar bou = that.getBounds();\n\n\t\t\tif (!bou && createjs.EaselJS.version[0] != 0) {\n\t\t\t\tw = h = 0;\n\t\t\t\tthat.setBounds();\n\t\t\t} else {\n\t\t\t\tif (bou) {\n\t\t\t\t\tw = vertical&&bou.width!=0&&specifiedWidth?width:bou.width;\n\t\t\t\t\th = vertical&&bou.height!=0?bou.height:height;\n\t\t\t\t\tthat.setBounds(w,h);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!zot(backdropColor)) {\n\t\t\t\tbackdrop.widthOnly = w;\n\t\t\t\tbackdrop.heightOnly = h;\n\t\t\t\tthat.addChildAt(backdrop,0);\n\t\t\t}\n\n\t\t\tif (vertical && !specifiedWidth) {\n\t\t\t\tfor (i=0; i<=buttons.length; i++) {\n\t\t\t\t\tif (align==\"center\" || align==\"middle\") button.x = (w-button.width)/2;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "30a620a046126974d7e84b5e8fa3b537", "score": "0.5850879", "text": "setup() {\n this.buttonGrid = [];\n for (let i = 0; i < this.rows; i++) {\n let buttonRow = []\n for (let j = 0; j < this.cols; j++) {\n if (j == this.safe[0] && i == this.safe[1]) {\n buttonRow.push(createButton(\"S\"));\n buttonRow[j].style('background-color', 'lime');\n } else {\n buttonRow.push(createButton(\" \"));\n buttonRow[j].style('background-color', 'gray');\n }\n buttonRow[j].position(offset + j * spacing, offset + i * spacing)\n buttonRow[j].size(spacing, spacing);\n buttonRow[j].style('font-size', '18px')\n buttonRow[j].mouseClicked(function() {\n if (board.isActive) {\n board.mine(j, i);\n }\n });\n\n }\n this.buttonGrid.push(buttonRow);\n }\n\n this.resetButton.position(this.cols * spacing + tableSpacingFactor * offset * 2.6, this.rows / 2 * spacing + spacing * 8);\n this.resetButton.style('font-size', '18px');\n this.resetButton.style('background-color', 'LightSteelBlue');\n this.resetButton.mouseClicked(function() {\n reset();\n });\n }", "title": "" }, { "docid": "298b46bf1950e352e4304e99e49d541a", "score": "0.58353114", "text": "function victory(direction, i) {\n if (direction === \"row\") {\n cells[i].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[i + 1].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[i + 2].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\";\n replay(\"Victoire de \" + morpion.actualPlayer.name);\n }\n else if (direction === \"column\") {\n cells[i].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[i + 3].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[i + 6].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\";\n replay(\"Victoire de \" + morpion.actualPlayer.name);\n }\n else if (direction === \"diagonal1\") {\n cells[0].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[4].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[8].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\";\n replay(\"Victoire de \" + morpion.actualPlayer.name);\n }\n else if (direction === \"diagonal2\") {\n cells[6].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[4].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\"; cells[2].style.backdropFilter = \"saturate(600%) hue-rotate(165deg)\";\n replay(\"Victoire de \" + morpion.actualPlayer.name);\n }\n if (morpion.actualPlayer === morpion.player1) {\n morpion.player1.score++;\n document.querySelector(\"#p1 .score\").innerHTML = \"Score : \" + morpion.player1.score;\n document.querySelector(\"#p1\").style.background = \"red\";\n document.querySelector(\"#p1\").style.color = \"white\";\n }\n else {\n morpion.player2.score++;\n document.querySelector(\"#p2 .score\").innerHTML = \"Score : \" + morpion.player2.score;\n document.querySelector(\"#p2\").style.background = \"red\";\n document.querySelector(\"#p2\").style.color = \"white\";\n }\n\n}", "title": "" }, { "docid": "6c80517b913ace06058aff41441263df", "score": "0.58267033", "text": "function cycleButtons() {\n if (computer === true) {\n $(\"#TL\").css(\"pointer-events\", \"auto\")\n\n $(\"#TR\").css(\"pointer-events\", \"auto\")\n\n $(\"#BL\").css(\"pointer-events\", \"auto\")\n\n $(\"#BR\").css(\"pointer-events\", \"auto\")\n computer = false;\n } else if (computer === false) {\n $(\"#TL\").css(\"pointer-events\", \"none\")\n\n $(\"#TR\").css(\"pointer-events\", \"none\")\n\n $(\"#BL\").css(\"pointer-events\", \"none\")\n\n $(\"#BR\").css(\"pointer-events\", \"none\")\n computer = true;\n }\n}", "title": "" }, { "docid": "f813fbd031897ff739d6b9909a2b1067", "score": "0.5822967", "text": "function buttonSetup() {\n playButton = new Button(width/2, height/4, 300, 200, \"Play\", 40, \"white\", blueButtonClicked, blueButton);\n optionsButton = new Button(width/2, height/2, 250, 150, \"Options\", 30, \"white\", blueButtonClicked, blueButton);\n quitButton = new Button(width/2, height * (14/20), 200, 100, \"Quit\", 30, \"white\", blueButtonClicked, blueButton);\n instructionsButton = new Button(width/2, height * (2/5) - 50, 250, 150, \"Instructions\", 30, \"white\", blueButtonClicked, blueButton);\n soundOptionButton = new Button(width/2, height * (3/5) + 50, 250, 150, \"Toggle Sound\", 30, \"white\", blueButtonClicked, blueButton);\n backOptionButton = new Button(width - 75, 75, 150, 150, \"Back\", 30, \"black\", yellowSmallButtonClicked, yellowSmallButton);\n backPlayButton = new Button(75, 75, 150, 150, \"Back\", 30, \"black\", yellowSmallButtonClicked, yellowSmallButton);\n endTurnButton = new Button(width - 100, width * (1/4), 200, 100, \"End Turn\", 25, \"white\", yellowButtonClicked, yellowButton);\n continueButtonYes = new Button(width/2 - 150, height/2 + 100, 200, 100, \"Yes\", 25, \"white\", greenButtonClicked, greenButton);\n continueButtonNo = new Button(width/2 + 150, height/2 + 100, 200, 100, \"No\", 25, \"white\", greenButtonClicked, greenButton);\n}", "title": "" }, { "docid": "d0c8fee47760a923fd0073939350e7a0", "score": "0.58107567", "text": "function generateBoard() {\n // Create Graphics object\n var line = new PIXI.Graphics();\n // Draw:\n for (var i = 0; i < 8; i++) {\n line.beginFill(0xaebaba);\n line.drawRect(i*74, 84, 10, 454);\n line.endFill();\n }\n line.beginFill(0xaebaba);\n line.drawRect(0, 84, 528, 10);\n line.endFill();\n for (var i = 1; i < 7; i++) {\n line.beginFill(0xaebaba);\n line.drawRect(0, 84+i*74, 528, 10);\n line.endFill();\n }\n stage.addChild(line);\n\n column_1 = new PIXI.Text('one', {fontFamily: 'Arial', fontSize: 32, fill: 0xaebaba});\n column_1.x = 10;\n column_1.y = 540;\n column_1.interactive = true;\n column_1.buttonMode = true;\n column_2 = new PIXI.Text('two', {fontFamily: 'Arial', fontSize: 32, fill: 0xaebaba});\n column_2.x = 84;\n column_2.y = 540;\n column_2.interactive = true;\n column_2.buttonMode = true;\n column_3 = new PIXI.Text('three', {fontFamily: 'Arial', fontSize: 32, fill: 0xaebaba});\n column_3.x = 152;\n column_3.y = 540;\n column_3.interactive = true;\n column_3.buttonMode = true;\n column_4 = new PIXI.Text('four', {fontFamily: 'Arial', fontSize: 32, fill: 0xaebaba});\n column_4.x = 238;\n column_4.y = 540;\n column_4.interactive = true;\n column_4.buttonMode = true;\n column_5 = new PIXI.Text('five', {fontFamily: 'Arial', fontSize: 32, fill: 0xaebaba});\n column_5.x = 312;\n column_5.y = 540;\n column_5.interactive = true;\n column_5.buttonMode = true;\n column_6 = new PIXI.Text('six', {fontFamily: 'Arial', fontSize: 32, fill: 0xaebaba});\n column_6.x = 385;\n column_6.y = 540;\n column_6.interactive = true;\n column_6.buttonMode = true;\n column_7 = new PIXI.Text('seven', {fontFamily: 'Arial', fontSize: 30, fill: 0xaebaba});\n column_7.x = 445;\n column_7.y = 540;\n column_7.interactive = true;\n column_7.buttonMode = true;\n\n title_1 = new PIXI.Text('Connect', {fontFamily: 'Arial', fontSize: 40, fill: 0xaebaba});\n title_1.x = 540;\n title_1.y = 90;\n stage.addChild(title_1);\n title_2 = new PIXI.Text('4', {fontFamily: 'Arial', fontSize: 100, fill: 0xf7dc6f });\n title_2.x = 585;\n title_2.y = 130;\n stage.addChild(title_2);\n title_3 = new PIXI.Text('by Jaehyun Chung', {fontFamily: 'Arial', fontSize: 18, fill: 0xaebaba });\n title_3.x = 540;\n title_3.y = 250;\n stage.addChild(title_3);\n instructions = new PIXI.Text('Instructions:', {fontFamily: 'Arial', fontSize: 18, fill: 0xaebaba });\n instructions.x = 540;\n instructions.y = 430;\n stage.addChild(instructions);\n instructions_1 = new PIXI.Text('Click a number in', {fontFamily: 'Arial', fontSize: 18, fill: 0xaebaba });\n instructions_1.x = 540;\n instructions_1.y = 460;\n stage.addChild(instructions_1);\n instructions_2 = new PIXI.Text('the bottom row, to', {fontFamily: 'Arial', fontSize: 18, fill: 0xaebaba });\n instructions_2.x = 540;\n instructions_2.y = 480;\n stage.addChild(instructions_2);\n instructions_3 = new PIXI.Text('drop a coin!', {fontFamily: 'Arial', fontSize: 18, fill: 0xaebaba });\n instructions_3.x = 540;\n instructions_3.y = 500;\n stage.addChild(instructions_3);\n\n stage.addChild(column_1);\n stage.addChild(column_2);\n stage.addChild(column_3);\n stage.addChild(column_4);\n stage.addChild(column_5);\n stage.addChild(column_6);\n stage.addChild(column_7);\n}", "title": "" }, { "docid": "61824803ca5716b24edadcc99746492d", "score": "0.58106256", "text": "function buildButtons() {\n\n}", "title": "" }, { "docid": "2ba723a55ca797aa25244bea3222f865", "score": "0.5810531", "text": "function RedrawBoard()\n{\n\t// These are the command buttons on the left hand side\n\tnoStroke();\n\tfill(palette(3));\n\trect(11, 54, 16, 11);\n\trect(11, 94, 16, 10);\n\trect(11, 134, 16, 10);\n\n\ttextSize(5);\n\ttextAlign(CENTER, CENTER);\n\tfill(palette(11));\n\ttext(\"Q\", 11+16/2, 54+11/2);\n\ttext(\"R\", 11+16/2, 94+10/2);\n\ttext(\"L\", 11+16/2, 134+10/2);\n\n\tfor(px = 1 ; px <= 9 ; px++)\n\t\tfor(py = 1 ; py <= 9 ; py++)\n\t\t\tEraseSquare();\n\n\tfor(px=1 ; px <= 9 ; px++)\n\t{\n\t\tfor(py=1 ; py <= 9 ; py++)\n\t\t{\n\t\t\tif (piece[px][py] > 0)\n\t\t\t\tPutShape();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3a3a1bcb75e7a1148d9d5faff553eb68", "score": "0.58057195", "text": "function updatePlayerButtons() {\n\n // If counter is set below or equal to zero\n if (counter == 0) {\n // Disable previous button\n $btnPrev.addClass('player-btn-disabled');\n\n // If the size of the content array is only 1\n if (contentArray.length == 1) {\n\n // Disable the next button as well\n $btnNext.addClass('player-btn-disabled');\n }\n }\n\n // If counter is equal to the size of contentArray array\n else if (counter == contentArray.length - 1) {\n $btnNext.addClass('player-btn-disabled');\n\n }\n // Enable all buttons\n else {\n $btnPrev.removeClass('player-btn-disabled');\n $btnNext.removeClass('player-btn-disabled');\n }\n }", "title": "" }, { "docid": "6c915533f0525d1734b74693a2fe063f", "score": "0.5803177", "text": "_createPlayButton() {\n /* Used to create a play button, it modifies the default button property in button.css */\n\n var $Button = $(\"<div>\", {\n class: \"play-button paused\"\n });\n var $left = $(\"<div>\", {\n class: \"left\"\n });\n var $right = $(\"<div>\", {\n class: \"right\"\n });\n var $triangle1 = $(\"<div>\", {\n class: \"triangle-1\"\n });\n var $triangle2 = $(\"<div>\", {\n class: \"triangle-2\"\n });\n\n $(this._divID).prepend($Button);\n\n $Button.append($left);\n $Button.append($right);\n $Button.append($triangle1);\n $Button.append($triangle2);\n\n // Update button dimension first\n let resizedButton = Array.min([this.config.transform.height, this.config.transform.width]) / 10.0 * this.config.autoPlay.button.dim;\n let maxButtonSize = 35.0; // The max button size is 40px so that buttons won't get too big\n this.config.autoPlay.button.dim = (resizedButton > maxButtonSize) ? maxButtonSize : resizedButton;\n\n $(this._divID + \" .play-button\").css(\"height\", this.config.autoPlay.button.dim + \"px\")\n .css(\"width\", this.config.autoPlay.button.dim + \"px\");\n\n $(this._divID + \" .triangle-1\").css(\"border-right-width\", this.config.autoPlay.button.dim + \"px\")\n .css(\"border-top-width\", this.config.autoPlay.button.dim / 2.0 + \"px\")\n .css(\"border-bottom-width\", this.config.autoPlay.button.dim / 2.0 + \"px\");\n\n $(this._divID + \" .triangle-2\").css(\"border-right-width\", this.config.autoPlay.button.dim + \"px\")\n .css(\"border-top-width\", this.config.autoPlay.button.dim / 1.9 + \"px\")\n .css(\"border-bottom-width\", this.config.autoPlay.button.dim / 2.0 + \"px\");\n\n $(this._divID + \" .left\").css(\"background-color\", this.config.autoPlay.button.color);\n $(this._divID + \" .right\").css(\"background-color\", this.config.autoPlay.button.color);\n\n let _pgm = this;\n $(this._divID + \" .play-button\").click(function() {\n $(this).toggleClass(\"paused\");\n if (_pgm.config.autoPlay.on) {\n _pgm._stopAutoPlay();\n } else {\n _pgm._startAutoPlay();\n }\n });\n }", "title": "" }, { "docid": "6f2cfa874cf0966fb92b4e4b71a44133", "score": "0.5799194", "text": "cauroselBtn(){\n var counter = this.counter;\n var frame = this.swipperFrame;\n var itemsWidth = this.itemsWidth;\n $.each(this.caurosel, function(index, current){\n $.each($(this).children(), function(C_index, C_current){\n $(C_current).click(function(){\n $(current).children().removeClass(\"active\");\n $(this).addClass(\"active\");\n counter = C_index;\n if(counter < 0){\n counter = 0;\n }\n $(frame).css({\n transform: \"translateX(\"+(-itemsWidth * counter)+\"px)\",\n transition: \"all 0.3s ease\"\n });\n });\n });\n });\n }", "title": "" }, { "docid": "9cfa388c2b16937ac5a735de6d84b6f7", "score": "0.5791871", "text": "function SamplerDisplay(x, y, w, h) {\n\n this.x = x;\n this.y = y;\n this.width = w;\n this.height = h;\n\n this.setupDisplay = function() {\n //Samples//\n for(var i=0; i<=rows; i++) {\n samples[i] = [];\n for(var j=0; j<cols; j++) { //2D array of SamplerButton objects//\n samples[i][j] = new SamplerButton(this.x +10 + i*200, this.y + 50 + j*80, 150, 50, tracks[((i+1) + (j+1) * 4) - 5], str(tracks[((i+1) + (j+1) * 4) - 5]).replace('assets/sounds/', '').replace('.wav', '')); //string manipulation to remove path from track name//\n }\n }\n\n //EffectBtns//\n for(var i=0; i<rows; i++) {\n effectBtns[i] = [];\n for(var j=0; j<cols; j++) { //2D array of SamplerEffectButton objects//\n effectBtns[i][j] = new SamplerEffectButton(this.x + 160 + i*200, this.y + 50 + j*80, 20, 50, ((i+1) + (j+1) * 4) - 4);\n }\n }\n\n\n //Buttons//\n resetBtn = new CustomButton(this.x+this.width - 70,this.y + 5, 60,30, \"Reset\");\n clearBtn = new CustomButton(this.x+this.width - 130,this.y + 5, 60,30, \"Clear FX\");\n strobeBtn = new CustomButton(this.x + 10,this.y + 5, 60,30, \"Strobe\");\n sineInstrumentButton = new InstrumentButton(width/2-180,this.y + 5, 60,30, \"SineX\");\n triangleInstrumentButton = new InstrumentButton(width/2-110,this.y + 5, 60,30, \"TriangleY\");\n sawInstrumentButton = new InstrumentButton(width/2+50, this.y + 5, 60, 30, \"SawX\");\n squareInstrumentButton = new InstrumentButton(width/2+120, this.y + 5, 60, 30, \"SquareY\");\n mainMenuButton = new MainMenuButton(width/2-25, height/2-1, 50, 50, \"assets/images/logo.png\");\n }\n\n this.outlinedisplay = function() {\n fill(255);\n noStroke();\n rect(this.x, this.y, this.width, this.height);\n }\n\n this.sampleDisplay = function() {\n for(var i=0; i<rows; i++) {\n for(var j=0; j<cols; j++) {\n samples[i][j].display();\n samples[i][j].play();\n }\n }\n }\n\n this.effectBtnDisplay = function() {\n for(var i=0; i<rows; i++) {\n for(var j=0; j<cols; j++) {\n effectBtns[i][j].display();\n }\n }\n }\n\n}", "title": "" }, { "docid": "d107f0efdc219670cc72ea4151eb6443", "score": "0.5788888", "text": "function drawButtons() {\n\n scheduledButton = createButton('Scheduled');\n departureButton = createButton('Departures');\n arrivalButton = createButton('Arrivals');\n\n scheduledButton.position (width - 500, height-200);\n departureButton.position (width - 300, height-200);\n arrivalButton.position (width - 100, height-200);\n\n scheduledButton.mousePressed(scheduledState);\n departureButton.mousePressed(departureState);\n arrivalButton.mousePressed(arrivalState);\n}", "title": "" }, { "docid": "9104c61cce2e42a2e044ed7d8b6f3516", "score": "0.57870734", "text": "initButtonsEvents(){\n\n // Select all the buttons and parts from the DOM\n let buttons = document.querySelectorAll(\"#buttons > g, #parts > g\");\n\n //For each buttons adds a click event\n buttons.forEach((btn, index) => {\n this.addEventListenerAll(btn, 'click drag', e => {\n // store the button class name\n let textBtn = btn.className.baseVal.replace(\"btn-\",\"\");\n\n //\n this.execBtn(textBtn);\n\n });\n\n //Change the cursor to a hand\n this.addEventListenerAll(btn, \"mouseover mouseup mousedown\", e => {\n btn.style.cursor = \"pointer\";\n });\n });\n }", "title": "" }, { "docid": "5edd75cb7789c5c881fa718bb5eb403b", "score": "0.5785322", "text": "function drawHabitButtons(habit, i){ \n $(\"#habitButtons\").prepend('<div class=\"btn-div\"><button type=\"button\" class=\"btn hbtn btn-habit c'+habit.k+'\" id=\"h'+i+'\">'+habit.s+'</button><div class=\"stk-rank\" id=\"h'+i+'-rank\"></div></div>');\n }", "title": "" }, { "docid": "dc309d65b1116a918980ea7e7d9645e5", "score": "0.5772212", "text": "function drawModifierButtons() {\n const targetDiv = document.querySelector(\".main-control\");\n const template = `\n <button class=\"modifier handicap btn btn-sm btn-outline-danger\">HANDICAP</button>\n <button class=\"modifier clouds btn btn-sm btn-outline-danger\">CLOUDS</button>\n <button class=\"modifier moonlight btn btn-sm btn-outline-danger\">MOONLIGHT</button>\n `;\n\n rowDiv = document.createElement(\"div\");\n rowDiv.className = \"row\";\n targetDiv.insertAdjacentElement('afterbegin', rowDiv);\n\n buttonsDiv = document.createElement(\"div\");\n buttonsDiv.className = \"modifier-buttons col-12 col-md-6 text-center\";\n rowDiv.insertAdjacentElement('afterbegin', buttonsDiv);\n \n buttonsDiv.innerHTML = template;\n}", "title": "" }, { "docid": "759a96a6f808f966a32abd0daf68e8a4", "score": "0.57687694", "text": "initControls() {\n const cvs = this.cvs;\n const ctx = this.ctx;\n const mode_names = [ 'draw', 'edit' ];\n const brush = ( x, y ) => {\n ctx.beginPath();\n ctx.arc( x, y, stroke / 2, 0, AV.RADIAN );\n ctx.fill();\n };\n const drawIcon = () => {\n const $cvs = $( this.cvs_saved );\n $cvs.css( {\n 'height': $cvs.height(),\n 'width': $cvs.height() * aspect\n } );\n this.cvs_saved.width = $cvs.width();\n this.cvs_saved.height = $cvs.height();\n this.ctx_saved.strokeStyle = 'black';\n this.ctx_saved.lineCap = 'round';\n this.ctx_saved.lineJoin = 'round';\n this.ctx_saved.lineWidth = 1;\n this.lexicon[ index ].draw( this.ctx_saved );\n };\n const draw = () => {\n click_radius = Math.max( 20, stroke );\n\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n switch ( mode ) {\n case 'draw':\n ctx.fillStyle = 'black';\n ctx.strokeStyle = 'black';\n ctx.lineWidth = stroke;\n this.active_word.draw( ctx );\n break;\n case 'edit':\n ctx.fillStyle = 'lightgrey';\n ctx.fillRect( 0, 0, width, height );\n ctx.fillStyle = 'white';\n ctx.fillRect( 0.125 * width, 0.125 * height, 0.75 * width, 0.75 * height );\n\n if ( snapping || shift_key ) {\n ctx.strokeStyle = 'lightgrey';\n ctx.lineWidth = 1;\n const dx = 0.75 * width / ( snap_rows - 1 );\n const dy = 0.75 * height / ( snap_cols - 1 );\n for ( let y = 0; y < snap_cols - 1; ++y ) {\n ctx.beginPath();\n ctx.moveTo( 0.125 * width, y * dy + 0.125 * height );\n ctx.lineTo( 0.875 * width, y * dy + 0.125 * height );\n ctx.closePath();\n ctx.stroke();\n }\n for ( let x = 0; x < snap_rows - 1; ++x ) {\n ctx.beginPath();\n ctx.moveTo( x * dx + 0.125 * width, 0.125 * height );\n ctx.lineTo( x * dx + 0.125 * width, 0.875 * height );\n ctx.closePath();\n ctx.stroke();\n }\n }\n\n ctx.strokeStyle = 'black';\n ctx.lineWidth = stroke;\n this.active_word.draw( ctx, true );\n\n ctx.lineWidth = click_radius;\n ctx.strokeStyle = 'red';\n this.active_word.iterate( ( point ) => {\n ctx.beginPath();\n ctx.arc( point.x * width, point.y * height, 1, 0, AV.RADIAN );\n ctx.closePath();\n ctx.stroke();\n } );\n break;\n }\n };\n\n this.history.onChange = ( strokes ) => {\n this.active_word.strokes = this.clone( strokes );\n points = [];\n draw();\n };\n\n var width = cvs.width,\n height = cvs.height,\n stroke = 20,\n click_radius = 20,\n reduction = 0.02,\n index = 0,\n snapping = true,\n snap_cols = 3,\n snap_rows = 3,\n aspect = 1,\n mode = mode_names[ 0 ],\n drawing, dragging, shift_key,\n points = [];\n\n this.active_word.strokes = this.clone( this.lexicon[ index ].strokes );\n drawIcon();\n\n $( cvs ).on( 'mousedown', ( event ) => {\n points = [];\n var x = event.offsetX,\n y = event.offsetY,\n dist;\n switch ( mode ) {\n case 'draw':\n drawing = true;\n brush( x, y );\n points.push( { x: x / width, y: y / height } );\n break;\n case 'edit':\n this.active_word.iterate( ( point, index, stroke, index_stroke ) => {\n if ( dragging ) return;\n dist = AV.dist( x, y, point.x * width, point.y * height );\n if ( dist <= click_radius ) {\n dragging = point;\n points = this.clone( stroke );\n editing_index = index_stroke;\n }\n } );\n break;\n }\n } ).on( 'mousemove mouseover', ( event ) => {\n var x = event.offsetX,\n y = event.offsetY,\n diff;\n switch ( mode ) {\n case 'draw':\n if ( !drawing ) return;\n brush( x, y );\n points.push( { x: x / width, y: y / height } );\n break;\n case 'edit':\n if ( !dragging ) return;\n dragging.x = x / width;\n dragging.y = y / height;\n if ( snapping === !shift_key ) {\n diff = Infinity;\n for ( let ix = 0; ix < snap_cols; ++ix ) {\n const px = AV.map( ix, 0, snap_cols - 1, width * 0.125, width * 0.875 );\n const dx = Math.abs( x - px );\n if ( dx < diff ) {\n diff = dx;\n dragging.x = px / width;\n }\n }\n diff = Infinity;\n for ( let iy = 0; iy < snap_rows; ++iy ) {\n const py = AV.map( iy, 0, snap_rows - 1, height * 0.125, height * 0.875 );\n const dy = Math.abs( y - py );\n if ( dy < diff ) {\n diff = dy;\n dragging.y = py / height;\n }\n }\n }\n draw();\n break;\n }\n } ).on( 'mouseup mouseleave', () => {\n if ( !drawing && !dragging ) return;\n drawing = dragging = false;\n switch ( mode ) {\n case 'draw':\n this.active_word.strokes.push( window.simplify( points, reduction, true ) );\n draw();\n break;\n case 'edit':\n break;\n }\n this.history.add( this.clone( this.active_word.strokes ) );\n } );\n\n $( 'input#mode' ).on( 'input change', ( event ) => {\n const val = $( event.target ).val();\n mode = mode_names[ val ];\n drawing = false;\n draw();\n } );\n\n $( 'input#undo' ).on( 'click', () => {\n this.history.undo();\n } );\n $( 'input#redo' ).on( 'click', () => {\n this.history.redo();\n } );\n $( 'input#clear' ).on( 'click', () => {\n if ( !this.active_word.strokes.length ) return;\n this.active_word.strokes = [];\n draw();\n this.history.add( this.clone( this.active_word.strokes ) );\n } );\n $( 'input#restore' ).on( 'click', () => {\n this.active_word.strokes = this.clone( this.lexicon[ index ].strokes );\n draw();\n this.history.add( this.clone( this.active_word.strokes ) );\n } ).click();\n $( 'input#save' ).on( 'click', () => {\n console.log( JSON.stringify( this.active_word.strokes ) );\n this.lexicon[ index ].strokes = this.clone( this.active_word.strokes );\n this.lexicon[ index ].params.aspect = aspect;\n draw();\n drawIcon();\n } );\n\n $( 'input#aspect' ).val( aspect ).on( 'input change', ( event ) => {\n aspect = $( event.target ).val();\n if ( aspect < 0.5 ) {\n aspect = 0.5;\n $( event.target ).val( 0.5 );\n }\n if ( Math.abs( 1 - aspect ) <= 0.1 ) {\n aspect = 1;\n $( event.target ).val( 1 );\n }\n if ( aspect >= 1 ) {\n cvs.width = width = 256;\n cvs.height = height = width / aspect;\n } else {\n cvs.height = height = 256;\n cvs.width = width = height * aspect;\n }\n draw();\n } );\n $( 'input#snapping' ).attr( 'checked', snapping ).on( 'change', ( event ) => {\n snapping = $( event.target ).is( ':checked' );\n draw();\n } );\n $( 'input#snap-cols' ).val( snap_cols ).on( 'input change', ( event ) => {\n snap_cols = $( event.target ).val();\n draw();\n } );\n $( 'input#snap-rows' ).val( snap_rows ).on( 'input change', ( event ) => {\n snap_rows = $( event.target ).val();\n draw();\n } );\n $( 'input#stroke-redux' ).val( reduction ).on( 'input change', ( event ) => {\n reduction = $( event.target ).val();\n if ( !this.active_word.strokes.length || !points.length ) return;\n this.active_word.strokes[ this.active_word.strokes.length - 1 ] = window.simplify( points, reduction, true );\n draw();\n } );\n $( 'input#stroke-width' ).val( stroke ).on( 'input change', ( event ) => {\n stroke = $( event.target ).val();\n draw();\n } );\n\n document.body.onkeydown = ( event ) => {\n if ( event.shiftKey ) {\n shift_key = true;\n draw();\n }\n if ( !event.ctrlKey ) return;\n /// Control + Key.\n switch ( event.code ) {\n case 'KeyC':\n /// Copy the entire image.\n menu_copypng.trigger( 'click' );\n break;\n case 'KeyS':\n /// Autosave.\n this.save();\n console.warn( 'Manually saved.' );\n break;\n case 'KeyV':\n /// Paste.\n navigator.clipboard.readText().then( ( text ) => {\n if ( !isNaN( '0x' + text ) ) {\n text = '#' + text;\n }\n if ( color_cache.set( text ) ) {\n this.createNewSquareAtMouse( color_cache );\n }\n } );\n break;\n case 'KeyY':\n $( 'input#redo' ).click();\n break;\n case 'KeyZ':\n if ( shift_key ) {\n $( 'input#redo' ).click();\n } else {\n $( 'input#undo' ).click();\n }\n break;\n default:\n /// Do not preventDefault().\n return;\n }\n event.preventDefault();\n };\n document.body.onkeyup = ( event ) => {\n shift_key = event.shiftKey;\n draw();\n };\n }", "title": "" }, { "docid": "66d404bb7f2bdbfb250a7524778c417e", "score": "0.57643473", "text": "drawEverything() {\n this.clearAll () \n this.background.draw();\n //draw all the pokemons\n for (let i = 0; i < this.pokemons.length; i++) {\n this.pokemons[i].draw();\n } \n this.player.draw();\n }", "title": "" }, { "docid": "6dc8cca91f408f3339da16ed9cf2f174", "score": "0.5762783", "text": "function buttonPlay(button) {\n $(button).css(\"border-top-width\", \"20px\").css(\"border-bottom-width\", \"20px\").css(\"border-left-width\", \"40px\").css(\"border-right-width\", \"0px\").css(\"height\",\"0px\").css(\"width\",\"0px\");\n}", "title": "" }, { "docid": "a963cacf5b27bad12d411803d7312110", "score": "0.57548064", "text": "function clickButtons() {\n if (game.gameOn === false) {\n return;\n }\n\n var buttonId = $(this).attr('id');\n\n console.log(\"User clicked = \" + buttonId);\n\n var buttonInfo = buttonInfos[buttonId - 1];\n $(this).css('background-color', buttonInfo.color);\n\n var audio = new Audio(buttonInfo.sound);\n audio.play();\n\n\n\n game.processUserChoice(buttonId);\n\n }", "title": "" }, { "docid": "04778513182b92040c78c415d57b8cc2", "score": "0.5748255", "text": "function OnGUI () {\n\tGUI.skin = customGUISkin;\n\t\n\t\n\tGUI.Label(Rect(0,0,320,480), GUIContent(backGround));\n\t\n\t\n\tvar index : int;\n\tindex = 0;\n\tfor (state in boardState) {\t\t\t\n\t\tvar xPos : int;\n\t\tvar yPos : int;\n\t\txPos = xOffset + index%3 * boardButtonWidth + index%3 * xSpacing;\n\t\tyPos = yOffset + index/3 * boardButtonHeight + index/3 * ySpacing;\n\t\t\n\t\tif (GUI.Button(Rect(xPos,yPos,boardButtonWidth, boardButtonHeight), boardButton[state+1])) {\n\t\t\tstate = turn;\n\t\t\tturn = turn * -1;\n\t\t}\t\n\t\tindex++;\n\t}\n}", "title": "" }, { "docid": "d694565af5bca5d0f9dcfcf46c25c725", "score": "0.5741024", "text": "initButtonsEvents(){\r\n //selecionando os botoes e os textos com ambos os ids do html \r\n let buttons = document.querySelectorAll(\"#buttons > g, #parts > g\");\r\n\r\n buttons.forEach((btn, index)=>{\r\n //colocando o mesmo valor apos clicar ou arrastar no botao desejado\r\n this.addEventListenerAll(btn, \"click drag\", e => {\r\n\r\n let textBtn = btn.className.baseVal.replace(\"btn-\",\"\");\r\n\r\n this.execBtn(textBtn);\r\n\r\n })\r\n //adcionando evento nos botoes para o usuario compreender onde quer clicar transformando a seta em uma pequena mão ao passar encima do botao\r\n this.addEventListenerAll(btn, \"mouseover mouseup mousedown\", e => {\r\n\r\n btn.style.cursor = \"pointer\";\r\n\r\n })\r\n\r\n })\r\n\r\n }", "title": "" }, { "docid": "0ab4f622f7aecea75ff5a71de97d5fc1", "score": "0.5730502", "text": "function playButton() {\n button = createImg(\"overig/Play.png\");\n button.position(innerWidth/2-22.5, innerHeight/2+30);\n button.mousePressed(play);\n}", "title": "" }, { "docid": "6be4d8e965e9e2cb75519dfa1ac3e43e", "score": "0.5728574", "text": "function buildGameControls() {\n // Just add two buttons to \"step once\" and \"run indefinitely\"\n var buttonRow = $('<div>');\n var stepButton = $('<button>').text('Step once').on('click', function() {\n stepForward();\n });\n buttonRow.append(stepButton);\n _runButton = $('<button>').text('Run').on('click', function() {\n toggleRun();\n });\n buttonRow.append(_runButton);\n return buttonRow;\n }", "title": "" }, { "docid": "e46ad3011bdbeca7fe2f2434bbd512af", "score": "0.57270724", "text": "function updateButtons(arr){\n dynamicTexture1.clear(); //clear\n dynamicTexture1.drawText(arr[0], 0, 7, 'white')\n dynamicTexture2.clear(); //clear\n dynamicTexture2.drawText(arr[1], 0, 7, 'white')\n dynamicTexture3.clear(); //clear\n dynamicTexture3.drawText(arr[2], 0, 7, 'white')\n dynamicTexture4.clear(); //clear\n dynamicTexture4.drawText(arr[3], 0, 7, 'white')\n dynamicTexture5.clear(); //clear\n dynamicTexture5.drawText(arr[4], 0, 7, 'white')\n dynamicTexture6.clear(); //clear\n dynamicTexture6.drawText(arr[5], 0, 7, 'white')\n dynamicTexture1.texture.needsUpdate = true; // update text\n}", "title": "" }, { "docid": "4c7c5f08815f81a02876596a4aafe7a7", "score": "0.5713503", "text": "static drawStdWeaponItems(){\n\n //OUTLINES\n for(let i = 0; i < 4; i++){\n switch(i){\n case 0:\n let STDShot = new ShopButton(GameManager.shopItems.StdShot, 300, (400) + (i* 100));\n STDShot.addEffect(weaponStaterWeaponLR);\n break;\n \n case 1:\n let LShot = new ShopButton(GameManager.shopItems.LShot, 300, (400) + (i * 100));\n LShot.addEffect(weaponSpreadLR);\n break;\n case 2:\n let XShot = new ShopButton(GameManager.shopItems.XShot, 300, (400) + (i * 100));\n XShot.addEffect(weaponXLR);\n break;\n case 3:\n let SpreadShot = new ShopButton(GameManager.shopItems.SpreadShot, 300, (400) + (i * 100));\n SpreadShot.addEffect(weaponAllSpreadLR);\n break;\n\n default: \n //timage = shopbuttonimg;\n }\n \n }\n\n let HealthUp = new ShopButton(GameManager.shopItems.HEALTHUP, 800, 400);\n HealthUp.addPowerUp(Shop.PlayerIncreaseHealth)\n let ShieldUp = new ShopButton(GameManager.shopItems.SHIELDUP, 800, 600);\n ShieldUp.addPowerUp(Shop.PlayerIncreaseShield)\n for(let i = 0; i < 4; i++){\n image(shopbuttonimg, 400, (400) + (i * 100));\n }\n\n }", "title": "" }, { "docid": "66ba3aa79c3f8547404d63bd6b6ea807", "score": "0.57114863", "text": "addConveyor() {\n let conveyorContainer = new PIXI.Container()\n // generate item----------------------------\n for (let i = 0; i < 5; i++) {\n let item = new ConveyorView(i + 1)\n this.itemArray.push(item)\n Helper.setScale(0.5, item)\n Helper.toBottom(dh-100, item)\n item.x = item.width * i\n conveyorContainer.addChild(item)\n\n item.interactive = true\n item.on('pointerup', () => {\n this.showSauce()\n this.addMaterial(i + 1)\n })\n }\n this.addChild(conveyorContainer)\n\n // set animation----------------------------------\n const itemWidth = 250\n timeline([{track: 'x', from: itemWidth * 5, to: 0, duration: 5000, ease: easing.linear}], \n {loop: Infinity, ease: easing.linear})\n .start((v) => {\n for (let i = 0; i < this.itemArray.length; i++) {\n this.itemArray[i].x = this.itemMoveCalculate((i + 1), v, itemWidth)\n }\n })\n }", "title": "" }, { "docid": "1c3434f669b9544211a31b3800b6f4bf", "score": "0.57106465", "text": "function makeButtons(){\n if (startGame) {\n $(\"#crystal1\").on(\"click\", function(){\n totalScore += (crystal1/counter);\n $(newSpan).html(\" \" + totalScore);\n winLose();\n });\n \n $(\"#crystal2\").on(\"click\", function(){\n totalScore += (crystal2/counter);\n $(newSpan).html(\" \" + totalScore);\n winLose();\n });\n \n $(\"#crystal3\").on(\"click\", function(){\n totalScore += (crystal3/counter);\n $(newSpan).html(\" \" + totalScore);\n winLose();\n });\n\n $(\"#crystal4\").on(\"click\", function(){\n totalScore += (crystal4/counter);\n $(newSpan).html(\" \" + totalScore);\n winLose();\n \n });\n}}", "title": "" }, { "docid": "84891092a0423d8940e8665be54bd5ea", "score": "0.5709761", "text": "run() {\n this.checkMouse();\n\n fill(65, 155, 255);\n noStroke();\n rect(this.x, this.y, this.width, this.height);\n if(this.mouse) {\n cursor(this.hoverCursor);\n image(images.buttonborder2, this.x - this.width * 0.026, this.y - this.height * 0.2, this.width * 1.052, this.height * 1.43);\n }\n else {\n image(images.buttonborder, this.x - this.width * 0.026, this.y - this.height * 0.2, this.width * 1.052, this.height * 1.43);\n }\n\n fill(this.textColor);\n strokeWeight(1);\n textSize(this.textSize);\n text(this.buttonText, this.x + this.width / 2, this.y + this.height / 2);\n\n if(this.mouse && mouseIsPressed && !globalMouse) {\n globalMouseToggle = 1;\n this.clickedOn();\n }\n\n }", "title": "" }, { "docid": "cd201534895e240dbd6eae4d7b3346a6", "score": "0.5694032", "text": "function play() {\n// it fills the squares array with numbers from 0-8\n tictactoe = Array.from(Array(9).keys());\n// it resets the content, style, recreate event listner of all squares \n for (var i = 0; i < squares.length; i++) {\n squares[i].innerText = '';\n squares[i].style.removeProperty('background-color');\n squares[i].addEventListener('click', turnClick, false);\n }\n}", "title": "" }, { "docid": "22ac34fa334effa37b02b23a018655fb", "score": "0.5690177", "text": "reveal() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n if (!this.wasVisited[i][j]) { // && this.board[i][j] == 9\n this.buttonGrid[i][j].remove();\n this.buttonGrid[i][j] = createButton(this.board[i][j]);\n this.buttonGrid[i][j].position(offset + j * spacing, offset + i * spacing)\n this.buttonGrid[i][j].size(spacing, spacing);\n this.buttonGrid[i][j].style('font-size', '18px')\n if (this.board[i][j] == 9) {\n this.buttonGrid[i][j].style('background-color', 'red')\n }\n }\n }\n }\n }", "title": "" }, { "docid": "3350573f0c949e6d0f41b1b8bd39b340", "score": "0.5689854", "text": "draw() {\n this.playerElements.forEach((playerElement, index) => {\n playerElement.draw();\n });\n }", "title": "" }, { "docid": "f9343e493cf2fb24b0827852fe76e1b3", "score": "0.56834936", "text": "draw () {\r\n const canvas = document.getElementById('editor')\r\n const ctx = canvas.getContext('2d')\r\n const toolbar = ctx.createLinearGradient(0, 0, 0, this.height)\r\n toolbar.addColorStop(0, '#4f5f7d')\r\n toolbar.addColorStop(1, '#333d51')\r\n this.width = document.getElementById('editor').getAttribute('width')\r\n const num = this.buttons.length\r\n if (num % 2 === 1) { this.x = this.width / 2 - ((num - 1) / 2) * (this.buttonsize + this.gap) } else this.x = this.width / 2 - (num / 2) * (this.buttonsize + this.gap)\r\n let starter = this.x\r\n for (let i = 0; i < this.buttons.length; i++) { // re-set the buttons position\r\n this.buttons[i].x = starter\r\n this.buttons[i].y = this.y\r\n starter += this.buttonsize + this.gap\r\n }\r\n ctx.fillStyle = toolbar\r\n ctx.fillRect(0, 0, this.width, this.height)\r\n // this.layout()\r\n for (let i = 0; i < this.buttons.length; i++) { // draw everything\r\n this.buttons[i].draw()\r\n }\r\n }", "title": "" }, { "docid": "cb7b83e4aba92cf55b1f5f98fade933c", "score": "0.56824154", "text": "function buttonAction() {\n document.querySelectorAll('button').forEach(button => {\n button.addEventListener('click', () => {\n if (button.dataset.name === 'play') {resetSnakeMovement();}\n else if (button.dataset.name === 'pause') {clearInterval(snake_interval);}\n // reset button\n else {\n clearCanvas()\n snake = [...starting_snake];\n drawSnake();\n spawnFood();\n clearInterval(snake_interval);\n document.querySelector('#lose').style = \"color: white;\"\n snake_dir = 'right';\n disableMapSlider(false); }\n });\n });\n}", "title": "" }, { "docid": "a2e7ce62dc531ae1771423ac74ecd87a", "score": "0.5677348", "text": "function drawActionButtons() {\n const targetDiv = document.querySelector(\".main-control div.row\");\n const newDiv = document.createElement(\"div\");\n const template = `\n <button class=\"prune x1 btn btn-sm btn-outline-danger\">PRUNE (x1)</button>\n <button class=\"prune x2 btn btn-sm btn-outline-danger\">PRUNE (x2)</button>\n <button class=\"prune x3 btn btn-sm btn-outline-danger\">PRUNE (x3)</button>\n `;\n\n newDiv.className = \"action-buttons col-12 mb-4 mb-md-0 col-md-6 text-center\";\n targetDiv.insertAdjacentElement('afterbegin', newDiv);\n newDiv.innerHTML = template;\n}", "title": "" }, { "docid": "9702971340e861bab0b99df88a4b27db", "score": "0.5668908", "text": "mapButtons() {\n\n // Exit\n var exit = this._game.add.sprite(-1, -1, \"button-right\").setOrigin(0, 0);\n exit.depth = 100;\n exit.setScrollFactor(0);\n this.buttonInteractive(exit, () => {\n this._bgm.stop();\n this._game.scene.start('GameMenuScene', { playerData: this._playerData });\n });\n\n // Save\n var save = this._game.add.sprite(1022, 2, \"button-down\").setOrigin(1, 0);\n save.depth = 100;\n save.setDisplaySize(32, 32);\n save.setScrollFactor(0);\n this.buttonInteractive(save, () => { saveFile(this.getTileData(), \"map-editor\", \"txt\"); });\n\n // Load\n\n\n // Expand Width\n var expandWidth = this._game.add.sprite(1024, 604, \"button-right-green\").setOrigin(1, 1);\n expandWidth.depth = 100;\n expandWidth.setDisplaySize(32, 32);\n expandWidth.setScrollFactor(0);\n this.buttonInteractive(expandWidth, () => { this.expandWidth(); });\n\n // Expand Height\n var expandHeight = this._game.add.sprite(998, 626, \"button-down-green\").setOrigin(1, 1);\n expandHeight.depth = 100;\n expandHeight.setDisplaySize(32, 32);\n expandHeight.setScrollFactor(0);\n this.buttonInteractive(expandHeight, () => { this.expandHeight(); });\n\n // Reduce Width\n var reduceWidth = this._game.add.sprite(972, 604, \"button-left-red\").setOrigin(1, 1);\n reduceWidth.depth = 100;\n reduceWidth.setDisplaySize(32, 32);\n reduceWidth.setScrollFactor(0);\n this.buttonInteractive(reduceWidth, () => { this.reduceWidth(); });\n\n // Reduce Height\n var reduceHeight = this._game.add.sprite(998, 582, \"button-up-red\").setOrigin(1, 1);\n reduceHeight.depth = 100;\n reduceHeight.setDisplaySize(32, 32);\n reduceHeight.setScrollFactor(0);\n this.buttonInteractive(reduceHeight, () => { this.reduceHeight(); });\n\n }", "title": "" }, { "docid": "3e1c914c8677d4b2d481ca299e8395bb", "score": "0.56652373", "text": "function createLabelsAndButtons() {\n // Start Scene\n // The title\n let title = new PIXI.Text(\"Player Senses\");\n title.style = new PIXI.TextStyle({\n fill: 0xBA55D3,\n fontSize: 100,\n fontFamily: 'Futura',\n stoke: 0xFF0000,\n strokeThickness: 12\n });\n title.x = sceneWidth / 4 - 70;\n title.y = 120;\n startScene.addChild(title);\n\n let playStyle = new PIXI.TextStyle({\n fill: 0xe75480,\n fontSize: 50,\n fontFamily: \"Arial\",\n stroke: 0x000000,\n strokeThickness: 4\n });\n\n // How to play text\n let howToPlay = new PIXI.Text(\"Tutorial\");\n howToPlay.style = playStyle;\n howToPlay.x = 200;\n howToPlay.y = sceneHeight - 140;\n howToPlay.interactive = true;\n howToPlay.buttonMode = true;\n howToPlay.on(\"pointerup\", viewControls); // viewControls is a function reference\n howToPlay.on('pointerover', e => e.target.alpha = 0.7);\n howToPlay.on('pointerout', e => e.currentTarget.alpha = 1.0);\n startScene.addChild(howToPlay);\n\n // Start game text\n let startButton = new PIXI.Text(\"Fight Those Troll\");\n startButton.style = playStyle;\n startButton.x = 200;\n startButton.y = sceneHeight - 260;\n startButton.interactive = true;\n startButton.buttonMode = true;\n startButton.on(\"pointerup\", startGame); // startGame is a function reference\n startButton.on('pointerover', e => e.target.alpha = 0.7);\n startButton.on('pointerout', e => e.currentTarget.alpha = 1.0);\n startScene.addChild(startButton);\n\n // 2 - set up `gameScene`\n let textStyle = new PIXI.TextStyle({\n fill: 0xFFFFFF,\n fontSize: 30,\n fontFamily: \"Futura\",\n stroke: 0xFF0000,\n strokeThickness: 4\n });\n\n // Make time label\n timeLabel = new PIXI.Text(\"Time \" + time);\n timeLabel.style = new PIXI.TextStyle({\n fill: 0xBEFF00,\n fontSize: 50,\n fontFamily: \"Futura\",\n stroke: 0x000000,\n strokeThickness: 6\n });\n timeLabel.x = 5;\n timeLabel.y = 5;\n gameScene.addChild(timeLabel);\n\n // Game Over Text \n textStyle = new PIXI.TextStyle({\n fill: 0xBE0000,\n fontSize: 90,\n fontFamily: \"Futura\",\n stroke: 0x000000,\n strokeThickness: 6\n });\n let gameOverText = new PIXI.Text(\"Game Over!\");\n gameOverText.style = textStyle;\n gameOverText.x = sceneWidth / 4;\n gameOverText.y = sceneHeight / 12;\n gameOverScene.addChild(gameOverText);\n\n // Actual time\n gameOverTimeLabel = new PIXI.Text();\n gameOverTimeLabel.style = textStyle;\n gameOverTimeLabel.x = sceneWidth / 12 + 30;\n gameOverTimeLabel.y = sceneHeight / 2 - 100;\n gameOverScene.addChild(gameOverTimeLabel);\n\n // High score label\n highScoreLabel = new PIXI.Text();\n highScoreLabel.style = textStyle;\n highScoreLabel.x = sceneWidth / 12 + 10;\n highScoreLabel.y = sceneHeight / 2;\n gameOverScene.addChild(highScoreLabel);\n\n let overStyle = new PIXI.TextStyle({\n fill: 0x016699,\n fontSize: 44,\n fontFamily: \"Arial\",\n stroke: 0x000000,\n strokeThickness: 4\n });\n\n // Make play again text\n let playAgainText = new PIXI.Text(\"Play Again\");\n playAgainText.style = overStyle;\n playAgainText.x = sceneWidth / 4;\n playAgainText.y = sceneHeight - 175;\n playAgainText.interactive = true;\n playAgainText.buttonMode = true;\n playAgainText.on(\"pointerup\", startGame); // startGame is a function reference\n playAgainText.on('pointerover', e => e.target.alpha = 0.7);\n playAgainText.on('pointerout', e => e.currentTarget.alpha = 1.0);\n gameOverScene.addChild(playAgainText);\n\n // Make quit text\n let quitText = new PIXI.Text(\"Quit\");\n quitText.style = overStyle;\n quitText.x = sceneWidth / 4;\n quitText.y = sceneHeight - 100;\n quitText.interactive = true;\n quitText.buttonMode = true;\n quitText.on(\"pointerup\", quitGame); // quitGame is a function reference\n quitText.on('pointerover', e => e.target.alpha = 0.7);\n quitText.on('pointerout', e => e.currentTarget.alpha = 1.0);\n gameOverScene.addChild(quitText);\n\n // Make how to play text\n let howToTitleCtor = new PIXI.TextStyle({\n fill: 0xFFFF00,\n fontSize: 90,\n fontFamily: \"Futura\",\n stroke: 0x000000,\n strokeThickness: 6\n });\n let howToTitle = new PIXI.Text(\"How To Play\");\n howToTitle.style = howToTitleCtor;\n howToTitle.x = sceneWidth / 5 + 10;\n howToTitle.y = 35;\n controlsScene.addChild(howToTitle);\n\n // Make instructions\n let controlTxtStyle = new PIXI.TextStyle({\n fill: 0xFFFFFF,\n fontSize: 40,\n fontFamily: \"Arial\",\n stroke: 0x000000,\n strokeThickness: 5\n });\n let instructions = new PIXI.Text(\"- Player crawls around the\\ncontainer with the WASD keys.\" +\n \"\\n\\n- Your goal is to survive the\\nlongest time by avoiding the\\nlethal enemys falling from above.\");\n instructions.style = controlTxtStyle;\n instructions.x = sceneWidth / 6;\n instructions.y = sceneHeight / 4 + 20;\n controlsScene.addChild(instructions);\n\n let sGoBack = new PIXI.Text(\"Back\");\n sGoBack.style = playStyle;\n sGoBack.x = sceneWidth / 2 - 100;\n sGoBack.y = sceneHeight - 100;\n sGoBack.interactive = true;\n sGoBack.buttonMode = true;\n sGoBack.on(\"pointerup\", fromControlsToStart); // fromControlsToStart is a function reference\n sGoBack.on('pointerover', e => e.target.alpha = 0.7);\n sGoBack.on('pointerout', e => e.currentTarget.alpha = 1.0);\n controlsScene.addChild(sGoBack);\n}", "title": "" }, { "docid": "3f18347de10058828711bbe0b8ea2cd3", "score": "0.5659369", "text": "function renderButtons() {\n\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of gifs\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generating buttons for each gif in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of gif-btn to our button\n a.addClass(\"gif-btn\");\n // Adding a data-attribute\n a.attr(\"data-topic\", gifs[i]);\n // Providing the initial button text\n a.text(gifs[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "f8ff1715cb0881d79ad530e2e9fdf7ca", "score": "0.5656216", "text": "function drawButtonsinObjectPanel(){\n\tvar self = this;\n\t//clear button group\n\t$('#object_buttongroup').remove();\n\n\tvar buttonNameList = ['Clear', 'Link', 'Logic_Composition']; \n\tvar buttongrouphtml = '<div class=\"btn-group header_footer_buttongroup\" id=\"object_buttongroup\" role=\"group\" aria-label=\"...\"><button type=\"button\" class=\"btn btn-warning btn-xs function_button\" id=<%=clearButtonId%> value=<%=clearButtonValue%> >Clear</button><button type=\"button\" class=\"btn btn-warning btn-xs function_button\" id=<%=linkButtonId%> value=<%=linkButtonValue%> >Link</button><button type=\"button\" class=\"btn btn-warning btn-xs function_button\" id=<%=logicButtonId%> value=<%=logicButtonValue%> >Logic Composition</button><div class=\"dropdown btn-group\" role=\"group\" id=\"remove_object_drop_div\"><button type=\"button\" id=\"add_object_button\" class=\"btn btn-warning btn-xs function_button dropdown-toggle\" data-toggle=\"dropdown\">Add<span class=\"caret\"></span></button><ul class=\"dropdown-menu \" id=\"invisible_object_menu\"></ul></div></div>';\n\tvar compiled = _.template(buttongrouphtml);\n\t$('#object_p_div .titlebar').html($('#object_p_div .titlebar').html() + compiled({\n\t\tclearButtonId: 'bg_' + buttonNameList[0],\n\t\tclearButtonValue: buttonNameList[0],\n\t\tlinkButtonId: 'bg_' + buttonNameList[1],\n\t\tlinkButtonValue: buttonNameList[1],\n\t\tlogicButtonId: 'bg_' + buttonNameList[2],\n\t\tlogicButtonValue: buttonNameList[2],\n\t}));\n\n\t$('#' + 'bg_' + buttonNameList[0]).click(function(){\n\t\t// //console.log(' ccccclick button ');\n\t\tself.clickObjectButton(this.value);\t\t\n\t})\n\t$('#' + 'bg_' + buttonNameList[1]).click(function(){\n\t\t// //console.log(' ccccclick button ');\n\t\tself.clickObjectButton(this.value);\t\t\n\t});\n\t$('#' + 'bg_' + buttonNameList[2]).click(function(){\n\t\t// //console.log(' ccccclick logic button ');\n\t\tself.clickObjectButton(this.value);\t\t\n\t});\n\n\t$('#remove_object_drop_div').on('click', function(){\n\t\t// //console.log(\" click add object button \");\n\n\t\tif($('#invisible_object_menu')[0].style.display == 'none' || $('#invisible_object_menu')[0].style.display == '')\n\t\t\t$('#invisible_object_menu').css({\n\t\t\t\tdisplay: 'block'\n\t\t\t});\n\t\telse\n\t\t\t$('#invisible_object_menu').css({\n\t\t\t\tdisplay: 'none'\n\t\t\t});\n\t});\n\n\t// $('#invisible_object_menu').on('mouseout', function(){\n\t// \t//console.log(\" oututtutu! \");\n\t// \t$('#invisible_object_menu').css({\n\t// \t\tdisplay: 'none'\n\t// \t});\n\t// });\n\n\t$('#invisible_object_menu').on('click', 'li', function(e){\n\t\tvar groupId = Number($(this).attr('groupid'));\n\t\t//console.log(' click ', groupId);\n \t\t$(this).remove();\n \t\t//make group visible\n \t\tg_ObjectGroupManager.setGroupVisible(groupId, true);\n \t\tself.drawObjectButton(groupId);\n \t\t//check for add_object_button\n \t\tif(g_ObjectGroupManager.getInVisibleGroupIdList().length > 0){\n\t\t\t// //console.log(' invisible = true ');\n\t\t\t$('#add_object_button').removeClass('alpha-3');\n\t\t}else{\n\t\t\t// //console.log(' invisible = false ');\n\t\t\t$('#add_object_button').addClass('alpha-3');\n\t\t}\n\t});\n\n\t$('#invisible_object_menu').on('mouseenter', 'li', function(e){\n\t\tvar groupId = $(this).attr('groupid');\n\t\t$('#obj_li_'+groupId).addClass('background-highlight cursor-pointer');\n\t});\n\t$('#invisible_object_menu').on('mouseout', 'li', function(e){\n\t\tvar groupId = $(this).attr('groupid');\n\t\t$('#obj_li_'+groupId).removeClass('background-highlight cursor-pointer');\n\t});\n\n\t$('#add_object_button').addClass('alpha-3');\n\n\t/*\n\t//select the titlebar div\n\tvar titleDiv = $('#object_p_div .titlebar');\n\n\t//add a button group\n\tvar buttonGroup = $(\"<div>\");\n\n\tbuttonGroup\n\t.attr('id', 'object_buttongroup')\n\t.attr('class', 'btn-group header_footer_buttongroup')\n\ttitleDiv.append(buttonGroup);\n\n\t// add button into the buttongroup\n\t// add the buttons\n\n\t//add in the left\n\tfor (var i = buttonNameList.length - 1; i >= 0; i--) {\n\t\tvar buttonName = buttonNameList[i];\n\t\tvar buttonRect = $('<button>');\n\t\tbuttonRect\n\t\t\t.attr('id', 'bg_' + buttonName)\n\t\t\t.attr('class', \"btn btn-warning btn-xs\")\n\t\t\t.attr(\"value\", buttonName)\t\t\t\n\t\t\t.text(buttonName);\n\n\t\tbuttonGroup.append(buttonRect);\n\t\tbuttonRect[0].onclick = function(){\n\t\t\t//console.log(' ccccclick button ');\n\t\t\tself.clickObjectButton(this.value);\n\t\t}\n\t};\n\t\n\t//add drop-down\n\tvar dropdownhtml = '<div class=\"btn-group dropdown dropdown-scroll\" role=\"group\"> <button type=\"button\" class=\"btn btn-warning btn-xs\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">Add<span class=\"caret\"></span></button><ul class=\"dropdown-menu\" id=\"invisible_object_menu\"></ul></div>';\n\tvar compiled = _.template(dropdownhtml);\n\tvar titleDiv2 = $('#object_buttongroup');\n\ttitleDiv2.html(titleDiv2.html() + compiled());\n\n\t// $('#invisible_object_menu').on('click', 'li', function(e) {\n\t// \tvar groupId = $(this).attr('groupid');\n\t// \t//console.log(' click ', groupId);\n\n // \t\t$(this).remove();\n\n // \t\t//make group visible\n // \t\tg_ObjectGroupManager.setGroupVisible(groupId, true);\n // \t\tself.drawObjectButton(groupId);\n\t// });\n*/\n}", "title": "" }, { "docid": "3f18e0c50e1ecdc7333da8d8740e5ad0", "score": "0.56554073", "text": "function renderButtons(){ \n\n\t\t// Deletes the movies prior to adding new movies (this is necessary otherwise you will have repeat buttons)\n\t\t$('#buttonsView').empty();\n\n\t\t// Loops through the array of movies\n\t\tfor (var i = 0; i < gifs.length; i++){\n\n\t\t\t// Then dynamicaly generates buttons for each movie in the array\n\n\t\t\t// Note the jQUery syntax here... \n\t\t var a = $('<button>') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t a.addClass('gif'); // Added a class \n\t\t a.addClass('btn')\n\t\t a.attr('data-name', gifs[i]); // Added a data-attribute\n\t\t a.text(gifs[i]); // Provided the initial button text\n\t\t $('#buttonsView').append(a); // Added the button to the HTML\n\t\t}\n\t}", "title": "" }, { "docid": "31be3c23c1af90e21e31574d71f8798d", "score": "0.565132", "text": "function _buildControls() {\n // Create html array\n var html = [],\n iconUrl = _getIconUrl(),\n iconPath = (!iconUrl.absolute ? iconUrl.url : '') + '#' + config.iconPrefix;\n\n // Larger overlaid play button\n if (_inArray(config.controls, 'play-large')) {\n html.push(\n '<button type=\"button\" data-plyr=\"play\" class=\"plyr__play-large\">',\n '<svg><use xlink:href=\"' + iconPath + '-play\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.play + '</span>',\n '</button>'\n );\n }\n\n html.push('<div class=\"plyr__controls\">');\n\n // Restart button\n if (_inArray(config.controls, 'restart')) {\n html.push(\n '<button type=\"button\" data-plyr=\"restart\">',\n '<svg><use xlink:href=\"' + iconPath + '-restart\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.restart + '</span>',\n '</button>'\n );\n }\n\n // Rewind button\n if (_inArray(config.controls, 'rewind')) {\n html.push(\n '<button type=\"button\" data-plyr=\"rewind\">',\n '<svg><use xlink:href=\"' + iconPath + '-rewind\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.rewind + '</span>',\n '</button>'\n );\n }\n\n // Play Pause button\n // TODO: This should be a toggle button really?\n if (_inArray(config.controls, 'play')) {\n html.push(\n '<button type=\"button\" data-plyr=\"play\">',\n '<svg><use xlink:href=\"' + iconPath + '-play\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.play + '</span>',\n '</button>',\n '<button type=\"button\" data-plyr=\"pause\">',\n '<svg><use xlink:href=\"' + iconPath + '-pause\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.pause + '</span>',\n '</button>'\n );\n }\n\n // Fast forward button\n if (_inArray(config.controls, 'fast-forward')) {\n html.push(\n '<button type=\"button\" data-plyr=\"fast-forward\">',\n '<svg><use xlink:href=\"' + iconPath + '-fast-forward\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.forward + '</span>',\n '</button>'\n );\n }\n\n // Progress\n if (_inArray(config.controls, 'progress')) {\n // Create progress\n html.push('<span class=\"plyr__progress\">',\n '<label for=\"seek{id}\" class=\"plyr__sr-only\">Seek</label>',\n '<input id=\"seek{id}\" class=\"plyr__progress--seek\" type=\"range\" min=\"0\" max=\"100\" step=\"0.1\" value=\"0\" data-plyr=\"seek\">',\n '<progress class=\"plyr__progress--played\" max=\"100\" value=\"0\" role=\"presentation\"></progress>',\n '<progress class=\"plyr__progress--buffer\" max=\"100\" value=\"0\">',\n '<span>0</span>% ' + config.i18n.buffered,\n '</progress>');\n\n // Seek tooltip\n if (config.tooltips.seek) {\n html.push('<span class=\"plyr__tooltip\">00:00</span>');\n }\n\n // Close\n html.push('</span>');\n }\n\n // Media current time display\n if (_inArray(config.controls, 'current-time')) {\n html.push(\n '<span class=\"plyr__time\">',\n '<span class=\"plyr__sr-only\">' + config.i18n.currentTime + '</span>',\n '<span class=\"plyr__time--current\">00:00</span>',\n '</span>'\n );\n }\n\n // Media duration display\n if (_inArray(config.controls, 'duration')) {\n html.push(\n '<span class=\"plyr__time\">',\n '<span class=\"plyr__sr-only\">' + config.i18n.duration + '</span>',\n '<span class=\"plyr__time--duration\">00:00</span>',\n '</span>'\n );\n }\n\n // Toggle mute button\n if (_inArray(config.controls, 'mute')) {\n html.push(\n '<button type=\"button\" data-plyr=\"mute\">',\n '<svg class=\"icon--muted\"><use xlink:href=\"' + iconPath + '-muted\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-volume\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleMute + '</span>',\n '</button>'\n );\n }\n\n // Volume range control\n if (_inArray(config.controls, 'volume')) {\n html.push(\n '<span class=\"plyr__volume\">',\n '<label for=\"volume{id}\" class=\"plyr__sr-only\">' + config.i18n.volume + '</label>',\n '<input id=\"volume{id}\" class=\"plyr__volume--input\" type=\"range\" min=\"' + config.volumeMin + '\" max=\"' + config.volumeMax + '\" value=\"' + config.volume + '\" data-plyr=\"volume\">',\n '<progress class=\"plyr__volume--display\" max=\"' + config.volumeMax + '\" value=\"' + config.volumeMin + '\" role=\"presentation\"></progress>',\n '</span>'\n );\n }\n\n // Toggle captions button\n if (_inArray(config.controls, 'captions')) {\n html.push(\n '<button type=\"button\" data-plyr=\"captions\">',\n '<svg class=\"icon--captions-on\"><use xlink:href=\"' + iconPath + '-captions-on\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath+ '-captions-off\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleCaptions + '</span>',\n '</button>'\n );\n }\n\n // Toggle fullscreen button\n if (_inArray(config.controls, 'fullscreen')) {\n html.push(\n '<button type=\"button\" data-plyr=\"fullscreen\">',\n '<svg class=\"icon--exit-fullscreen\"><use xlink:href=\"' + iconPath + '-exit-fullscreen\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-enter-fullscreen\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleFullscreen + '</span>',\n '</button>'\n );\n }\n\n // Close everything\n html.push('</div>');\n\n return html.join('');\n }", "title": "" }, { "docid": "6ab497924f7be6f44b0a1e014d5ad6b4", "score": "0.56501323", "text": "showBoard(painter) {\n let blanks = Stage.getBlanks(this.board),\n isAboveBlanks = (col, row) => blanks.some(bl => bl[0] === col) && blanks.filter(bl => bl[0] === col)[0][1] > row;\n return (x, y) => {\n return painter.rect(x, y, STAGE_WIDTH * 32, (STAGE_HEIGHT - 2) * 32)\n .clip(this.board.map((column, colNum) => column.map((q, rowNum) => q.match({\n nothing: () => M_IO.unit(),\n just: (quark) => {\n return this.phase.match({\n wait: (_) => {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32);\n },\n move: () => {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32);\n },\n turn: (_) => {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32);\n },\n land: (_) => {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32);\n },\n clear: (clearQuarks, counter) => {\n let filteredClearQuark = clearQuarks.filter(h => h[0][0] === colNum && h[0][1] === rowNum);\n if (filteredClearQuark.length === 0) {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32);\n } else {\n let ease2 = Tween.ease(Tween.in(Tween.quad))(20 - counter, 1, -1, 20);\n return painter.globalAlpha(ease2)(quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32)).bind(_ =>\n filteredClearQuark.map(h => h[1].match({\n nothing: () => M_IO.unit(),\n just: (hadron) => painter.text(hadron.name, x + colNum * 32 + 16, y + (rowNum - 2) * 32 + 16, { font: 'Fira Sans', size: 28, align: 'center', baseline: 'middle' })\n .fill(Color.HSL(0, 0, 0).toHex())\n })).reduce((a, b) => a.bind(_ => b)));\n }\n },\n fall: (fallDistance, _) => {\n if (isAboveBlanks(colNum, rowNum)) {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2 + fallDistance) * 32);\n } else {\n return quark.show(painter, x + colNum * 32, y + (rowNum - 2) * 32);\n }\n }\n });\n }\n })).reduce((a, b) => a.bind(_ => b))).reduce((a, b) => a.bind(_ => b)));\n }\n }", "title": "" }, { "docid": "098bf2168eec8a2ccef9cb9a58cd7b71", "score": "0.56397444", "text": "function draw_board(){\n $('#root').empty(); // empty root container\n var row_count = 0; // count rows (for html id)\n\n // OUTER FOR\n this.board.forEach(function(row){\n // CREATE ROW HTML & APPEND TO ROOT\n var html = `<div class=\"row\" id=\"row-${row_count}\"></div>`;\n $('#root').append(html); // append row\n let col_count = 0; // count cols (for html id)\n\n // INNER FOR\n row.forEach(function(cell){\n switch (cell) {\n // MINE\n case \"M\":\n var square = $(`<div id=\"col-${col_count}\" class=\"square\"><button class='mine-btn'>?</button></div>`);\n $(`#row-${row_count}`).append(square);\n break;\n\n // MINE WITH FLAG\n case \"Mf\":\n var square = $(`<div id=\"col-${col_count}\" class=\"square\"><button class='mine-btn'><img src='img/flag.png'/></button></div>`);\n $(`#row-${row_count}`).append(square);\n break;\n case \"f\":\n var square = $(`<div id=\"col-${col_count}\" class=\"square\"><button><img src='img/flag.png'/></button></div>`);\n $(`#row-${row_count}`).append(square);\n break;\n default:\n var color;\n if(cell == '1') color = '#D48A6A';\n else if(cell == '2') color = '#AA5B39';\n else if(cell == '3') color = '#803515';\n else if(cell == '4') color = '#581B01';\n else if(cell == '5') color = '#6D1238';\n else if(cell == '6') color = '#6D1238';\n else if(cell == '') color = '#FFDCCD';\n\n var square = $(`<div id=\"col-${col_count}\" class=\"square\"><button style='background-color: ${color}'>${cell}</button></div>`);\n $(`#row-${row_count}`).append(square);\n break;\n }\n\n\n col_count++;\n });\n\n row_count++;\n });\n}", "title": "" }, { "docid": "4b9d4222f9d3d64532556522927e9d0a", "score": "0.56328106", "text": "_layout() {\n const m = this.margin;\n const w = this.width - (2 * m);\n const hw = Math.floor(w / 2);\n const x = m + hw;\n let y = m + hw;\n // lay out top buttons\n for (let i = 0; i < this._buttons.length - this.bottomCount; i++) {\n const button = this._buttons[i];\n button.size = w;\n button.x = x;\n button.y = y;\n y += w + m;\n }\n // lay out bottom buttons\n y = this.height - (m + hw);\n for (let i = 0; i < this.bottomCount; i++) {\n const button = this._buttons[(this._buttons.length - 1) - i];\n button.size = w;\n button.x = x;\n button.y = y;\n y -= w + m;\n }\n this._background.clear();\n this._background.beginFill(16777215 /* BACKGROUND */, 1.0);\n this._background.drawRect(0, 0, this.width, this.height);\n this._background.endFill();\n renderer_6.Renderer.needsUpdate();\n }", "title": "" }, { "docid": "cce96902d0c7af37ddf1211c339c932d", "score": "0.56275547", "text": "drawAllItems() {\n this.gs.clearRect(0, 0, this.gameScreen.width, this.gameScreen.height)\n this.player.draw(this.gs)\n this.coffeeCups.forEach((elem) => elem.draw(this.gs)) // empy array at start\n this.labBooks.forEach((elem) => elem.draw(this.gs)) // empy array at start\n }", "title": "" }, { "docid": "f8ef537c12fc65237f98d66f8b55e7c4", "score": "0.56250495", "text": "function disableButtons() {\n\tfor (var i = 0; i < playlistSize; i++) {\n\t\tdocument.getElementById('del'+i).disabled = true;\n\t\tdocument.getElementById('toTop'+i).disabled = true;\n\t\tdocument.getElementById('up'+i).disabled = true;\n\t\tdocument.getElementById('down'+i).disabled = true;\n\t\tdocument.getElementById('toBottom'+i).disabled = true;\n\t}\n}", "title": "" }, { "docid": "e0fe49fcd68449ce2f57efac1f1b34f1", "score": "0.5624165", "text": "function ControlDisplay(game) {\n\n this.btnDim = 80;\n this.buttonIcon = AM.getAsset(\"./img/control/button.png\")\n\n this.actionIconOn = AM.getAsset(\"./img/control/action_on.png\")\n this.actionIconOff = AM.getAsset(\"./img/control/action_off.png\")\n this.fightIconOn = AM.getAsset(\"./img/control/fight_on.png\")\n this.fightIconOff = AM.getAsset(\"./img/control/fight_off.png\")\n this.moveIcon = AM.getAsset(\"./img/control/move.png\")\n this.kingIconOn = AM.getAsset(\"./img/control/king_on.png\")\n this.kingIconOff = AM.getAsset(\"./img/control/king_off.png\")\n\n this.buildIconOn = AM.getAsset(\"./img/control/build_on.png\")\n this.buildIconOff = AM.getAsset(\"./img/control/build_off.png\")\n this.barracksIconOn = AM.getAsset(\"./img/control/barracks_on.png\")\n this.barracksIconOff = AM.getAsset(\"./img/control/barracks_off.png\")\n this.siloIconOn = AM.getAsset(\"./img/control/silo_on.png\")\n this.siloIconOff = AM.getAsset(\"./img/control/silo_off.png\")\n\n this.troopIconOn = AM.getAsset(\"./img/control/knight_on.png\")\n this.troopIconOff = AM.getAsset(\"./img/control/knight_off.png\")\n this.soldierIconOn = AM.getAsset(\"./img/control/troop_on.png\")\n this.soldierIconOff = AM.getAsset(\"./img/control/troop_off.png\")\n this.archerIconOn = AM.getAsset(\"./img/control/archer_on.png\")\n this.archerIconOff = AM.getAsset(\"./img/control/archer_off.png\")\n\n this.endTurnIconOn = AM.getAsset(\"./img/control/end_turn_on.png\")\n this.endTurnIconOff = AM.getAsset(\"./img/control/end_turn_off.png\")\n\n this.updateFlag = false;\n\n var w = gameEngine.surfaceWidth;\n var h = gameEngine.surfaceHeight;\n this.aBtn = { x: w - this.btnDim * 4, y: h - this.btnDim };\n this.tBtn = { x: w - this.btnDim * 3, y: h - this.btnDim };\n this.bBtn = { x: w - this.btnDim * 2, y: h - this.btnDim };\n this.eTBtn = { x: w - this.btnDim * 1, y: h - this.btnDim };\n\n this.a_moveBtn = { x: w - this.btnDim * 4, y: h - this.btnDim * 2 };\n this.a_capBtn = { x: w - this.btnDim * 5, y: h - this.btnDim * 2 };\n this.t_infBtn = { x: w - this.btnDim * 3, y: h - this.btnDim * 2 };\n this.t_arcBtn = { x: w - this.btnDim * 4, y: h - this.btnDim * 2 };\n this.b_farmBtn = { x: w - this.btnDim * 2, y: h - this.btnDim * 2 };\n this.b_barBtn = { x: w - this.btnDim * 3, y: h - this.btnDim * 2 };\n\n this.menu = [{ name: \"action\", x: this.aBtn.x, y: this.aBtn.y, w: this.btnDim, h: this.btnDim },\n { name: \"troop\", x: this.tBtn.x, y: this.tBtn.y, w: this.btnDim, h: this.btnDim },\n { name: \"building\", x: this.bBtn.x, y: this.bBtn.y, w: this.btnDim, h: this.btnDim },\n { name: \"endTurn\", x: this.eTBtn.x, y: this.eTBtn.y, w: this.btnDim, h: this.btnDim }];\n\n this.actionMenu = [{ name: \"moveCap\", x: this.a_capBtn.x, y: this.a_capBtn.y, w: this.btnDim, h: this.btnDim },\n { name: \"moveFight\", x: this.a_moveBtn.x, y: this.a_moveBtn.y, w: this.btnDim, h: this.btnDim }];\n\n this.troopMenu = [{ name: \"troop1\", x: this.t_infBtn.x, y: this.t_infBtn.y, w: this.btnDim, h: this.btnDim },\n { name: \"troop2\", x: this.t_arcBtn.x, y: this.t_arcBtn.y, w: this.btnDim, h: this.btnDim }];\n\n this.buildingMenu = [{ name: \"farm\", x: this.b_farmBtn.x, y: this.b_farmBtn.y, w: this.btnDim, h: this.btnDim },\n { name: \"barracks\", x: this.b_barBtn.x, y: this.b_barBtn.y, w: this.btnDim, h: this.btnDim }];\n\n this.moveDelay = false;\n this.currentRegion = null;\n this.moveSource = null;\n this.moveDestination = null;\n\n this.destinationSelect = false;\n this.destinationSelectCaptain = false;\n\n this.actionFlag = false; // Display action sub-menu\n this.troopFlag = false; // Display troop sub-menu\n this.buildingFlag = false; // Display building sub-menu\n\n // Mega Menu On/Off boolean\n this.actionActive = false;\n this.troopActive = false;\n this.buildingActive = false;\n this.endTurnActive = true;\n\n // Sub-menu On/Off boolean\n this.moveActive = false;\n this.capActive = false;\n this.soldierActive = false;\n this.archerActive = false;\n this.barracksActive = false;\n this.farmActive = false;\n\n\n //Hover mega menu\n this.actionHover = false;\n this.troopHover = false;\n this.buildingHover = false;\n this.endHover = false;\n\n //Sub menu\n this.moveHover = false;\n this.capHover = false;\n this.soldierHover = false;\n this.archerHover = false;\n this.barracksHover = false;\n this.farmHover = false;\n\n GUIEntity.call(this, game, 0, 0);\n}", "title": "" }, { "docid": "d811fa60e81ec396b2269effe9098864", "score": "0.5623635", "text": "function resetBtnKillSamples() {\n for(var i=0; i<rows; i++) {\n for(var j=0; j<cols; j++) {\n if(resetBtnHover === true) {\n samples[i][j].killAll();\n recordingStudio.killAll();\n\n sineInstrumentButton.killAll();\n triangleInstrumentButton.killAll();\n sawInstrumentButton.killAll();\n squareInstrumentButton.killAll();\n clicked = false;\n }\n }\n }\n}", "title": "" }, { "docid": "07170e77495251ff058556dc58e0a0fb", "score": "0.5609783", "text": "run() {\n this.checkMouse(); \n\n noFill();\n strokeWeight(7.5);\n\n if(this.itemID === currentItem) {\n image(images.border3, this.x - this.width * 0.028, this.y - this.height * 0.08, this.width * 1.066, this.height * 1.12);\n }\n else if (this.mouse) {\n image(images.border2, this.x - this.width * 0.028, this.y - this.height * 0.08, this.width * 1.066, this.height * 1.12);\n }\n else {\n image(images.border, this.x - this.width * 0.028, this.y - this.height * 0.08, this.width * 1.066, this.height * 1.12);\n }\n\n if (mouseX >= this.x && mouseY >= this.y && mouseX <= this.x + this.width && mouseY <= this.y + this.height) {\n cursor(\"assets/cursors/gotomenu.cur\");\n }\n\n image(this.icon, this.x, this.y, this.width, this.height);\n\n if(this.mouse && mouseIsPressed && !globalMouse) {\n globalMouseToggle = 1;\n currentItem = this.itemID;\n if (volumeControl) {\n sound.clickItem.setVolume(0.1);\n sound.clickItem.play();\n }\n }\n\n }", "title": "" }, { "docid": "f1a095b6cdda275cb6cbd9ab110ea3f3", "score": "0.5609513", "text": "function randomize ()\n{\n\n // Clear all the buttons\n for (var row = 0; row < 5; row++)\n {\n for (var col = 0; col < 5; col++)\n {\n clear(row, col);\n }\n }\n\n // Make 15 moves at random\n for (var moves = 0; moves < 15; moves++)\n {\n var row = Math.floor(Math.random()*5);\n var col = Math.floor(Math.random()*5);\n play(row,col);\n }\n}", "title": "" }, { "docid": "b1bc75832ea1858577f7261a0162052b", "score": "0.560661", "text": "playVictorySequence() {\n // iterator for timed loop\n let i = 0;\n\n // interval used for time between button sounds\n let buttonPlayInterval = null;\n\n // duration between button sounds\n const intervalSpeed = 525;\n\n // duration of sound\n const soundDuration = 500;\n\n // create a timed loop for playback of button presses\n buttonPlayInterval = setInterval(() => {\n // play all buttons simulataneously\n this.playButtonSound(1);\n this.playButtonSound(2);\n this.playButtonSound(3);\n this.playButtonSound(4);\n\n // highlight all buttons\n $('.button').each(function () {\n $(this).addClass('button-active');\n });\n\n // wait for 500 ms then stop the button sounds\n setTimeout(() => {\n this.stopButtonSounds();\n\n // un-highlight all buttons\n $('.button').each(function () {\n $(this).removeClass('button-active');\n });\n }, soundDuration);\n\n // increment the iterator\n i += 1;\n\n // stop the timed loop if iterator has repeated 3 times\n if (i >= 3) {\n clearInterval(buttonPlayInterval);\n }\n }, intervalSpeed);\n }", "title": "" }, { "docid": "c798771bed69162d225dc6b777593f8f", "score": "0.56053513", "text": "draw() {\n\t\tfor( let i = 0; i < this.clickableArray.length; i++ ) {\n\t\t\tthis.clickableArray[i].draw();\n\t\t}\n\t}", "title": "" }, { "docid": "6b7d01dcf482bc669ded1c956994ca97", "score": "0.56048787", "text": "play() {\n // play button properties\n this.playButton = {\n x: width / 2,\n y: height / 2 + 50,\n w: 150,\n h: 80,\n tl: 15,\n tr: 15,\n bl: 15,\n br: 15,\n textSize: 35,\n fillColor: color(35, 145, 200)\n }\n push();\n noStroke();\n rectMode(CENTER);\n fill(this.playButton.fillColor);\n rect(this.playButton.x, this.playButton.y, this.playButton.w, this.playButton.h, this.playButton.tl, this.playButton.tr, this.playButton.br, this.playButton.bl);\n fill(255);\n textSize(this.playButton.textSize);\n textAlign(CENTER);\n text(\"PLAY\", this.playButton.x, this.playButton.y + 10);\n pop();\n }", "title": "" }, { "docid": "4d85121799194270debd11548738e617", "score": "0.5604536", "text": "function renderButtons() {\n // THIS IS TO PREVENT REPEAT BUTTONS AND DELETE SHOWS PRIOR TO ADDING NEW SHOWS\n $(\"#buttons-view\").empty();\n\n // LOPPS THROUGH THE ARRAY OF TOPICS\n for (var i = 0; i < topics.length; i++) {\n\n // THIS IS TO GENERATE BUTTONS FOR EACH SHOW IN THE ARRAY\n // CREATING A <BUTTON> TAG FOR EACH TOPIC\n var buttons = $(\"<button>\");\n // Adding a class of movie-btn to our button\n buttons.addClass(\"show-btn\");\n // Adding a data-attribute\n buttons.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n buttons.text(topics[i]);\n // Adding the buttons to the buttons-view div\n $(\"#buttons-view\").append(buttons);\n\n } \n displayGifs();\n}", "title": "" }, { "docid": "73bd3614122835cc7dbdb6e9893f42ac", "score": "0.56025577", "text": "function controlImgs() {\n if (index === slides.length) {\n index = 0;\n } else if (index < 0) {\n index = slides.length-1;\n }\n\n slides.forEach(slide => {\n slide.style.transform = `translateX(-${index * 100}%)`;\n });\n \n showNamePaint();\n}", "title": "" }, { "docid": "c2f7b161b968759839a05aaf29a93eaf", "score": "0.5601687", "text": "function scissorShow()\r\n{\r\n rockButt.style.visibility=\"hidden\"\r\n paperButt.style.borderColor=\"yellow\"\r\n paperIcon[0].style.display=\"none\";\r\n scissorsIcon[0].style.display=\"block\"\r\n\r\n}", "title": "" }, { "docid": "5872412ffa6ba9cf3b97ebacd81133cf", "score": "0.55992836", "text": "function checkButtonOverlay() {\r\n var btn = document.querySelectorAll(\".keycap, .keycap-wide\");\r\n for (var i = 0; i < btn.length; i++) {\r\n if (isSleeping) {\r\n btn[i].style.opacity = 0.4;\r\n } else {\r\n btn[i].style.opacity = 1;\r\n }\r\n\r\n }\r\n}", "title": "" }, { "docid": "706b2e55e7bc8cdb025a640a4f99aff0", "score": "0.55976945", "text": "function buildslots()\n{\n\t\t// iterate args\n\t\tfor(k=0;k<slotnum;k++)\n\t\t{\n\t\t\tx = 0; // set object’s x co-ordinate\n\t\t\ty = 15 * (k+1); // set object’s y co-ordinate\n\t\t\ttwoclickObjects[4*k+3] = this.patcher.newdefault( x, y, \"ubutton\", \"@varname\", modulename + \"-\" + (k+1) + \"-\" + slottype + \"-slot\", \"@patching_rect\", x, y, 105, 15, \"@presentation_rect\", x, y, 105, 15, \"@presentation\", 1, \"@hltcolor\", 0.05, 0.97, 0.39, 0.5, \"@rounded\", 0);\n\n\t\t\ttwoclickObjects[4*k] = this.patcher.newdefault( x, y, \"textbutton\", \"@varname\", modulename + \"-\" + (k+1) + \"-\" + slottype + \"-slot-label\", \"@patching_rect\", x, y, 15, 15, \"@presentation_rect\", x, y, 15, 15, \"@presentation\", 1, \"@mode\", 1, \"@text\", k+1, \"@texton\", k+1, \"@fontname\", \"Arial\", \"@fontsize\", 10., \"@fontface\", 1, \"@align\", 1, \"@bgcolor\", 0.25, 0.25, 0.25, 1., \"@textcolor\", 0.96, 0.96, 0.96, 1., \"@border\", 1, \"@rounded\", 0, \"@bordercolor\", 1., 1., 1., 1., \"@bgoncolor\", 0.05, 0.97, 0.39, 1., \"@textoncolor\", 0., 0., 0., 1., \"@borderoncolor\", 0.05, 0.97, 0.39, 1.);\n\n\t\t\ttwoclickObjects[4*k+1] = this.patcher.newdefault( x+15, y, \"textbutton\", \"@varname\", modulename + \"-\" + (k+1) + \"-\" + slottype + \"-slot-val\", \"@patching_rect\", x+15, y, 90, 15, \"@presentation_rect\", x+15, y, 90, 15, \"@presentation\", 1, \"@mode\", 1, \"@text\", \"[empty]\", \"@texton\", \"[empty]\", \"@fontname\", \"Arial\", \"@fontsize\", 10., \"@fontface\", 1, \"@align\", 0, \"@bgcolor\", 0.96, 0.96, 0.96, 1., \"@textcolor\", 0.2, 0.2, 0.2, \"@border\", 1, \"@rounded\", 0, \"@bordercolor\", 1., 1., 1., 1., \"@bgoncolor\", 0.05, 0.97, 0.39, 1., \"@textoncolor\", 0., 0., 0., 1., \"@borderoncolor\", 0.05, 0.97, 0.39, 1.);\n\t\t}\n\n\t\t// print done building confirmation in Max window\n\t\tif(modulename.length) {\n\t\t\tpost(modulename + ':')\n\t\t}\n\t\tpost('Done building ' + slotnum + ' ' + slottype + 'put(s).\\n');\n\t\tsetdict(); // add all the created slots to the global dictionary\n\t\tresizebpatcher();\n}", "title": "" }, { "docid": "58624534a44fa295da3685b42a546922", "score": "0.5596816", "text": "function enableRemainingSlots() {\n var htmlTileArr = document.getElementsByClassName(\"empty\");\n // console.log(htmlTileArr);\n for (i = 0; i < htmlTileArr.length; i++) {\n var disc = htmlTileArr[i];\n disc.className = \" disc empty\";\n disc.onclick = function () {\n // console.log(this.id);\n hoverSound.play();\n drop(this.id);\n swapTurn();\n }\n disc.onmouseover = function () {\n // console.log(this.id);\n highlight(this.id);\n }\n disc.onmouseleave = function () {\n // console.log(this.id);\n dehighlight(this.id);\n }\n }\n}", "title": "" }, { "docid": "176e7f6ec1a7308b6234e7ca7844f95e", "score": "0.5596745", "text": "function whiteBoard() {\n\n isWhiteBoard = true;\n\n const div = document.createElement('div');\n div.style.padding = '5px';\n div.setAttribute('id', 'canvas');\n\n const div1 = document.createElement('div');\n div1.classList.add('box-position');\n\n\n div1.innerHTML = `<div class=\"white-board-icons\" style=\"\" id=\"\" onclick=\"cross()\">\n <i class=\"fas fa-times\"></i>\n </div>\n <div class=\"white-board-icons\" style=\"top:50px;\" id=\"\" onclick=\"pencil()\">\n <i class=\"fas fa-pencil-alt\"></i>\n </div>\n <div class=\"white-board-icons\" style=\"top:100px;\" id=\"\" onclick=\"eraser()\">\n <i class=\"fas fa-eraser\"></i>\n </div>\n <div class=\"white-board-icons colour\" style=\"top:150px; background-color:red;\" id=\"\" onclick=\"red()\">\n </div>\n <div class=\"white-board-icons colour\" style=\"top:200px; background-color:green;\" id=\"\" onclick=\"green()\">\n </div>\n <div class=\"white-board-icons colour\" style=\"top:250px; background-color:blue;\" id=\"\" onclick=\"blue()\">\n </div>\n <div class=\"white-board-icons colour\" style=\"top:300px; background-color:yellow;\" id=\"\" onclick=\"yellow()\">\n </div>`;\n\n const canvas = document.createElement('canvas');\n\n div1.appendChild(canvas);\n div.appendChild(div1);\n\n for (let i = 0; i < videoGrid1.childNodes.length; i++) {\n videoGrid1.childNodes[i].style.display = 'none';\n }\n\n div.classList.add('resize');\n\n videoGrid1.appendChild(div);\n\n\n const ctx = canvas.getContext('2d');\n\n let painting = false;\n let lastX = 0;\n let lastY = 0;\n\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetHeight;\n\n ctx.lineJoin = 'round';\n ctx.lineCap = 'round';\n\n\n console.log(ctx)\n\n function startPosition(e) {\n painting = true;\n lastX = e.offsetX;\n lastY = e.offsetY;\n }\n\n function finishPosition(e) {\n painting = false;\n }\n\n // drawing the design and sending the coordinates, pencil-color and pencil-width immediately to other users.\n\n function draw(e) {\n\n if (!painting) return;\n\n ctx.strokeStyle = pencilColor;\n ctx.lineWidth = pencilWidth;\n\n ctx.beginPath();\n ctx.moveTo(lastX, lastY);\n\n ctx.lineTo(e.offsetX, e.offsetY);\n ctx.stroke();\n\n socket.emit('draw', lastX, lastY, e.offsetX, e.offsetY, pencilColor, pencilWidth);\n\n lastX = e.offsetX;\n lastY = e.offsetY;\n }\n\n canvas.addEventListener('mousedown', startPosition);\n canvas.addEventListener('mouseup', finishPosition);\n canvas.addEventListener('mouseout', finishPosition);\n canvas.addEventListener('mousemove', draw);\n}", "title": "" }, { "docid": "aadb02013e28c86ae12fd42bee6986ce", "score": "0.5591421", "text": "function play() {\n let sq = document.querySelectorAll('.squares');\n let counter = 0;\n let index = [];\n sq.forEach(item => {\n item.addEventListener('mousedown', event => {\n \n //check number of clicks ==2 because you only need to move piece from index1 to index2 (i.e 2 clicks)\n if (counter == 1) {\n index.push(item.id - 1);\n item.style.backgroundColor = \"orange\";\n if (isLegal(index)) {\n movePiece(index);\n }\n else {\n console.log(\"Illegal move made.Select another.\");\n } \n \n removeSquareSelection(index); \n counter = 0; \n index = [];\n return 0;\n }\n //else highlight the square\n else {\n item.style.backgroundColor = \"orange\";\n index.push(item.id - 1);\n counter++;\n }\n })\n })\n }", "title": "" }, { "docid": "5ab4ac597b234b38edd3fe09aa308ca9", "score": "0.558643", "text": "function rPlayerX(){\r\n realPlayer = \"x\";\r\n pcPlayer = \"o\";\r\n\r\n //change the shape of the button to make the user know he shouldn't use them at the middle of the game\r\n realPlayerX.classList.add(\"inactive\");\r\n realPlayerO.classList.add(\"inactive\");\r\n\r\n //also for more certainty we make the buttons fade away \r\n let i = 1;\r\n var inter = setInterval( function(){\r\n realPlayerX.style.opacity = i;\r\n realPlayerO.style.opacity = i;\r\n i-=0.1;\r\n if(i <= 0){\r\n realPlayerX.style.opacity = 0;\r\n realPlayerO.style.opacity = 0;\r\n clearInterval(inter);\r\n }\r\n }, 50);\r\n\r\n //make the cells clickable for the user to play\r\n for (let i = 0; i < cells.length; i++) {\r\n cells[i].addEventListener('click', eventListener);\r\n cells[i].classList.remove(\"inactive-cells\");\r\n }\r\n\r\n //buttons disappear but the user can still click on the empty space \r\n //so i removed the effect of the click to prevent errors\r\n realPlayerX.removeEventListener(\"click\", rPlayerX);\r\n realPlayerO.removeEventListener(\"click\", rPlayerO);\r\n}", "title": "" }, { "docid": "35d859239ddc2880ef2bd3701443cc65", "score": "0.55789936", "text": "function renderButtons() {\n\n // starting out with an empty page\n $(\"#buttons-view\").empty();\n\n // Looping through the array of gifs (Line 06)\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n var newButton = $(\"<button>\");\n // Adding a class of gif-btn to our button\n newButton.addClass(\"gif-btn\");\n // Adding a data-attribute\n newButton.attr(\"gif-input\", gifs[i]);\n // Providing the initial button text\n newButton.text(gifs[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(newButton);\n }\n}", "title": "" }, { "docid": "b220dd088910f15a17f2fb0af01e5b40", "score": "0.55789375", "text": "function buttonsAndLabels(){\r\n // setting button styles\r\n let buttonStyle = new PIXI.TextStyle({\r\n fill: 0x000000,\r\n fontSize: 48,\r\n fontFamily: \"Impact\",\r\n stroke:0xFF0000,\r\n strokeThickness:3 \r\n });\r\n \r\n //setting start screen label\r\n let startLabel1 = new PIXI.Text(\"Night Walk 2!\");\r\n //setting style\r\n startLabel1.style = new PIXI.TextStyle({\r\n fill: 0x000000,\r\n fontSize:96,\r\n fontFamily:\"Impact\",\r\n stroke:0xFF0000,\r\n strokeThickness:6\r\n })\r\n \r\n //setting start label position\r\n startLabel1.x = sceneWidth/4 - 50; \r\n startLabel1.y = sceneHeight - 520;\r\n //appending start label\r\n startScene.addChild(startLabel1);\r\n \r\n\r\n // setting start screen button\r\n let startButton = new PIXI.Text(\"Start\");\r\n //setting style\r\n startButton.style = buttonStyle;\r\n //setting start button positions\r\n startButton.width = 150;\r\n startButton.x = sceneWidth/2 - 90;\r\n startButton.y = sceneHeight - 300;\r\n \r\n //setting start button properties\r\n startButton.interactive = true;\r\n startButton.buttonMode = true;\r\n startButton.on(\"pointerup\",startGame);\r\n startButton.on('pointerover', e=>e.target.alpha = 0.7);\r\n startButton.on('pointerout', e=>e.currentTarget.alpha = 1.0);\r\n \r\n //appending start button\r\n startScene.addChild(startButton);\r\n \r\n \r\n//setting up gameover labels\r\n \r\n //setting up first gameover label\r\nlet gameOverText = new PIXI.Text(\"Game Over!\");\r\n //setting up gameover label style\r\nlet textStyle = new PIXI.TextStyle({\r\n fill: 0x000000,\r\n fontSize:96,\r\n fontFamily:\"Impact\",\r\n stroke:0xFF0000,\r\n strokeThickness:6\r\n});\r\ngameOverText.style = textStyle;\r\n //setting up gameover label positions\r\ngameOverText.x = sceneWidth/4 - 10;\r\ngameOverText.y = sceneHeight - 620;\r\n //appending gameover label\r\ngameOverScene.addChild(gameOverText);\r\n \r\n \r\n//creating new style for gameOverScore label\r\nlet textStyle2 = new PIXI.TextStyle({\r\n\tfill: 0x000000,\r\n fontSize:34,\r\n fontFamily:\"Impact\",\r\n stroke:0xFF0000,\r\n strokeThickness:6\r\n});\r\ngameOverScoreLabel.style = textStyle2;\r\n \r\n//setting gameOverScoreLabel position\r\ngameOverScoreLabel.x = sceneWidth/4 + 120;\r\ngameOverScoreLabel.y = sceneHeight - 420;\r\n //appending gameOverScore Label\r\ngameOverScene.addChild(gameOverScoreLabel);\r\n \r\n //if the highscore is undifined then it equals 0\r\n if(highScore == undefined){\r\n highScore = 0; \r\n } \r\n \r\n //setting highscore label\r\n highScoreLabel.text = (`High Score: ${highScore}`);\r\n //setting highscore label style\r\nhighScoreLabel.style = textStyle2;\r\n //setting highscore label position\r\nhighScoreLabel.x = sceneWidth/4 + 120;\r\nhighScoreLabel.y = sceneHeight - 320;\r\n //appending highscore label\r\ngameOverScene.addChild(highScoreLabel);\r\n \r\n\r\n// setting up replay button\r\nlet playAgainButton = new PIXI.Text(\"Play Again?\");\r\n //setting replay button style\r\nplayAgainButton.style = buttonStyle;\r\n //setting replay button position\r\nplayAgainButton.x = sceneWidth/4 + 100;\r\nplayAgainButton.y = sceneHeight - 200;\r\n //setting replay button properties\r\nplayAgainButton.interactive = true;\r\nplayAgainButton.buttonMode = true;\r\nplayAgainButton.on(\"pointerup\",startGame); \r\nplayAgainButton.on('pointerover',e=>e.target.alpha = 0.7); \r\nplayAgainButton.on('pointerout',e=>e.currentTarget.alpha = 1.0); \r\n //appending replay button\r\ngameOverScene.addChild(playAgainButton);\r\n \r\n \r\n //setting up style for score label\r\n let scoreStyle = new PIXI.TextStyle({\r\n fill: 0xFFFFFF,\r\n fontSize: 18,\r\n fontFamily: \"Impact\",\r\n stroke: 0xFF0000,\r\n strokeThickness: 4\r\n });\r\n\r\n //setting up scoreLabel style\r\n scoreLabel.style = scoreStyle ;\r\n //setting scoreLabel position\r\n scoreLabel.x = 5;\r\n scoreLabel.y = 5;\r\n //appending score Label\r\n gameScene.addChild(scoreLabel); \r\n}", "title": "" }, { "docid": "c148a880cbfa0bb012f696194daed4c9", "score": "0.5574863", "text": "function displayButtons(player) {\n $(\"#rpsPlaceholder\").empty();\n for (var i = 0; i < plays.length; i++) {\n var newButton = $(\"<button>\");\n newButton.addClass(\"btn m-2 text-white btn-primary\");\n newButton.addClass(player);\n newButton.attr(\"choice\", plays[i]);\n newButton.text(plays[i]);\n newButton.appendTo($(\"#rpsPlaceholder\"));\n }\n}", "title": "" }, { "docid": "03edd94308a0fdf4247af2ea9eba6bb5", "score": "0.5573513", "text": "function drawbricks(){\n bricks.forEach(column => {\n column.forEach(brick=>{\n gamedisplay.beginPath();\n gamedisplay.rect(brick.x,brick.y,brick.w,brick.h);\n gamedisplay.fillStyle = brick.visible ? '#ff0023' : 'transparent';\n gamedisplay.fill();\n gamedisplay.closePath();\n });\n });\n}", "title": "" }, { "docid": "85df2ab13dbbf03705ff0bd3d008566a", "score": "0.5572951", "text": "function ableClick(){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.pointerEvents = 'auto';\n\t};\n}", "title": "" }, { "docid": "159feb8581057932aef405b946ce99f3", "score": "0.55723786", "text": "run(){\n\t\tthis.setState({\n\t\t\tbuttons: {\n\t\t\t\trun: true,\n\t\t\t\tclear: false,\n\t\t\t\tpause: false\n\t\t\t},\n\t\t\tshouldDraw: true,\n\t\t\tshouldLoop: true\n\n\t\t}, ()=> {this.draw();});\t\n\n\t}", "title": "" }, { "docid": "b69f337dfbf678d6d133a732db168da2", "score": "0.556979", "text": "function renderButtons(item) { \n $(\"#buttons-view\").empty();\n for (var i = 0; i < gifs.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"gif-btn\");\n a.attr(\"data-gif\", gifs[i]);\n a.text(gifs[i]);\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "d1b275873b7c569051d06996f3a3d280", "score": "0.5562931", "text": "addButtonsGUI() {\n this.gui.add(this.scene.gameOrchestrator, 'start').name('Start new game');\n this.gui.add(this.scene.gameOrchestrator, 'undo').name('Undo');\n this.gui.add(this.scene.gameOrchestrator, 'pause').name('Pause/Continue');\n this.gui.add(this.scene.gameOrchestrator, 'replay').name('Replay');\n this.gui.add(this, 'cameraLock').name('Lock camera');\n this.gui.add(this.scene.gameOrchestrator, 'playTime', 5, 60, 1).name('Time').onChange(null).step(1);\n }", "title": "" }, { "docid": "89680ffcf101b32288587eb380bb3d37", "score": "0.55622965", "text": "function turnStructure(player) {\n var validPlay;\n var clickedBox = event.target;\n var clickedId = parseInt(event.target.id);\n for (i = 1; i <= rows; i++) {\n if (clickedBox.classList.contains(\"empty\")) {\n clickedBox.classList.add(player, \"in-play\");\n clickedBox.classList.remove(\"empty\", \"alliance-hover\", \"imperial-hover\");\n validPlay = true;\n break;\n } else {\n clickedId = clickedId + 10;\n clickedBox = document.getElementById(clickedId);\n }\n }\n if (validPlay === true) {\n clickerCount++;\n stackPlay(clickedId);\n validPlay = undefined;\n }\n\n\n}", "title": "" }, { "docid": "d16e943016ffb2f03b165179bc7c22f1", "score": "0.5562089", "text": "function updateButtons()\r\n{\r\n\t// Play Button\r\n\tif (!BG.musicTag.paused && !BG.musicTag.ended)\t// if (music is PLAYING and NOT OVER)\r\n\t{\r\n\t\tplayButton.style.backgroundImage = \"url(Images/pauseButton.png)\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tplayButton.style.backgroundImage = \"url(Images/playButton.png)\";\r\n\t}\r\n\t// Mute Button\r\n\tif (BG.musicTag.muted == true)\t\t// If the track is already muted, show mute button.\r\n\t{\r\n\t\tmuteButton.style.backgroundImage = \"url(Images/muteButton.png)\";\r\n\t}\r\n\telse\t// track is not muted.\r\n\t{\r\n\t\tmuteButton.style.backgroundImage = \"url(Images/speakerButton.png)\";\r\n\t}\r\n}", "title": "" }, { "docid": "9b5793fac22de8dce30d616799c9446f", "score": "0.5555751", "text": "function renderButtons() {\n\n // Deletes the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#gif-buttons\").empty();\n\n // Loops through the array of sports\n for (var i = 0; i < sports.length; i++) {\n\n // Then dynamicaly generates buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<div class=button>\");\n // Adds a class of movie to our button\n a.addClass(\"btn btn-warning sport\");\n // Added a data-attribute\n a.attr(\"data-name\", sports[i]);\n // Provided the initial button text\n a.text(sports[i]);\n // Added the button to the buttons-view div\n $(\"#gif-buttons\").append(a);\n };\n }", "title": "" } ]
65f82cc72e4098ff051b9405b39eff29
Returns PieceColor.white || PieceColor.black || null
[ { "docid": "3eed257c640decb49edddf85971c5587", "score": "0.63943845", "text": "function getPieceColor(chessBoard, row, col) {\n var target = chessBoard.rows[row].cells[col];\n var subImages = target.getElementsByTagName(\"img\");\n if (subImages.length == 0) {\n return null;\n }\n\n return target.getElementsByTagName(\"img\")[0].dataset.pieceColor;\n}", "title": "" } ]
[ { "docid": "ebee5c8930c17a2cf5aab49524650571", "score": "0.68737054", "text": "function getColourOfPiece(piece) {\n\tif(piece == ' ') {\n\t\treturn(pieceColours.EMPTY);\n\t}\n\tif(piece . toUpperCase() == piece) {\n\t\treturn(pieceColours.WHITE);\n\t}\n\treturn(pieceColours.BLACK);\n}", "title": "" }, { "docid": "1d7db6a88ecce7ecc5ca8ce7de55fb21", "score": "0.6683044", "text": "static getPieceColor(tile) {\n if (tile.match(/[♙♖♘♗♕♔]/)) {\n return \"W\";\n } else if (tile.match(/[♟♜♞♝♛♚]/)) {\n return \"B\";\n } else {\n return \"E\";\n }\n }", "title": "" }, { "docid": "c72b877f859c670b2807abb17e153f3a", "score": "0.664594", "text": "function colorOfPiece(board, row, col) {\r\n const piece = board.pieceAt(row, col);\r\n if (piece === null) return null;\r\n return piece.color;\r\n}", "title": "" }, { "docid": "78736fda68f66d0e3ad7440d75a8d561", "score": "0.65195596", "text": "checkForPromotion(color) {\n const pieces = this.board.pieces(color);\n for (let piece of pieces) {\n if (!piece || !(piece instanceof Pawn)) continue;\n if (piece.position.row === (color === WHITE ? 0 : 7))\n return piece;\n }\n return null;\n }", "title": "" }, { "docid": "b4cee0420bce9d54136aa73bfe58ba65", "score": "0.6380034", "text": "setColor(){\r\n if(this.neighbours < 2){\r\n return Cell.colours[0];\r\n }else if(this.neighbours > 3){\r\n return Cell.colours[2];\r\n }else{\r\n return Cell.colours[1];\r\n }\r\n }", "title": "" }, { "docid": "8c0f4259b17c4455805958fb2ec50709", "score": "0.6337701", "text": "isSameColor(piece) {\n return this.color === piece.color;\n }", "title": "" }, { "docid": "3017855c8c916c7a49839081cac65bdf", "score": "0.62885463", "text": "wrongColor(piece) {\r\n return this.state.gameInfo.getTurn() !== piece.color;\r\n }", "title": "" }, { "docid": "d26b7be744c8db3f3c005fc8f6df4dbb", "score": "0.6259663", "text": "getPieceColor(cords){\n\t\tlet color = this.board[cord[1]][cord[0]][0];\n\t\treturn color;\n\t}", "title": "" }, { "docid": "251523e0e8f403f52d51a264e4b4bdab", "score": "0.6160574", "text": "function whiteOrBlack(cell) {\n const blackFirst = [\"A\", \"C\", \"E\", \"G\"];\n if (blackFirst.includes(cell[0])) {\n return cell[1] % 2 === 1 ? \"black\" : \"white\";\n } else {\n return cell[1] % 2 === 1 ? \"white\" : \"black\";\n }\n}", "title": "" }, { "docid": "cbf99f84868c543bc7ec287bc9db17af", "score": "0.6145541", "text": "function getColor(piece) {\n var color = \"\";\n switch (piece) {\n case \"a\":\n case \"b\":\n case \"c\":\n case \"d\":\n color = \"white\";\n break;\n case \"e\":\n case \"f\":\n case \"g\":\n case \"h\":\n color = \"green\";\n break;\n case \"i\":\n case \"j\":\n case \"k\":\n case \"l\":\n color = \"red\";\n break;\n case \"m\":\n case \"n\":\n case \"o\":\n case \"p\":\n color = \"blue\";\n break;\n case \"r\":\n case \"s\":\n case \"t\":\n case \"u\":\n color = \"orange\";\n break;\n case \"v\":\n case \"w\":\n case \"x\":\n case \"z\":\n color = \"yellow\";\n break;\n\n default:\n color = \"unkown\";\n }\n return color;\n}", "title": "" }, { "docid": "204d026a5e33eb79261ed991140644c5", "score": "0.6141443", "text": "opposite(color) {\n return color === WHITE ? BLACK : WHITE;\n }", "title": "" }, { "docid": "769a15950a6e5de1a76044e9b9a2b151", "score": "0.6126604", "text": "getOppPieces() {\r\n return this.getInPlay(\r\n this.state.gameInfo.oppColor(this.state.gameInfo.getTurn())\r\n );\r\n }", "title": "" }, { "docid": "e0b25560f467af7281d14c28e0c2c127", "score": "0.60214955", "text": "function samePiece(p1, p2) {\n return p1 != null && p2 != null && p1.color === p2.color && p1.piece === p2.piece\n}", "title": "" }, { "docid": "de8d1c2f76b9952655606e6395a92530", "score": "0.5878017", "text": "function get_color(x, y) {\n let figure = map [x] [y];\n if (figure == '')\n return \" \";\n // since we know that the upper case is white, we check if\n // figure is equal to itself, so it's white\n return (figure.toUpperCase() == figure) ? \"white\" : \"black\";\n}", "title": "" }, { "docid": "3e1967e10e2d7860b04c8d5d8eae6b27", "score": "0.58602124", "text": "get color() {\n return this.suit === \"♣\" || this.suit === \"♠\" ? \"black\" : \"red\"\n }", "title": "" }, { "docid": "cc3b33e627c3e61cb189403bb5f1f3f0", "score": "0.5810094", "text": "function brickColoring(element) {\n if( element == 0)\n color = \"white\"\n else\n color = \"rgb(273,200,71)\" // yellowish\n return color\n }", "title": "" }, { "docid": "5137571ac896ef8ec97380c4020ff17a", "score": "0.57917863", "text": "function colorStates() {\n cholorpleth.style('fill', d => {\n const value = d.properties.value;\n if (value) {\n return color(value); // if value exists\n } else {\n return '#ccc'; //if value is undefined\n }\n });\n }", "title": "" }, { "docid": "239339449c5e47f085a3a978daab244d", "score": "0.57892483", "text": "get transparent() {\n try {\n let tuple = this._getRGBATuple();\n return !(tuple.r || tuple.g || tuple.b || tuple.a);\n } catch(e) {\n return false;\n }\n }", "title": "" }, { "docid": "db16b944ff246e56d1ec6e913a1f7232", "score": "0.5753807", "text": "checkWinner() {\n\n\t\tvar whitetotal = 0;\n\t\tvar blacktotal = 0;\n\n\t\tfor (var i = 0; i < this.board.length; i++) {\n\t\t\tfor (var j = 0; j < this.board.length; j++) {\n\t\t\t\tif(this.board[i][j] == Othello.BLACK) {\n\t\t\t\t\tblacktotal++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.board[i][j] == Othello.WHITE) {\n\t\t\t\t\twhitetotal++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (whitetotal < blacktotal) {\n\t\t\treturn Othello.BLACK;\n\t\t}\n\n\t\telse if (blacktotal < whitetotal) {\n\t\t\treturn Othello.WHITE;\n\t\t}\n\n\t\telse {\n\t\t\treturn Othello.TIE;\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "8bfeb8f10af3cfbb5e3534a1afa95042", "score": "0.5728433", "text": "function colorMatchCheck(one,two,three,four){\n return (one===two && one===three && one===four && one !== colorGrey && one !== undefined);\n}", "title": "" }, { "docid": "6eaf3b65a38fcdd8309b8cbefe552657", "score": "0.5712509", "text": "function getPieceColor(status) {\n switch (status.toLowerCase()) {\n case 'failed':\n return 'red';\n case 'skipped':\n case 'incomplete':\n return 'grey';\n case 'passed':\n return 'green';\n }\n }", "title": "" }, { "docid": "168c3d3f0dec38b10e0fef22e7047ca0", "score": "0.56920373", "text": "function isColor(ch) {\n\treturn pieces[\"colors\"].includes(ch);\n}", "title": "" }, { "docid": "6a7270b0f0073073e1fc0494d233921d", "score": "0.5667729", "text": "checkPiece(original, square) {\n const currentPiece = this.getPiece(square);\n if (!currentPiece) return ColoredSquare.EMPTY;\n if (currentPiece.player === original.player) return ColoredSquare.ALLY;\n if (currentPiece instanceof King) return ColoredSquare.ENEMY_KING;\n return ColoredSquare.ENEMY;\n }", "title": "" }, { "docid": "0cc1308a27de55043d385c204a723a53", "score": "0.5616522", "text": "function colorMatchCheck(one,two,three,four){\r\n return (one===two && one===three && one===four && one !== 'rgb(128, 128, 128)' && one !== undefined);\r\n}", "title": "" }, { "docid": "0cc1308a27de55043d385c204a723a53", "score": "0.5616522", "text": "function colorMatchCheck(one,two,three,four){\r\n return (one===two && one===three && one===four && one !== 'rgb(128, 128, 128)' && one !== undefined);\r\n}", "title": "" }, { "docid": "dfc166c119acb26a68d2a58d997f2cb3", "score": "0.5614653", "text": "function getColor(s) {\n return s > 7 ? 'red' :\n s > 6 ? 'blue' :\n s > 5 ? 'yellow' :\n s > 4 ? 'green' :\n s > 3 ? '#FD8D3C' :\n s > 2 ? '#FED976' :\n '#FFEDA0';\n}", "title": "" }, { "docid": "a390b67e8217a4626cc6cbfe5e296f8d", "score": "0.5566564", "text": "function getbgc(blank) {\n\t\t/*#if BG_COLOR_DEBUG\n\t\tif (blank)\n\t\t\treturn xcolors[0x088];\n\t\telse if (hposblank == 1)\n\t\t\treturn xcolors[0xf00];\n\t\telse if (hposblank == 2)\n\t\t\treturn xcolors[0x0f0];\n\t\telse if (hposblank == 3)\n\t\t\treturn xcolors[0x00f];\n\t\telse if (ce_is_borderblank(colors_for_drawing.extra))\n\t\t\treturn xcolors[0x880];\n\t\t//return colors_for_drawing.acolors[0];\n\t\treturn xcolors[0xf0f];\n\t\t#endif*/\n\t\treturn (blank || hposblank || ce_is_borderblank(colors_for_drawing.extra)) ? 0 : colors_for_drawing.acolors[0];\n\t}", "title": "" }, { "docid": "595cea96fc8194df4c4caf9d3ff40bfd", "score": "0.55458516", "text": "function gameCondition(red, col) {\n\t\tlet yPos = modelBoard[col].length - 1;\n\t\tlet xPos = col;\n\t\tlet piece = $(\"board\").childNodes[xPos].childNodes[yPos];\n\t\tlet toCheck = null;\n\n\t\tif (red) {\n\t\t\ttoCheck = \"red\";\n\t\t} else {\n\t\t\ttoCheck = \"black\"\n\t\t}\n\n\t\t// Downward Check\n\t\tlet cnt = 0;\n\t\tif (yPos > winCnt-2) {\n\t\t\tfor (let i = yPos; i >= 0; i--) {\n\t\t\t\tif (getPiece(xPos, i).classList.contains(toCheck)) {\n\t\t\t\t\tcnt++;\n\t\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Horizontal Check\n\t\tcnt = 1;\n\t\t// left\n\t\tfor (let i = xPos-1; i >= 0; i--) {\n\t\t\tif (modelBoard[i][yPos]!=null && getPiece(i, yPos).classList.contains(toCheck)) {\n\t\t\t\tcnt++;\n\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// right\n\t\tfor (let i = xPos+1; i < columns; i++) {\n\t\t\tif (modelBoard[i][yPos]!=null && getPiece(i, yPos).classList.contains(toCheck)) {\n\t\t\t\tcnt++;\n\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Top Left Check\n\t\tcnt = 1;\n\t\tlet x = xPos - 1;\n\t\tlet y = yPos + 1;\n\t\t// Top left\n\t\twhile (x >= 0 && y < rows) {\n\t\t\tif (modelBoard[x][y]!=null && getPiece(x, y).classList.contains(toCheck)) {\n\t\t\t\tx--;\n\t\t\t\ty++;\n\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tx = xPos + 1;\n\t\ty = yPos - 1;\n\t\t// Bottom right\n\t\twhile (x < columns && y >= 0) {\n\t\t\tif (modelBoard[x][y]!=null && getPiece(x, y).classList.contains(toCheck)) {\n\t\t\t\tcnt++;\n\t\t\t\tx++;\n\t\t\t\ty--;\n\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Top Right Check\n\t\tcnt = 1;\n\t\tx = xPos + 1;\n\t\ty = yPos + 1;\n\t\t// Top right\n\t\twhile (x < columns && y < rows) {\n\t\t\tif (modelBoard[x][y]!=null && getPiece(x, y).classList.contains(toCheck)) {\n\t\t\t\tcnt++;\n\t\t\t\tx++;\n\t\t\t\ty++;\n\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tx = xPos - 1;\n\t\ty = yPos - 1;\n\t\t// Bottom left\n\t\twhile (x >= 0 && y >= 0) {\n\t\t\tif (modelBoard[x][y]!=null && getPiece(x, y).classList.contains(toCheck)) {\n\t\t\t\tcnt++;\n\t\t\t\tx--;\n\t\t\t\ty--;\n\t\t\t\tif (cnt===winCnt) alert(toCheck + \" wins!!!!\");\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "3bc4992d8bbd6d604aadc29f2b825d5e", "score": "0.5542181", "text": "function chooseColor(borough) {\r\n if (borough == \"Brooklyn\") return \"blue\";\r\n else if (borough == \"Bronx\") return \"red\";\r\n else if (borough == \"Manhattan\") return \"orange\";\r\n else if (borough == \"Queens\") return \"brown\";\r\n else if (borough == \"Staten Island\") return \"purple\";\r\n else return \"black\";\r\n}", "title": "" }, { "docid": "b9d5992d106d54536e6e7ceeacb926bd", "score": "0.55133516", "text": "function isSameColor(piece, newPiece) {\n return piece[0] === newPiece[0];\n}", "title": "" }, { "docid": "e6a0aebb80350ee64e4c78b9e2709945", "score": "0.55006945", "text": "function getSquareColor(value){\r\n\tif (value == 0)\r\n\t\treturn '#d8d8d8';\r\n\tif (value == 1)\r\n\t\treturn '#be0712'\r\n\tif (value == 2)\r\n\t\treturn '#548039';\r\n\tif (value == 3)\r\n\t\treturn '#5e9cd3'\r\n}", "title": "" }, { "docid": "c9054a6493cfdf175005d30e73358a59", "score": "0.5500256", "text": "function getExistingColor() {\n //원래로컬인데...사용하려고 전역으로 뺌\n existingcolors = findColors(); //레벨1에서 사용된 색들(중복없는 색 배열)\n var bubbletype = bbDic.red; //1로 초기화\n \n ExistColorCount = existingcolors.length;\n \n if (existingcolors.length > 0) {\n bubbletype = existingcolors[randRange(0, existingcolors.length - 1)]; //사용된 색 중에서 1개\n }\n \n var s = convertStr2Arr1D(existingcolors);\n if(dm) console.log(\"getExistingColor: \" + bubbletype + \", color:\" + s);\n \n if(firstRed){\n if(kData.curLevel+1==1 || kData.curLevel+1==2){\n bubbletype=1;\n// player.tiletype=1;\n// player.bubble.tiletype=3;\n// player.nextbubble.tiletype=3;\n firstRed = false;\n }\n } \n return bubbletype;\n}", "title": "" }, { "docid": "3064eb316423e24b41fb124ed1d571a1", "score": "0.549557", "text": "getSolidColor(){\n return this.chemFromProperties()[CHEMICAL_PROPERTY_COLOR_SOLID];\n }", "title": "" }, { "docid": "229d7af20bd3b243b531aaa788434fd5", "score": "0.5488365", "text": "function defuse(wires){\n for (var i = 1; i < wires.length; i++){\n /*if (wires[i-1] == \"white\" && (wires[i] == \"white\" || wires[i] == \"black\"))\n return \"Boom\";\n else if (wires[i-1] == \"red\" && wires[i] != \"green\")\n return \"Boom\";\n else if (*/\n switch(wires[i-1]) {\n case \"white\":\n if (wires[i] == \"white\" || wires[i] == \"black\") return \"Boom\";\n break;\n case \"red\":\n if (wires[i] != \"green\") return \"Boom\";\n break;\n case \"black\":\n if (wires[i] == \"white\" || wires[i] == \"green\" || wires[i] == \"orange\") return \"Boom\";\n break;\n case \"orange\":\n if (wires[i] != \"red\" && wires[i] != \"black\") return \"Boom\";\n break;\n case \"green\":\n if (wires[i] != \"orange\" && wires[i] != \"white\") return \"Boom\";\n break;\n case \"purple\":\n if (wires[i] == \"purple\" || wires[i] == \"green\" || wires[i] == \"orange\" || wires[i] == \"white\") return \"Boom\";\n break;\n }\n\n }\n\n return \"Defused\";\n}", "title": "" }, { "docid": "7f06884a7bfac7284341212dd547b5c7", "score": "0.548808", "text": "function Piece (color) {\n this.color = color;\n}", "title": "" }, { "docid": "47c12eba9db518cf9373db2c16c74664", "score": "0.5472245", "text": "function checkColour(elem, col) {\n if (elem === null)\n return false;\n else if (elem.style.fill != null){\n if (elem.style.fill.toUpperCase() === col)\n return true;\n }\n else if (elem.getAttribute(\"fill\") != null){\n if (elem.getAttribute(\"fill\").toUpperCase() === col)\n return true;\n }\n else\n return false;\n}", "title": "" }, { "docid": "abb0a81139961c99b4efd326548eb5a0", "score": "0.5471887", "text": "isRed(door) {\n if (door.css('background-color') === 'rgb(255, 0, 0)'){\n return true;\n } else {\n return false;\n };\n }", "title": "" }, { "docid": "6a2cf671536d96ae9735dc1f84c36508", "score": "0.5456379", "text": "function Color () {\n return null;\n}", "title": "" }, { "docid": "d448f16fe630e1ace4f7271dfcbf422e", "score": "0.5445504", "text": "function whatDoesItDo(color) { \n if (color !== 'blue' || color !== 'green') {\n color = 'red';\n }\n return color;\n }", "title": "" }, { "docid": "7dd67c113529f359270fc08368c0e9e3", "score": "0.54234153", "text": "function host_polarity_getColor(d) {\n return d > 0.22 ? '#E31A1C' :\n d > 0.20 ? '#FC4E2A' :\n d > 0.18 ? '#FD8D3C' :\n d > 0.16 ? '#FEB24C' :\n d > 0.14 ? '#FED976' :\n '#FFEDA0';\n}", "title": "" }, { "docid": "f4b055985623db3124875c937e00198e", "score": "0.541558", "text": "function getColor(iso2) {\n if (!flagColors[iso2]) {\n return \"white\";\n } else {\n return flagColors[iso2];\n }\n }", "title": "" }, { "docid": "be330290ad71546f7c089f02e89baba9", "score": "0.5405805", "text": "checkOthelloResult() {\n let kingCount = this.board.pieces(WHITE).filter(piece => piece instanceof King).length;\n\n // White has no kings - black won.\n if (kingCount === 0) {\n this.result = BLACK;\n this.resultReason = \"White's king got flipped by Othello rules\";\n }\n // White has 2 kings - white won.\n if (kingCount === 2) {\n this.result = WHITE;\n this.resultReason = \"Black's king got flipped by Othello rules\";\n }\n }", "title": "" }, { "docid": "be90d95c0b75f733722e41cf4c3387d7", "score": "0.5371012", "text": "getColor() {\n const { mapMode,\n availableBikes,\n availableDocks} = this.props;\n\n const counter = mapMode === 'docks' ? availableDocks : availableBikes;\n\n return evaluateColor(counter);\n }", "title": "" }, { "docid": "ff7005144beb9e742d4ec4261ad835c0", "score": "0.5360658", "text": "function oppositeColor(color){\n\tif(color == \"Red\"){\n\t\treturn \"Blue\";\n\t}\n\telse if(color == \"Blue\"){\n\t\treturn \"Red\";\n\t}\n\treturn \"Neutral\";\n}", "title": "" }, { "docid": "e5459bfc594df48e29d60b0081aadf36", "score": "0.5356746", "text": "function isColor$1(value) {\n return value && d3Color.color(value) != null;\n}", "title": "" }, { "docid": "98da98997ab301e05a9ee330ee8e3293", "score": "0.53443295", "text": "getColor() {\n return null;\n }", "title": "" }, { "docid": "c9f7836b9452f146da7cafc1dca9e542", "score": "0.5335841", "text": "function guest_polarity_getColor(d) {\n return d > 0.41 ? '#E31A1C' :\n d > 0.39 ? '#FC4E2A' :\n d > 0.37 ? '#FD8D3C' :\n d > 0.35 ? '#FEB24C' :\n d > 0.33 ? '#FED976' :\n '#FFEDA0';\n}", "title": "" }, { "docid": "d124577adb75d2196204071eb88086a4", "score": "0.5332019", "text": "function checkColor(){\n\tfor (var i = 0; i < circles.length; i++) {\n\t\t// get color of red (0 - 255) from the point of circles, and fill their data with it\n\t\tcircles[i].backgroundColor = (backCtx.getImageData(circles[i].x, circles[i].y, 1, 1)).data[0]\n\t}\n}", "title": "" }, { "docid": "ae874eae6c383068d5648bfee58076bb", "score": "0.53280556", "text": "function whoseMove(lastPlayer, win) {\n return win?lastPlayer:lastPlayer==='black'?'white':'black';\n}", "title": "" }, { "docid": "589f844b69ea4a1538ff265814f138d2", "score": "0.53264564", "text": "function getLeftColor(i) {\r\n\t//if far left side of board then no squares to left\r\n\tif (i % n_by_n_board == 0) {\r\n\t\treturn 'rgba(0,0,0,0)';\r\n\r\n\t}\r\n\t//checks if square to left is off\r\n\telse if (boxes[i - 1].color == 'rgba(0,0,0,0)') {\r\n\t\treturn 'rgba(0,0,0,0)';\r\n\r\n\t}\r\n\t//if none of the above then cell is active\r\n\telse {\r\n\t\treturn boxes[i - 1].color;\r\n\r\n\t}\r\n\t//somehow got outside of if statement\r\n\treturn 'rgba(0,0,0,0)';\r\n\r\n}", "title": "" }, { "docid": "eef5060548b537edd3f8dd3cb174197a", "score": "0.5308294", "text": "function FindPieceCol(sq, position) {\r\n\r\n if(position[sq] == Squares.OUTOFBOUND) {\r\n return Squares.OUTOFBOUND;\r\n } else if (position[sq] == 0) {\r\n return Colour.Both;\r\n } else if (position[sq] < 7) {\r\n return Colour.White;\r\n } else if (position[sq] > 7) {\r\n return Colour.Black;\r\n }\r\n\r\n}", "title": "" }, { "docid": "ad4780c0931efb193b2be64d49a9e305", "score": "0.53042674", "text": "draw (board) {\n for (let r = 0; r < 6; r++) {\n for (let c = 0; c < 7; c++) {\n if (board[r][c] === null) {\n return null;\n }\n }\n }\n return 'draw'; \n }", "title": "" }, { "docid": "86721e4bb5740a056b1da33a4012b589", "score": "0.5296728", "text": "function getWinner(captured) {\n var winner = 'O';\n if (captured.black - captured.white === 0) {\n winner = '';\n }\n else if (captured.white > captured.black) {\n winner = 'X';\n }\n return winner;\n }", "title": "" }, { "docid": "f1d0cd8dd4f60f36381d811327b34267", "score": "0.5288852", "text": "function getPieceValue(piece) {\r\n if (piece === null) {\r\n // Return 0 if piece is null\r\n return 0;\r\n }\r\n // JSON object for all pieces as keys and its values\r\n var pieceValues = {\r\n \"p\": 10,\r\n \"n\": 50,\r\n \"b\": 50,\r\n \"r\": 100,\r\n \"q\": 500,\r\n \"k\": 1000\r\n }\r\n if (piece.type in pieceValues)\r\n {\r\n // If the given piece exists, return the absolute value based upon the player to play\r\n return piece.color === 'w' ? pieceValues[piece.type] : -pieceValues[piece.type];\r\n }\r\n else\r\n {\r\n // Throw unknown piece error otherwise\r\n throw \"Unknown piece type: \" + piece.type;\r\n }\r\n}", "title": "" }, { "docid": "d45bb8aeceb2606906f89ac2594f3f71", "score": "0.52689016", "text": "function basic(time) {\n if( time < timeRed ) {\n return redColor;\n } else if ( time < cycleLength ) {\n return greenColor;\n } else {\n throw \"invalid time: \"+time;\n }\n }", "title": "" }, { "docid": "b59f4674a971fa87d5d3c523cab9dc20", "score": "0.52686244", "text": "function getColor(i) {\n return i > 5 ? '#F30' :\n i > 4 ? '#F60' :\n i > 3 ? '#F90' :\n i > 2 ? '#FC0' :\n i > 1 ? '#FF0' :\n '#9F3';\n }", "title": "" }, { "docid": "6c8a44fd1a8e692b5c8e3135ccaadcc5", "score": "0.52633333", "text": "confirmColor() {\n if (_isEqual(this.state.values, this.props.values)) {\n return \"light\";\n }\n return \"primary\";\n }", "title": "" }, { "docid": "627a4d3bd814c7c1ef1586f33babe56f", "score": "0.52630544", "text": "function guest_polarity_getColor(d) {\n return d > 0.415 ? '#000000' :\n d > 0.390 ? '#132639' :\n d > 0.365 ? '#204060' :\n d > 0.340 ? '#336699' :\n d > 0.315 ? '#3973AC' :\n d > 0.290 ? '#4080BF' :\n d > 0.265 ? '#538CC6' :\n d > 0.240 ? '#6699CC' :\n d > 0.215 ? '#79A6D2' :\n d > 0.190 ? '#8CB3D9':\n d > 0.165 ? '#B3CCE6' :\n '#ECF2F9';\n}", "title": "" }, { "docid": "20bdda8862c0e847c72c4d571a70bf25", "score": "0.52626014", "text": "function piecesGivingCheck() {\r\n\tvar ourKing = king[turn];\r\n\tvar enemyColor = turn == Color.WHITE ? Color.BLACK : Color.WHITE;\r\n\t\r\n\treturn getPiecesAttackingSquare(getPieceRow(ourKing), getPieceCol(ourKing), enemyColor);\r\n}", "title": "" }, { "docid": "178f7ffa3c808ce1aa8457b519c432fe", "score": "0.5260055", "text": "function aiPlayOppCorner(){\n\t\tif(board[0][0] === game.playerToken && board[2][2] === \"\"){\n\t\t\treturn \"22\";\n\t\t}\n\t\tif(board[0][2] === game.playerToken && board[2][0] === \"\"){\n\t\t\treturn \"20\";\n\t\t}\n\t\tif(board[2][0] === game.playerToken && board[0][2] === \"\"){\n\t\t\treturn \"02\";\n\t\t}\n\t\tif(board[2][2] === game.playerToken && board[0][0] === \"\"){\n\t\t\treturn \"00\";\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "ce47d16c76c51ebd256904260849487b", "score": "0.5250479", "text": "function getColor(m)\n {\n return m > 5 ? \"purple\" :\n m > 4 ? \"orange\" :\n m > 3 ? \"gold\" :\n m > 2 ? \"yellow\" :\n m > 1 ? \"greenyellow\" :\n \"red\";\n }", "title": "" }, { "docid": "12e160545eda89f8b0e046c4e12c2527", "score": "0.5250071", "text": "function isColor(value) {\n return value && d3Color.color(value) != null;\n}", "title": "" }, { "docid": "4ba8a9813c6da78790740aae717652a7", "score": "0.5242401", "text": "function aiPlayCorner(){\n\t\tif(board[0][0] === \"\"){\n\t\t\treturn \"00\";\n\t\t}\n\n\t\tif(board[0][2] === \"\"){\n\t\t\treturn \"02\";\n\t\t}\n\n\t\tif(board[2][0] === \"\"){\n\t\t\treturn \"20\";\n\t\t}\n\n\t\tif(board[2][2] === \"\"){\n\t\t\treturn \"22\";\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "62e5c3fb6b4624b70696dc8163914c6a", "score": "0.5242284", "text": "checkEnpassant() {\n if(lastMove){\n if(lastMove.piece==\"Pawn\"){\n if(turn==\"white\") {\n if (lastMove.pRow==6 && lastMove.sRow==4) {\n return lastMove.pCol;\n }\n }\n else if (turn==\"black\") {\n if (lastMove.pRow==1 && lastMove.sRow==3) {\n return lastMove.pCol;\n }\n }\n }\n }\n return \"no\"\n }", "title": "" }, { "docid": "08102d1a4d3cdc579192ca5a9514f890", "score": "0.5239784", "text": "function goodTile(r, c) \n{\n\tif (r > 8 || r < 1 || c > 8 || c < 1)\n\t\treturn 1\n\ttile = tiles[r.toString() + c.toString()]\n\tif (tile.piececolor == currentcolor)\n\t\treturn 1\n\tif (!tile.piececolor)\n\t\treturn 2\n\treturn 3\n}", "title": "" }, { "docid": "deb303c6244265654b53d1fe081c408a", "score": "0.5235038", "text": "function rgb2whiteness(red, green, blue) {\n\treturn Math.min(red, green, blue);\n}", "title": "" }, { "docid": "deb303c6244265654b53d1fe081c408a", "score": "0.5235038", "text": "function rgb2whiteness(red, green, blue) {\n\treturn Math.min(red, green, blue);\n}", "title": "" }, { "docid": "53556018c97642d4bb0fa5dc77ed8eb8", "score": "0.5226299", "text": "function getColor2(x,a,b,c,d,e,f){\r\n\t return x === a ? \"#006600\" :\r\n x === b ? \"#2eb82e\" :\r\n x === c ? \"#ffcc00\" :\r\n x === d ? \"#ff3300\" :\r\n\t\t\t x === e ? \"#990000\" :\r\n \"#808080\";\r\n\t\t\t\t\t \r\n}", "title": "" }, { "docid": "641389bff3a53fd725273662f1bb19e0", "score": "0.52246916", "text": "function crimeColors(type){\n switch (type) {\n case \"Assault\":\n return \"yellow\";\n case \"Auto Theft\":\n return \"red\";\n case \"Break and Enter\":\n return \"orange-dark\";\n case \"Homicide\":\n return \"blue\";\n case \"Robbery\":\n return \"purple\";\n case \"Theft Over\":\n return \"#0079A4\";\n default:\n return \"black\";\n }\n \n }", "title": "" }, { "docid": "4ac785a4b5f4f4e8fd6f72d7f72746a6", "score": "0.5222052", "text": "checkGameOver() {\n let whiteWon = false;\n let blackWon = false;\n //Game is over if, in any board, a player has no pieces left\n for(let pieceOffset = 0; pieceOffset <= 3*this.boardSize; pieceOffset += this.boardSize) {\n for(let i = pieceOffset; i < pieceOffset+this.boardSize; i++) {\n if(this.whitePieces[i].position[0] != -1)\n break;\n if(i == pieceOffset+this.boardSize-1) {\n this.timer.stopCount();\n blackWon = true;\n }\n }\n for(let i = pieceOffset; i < pieceOffset+this.boardSize; i++) {\n if(this.blackPieces[i].position[0] != -1)\n break;\n if(i == pieceOffset+this.boardSize-1) {\n this.timer.stopCount();\n whiteWon = true;\n }\n }\n }\n if(whiteWon) {\n this.phase = \"gameOver\";\n this.winner = 'w';\n } else if (blackWon) {\n this.phase = \"gameOver\";\n this.winner = 'b';\n }\n }", "title": "" }, { "docid": "8a2aa4a33002c4d9f60e5809bc9d60a8", "score": "0.52107215", "text": "function allExplored() {\n return findUnexplored().length == 0;\n}", "title": "" }, { "docid": "373b38004bac4fde9c5630fff4798273", "score": "0.5201357", "text": "function getBoardSquareColor(row, col) {\n if (state.board[row][col] === '0') {\n return '#33CCFF';\n }\n else if (state.board[row][col] === '1') {\n return '#FF9900';\n }\n else if (state.board[row][col] === '2') {\n return '#FF3399';\n }\n else if (state.board[row][col] === '3') {\n return '#99FF33';\n }\n else {\n return '#F0F0F0';\n }\n }", "title": "" }, { "docid": "dca30336265f17a7152b2cb2f72502ea", "score": "0.5200052", "text": "function color(colorType, val) {\n\n // Colors for the parties\n if(colorType == \"PartyAbbreviation\") {\n if (val == 'PLD') {\n return '#3131BD'\n } else if (val == 'UDC') {\n return '#088A4B'\n } else if (val == 'PSS') {\n return '#FA1360'\n } else if (val == 'PDC') {\n return '#FE9A2E'\n } else if (val == 'PLR') {\n return '#0174DF'\n } else if (val == 'PES') {\n return '#01DF01'\n } else if (val == 'pvl') {\n return '#9AFE2E'\n } else if (val == 'PBD') {\n return '#FFFF00'\n } else if (val == 'PEV') {\n return '#FFD735'\n } else if (val == 'Lega') {\n return '#0B3861'\n } else if (val == 'csp-ow') {\n return '#E2563B'\n } else if (val == '-') {\n return '#CCCCCC'\n } else if (val == 'MCG') {\n return '#FECC01'\n } else if (val == 'BastA') {\n return '#DFDE00'\n } else if (val == 'PdT') {\n return '#FF0000'\n }\n // Color for the Parl groups\n } else if(colorType == \"ParlGroupAbbreviation\") {\n if(val == \"NaN\") {\n return '#CCCCCC'\n } else if (val == \"GL\") {\n return '#9AFE2E'\n } else if (val == \"BD\") {\n return '#FFFF00'\n } else if (val == \"C\") {\n return '#FE9A2E'\n } else if (val == \"S\") {\n return '#FA1360'\n } else if (val == \"G\") {\n return '#01DF01'\n } else if (val == \"RL\") {\n return '#0174DF'\n } else if (val == \"V\") {\n return '#088A4B'\n }\n // Colors for the councils\n } else if(colorType == \"CouncilAbbreviation\") {\n if (val == \"CN\") {\n return \"#ff1c14\";\n } else if (val == \"CE\") {\n return \"#3b5998\";\n } else if (val == \"CF\") {\n return \"#2ea52a\";\n }\n // Colors for the genders\n } else if(colorType == \"GenderAsString\") {\n if (val == \"m\") {\n return \"#00FFFF\";\n } else if (val == \"f\") {\n return \"#FF69B4\";\n }\n // Colors for the Native languages\n } else if(colorType == \"NativeLanguage\") {\n if (val == \"I\") {\n return \"#009246\";\n } else if (val == \"D\") {\n return \"#FFCC1E\";\n } else if (val == \"F\") {\n return \"#002395\";\n } else if (val == \"Tr\") {\n return \"#E30A17\";\n } else if (val == \"Sk\") {\n return \"#489DD3\";\n } else if (val == \"RM\") {\n return \"#E2017B\";\n }\n // Colors for the Age Category\n } else if(colorType == \"AgeCategory\") {\n if (val == 0 || val == \"-20\") {\n return \"#a65628\";\n } else if (val == 1 || val == \"20-29\") {\n return \"#b3b000\";\n } else if (val == 2 || val == \"30-39\") {\n return \"#81b300\";\n } else if (val == 3 || val == \"40-49\") {\n return \"#00b399\";\n } else if (val == 4 || val == \"50-59\") {\n return \"#0087b3\";\n } else if (val == 5 || val == \"60-69\") {\n return \"#0060b3\";\n } else if (val == 6 || val == \"70+\") {\n return \"#0003ff\";\n }\n }\n}", "title": "" }, { "docid": "c05d598a30b4eaec4a0a64a2781849c0", "score": "0.51994854", "text": "function getColor(type)\n{\n if(type == 'I') return \"aqua\";\n else if(type == 'O') return \"gold\";\n else if(type == 'T') return \"purple\";\n else if(type == 'L') return \"orange\";\n else if(type == 'J') return \"Blue\";\n else if(type == 'Z') return \"red\";\n else return \"green\";\n}", "title": "" }, { "docid": "3790d28df9ecbff45b2de9e1535f682c", "score": "0.51982737", "text": "function grabSomeColour() {\n\treturn colours[Math.floor((Math.random() * colours.length-1) + 1)];\n}", "title": "" }, { "docid": "f057e474b6bcd042f381c606665adda2", "score": "0.51978546", "text": "function greenb() {\n if (winDiv.style.backgroundColor == \"\") {\n winDiv.style.backgroundColor = \"green\";\n } else if (winDiv.style.backgroundColor == \"green\") {\n winDiv.style.backgroundColor = \"rgb(0, 255, 127)\";\n } else if (winDiv.style.backgroundColor == \"rgb(0, 255, 127)\"){\n winDiv.style.backgroundColor = \"green\";\n }\n if (loseDiv.style.backgroundColor != \"\") {\n loseDiv.style.backgroundColor = \"\";\n }\n}", "title": "" }, { "docid": "45ae5eb630292e808a97ff80455cd1d8", "score": "0.5194238", "text": "function getChoroColor( acsRecord, geoid ) {\n\n\tif (geoid == null) {\n\t\tconsole.info(\"getChoroColor missing geoid: \");\n\t\tconsole.trace();\n\t\treturn '#3388ff'; // Blue\n\t}\n\tif ((acsRecord == null) || (acsRecord.acsData == null) || (acsRecord.breaks == null)) {\n\t\tconsole.trace();\n\n\t\tif (acsRecord == null) {\n\t\t\tconsole.info(\"NULL: acsRecord: \"+acsRecord);\n\t\t} else if (acsRecord.acsData == null) {\n\t\t\tconsole.info(\"NULL: acsRecord.acsData: \"+acsRecord.acsData+\" for \"+acsRecord.fullpath);\n\t\t} else if (acsRecord.breaks == null) {\n\t\t\tconsole.info(\"NULL: acsRecord.break: \"+acsRecord.breaks);\n\t\t}\n\t\t\n\t\tif (geoid != null && geoid.length > 5) {\n\t\t\t// ACS Tract\n\t\t\treturn '#ffa500'; // Orange\n\t\t}\n\t\t//return '#3388ff'; // Blue\n\t\treturn '#00ff00';\n\t}\n\t\n\tlet row = findRow(acsRecord.acsData, geoid)\n\n\tif (row == -1) {\n\t\treturn \"#ffffff\";\n\t}\n\tlet value = get_choropleth_value( acsRecord, row );\n\t\n\tif (value == -1) {\n\t\treturn \"#ffffff\";\n\t}\n\t\n\tlet choro_colors = mapColors[acsRecord.breaks.length-3];\n\tfor (let i = 1; i < acsRecord.breaks.length; i++) {\n\t\tif (value < acsRecord.breaks[i]) {\n\t\t\treturn choro_colors[i-1];\n\t\t}\n\t}\n\t\n\treturn choro_colors[choro_colors.length-1];\n}", "title": "" }, { "docid": "36d4edba50c91a83e40ef5228ec6afb4", "score": "0.51927847", "text": "function chessBoardCellColor(cell1, cell2) {\n return checkColor(cell1) === checkColor(cell2)\n}", "title": "" }, { "docid": "d0cab48cbe2cd93b4ae90a35cc28de9b", "score": "0.51896644", "text": "get color() {}", "title": "" }, { "docid": "0b0b36cc1125436e397e5e348cd83cd2", "score": "0.51852626", "text": "renderColor() {\r\n const { employee } = this.props;\r\n\r\n if ((employee.exit_type) === 1) {\r\n return 'green';\r\n } else if ((employee.exit_type) === 2) {\r\n return 'orange';\r\n } else if ((employee.exit_type) === 3) {\r\n return 'red';\r\n } else {\r\n return 'blue';\r\n }\r\n }", "title": "" }, { "docid": "c6ae68d73fc9146067b5ba78f6eb3777", "score": "0.518292", "text": "function fetchChampColour(champ) { \n\tswitch (champ) {\n\t case 'junior':\n\t colour = \"#7ac943\";\n\t break;\n\t case 'challenge':\n\t colour = \"#c1272d\";\n\t break;\n\t case 'supercup':\n\t colour = \"#3fa9f5\";\n\t break;\n\t case 'grdc':\n\t colour = \"#f7931e\";\n\t break;\n\t case 'grdcplus':\n\t colour = \"#f15a24\";\n\t break;\n\t case 'g57':\n\t colour = \"#4F407A\";\n\t break;\n\t case 'global':\n\t colour = \"#999\";\n\t break;\n\t }\n\t return colour; \n\t}", "title": "" }, { "docid": "131b56c054b0de30fbe67b3eaa463766", "score": "0.5181372", "text": "colors () {\n return this.props.colors || COLORS\n }", "title": "" }, { "docid": "fd5836ba6da90ae42e166930555bf83f", "score": "0.5165827", "text": "function colorPicker()\n{\n // normalized inputs\n let inputs = [r / 255,g / 255,b / 255];\n let out = nn.feedforward(inputs);\n\n if(out[0] > out[1])\n return \"black\";\n else\n return \"white\";\n}", "title": "" }, { "docid": "adad2d1a2e4fff040b86c8a784757aad", "score": "0.51652735", "text": "function returnOpponentEye(e){ //returns opponent's eye\n return ((e==\"white\") ? \"black\" : \"white\");\n }", "title": "" }, { "docid": "9a7db5aa73b1790c1c2b7708e90cabf6", "score": "0.5163241", "text": "getCapturedPieces(player) {\n let pieceColors;\n if (player === 'opponent') {\n if (this.state.game.playerWhite.userId === Number(this.state.userId)) {\n pieceColors = 'WHITE';\n } else {\n pieceColors = 'BLACK';\n }\n } else {\n if (this.state.game.playerWhite.userId === Number(this.state.userId)) {\n pieceColors = 'BLACK';\n } else {\n pieceColors = 'WHITE';\n }\n }\n let capturedPieces = [];\n this.state.game.pieces.forEach(function (piece) {\n if (piece.captured) {\n if (pieceColors === piece.color) {\n capturedPieces.push(piece.pieceType);\n }\n }\n });\n\n return (\n <Grid.Row style={capturedPiecesStyle}>\n <div style={{height: '100%',width: '340px', borderRadius: '3px', backgroundColor: 'rgba(255, 255, 255, 0.2)'}}>\n {capturedPieces[0] && capturedPieces.map(piece => {\n return (<Icon\n style={{\n align: 'center',\n color: pieceColors.toLowerCase(),\n textShadow: pieceColors.toLowerCase() === 'white' ?\n '1px 0px #000000, -1px 0px #000000, 0px 1px #000000, 0px -1px #000000' : ''\n }}\n name={'chess ' + piece.toLowerCase()}\n\n />)\n })}\n </div>\n </Grid.Row>\n )\n }", "title": "" }, { "docid": "1421008fc680523591f6493fb50ca4c9", "score": "0.51597613", "text": "function isO(piece){ return piece == 1 || piece == 2;}", "title": "" }, { "docid": "d90518c2851116dd4b0aeeaa80d39505", "score": "0.5152414", "text": "updateColor() {\n this.color = this.pieces.length >= 1 ? this.pieces[this.pieces.length - 1].color : null;\n }", "title": "" }, { "docid": "b9248d2eddace1c592c041720c7004aa", "score": "0.51449025", "text": "function prescriptionGetColor(r) {\n return r > 100 ? '#a50f15':\n r > 90 && r <= 100 ? '#de2d26':\n r > 80 && r <= 90 ? '#fb6a4a':\n r > 70 && r <= 80 ? '#fc9272':\n r > 60 && r <= 70 ? '#fcbba1':\n '#fee5d9'\n }", "title": "" }, { "docid": "40e4848680047751e26a6ec7b25d8dee", "score": "0.5139075", "text": "function who_on_click() {\n\n var team=chessObject.getTeam();\n var pices=chessObject.getChessMan();\n\n\n if((team===\"w\") && (pices===\"p\")){\n return \"wite-pone\";\n }else if((team===\"w\") && (pices===\"r\")){\n return \"wite-rok\";\n }else if((team===\"w\") && (pices===\"n\")){\n return \"wite-night\";\n }else if((team===\"w\") && (pices===\"b\")){\n return \"wite-bishop\";\n }else if((team===\"w\") && (pices===\"q\")){\n return \"wite-queen\";\n }else if((team===\"w\") && (pices===\"king\")){\n return \"wite-king\";\n }else if((team===\"b\") && (pices===\"p\")){\n return \"black-pone\";\n }else if((team===\"b\") && (pices===\"r\")){\n return \"black-rok\";\n }else if((team===\"b\") && (pices===\"n\")){\n return \"black-night\";\n }else if((team===\"b\") && (pices===\"b\")){\n return \"black-bishop\";\n }else if((team===\"b\") && (pices===\"q\")){\n return \"black-queen\";\n }else if ((team===\"b\") && (pices===\"king\")){\n return \"black-king\";\n\n }\n}", "title": "" }, { "docid": "692d76d2aeac02585eb9badd163e1b90", "score": "0.5135792", "text": "function applyColor(player,area) {\n var r = document.getElementById(player + \"_RedAmt\" + area);\n var g = document.getElementById(player + \"_GreenAmt\" + area);\n var b = document.getElementById(player + \"_BlueAmt\" + area);\n\n r = r.value ? r.value : 0;\n g = g.value ? g.value : 0;\n b = b.value ? b.value : 0;\n\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "title": "" }, { "docid": "b71c5fccf9f8db7beb51fccd17181ed2", "score": "0.51351875", "text": "function row_color(x) {\n for (let y = 0; y < squars[x].length; y++) {\n if(squars[x][y] != \"black\"){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "f0ef18497b258d9e14e300ed8ad74e22", "score": "0.51305544", "text": "pickSwatchColor() {\n\t\tvar stx = this.context.stx;\n\t\tvar swatch = this.node.find(\"cq-swatch\");\n\t\tif (!swatch.length) return;\n\t\tvar currentColor = swatch[0].style.backgroundColor;\n\n\t\tvar usedColors = {};\n\t\tfor (var s in stx.chart.series) {\n\t\t\tvar series = stx.chart.series[s];\n\t\t\tif (!series.parameters.isComparison) continue;\n\t\t\tusedColors[CIQ.convertToNativeColor(series.parameters.color)] = true;\n\t\t}\n\n\t\tif (currentColor !== \"\" && !usedColors[currentColor]) return; // Currently picked color not in use then allow it\n\t\tfor (var i = 0; i < this.swatchColors.length; i++) {\n\t\t\t// find first unused color from available colors\n\t\t\tif (!usedColors[this.swatchColors[i]]) {\n\t\t\t\tswatch[0].style.backgroundColor = this.swatchColors[i];\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t//Uh oh, all colors taken. Last color will be used.\n\t}", "title": "" }, { "docid": "40d0a89655bd71f1f8b5896ce18c78d8", "score": "0.51266146", "text": "function deathGetColor(r) {\n return r > 10 ? '#006d2c':\n r > 8 && r <= 10 ? '#31a354':\n r > 6 && r <= 8 ? '#74c476':\n r > 4 && r <= 6 ? '#a1d99b':\n r > 2 && r <= 4 ? '#c7e9c0':\n '#edf8e9'\n }", "title": "" }, { "docid": "878e67e9a6574fe46c409654ac00e021", "score": "0.512639", "text": "function checkDraw(squares) {\n return squares.every((value) => (value !== null))\n}", "title": "" }, { "docid": "fc211d55376fd198a311fbf13bf9ab72", "score": "0.5125031", "text": "function getColor() {\n\tif (checkNight()) return 'style=\"color:purple\"';\n\treturn 'style=\"color:yellow\"';\n}", "title": "" }, { "docid": "6037126b668994a5d796ef2ed6a25f53", "score": "0.51196945", "text": "function titleColoris(Color) {\n if (Color == \"firstColor\"){\n return \"#9E001C\"\n }\n else if (Color == \"secondColor\"){\n return \"#F6AE2D\"\n }\n else if (Color == \"thirdColor\"){\n return \"#33658A\"\n }\n else if (Color == \"fourthColor\"){\n return \"#494949\"\n }\n}", "title": "" }, { "docid": "265c79557cd55ceea9c67d425eb9c30a", "score": "0.5117554", "text": "function randomPiece(){\n let rand = Math.floor(Math.random() * PIECES.length); // 0 -> 6\n return new Piece(PIECES[rand][0], PIECES[rand][1]); //PIECES[rand][0] = shape, PIECES[rand][1] = color\n }", "title": "" }, { "docid": "40d5907a2bd2b1f8848e92f0c865fa57", "score": "0.511725", "text": "function check() {\r\n\t var posCap;//A possible piece to capture.\r\n\r\n\t if (checkSquare && (posMove == checkSquare)) {//If it's the move we're checking for\r\n\t\t return true;\r\n\t } else if (checkSquare) {\r\n\t\t return null;\r\n\t }\r\n\r\n\t if (posMove) {\r\n\t\t posCap = gameState.get(posMove);//A piece that could possible be captured.\r\n\r\n\t\t if (!posCap || posCap.substring(0, 1) != piece.color) {\r\n\t\t if (posCap && posCap.substring(1)!=\"K\") {//For a capturable piece:\r\n\t\t\t if (hasMoves) {\r\n\t\t\t move = piece.position + \"-\" + posMove;\r\n\t\t\t if (!ChessUtil.checkMoveForCheck(gameState, move, piece.color)) {\r\n\t\t\t\t return true;\r\n\t\t\t } else {\r\n\t\t\t\t return null;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t return posMove;\r\n\t\t } else if (!posCap) {//Nothing to capture:\r\n\t\t\t if (hasMoves) {\r\n\t\t\t move = piece.position + \"-\" + posMove;\r\n\t\t\t if (!ChessUtil.checkMoveForCheck(gameState, move, piece.color)) {\r\n\t\t\t\t return true;\r\n\t\t\t } else {\r\n\t\t\t\t return null;\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\r\n\t\t return posMove;\r\n\t\t }\r\n\t }\r\n\t }", "title": "" }, { "docid": "a434e04b8b4d6e132d57d5591c27deea", "score": "0.5116422", "text": "drawPiece() {\n this.drawEmpty();\n this.drawBoard();\n var piece = this.piece.getPiece();\n for (var r = 0; r < piece.length; r++) {\n for (var c = 0; c < piece.length; c++) {\n if (this.piece.isEmpty(r, c)) {\n continue;\n }\n this.drawSquare(c + this.piece.getX(), r + this.piece.getY(), this.piece.getColor());\n }\n }\n }", "title": "" }, { "docid": "4e3e9edda5c8f50d5c994d6f9d1642df", "score": "0.5115561", "text": "function getColor(a) {\n return a == 5 ? '#a50f15' :\n a == 4 ? '#de2d26' :\n a == 3 ? '#fb6a4A' :\n a == 2 ? '#fcae91' :\n '#fee5d9';\n}", "title": "" } ]
c2507a8b4e0bb6114051fe3913e86c7e
creates an HTML string that represents a new row in the table with a groups access right on a resource
[ { "docid": "d35863353ec4d70f8b54f8abe9ce7a2c", "score": "0.7485598", "text": "function addTableRowWithAccessRight(accessRight, groupName) {\n\t\t\t\t\t\treturn '<tr>'\n\t\t\t\t\t\t\t\t+ '<td id=\\'accessRight_'\n\t\t\t\t\t\t\t\t+ accessRight.groupId\n\t\t\t\t\t\t\t\t+ '_groupId\\' >'\n\t\t\t\t\t\t\t\t+ accessRight.groupId\n\t\t\t\t\t\t\t\t+ '</td>'\n\t\t\t\t\t\t\t\t+ '<td>'\n\t\t\t\t\t\t\t\t+ groupName\n\t\t\t\t\t\t\t\t+ '</td>'\n\t\t\t\t\t\t\t\t+ createTd('readRight', accessRight.readRight,\n\t\t\t\t\t\t\t\t\t\taccessRight.groupId)\n\t\t\t\t\t\t\t\t+ createTd('updateRight',\n\t\t\t\t\t\t\t\t\t\taccessRight.updateRight,\n\t\t\t\t\t\t\t\t\t\taccessRight.groupId)\n\t\t\t\t\t\t\t\t+ createTd('deleteRight',\n\t\t\t\t\t\t\t\t\t\taccessRight.deleteRight,\n\t\t\t\t\t\t\t\t\t\taccessRight.groupId)\n\t\t\t\t\t\t\t\t+ createTd('changeRight',\n\t\t\t\t\t\t\t\t\t\taccessRight.changeRightsRight,\n\t\t\t\t\t\t\t\t\t\taccessRight.groupId)\n\t\t\t\t\t\t\t\t+ '<td><input type=\"button\" value=\"Delete\" onclick=\"deleteAccessRightsRow(this)\"></td>'\n\t\t\t\t\t\t\t\t+ '</tr>';\n\t\t\t\t\t}", "title": "" } ]
[ { "docid": "d76f9a902cb74f140a916b8bb51bbc3d", "score": "0.6314341", "text": "function klantTableRow(klant) {\n var tr = document.createElement(\"tr\");\n tr.id = klant.id;\n addHtmlElementContent(tr, document.createElement(\"td\"), klant.bedrijf, \"BedrijfInDB\"+tr.id);\n addHtmlElementContent(tr, document.createElement(\"td\"), klant.voornaam, \"VoornaamInDB\"+tr.id);\n addHtmlElementContent(tr, document.createElement(\"td\"), klant.achternaam, \"AchternaamInDB\"+tr.id);\n addHtmlElementContent(tr, document.createElement(\"td\"), klant.emailadres, \"EmailadresInDB\"+tr.id);\n\n var pencil = document.createElement(\"span\");\n var trash = document.createElement(\"span\");\n addHtmlElementContentPlusAwesome(tr, pencil, trash, document.createElement(\"td\"), klant.username, \"UsernameInDB\"+tr.id, klant.id);\n \n\n\n return tr;\n}", "title": "" }, { "docid": "2ff20a4522f903cac11c9b544d771920", "score": "0.6174609", "text": "function createTd(idSuffix, value, groupId) {\n\t\t\t\t\t\treturn '<td><input id=\\'input_accessRight_' + groupId\n\t\t\t\t\t\t\t\t+ '_' + idSuffix + '\\' type=\\'checkbox\\''\n\t\t\t\t\t\t\t\t+ isChecked(value) + '></input></td>\\n';\n\t\t\t\t\t}", "title": "" }, { "docid": "d45e93bc5e8a65551d405039762fdb93", "score": "0.6101194", "text": "function appendNewGroup(groupData) {\n let optionalString = groupData.optionalFields.join(\", \");\n let invalidString = groupData.invalidFields.join(\", \");\n let statusString = groupData.statuses.join(\", \");\n\n let row = document.createElement(\"tr\");\n let td = document.createElement(\"td\");\n let button = document.createElement(\"button\");\n\n let name = td.cloneNode();\n let optionalFields = td.cloneNode();\n let invalidFields = td.cloneNode();\n let statuses = td.cloneNode();\n let buttonContainer = td.cloneNode();\n\n let editButton = button.cloneNode();\n let deleteButton = button.cloneNode();\n\n name.className = \"table-group-name\";\n optionalFields.className = \"table-optional-fields\";\n invalidFields.className = \"table-invalid-fields\";\n statuses.className = \"table-statuses\";\n\n name.textContent = groupData.name;\n optionalFields.textContent = optionalString;\n invalidFields.textContent = invalidString;\n statuses.textContent = statusString;\n\n editButton.className = \"group-edit-button\";\n deleteButton.className = \"group-delete-button\";\n\n editButton.textContent = \"Edit\";\n deleteButton.textContent = \"Delete\";\n \n // Add edit/delete listeners.\n editButton.addEventListener(\"click\", loadUpdateForm);\n deleteButton.addEventListener(\"click\", deleteGroup);\n\n buttonContainer.appendChild(editButton);\n buttonContainer.appendChild(deleteButton);\n\n row.appendChild(name);\n row.appendChild(optionalFields);\n row.appendChild(invalidFields);\n row.appendChild(statuses);\n row.appendChild(buttonContainer);\n\n groupsTable.appendChild(row);\n }", "title": "" }, { "docid": "b185207b8eae9fe13286d9fa80192439", "score": "0.6094267", "text": "function addRow(assessor, skills, type, applications, innovationArea){\n //alert(assessor+' '+skills+' '+type+' '+applications);\n jQuery('#assessor-assigned').append(\n \"<tr><th>\"+ assessor +\"</th>\" +\n \"<td>\"+ type +\"</td>\" +\n \"<td>\"+ innovationArea +\"</td>\" +\n \"<td>\"+ skills +\"</td>\" +\n \"<td>\"+ applications +\"</td>\" +\n \"<td><a href='#' class='view-assessor'>View</a>\" +\n \"<td class='full-view'></td>\" +\n \"<td class='full-view'></td>\" +\n \"<td class='full-view'></td>\" +\n \"<td class='alignright'><a href='#' class='undo-assessor'>Undo</a>\" +\n \"</tr>\"\n );\n }", "title": "" }, { "docid": "d8cdc1e5ac0488901ef448b9e2d36d1e", "score": "0.6091245", "text": "function productMgmChild2Table(){\r\n\tvar childDivString = '<table id=\"productUserPermission_dataTable\" class=\"cell-border compact\" cellspacing=\"0\" width=\"100%\">'+\r\n\t'<thead>'+\r\n\t\t'<tr>'+\r\n\t\t\t'<th>ID</th>'+\r\n\t\t\t'<th>User Name</th>'+\r\n\t\t\t'<th>Role</th>'+\r\n\t\t\t'<th>Status</th>'+\r\n\t\t'</tr>'+\r\n\t'</thead>'+\r\n\t'<tfoot>'+\r\n\t\t'<tr>'+\r\n\t\t\t'<th></th>'+\r\n\t\t\t'<th></th>'+\r\n\t\t\t'<th></th>'+\r\n\t\t\t'<th></th>'+\r\n\t\t'</tr>'+\r\n\t'</tfoot>'+\t\t\r\n\t'</table>';\t\t\r\n\t\r\n\treturn childDivString;\t\r\n}", "title": "" }, { "docid": "772fa8f8ef40f83cf689281e67643583", "score": "0.6076221", "text": "function addNewRowHTML()\n{\n\twriteln('<tr>');\n\t//write Name row\n\twriteln('<td width=\"26%\" height=\"36\"><span class=\"general-label\">\\\n\t\t\\n<input type=\"text\" name=\"newName\" size=\"24\" maxlength=\"40\" value=\"\">\\\n\t\t\\n</span></td>');\n\t//write Description row\n\twriteln('<td width=\"26%\" height=\"36\"> \\\n\t\t\t\\n<div align=\"center\"><span class=\"general-label\"> \\\n\t\t\t\\n<input type=\"text\" name=\"newDescription\" size=\"24\" maxlength=\"100\" value=\"\">\\\n\t\t\t\\n</span></div></td>');\n\t//write Duration\n\twriteln('<td width=\"18%\" height=\"36\"> \\\n\t\t\t\\n<div align=\"center\"><span class=\"general-label\"> \\\n\t\t\t\\n<input type=\"text\" name=\"newDuration\" size=\"8\" maxlength=\"8\" value=\"\">\\\n\t\t\t\\n</span> </div>\\\n\t\t\t\\n</td>');\n\t//write Price\n\twriteln('<td width=\"11%\"> \\\n\t\t\t\\n<div align=\"center\"><span class=\"general-label\"> \\\n\t\t\t\\n <input type=\"text\" name=\"newPrice\" size=\"8\" maxlength=\"8\" value=\"\">\\\n\t\t\t\\n </span></div>\\\n\t\t\t\\n</td>');\n\t//write delete column\n\twriteln('<td width=\"19%\" nowrap height=\"36\"> \\\n\t\t\t \\n<div align=\"center\"><a href=\"javascript:deleteService(\\'New\\',\\'\\');\"><img src=\"/cgi-docs/Mercantec/PC_F_6.6.1/images/btnbsm_delete.gif\" width=\"60\" height=\"19\" border=\"0\"></a></div>\\\n\t\t\t \\n</td>');\n\twriteln('\\n</tr>');\n}", "title": "" }, { "docid": "7c0e357b803f2cc117227a93bcd34cf1", "score": "0.60687274", "text": "function newGroup() {\n let el = document.createElement('TR');\n return el;\n}", "title": "" }, { "docid": "37ed92eddf97c1869b88fec7051fd44f", "score": "0.59844863", "text": "function create_html_for_row( $columns_to_add )\n{\n\tvar html = \"<tr>\";\n\t\n\tfor( $j=0; $j != $columns_to_add.length; ++$j )\n\t{\n\t\thtml += \"<td>\" + $columns_to_add[$j] + \"</td>\";\n\t}\n\t\n\thtml += \"</tr>\";\n\t\n\treturn html;\n}", "title": "" }, { "docid": "e50960d3569e49a96bda12818c317af0", "score": "0.5979508", "text": "function createRow(ticket) { \n // get element #content from simple.html\n let content = document.getElementById('content');\n // the += operator in strings works as an append function: \"string\" += \"new\" ... \"stringnew\"\n // we add more HTML inside the grid, the browser will interprete it as we add it\n let row = \n // creates a new row in the table <tr> with id = Student._id (unique)\n '<tr id=\"' + ticket._id +'\" data-id=\"' + ticket._id + '\">' +\n // First name \"\n '<td class=\"p-2 border creator\">' + ticket.creator + '</td>' +\n // Last name \"\n '<td class=\"p-2 border solver\">' + ticket.solver + '</td>' +\n // Email \"\n '<td class=\"p-2 border type\">' + ticket.type + '</td>' +\n // creates cell for the options' buttons\n '<td class=\"text-center p-2 border\">' + \n // create edit button that points to updateItem(ticket._id)\n '<button class=\"btn btn-info btn-block\" onclick=\"updateItem(\\'' + ticket._id + '\\')\">' +\n 'Edit' + \n '</button>' + \n // create edit button that points to removeItem(ticket._id)\n '<button class=\"btn btn-danger btn-block\" onclick=\"removeItem(\\'' + ticket._id + '\\')\">' + \n 'Delete' + \n '</button>' + \n '</td>' +\n '</tr>';\n /*\n <table>\n <thead>\n <tr>\n <th> First name </th>\n ...\n <th> Action </th> \n </tr>\n </thead>\n <tbody id=\"content\">\n <tr> -> create this part\n <td> first name here </td>\n ... \n <td> actions here </td>\n </tr>\n </tbody>\n </table>\n */\n content.innerHTML += row;\n}", "title": "" }, { "docid": "745d1332c07fd9e15a652ebb28958fd5", "score": "0.59660655", "text": "createGroupHeaderRow(tables, entryTemplate) {\r\n for (let i = 0; i < tables.length; i++) {\r\n const entry = Object.assign({}, entryTemplate),\r\n colspan = tables[i].datafields.length,\r\n tableRow = [entry];\r\n\r\n entry.colSpan = colspan;\r\n tableRow.length = colspan;\r\n tableRow.fill({}, 1, colspan - 1);\r\n\r\n tables[i].body.push(tableRow);\r\n }\r\n }", "title": "" }, { "docid": "8c5617ee7b9c6569bb4f46b602e63d20", "score": "0.5938778", "text": "function create_link_row(username,site,url,base64icon) {\r\n\r\n var icon = document.createElement(\"a\");\r\n var icon_img = document.createElement(\"img\");\r\n icon_img.setAttribute(\"src\",\"data:image/png;base64,\"+base64icon);\r\n icon_img.setAttribute(\"style\",resetStyle);\r\n// icon_img.setAttribute(\"border\", \"0\");\r\n icon.appendChild(icon_img);\r\n icon.setAttribute(\"style\",resetStyle);\r\n icon.setAttribute(\"title\",username+\" on \"+site);\r\n icon.setAttribute(\"href\",url);\r\n\r\n var a = dom_createLink(url,username+' on '+site, 'Link to '+username+' on '+site);\r\n\r\n var tr = document.createElement(\"tr\");\r\n tr.setAttribute(\"style\",resetStyle);\r\n var td_left = document.createElement(\"td\");\r\n var td_right = document.createElement(\"td\");\r\n td_left.setAttribute(\"style\",resetStyle+\"padding-left:6px;\");\r\n td_right.setAttribute(\"style\",resetStyle+\"padding-left:6px;\");\r\n td_left.appendChild(icon);\r\n td_right.appendChild(a);\r\n td_right.setAttribute(\"align\", \"left\");\r\n tr.appendChild(td_left);\r\n tr.appendChild(td_right);\r\n return tr;\r\n}", "title": "" }, { "docid": "08d67f5fb7b646a5fed2fb6dce8ab012", "score": "0.59214514", "text": "function generateTableEntry(first, last, role, location, link) {\n return `\n <tr>\n <th>${first}</th>\n <th>${last}</th>\n <th>${role}</th>\n <th>${location}</th>\n <th>${link}</th>\n </tr>`;\n}", "title": "" }, { "docid": "57de51736a35f748c80c494d261d1d9f", "score": "0.5917531", "text": "function createRow(type,wrap,arr) {\n \tvar newRow = wrap;\n for (var j=0;j<arr.length;j++) {\n newRow = newRow+'<a href=\"#\">'+arr[j]+'</a>';\n }\n newRow = newRow +'</div>';\n\t\t\treturn newRow;\n }", "title": "" }, { "docid": "e8c6cd2f64b6a8ea045eb330d34cd3b4", "score": "0.58537966", "text": "function CreateRow( invite, elem_append, elem_show )\n{\n\tvar createDate = new Date( invite.time_created * 1000 );\n\tvar newRow = $J('#invite_token_row').html().replace( /%s/g, invite.invite_token ).replace( /%date%/g, createDate.toLocaleDateString() );\n\t$J( elem_show ).show();\n\t$J( elem_append ).append( newRow );\n}", "title": "" }, { "docid": "33b5e0eb1dfdd0debacf5e19ea558410", "score": "0.5839217", "text": "function createRow(userObject) {\n let row = document.createElement('tr');\n // div.id = 'user-item';\n\n let td;\n let keys = [\n 'username',\n 'email',\n 'instaID',\n 'modes',\n 'phone',\n 'payPhone',\n 'screenshotLink',\n 'squad'\n ];\n \n keys.forEach((key) => {\n td = document.createElement('td');\n // create a tag with link\n if(key == 'screenshotLink') {\n let a = document.createElement('a');\n a.href = userObject[key];\n // add link icon to a tag\n let i = document.createElement('i');\n i.className += 'fas fa-link';\n a.appendChild(i);\n // append a tag to row\n td.appendChild(a);\n }\n else {\n if(userObject[key] == '')\n td.innerHTML = '-';\n else {\n td.innerHTML = userObject[key] ;\n }\n }\n row.appendChild(td);\n });\n\n return row;\n}", "title": "" }, { "docid": "66aa53e736e5de054d1a4c96bc2b747b", "score": "0.5805818", "text": "function createNewRow(doctor) {\n\n return `<tr class=\"edit\" data-docID=${doctor.id}>\n <td>${doctor.firstName} ${doctor.lastName}</td>\n <td>${doctor.addressOne} ${doctor.addressTwo}</td>\n <td>${doctor.telephone}</td>\n <td>${doctor.email}</td>\n <td>${doctor.orgName}</td>\n <td>${doctor.description}</td> \n <td><a href=\"/appointment.html\"><button type=\"submit\" class=\"button is-dark is-medium icon\" id=\"doctorSearch\"><i class=\"fas fa-calendar-check\"></i></button></a></td> \n </tr>`;\n }", "title": "" }, { "docid": "0d80f8cebba6fbfe1bfca804695cf316", "score": "0.5801675", "text": "function appendNewRow() {\n const newRow = `<div class=\"col s9\">\n <p>${giftInfo.name}</p>\n </div>\n <div class=\"col s3\">\n <a class=\"btn red lighten-2 edit\">\n <i class=\"material-icons\">edit</i>\n </a>\n </div>`;\n\n $(\"#gifts\").append(newRow);\n }", "title": "" }, { "docid": "1f043604239b0e691cd3fa287d558250", "score": "0.5799593", "text": "function getRow(props) {\n var $tr = $('<tr />');\n var $one = $('<td />').appendTo($tr);\n var $a = $('<a />').attr(\"href\", \"/admin/places/feature/\" + props.id).text(props.preferred_name).appendTo($one);\n $('<td />').text(props.uri).appendTo($tr);\n $('<td />').text(props.feature_type).appendTo($tr);\n $('<td />').text(props.admin2).appendTo($tr);\n $('<td />').text(props.admin1).appendTo($tr);\n return $tr; \n}", "title": "" }, { "docid": "e1bcbb64f8852b1dc47514364206a2bb", "score": "0.57978404", "text": "function displayRole(obj) {\n // clear the contents of role details\n document.getElementById(\"roleDetails\").innerHTML = \"\";\n\n // start the table and add the columns\n let txt = \"<table id='addTable'>\";\n\n // display the character details\n txt += \"<tr><td style='width:400px'><h2>\" + obj.name + \"</h2>\";\n txt += \"<p>\" + obj.abilities + \"</p></td><td style='width:200px'>\";\n txt += \"<img src='\" + obj.image + \"'\" + \" alt='\" + obj.name + \"'\"\n + \" height='255' width='183' id='\" + obj.image + \"'></td></tr>\";\n\n // close the table\n txt += \"</table>\";\n\n // update the character details\n document.getElementById(\"roleDetails\").innerHTML = txt;\n}", "title": "" }, { "docid": "32f12f329a7e84e4fc18bb4ce005305a", "score": "0.5778737", "text": "function insertRow() {\n\t\tvar table = $(\"#mainTable\")[0];\n\t\tvar nrows = table.rows.length;\n\t\n\t\tvar row = $(\"<tr />\");\n\t\tif (nrows % 2 === 1)\n\t\t\trow.addClass(\"alt\");\n\t\t\n\t\trow.append($(\"<td />\").append(createEditable(\"Assignment \" + (nrows - 1))));\n\t\trow.append($(\"<td />\").append(createEditable(\"0.0\")).append(\"%\"));\n\t\trow.append($(\"<td />\").append(createEditable(\"0.0\")).append(\"%\"));\n\t\trow.append($(\"<td />\").text(\"0.00\"));\n\t\t$(\"#gradesGrid tbody\").append(row);\n\t\t\n\t\tinitEditables();\n}", "title": "" }, { "docid": "1ef3b137b8f411b952e6b996caa979e7", "score": "0.57628363", "text": "function format(d){\n\t// `d` is the original data object for the row\n\t// Child rows for personally resolved\n\tconsole.log(d.rResolver);\n\tif (d.rResolver == (user.firstName + \" \" + user.lastName + \" (<a href=\\\"#\\\"><i>\" + user.email + \"</i></a>)\")){\n\t\treturn '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">' +\n\t\t'<tr>' +\n\t\t\t'<td>Description:</td>' +\n\t\t\t'<td>' + d.rDesc + '</td>' +\n\t\t'</tr>' +\n\n\t\t'<tr>' +\n\t\t\t'<td>Resolved By <b>You</b>:</td>' +\n\t\t\t'<td>' + d.resolveDate + '</td>' +\n\t\t'</tr>' + \n\t\t'</table>';\n\t}\n\t// child rows for all past\n\telse{\n\t\treturn '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">' +\n\t\t'<tr>' +\n\t\t\t'<td>Description:</td>' +\n\t\t\t'<td>' + d.rDesc + '</td>' +\n\t\t'</tr>' +\n\t\t'<tr>' +\n\t\t\t'<td>Resolved By:</td>' +\n\t\t\t'<td>' + d.rResolver + '</td>' +\n\t\t'</tr>' + \n\t\t'</table>'; \n\t}\n}", "title": "" }, { "docid": "e7205b5b512b078c8099aa107558aed2", "score": "0.57626116", "text": "function drawTable() {\n var id = 1;\n var groupData = '';\n\n $(\"#group-table > tbody\").empty();\n\n $.getJSON(\"/Groups\", function (data) {\n if (data != 0) {\n $.each(data, function (key, value) {\n groupData += '<tr>';\n groupData += '<td>' + id++ + '</td>';\n groupData += '<td> <a href=\"#\" class=\"item-name\" data-id=\"' + value.id_group + '\">' + value.name + '</a></td>';\n groupData += '<td>' + value.code + '</td>';\n groupData += '<td class=\"item-description\">' + value.description + '</td>';\n groupData += '<td><button class=\"btn-modal\" id=\"button-table-edit\" data-type=\"edit\" data-id=\"' + value.id_group + '\">Edycja</button> <button class=\"button-table-delete\"data-id=\"' + value.id_group + '\">Usuń</button></td>';\n groupData += '</tr>';\n codeOfLastGroup = value.code;\n });\n $(\"#group-table\").append(groupData);\n displayTable();\n }\n else {\n removeTable();\n }\n\n });\n }", "title": "" }, { "docid": "2b059f50fd3e8dc9fedaae32788dee68", "score": "0.57496804", "text": "function createRow(milestones) {\n\n return `<tr>\n <td>${milestones.id}</td>\n <td>${milestones.project}</td>\n <td>${milestones.task}</td>\n <td>${milestones.deadline}</td>\n <td>${milestones.notes}</td>\n \n </tr>`;\n}", "title": "" }, { "docid": "2d6ea0f02d221bafb9b1638254f1ca1d", "score": "0.5744033", "text": "function addRow(item) {\n\n var row = templateRow.cloneNode(true);\n\n row.removeAttribute('id');\n\n row.style.display = '';\n\n for (var prop in item) {\n \n var field = row.querySelector('[data=' + prop + ']');\n\n field.innerHTML = item[prop];\n }\n tableBody.appendChild(row);\n}", "title": "" }, { "docid": "c93baf8ae5109b5cfa67f3e869738f87", "score": "0.57372373", "text": "function makeProjectRow(id, name)\n{\n var row = '<tr id=\"project-'+ id +'\" class=\"ui-state-default\">';\n row += ' <td><span class=\"project-name\" id='+ id +'\">'+ name +'</span></td>';\n row += ' <td>&nbsp;</td>';\n row += ' <td><a class=\"ui-link ui-state-default ui-corner-all\" href=\"?page=project&id='+ id +'\">';\n row += ' <span class=\"ui-icon ui-icon-folder-open\"/>go';\n row += ' </a></td>';\n row += '</tr>';\n\n return row;\n}", "title": "" }, { "docid": "68105869706b923b27e674c0168e4f21", "score": "0.57211035", "text": "function format ( d ) {\n // `d` is the original data object for the row\n return '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">'+\n '<tr>'+\n '<td>Full name:</td>'+\n '<td>'+d.name+'</td>'+\n '</tr>'+\n '<tr>'+\n '<td>Extension number:</td>'+\n '<td>'+d.extn+'</td>'+\n '</tr>'+\n '<tr>'+\n '<td>Extra info:</td>'+\n '<td>And any further details here (images etc)...</td>'+\n '</tr>'+\n '</table>';\n }", "title": "" }, { "docid": "d809415a2ad54774304504c35f63738f", "score": "0.5716492", "text": "function build_fork_element_html(table_body, combined_name, num_stars, num_forks) {\n const NEW_ROW = $('<tr>', {id: extract_username_from_fork(combined_name), class: \"useful_forks_repo\"});\n table_body.append(\n NEW_ROW.append(\n $('<td>').html(getRepoCol(combined_name, false)).attr(\"value\", combined_name),\n $('<td>').html(UF_TABLE_SEPARATOR + getStarCol(num_stars)).attr(\"value\", num_stars),\n $('<td>').html(UF_TABLE_SEPARATOR + getForkCol(num_forks)).attr(\"value\", num_forks)\n )\n );\n return NEW_ROW;\n}", "title": "" }, { "docid": "994f5cd23a1b552c24649c79bc33dbb9", "score": "0.5713038", "text": "function make_summ_row( ds,grp,label,type,min,max,num_miss,complt,mean,mean_abs,lowres,highres, table) {\n var summ_row = document.createElement ( 'tr' );\n summ_row.innerHTML = '<td>'+ds+'</td><td>'+grp+'</td><td>'+label+'</td><td>'+type+'</td><td>'+\n min+'</td><td>'+max+'</td><td>'+num_miss+'</td><td>'+complt+'</td><td>'+mean+'</td><td>'+\n mean_abs+'</td><td>'+lowres+'</td><td>'+highres+'</td>';\n table.appendChild ( summ_row );\n}", "title": "" }, { "docid": "47cbc5f2dabc2cd89ddeb415d9fb86b9", "score": "0.5708002", "text": "function createGeneralNameListTable(noRecordsMsg, list, methodName) {\n //Create new Table\n var tb = document.createElement(\"table\");\n tb.setAttribute(\"role\", \"presentation\");\n\n if (list != null && list.length > 0 && list[0] != '') {\n for (var i = 0; i < list.length; i++) {\n var row = tb.insertRow(-1);\n var cell = row.insertCell(-1);\n var recordStyle;\n var record = list[i].split('\\b');\n var name = list[i];\n var eduDegree = '';\n\n if (record && record.length == 3) {\n eduDegree = record[2];\n }\n\n if (record != null && record.length > 0) {\n name = record[0];\n }\n\n if (i % 2 == 0) {\n recordStyle = 'ACA_TabRow_Single_Line font12px';\n }\n else {\n recordStyle = 'ACA_TabRow_Double_Line font12px';\n }\n\n var cellInnerHtml = \"<a\";\n\n if (i == 0) {\n cellInnerHtml += \" id='\" + generalNameList_firstNameID + \"'\";\n\n if (list.length == 1) {\n generalNameList_lastNameID = generalNameList_firstNameID;\n }\n } else if (i == (list.length - 1)) {\n cellInnerHtml += \" id='\" + generalNameList_lastNameID + \"'\";\n }\n\n cellInnerHtml += \" tabindex='0' title='\" + name + eduDegree + \"' href='javascript:void(0);' style='color:#666666; cursor:pointer' onclick=\\\"showNameList=false;generalNameListClose();\" + methodName + \"('\" + JsonDecode(list[i]).replace(/'/g, \"\\\\'\") + \"');\\\" class='\" + recordStyle + \"'><span>\" + TruncateString(name) + eduDegree + \"</span></a>\";\n cell.innerHTML = cellInnerHtml;\n }\n }\n else {\n var row = tb.insertRow(-1);\n var cell = row.insertCell(-1);\n cell.setAttribute(\"class\", \"ACA_TabRow_Single_Line font12px\");\n cell.innerHTML = \"<a id='\" + generalNameList_firstNameID + \"' tabindex='0' href='javascript:void(0)' onclick='generalNameListClose();' style='text-decoration: none; color:#666666; cursor:pointer'>\" + noRecordsMsg + \"</a>\";\n generalNameList_lastNameID = generalNameList_firstNameID;\n }\n\n // Remove old Table ,add new\n var div = document.getElementById('divGeneralNameList');\n\n for (var i = 0; i < div.childNodes.length; i++) {\n div.removeChild(div.childNodes[i]);\n }\n div.appendChild(tb);\n}", "title": "" }, { "docid": "c600b78e4518dbcbc868e315dd1c9290", "score": "0.56841636", "text": "function format(d) {\n // `d` is the original data object for the row\n return (\n '<table cellpadding=\"5\" class=\"child-row-details\" cellspacing=\"0\" border=\"0\" style=\"padding-left:50px;\">' +\n \"<tr>\" +\n \"<td>Full name:</td>\" +\n \"<td>\" +\n d.name +\n \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td>Extension number:</td>\" +\n \"<td>\" +\n d.extn +\n \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td>Extra info:</td>\" +\n \"<td>And any further details here (images etc)...</td>\" +\n \"</tr>\" +\n \"</table>\"\n );\n }", "title": "" }, { "docid": "df72ef5fe1b6402c7fef70bc3ec5f9fa", "score": "0.5677308", "text": "function fnCreatedRow( nRow, aData, iDataIndex ) {\n // private helper function to avoid hard-coding column indices\n function v(field) {\n return aData[colNumLookup[field]];\n }\n\n var html = [];\n\n // title\n html.push('<div class=\"model_row\">');\n \n // location\n html.push('<span class=\"location\">' + v('hqcity') + ', ' + v('hqstate') + '</span>');\n\n html.push('<h2>' +\n '<a href=\"' + v('url') + '\" target=\"_top\">' + v('title') + '</a>' +\n '</h2>');\n\n html.push('<span class=\"grades\"> Grades ' + v('gradesserved') + '</span>');\n\n html.push('<span class=\"model\">' + v('programmodels') + '</span>');\n\n\n html.push('</div>');\n\n // set it just to the first td in the row\n $('td:eq(0)', nRow).empty().html(html.join(''));\n}", "title": "" }, { "docid": "a7d712b75293ce5c86aeac84fa0e51ac", "score": "0.5671319", "text": "function visualizarGrupo(grupo){\n console.log(grupo);\n const row=document.createElement('tr');\n row.innerHTML=`\n <td>${grupo.idgpo}</td>\n <td>${grupo.materia}</td>\n <td>${grupo.docente}</td>\n <td>${grupo.aula}</td>\n <td>${grupo.creditos}</td>\n <td><button class=\"eliminar-mat\" data-id=\"${grupo.idgpo}\">x</button></td>\n `;\n document.querySelector(\"#listaGpos tbody\").appendChild(row);\n}", "title": "" }, { "docid": "299f3bd349e03c6f989176c37aa398b3", "score": "0.5649099", "text": "function createRow(name,value,readonly,type)\n {\n return \"<tr><td>\"+name+\"</td><td><input class='form-control' id=\\\"\"+name+\"\\\" type=\\\"\"+type+\"\\\" value=\"+value+\" \"+readonly+\"></td></tr>\";\n }", "title": "" }, { "docid": "d3a6a960a55c7fa14acced1e54686b7d", "score": "0.5647972", "text": "function appendToAssignmentTable (new_assignment) {\n $(\"#assignments_table > tbody:last-child\").append(`\n <tr id=\"assignment-${new_assignment.id}\">\n <td class=\"assignmentName assignmentData\" name=\"name\">${new_assignment.name}</td>\n <td class=\"assignmentDueDate assignmentData\" name=\"due_date\">${new_assignment.due_date}|date:'Y-m-d'</td>\n <td class=\"assignmentCollection assignmentData\" name=\"collection\">${new_assignment.collection.name}</td>\n <td class=\"assignmentMin assignmentData\" name=\"min_hours\">${new_assignment.min_hours}</td>\n <td class=\"assignmentMax assignmentData\" name=\"max_hours\">${new_assignment.max_hours}</td>\n <td class=\"assignmentPriority assignmentData\" name=\"priority\">${new_assignment.priority}</td>\n <td align=\"center\">\n <button class=\"btn btn-secondary form-control\" onClick=\"editAssignment(${new_assignment.id})\" data-toggle=\"modal\" data-target=\"assignmentModal\">EDIT</button>\n </td>\n <td align=\"center\">\n <button class=\"btn btn-success\" onClick=\"changeComplete(${new_assignment.id})\">COMPLETE</button>\n </td>\n <td align=\"center\">\n <button class=\"btn btn-danger form-control\" onClick=\"deleteAssignment(${new_assignment.id})\">DELETE</button> \n </td>\n </tr>\n `);\n }", "title": "" }, { "docid": "2386928e6709cbc22c4e5a66c6161b35", "score": "0.5630346", "text": "function addTableRow(event){\n\n\tvar tableRow = `<tr class=\"event\">\n\t\t\t\t\t\t<td class='col-md-3 '>${event['datetime']}</td> \n\t\t\t\t\t\t<td class='col-md-3 event-title' data-title='${event['user_details']['name']} ${event['type']}'>${event['user_details']['name']} ${event['type']}</td> \n\t\t\t\t\t\t<td class='col-md-3'><a class='event_details' data-id=${event['id']} href=/event_detials?id=${event['id']} > ${event['description']} </a></td> \n\t\t\t\t\t</tr>`\n\n\treturn tableRow;\n}", "title": "" }, { "docid": "be13a15b5905f6b5688f10a0afa14177", "score": "0.5618235", "text": "function showExerciseInfo(tx, rs) {\n var exerciseOutput = \"<table border='1'>\";\n exerciseOutput += \"<tr><td>ID</td><td>\" + rs.rows.item(0).ID + \"</td></tr>\"\n exerciseOutput += \"<tr><td>Name</td><td>\" + rs.rows.item(0).exercise_name + \"</td></tr>\"\n exerciseOutput += \"<tr><td>Machine #</td><td>\" + rs.rows.item(0).machine_num + \"</td></tr>\"\n exerciseOutput += \"<tr><td>Type of Exercise</td><td>\" + rs.rows.item(0).exercise_type + \"</td></tr>\"\n exerciseOutput += \"<tr><td>Measured By:</td><td>\" + rs.rows.item(0).exercise_measure+ \"</td></tr>\"\n exerciseOutput += \"</table>\"\n\n\n $(\"#exerciseInfo\").html(exerciseOutput);\n\n\n}", "title": "" }, { "docid": "9e756c4063f8d04b2993009ceed90fbb", "score": "0.55969334", "text": "function buildErrorRowHtml (err) {\n return '<li>' + htmlEscape(err) + '</li>'\n }", "title": "" }, { "docid": "52c7fafbb65befbe2b94b965eaddcdef", "score": "0.5589888", "text": "function format (d) {\n // `d` is the original data object for the row\n \n return '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\">'+\n '<tr>'+\n '<td>Admission\\'s Page Link:</td>'+\n '<td>' + d[\"9\"] + '</td>'+\n '</tr>'+\n '<tr>'+\n '<td>Gateway Admission\\'s Page Link:</td>'+\n '<td>' + d[\"10\"] + '</td>'+\n '</tr>'+\n '</table>';\n }", "title": "" }, { "docid": "2abce325a9603a4194864ecd0121071e", "score": "0.55717534", "text": "function addRowRight(doctor) {\n $(\"#d_rowsRight\").append(\n `<tr class=\"tabRow\"><td width=\"15%\"><img src=\"../assets/img/doctors/${doctor.imageurl}\" height=\"auto\" width=\"100%\"></td><td width=\"85%\"><table id=\"doctorsInfo\" cellpadding=\"10\" cellspacing=\"10\"><tr id=\"doctorName\"><td><a href=\"doctor.html?id=${doctor.id}\"><font size=\"4\">${doctor.name}</font></a></td></tr><tr id=\"doctorSpec\"><td><font size=\"3\">${doctor.spec}</font></td></tr></table></td></tr>`);\n}", "title": "" }, { "docid": "48fc3753c852a1eefac8088ef9e96874", "score": "0.55680984", "text": "function tableRowTemplate(user, i){\n var url = `http://www.freecodecamp.org/${user.username}`\n return (`\n <tr>\n <td class=\"rank\">${i+1}</td>\n <td class=\"username\">\n <a href=\"${url}\" target=\"_blank\"><img class=\"avatar\" src=\"${user.img}\" />${user.username}</a>\n </td>\n <td class=\"recent\">${user.recent}</td>\n <td class=\"alltime\">${user.alltime}</td>\n </tr>`)\n }", "title": "" }, { "docid": "a916be5b2a07195cd83ab5b2bc75e334", "score": "0.5544912", "text": "function addRow(table, text, gravatarUrl, url) {\n var tr = document.createElement(\"tr\");\n\n var imageTd = document.createElement(\"td\");\n var textTd = document.createElement(\"td\");\n\n textTd.innerText = text;\n\n var image = document.createElement(\"img\");\n image.src = gravatarUrl;\n image.className = \"gravatarPicture\";\n imageTd.appendChild(image);\n\n tr.appendChild(imageTd);\n tr.appendChild(textTd);\n tr.className = \"listElement\";\n\n tr.addEventListener(\"click\", function() {\n window.open(url);\n });\n\n table.appendChild(tr);\n}", "title": "" }, { "docid": "ebfdc61612969454a1a1dde0eee205fb", "score": "0.5543046", "text": "function createTableRow(resp){\n let tr = document.createElement(\"tr\");\n tr.style.border=\"1px solid black\"\n let td1 = document.createElement(\"td\");\n td1.style.border=\"1px solid black\"\n td1.innerHTML=resp.name;\n let td2 = document.createElement(\"td\");\n td2.style.border=\"1px solid black\"\n td2.innerHTML=resp.gender;\n let td3 = document.createElement(\"td\");\n td3.style.border=\"1px solid black\"\n td3.innerHTML=resp.culture;\n let td4 = document.createElement(\"td\");\n td4.style.border=\"1px solid black\"\n td4.innerHTML=resp.playedBy[0];\n tr.append(td1,td2,td3,td4)\n return tr;\n}", "title": "" }, { "docid": "f90fb857ef4cac29e934cb480ceb5489", "score": "0.55429286", "text": "function write_html(data, row) {\n if (row.category == 'Gadget') {\n row.title += ' (Like New)';\n }\n\n if (row.worthless) {\n hide_after(1, row.item_id);\n }\n\n return \"<tr class='new response'> <td class='upc'>\" + row.product_code + \"</td> <td class='details'> <div class='td_image'> <img src='\" + row.images + \"' alt='\" + row.title + \"' /> </div><div class='td_details'> <strong>\" + row.title + \"</strong><br /><em>\" + (row.author == null ? '' : row.author) + \"</em><br/>\" + (row.category == null ? \"\" : row.category) + \"</div> </div></td> <td class='quantity'>\" + row.quantity + \"</td> <td class='item'>\" + (row.worthless == true ? \"<p class='blatent'>No Abunda Value</p>\" : \"\") + (row.overstocked == true ? \"<span class='blatent'>Over Stocked Item</span>\" : \"\") + \"<div class='item'>\" + data.currency_for_total + row_price + \"</div></td> <td class='values'>\" + data.currency_for_total + row_total + \"</td> <td class='delete'> <a href='#' alt='Delete' class='delete_this_row' id='del_\" + row.item_id + \"'>Delete</a></tr>\";\n}", "title": "" }, { "docid": "3efdbabc9a526b7a23a4cb45197e6fc8", "score": "0.55191916", "text": "function mkTableRow(obj){\n var info_row = $('<tr>');\n info_row.append('<td class=\"expand\"><i class=\"icon-chevron-right\"></i></td>');\n table_template.forEach(function(value,index){\n info_row.append('<td>'+obj[value.selector]+'</td>');\n });\n\n var data_row = $('<tr>');\n data_row.hide();\n var data = JSON.stringify(obj, undefined, 2);\n var colspan = table_template.length;\n data_row.append('<td colspan=\"'+colspan+'\"><pre class=\".pre-scrollable\">'+data+'</pre></td>')\n\n var res = [info_row, data_row];\n\n return res;\n}", "title": "" }, { "docid": "ebd5edeff89436cd367444f66a7d0b4f", "score": "0.55136776", "text": "function displayGroup(group) {\n const cayleyTitle = (group.cayleyDiagrams.length == 0) ?\n undefined :\n group.cayleyDiagrams[0].name;\n const symmetryTitle = (group.symmetryObjects.length == 0) ?\n undefined :\n group.symmetryObjects[0].name;\n\n $(`tr[group=\"${group.URL}\"]`).remove();\n let $row = $(eval(Template.HTML('row_template')));\n\n // draw Cayley diagram\n {\n const graphicData = new CayleyDiagram(group, cayleyTitle);\n const img = graphicContext.getImage(graphicData);\n group.CayleyThumbnail = img.src;\n img.height = img.width = 32;\n $row.find(\"td.cayleyDiagram a div\").html(img.outerHTML);\n }\n\n // draw Multtable\n {\n const graphicData = new Multtable(group);\n const img = multtableContext.getImage(graphicData);\n $row.find(\"td.multiplicationTable a div\").html(img.outerHTML);\n }\n\n // draw Symmetry Object\n if (symmetryTitle == undefined) {\n $row.find(\"td.symmetryObject\").html('none').addClass('noDiagram').removeAttr('title');\n } else {\n const graphicData = SymmetryObject.generate(group, symmetryTitle);\n const img = graphicContext.getImage(graphicData);\n img.height = img.width = 32;\n $row.find(\"td.symmetryObject a div\").html(img.outerHTML);\n }\n\n // draw Cycle Graph\n {\n const graphicData = new CycleGraph( group );\n const img = cycleGraphContext.getImage( graphicData );\n $row.find(\"td.cycleGraph a div\").html(img.outerHTML);\n }\n\n return $row;\n}", "title": "" }, { "docid": "f476e20ef54765c326d3e4e732c0e421", "score": "0.54997057", "text": "function addRow() {\n\t\tvar guestTable = $('#guestTable'); \n\t\tvar headers = guestTable.find(\"thead\").find(\"th\"); \n \n\t\tif(guestTable.find('tbody').length < 1){\n\t\t\tguestTable.append(\"<tbody></tbody>\"); \n\t\t}\n\n\t\tvar tr = $(\"<tr></tr>\"); \n\t\tvar rowColor = getRowColor(); \n\t\ttr.css(\"background-color\", rowColor); \n\t\tguestTable.find('tbody').append(tr); // TABLE ROW.\n\n\t\tfor (var i = 0; i < headers.length; i++) {\n\t\t\tvar td = $(\"<td></td>\"); \n\t\t\ttd.attr(\"align\", \"center\"); \n\t\t\ttr.append(td); \n\n\t\t\tswitch(headers[i].innerHTML){\n case \"First Name\": td.append(createInputField(\"First Name*\", \"guestfirst[]\")); break; \n\t\t\t\tcase \"Last Name\": td.append(createInputField(\"Last Name*\", \"guestlast[]\")); break; \n\t\t\t\tcase \"Plus One\": td[0].appendChild(getPlusOneDropdown()); break;\n\t\t\t\tcase \"Relation\" : td[0].appendChild(getRelationDropdown(-1)); break; \n\t\t\t\tdefault: td[0].appendChild(getRemoveButton()); break; \n\t\t\t}\n\t\t}\n\n\t\tnumOfGuests++;\n\t}", "title": "" }, { "docid": "ceb03506c38273fa5e01e14da40baf43", "score": "0.54979104", "text": "function createTableRow(result, resultsType, semesterOverride) {\n var tr = document.createElement(\"tr\");\n var td = document.createElement(\"td\");\n\n // Assign type-specific elements and attributes.\n var label = null;\n // Create course-type labels.\n if (resultsType == \"course\") {\n // Create info button.\n var infoBut = createInfoButton(result, semesterOverride);\n\n // Create label and onclick listener\n label = text(createCourseTag(result));\n td.addEventListener(\"click\", courseResultHandler); // note td\n td.semesterOverride = semesterOverride; // if not provided, will be undefined\n }\n // Create program-type labels.\n else if (resultsType = \"program\") {\n label = text(createProgramTag(result));\n tr.addEventListener(\"click\", programResultHandler); // note tr\n }\n\n // Cache database information to reduce future queries.\n tr.obj_data = JSON5.stringify(result);\n\n // Add elements to each other\n td.appendChild(label);\n tr.appendChild(td);\n\n // Add infobutton if needed.\n if (resultsType == \"course\") {\n td.appendChild(infoBut);\n }\n\n return tr;\n}", "title": "" }, { "docid": "21a3eb192101285c8cb3818f066ca1ce", "score": "0.54974884", "text": "append_row(arg_key, arg_content, arg_depth, arg_expanded)\n\t{\n\t\tvar id = 'tr_' + uid()\n\t\tvar style = 'padding-left:' + arg_depth * 20 + 'px'\n\t\t// var style = ''\n\t\tvar class_expanded = arg_expanded ? 'expanded' : 'collapsed'\n\n\t\tvar html_row = '<tr id=\"' + id + '\" class=\"node_content ' + class_expanded + '\" data-depth=\"' + arg_depth + '\">'\n\t\thtml_row += '<td style=\"' + style + '\">' + arg_key + '</td>'\n\t\thtml_row += '<td>' + arg_content + '</td>'\n\t\thtml_row += '</tr>'\n\t\t\n\t\tthis.tbody_jqo.append(html_row)\n\t}", "title": "" }, { "docid": "c48c5e15192f4febc539ffd4e2d8d8cc", "score": "0.5490784", "text": "function create_html(genrations){\n\t\t// Start ul tag\n var html='<ul class=\"mainul\">';\n \n\t\tfor(i = 0; i < genrations.length; i++){\n\t\t html+='<li class=\"header\">Genration '+(i+1)+' <a onclick=\"add_new_member('+i+')\" class=\"pointer\" title=\"Add new member\">+</a></li>';\n\t\t \n\t\t // this function will sort the array in alphabetical order, which will also be case insensitive\n\t\t genrations[i].sort(function (a, b) {\n\t\t\t\treturn a.toLowerCase().localeCompare(b.toLowerCase());\n\t\t\t});\n\t\t\tfor(j = 0; j < genrations[i].length; j++){\n\t\t\t\thtml+='<li>'+genrations[i][j]+'</li>';\n\t\t\t}\n\t\t}\n\t\thtml+='<li> <button class=\"pointer genrationbutton\" onclick=\"add_genration()\">Add new genration</button></li>';\n\t\t// ends our ul tag here\n html+='</ul>';\n \n save_genrations(genrations)\n return html;\n\t}", "title": "" }, { "docid": "88603663dd60467e13b735f75115719f", "score": "0.5488057", "text": "function AppendTable(employee) {\n var tableContent = `<tr employee-id=${employee.employeeId}>\n <td><img src=\"${employee.picture}\" class=\"picture\"></td>\n <td>${employee.lastName}</td>\n <td>${employee.firstName}</td>\n <td>${employee.email}</td>\n <td>${employee.gender}</td>\n <td>${employee.birthDate}</td>\n <td class=\"stergere\"><img src=\"/images/trash.svg\"></td>\n </tr>`\n console.log(employee);\n document.getElementById(\"table-employees\").innerHTML += tableContent;\n}", "title": "" }, { "docid": "47471940f1fd85449f4c803d68cb45ae", "score": "0.54874325", "text": "function showGroupDetails(id){\n\tvar url = 'https://'+CURRENT_IP+'/cgi-bin/NFast_3-0/CGI/ADMINISTRATION/FQueryCgiAdminPy.py?action=showUserGroups&query={\"QUERY\":[{\"UserId\":\"'+id+'\",\"Filter\":\"\",\"Limit\":\"20\",\"Page\":\"1\"}]}';\n\t$.ajax({\n\t\turl: url,\n\t\tdataType: 'html',\n\t\tsuccess: function(data){\n\t\t\tdata = data.replace(/'/g,'\"');\n\t\t\tvar jsonData = jQuery.parseJSON(data);\n\t\t\tfor (var a=0;a<jsonData.data[0].row.length;a++){\n\t\t\t\tvar row = jsonData.data[0].row[a];\n\t\t\t\tstr += \"<tr>\";\n\t\t\t\tstr += \"<td>\"+row.GroupName+\"</td>\";\n\t\t\t\tstr += \"<td>\"+row.Description+\"</td>\";\n\t\t\t\tstr += \"<td>\"+row.ResourceProfile+\"</td>\";\n\t\t\t\tstr += \"<td>\"+row.ZoneName+\"</td>\";\n\t\t\t\tstr += \"<td>\"+row.AccessRight+\"</td>\";\n\t\t\t\tstr += \"</tr>\";\n\t\t\t}\n\t\t\t$('#bindedUserGroup-table > tbody').empty().append(str);\n\t\t}\n\t});\n\t\t\n}", "title": "" }, { "docid": "4b0410a26645ee86f9462bc3543b2fa2", "score": "0.5477937", "text": "function addRow(data) {\n var row = '<tr data-id=' + data.id + ' id=\"row' + data.id + '\">' +\n '<td>' + data.patente + '</td>' +\n\t\t\t'<td>' + data.marca + '</td>' +\n\t\t\t'<td>' + data.modelo + '</td>' +\n '<td>' +\n '<div class=\"t-actions\">' +\n '<a class=\"asociar_chofer\" href=\"#\" role=\"button\"><span class=\"span-actions span-vehiculo\">+ Chofer</span></a>'+ ' ' +\n '<a class=\"editar_vehiculo\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal-editar-vehiculo\" role=\"button\"><span class=\"span-actions span-editar\">Editar</span></a>' + ' ' +\n '<a href=\"#\" type=\"submit\" class=\"btn-delete-vehiculo\"><span class=\"span-actions span-eliminar\">Eliminar</span></a>' + ' ' +\n '</div>' +\n '</td>' +\n '</tr>';\n $('#t-header-content-principal').after(row);\n }", "title": "" }, { "docid": "841fa6befc9c956ac658cc9f21c98d5a", "score": "0.5464912", "text": "function writePoolTable(SQLResult) {\n console.log(SQLResult);\n let tableStr = \"\";\n for (let item of SQLResult) {\n tableStr += \"<tr><td><input type=\\\"radio\\\" id=\\\"\" + item.poolBarcode + \"\\\" value=\\\"\" + item.poolBarcode + \"\\\"></td>\" +\n \"<td> \" + item.poolBarcode + \" </td>\" +\n \"<td> \" + item.testBarcode + \" </td>\" +\n \"</tr>\";\n }\n //tableStr += \"</table>\"\n console.log(tableStr);\n return tableStr;\n}", "title": "" }, { "docid": "c84f4ae5ae4db37d558e846220f92efd", "score": "0.5464676", "text": "_getServerTableAddRow() {\n let tr = document.createElement(\"TR\");\n tr.innerHTML = \"<td><input id='conf-server-name'></td><td><input id='conf-server-url'></td><td><button\" +\n \" class='btn btn-success conf-btn-add-server'>\" + window.iotlg.addButton + \"</button></td>\";\n return tr;\n }", "title": "" }, { "docid": "0eb408cd37f1c95cbf2c808da06b9818", "score": "0.5455077", "text": "function generateTable(sample) {\n var template = \"\";\n var i = 1;\n var index = 0;\n template += \"<div class='accordion'>\";\n sample.forEach(function (x) {\n\n template += \"<h3>\" + x.getLastName() + \", \" + x.getFirstName() + \"</h3>\";\n //template +=\"<h3>\"+\"Edit\"+\"</h3>\";\n template += \"<div>\";\n //template +=\"ITEM \"+i +\"<br>\";\n template += \"First Name - \" + x.getFirstName() + \"<button id='editButton' class='btn editButton' style='float:right;' val='\" + index + \"'>EDIT</button>\" + \"<br>\";\n\n template += \"Last Name - \" + x.getLastName() + \"<br>\";\n template += \"DOB - \" + x.getDob() + \"<br>\";\n template += \"Gender - \" + x.getGender() + \"<br>\";\n template += \"Address - \" + x.getAddress() + \"<br>\";\n template += \"State - \" + x.getCountry() + \"<br>\";\n template += \"Cars - \" + x.getCars() + \"<br>\";\n //template +=\"<button>\"+x.submit+\"</button>\";\n //template += \"<hr>\"\n template += \"</div>\";\n\n i++;\n index++;\n //x.checkData();\n });\n\n template += \"</div>\";\n return template;\n\n}", "title": "" }, { "docid": "30d316e0ab46e5d2efde0423429e10a7", "score": "0.54534835", "text": "function createHTML(loggedInUser){\r\n\r\n return \"<div>\"+\r\n \"<p id='firstname'> First name: \" + loggedInUser.firstname + \"<p>\"+\r\n \"<p id='lastname'> Last name: \" + loggedInUser.lastname + \"</p>\"+\r\n \"<p id='dateOfBirth'> Date of Birth: \" + loggedInUser.dateOfBirth + \"</p>\"+\r\n \"<p id='image'> \" + \"<img src=\" + loggedInUser.image + \" />\" + \"</p>\" +\r\n \"<p id='qualifications'> Qualifications: \" + loggedInUser.qualifications + \"</p>\"+\r\n \"<p id='description'> Description: \" + loggedInUser.description + \"</p>\"+\r\n \"</div>\";\r\n}", "title": "" }, { "docid": "7a310b33fa566cb2d8f61c00ed683633", "score": "0.5452756", "text": "function addRow(tableName, row, stat, label, source, pctLabel)\n{\n var table = document.getElementById(tableName);\n var NewRow = document.createElement(\"tr\");\n\n\n var statName = document.createElement(\"tooltiptext\")\n statName.setAttribute(\"title\", source);\n $('<p>' + label + '</p>').appendTo(statName);\n\n var NewCol1 = document.createElement(\"td\");\n NewCol1.setAttribute(\"id\", \"label\")\n var NewCol2 = document.createElement(\"td\");\n var NewCol3 = document.createElement(\"td\");\n\n var Text2 = document.createTextNode(row[stat].toLocaleString('en'));\n\n var percentName = document.createElement(\"tooltiptext\")\n percentName.setAttribute(\"title\", pctLabel);\n var percentText = document.createTextNode(row['perc'].toLocaleString('en', {style: \"percent\"}));\n $(percentText).appendTo(percentName);\n\n\n var NewCol4 = document.createElement(\"td\");\n var Text4 = document.createTextNode(row['reliability']);\n\n\n\n\n // $('<p>' + (row['meas_aggregate_mean'].toLocaleString('en', {style: \"percent\"} + '</p>')).appendTo(percentName);\n // var Text3 = document.createTextNode(row['meas_aggregate_mean'].toLocaleString('en', {style: \"percent\"}));\n\n table.appendChild(NewRow);\n NewCol1.appendChild(statName);\n NewCol4.appendChild(Text4);\n NewRow.appendChild(NewCol1);\n NewRow.appendChild(NewCol4);\n NewRow.appendChild(NewCol2);\n NewRow.appendChild(NewCol3);\n NewCol2.appendChild(Text2);\n NewCol3.appendChild(percentName);\n}", "title": "" }, { "docid": "9b4794c78868a89c6b33af92a7e62b3a", "score": "0.54506254", "text": "function ContenidoComida(dato) {\n let fila = document.createElement(\"tr\");\n $(fila).append(\n $(\"<td>\").html(dato.id).attr(\"role\",\"id\")\n ).append(\n $(\"<td>\").html(dato.descripcion).attr(\"role\", \"nombre\")\n ).append(\n $(\"<td>\").html(dato.tipo).attr(\"role\", \"tipo\")\n ).append(\n $(\"<td>\").html(dato.cantidad).attr(\"role\", \"cantidad\")\n ).attr(\"scope\", \"row\")\n ;\n return fila;\n}", "title": "" }, { "docid": "04c91a1638786dc6df2ee0a6522493d5", "score": "0.5441027", "text": "m_renderRow(rowData, fullData) {\n var tr = this.m_createTableRow();\n for (var i = 0; i < rowData.length; i++) {\n tr.appendChild(this.m_createTableData(rowData[i]));\n }\n tr.dataset.fileid = fullData.FILEID;\n return tr;\n }", "title": "" }, { "docid": "7f24fe413941cab9bce4d6efb396925c", "score": "0.5438924", "text": "function createdRow(row, data, dataIndex) {\n $(row.getElementsByTagName(\"TD\")[0]).html(dataIndex + 1);\n $(row.getElementsByTagName(\"TD\")[2]).html('<h5 class=\"m-0\">'+ data.firstName + ' ' + data.lastName +'</h5>');\n\n // Recompiling so we can bind Angular directive to the DT\n $compile(angular.element(row).contents())($scope);\n }", "title": "" }, { "docid": "2af4e734f7ef1c994098caee66c36913", "score": "0.5434969", "text": "scoreRow(score){\n const trHTML = htmlCreator.element(\"tr\");\n const tdHTML = htmlCreator.element(\"td\",{},score.username);\n const tdpointsHTML = htmlCreator.element(\"td\",{},score.points);\n trHTML.append(tdHTML);\n trHTML.append(tdpointsHTML);\n return trHTML;\n }", "title": "" }, { "docid": "704e8e8f08c8be143b1728c6dce9eaf5", "score": "0.5424526", "text": "function makeRow(data){\r\n return \"<li>\"+data+\"</li>\"\r\n}", "title": "" }, { "docid": "3d7848912ae264cf72ad5fb84976c795", "score": "0.5404789", "text": "function create_fieldset_row( type, name, user_friendly_label, id, required, class_name )\n{\n\tvar label = '<label for =\"' + name + '\">' + user_friendly_label + '</label>';\n\tvar textbox = '<input type=\"' + type + '\" name=\"' + name + '\" id=\"' + id + '\" required=\"' + required + '\" class=\"' + class_name + '\" />';\n\t\n\treturn label + textbox;\n}", "title": "" }, { "docid": "5f770e7733ce9762fbf30e77a266b0e3", "score": "0.5402191", "text": "function tableBuilder(response) {\n console.log('tableBuilder');\n var output = \"\";\n for (var i in response) {\n output += \"<tr id='\"+response[i].acc_name+\"Row'><td>\" +\n response[i].acc_id +\n \"</td><td>\" +\n response[i].acc_name +\n \"</td><td>\" +\n response[i].acc_login +\n \"</td><td>\" +\n \"</td><td>\" +\n \"<button id='\"+response[i].acc_name+\"' type='button' onclick='startEditUser()'>E</button>\" +\n \"<button id='\"+response[i].acc_id+\"' type='button' onclick='deleteUser()'>D</button>\" +\n \"</td></tr>\";\n }\n document.getElementById(\"acc\").innerHTML = output;\n }", "title": "" }, { "docid": "90ecc161482d7be47caeb4c7a5637d5c", "score": "0.53992075", "text": "function makeRow(str) {\n var row = document.createElement(\"p\");\n row.innerHTML = str;\n\n document.getElementById(\"messages\").appendChild(row);\n}", "title": "" }, { "docid": "39a9a2efe97c4d707817e273ef6a0c35", "score": "0.53933644", "text": "function appendRow(data) {\n $(\"#institutions-data-table\").DataTable().row.add([\n \"<small><a class='institution-address' style='cursor: pointer;' href'#' >\" + data[0] + \"</a><small>\",\n data[1],\n \"<span class='\" + data[0] + \"'><i class='fa fa-spinner fa-pulse'></i><span>\"\n ]).draw();\n }", "title": "" }, { "docid": "09a484c6f751a8b79b4e0ae1aa7071fa", "score": "0.5379884", "text": "function drawRow(rowData) {\n var row = $(\"<tr />\")\n \n row.append($(\"<td>\" + rowData.status + \"</td>\"));\n row.append($(\"<td>\" + rowData.notes + \"</td>\"));\n \n return row[0];\n }", "title": "" }, { "docid": "b2a1cbcf62a9f218be72710e6c43cbeb", "score": "0.537984", "text": "function operateFormatter(value, row, index) {\r\n return [\r\n '<a id=\"edit\" class=\"edit ml10\" href=\"javascript:void(0)\" title=\"Edit\">',\r\n '<i class=\"glyphicon glyphicon-edit\"></i>',\r\n '</a>&nbsp;&nbsp;',\r\n '<a id=\"delete\" class=\"remove ml10\" href=\"javascript:void(0)\" title=\"Remove\">',\r\n '<i class=\"glyphicon glyphicon-remove\"></i>',\r\n '</a>'\r\n ].join('');\r\n}", "title": "" }, { "docid": "98ef1bf84e5a08f0fb7a5c7e806fb270", "score": "0.53744125", "text": "function addTableRow(message){\n $('#tableRow').html(\n '<tr>'+\n '<td colspan=\"6\">'+message+' </td>'+\n '</tr>'\n )\n}", "title": "" }, { "docid": "98a923ce16bd7a0d3e5bd9e87070080e", "score": "0.5371304", "text": "function createRow(table, json) {\n // Creating table row with the data base id\n var tr = document.createElement(\"tr\");\n tr.setAttribute(\"id\", json.id);\n\n // Creating table columns\n var tdName = document.createElement(\"td\");\n var tdEmail = document.createElement(\"td\");\n var tdDelete = document.createElement(\"td\");\n var tdUpdate = document.createElement(\"td\");\n\n // adding data in the columns\n tdName.innerText = json.name;\n tdEmail.innerText = json.email;\n\n // adding the delete image to the column\n var imgDelete = document.createElement(\"img\");\n imgDelete.setAttribute(\"src\", \"img/delete.png\");\n imgDelete.setAttribute(\"onclick\", \"fnDelete(\" + json.id + \");\");\n tdDelete.appendChild(imgDelete);\n\n // adding the update image to the column\n var imgUpdate = document.createElement(\"img\");\n imgUpdate.setAttribute(\"src\", \"img/update.png\");\n imgUpdate.setAttribute(\"onclick\", \"enableUpdate(\" + json.id + \");\");\n tdUpdate.appendChild(imgUpdate);\n\n // adding the columns in the row\n tr.appendChild(tdName);\n tr.appendChild(tdEmail);\n tr.appendChild(tdDelete);\n tr.appendChild(tdUpdate);\n\n // adding the row in the table\n table.appendChild(tr);\n}", "title": "" }, { "docid": "150ec579a0b98a0e8fa15d88f4ca6b44", "score": "0.53709406", "text": "m_createTableRow() {\n return document.createElement(\"tr\");\n }", "title": "" }, { "docid": "9b3b4f937f54c393b9eb53f80374f7e8", "score": "0.5368971", "text": "function add_table_row(game) {\n let html = \"<tr id=tr_\" + game.id + \">\";\n html += form_game_table_row(game);\n html += \"</tr>\";\n\n $(\"#res-table tbody\").append(html);\n}", "title": "" }, { "docid": "755d484075bd89d099c59b5a5dddb2d8", "score": "0.53670114", "text": "function addEncounterRow(date, type, serviceProvider) {\n encounters.innerHTML += \"<tr> <td>\" + date + \"</td><td>\" + type + \"</td><td>\" + serviceProvider + \"</td></tr>\";\n}", "title": "" }, { "docid": "92348e1c7d7ad1e9a46922ef695dcdb1", "score": "0.53655106", "text": "addRow(HTMLData)\n {\n let row = $('<tr></tr>');\n\n HTMLData.forEach(function(data)\n {\n let column = $('<td></td>');\n\n column.html(data);\n row.append(column);\n });\n\n if ($(this).attr('no-delete') === undefined)\n {\n let deleteButton = $('<button></button>').text('delete').click(function()\n {\n row.remove();\n });\n row.append($('<td></td>').append(deleteButton));\n }\n\n $(this.table).append(row);\n\n // Adding rows can increase our page height -> Reposition footer if needed.\n window.cFooter();\n }", "title": "" }, { "docid": "30b1c5240a4215d5c4a1721a0f02262f", "score": "0.5361843", "text": "function addRowToBillingTable(accountNumber, accountName, email) {\n\t\treturn '<tr id=\"' + accountNumber + '\" title=\"' + accountNumber + '\"><td>' + accountName + '</td><td>' + email + '</td></tr>'\n\t}", "title": "" }, { "docid": "349eaff40d5e9ee7ea1ae300657498a2", "score": "0.5357232", "text": "function tableInsertNewRowFunction() {\n var newSkill = {\n description: document.getElementById(\"mySkill\").value,\n linkToPicture: document.getElementById(\"relatedPicture\").value,\n get linkAsHtml() {\n return \"<img id=\" +'\"myImg\"' + ' src=\"' + this.linkToPicture + '\" width=\"84\" height=\"58\">';\n }\n }\n\n /* New row node is created for the table */\n /* New cell nodes are created for the row node */\n /* The values from the \"skills\" object are inserted to cells */\n var table = document.getElementById(\"myTable\");\n var row = table.insertRow(0);\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n\n cell1.innerHTML = newSkill.description;\n cell2.innerHTML = newSkill.linkAsHtml;\n}", "title": "" }, { "docid": "d5e18599bd10d3371bb68d7b4a9d25d0", "score": "0.5351454", "text": "function rowmlist(clearanceStat, contactnum, fname, idnum, liability, lname, mname, yearLevel)\n{\n\n\treturn '<tr class=\"table-success\" onclick=\"clickdata(this)\">'+\n\t\t\t'<td>'+idnum+'</td>'+\n\t\t\t'<td>'+fname+'</td>'+\n\t\t\t'<td>'+mname+'</td>'+\n\t\t\t'<td>'+lname+'</td>'+\n\t\t\t'<td>'+yearLevel+'</td>'+\n\t\t\t'<td>'+contactnum+'</td>'+\n\t\t\t'<td>'+liability+'</td>'+\n\t\t\t'<td>'+clearanceStat+'</td>'+\n\t\t\t'<td> <a title=\"Edit\" data-toggle=\"tooltip\" data-placement=\"top\"><button class=\"btn btn-primary btn-xs\" data-target=\"#edit\" data-toggle=\"modal\" data-title=\"Edit\"><span class=\"glyphicon glyphicon-pencil\"></span></button>' +\n\t\t\t'</a><a title=\"Delete\" data-toggle=\"tooltip\" data-placement=\"top\"><button class=\"btn btn-danger btn-xs\" data-target=\"#delete\" data-toggle=\"modal\" data-title=\"Delete\"> <span class=\"glyphicon glyphicon-trash\"></span></button> </a></td>' +\n\t\t\t'</tr>';\n\n}", "title": "" }, { "docid": "69b4069a5b5d07acb88cfd666b97eacc", "score": "0.5351297", "text": "function makeRow(type, keys, curObj)\n{\n let row = $(document.createElement('tr'));\n for (var col = 0; col < keys.length; col++)\n {\n let td = $(document.createElement('td'));\n let cellVal = curObj[keys[col]];\n // Final column is a checkbox in checkbox tables\n if (type == TABLE_CHECK && col == keys.length - 1)\n {\n checkBox = $(document.createElement('input'));\n checkBox.attr(\"type\", \"checkbox\");\n let checked = true;\n if (cellVal == \"false\" || !cellVal)\n checked = false;\n checkBox.attr(\"checked\", checked);\n checkBox.attr(\"id\", \"check\" + curObj.id);\n td.append(checkBox);\n }\n else\n td.text(cellVal);\n row.append(td);\n }\n //Adding row buttons\n if (type == TABLE_CRUD)\n {\n for (i = 0; i < 2; i++)\n {\n let td = $(document.createElement('td'));\n let button = $(document.createElement('button'));\n if (i == 0)\n {\n button.html(\"Modify\");\n button.attr(\"onclick\", \"openModify(\" + curObj.id + \")\");\n }\n else\n {\n button.html(\"Delete\");\n button.attr(\"onclick\", \"deleteData(\"+ curObj.id+ \")\");\n }\n button.attr(\"class\", \"btn btn-primary\");\n td.append(button);\n row.append(td);\n }\n }\n return row;\n}", "title": "" }, { "docid": "05150dfd2fea85a51e7eb168c56ef051", "score": "0.5348742", "text": "function tblEventCreatedRow(row, data, index) {\n\t\t\t$compile(angular.element(row).contents())($scope);\n\t\t}", "title": "" }, { "docid": "05150dfd2fea85a51e7eb168c56ef051", "score": "0.5348742", "text": "function tblEventCreatedRow(row, data, index) {\n\t\t\t$compile(angular.element(row).contents())($scope);\n\t\t}", "title": "" }, { "docid": "1ca8c0a10c779754dce286b0d472b9ed", "score": "0.5347547", "text": "function drawRow(rowData) {\n let row = \n `\n <tr class=\"bookRow\" />\n <td class=\"bookView\"> \n <button type\"submit\" class=\"bookViewButton\" tabindex=\"\">View</button>\n </td>\n <td class=\"bookID\">${rowData.id}</td>\n <td class=\"bookTitle capitalize\">${rowData.title}</td>\n <td class=\"bookAuthor\">${rowData.author}</td>\n <td class=\"bookGenre hide capitalize\">${rowData.genre}</td>\n <td class=\"bookRL hide\">${rowData.readingLevel}</td>\n </tr>\n `;\n $(\".libraryBooksDisplayed\").append(row);\n}", "title": "" }, { "docid": "8696de49ecffc0d97c36297a98233a60", "score": "0.53447956", "text": "function RenderRow() { }", "title": "" }, { "docid": "459445be28c2afc908f524803170c592", "score": "0.5344303", "text": "function rowelist(eventDate, eventDesc, eventName, eventNo)\n{\n\n\treturn '<tr class=\"table-success\" onclick=\"clickdata2(this)\">'+\n\t\t\t'<td>'+eventNo+'</td>'+\n\t\t\t'<td>'+eventName+'</td>'+\n\t\t\t'<td>'+eventDate+'</td>'+\n\t\t\t'<td>'+eventDesc+'</td>'+\n\t\t\t'<td> <a title=\"Edit\" data-toggle=\"tooltip\" data-placement=\"top\"><button class=\"btn btn-primary btn-xs\" data-target=\"#edit\" data-toggle=\"modal\" data-title=\"Edit\"><span class=\"glyphicon glyphicon-pencil\"></span></button>' +\n\t\t\t'</a><a title=\"Delete\" data-toggle=\"tooltip\" data-placement=\"top\"><button class=\"btn btn-danger btn-xs\" data-target=\"#delete\" data-toggle=\"modal\" data-title=\"Delete\"> <span class=\"glyphicon glyphicon-trash\"></span></button> </a></td>' +\n\t\t\t'</tr>';\n\n}", "title": "" }, { "docid": "3c9668e2f7591b17e77ecbba05f73ecb", "score": "0.5341881", "text": "function operateFormatter(value, row, index) {\n return [\n '<a id=\"edit\" class=\"edit ml10\" href=\"javascript:void(0)\" title=\"Edit\">',\n '<i class=\"glyphicon glyphicon-edit\"></i>',\n '</a>&nbsp;&nbsp;',\n '<a id=\"delete\" class=\"remove ml10\" href=\"javascript:void(0)\" title=\"Remove\">',\n '<i class=\"glyphicon glyphicon-remove\"></i>',\n '</a>'\n ].join('');\n}", "title": "" }, { "docid": "b11b530740541ce357053a4fd25ca5c5", "score": "0.533726", "text": "function crearFilaHtml(nombre,edad,telefono,carnet){\n\n// Construimo el strin HTML que contiene una fila en la tabla y lo retornamos\nfilaHTML = '';\nfilaHTML += '<tr>';\nfilaHTML += '<td>'+ nombre + '</td>';\nfilaHTML += '<td>'+ edad +'</td>';\nfilaHTML += '<td>'+ telefono +'</td>';\nfilaHTML += '<td>'+ carnet +'</td>';\nfilaHTML += '</tr>';\nreturn filaHTML;\n}", "title": "" }, { "docid": "d7cfaf982ef2b10a30769795e8b3b63e", "score": "0.53370327", "text": "function appendRow(data) {\n $(\"#certificates\").DataTable().row.add([\n \"<button class='btn btn-primary btn-xs btn-send-email'><i class='fa fa-send'></i></button> \" + data[0],\n \"<a class='certificate-contract' style='cursor: pointer;' href'#' >\" + data[1] + \"</a>\",\n data[2],\n data[3],\n data[4],\n data[5]\n ]).draw();\n }", "title": "" }, { "docid": "701d6a5264e9622ffbc56bb976259a6e", "score": "0.53364307", "text": "function drawRow(rowData) {\n var row = $(\"<tr />\")\n\n row.append($(\"<td>\" + \"Curated\" + \"</td>\"));\n row.append($(\"<td>\" + rowData.notes + \"</td>\"));\n\n\n return row[0];\n}", "title": "" }, { "docid": "ab0b227ed84e079514010c25a8b76bf2", "score": "0.5315529", "text": "function generate_html(content)\n{\n\tvar list = '';\n\tvar is_readonly = $('table.main > tbody').hasClass('readonly');\n\tvar is_deletable = $('table.main > tbody').hasClass('deletable');\n\n\t//console.log('is_readonly:', is_readonly);\n\t//console.log('is_deletable:', is_deletable);\n\t \n\t$.each(content, function(i, data) \n\t{\t\t\n\t\tlist += '<tr rel=\"' + data['id'] + '\">';\n\n\t\tif(is_readonly === true || is_deletable === false)\n\t\t{\n\t\t\trow_header = i + 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trow_header = '<input type=\"checkbox\" id=\"' + data['id'] + '\" value=\"' + data['id'] + '\" />';\n\t\t}\n\n\t\tlist += '<td class=\"center\">' + row_header + '</td>';\n\t\t\n\t\t$('table.main.table thead th:not(:first-child)').each(function(index) \n\t\t{\t\t\n\t\t\tfield = $(this).attr('axis');\n\t\t\talign = $(this).attr('align');\t\t\t\n\t\t\t\n\t\t\tlist += '<td class=\"'+ align + '\">' + data[field] + '</td>';\n\t\t});\n\t\t\t\t\n\t\tlist += '</tr>';\n\t});\n\t\n\treturn list;\n}", "title": "" }, { "docid": "02c90fa87a499fd732a63e395a01dbe4", "score": "0.5315294", "text": "function operateFormatter(value, row, index) {\r\n return [\r\n\t\t ' <a href=\"#\" data-toggle=\"modal\" data-target=\"#userform_popup\" class=\"edit ml10\">',\r\n\t\t ' <i class=\"fa fa-pencil-square-o\"></i> ',\r\n\t\t ' </a>',\r\n\t\t\t\t\t\t\r\n ' <a href=\"#\" data-toggle=\"modal\" data-target=\"#deleteuser\" class=\"remove ml10\">',\r\n\t\t ' <i class=\"fa fa-times\"></i>',\r\n\t\t ' </a>'\r\n\t\t \r\n \r\n ].join('');\r\n }", "title": "" }, { "docid": "e75438bcc38d5572f79864bf0a9042e5", "score": "0.5311062", "text": "function addUserRecordToTable(data) {\n var allus = document.getElementById(\"allus\").getElementsByTagName(\"tbody\")[0];\n var newRecord =allus.insertRow(allus.length);\n\n var cell1 = newRecord.insertCell(0);\n cell1.innerHTML = data.UserID;\n var cell2 = newRecord.insertCell(1);\n cell2.innerHTML = data.UserName;\n var cell3 = newRecord.insertCell(2);\n cell3.innerHTML = data.Email;\n var cell4 = newRecord.insertCell(3);\n cell4.innerHTML = data.createdAt;\n var cell5 = newRecord.insertCell(4);\n cell5.innerHTML = data.updatedAt;\n var cell6 = newRecord.insertCell(5);\n cell6.innerHTML = '<a onclick=\"onUserEdit(this)\">Edit</a> <a onClick=\"onUserDelete(this)\">Delete</a>'; \n}", "title": "" }, { "docid": "46c79efd2721865698a81d16280d025e", "score": "0.53079855", "text": "function rowmetlist(meetingDate, meetingDesc, meetingName, meetingNo)\n{\n\n\treturn '<tr class=\"table-success\" onclick=\"clickdata3(this)\">'+\n\t\t\t'<td>'+meetingNo+'</td>'+\n\t\t\t'<td>'+meetingName+'</td>'+\n\t\t\t'<td>'+meetingDate+'</td>'+\n\t\t\t'<td>'+meetingDesc+'</td>'+\n\t\t\t'<td> <a title=\"Edit\" data-toggle=\"tooltip\" data-placement=\"top\"><button class=\"btn btn-primary btn-xs\" data-target=\"#edit\" data-toggle=\"modal\" data-title=\"Edit\"><span class=\"glyphicon glyphicon-pencil\"></span></button>' +\n\t\t\t'</a><a title=\"Delete\" data-toggle=\"tooltip\" data-placement=\"top\"><button class=\"btn btn-danger btn-xs\" data-target=\"#delete\" data-toggle=\"modal\" data-title=\"Delete\"> <span class=\"glyphicon glyphicon-trash\"></span></button> </a></td>' +\n\t\t\t'</tr>';\n\n}", "title": "" }, { "docid": "3456bd7bc0430dac03954b0385de60ce", "score": "0.530682", "text": "function ApplyGroups() {\n const target = byId(\"groups-list-table\")\n\n data.groups.forEach(group => {\n\n\t\tlet groupTR = createElem2({\n\t\t\tappendTo: target,\n\t\t\ttype: \"tr\"\n\t\t});\n\n const addCell = (content) => createElem2({\n appendTo: groupTR,\n type: \"td\",\n innerHTML: content,\n })\n\n addCell(group.id)\n\n\t\tlet groupLogoCell = createElem2({\n\t\t\tappendTo: groupTR,\n\t\t\ttype: \"td\"\n\t\t});\n\n\t\tlet groupLogo = createElem2({\n\t\t\tappendTo: groupLogoCell,\n\t\t\ttype: \"img\",\n class: \"group-logo\",\n src: getFilePathFromURL(group.icon_url)\n\t\t});\n\n addCell(group.name)\n\t\taddCell(group.number_members)\n addCell(group.visibility)\n addCell(group.registration_level)\n addCell(group.posts_level)\n addCell(group.virtual_directory)\n addCell(group.membership)\n addCell(group.following ? \"Yes\" : \"No\")\n\t});\n}", "title": "" }, { "docid": "8c72de2a376eea2155a47342dcee2616", "score": "0.53067946", "text": "function createExpenseRow(expenseData) {\n\n var newTr = $('<tr class=\"current-expenses\">');\n newTr.data('expense', expenseData);\n newTr.append('<td>' + expenseData.name + '</td>');\n newTr.append('<td>' + '$' + expenseData.cost + '</td>');\n newTr.append('<td>' + expenseData.date + '</td>');\n newTr.append('<td style=\"text-align: center\">' + '$' + expenseData.dailyAmountUntilPaid + '</td>');\n\n newTr.append('<td><a style=\\'cursor:pointer;color:blue\\' class=\\'delete-expense\\'>Delete</a></td>');\n\n //adds name and cost and finds date to put into fullcalendar\n var event={title: expenseData.name + ':' + '\\xa0\\xa0\\xa0' + '$' + expenseData.cost, start: expenseData.date};\n\n $('#calendar').fullCalendar( 'renderEvent', event, true);\n\n return newTr;\n }", "title": "" }, { "docid": "f023544508620ded07726107b66a96c3", "score": "0.5300279", "text": "function gen_row_html(row){\n var makecell = (x) => '<td>' + process_cell(x) + '</td>';\n var concat = (x, y) => x + y;\n return row.map(makecell).reduce(concat, '') + '</tr>';\n}", "title": "" }, { "docid": "44eda6d820c422a210a6098e6030098d", "score": "0.52999073", "text": "function createOwnerRow(ownerData) {\n var newTr = $(\"<tr>\");\n newTr.data(\"owner\", ownerData);\n newTr.append(\"<td>\" + ownerData.name + \"</td>\");\n newTr.append(\"<td> \" + ownerData.posts.length + \"</td>\");\n newTr.append(\"<td><a href='/blog?owner_id=\" + ownerData.id + \"'>Go to Posts</a></td>\");\n newTr.append(\"<td><a style='cursor:pointer;color:red' class='delete-author'>Delete Owner</a></td>\");\n return newTr;\n }", "title": "" }, { "docid": "30215c907c75b57f7353e45f9ab8118d", "score": "0.52981395", "text": "function addRecordToRiskNameList(riskNameList, currentRecord) {\r\n var row = riskNameList.createElement(\"ROW\");\r\n\r\n row.setAttributeNode(currentRecord.getAttributeNode(\"id\").cloneNode(true));\r\n row.setAttributeNode(currentRecord.getAttributeNode(\"index\").cloneNode(true));\r\n row.setAttributeNode(currentRecord.getAttributeNode(\"col\").cloneNode(true));\r\n row.setAttribute(\"col\", \"1\");\r\n row.appendChild(currentRecord.selectNodes(\"CRISKNAME\").item(0).cloneNode(true));\r\n row.appendChild(currentRecord.selectNodes(\"CRISKID\").item(0).cloneNode(true));\r\n row.appendChild(currentRecord.selectNodes(\"CENTITYID\").item(0).cloneNode(true));\r\n row.appendChild(currentRecord.selectNodes(\"UPDATE_IND\").item(0).cloneNode(true));\r\n row.appendChild(currentRecord.selectNodes(\"DISPLAY_IND\").item(0).cloneNode(true));\r\n row.appendChild(currentRecord.selectNodes(\"EDIT_IND\").item(0).cloneNode(true));\r\n riskNameList.documentElement.appendChild(row);\r\n}", "title": "" }, { "docid": "9b153305441be0dc8c3adde973cb59bc", "score": "0.5289943", "text": "function appendRow() {\n var row = document.createElement(\"tr\");\n table.appendChild(row);\n return row;\n }", "title": "" }, { "docid": "43ce8503f15f6062a76fe84d86706682", "score": "0.5285601", "text": "function carregarGrpSuccess(tx, results) {\r\n\tvar len = results.rows.length;\t\t\r\n\tif (len > 0) {\r\n\t\tfor (var i = 0; i < len; i++) {\r\n\t\t\t$(\"#tabelaGrupos tbody\").append(\"<tr><td><input type='checkbox' value='\"+results.rows.item(i).IDG+\"'></td>\"\r\n\t\t\t\t\t\t\t\t\t+ \"<td>\"+results.rows.item(i).DESC+\"</td>\"\r\n\t\t\t\t\t\t\t\t\t+ \"<td></td>\"\r\n\t\t\t\t\t\t\t\t\t+ \"<td><button type='button' class='btn btn-danger btn-xs' id='\"+results.rows.item(i).IDG+\"'onclick='confirmaExcluirGrupo(this.id)'>\"\r\n\t\t\t\t\t\t\t\t\t+ \"<span class='glyphicon glyphicon-trash'></span></button></td></tr>\");\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "c506f0c5e587ec81829cda2e724af380", "score": "0.52739024", "text": "function appendGroup(containerId, data) {\n // Creates a new id for current group\n const groupId = data.id;\n\n // Gets the groups container\n let groupContainer = getElement(containerId);\n\n // Creates a short spacing element\n let spacing = createElement(\"hr\", \"\", \"short-spacing\");\n\n // Creates a new element for the group\n let group = createElement(\"div\", groupId, \"group minimized\");\n \n // New tab and table id\n const tabId = groupId + \"-tab\";\n const tableId = groupId + \"-user-table\";\n const pollsContainerId = groupId + \"-polls\";\n\n // Creates a tab for the group\n let tab = createElement(\"div\", tabId, \"tab\");\n\n // Adds onclick function to tab\n tab.onclick = function() {\n // Gets current element class name\n let tabClassName = getElement(groupId).className;\n\n // Default class name\n let className = \"group minimized\";\n\n // Switch class if class is same as deafult\n if (tabClassName == className)\n className = \"group active\";\n\n // Changes class name\n changeElementClass(groupId, className);\n }\n\n // Creates a title for the tab\n let title = createElement(\"p\");\n\n // Sets title for title element\n title.innerHTML = data.title;\n\n // Creates an arrow indicator\n let tabArrow = createElement(\"a\");\n\n // Adds arrow indicator\n tabArrow.innerHTML = LEFT_ARROW_CHAR;\n\n // Adds both title and arrow indicator to tab element\n tab.appendChild(title);\n tab.appendChild(tabArrow);\n\n // Creates a content container\n let content = createElement(\"div\", \"\", \"content\");\n\n // Creats a sub content container\n let subContent = createElement(\"div\", \"\", \"sub-content\");\n\n // Creates a table container for group users\n let groupTableContainer = createElement(\"div\", \"\", \"group-table-container\");\n\n // Creates a title for current section\n title = createElement(\"p\");\n\n // Sets section title\n title.innerHTML = \"Användare\";\n\n // Appends the title and a spacing element\n groupTableContainer.appendChild(title);\n groupTableContainer.appendChild(spacing.cloneNode(true));\n\n // Create table if users uid array length is greater than zero\n if (data.users.length > 0) { \n // Creates container for user table\n let tableContainer = createElement(\"div\", \"\", \"table-container\");\n \n // Creates a new table element\n let table = createElement(\"table\", tableId);\n\n // Adds actual table to table container\n tableContainer.appendChild(table);\n\n // Finally adds table container to group table container\n groupTableContainer.appendChild(tableContainer);\n }\n\n // Creates and returns an anchor button\n let addUserBtn = createAnchorButton({\n id: \"show-add-group-user\", \n type: \"small\", \n href: \"#edit-group-users\",\n text: \"Hantera användare\"\n });\n\n // Gets popup user table on click\n addUserBtn.onclick = () => loadPopupUserTable(groupId);\n\n // Appends the button and a spacing element\n groupTableContainer.appendChild(spacing.cloneNode(true));\n groupTableContainer.appendChild(addUserBtn);\n\n // Adds group table container to sub content container\n subContent.appendChild(groupTableContainer);\n\n // Adds sub content container to parent container\n content.appendChild(subContent);\n\n // Creats a new sub content container\n subContent = createElement(\"div\", \"\", \"sub-content\");\n\n // Creates a new group poll container\n let groupPollsContainer = createElement(\"div\", \"\", \"group-polls-container\");\n\n // Creates a new title for current section\n title = createElement(\"p\");\n \n // Sets section title\n title.innerHTML = \"Alla formulär\";\n\n // Adds all sub content children to container\n groupPollsContainer.appendChild(title);\n groupPollsContainer.appendChild(spacing.cloneNode(true));\n\n // Creates a nullified poll container\n let pollsContainer = null;\n\n // Proceed only if poll array length is greater than zero\n if (data.polls.length > 0) {\n // Creates a new poll container\n pollsContainer = createElement(\"div\", pollsContainerId, \"polls-container\");\n }\n\n // Creates and returns an anchor button\n let addPollBtn = createAnchorButton({\n type: \"small\", \n href: \"create-poll.html?group_id=\" + groupId,\n text: \"Nytt formulär\",\n iconText: \"&plus;\"\n });\n\n // Add poll container only if it is not null\n if (pollsContainer != null)\n groupPollsContainer.appendChild(pollsContainer);\n\n groupPollsContainer.appendChild(spacing.cloneNode(true));\n groupPollsContainer.appendChild(addPollBtn);\n\n // Adds group poll container to sub content container\n subContent.appendChild(groupPollsContainer);\n\n // Adds sub content container to parent container\n content.appendChild(subContent);\n\n // Creats a new sub content container\n subContent = createElement(\"div\", \"\", \"sub-content\");\n \n // Creates a new group poll container\n let centeredContainer = createElement(\"div\", \"\", \"content-center-container\");\n\n // New id for delete button\n const deleteButtonId = `remove-${groupId}-button`;\n\n // Creates a delete group button\n let deleteButton = createElement(\"button\", deleteButtonId, \"regular-button\");\n\n // Sets default attributes\n deleteButton.setAttribute(\"type\", \"submit\");\n deleteButton.setAttribute(\"style\", \"background: #dd0000\");\n\n // Adds text to button\n deleteButton.innerHTML = \"Ta bort grupp\";\n\n // Adds delete function to button\n deleteButton.onclick = (e) => deleteCurrentGroup(groupId);\n\n // Adds button to centered container\n centeredContainer.appendChild(deleteButton);\n\n // Adds group poll container to sub content container\n subContent.appendChild(centeredContainer);\n \n // Adds sub content container to parent container\n content.appendChild(subContent);\n\n // Adds tab and content elements to group element\n group.appendChild(tab);\n group.appendChild(content);\n\n // Appends current group to the container\n groupContainer.appendChild(group);\n\n /* Inserts users and polls to group table after all contents\n * of the group container has been initialized and\n * if the group data users and polls length is greater than zero\n */\n if (data.users.length > 0)\n insertGroupUserTable(tableId, data.users);\n\n if (data.polls.length > 0)\n insertGroupPolls(pollsContainerId, data.polls);\n\n // Increments group count\n groupCount++;\n}", "title": "" }, { "docid": "96e4fa78da86825914d24bce84042ec9", "score": "0.52737725", "text": "function appendTable() {\n\t\tvar snippet = '<table class=\"table\">\\n'+\n\t\t'\t<thead>\\n'+\n\t\t'\t\t<tr>\\n'+\n\t\t'\t\t\t<th>#</th>\\n'+\n\t\t'\t\t\t<th>First Name</th>\\n'+\n\t\t'\t\t\t<th>Last Name</th>\\n'+\n\t\t'\t\t\t<th>Username</th>\\n'+\n\t\t'\t\t</tr>\\n'+\n\t\t'\t</thead>\\n'+\n\t\t'\t<tbody>\\n'+\n\t\t'\t\t<tr>\\n'+\n\t\t'\t\t\t<th scope=\"row\">1</th>\\n'+\n\t\t'\t\t\t<td>Mark</td>\\n'+\n\t\t'\t\t\t<td>Otto</td>\\n'+\n\t\t'\t\t\t<td>@mdo</td>\\n'+\n\t\t'\t\t</tr>\\n'+\n\t\t'\t</tbody>\\n'+\n\t\t'</table>';\n\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(snippet, insertionPos);\n\t\t}\n\t}", "title": "" } ]
c8ff2ce88cb5dbda31c36c59c8375f8d
copied from $http, prevents $digest loops
[ { "docid": "e07ee4de4b73289c473f528f0b1b8170", "score": "0.0", "text": "function applyUpdate() {\n if (!$rootScope.$$phase) {\n $rootScope.$apply();\n }\n }", "title": "" } ]
[ { "docid": "c7fc2339faf3264b80447e8e57558a43", "score": "0.56427366", "text": "$http(url){\n // A small example of object\n let core = {\n\n // Method that performs the ajax request\n ajax(method, url, args) {\n\n // Creating a promise\n let promise = new Promise( (resolve, reject) => {\n if (Development) {\n // Cached response for development\n setTimeout(() => {\n resolve(JSON.stringify(Geoname))\n }, Delay)\n } else {\n // Instantiates the XMLHttpRequest\n let client = new XMLHttpRequest()\n let uri = url\n\n if (args && (method === 'POST' || method === 'PUT')) {\n uri += '?'\n let argcount = 0\n for (let key in args) {\n if (args.hasOwnProperty(key)) {\n if (argcount++) {\n uri += '&'\n }\n uri += encodeURIComponent(key) + '=' + encodeURIComponent(args[key])\n }\n }\n }\n client.open(method, uri)\n client.send()\n\n client.onload = function () {\n if (this.status >= 200 && this.status < 300) {\n // Performs the function \"resolve\" when this.status is equal to 2xx\n // if (StorageAvailable('localStorage')) {\n // localStorage.timestamp = new Date()\n // localStorage.messages = this.response\n // }\n resolve(this.response)\n } else {\n // Performs the function \"reject\" when this.status is different than 2xx\n reject(this.statusText)\n }\n }\n client.onerror = function () {\n reject(this.statusText)\n }\n }\n })\n\n // Return the promise\n return promise\n },\n }\n\n // Adapter pattern\n return {\n get(args) {\n return core.ajax('GET', url, args)\n },\n post(args) {\n return core.ajax('POST', url, args)\n },\n put(args) {\n return core.ajax('PUT', url, args)\n },\n delete(args) {\n return core.ajax('DELETE', url, args)\n },\n }\n }", "title": "" }, { "docid": "32804ab3f96cf0786b392e5814de4cf3", "score": "0.5484126", "text": "function GetCountAmount($http) {\n var counter = {\n count: 0,\n };\n\n this.propertyThing = counter;\n\n this.getCount = function () {\n return $http.get('/count')\n .then(function (response) {\n var amount = response.data[0];\n console.log('amount', amount);\n counter.count = amount.count;\n return amount;\n });\n };\n}", "title": "" }, { "docid": "8d8c18d4571d29221545424ef7ac201e", "score": "0.5471184", "text": "function someData() {\n var request = $http({\n method: \"get\",\n url: \"\",\n params: {\n action: \"get\"\n }\n });\n\n return (request.then(handleSuccess, handleError));\n }", "title": "" }, { "docid": "40848467b0cb09a832fa96d98d15261b", "score": "0.54612046", "text": "function getRequestData() {\n console.log('geting information...');\n var request = $http({\n method: \"post\",\n url: \"http://139.59.254.92/getseftrequestlist.php\",\n data: {\n userName: $scope.userName\n },\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' }\n });\n /* Successful HTTP post request or not */\n request.success(function (data) {\n if (data.lenght==0) {\n $('#noRequest').show();\n }else {\n $scope.seftRequest = data;\n for (var i = 0; i < $scope.seftRequest.length; i++) {\n var unformatedUrl = $scope.seftRequest[i][\"avatarUrl\"];\n var formatedUrl = unformatedUrl.replace(\"?\", \"%3f\");\n $scope.seftRequest[i][\"avatarUrl\"] = formatedUrl;\n var unformatedCoverUrl = $scope.seftRequest[i][\"coverImageUrl\"];\n var formatedCoverUrl = unformatedCoverUrl.replace(\"?\", \"%3f\");\n $scope.seftRequest[i][\"coverImageUrl\"] = formatedCoverUrl;\n }\n }\n });\n }", "title": "" }, { "docid": "4a2379d1775e7749b026af9e664f4f55", "score": "0.5398934", "text": "function MainController($scope, $http) {\n $scope.message = \"Hello Angular\";\n \n//Here http get is used to get data from GITHUB about a user \n $http.get(\"https://api.github.com/users/hitheshaum\")\n .success(function(response) \n\n/*Then we define a variable info, and attach it to scope\nthe response from get is stored in the variable info\ninfo contains the response that is returned from GITHUB (remember the output in the URL)\ninfo can be accessed from HTML file to display the data\nKeep in mind scope is the glue between HTML and JS file\nSo anything attached to scope can be accessed from HTML\n*/\n {$scope.info = response;});\n }", "title": "" }, { "docid": "bade5d653bfa6826f276cd4cdaa0009d", "score": "0.53508806", "text": "function Test($scope, $http) {\n\t/* var id = $scope.data.id; */\n\t$scope.getData = function(id) {\n\t\t$http.get('http://localhost:8080/Vehicle-Store/dataById/' + id)\n\t\t\t\t.success(function(data) {\n\t\t\t\t\t$scope.data = data;\n\t\t\t\t});\n\t}\n\n}", "title": "" }, { "docid": "30489d52edf10c89a578c10fd6da6fd2", "score": "0.5332958", "text": "function $http(url){\n\t \tvar core = {\n\t // Method that performs the ajax request\n\t\tajax: function (method, url, args) {\n\t\t var promise = new Promise( function (resolve, reject) {\n\t\t \tvar client = new XMLHttpRequest();\n\t\t \tvar uri = url;\n\t\t \tvar params = {};\n\t\t \t// if the method is GET, then put the paramenters in the URL\n\t\t \tif (args && (method === 'GET')) {\n\t\t \t \turi += '?';\n\t\t \t \tvar argcount = 0;\n\t\t \t \tfor (var key in args) {\n\t\t\t \t if (args.hasOwnProperty(key)) {\n\t\t\t \t \tif (argcount++) {\n\t\t\t \t \t\turi += '&';\n\t\t\t \t \t}\n\t\t\t \t \turi += encodeURIComponent(key) + '=' + encodeURIComponent(args[key]);\n\t\t\t \t }\n\t\t \t \t}\n\t\t \t// if the method is POST, PUT or PATCH then send the parameters as form data\n\t\t \t} else if (args && (method === 'POST' || method === 'PUT' || method === 'PATCH')){\n\t\t \t\tfor (var key in args) {\n\t\t \t\t\tif (args.hasOwnProperty(key)) {\n\t\t \t\t\t\tparams[key] = args[key];\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t \tclient.open(method, uri);\n\t\t \t// if the token is not null then send also the X-Authentication header\n\t\t \tif (__token != null) {\n\t\t \t\tclient.setRequestHeader(\"X-Authentication\", __token);\n\t\t \t}\n\t\t \tclient.send(JSON.stringify(params));\n\t\t \tclient.onload = function () {\n\t\t\t if (this.status >= 200 && this.status < 300) {\n\t\t\t // Performs the function \"resolve\" when this.status is equal to 2xx\n\t\t\t resolve(this.response);\n\t\t\t } else {\n\t\t\t // Performs the function \"reject\" when this.status is different than 2xx\n\t\t\t reject(this.statusText);\n\t\t\t }\n\t\t };\n\t\t client.onerror = function () {\n\t\t \treject(this.statusText);\n\t\t };\n\t\t });\n\t\t return promise;\n\t\t }\n\t\t};\n\n\t\t// Adapter pattern\n\t\t// Returns all methods\n\t\treturn {\n\t\t\t'get': function(args) {\n\t\t\t\treturn core.ajax('GET', url, args);\n\t\t\t},\n\t\t\t'post': function(args) {\n\t\t\t\treturn core.ajax('POST', url, args);\n\t\t\t},\n\t\t\t'put': function(args) {\n\t\t\t\treturn core.ajax('PUT', url, args);\n\t\t\t},\n\t\t\t'delete': function(args) {\n\t\t\t\treturn core.ajax('DELETE', url, args);\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "16aee11f4055552aed92d7347ed8b3fa", "score": "0.5289046", "text": "function orderDirectionService ($http, $log) {\n this.requestedData = \"\";\n this.driveForwards = _orderForwards;\n this.driveBackwards = _orderBackwards;\n this.driveLeft = _orderLeft;\n this.driveRight = _orderRight;\n\n function getIpAddress() {\n var url = window.location.href;\n var end = window.location.href.toString().indexOf(\"/#\");\n var resultUrl = url.slice(0, end);\n return resultUrl;\n }\n\n function _orderForwards() {\n $log.info('driving function entered function entered');\n return $http.get(getIpAddress() + \":8888/hits/forwardsorder\")\n .then(function(response) {\n $log.info('forwardsorder carried out');\n this.requestedData = \"\";\n this.requestedData.concat(response.data);\n });\n }\n\n function _orderBackwards() {\n $log.info('driving function entered function entered');\n return $http.get(getIpAddress() + \":8888/hits/backwardsorder\")\n .then(function(response) {\n $log.info('backwardsorder carried out');\n this.requestedData = \"\";\n this.requestedData.concat(response.data);\n });\n }\n\n function _orderLeft() {\n $log.info('driving function entered function entered');\n return $http.get(getIpAddress() + \":8888/hits/leftorder\")\n .then(function(response) {\n $log.info('leftorder carried out');\n this.requestedData = \"\";\n this.requestedData.concat(response.data);\n });\n }\n\n function _orderRight() {\n $log.info('driving function entered function entered');\n return $http.get(getIpAddress() + \":8888/hits/rightorder\")\n .then(function(response) {\n $log.info('rightorder carried out');\n this.requestedData = \"\";\n this.requestedData.concat(response.data);\n });\n }\n}", "title": "" }, { "docid": "81041c08b9984cca8e76406f8326ffe4", "score": "0.5283208", "text": "function joMeanData($http) { //}, authentication) {\n\n var employeesList = function () {\n return $http.get('/api/employees');\n };\n\n return {\n employeesList: employeesList\n };\n }", "title": "" }, { "docid": "83111d725cc97d63fb4e16d890ccf8ee", "score": "0.52697086", "text": "function ajaxService( $http, $location ) {\n \n return ({\n \n request: function( method, url, data, headers, onSuccess, onFail ) {\n \n if( headers === undefined ) {\n if( method == \"post\" || method == \"POST\" )\n headers = { \"Content-Type\": \"application/x-www-form-urlencoded\" };\n }\n \n if( onSuccess === undefined )\n onSuccess = ajaxSuccess;\n \n if( onFail === undefined )\n onFail = ajaxFail;\n \n var request = $http({\n method: method,\n url: url,\n data: data,\n headers: headers\n });\n \n request.then( onSuccess, onFail );\n \n }\n \n })\n \n}", "title": "" }, { "docid": "f68ec165d11402e3146adb698216ff94", "score": "0.5258708", "text": "function getData() {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({ method: 'GET', url: urlBase + '/Count' + cacheBuster });\n }", "title": "" }, { "docid": "7ee837f844951e85ad1e87de8634434d", "score": "0.5232952", "text": "function _refreshEmployeeData() {\n\t $http({\n\t method: 'GET',\n\t url: '/employees'\n\t }).then(\n\t function(res) { // success\n\t $scope.employees = res.data;\n\t },\n\t function(res) { // error\n\t console.log(\"Error: \" + res.status + \" : \" + res.data);\n\t }\n\t );\n\t}", "title": "" }, { "docid": "a393d5ec43ceea271f6cf8d58311ff89", "score": "0.5225115", "text": "function done(status,response,headersString,statusText,xhrStatus){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText,xhrStatus]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText,xhrStatus);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "title": "" }, { "docid": "a393d5ec43ceea271f6cf8d58311ff89", "score": "0.5225115", "text": "function done(status,response,headersString,statusText,xhrStatus){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText,xhrStatus]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText,xhrStatus);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "title": "" }, { "docid": "d5397ad4f932f7a6a12e363090ebc48b", "score": "0.5206211", "text": "function AuthorCtrl($scope, $http) {\n // Get data\n $http.get('/api/authors').\n success(function(data, status, headers, config) {\n $scope.authors = data.authors;\n });\n}", "title": "" }, { "docid": "03650be6d4e8cdab41f64953c8163173", "score": "0.5196502", "text": "function UserCtrl($scope,$http) {\n $scope.name = 'ImageQuick';\n\n $http.get(SERVER_DOMAIN+'/get/slogans/').then(function(response){\n $scope.slogans = response.data.slogans\n })\n $http.get(SERVER_DOMAIN+'/get/stations/').then(function(response){\n $scope.stations = response.data.stations\n })\n $http.get(SERVER_DOMAIN+'/get/frequency/').then(function(response){\n $scope.frequencies = response.data.frequencies\n })\n $http.get(SERVER_DOMAIN+'/get/groups/').then(function(response){\n $scope.groups = response.data.groups\n })\n\n $scope.add = function(user){\n $http.post( SERVER_DOMAIN + \"/backend/create_user\",user).then(function(data){\n $.notify(\"Added\",'success')\n $scope.user={};\n \n });\n\n }\n}", "title": "" }, { "docid": "11e1addf7b57d06d64537c5737949bc9", "score": "0.51882535", "text": "function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "title": "" }, { "docid": "11e1addf7b57d06d64537c5737949bc9", "score": "0.51882535", "text": "function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else{// remove promise from the cache\ncache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else{resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}", "title": "" }, { "docid": "dd09fea6e057b6552281999d3fd9a29f", "score": "0.5176795", "text": "function run($http){\n $http.defaults.xsrfHeaderName = 'X-CSRFToken';\n $http.defaults.xsrfCookieName = 'csrftoken';\n\n}", "title": "" }, { "docid": "dd09fea6e057b6552281999d3fd9a29f", "score": "0.5176795", "text": "function run($http){\n $http.defaults.xsrfHeaderName = 'X-CSRFToken';\n $http.defaults.xsrfCookieName = 'csrftoken';\n\n}", "title": "" }, { "docid": "c6a342885efa2c62308b6ef53eec8a21", "score": "0.51535994", "text": "function callRest($window, $http, url, method, headers, data) {\n\t// url = getUrl(url);\n\theaders = angular.extend(headers, {\n\t\t'Content-Type' : 'application/json'\n\t});\n\t// alert(headers);\n\treturn $http({\n\t\tmethod : method,\n\t\turl : url,\n\t\theaders : headers,\n\t\tdata : data\n\t});\n\n}", "title": "" }, { "docid": "93e0ba8c3e27967a0c0e7045011e870e", "score": "0.5149822", "text": "function getUrlData() {\n $http.get($scope.url.text).success(function(data) {\n $scope.data = data;\n });\n }", "title": "" }, { "docid": "3cb88fd39c43123a3bd242dcf52bc4a5", "score": "0.5149321", "text": "function getHTTP($http, url, succfunc){\n\t$http.get(url).success(function(data){\n\t\tsuccfunc(data);\n }).error(function(data, status) {\n errorAction(status);\n });\n}", "title": "" }, { "docid": "fcb97a2e29dc786d90777869d603da78", "score": "0.51394063", "text": "function run($http) {\n $http.defaults.xsrfHeaderName = 'X-CSRFToken';\n $http.defaults.xsrfCookieName = 'csrftoken';\n}", "title": "" }, { "docid": "32aee3ae83264f1dc3800c6ba0e40a73", "score": "0.5136138", "text": "function HostGameCtrl($scope, $http){\n\n\tvar reqURL = property.url +'/game/create';\n\tconsole.log(reqURL);\n\n\t$http.get(reqURL).\n\tsuccess(function(data){\n\t\tgameState.setPasskey(data.passkey);\n\t\t$scope.game = data;\n\t}).\n\terror(function(data){\n\t\talert('an error has occured, please try again.');\n\t\twindow.location.replace('#');\n\t});\n}", "title": "" }, { "docid": "6ae0a29f46da394375bfe4bd0711c6c2", "score": "0.51228476", "text": "function fetchApiData($scope, $http, $q){\n\n\t\tconsole.log(\"Fetching data...\");\n\n\t\t//Prepare the url and options to fetch the data\n\t\tvar token = \"fbf89b6988d4aa95fdc31246f6c906235afeb762\";\n\t\tvar options = {\n\t\t\theaders: {'Authorization': 'token '+token}\n\t\t};\n\t\tvar uri = \"https://api.github.com/repos\" + \"/\" + $scope.owner + \"/\" + $scope.repo + \"/stats\";\n\n\t\t//Async api requests\n\t\tvar first = $http.get(uri + \"/contributors\", options), //Get contributors list with additions, deletions, and commit counts.\n\t\t\tsecond = $http.get(uri + \"/punch_card\", options); //Get the number of commits per hour in each day\n\n\n\t\t$q.all([first, second]).then(function(result) {\n\n\t\t\tvar tmp = [];\n\t\t\tangular.forEach(result, function(response) {\n\t\t\t\ttmp.push(response.data);\n\t\t\t});\n\n\t\t\tconsole.log(\"Data fetched!\");\n\t\t\t$scope.success = true;\n\t\t\treturn tmp;\n\n\t\t}, function (error) {\n\n\t\t\tconsole.log(\"Error 404 not found !\")\n\t\t\t$scope.success = false;\n\t\t\treturn $q.reject(error);\n\n\t\t}).then(function(tmpResult) {\n\n\t\t\t//Format the data to get the number of commit per contributor.\n\t\t\tformatContributorsList($scope, tmpResult[0]);\n\t\t\t//format the data to get the number of commits per day in a week.\n\t\t\tformatPunchCard($scope, tmpResult[1]);\n\n\t\t}).then(function () {\n\n\t\t\t//Post the given owner/repo to the server\n\t\t\tsendStatistics($http, $scope);\n\n\t\t});\n\t}", "title": "" }, { "docid": "b75082a2417027e83e0af334e6a65220", "score": "0.5118783", "text": "function prepareRequest() {\n $scope.posting = true;\n }", "title": "" }, { "docid": "8ef5f038d06989134aa7d43d603ae284", "score": "0.5116131", "text": "function retrieveEventTot(creator){\r\n var args = {want: 'eventAmount', creator: creator};\r\n $http.post(\"wanted.php\", args).then(function(data){\r\n console.log(data);\r\n eventTot = data;\r\n });\r\n}", "title": "" }, { "docid": "10be95a4ef8f6117949636945fbb25e0", "score": "0.51129586", "text": "function _refreshAgentData() {\n \t $http({\n url : '/MyTaxReturn/v1/agent/agentdetails',\n method : \"GET\",\n \t headers: {\n \t \"Content-Type\": \"application/json\",\n \t \"Accept\": \"application/json\"\n \t }\n }).then(function mySuccess(response) {\n \t\n \t$scope.Agents=response.data;\n \t\n \n }, function myError(response) {\n $scope.message = response.statusText;\n });\n }", "title": "" }, { "docid": "596eef054cb1a59795402ff157e0eb65", "score": "0.5095351", "text": "function angularDigestMiddleware($rootScope) {\n return function (next) {\n return function (action) {\n next(action);\n\n // '$$phase' is set if Angular is in the middle of a digest cycle already\n if (!$rootScope.$$phase) {\n // $applyAsync() is similar to $apply() but provides debouncing.\n // See http://stackoverflow.com/questions/30789177\n $rootScope.$applyAsync(function () {});\n }\n };\n };\n}", "title": "" }, { "docid": "475db91285c894185fc953c534902f51", "score": "0.5082664", "text": "function getData(){ \n $http.post(\"http://plusidea.co/angular/getData.php\").success(function(data){\n $scope.data = data;\n });\n }", "title": "" }, { "docid": "19d50c3260082e40a1bee1a432c5acbc", "score": "0.50812554", "text": "function get_weather(q){\r\n \t\t\t $.ajax({\r\n \t\t\t type: 'GET',\r\n \t\t\t url: node_server+'/weather?q='+q,\r\n \t\t\t dataType: 'json',\r\n \t\t\t success: function(data) {\r\n \t\t\t console.log(data);\r\n $scope.data=data;\r\n $scope.loaded=false;\r\n \t\t\t $scope.$apply();\r\n\r\n \t\t\t },\r\n \t\t\t error: function(jqXHR, textStatus, errorThrown){\r\n alert('Cannot Find The Weather of your location');\r\n \t\t\t }\r\n \t\t\t });\r\n}", "title": "" }, { "docid": "0d821c4b7b27a0cd8c1c28d59e97e0af", "score": "0.50779265", "text": "function userService($http) {\n\n var api = {\n\n 'findUserByCredentials' : findUserByCredentials,\n 'findUserById' : findUserById,\n 'updateUser' : updateUser,\n 'deleteUser': deleteUser,\n 'createUser':createUser,\n 'findUserByUsername': findUserByUsername\n };\n return api;\n\n function findUserById(userId){\n // for (var u in valid_users) {\n // var _user = valid_users[u];\n // if (_user._id === userId) {\n // return _user;\n // }\n // }\n // return null;\n var response = $http.get(\"/api/users/\"+userId);\n // console.log(response);\n return response;\n }\n\n function findUserByCredentials(username, password) {\n // for (var u in valid_users) {\n // var _user = valid_users[u];\n // if (_user.username === username && _user.password === password) {\n // return _user;\n // }\n // }\n // return null;\n\n return $http.get(\"/api/user?username=\"+username+\"&password=\"+password);\n }\n\n function updateUser(user_id, user) {\n // for (var u in valid_users) {\n // var _user = valid_users[u];\n // if (_user._id === user_id) {\n // _user.username = user.username;\n // _user.firstName = user.firstName;\n // _user.lastName = user.lastName;\n // return \"Updated\";\n // }\n // }\n // return \"Couldn't Find User\";\n\n var url = \"/api/user/\" + user_id;\n return $http.put(url, user);\n // return response;\n }\n\n function deleteUser(user_id) {\n // for (var u in valid_users) {\n // var _user = valid_users[u];\n // if (_user._id === user_id) {\n // valid_users.splice(u, 1);\n // }\n // }\n var url = \"/api/user/\" + user_id;\n return $http.delete(url);\n }\n\n function createUser(user){\n // var total_existing_users = valid_users.length;\n // var current_user_id = (total_existing_users+1)+''+(total_existing_users+2)+''+(total_existing_users+3);\n // var user_new = {};\n // user_new._id = current_user_id;\n // user_new.firstName = user.firstName;\n // user_new.lastName = user.lastName;\n // user_new.username = user.username;\n // user_new.password = user.password;\n // // valid_users.push(user_new);\n // // // console.log(valid_users);\n // // return current_user_id;\n //\n // var url = '/api/user/';\n // var response = $http.post(url, user_new);\n // console.log(response.data);\n // return response.data;\n var url = \"/api/user\";\n var response = $http.post(url, user);\n return response;\n }\n\n function findUserByUsername(username) {\n var url = \"/api/user?username=\"+username;\n return $http.get(url);\n }\n\n\n }", "title": "" }, { "docid": "e066eb6e283474d08ffff50101760f62", "score": "0.50716746", "text": "function factory($http, $q, $log) {\n\n function FacetedSearch(endpoint) {\n this.$resolved = false;\n this.endpoint = endpoint.match(/^https?:/i)\n ? endpoint\n : viroverse.url_base + endpoint;\n return this;\n }\n\n\n // $get method takes a query object and an optional callback to receive the\n // current object on success (imitating $resource). Any outstanding\n // requests are cancelled before making a new one (unlike $resource).\n FacetedSearch.prototype.$get = function(query, success) {\n var result = this;\n this.$cancelRequest();\n\n var options = {\n params: angular.copy(query),\n timeout: this.$canceller.promise\n };\n\n this.$promise = $http.get(this.endpoint, options).then(\n function(response) {\n result.$resolved = true;\n\n // Extend ourselves with the new data\n angular.extend(result, response.data);\n\n if (success)\n success(result);\n\n return response;\n },\n function(response) {\n // Cancelled requests are status === -1\n if (response.status !== -1) {\n $log.error(\"Failed to perform faceted search: \", response);\n result.$resolved = true;\n }\n return $q.reject(response);\n }\n );\n };\n\n\n // $cancelRequest method to explicitly end any outstanding request.\n FacetedSearch.prototype.$cancelRequest = function() {\n if (this.$canceller)\n this.$canceller.resolve();\n this.$canceller = $q.defer();\n };\n\n return FacetedSearch;\n }", "title": "" }, { "docid": "e909672bf9002cbf2e09e54104214154", "score": "0.50712246", "text": "function IndexCtrl($scope, $http) {\n $scope.commentForms = commentForms;\n // Get data\n $http.get('/api/posts').\n success(function(data, status, headers, config) {\n $scope.posts = data.posts;\n });\n}", "title": "" }, { "docid": "6e2bc2a56f38330ae16dfa050bdff20d", "score": "0.50595623", "text": "function topicsController($scope, $http, dataService) {//angular injects scope service - container for data / dom manipulation\n $scope.data = dataService;\n $scope.isBusy = false;\n if (dataService.isReady() == false) {\n $scope.isBusy = true;\n dataService.getTopics()//async returns a promise object with a then method\n .then\n (\n function () {//then yeilds a result to the callback\n },\n function () {\n alert(\"Failed to load topics\");// i am responsible for UI interaction - NOT the dataService\n }\n )\n .then\n (\n function () {//the then call also returns a promise so can chain - similar to a try catch finally... this will always be done\n $scope.isBusy = false;\n },\n function () {\n //nothin here.\n }\n );\n }\n}//]", "title": "" }, { "docid": "02ac6f036bae16f62ab6d90d62336976", "score": "0.50571734", "text": "function refreshUserName(){\n\n var deferred = $q.defer();\n if (!provider){\n console.log(\"provider bool is false\")\n req=$http.get('/user/userName');\n }\n else{\n console.log(\"provider bool is true\")\n req=$http.get('/provider/userName')\n }\n // send a post request to the server\n //$http.get('/user/userName')\n // handle success\n req\n .success(function (data,status) {\n if(status === 200 && data.username){\n console.log('SERVICE: Success!')\n username=data.username\n deferred.resolve();\n } else {\n console.log('SERVICE: else')\n console.log('SERVICE: status:'+status)\n console.log('SERVICE: data:'+data)\n deferred.reject();\n }\n })\n // handle error\n .error(function (data) {\n console.log('SERVICE: error')\n deferred.reject();\n });\n\n // return promise object\n return deferred.promise;\n }", "title": "" }, { "docid": "8addc4c3945fd403baf589dad8a62102", "score": "0.50487787", "text": "function productService($http, $q) {\n\n var Service = {\n index: getIndex,\n }\n var url =\"http://api.drupalcamp2015.dev/a/products\";\n\n function getIndex() {\n var def = $q.defer();\n $http.get(url)\n .success(function(data){\n def.resolve(data);\n })\n .error(function(error) {\n def.reject(error);\n });\n return def.promise;\n }\n\n return Service;\n}", "title": "" }, { "docid": "d1e741d3a2e19dc028fbdc0201a9d7c2", "score": "0.5026424", "text": "function sesionCtrl($http, globales)\n{\n console.log(\"sesionCtrl activado\");\n var vm = this;\n \n this.ingresar = function(datos)\n {\n //validaciones\n vm.invalido = false; vm.errores = \"\";\n if (datos.correoElectronico.length < 3){\n vm.invalido = true;\n vm.errores = \"introduzca correctamente su usuario\";\n return;\n\n } else if (datos.contrasena.length < 3) {\n vm.invalido = true;\n vm.errores = \"introduzca correctamente su contraseña\";\n return;\n }\n vm.invalido = false; vm.cargando = true;\n\n\n // Llamada al WS\n globales.sesion = \"\";\n var url = globales.url + \"&correoElectronico=\" + datos.correoElectronico + \"&contrasena=\" + datos.contrasena;\n console.log(url);\n \n $http.jsonp(url)\n .success(function (data) { globales.sesion = data; console.log(globales.sesion); console.log(globales.sesion.UsuarioNombre) } )\n .error(function(data, status, headers, config) { alert(status); } );\n }\n\n this.getSesion = function()\n {\n return globales.sesion;\n }\n\n\n}", "title": "" }, { "docid": "8e7365420317485588542f1af65f95fc", "score": "0.5026082", "text": "function apiFact ($http){\n\n function getGoal () {\n return $http.get('/dashboard/goals')\n }\n function createGoal (goalsData) {\n return $http.post('/dashboard/goals', goalsData)\n }\n\n // This return value is exactly what we gain access to in the controller\n return {\n getGoal : getGoal,\n createGoal: createGoal,\n }\n}", "title": "" }, { "docid": "cb990a121bf2aa1588f88cd5a1284b11", "score": "0.5002929", "text": "function request(){\n return $http.get(protocol+Base64.decode($rootScope.globals.currentUser.authdata)+'@'+host+'/author/friends/friend_requests')\n }", "title": "" }, { "docid": "7c73f685317aaa25e14c85ffe54f82ab", "score": "0.4996369", "text": "function _refreshPageData() {\r\n\t\t// $http({\r\n\t\t// method : 'GET',\r\n\t\t// url : 'employees'\r\n\t\t// }).then(function successCallback(response) {\r\n\t\t// $scope.employees = response.data.employees;\r\n\t\t// }, function errorCallback(response) {\r\n\t\t// console.log(response.statusText);\r\n\t\t// });\r\n\t}", "title": "" }, { "docid": "3ca328033e5b4cccfbc2ffedc6ec2a7c", "score": "0.49961987", "text": "function httpPost(url, data){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.post(serviceBase + url , data).then(\n \t\tfunction (response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "title": "" }, { "docid": "3ca328033e5b4cccfbc2ffedc6ec2a7c", "score": "0.49961987", "text": "function httpPost(url, data){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.post(serviceBase + url , data).then(\n \t\tfunction (response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "title": "" }, { "docid": "31198ab19e514acb0162241c30dd6fc6", "score": "0.49827915", "text": "function addQuestionControllerOld($scope, $http){\r\n $scope.addIt = function(){\r\n var tryThis=\"222\";\r\n var someNum=\"111\";\r\n $http.defaults.headers.post[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n $http.post(\"php/add_question.php\", \"q_number=\" + encodeURIComponent(someNum)+\"&q_text=\"+encodeURIComponent(tryThis))\r\n .then(function(response){\r\n alert(\"name - \" + response.data);\r\n }, function (error){\r\n alert(error);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "72f315c0ba659dec7cbe3ac227faf51d", "score": "0.4979845", "text": "function getFavorites() {\n $http.get('/movies').then(function(response){\n console.log('response.data from GET request: ', response.data);\n movieObject.data = response.data;\n });\n}", "title": "" }, { "docid": "1ebd56d897f2d6888c54ad1f7bc736e7", "score": "0.49692068", "text": "function fn($scope, $resource) {}", "title": "" }, { "docid": "ec7a9cb001fbc392df6f77b3539ed73f", "score": "0.4948461", "text": "function connectScopes(){var scopeDigesting=false;var newScopeDigesting=false;scope.$watch(function(){if(newScopeDigesting||scopeDigesting){return;}scopeDigesting=true;scope.$$postDigest(function(){if(!newScopeDigesting){newScope.$digest();}scopeDigesting=newScopeDigesting=false;});});newScope.$watch(function(){newScopeDigesting=true;});}", "title": "" }, { "docid": "5f1231e31fc8624118bac75a8c210f33", "score": "0.49456725", "text": "function populateFilterValues() {\r\n $http({\r\n method: \"GET\",\r\n url: routesPrefix+\"/summaryjhic/figure/getFilterValues\",\r\n }).then(function mySucces(response) {\r\n $scope.counties = response.data.countyList;\r\n console.log(\"check here\");\r\n console.log(loggedInUserRole);\r\n\r\n \r\n $scope.selectedCounty = $scope.counties[0];\r\n \r\n $scope.selectedUnit = \"All\";\r\n bindListeners();\r\n }, function myError(response) {\r\n console.log(response.statusText);\r\n });\r\n }", "title": "" }, { "docid": "3dc0017f110afad417e141f5fea769b0", "score": "0.49413958", "text": "function funcHTTP($http, _method, _url, _data, succfunc, failfunc, errfunc){\n\n\t//$(\"#auth_common_lbl\").show();\n\tangular.element(document.querySelector('#auth_common_lbl')).css('display','inline');\n\n\t$http({\n method : _method,\n url : _url,\n data : _data,\n headers: {'Content-Type': 'application/json'}\n })\n .success(function(data, status) {\n \t//$(\"#auth_common_lbl\").hide();\n \tangular.element(document.querySelector('#auth_common_lbl')).css('display','none');\n \tif (status === 204) {\n \t succfunc(\"ok\");\n \t}else if (data.success) {\n \tsuccfunc(data);\n }else{\n \tfailfunc(data);\n }\n })\n .error(function(data, status){\n \t//$(\"#auth_common_lbl\").hide();\n \tangular.element(document.querySelector('#auth_common_lbl')).css('display','none');\n \tif(errorAction(status) == false){\n \t\tif(data == null){\n \t\t\tdata={errors:[\"We encountered server exception, please try again.\"]};\n \t\t}\n \t\terrfunc(data);\n \t}\n });\n}", "title": "" }, { "docid": "ce45c31c671bf1aa3b601bf16799c268", "score": "0.4938786", "text": "function _refreshshipmentData() {\r\n $http({\r\n method : 'GET',\r\n url : 'http://localhost:8080/Shipments'\r\n }).then(function successCallback(response) {\r\n $scope.shipments = response.data;\r\n }, function errorCallback(response) {\r\n console.log(response.statusText);\r\n });\r\n }", "title": "" }, { "docid": "a3afe8fa4a99aa4d15ee82d11c9b0ec1", "score": "0.4937997", "text": "constructor($http) {\n this.$http = $http;\n }", "title": "" }, { "docid": "f71b14e339b9e7c05a99c12c20c54593", "score": "0.4937109", "text": "function SaleMatCtrl($scope, $http){\n\t$http({method: 'GET', url:'/api/salesmanmatrix'}).\n\tsuccess(function(data, status, headers, config){\n\t\t$scope.data = data.body;\n\t});\n}", "title": "" }, { "docid": "6947781773d22a45dd7aa8b4f31150a3", "score": "0.4936107", "text": "function Service($http, $q) {\n var service = {};\n service.generate = generate;\n return service;\n // $http.get('/api/sheetMusic/'+b\n\n function generate(req, res) {\n console.log(\"maaaaaa\");\n $http.post('/api/generator/generate').then(handleSuccess,handleError);\n console.log(\"maaaaaa\");\n }\n\n function handleSuccess(res){\n console.log(res.data);\n return res.data;\n }\n function handleError(res){\n console.log('muuuuu2222u');\n return $q.reject(res.data);\n }\n }", "title": "" }, { "docid": "e34538b8f7fc0ae2ccfc06ad6879dd06", "score": "0.49347293", "text": "function getDigests() {\n $http.get(\"api/digests\").then(function (result) {\n for (let d = 0; d < result.data.length; d++) {\n vm.displayedDigests.push(result.data[d]);\n }\n });\n }", "title": "" }, { "docid": "d39c4dfd7033c9ebe810b0d99a6a319e", "score": "0.49273288", "text": "dogDeets(dogObj) {\n\n dogId = dogObj.id;\n $http({\n url: '/dogs',\n method: 'GET',\n }).then(function(response){\n\n dawgz = response.data;\n\n dawgz.forEach(function(e,i){\n console.log(e);\n if (e.id === dogId) {\n dogD = e;\n }\n })\n\n $location.path('/details');\n return dogD;\n\n });\n return dogD\n\n }", "title": "" }, { "docid": "efcbce3c41b36269d280936a898bd671", "score": "0.49236953", "text": "function DataSerClass($http) {\n var createReportF = function (data) {\n var action = \"dynamic-client-add\";\n var enAction = encodeURIComponent(action);\n var clientName = encodeURIComponent(data.clientName);\n var sellerId = encodeURIComponent(data.sellerId);\n var mwsAuthKey = encodeURIComponent(data.mwsAuthKey);\n\n var reqStr = \"/?client-name=\" + clientName;\n\n console.log(\"lab916 - The reqStr = \"+reqStr);\n\n //-- make the HTTP request:\n return $http.get(reqStr);\n };\n\n return {\n createReport: createReportF\n }\n }", "title": "" }, { "docid": "47351d2ae12f274426b3647b35ce22fe", "score": "0.49191365", "text": "function buscarUsuarioPrimeiroAcesso() { \r\n let dados = {}; \r\n dados[\"email\"] = $location.search().email;\r\n priemiroAcessoService.buscarUsuarioPorEmailCriptografado(dados).then(function (response) {\r\n $scope.usuario = response.data; \r\n })\r\n }", "title": "" }, { "docid": "76956b28ef217ec520d9aca1ff854d64", "score": "0.49185285", "text": "function ReadAuthorCtrl($scope, $http, $routeParams) {\n // Get data\n $http.get('/api/author/' + $routeParams.id).\n success(function(data) {\n $scope.author = data.author;\n });\n}", "title": "" }, { "docid": "5a3583bafbf9009d10e41b3af4398413", "score": "0.49115828", "text": "function mainController($scope, $http) {\n\t$scope.formData = {};\n\t// when is loading the page, pipe, del apu todos from the database in mongod\n\t$http.get('/api/todos')\n\t.success(function(data) {\n\t\t$scope.todos = data; \n\t\tconsole.log(data);\n\n\t})\n\t.error(function(data) {\n\n\t\tconsole.log('Error: ' + data); \n\n\t}); \n\t$scope.createTodo = function() {\n\t\t $http.post('/api/todos', $scope.$formData)\n\t\t .success(function(data) {\n\t\t\t $scope.formData = {};\n\t\t\t $scope.todos = data; \n\t\t\t console.log(data); \n\t\t })\n\t\t .error(function(data) {\n\t\t\t\tconsole.log('Error: ' + data); \n\t\t }); \n\n\t}; \n}", "title": "" }, { "docid": "c7e07f28e7b4916a31ca4dbf8bb448f8", "score": "0.49078825", "text": "function mainCtrl3($scope, $http, $timeout, $window){\n\n\n } // END MAINCTRL3 - CONTROLLER", "title": "" }, { "docid": "e12d8216fb8a00b85e7daf66916c1396", "score": "0.4903795", "text": "function _userPostData(userid) {\n $http({\n method: 'GET',\n url: 'https://jsonplaceholder.typicode.com/posts?userId=' + userid.id\n }).then(function successCallback(response) {\n $scope.posts = response.data;\n }, function errorCallback(response) {\n console.log(response.statusText);\n });\n }", "title": "" }, { "docid": "efbf194b7c38fb911b517f1eda22dac7", "score": "0.48908794", "text": "constructor($http, $scope, socket) {\n this.$http = $http;\n \n }", "title": "" }, { "docid": "cd798241254f66f1384cae63044948f6", "score": "0.48891097", "text": "getMessages(){\n var vm = this;\n //uses http get method\n this.$http.get('http://localhost:8080/api/message')//returns promises\n .then((result) => {\n //scope of angular message array\n vm.messages = result.data;\n });\n }", "title": "" }, { "docid": "6a0c816294cc5d10635338c8446fd20a", "score": "0.48842305", "text": "function getData() {\n var req = {\n method: 'GET',\n url: 'http://sport-social.ddns.net/matches?page=26',\n headers: {\n 'Content-Type': 'application/json',\n }\n };\n return $http(req);\n }", "title": "" }, { "docid": "3afd41d9ef0e0914fd1c0086fec959c7", "score": "0.48808423", "text": "constructor($http) {\n //key word ngInject \n 'ngInject';\n// this object maincontroller set to http service\n this.$http = $http;\n this.getMessages();\n }", "title": "" }, { "docid": "fd8b8e5568fd3d8b065f5d9c9b270a5c", "score": "0.48775735", "text": "$digest() {\n let ttl = 10; // Time To Live - the max iterations before giving up.\n let dirty;\n this.$$lastDirtyWatch = null;\n do {\n dirty = this.$$digestOnce();\n if (dirty && !--ttl) {\n throw \"10 digest iterations reached without stabilising\";\n }\n } while (dirty);\n }", "title": "" }, { "docid": "40fc942b6360d0c7af2a7534f0bafe81", "score": "0.48748395", "text": "function getData(reqObject) {\n var deferred = $q.defer();\n\n $http({\n method: 'GET',\n url: serviceBase + reqObject\n }).then(function successCallback(response) {\n // Use “response” within the application\n deferred.resolve(response);\n }, function errorCallback(response) {\n // Well-handled error (details are logged)\n //$exceptionHandler(“An error has occurred.\\nHTTP error: ” + response.status + “ (“ + response.statusText + “)”);\n deferred.reject(response);\n });\n\n //$http.get(serviceBase + reqObject).success(function (response) { \n \n \n\n //}).error(function (err, status) {\n // //do a logging here;\n // deferred.reject(err);\n //});\n\n return deferred.promise;\n }", "title": "" }, { "docid": "fafbf45482bb26bfaf9f15c40b016078", "score": "0.48715618", "text": "function newTicket(prmEspacio) {\n $scope.datSel = { \n codigo: 0, \n cod_cliente: 1,\n cod_empleado: 1,\n cod_espacio: prmEspacio,\n fecha_ticket: new Date(),\n fecha_modifica: '',\n fecha_pago: '',\n observaciones: '',\n subtotal: 0,\n prc_descuento: 0,\n tot_descuento: 0,\n prc_impuestos: 0,\n tot_impuestos: 0,\n total: 0,\n total_entrega: 0,\n total_cambio: 0\n };\n \n $http({\n method: 'POST',\n url: '/tickets/api/v1/tickets',\n data: $scope.datSel\n }).then( function( response ) {\n// $scope.dat = data;\n \n $http({\n method: 'GET',\n url: '/tickets/api/v1/mesa-tickets/' + prmEspacio\n }).then( function( response ) {\n auxData = response.data;\n $scope.datTickets = auxData[0];\n console.log($scope.datTickets);\n }, function (error) {\n console.log('Error: ' + error);\n });\n//\n// $window.location.reload();\n });\n }", "title": "" }, { "docid": "eb5d5c0094f8c8354b4a9dc77d494936", "score": "0.48639765", "text": "function load() {\r\n $http.get(WEBAPI.URL + '/api/CatalogRooms')\r\n .success(function (data) {\r\n vm.roomList = data;\r\n if (!$scope.$$phase) {\r\n $scope.$digest();\r\n };\r\n })\r\n .error(function (status) {\r\n\r\n });\r\n }", "title": "" }, { "docid": "7a4e99896c3ea6f313304d580c9944db", "score": "0.48617378", "text": "function FellowResidentsService($http, $q, $cacheFactory) {\n this.$http = $http;\n this.$q = $q;\n this.$cacheFactory = $cacheFactory;\n }", "title": "" }, { "docid": "3d438fffe7f354dc2763adca6ff81e54", "score": "0.48591864", "text": "function UserFactory($http) {\n\n var _getAllUsers = () => {\n var p = $http.get('http://localhost:3000/users')\n .then((response) => {\n return response.data;\n }, (response) => {\n return \"An error occured while calling /users api\";\n });\n return p;\n\n }\n\n var _getUserById = (id) => {\n var p = $http.get('http://localhost:3000/user/' + id)\n .then((response) => {\n return response.data;\n }, (response) => {\n return \"An error occured while trying user by id\";\n })\n return p;\n }\n\n\n var _updateUser = (user) => {\n return $http({\n url: 'http://localhost:3000/user',\n method: 'PUT',\n data: user\n })\n .then((response) => {\n return \"success.\"\n }, (error) => {\n return \"An error occured while updating user\";\n });\n\n }\n\n var _onDeleteClick = (id) =>{\n return $http.delete('http:/user/' + id)\n .then((response) => {\n return true;\n });\n }\n\n return {\n getAllUsers: _getAllUsers,\n getUserById: _getUserById,\n updateUser: _updateUser,\n onDeleteClick:_onDeleteClick\n };\n}", "title": "" }, { "docid": "141b66cd11b2e495a75101a332ac0eef", "score": "0.4857166", "text": "function fetchData(){\n return $http.get('/data/data.json');\n }", "title": "" }, { "docid": "01ca0265962879fa246d468f79e06dc8", "score": "0.48541448", "text": "function refresh(){\n $http.get(\"/users/unapproved\"\n ).success(function(data){\n $scope.users = data;\n });\n }", "title": "" }, { "docid": "bb4aefeae7bcfd63b052860249e79a52", "score": "0.48520443", "text": "function myController($http,$interval,$log,$anchorScroll,$location,github) {\n var vm = this;\n\n var person = { // global object to the IIFE\n firstName: 'Pere',\n lastName: 'Pages',\n image: 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Zayapa_%28Grapsus_grapsus%29%2C_Las_Bachas%2C_isla_Baltra%2C_islas_Gal%C3%A1pagos%2C_Ecuador%2C_2015-07-23%2C_DD_30.JPG/800px-Zayapa_%28Grapsus_grapsus%29%2C_Las_Bachas%2C_isla_Baltra%2C_islas_Gal%C3%A1pagos%2C_Ecuador%2C_2015-07-23%2C_DD_30.JPG'\n };\n\n vm.countdown = 5;\n vm.title = 'Hello World';\n vm.person = person;\n vm.person2;\n vm.user;\n vm.username = '';\n vm.repos;\n\n // the position of the variables is very important because of hoisting\n // so countdown must go before startCountDown, otherewise won't bee kept\n var countdownInterval = null;\n var init = function() {\n startCountdown();\n };\n\n init();\n\n vm.getData = function () {\n $http.get('/mockup-data/data.json').then(function (response) {\n vm.person2 = response.data;\n });\n };\n\n function startCountdown() {\n // stop after 5 intervals;\n // another good thing about $interval is that calls the $digest cycle\n countdownInterval = $interval(decrementCountdown, 1000, vm.countdown);\n };\n\n function decrementCountdown() {\n vm.countdown--;\n if( vm.countdown == 0){\n vm.getGithubUser(vm.username);\n }\n }\n\n var onRepos = function (data) {\n vm.repos = data;\n $location.hash('userDetails');\n $anchorScroll();\n };\n\n var onUserComplete = function (data) {\n vm.user = data;\n github.getRepos(vm.user).then(onRepos, onError);\n };\n\n var onError = function () {\n // code\n }\n\n vm.getGithubUser = function (user) {\n $log.info(\"Searching for \"+ user);\n console.log('hello there',countdownInterval);\n if(countdownInterval) {\n \n $interval.cancel(countdownInterval);\n }\n if (user !== undefined) {\n github.getUser(user).then(onUserComplete, onError);\n } else {\n alert('select one user please!');\n }\n }\n\n }", "title": "" }, { "docid": "2eb15f3825c21409755e02e6e4e036b4", "score": "0.48495686", "text": "function ImplCtrl($scope, $rootScope, globalConst, dataService, apiService) {\r\n\r\n //$scope.num =new num(0,0);\r\n //dataService.ab= $scope.num;\r\n $scope.ds = dataService\r\n\r\n}", "title": "" }, { "docid": "6ad5958c52b4829d8dfe70a66152d29d", "score": "0.48416543", "text": "function sendStatistics($http, $scope){\n\t\tconsole.log(\"Sending statistics...\")\n\t\treturn $http.post(\"/stats\", { owner: $scope.owner, repo: $scope.repo })\n\t\t\t.then(function () {\n\t\t\t\tconsole.log(\"Statistics sent!\");\n\t\t\t});\n\t}", "title": "" }, { "docid": "a7a94c4d81112dd748f9a5d8948daced", "score": "0.48370215", "text": "function logincontroller($scope,$http,$location)\n{\n\t$scope.login =function(){\n\t\tvar url = \"rest/user/findUser\";\n /* while compiling form , angular created this object*/\n var data=$scope.user; \n /* post to server*/\n $http.post(url, data).success(function(response) {\n $scope.status = status;\n resMessage = response;\n console.log(response);\n $scope.message = response[0]; \n if (response)\n \t$location.path(\"loginSuccess.html\");\n //$location.path(\"templates/list.html\");\n return response;\n }).error(function(data, status, headers, config) {\n console.log(status, headers, config);\n });\t\n };\n}", "title": "" }, { "docid": "c15bed8ae334a6aadca8fcf30ded9cf3", "score": "0.48288685", "text": "function init(){\n /* this is (\"COMMENTED CODE\") a synchronous call used by factories and services\n To make it asynchronous for $http to used follow below method */\n \n //$scope.customer = customerFactory.getCustomer(customerId);\n \n customerFactory.getCustomer(customerId)\n .success(function(customer) {\n $scope.customer= customer;\n })\n .error(function(data, status, headers, config) {\n //handle error\n });\n }", "title": "" }, { "docid": "d0933d60a42701dd35ddae1a15385824", "score": "0.4822741", "text": "function httpGet(url){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.get(serviceBase + url ).then(\n \t\tfunction(response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "title": "" }, { "docid": "d0933d60a42701dd35ddae1a15385824", "score": "0.4822741", "text": "function httpGet(url){\n \tvar deferred = $q.defer();\n \tvar promise = deferred.promise;\n\n \t$http.get(serviceBase + url ).then(\n \t\tfunction(response){\n \t\t\treturn deferred.resolve(response.data);\n \t\t}, function(error){\n \t\t\treturn deferred.reject(error);\n \t\t});\n \treturn promise;\n }", "title": "" }, { "docid": "8d751f6d39f01825cd4321bfc4431aad", "score": "0.48191798", "text": "function addQuestionController($scope, $http, $httpParamSerializerJQLike){\r\n $scope.addIt = function(){\r\n var theData =\"q_number=\"+$scope.q_number\r\n +\"&q_text=\"+$scope.q_text\r\n +\"&q_a1=\"+$scope.q_a1\r\n +\"&q_a2=\"+$scope.q_a2\r\n +\"&q_a3=\"+$scope.q_a3\r\n +\"&q_a4=\"+$scope.q_a4\r\n +\"&correct_answer=\"+$scope.correct_answer;\r\n var myData = $http({\r\n method: 'POST',\r\n url: \"php/add_question.php\",\r\n headers:{'Content-type': 'application/x-www-form-urlencoded'},\r\n data: theData\r\n })\r\n .then (function (response){\r\n $scope.questionData=response.data;\r\n $scope.theResponse=response.data;\r\n console.log(response.data);\r\n\r\n }, function (error){\r\n // $scope.theResponse = \"Error = \" + error;\r\n //handle the error\r\n console.log(response.data);\r\n });\r\n }\r\n}", "title": "" }, { "docid": "702933832264ff89385fbee388c94d17", "score": "0.48178878", "text": "function TrackerRequestUploadCtrl($scope, $http, $cookieStore, $location, $routeParams, $route, $resource) {\n\tvar config = {headers: {'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}};\n\n\t$scope.showContent = function($fileContent){\n\t\t$scope.content = $fileContent;\n\t\t$scope.jsonData = $.csv.toObjects($fileContent);\n\t\t$scope.jsonContent = $scope.jsonData;\n\t\t\n\t\t// console.log($scope.jsonData);\n\t\t\n\t\tfor (var i=0; i< $scope.jsonData.length; i++) {\n\t\t\t$scope.PayPeriod = $scope.jsonData[i].PayPeriod;\n\t\t\t$scope.HistroicalIncoming = $scope.jsonData[i].HistoricalIncoming;\n\t\t\t$scope.RemainedOpen = $scope.jsonData[i].RemainedOpen;\n\t\t\t$scope.Incoming = $scope.jsonData[i].Incoming;\n\t\t\t$scope.Outgoing = $scope.jsonData[i].Outgoing;\n\n\t\t\tvar store_tracker_request_Data = \"pay_period=\" + $scope.PayPeriod\n\t\t\t\t\t\t\t\t\t\t+ \"&histroical_incoming=\" + $scope.HistroicalIncoming\n\t\t\t\t\t\t\t\t\t\t+ \"&remained_open=\" + $scope.RemainedOpen\n\t\t\t\t\t\t\t\t\t\t+ \"&incoming=\" + $scope.Incoming + \"&outgoing=\" + $scope.Outgoing;\n\t\t\tconsole.log(store_tracker_request_Data);\n\n\t\t\t$http.post('/metricdashboard/store_tracker_request', store_tracker_request_Data, config).success(function(data) {\n\t\t\t});\n\t\t};\n\t};\n\n\t$scope.complete = function(content) {\n\t\t$location.path(\"charts_tracker\");\n\t};\n}", "title": "" }, { "docid": "26ff32b4c74a1cda3aa4bc142c872b64", "score": "0.48039812", "text": "function SesionIniciada($http, $q, CONFIG)\n{\n var q = $q.defer();\n var usuario = new Usuario();\n\n $http({\n\n method: 'GET',\n url: CONFIG.APIURL + '/GetEstadoSesion'\n\n }).then(function(response){\n if( response.data[0].Estatus)\n {\n usuario = new Usuario();\n usuario = SetUsuario(response.data[1].Usuario);\n usuario.Aplicacion = response.data[0].Aplicacion;\n }\n else\n {\n usuario = new Usuario();\n usuario.SesionIniciada = false;\n }\n\n q.resolve(usuario);\n\n }, function(response){\n alert(\"Ha fallado la petición, no se ha podido obtener el estado de sesion. Estado HTTP:\"+response.status);\n });\n\n return q.promise;\n}", "title": "" }, { "docid": "1e8cf3d3813cea09f9b2d03009374545", "score": "0.47994483", "text": "function LoadingHttpInterceptor($rootScope, $q) {\n\n var loadingCount = 0;\n var loadingEventName = 'spinner:activate';\n\n return {\n request: function (config) {\n // console.log(\"Inside interceptor, config: \", config);\n\n if (++loadingCount === 1) {\n $rootScope.$broadcast(loadingEventName, {on: true});\n }\n\n return config;\n },\n\n response: function (response) {\n if (--loadingCount === 0) {\n $rootScope.$broadcast(loadingEventName, {on: false});\n }\n\n return response;\n },\n\n responseError: function (response) {\n if (--loadingCount === 0) {\n $rootScope.$broadcast(loadingEventName, {on: false});\n }\n\n return $q.reject(response);\n }\n };\n }", "title": "" }, { "docid": "94ae3b68f2d3bfc600a0fb3422590dc6", "score": "0.4776592", "text": "function addSeries(user_id,series_id){\n $http({method: \"GET\",\n url:\"localhost:5000/addSeries\",\n data:{\"user_id\":user_id,\"series_id\":series_id}\n }).then(function(response) {\n\n alert(\"test\");\n $scope.showList = response.data.Series;\n alert(response);\n\n console.log(response.data.Series);\n }\n );\n}", "title": "" }, { "docid": "2b203e4c9f6a6805bcffabab577cd688", "score": "0.47724745", "text": "function PassKeyCtrl($scope, $http) {\n\t\t\n\t// http request to join game and redirect to #/game \n \t$scope.submit = function() {\n\t\tvar reqURL = property.url + '/game/join/' + this.text;\n\n\t\t$http.get(reqURL).\n \tsuccess(function(data){ \t\t\n \t\tgameState.setPasskey(this.text);\n \t\tgameState.setWhiteCard(data.whiteCards);\n \t\tgameState.setBlackCard(data.blackCard);\n \t\tgameState.setUserType(\"PLAYER\");\n \t\t\twindow.location.replace('#/game');\n \t\t}).\n \t\terror(function(data){\n \t\t\talert('an error has occured, please try again.'); \t\t\t\n \t\t\twindow.location.replace('#/joinGame');\n \t});\n \t};\n}", "title": "" }, { "docid": "f11ea2d499ae9a7049fc49aa6e0a50a1", "score": "0.47713745", "text": "function HomeCtrl($scope, $http) {\r\n}", "title": "" }, { "docid": "c61d186406ae74fba836e8aeb8fdced2", "score": "0.4770284", "text": "function DataCall() {\n$http.get(ApiUrlPrefix + \"fetchAllEmployeeDataByHR\").success(function (data) {\n$scope.currentEmployeeList = data;\n\n//console.log(data);\n});\n}", "title": "" }, { "docid": "af957ec8038258dc601bfb6728b02d12", "score": "0.47699562", "text": "function _refreshStatusData() {\n $http({\n method : 'GET',\n url : 'http://localhost:8080/Pasupu-Kumkuma-Api/master/status/'\n }).then(function successCallback(response) {\n \t//alert(response.data.data)\n $scope.status = response.data.data;\n }, function errorCallback(response) {\n console.log(response.statusText);\n });\n }", "title": "" }, { "docid": "27885fa7766e0dfc84d4a20b2799a803", "score": "0.47695142", "text": "function _refreshProductData() {\n $http({\n method: 'GET',\n url: '/api/products'\n }).then(\n function(res) { // success\n $scope.products = res.data;\n },\n function(res) { // error\n console.log(\"Error: \" + res.status + \" : \" + res.data);\n }\n );\n }", "title": "" }, { "docid": "16625568b7b61dbe08c3f79029c0f82d", "score": "0.47632447", "text": "function WorkoutCtrl($scope, $http) {\n $scope.workout = function() {\n $http.get('/workouts/15241.json', {params: {query: $scope.workout}}).success(function(data) {\n $scope.workout = data;\n });\n };\n}", "title": "" }, { "docid": "f18165e4ffb4a0b10c820a11918a3955", "score": "0.476304", "text": "function get_items(){\n\t\t\treturn $http.get(\"/service/todo_get\");\n\t\t}", "title": "" }, { "docid": "6bc3c60507b2f8ae0b9e0f6d99f87e29", "score": "0.47606578", "text": "function newsService($q, $http) {\n\t\tvar news = [];\n\n\t\tfunction getNews(force) {\n\t\t\tvar deferred = $q.defer(),\n\t\t\t\tconfig = {\n\t\t\t\t\t'url': '/api/News',\n\t\t\t\t\t'method': 'GET'\n\t\t\t\t};\n\t\t\tfunction success(response) {\n\t\t\t\tdeferred.resolve(response.data);\n\t\t\t}\n\t\t\tif (news.length > 0 && !force) {\n\t\t\t\tdeferred.resolve(news);\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\t\t\t$http(config).then(success);\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\treturn {'getNews': getNews};\n\t}", "title": "" }, { "docid": "3eaadd4355891b8e3cbd5b758f88776f", "score": "0.47563812", "text": "verifyAccount() {\n return ListingService.getCurrentUser()\n .then(user => {\n var data = {\n email: user.email,\n user_id: user._id,\n first_name: user.name.first,\n last_name: user.name.last\n };\n\n return $http({\n method: 'POST',\n url: '/api/payments/verify-account',\n headers: {'Content-Type': 'application/x-www-form-urlencoded'},\n transformRequest: transformRequest,\n data: data\n })\n .then(response => {\n var promises = [];\n\n if(response.data.status === 'success' && response.data.message.length === 3) {\n user.bankAccount.verification = [];\n\n angular.forEach(response.data.message, function(message, key) {\n if(message.transaction_type === 'direct_debit') {\n user.bankAccount.verification.push(message.amount_in_cents);\n }\n var transaction = {\n user: user,\n entry: 'Private',\n kind: 'Verification',\n amount: message.amount_in_cents,\n balance: null,\n details: response.data.message,\n description: 'Verify Account'\n };\n promises.push(message);\n $http.post('/api/transactions', transaction)\n .then(response => {\n console.log(response);\n return response;\n })\n .catch(err => {\n console.log(err);\n return err;\n })\n });\n\n return $q.all(promises)\n .then(() => {\n return response;\n });\n }\n })\n .then(() => {\n return $http.put('/api/users/' + user._id, {\n user: user\n });\n })\n .catch(err => {\n return err;\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "d59e2814cbf1d850656088bc4694cc54", "score": "0.47508606", "text": "function AuthorCtrl($scope, $http) {\n $http.get('/static/author/author.json').success(function(data) {\n $scope.author = data;\n });\n}", "title": "" }, { "docid": "f2ff5d57af508b7f779611af39e6f710", "score": "0.47500846", "text": "function broadCastService($http,$q){\n\t// alert(\"inside broadCastService\");\n\tvar deferred=$q.defer();//this is deferred object for asyc call\n\tthis.getBroadCasts=function(){\n\n\t\treturn $http.get('http://localhost:3011/api/getCustomers').then(function(response){\n\t\t\t//resovle the promise with data in response object retrived by http\n\t\t\tdeferred.resolve(response.data);\n\t\t\treturn deferred.promise;//return promis\n\t\t},\n\t\tfunction(error){\n\t\t\t//if something went wrong reject promise\n\t\t\tdeferred.reject(error);\n\t\t\treturn deferred.promise;\n\t\t});\n\t};//end of function\n}//end of service", "title": "" }, { "docid": "55bb51083713c644397e67b8c2110508", "score": "0.47498006", "text": "function doGetHttp(functionName, url, data) {\r\n var deferred = $q.defer();\r\n\r\n busyCursorStart();\r\n\r\n $http.get(url, { params: data })\r\n .success(function (response) {\r\n console.log(functionName + \"Success\");\r\n\r\n busyCursorEnd();\r\n\r\n deferred.resolve(response);\r\n }).error(function (error) {\r\n console.log(functionName + \" Error :\" + error);\r\n\r\n busyCursorEnd();\r\n\r\n deferred.reject(error);\r\n });\r\n\r\n return deferred.promise;\r\n }", "title": "" }, { "docid": "3f6224504a71b6d2d31a81c358ef1537", "score": "0.4748845", "text": "function sideBarImage()\n{\n $http(\n \t{\n \t\tmethod:'GET',\n \t\turl:'https://api.jumpseller.com/v1/products.json?login=1bdae2ae3765ab2764fff0946d902e64&authtoken=3b0787f580911f25abfa481ed500dfb4'\t\n \t})\n .then(\n function(response)\n \t\t\t{\n \t\t\t\tconsole.log(response.data);\n \t\t\t\t$scope.productResponse = response.status;\n \t\t\t\t$scope.productData = response.data;\n \t\t\t\t\n \t\t\t},\n function(response)\n \t\t\t{\n \t\t\tthis.productData = 'Response Failed';\n \t\t\tconsole.log(\"failed\");\n \t\t\t}\n\t\t ); //end of then function scopr\n}", "title": "" }, { "docid": "18e8b61e4b7dc670b1b7ba4f064b7cf8", "score": "0.474368", "text": "function doPostHttp(functionName, url, data) {\r\n var deferred = $q.defer();\r\n\r\n busyCursorStart();\r\n\r\n $http.post(url, data)\r\n .success(function (response) {\r\n console.log(functionName + \" Success\");\r\n\r\n busyCursorEnd();\r\n\r\n deferred.resolve(response);\r\n }).error(function (error, status) {\r\n console.log(functionName + \" Error :\" + error);\r\n\r\n busyCursorEnd();\r\n\r\n deferred.reject(error, status);\r\n });\r\n\r\n return deferred.promise;\r\n }", "title": "" }, { "docid": "0e771a9d0cc7c707855b92d5db31ad49", "score": "0.4742748", "text": "function ViewResearchController($http) {\n this.$http = $http;\n this.isLoading = false;\n }", "title": "" } ]
b6ab60c8e363cfedd250cf9e0298bdf6
Standard/simple iteration through an event's collected dispatches.
[ { "docid": "fec7594e9cf8f26ea21baa52785e689e", "score": "0.0", "text": "function executeDispatchesInOrder(event, simulated) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (process.env.NODE_ENV !== 'production') {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t executeDispatch(event, simulated, dispatchListeners, dispatchIDs);\n\t }\n\t event._dispatchListeners = null;\n\t event._dispatchIDs = null;\n\t}", "title": "" } ]
[ { "docid": "5d9be43287e47f58409aa5bfe31c8b77", "score": "0.6634704", "text": "dispatchEvent(event) {\n // for each loop\n this.eventListeners.forEach(function(pair) {\n // call .notify(event) on each pair where the eventType matches up\n if (pair.eventType === event.eventType) {\n pair.eventListener.notify(event);\n }\n });\n }", "title": "" }, { "docid": "0347f8b89276d95248934b737a2ade4d", "score": "0.64787745", "text": "dispatch(e) {\n for (let i = 0; i < this.listeners_.length; ++i) {\n this.listeners_[i].call(undefined, e);\n }\n }", "title": "" }, { "docid": "7444b88d90b8bfe69377495f87edf007", "score": "0.6396759", "text": "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\" !== \"development\"){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\ncb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "title": "" }, { "docid": "b2af40919ac21bd31e2dbeff383b7724", "score": "0.6192672", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "c002e00817c328deaa5433cd39b009bd", "score": "0.61514235", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n }", "title": "" }, { "docid": "175607c9c6e058d4697865001851c64d", "score": "0.6144744", "text": "proc(event) {\n for(let obj of this[OBJECTS]) {\n obj.proc(event);\n }\n }", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.6122544", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60784554", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.6072781", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "4921860c6713f50f6514dea4636a6490", "score": "0.60236746", "text": "forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback((this.#events.get(name)), i);\n }\n }", "title": "" }, { "docid": "8518a5b1c68b0a51959adb142aa08127", "score": "0.5846873", "text": "function forEachEventDispatch(abstractEvent, cb) {\n var dispatchListeners = abstractEvent._dispatchListeners;\n var dispatchIDs = abstractEvent._dispatchIDs;\n if (__DEV__) {\n validateEventDispatches(abstractEvent);\n }\n if (Array.isArray(dispatchListeners)) {\n var i;\n for (\n i = 0;\n i < dispatchListeners.length && !abstractEvent.isPropagationStopped;\n i++) {\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(abstractEvent, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(abstractEvent, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "90488ecf233a8b68e3f30530f12b7441", "score": "0.5801898", "text": "dispatch(event, data) {\n if (!EVENTS[event]) {\n throw ('Event: ' + event + ' is not subscribed');\n return;\n }\n\n let keys = Object.keys(EVENTS[event]);\n\n for(let key of keys) {\n EVENTS[event][key](data);\n }\n }", "title": "" }, { "docid": "5c663ebd555665a9626b0ae46777c6a8", "score": "0.5798595", "text": "function printNextEvents() {\n printCurrentEvent();\n recieveAllEvents();\n}", "title": "" }, { "docid": "02552760c90cb2f63a7f5147fdc6af94", "score": "0.5788342", "text": "function forEach(event, each) {\r\n return snapshot(function (listener, thisArgs, disposables) {\r\n if (thisArgs === void 0) { thisArgs = null; }\r\n return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables);\r\n });\r\n }", "title": "" }, { "docid": "033cd7d62ab38bebed9bcb206d6a8633", "score": "0.57867813", "text": "_dispatchEvents() {\n //order of events is specified in the EVENT_ORDER array below\n for (let eventName of EVENT_ORDER) {\n let h = this._eventHandlers.get(eventName);\n\n if (h !== undefined && h.needToDispatch) {\n h.dispatch();\n }\n }\n }", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.5766144", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "60e0f827b1f27325f81633c78836b76b", "score": "0.57251835", "text": "function executeDispatchesInOrder(event,cb){forEachEventDispatch(event,cb);event._dispatchListeners = null;event._dispatchIDs = null;}", "title": "" }, { "docid": "ac7a20afe3a7b147029c35715fc6c1cc", "score": "0.55769694", "text": "function invokeAll(events) {\n events.forEach(function(e) {\n e();\n });\n }", "title": "" }, { "docid": "60ff90ebd851674bf7c7f055ac9a51a7", "score": "0.55760604", "text": "function patchViaCapturingAllTheEvents() {\n\t var _loop_1 = function(i) {\n\t var property = eventNames[i];\n\t var onproperty = 'on' + property;\n\t document.addEventListener(property, function (event) {\n\t var elt = event.target, bound, source;\n\t if (elt) {\n\t source = elt.constructor['name'] + '.' + onproperty;\n\t }\n\t else {\n\t source = 'unknown.' + onproperty;\n\t }\n\t while (elt) {\n\t if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n\t bound = Zone.current.wrap(elt[onproperty], source);\n\t bound[unboundKey] = elt[onproperty];\n\t elt[onproperty] = bound;\n\t }\n\t elt = elt.parentElement;\n\t }\n\t }, true);\n\t };\n\t for (var i = 0; i < eventNames.length; i++) {\n\t _loop_1(i);\n\t }\n\t ;\n\t}", "title": "" }, { "docid": "ad0c4bc02a49145c9204ea964423bd59", "score": "0.55399233", "text": "each(handler) {\n for (var i = 0; i < this.count; i++) {\n handler.call(this.context, this[i], i);\n }\n }", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.55030125", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.55030125", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "a802b6b5bdaa9f015578d9e165ee6ce0", "score": "0.54947287", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5490577", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "b5d6d6efffc8695567634d203a15e750", "score": "0.5469118", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto_1(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto_1(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54687405", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" } ]
acc087fe7cfef02311978e52032b2fee
use map function to put new values into array of 9
[ { "docid": "7def3ccff4d8bca8d2caf651a49a9ebc", "score": "0.0", "text": "render(){\n let {spaces} = this.state\n\n let newSquare = spaces.map((value, index) => {\n return (<Square\n clickSquare = {this.clickSquare}\n \n value = {value}\n index = {index}/>)\n\n })\n\n return(\n <div id= 'displayBoard'>\n {newSquare}\n {this.setTreasure}\n\n </div>\n )\n\n }", "title": "" } ]
[ { "docid": "3d5d41fe99bf756c048e05e89cf611dc", "score": "0.69063234", "text": "function doubleValues(arr){\n var newArr = myMap(arr, function(num, index, array) {\n return 2 * num\n })\n return newArr\n}", "title": "" }, { "docid": "412a386cde94ad5ca6a3f556fbb2c939", "score": "0.6754897", "text": "static map(a, fn) {\n for (let i = 0, len = a.length; i < len; i++) {\n a[i] = fn(a[i], i, a);\n }\n return a;\n }", "title": "" }, { "docid": "373eec7f8680e418053b2bcc30c47347", "score": "0.67189443", "text": "function multiplyByTwo() {\n let value = [1, 2, 3, 4, 5]\n value = value.map(function (value) {\n return value * 2\n });\n console.log(value); \n}", "title": "" }, { "docid": "a19f90ff94fdc99afc4bf9934814c5d8", "score": "0.67179585", "text": "function map(arr, fun){\n newArray = arr.map(fun)\n return newArray;\n\n}", "title": "" }, { "docid": "c3443138bce09cde049ebd2c5408ad61", "score": "0.66818345", "text": "function mapArray(array, fun) {\n var emptyArray = [];\n array.forEach(function(elementValue) {\n // emptyArray.push(fun(elementValue));\n emptyArray.push(elementValue * 45);\n });\n return emptyArray;\n }", "title": "" }, { "docid": "a68f80684c299b69eb06fc6d5b9495f0", "score": "0.6677835", "text": "function maps(x){\n return x.map(number => number * 2)\n}", "title": "" }, { "docid": "d94aeb90e9ca949230c210089d906cfa", "score": "0.6647431", "text": "function modifyArray(nums) {\n const map1 = nums.map(x => x % 2 === 0 ? x * 2 : x * 3);\n //console.log(map1);\n return map1;\n}", "title": "" }, { "docid": "31cff13d395f1b72de0da771f86b18f0", "score": "0.66220206", "text": "function multiplyByTwo(number){\n \n return number * 2\n // getting values of new array that has been multiplied by two\n const newNumbers = numbers.map(multiplyByTwo)\n \n console.log('new number', newNumbers)\n}", "title": "" }, { "docid": "a21251a03b31377719dcee3cb6e103d1", "score": "0.65704226", "text": "function sqrArrMapLoop(arr) {\n let newNumberArray = arr.map((elem, i) => {\n return elem * elem;\n });\n return newNumberArray;\n\n}", "title": "" }, { "docid": "9a870bbbcae4e3f99c333183e5f174fa", "score": "0.6563713", "text": "function map(arr, f) {\n const newArr = [];\n for (const item of arr) {\n newArr.push(f(item));\n }\n return newArr;\n}", "title": "" }, { "docid": "2a22927f6c8d5405f8e7acbfe3973273", "score": "0.65430576", "text": "function mapArr() {\n const array = [\n \"fun\",\n \"sugar\",\n \"snack\",\n \"rice\",\n \"beans\",\n \"maggi\"\n ]\n \n var double = [];\n const newArray = array.forEach(x => {\n double.push(x + \"!\")\n })\n console.log(double)\n \n const numlist = [\n 1,2,3,4,5,6,7,8,9\n ]\n const printNum = numlist.map( x => x + 1)\n console.log(printNum)\n}", "title": "" }, { "docid": "f6e348157ee4a770a17f989a0d37eeb4", "score": "0.6512642", "text": "function map(arr, func) {\n var newArr = [];\n arr.forEach(function (curr) {\n newArr.push(func(curr));\n })\n return newArr;\n}", "title": "" }, { "docid": "b78c8bb0b37620366ccd62e987ba9ad0", "score": "0.65104926", "text": "function maps(x){\n\n var doubledNumbers = x.map(n => n*2)\n return doubledNumbers\n\n}", "title": "" }, { "docid": "8f80660c2e22bcb6c8b2ba5d173c02b8", "score": "0.6506905", "text": "function maps(x) {\n return x.map(v => v * 2)\n}", "title": "" }, { "docid": "5d70e136de54db4e3972b3ceb7d9ca86", "score": "0.6504044", "text": "function maps(x){\n return x.map( el => el * 2);\n}", "title": "" }, { "docid": "19bfa21446cf729033b4226d95cc2057", "score": "0.649085", "text": "function mapArray01(anArrayOfNumbers) {\n return(anArrayOfNumbers.map( (element) => {\n return(2*element);\n }));\n }", "title": "" }, { "docid": "0a77d98c6943b15e880dc2cd7d1294e2", "score": "0.6476049", "text": "function timesTen(array) { \n\n var newArray = array.map( function (arrayCell) {return arrayCell*=10;});\n \n return newArray;\n }", "title": "" }, { "docid": "240bb8bdba14cc6ebdf3e0ba2914ab0b", "score": "0.6472924", "text": "function map (f, a) {\n const l = a.length\n const b = new Array(l)\n for (let i = 0; i < l; ++i) {\n b[i] = f(a[i])\n }\n return b\n}", "title": "" }, { "docid": "dfc51caecbba50cd7f16c0eaf61fade2", "score": "0.6470265", "text": "function maps(x){\n return x.map(y => y * 2)\n}", "title": "" }, { "docid": "91b0d4382522a5131b62ad2c3f013c47", "score": "0.6464596", "text": "function map(array, fn){\n let newArr = [];\n\n array.forEach(element => {\n newArr.push(fn(element))\n });\n\n return newArr\n}", "title": "" }, { "docid": "bfcfd31fc3b8d08c3d98f04474e04b74", "score": "0.64538026", "text": "function map (fn, arr) {\n let newArr = [];\n for (let i = 0, max = arr.length; i < max; i += 1) {\n newArr.push(fn(arr[i], i));\n }\n return newArr;\n}", "title": "" }, { "docid": "00a6566aadac270d1699b901b430227c", "score": "0.64397836", "text": "function maps(x){\nlet double=x.map(element=>element*2);\nreturn double\n\n}", "title": "" }, { "docid": "8c96a2828359f0bfbe96f8d0067c5a5b", "score": "0.6430844", "text": "function map(f, xs) {\n return xs.map(f);\n }", "title": "" }, { "docid": "387bc7496ac00b8efdab5fc9cecb3165", "score": "0.64244753", "text": "function map(arr, fn) {\n\n}", "title": "" }, { "docid": "483d03250d7d3e25e152874cf4973a90", "score": "0.6413505", "text": "function map(array, fun){\n newArray = []\n for(i=0;i<array.length;i++){\n newArray[i] = fun(array[i])\n }\n return newArray\n}", "title": "" }, { "docid": "9b913d786d86cae2e627c4b7a8f09704", "score": "0.6401911", "text": "function map(f, a) {\n var l = a.length;\n var b = new Array(l);\n for (var i = 0; i < l; ++i) {\n b[i] = f(a[i]);\n }\n return b;\n }", "title": "" }, { "docid": "e3138436b8debe55d5225ee8c9057932", "score": "0.64012206", "text": "function arrayMap(arr, fn){\n let newArr = new Array (arr.length);\n for (let i = 0; i < newArr.length; i++) {\n newArr[i] = fn(arr[i]);\n }\n return newArr;\n}", "title": "" }, { "docid": "67b314443200eef9636b51210e9ba427", "score": "0.6399792", "text": "function map(arr, fn) {\n\tlet idx = -1,\n\t\tlen = arr.length,\n\t\tresult = new Array(len);\n\twhile (++idx < len) { result[idx] = fn(arr[idx], idx, arr); }\n\treturn result;\n}", "title": "" }, { "docid": "25d3bb8e81f06823c81f4459b4587c66", "score": "0.6392509", "text": "function map(mappingFunction, theArray) {\n \n var tempa=[];\n theArray.forEach(function(item){\n var newItem=mappingFunction(item);\n \n tempa.push(newItem);\n });\n \nreturn tempa;\n // You write the code here\n}", "title": "" }, { "docid": "d4865c14f86db46a1d4d8ff04564201c", "score": "0.63789165", "text": "function initVals(map, ct) { while (ct--) map.forEach((v, k) => k.push(v())) }", "title": "" }, { "docid": "bdd7f7da7cc8d33b54ee79bdc84a147f", "score": "0.6369761", "text": "function modifyArray(nums) {\n\tconst res = nums.map( s => {\n\t\treturn s % 2 == 0 ? s * 2 : s * 3;\n\t}); \n\treturn res; \n}", "title": "" }, { "docid": "e038581fd4f82f02390c7d6acc40c03a", "score": "0.63610506", "text": "function valTimesIndex(arr){\n var newArr = myMap(arr, function(num, index, array) {\n return num * index\n })\n return newArr\n}", "title": "" }, { "docid": "28a29a9e704a7ca9392e2cb086e28773", "score": "0.6335615", "text": "map(fn){\n return this.elements.map(fn)\n }", "title": "" }, { "docid": "0557b3ed4667ce163d9b57fae3a7d5c7", "score": "0.63329035", "text": "function multiplyBy10(array) {\n const result = array.map(element => {\n return element * 10;\n })\n console.log(\"result:\" + result);\n return result;\n\n}", "title": "" }, { "docid": "15bcb35b0ffa04ceed525e9ef285fdcf", "score": "0.6321556", "text": "function map(square , arr) {\n let a =[];\n for (let i = 0; i < arr.length; i++){\n a[i] = square(arr[i]);\n }\n return a;\n}", "title": "" }, { "docid": "bea52f21557707e93a6b15d8b9ca2d9f", "score": "0.63189054", "text": "function map(f, a) {\n let result = []; \n let i;\n for (i = 0; i != a.length; i++)\n result[i] = f(a[i]);\n return result;\n}", "title": "" }, { "docid": "68137f3211c1a353f1b627929491078a", "score": "0.6317425", "text": "function mapForEach(arr, fn) {\r\n var newArr = []\r\n for (let i = 0; i < arr.length; i++) {\r\n newArr.push(\r\n fn(arr[i])\r\n )\r\n }\r\n return newArr\r\n}", "title": "" }, { "docid": "c3f99f061cf84bc1101acd8fae18d918", "score": "0.631129", "text": "function multiplyBy10(myArray) {\n const returnArray = myArray.map(function (element, i, array) {\n return element * 10;\n })\n return returnArray;\n}", "title": "" }, { "docid": "815b6d715c4caf56f7876c983a9c85d0", "score": "0.631016", "text": "function map (array, fn) {\n var newArray = [];\n forEach(array, function (x) {\n newArray.push(fn(x));\n });\n return newArray;\n}", "title": "" }, { "docid": "9abce3126396597d24d0cc041c6f1815", "score": "0.63005054", "text": "function map(numbersArray, callback) {\n for(var i = 0; i < numbersArray.length; i++) {\n numbersArray[i] = callback(numbersArray[i]);\n }\n\n return numbersArray;\n}", "title": "" }, { "docid": "58b2ebafeea9f24c7d2cab763e38dcf8", "score": "0.6299964", "text": "function map$4(f, a) {\n var l = a.length;\n var b = new Array(l);\n for (var i = 0; i < l; ++i) {\n b[i] = f(a[i]);\n }\n return b;\n }", "title": "" }, { "docid": "a7c75b309806802152b92e1d95bb4e2b", "score": "0.6297456", "text": "function map(array, func) {\n let newArray = [];\n for (let i = 0; i < array.length; i++) {\n newArray[i] = func(array[i]); \n }\n return newArray;\n}", "title": "" }, { "docid": "5c15232128d21e2fa3fec5198816008a", "score": "0.6296146", "text": "map(func) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n let val = this.data[i][j];\n this.data[i][j] = func(val);\n }\n }\n }", "title": "" }, { "docid": "edc252b84563140aad57d5d1e48b4874", "score": "0.6294662", "text": "function maps(x) {\n return x.map(x => x * 2);\n}", "title": "" }, { "docid": "f166209ce4c7bba731867c3fbede22ee", "score": "0.62918174", "text": "function mapForEach(arr, fn){\n var newArr = [];\n for(var i=0; i<arr.length;i++){\n newArr.push(fn(arr[i]));\n }\n return newArr;\n}", "title": "" }, { "docid": "01f609e1fb13ddcf733c5a73ac34dabe", "score": "0.6290935", "text": "function mapForEach(arr,fn){\n\tvar newArr = [];\n\tfor(var i = 0; i < arr.length; i++){\n\t\tnewArr.push(\n\t\t\tfn(arr[i])\n\t\t);\n\t}\n\treturn newArr;\n}", "title": "" }, { "docid": "345427dd350a9f45eb1dd9be7e9d05eb", "score": "0.6288878", "text": "function modifyArray(nums) {\n return nums.map(element => { \n if (element % 2 == 1) {\n return element * 3;\n }\n return element * 2;\n });\n}", "title": "" }, { "docid": "f4a4e7ddc1437b415ec593f8db232213", "score": "0.6274389", "text": "function map(f, a) {\n\t var l = a.length;\n\t var b = new Array(l);\n\t for (var i = 0; i < l; ++i) {\n\t b[i] = f(a[i]);\n\t }\n\t return b;\n\t}", "title": "" }, { "docid": "4262dec602290481d127f42538916bdd", "score": "0.6266318", "text": "map(callback){\n var tempArr = [];\n for(var i = 0; i<this.arr.length; i+=1){\n tempArr.push(callback(this.arr[i], i, this.arr));\n }\n return tempArr\n }", "title": "" }, { "docid": "053f141ae0606a6c7efb5530bd02d7cf", "score": "0.6261914", "text": "function mapSomeShit(val,i,array){\n newArray.push(callback(val,i,arr))\n }", "title": "" }, { "docid": "25d4b233dccae8a4b054175564809247", "score": "0.62558705", "text": "function map(arr, f) {\n var ret = new Array(arr.length);\n for (var i = 0; i < arr.length; i++) {\n ret[i] = f(arr[i]);\n }\n return ret;\n}", "title": "" }, { "docid": "b849cdb623114eb3237d0a4d84bbc378", "score": "0.6252057", "text": "function foo(arr) {\n const newArr = [];\n\n arr.map((next) => {\n next.total = next.price * next.quantity;\n newArr.push(next);\n });\n\n return newArr;\n}", "title": "" }, { "docid": "376e02ecddc7972f4d152c3537aeb2ce", "score": "0.6246832", "text": "function map(array, f) {\n let result = [];\n for (let i = 0; i < array.length; i++) {\n result[i] = f(array[i]);\n }\n return result;\n}", "title": "" }, { "docid": "803a47e93d0e25144d6a305cae0d14cd", "score": "0.62412", "text": "function map(arr, fn) {\n var ret = [];\n for (var i = 0; i < arr.length; ++i) {\n ret.push(fn(arr[i], i));\n }\n return ret;\n}", "title": "" }, { "docid": "803a47e93d0e25144d6a305cae0d14cd", "score": "0.62412", "text": "function map(arr, fn) {\n var ret = [];\n for (var i = 0; i < arr.length; ++i) {\n ret.push(fn(arr[i], i));\n }\n return ret;\n}", "title": "" }, { "docid": "6f452f8829b1cd54f7635979f7dfe451", "score": "0.624073", "text": "function mapForEach(arr, fn) { // run a function at each array index\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n newArr.push(\n fn(arr[i])\n )\n };\n return newArr;\n}", "title": "" }, { "docid": "ade03855204b2bfb9d1114cd302121c3", "score": "0.6235334", "text": "function myMap(arr,cb){\n newArr=[]\n for(i=0;i<arr.length;i++){\n var temp=cb(arr[i],i,arr)\n newArr.push(temp)\n }\n return newArr\n}", "title": "" }, { "docid": "5597f4458cc1327d9d417858e5702b04", "score": "0.6231925", "text": "function transform(arr) {\n return arr.map(function(number){\n return function(){\n return number;\n }\n });\n}", "title": "" }, { "docid": "057caab148da2a8ccdb401e9acd979e0", "score": "0.6231103", "text": "map(func){\n this.data = this.data.map((array,indexI)=>{\n return array.map((number, indexJ) =>{\n //console.log(indexI, indexJ);\n return func(number, indexI, indexJ);\n })\n })\n\n // Return object\n return this;\n }", "title": "" }, { "docid": "b0cd604c0f85193fa8f82f4f4ba6a56b", "score": "0.62259376", "text": "function mapforeach(arr, fn){\n\tvar newArray = [];\n\tfor(var i=0; i<arr.length; i++){\n\t\tnewArray.push(\n\t\t\tfn(arr[i])\n\t\t);\n\t}\n\treturn newArray;\n}//One fn can be used multiple times", "title": "" }, { "docid": "1d2623cbcd5f592d7e7a50d802f1837c", "score": "0.6218153", "text": "function map(value, func) {\n if (isArray(value)) {\n var result = clone(value);\n\n for (var i = 0; i < result.length; ++i) {\n result[i] = func(result[i], i, result);\n }\n\n return result;\n }\n\n return func(value);\n} //", "title": "" }, { "docid": "f5f46d92fb4a994c4cb06339cdbd799b", "score": "0.6207605", "text": "function function_22(arr) {\n let newArr = [];\n arr.forEach((element) => {\n newArr.push(element + 7);\n });\n return newArr;\n}", "title": "" }, { "docid": "a03cd7c1477320ffa0ff6d1ed21fa762", "score": "0.62070674", "text": "function mapForEach(arr, fn) {\n var newArr = [];\n for (var i=0; i < arr.length; i++) {\n newArr.push(\n fn(arr[i]) \n )\n };\n return newArr;\n}", "title": "" }, { "docid": "2be0ba035c4200a0d6ea3a9da615531e", "score": "0.6197893", "text": "function mapForEach(array, fn){\n let newArray = [];\n for(let i = 0; i < array.length; i++){\n newArray.push(\n fn(array[i])\n );\n };\n return newArray;\n}", "title": "" }, { "docid": "1758f3147312a402e8f11ac22d184af5", "score": "0.6197536", "text": "map(func) {\n this.iterate((x, y) => {\n this.data[x][y] = func(this.data[x][y]);\n });\n return this;\n }", "title": "" }, { "docid": "b7a7214ff5b7b6fc052476151bd08f3b", "score": "0.6188268", "text": "function mapedValue(){\n var listValue=[3,2,1,3,8,1,3,1]\n var mapedValue=listValue.map(function(n){\n n+=1\n return n\n });\n console.log(mapedValue)\n}", "title": "" }, { "docid": "fa4c7788023a10485748215f4a4c6515", "score": "0.6184869", "text": "function indexMap =arr => \n arr.map(ele,idx){\n ele * idx\n }", "title": "" }, { "docid": "6cd71d2fa7f0839aa64434ca217056a8", "score": "0.61810094", "text": "function map(a, fn) {\n\t\tvar i, len, result = [];\n\t\tfor (i = 0, len = a.length; i < len; i++) {\n\t\t\tresult.push(fn(a[i]));\n\t\t}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "c63d1d8fae4bea9169e3fac628fa7b7e", "score": "0.61500037", "text": "function mapWith(array, callback) {\n\t// set an empty array to hold nwe mutated values\n const newArr = [];\n // iterate through the given array with forEach\n array.forEach((item) => {\n // pass each array item to the cb\n // push the return value of the cb to newArr\n \tnewArr.push(callback(item));\n });\n// console.log(newArr)\n return newArr;\n}", "title": "" }, { "docid": "0723394e06f6376a9a9a61923ce86041", "score": "0.6136971", "text": "function map (fn, list) {\n var len = list.length\n\n for (var i = 0; i < len; i++) {\n list[i] = fn(list[i])\n }\n\n return list\n}", "title": "" }, { "docid": "016ab1a72e5625af428422ee68a8d034", "score": "0.61367786", "text": "function map(fn, a)\r\n{\r\n b = [];\r\n for (i = 0; i < a.length; i++)\r\n b[i] = fn(a[i]);\r\n return b;\r\n}", "title": "" }, { "docid": "afd4804ef03f7bdb46e819a35cf39f9c", "score": "0.61147386", "text": "function map(array, fn) {\r\n var length = array.length;\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n output[i] = fn(array[i], i);\r\n }\r\n return output;\r\n}", "title": "" }, { "docid": "05218696f40f3c60815b846fc6694a9d", "score": "0.6111199", "text": "function mymap(arr,mapFunc) \n{ \n let mapArr = []; // empty array // loop though array \n for(let i=0;i<arr.length;i++) \n { \n const result = mapFunc(arr[i]); \n mapArr.push(result); \n } \n return mapArr;\n}", "title": "" }, { "docid": "25045c69208fd908277639c409f7d07b", "score": "0.6110396", "text": "function mapArr (arr) {\r\n return arr.map(cleanArr);\r\n }", "title": "" }, { "docid": "95d8a15b74388153a770322cd92afc00", "score": "0.61071014", "text": "function map(arr) {\n var x = arr.map(n => n + 1);\n return x;\n}", "title": "" }, { "docid": "055d48869cbd3196a5a1510da27c0583", "score": "0.6105655", "text": "function map(arr, fn) {\n let idx = 0, index = 0,\n len = arr.length,\n result = new Array(len);\n while (++idx < len) {\n result[index++] = fn(arr[idx-1], idx, arr);\n }\n return result;\n}", "title": "" }, { "docid": "a300ecb7d797c81f361d06b2a030a35c", "score": "0.61009616", "text": "function mapWith(array, callback) {\n\n}", "title": "" }, { "docid": "eb79ed95101868b056b98cf0b5bd0de1", "score": "0.6096253", "text": "function myMap(array, fnc) {\n let result = [];\n for (var i = 0; i < array.length; i++) {\n result.push(fnc(array[i]));\n }\n return result;\n}", "title": "" }, { "docid": "2abcba809471e7baca3a352a0c73aeaf", "score": "0.6094835", "text": "function Map() {\n\tlet array2 = [5, 7, 8, 45, 67];\n\tconst map1 = array2.map(x => x*2);\n\n\treturn map1;\n\n}", "title": "" }, { "docid": "024dfbb35f6935b1c69eab776ccbda18", "score": "0.607783", "text": "function modifyArray(nums) {\n return (nums.map(num => (num%2==0)?num*2:num*3))\n}", "title": "" }, { "docid": "c9b99f4fa03a90309d3a1caaafa4629a", "score": "0.6075773", "text": "function map(array, func) {\n const result = [];\n array.forEach( element => {\n result.push(func(element));\n });\n return result;\n}", "title": "" }, { "docid": "9d4e825ad4a6bcc196332802daed0887", "score": "0.60651356", "text": "function map(ary,each,done){var result=new Array(ary.length);var next=after_1(ary.length,done);var eachWithIndex=function eachWithIndex(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result);});};for(var i=0;i<ary.length;i++){eachWithIndex(i,ary[i],next);}}", "title": "" }, { "docid": "7dc16f9c081f86388f5989465f997c01", "score": "0.6060894", "text": "function map(arr, callback){\n var newArr = [];\n for(var i = 0; i < arr.length; i++){\n newArr.push(callback(arr[i], i, arr));\n }\n return newArr;\n}", "title": "" }, { "docid": "37b86c7c3523172dbb72278065fe746a", "score": "0.6040605", "text": "function multiplyBy10(array) {\n return array.map(function(elements) {\n return elements * 10;\n });\n}", "title": "" }, { "docid": "3f12c7b7092377538e5fe79d49d7b5c7", "score": "0.60336006", "text": "function map(array, func) {\n var acc = [];\n each(array, function(element, i) {\n acc.push(func(element, i));\n });\n return acc;\n}", "title": "" }, { "docid": "2c954a627d7a559717e066a5076749e5", "score": "0.6033457", "text": "function myMap(arr, fun){\n let mapArray=[]\n for(let element of arr){\n mapArray.push(mapFunc(element))\n }\n return mapArray;\n}", "title": "" }, { "docid": "2398893786f53cf093b59f504fa54c74", "score": "0.6032882", "text": "function supermapper(array) {\n\t if (array[0] > 1000) return;\n\t const squares = array.map(x => x + x);\n\t console.log(squares);\n\t supermapper(squares);\n}", "title": "" }, { "docid": "c1e1e3c684d73e5b20c243238e98d67b", "score": "0.60275596", "text": "function map(action,array){\n var result = [];\n forEach(array,function(element){\n result.push(action(element));\n });\n return result;\n}", "title": "" }, { "docid": "141f1cc7f9fee09aa5ee5a9ab7ca9e51", "score": "0.60267246", "text": "function map(arr, func) {\n\t\tvar newArr = []; \n\t\tfor (var i in arr) {\n\t\t\tif (arr.hasOwnProperty(i)) {\n\t\t\t\tnewArr[i] = func(arr[i]);\n\t\t\t}\n\t\t}\n\t\treturn newArr;\n\t}", "title": "" }, { "docid": "b67f9ecbcaa7de9022eefb910b58129c", "score": "0.60203105", "text": "function map(array, fn) {\n var length = array.length;\n var output = new Array(length);\n\n for (var i = 0; i < length; ++i) {\n output[i] = fn(array[i], i);\n }\n\n return output;\n}", "title": "" }, { "docid": "a4a4eab148b99deb21bd7cebc97095e8", "score": "0.6015072", "text": "function map(arr, func) {\n\t\tvar newArr = [];\n\t\tfor (var i in arr) {\n\t\t\tif (arr.hasOwnProperty(i)) {\n\t\t\t\tnewArr[i] = func(arr[i]);\n\t\t\t}\n\t\t}\n\t\treturn newArr;\n\t}", "title": "" }, { "docid": "0aaffea0b07401fa6d2f4aa81a46a4be", "score": "0.60122997", "text": "function doubleEachNumber(arr) {\n arr = arr.map(element => {\n if (typeof element === \"number\") {\n return element * 2;\n } else {\n return element;\n }\n });\n return arr;\n}", "title": "" }, { "docid": "9fe39bb1a382c582fe585177d3933953", "score": "0.60071856", "text": "function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function eachWithIndex(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result);});};for(var i=0;i<ary.length;i++){eachWithIndex(i,ary[i],next);}}", "title": "" }, { "docid": "849a7d8748e438b5ce70c648c0985355", "score": "0.599996", "text": "function mapWith(array, callback) {\n array.forEach((value, index, arr) => {\n arr[index] = callback(value, index, arr);\n })\n return array;\n}", "title": "" }, { "docid": "7dbe19eff07a41103621be3f77744b49", "score": "0.59961873", "text": "function arrayStuff(pos3) {\r\n mapArray.push(pos3);\r\n }", "title": "" }, { "docid": "44a8d121969ae77244a1446c929dff40", "score": "0.5976668", "text": "function myMap(arrayIn, fn)\n {\n const arrayOut = [];\n for(let i = 0; i < arrayIn.length; i++)\n {\n const item = arrayIn[i];\n arrayOut.push( fn(item) )\n }\n\n return arrayOut\n }", "title": "" }, { "docid": "56b2ba8979fb14f1ed0bbb1120db3331", "score": "0.5951123", "text": "function myMap(arr, callback) {\n newArray = [];\n for (let i = 0; i < arr.length; i++) {\n newArray.push(callback(arr[i]))\n }\n return newArray;\n}", "title": "" }, { "docid": "a5804118c1502836d520e98347dcf1ad", "score": "0.5929953", "text": "function map(arr, cb) {\n const output = []\n // for (let i = 0; i < arr.length; i++) {\n // output.push(cb(arr[i]))\n // }\n arr.forEach(function(element) {\n output.push(cb(element))\n })\n return output\n}", "title": "" }, { "docid": "2eac83b10902d1f0320d6f5c8c6a4ef3", "score": "0.59279376", "text": "function myMap(arr, callback) {\n var newArr = []\n for (let i=0; i < arr.length; i++) {\n newArr.push(callback(arr[i], i, arr))\n }\n return newArr\n}", "title": "" }, { "docid": "6af75a1e94e2945c753f23656ccf5997", "score": "0.59277934", "text": "function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result);});};for(var i=0;i<ary.length;i++){eachWithIndex(i,ary[i],next);}}", "title": "" }, { "docid": "1501fbc762470b9475bbc63a6457d6f9", "score": "0.5920057", "text": "function myMap(array, cb) {\n var newArray = []\n array.forEach(function(ele, idx, arr){\n newArray.push(cb(ele,idx));\n });\n return newArray;\n}", "title": "" } ]
a6c73872c2cf46ade77e5ef85238baea
get department to load combo
[ { "docid": "06c51e38add0cabbdb97aa34e45b3cc0", "score": "0.65288913", "text": "function getDepartmentData() {\n cmbDepartment.empty();\n $.ajax({\n url: VIS.Application.contextUrl + \"VAT/Common/GetDepartmentData\",\n success: function (result) {\n result = JSON.parse(result);\n if (result && result.length > 0) {\n for (var i = 0; i < result.length; i++) {\n cmbDepartment.append(\" <option value=\" + result[i].ID + \">\" + result[i].Value + \"</option>\");\n }\n cmbDepartment.prop('selectedIndex', 0);\n }\n },\n error: function (eror) {\n console.log(eror);\n }\n\n });\n }", "title": "" } ]
[ { "docid": "9204d15e44f0b60f0dae27b50e206af6", "score": "0.6468761", "text": "function getDepartments(school){\n\n\t$.getJSON(\"/api/departments/\" + school, function (data) {\n\t\tvar depts =[];\n\t\tdepts = data.departments;\n\t\tvar deptDropdown = [];\n\n\t\tfor (var i = 0; i < depts.length; i++){\n\t\t\tdeptDropdown.push('<option>' + depts[i] + '</option>');\n\t\t}\n\n\t\t$( \"<select/>\", {\n\t\t\t\"class\": \"deptSelector\",\n\t\t\t\"id\": \"dept\",\n\t\t\t\"style\": \"display:inline\",\n\t\t\t\"name\": \"department\",\n\t\t\thtml: deptDropdown.join( \"\" )\n\t\t }).appendTo( \"body\" );\n\n\n\t});\n}", "title": "" }, { "docid": "f002d5dff513ac3a4bddce4a53c25c0f", "score": "0.64528304", "text": "function getEmployeeDept(){\n connection.query(queryList.deptList, function(err, res){\n if (err) throw err;\n inquirer\n .prompt([new q.queryAdd(\"department\", \"Which department is this employee in?\", res.map(dept => dept.name))])\n .then(answer => {\n let dept = res.filter(d => d.name === answer.department);\n addEmployee(dept);\n })\n .catch(err => {\n if(err) throw err;\n quit();\n });\n });\n}", "title": "" }, { "docid": "1e6b982589164df3a683f28e4a53cbf9", "score": "0.64360887", "text": "function onSelectDept(){\n var deptGrid = View.panels.get('deptGrid');\n deptCode = deptGrid.rows[deptGrid.selectedRowIndex][\"dp.dp_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"rm.dv_id\", divisionId, \"=\");\n restriction.addClause(\"rm.dp_id\", deptCode, \"=\");\n if (View.controllers.get(\"hotelCostRptController\").isExcludeNullArea) {\n restriction.addClause(\"rmpct.area_rm\", 0, \">\");\n }\n View.panels.get('rmpctGrid').refresh(restriction);\n var title = getMessage(\"roomFloorPanelTitle\").replace(\"<{0}>\", divisionId + \"-\" + deptCode);\n setPanelTitle(\"rmpctGrid\", title);\n}", "title": "" }, { "docid": "90db50d6d921b72dc8b397e25fb020bb", "score": "0.6412052", "text": "function chooseDepartment(CBfunc) {\n // select all from existing department table in employees_db\n connection.query(\"SELECT * FROM department\", function(err, results) {\n if (err) throw err;\n console.table(results);\n // set up empty array to add department name info\n let deptArray = [];\n // make sure globalDept variable matches with results retrieved from database\n globalDept = results;\n // for loop to produce all entries in table\n for (i = 0; i < results.length; i++) {\n // push/add each name result to array\n deptArray.push(results[i].dept_name);\n }\n\n // call back function used below in addRole function, departmentNames used for the \"choices\" in dept question\n CBfunc(deptArray);\n });\n}", "title": "" }, { "docid": "003dbfb9d43c1629c4f5baee2fb06aea", "score": "0.63851243", "text": "function getDepartment() {\n $.ajax({\n url: $('input[name=base_url]').val() + '/department/' + $('select[name=group_id]').val(),\n type: 'get',\n cache: false,\n dataType: 'json',\n success: function(data) {\n \n },\n complete: function (jqXHR, textStatus){\n var obj = jQuery.parseJSON(jqXHR.responseText);\n \n $('select[name=department_id]').empty();\n\t\t\t$('select[name=department_id]').append('<option value=\"0\" selected disabled>Department</option>');\n\t\t\t\n\t\t\t// iterate department\n\t\t\t$.each (obj, function (key, val) {\n\t\t\t\tif ($('input[name=text_department_id]').val() == val['id']) {\n\t\t\t\t\t$('select[name=department_id]').append('<option value=\"' + val['id'] + '\" selected>' + val['department_name'] + '</option>');\n\t\t\t\t} else {\n\t\t\t\t\t$('select[name=department_id]').append('<option value=\"' + val['id'] + '\">' + val['department_name'] + '</option>');\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t$('.js-loading-bar').modal('hide');\n\t\t\t$('.progress-bar').removeClass('animate');\n },\n error: function(xhr, textStatus, thrownError) {\n console.log('Something went to wrong.Please Try again later...' + thrownError);\n }\n });\n}", "title": "" }, { "docid": "df025907e07cf5fd9680a51ee477cfb9", "score": "0.63551307", "text": "function getDepartments(data) {\n if (data.jobs.job[0]) {\n return data.jobs.job[0].company.company_departments.department;\n }\n}", "title": "" }, { "docid": "3f0b6347dd058016ab9716c302bacc2e", "score": "0.6353462", "text": "function selectDepartment() {\n const query = 'SELECT * FROM department';\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n inquirer\n .prompt([{\n type: 'list',\n message: `Which department would you like to view?`,\n name: 'departmentName',\n choices() {\n const choiceArray = ['Cancel'];\n res.forEach(({ name }) => {\n choiceArray.push(name);\n });\n return choiceArray;\n },\n },\n ])\n .then((response) => {\n if (response.departmentName == 'Cancel') {\n start();\n } else {\n viewEmployeeByDepartment(response);\n }\n })\n });\n}", "title": "" }, { "docid": "f42f316b2e1790d297d37e19be052ce4", "score": "0.6342814", "text": "function cmbdepartemen(typ,dep){\n var u= dir2;\n var d='aksi=cmb'+mnu2;\n ajax(u,d).done(function (dt) {\n var out='';\n if(dt.status!='sukses'){\n out+='<option value=\"\">'+dt.status+'</option>';\n }else{\n if(dt.departemen.length==0){\n out+='<option value=\"\">kosong</option>';\n }else{\n $.each(dt.departemen, function(id,item){\n out+='<option '+(dep==item.replid?' selected ':'')+' value=\"'+item.replid+'\">'+item.nama+'</option>';\n });\n }\n if(typ=='filter'){ // filter (search)\n $('#departemenS').html(out);\n cmbtahunajaran('filter','');\n }else{ // form (edit & add)\n $('#departemenDV').text(': '+dt.departemen[0].nama);\n }\n }\n });\n }", "title": "" }, { "docid": "024e68bbb8e1a6f0a2946993de9ca51d", "score": "0.6283485", "text": "function deptList() {\n return connection.query(\"SELECT id, dept_name FROM departments\");\n}", "title": "" }, { "docid": "ed4e9bc58305f1433ab6e873c169127e", "score": "0.6259058", "text": "function checkDept() {\n deptURL = '';\n if (dept === 'Engineering') {\n deptURL = \"eng\";\n $(\"#deptSelect > option\").each(function() {\n if (this.value === dept) {\n this.selected = true\n }\n });\n } else if (dept === 'Manufacturing') {\n deptURL = \"mfg\";\n $(\"#deptSelect > option\").each(function() {\n if (this.value === dept) {\n this.selected = true\n }\n });\n } else if (dept === 'Program Management') {\n deptURL = \"pm\";\n $(\"#deptSelect > option\").each(function() {\n if (this.value === dept) {\n this.selected = true\n }\n });\n };\n }", "title": "" }, { "docid": "7e155288a5d1f2ec0ae7803e7c909eb8", "score": "0.62548184", "text": "function whichDepart() {\r\n\r\n let lcraDepartment = [\"Business Development\", \"Chief Administrative Officer\", \"Chief Commercial Officer\", \"Chief Financial Officer\", \"Chief of Staff\", \"Commercial Asset Management\", \"Communications\", \"Community Services\", \"Construction I\", \"Construction II\", \"Construction Support\", \"Controller\", \"Corporate Events\", \"Corporate Strategy\", \"Critical Infra Protection\", \"Critical Infrastructure Protection\", \"Customer Operations\", \"Cybersecurity\", \"Dam and Hydro\", \"Digital Services\", \"Enterprise Operations\", \"Environmental Affairs\", \"Environmental Field Services\", \"Environmental Lab\", \"Facilities Planning Management\", \"Finance\", \"Financial Planning & Strategy\", \"Fleet Services\", \"FPP Maintenance\", \"FPP Operations\", \"FPP Plant Support\", \"FRG Maintenance\", \"FRG Operations\", \"FRG Plant Support\", \"Fuels Accounting\", \"General Counsel\", \"General Manager\", \"Generation Environmental Group\", \"Generation Operations Mgmt\", \"Governmental & Regional Affairs\", \"Hilbig Gas Operations\", \"Human Resources\", \"Information Management\", \"Irrigation Operations\", \"Lands & Conservation\", \"Legal Services\", \"Line & Structural Engineering\", \"Line Operations\", \"LPPP Maintenance\", \"LPPP Operations\", \"LPPP Plant Support\", \"Materials Management\", \"Mid-Office Credit and Risk\", \"P&G Oper Reliability Group\", \"Parks\", \"Parks District - Coastal\", \"Parks District - East\", \"Parks District - West\", \"Plant Operations Engr. Group\", \"Plant Support Service\", \"Project Management\", \"Public Affairs\", \"QSE Operations\", \"Rail Fleet Operations\", \"Rangers\", \"Real Estate Services\", \"Regulatory & Market Compliance\", \"Regulatory Affairs\", \"Resilience\", \"River Operations\", \"Safety Services\", \"Sandy Creek Energy Station\", \"Security\", \"Service Quality & Planning\", \"SOCC Operations\", \"Strategic Initiatives & Transformation\", \"Strategic Sourcing\", \"Substation Engineering\", \"Substation Operations\", \"Supply Chain\", \"Survey GIS & Technical Svc\", \"System Control Services\", \"System Infrastructure\", \"Technical & Engineering Services\", \"Telecom Engineering\", \"Trans Contract Construction\", \"Trans Operational Intelligence\", \"Transmission Design & Protect\", \"Transmission Executive Mgmt\", \"Transmission Field Services\", \"Transmission Planning\", \"Transmission Protection\", \"Transmission Strategic Svcs\", \"Water\", \"Water Contracts & Conservation\", \"Water Engineering\", \"Water Quality\", \"Water Resource Management\", \"Water Surface Management\", \"Wholesale Markets & Sup\"];\r\n\r\n //let lcraDepart = document.getElementById(\"lcraDepart\");\r\n\r\n\r\n for(let i = 0; i < lcraDepartment.length; i++){\r\n let optn = lcraDepartment[i];\r\n let el = document.createElement(\"option\");\r\n el.value = optn;\r\n el.textContent = optn;\r\n lcraDepart.appendChild(el);\r\n }\r\n}", "title": "" }, { "docid": "9b075f57e8c5fafe087e52b1026d2166", "score": "0.61368984", "text": "function getDepartments() {\n const query = \"SELECT * FROM department\";\n return queryDB(query);\n}", "title": "" }, { "docid": "56c27c134a5d5c678dff8dca26fd9583", "score": "0.6135628", "text": "function viewDept() {\n connection.query(\n `\n SELECT \n department.name AS 'Department'\n FROM department\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "title": "" }, { "docid": "bad92e02dae8a201558505c2c88c210d", "score": "0.6092054", "text": "function searchDept(deptKey, courseKey, sectionKey) {\n const deptObj = coursesData.departments[deptKey];\n if (deptObj != null) {\n displayDeptRes(deptObj);\n } else {\n searchFailed('department', deptKey);\n markInput(inputs[0], false);\n }\n}", "title": "" }, { "docid": "be03da7cd5c30fbbdfda88fa1368cca3", "score": "0.6088838", "text": "function getDepartments() {\n Department.getAll()\n .then(function (departments) {\n $scope.departments = departments;\n })\n ['catch'](function (err) {\n Notification.error('Something went wrong with fetching the departments, please refresh the page.')\n });\n }", "title": "" }, { "docid": "cc11b6268286c56b9dee930041d2e909", "score": "0.6088048", "text": "function getAvailableDepartments() {\n departmentService.getAllDepartments().then(function(departments) {\n $scope.departments = departments.data;\n })\n }", "title": "" }, { "docid": "8e6bd89117fadd126f053b19686d7ed6", "score": "0.60810965", "text": "function viewByDepartment() {\n inquirer\n .prompt({\n name: \"choice\",\n message: \"Which department you want to see?\",\n type: \"list\",\n choices: [\n \"Marketing\",\n \"Engineering\",\n \"Finance\",\n \"Legal\"],\n }).then((result)=>{\n var department = result.choice;\n connection.query(\n \"SELECT * FROM employee WHERE department=?\", [department],\n\n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n\n })\n }", "title": "" }, { "docid": "a34fe7164f22cbc00418add2b2756794", "score": "0.60495687", "text": "async function viewByDepart() {\n const depsArray = await getDepsInArray();\n // Prompts\n const { department }= await prompt({\n name: \"department\",\n message: \"What department would you like to chose?\",\n choices: depsArray.map((depsItem) => ({\n name: depsItem.name,\n value: depsItem.id,\n })),\n type: \"list\",\n });\n \n const query = `SELECT first_name, last_name, title, salary\n FROM employee \n INNER JOIN role ON employee.role_id = role.id \n INNER JOIN department ON role.department_id= department.id \n WHERE department.id = ?`;\n \n\n // Send request to database\n const data = await connection.query(query, [department]);\n console.table(data);\n \n }", "title": "" }, { "docid": "6318a8c4eff1caf690be1fac3ec927b8", "score": "0.60397184", "text": "function loadDepartmentDDL(empdep) {\n $.ajax({\n type: \"Get\",\n url: \"api/departments/\",\n contentType: \"application/json; charset=utf-8\"\n })\n .done(function (data) {\n html = \"\";\n $(\"#ddlDepts\").empty();\n $.each(data, function () {\n html += \"<option value=\\\"\" + this[\"DepartmentId\"] + \"\\\">\" + this[\"DepartmentName\"] + \"</option>\";\n });\n $(\"#ddlDepts\").append(html);\n $(\"#ddlDepts\").val(empdep);\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n alert(\"error\");\n });\n}", "title": "" }, { "docid": "f05bba8b09256a3d28c02e0358ae47d6", "score": "0.5968888", "text": "function viewDept() {\n connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "title": "" }, { "docid": "cd5ffdbfd1a50396c5d29fdb5af24efc", "score": "0.59594893", "text": "function generateDepartmentData() {\n return {\n name: generateDepartmentName()\n };\n}", "title": "" }, { "docid": "510d8c9e03d6baebd718b28518cdf2c7", "score": "0.5934958", "text": "getApiProgrammersSection(){\n\n // Only get assign programmers section when the department selected has programming as one of its department\n\n if(this.isProgrammersDepSelected()){\n this.getApiJobDepartments();\n this.getApiProgrammers();\n\n\n }else{\n // Else empty the array of the programmers\n this.setState((prevState, props) => (\n { programmers_selection: \"\", programmers_options: []}\n ));\n }\n }", "title": "" }, { "docid": "7e451ce55fc52df152fe2871a449cf40", "score": "0.59257275", "text": "viewAllDept() {\n\t\tconst query = `SELECT *\n\t FROM department;`;\n\t\treturn this.connection.query(query);\n\t}", "title": "" }, { "docid": "825d82e399e479df053326eda6c7a74e", "score": "0.5921439", "text": "function cmbdepartemenS(){\n deplist().done(function(res){\n var opt='';\n if(res.status!='sukses'){\n notif(res.status,'red');\n }else{\n $.each(res.departemen, function(id,item){\n opt+='<option value=\"'+item.replid+'\">'+item.nama+'</option>'\n });\n $('#departemenS').html(opt);\n cmbprosesS($('#departemenS').val());\n }\n });\n }", "title": "" }, { "docid": "c56cbad2fa86a35a81657ab570d358b4", "score": "0.591727", "text": "function viewDepartment() {\n const query = `SELECT department FROM department`;\n \n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n \n start();\n });\n \n\n}", "title": "" }, { "docid": "3fb1ec3594e0a57c4e8fb7b89b3df8b4", "score": "0.59055144", "text": "function getCurrentDepartments(){\n connection.query(`SELECT * FROM department_table`, (err, res) => {\n // If error log error\n if (err) throw err;\n // Set the current departments array equal to an array of department objects returned in the response\n currentDepartments = res;\n // Get the department names from the returned object and set them equal to a variable for use in inquirer choices\n currentDepartmentNames = currentDepartments.map(a=>a.department_name);\n // Get the latest roles information\n getCurrentRoles()\n })\n }", "title": "" }, { "docid": "f62602f5ed17986508899a6aed0d546b", "score": "0.58965147", "text": "function getDepartamentosDropdown() {\n $http.post(\"Departamentos/getDepartamentosTotal\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.listaDepartamentos.data = r.data.d.data;\n \n }\n })\n }", "title": "" }, { "docid": "417c08c6999b4d7fce6a49b0f4728d2a", "score": "0.58959085", "text": "function viewAllEmployeesByDepart() {\n const query2 = `select department.id,department.name\n FROM employee INNER JOIN role ON (employee.role_id = role.id) INNER JOIN department ON (department.id = role.department_id) group by department.id,department.name;`;\n connection.query(query2, (err, res) => {\n if (err) throw err;\n const departmentChoices = res.map((data) => ({\n value: data.id, name: data.name,\n }));\n // console.table(res);\n // console.log(departmentChoices);\n promptDepartment(departmentChoices);\n });\n}", "title": "" }, { "docid": "2a5d660b9bd81c08359ee5d8da597f87", "score": "0.58801234", "text": "function viewByDept() {\n connection.query(`SELECT * FROM employee_db.department`, function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer\n .prompt({\n name: \"department\",\n type: \"list\",\n message: \"Which department?\",\n choices: function () {\n var choiceArray = [];\n for (var i = 0; i < res.length; i++) {\n choiceArray.push(res[i].name);\n }\n return choiceArray;\n },\n })\n .then(function (answer) {\n connection.query(\n `SELECT employee.first_name, employee.last_name, role.salary, role.title, department.name as \"department name\"\n FROM employee_db.employee\n INNER JOIN role ON employee.role_id = role.id\n INNER JOIN department ON role.department_id = department.id\n WHERE department.name LIKE '${answer.department}'`,\n function (err, res) {\n if (err) throw err;\n console.table(res);\n }\n );\n startQuestions();\n });\n });\n}", "title": "" }, { "docid": "bd1eddc2157c9c8b8ca5224e4cfca256", "score": "0.5869574", "text": "fetchAllGradingsFreePointByDepartmentForDropDown() {\n return instance.get(`/department/free-point-gradings/all-free-point-gradings-with-default`);\n }", "title": "" }, { "docid": "30474a607af238ac2ab95ec7cbcbd018", "score": "0.58575064", "text": "function deptSearch() {\n db.query(\n `SELECT * FROM departments`,\n (err, res) => {\n if (err) throw err\n console.table(res)\n deptOptions()\n }\n )\n}", "title": "" }, { "docid": "ca8d27ffe2317562484f8b96e99ab969", "score": "0.5846624", "text": "function GetDepartmentName(id) {\n if (id == 1) {\n return \"HR\";\n } \n\n if (id == 2) {\n return \"IT\";\n } \n\n if (id == 3) {\n return \"Creative\";\n } \n\n if (id == 4) {\n return \"Marketing\";\n } \n\n if (id == 5) {\n return \"Sales\";\n } \n\n return \"Not Defined\";\n}", "title": "" }, { "docid": "79fe426daa53ce9eb07ad9f3756874bf", "score": "0.58285916", "text": "function GetDepartment(deptList)\n{\n let departments = '';\n for(const dept of deptList)\n {\n departments = `${departments} <div class='dept-label'>${dept}</div>`\n }\n return departments;\n}", "title": "" }, { "docid": "79fe426daa53ce9eb07ad9f3756874bf", "score": "0.58285916", "text": "function GetDepartment(deptList)\n{\n let departments = '';\n for(const dept of deptList)\n {\n departments = `${departments} <div class='dept-label'>${dept}</div>`\n }\n return departments;\n}", "title": "" }, { "docid": "b6ee32f1662dc5e738971baba232903a", "score": "0.5822208", "text": "function viewDept() {\n db.selectAllDepartments()\n .then(([data]) => {\n console.log(`${separator}\\n DEPARTMENTS\\n${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "title": "" }, { "docid": "36714bb5f051834d570ca7b35cd06540", "score": "0.5803915", "text": "function viewDepartmnt() {\n \n connection.query(\" SELECT * FROM department \", function (error, result) \n {\n if (error) throw error;\n console.table(result);\n mainMenu()\n\n });\n\n }", "title": "" }, { "docid": "2aaab9c0268ec5444740c52f1800f177", "score": "0.5797759", "text": "function viewDepartment() {\n inquirer\n .prompt([{\n name: 'departments',\n type: 'list',\n message: 'Would you like to view all stored departments?',\n choices: [\n 'Sales',\n 'Engineering',\n 'Finance',\n 'Legal team',\n 'Manager'\n ]\n }])\n .then(function (answer) {\n const query = 'SELECT * FROM department WHERE ?';\n connection.query(query, {\n department_name: answer.departments\n }, function (err, res) {\n if (err) throw err;\n console.table(res)\n runSearch();\n });\n });\n}", "title": "" }, { "docid": "73b80de9c2e649d414e9d7b7b8aec67f", "score": "0.5789954", "text": "async function viewByDepartment() {\n clear();\n const departments = await connection.query(\"SELECT * FROM department\");\n const departmentOptions = departments.map(({ id, department_name }) => ({\n name: department_name,\n value: id,\n }));\n \n const { userDepartmentId } = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which department would you like to view?\",\n name: \"userDepartmentId\",\n choices: departmentOptions,\n },\n ]);\n\n const employees = await connection.query(employeesSQL + \" WHERE department.id = ?;\", userDepartmentId);\n\n log(\"\\n\");\n console.table(employees);\n mainMenu();\n}", "title": "" }, { "docid": "25c1d912a51c5e69faddb6de703a156f", "score": "0.5780376", "text": "function GetDepartmentNames() {\n // Send an AJAX request\n $.getJSON(\"api/DepartmentNames\")\n .done(function (data) {\n $.each(data, function (key, item) {\n $('<option>', { text: item, value: item }).appendTo($('#chooseDepartment'));\n });\n });\n}", "title": "" }, { "docid": "a634544d9d54c1ba1e598f78d6a086bc", "score": "0.57687104", "text": "function viewDepts(){\n var query = connection.query(\"SELECT Department_ID, Department_Name FROM departments;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n superAsk();\n });\n }", "title": "" }, { "docid": "50216d4b00031ebab68d833021c8c562", "score": "0.57564765", "text": "function employeesDepartment() {\n connection.query(\"SELECT * FROM employeeTracker_db.department\",\n function (err, res) {\n if (err) throw err\n console.table(res)\n runSearch()\n }\n )\n}", "title": "" }, { "docid": "e4f56de35f859c543147c372febe4513", "score": "0.5741693", "text": "function viewDepartment() {\n connection.query(\"SELECT * FROM employee_db.department\", function (error, data) {\n console.table(data)\n init()\n })\n}", "title": "" }, { "docid": "74e0cde3a40a77bdd72173253fc8cb6a", "score": "0.5736653", "text": "function getDepartment(dept, sheet, minSems){\n if(dept == undefined){ \n throw \"ERROR: NO DEPARTMENT SPECIFIED\";\n return;\n }\n if(sheet == undefined){\n sheet = SpreadsheetApp.openByUrl(\"https://docs.google.com/spreadsheets/d/11tRpkgU0JoV_qTa_KsI8yEO6aLz8KY9wtGmIQXkdaXs/edit#gid=0\").getSheets()[1];\n }\n \n //Strip any whitespaces\n dept = dept.replace(\" \", \"\");\n \n const values = sheet.getRange(\"A:C\").getValues();\n\n //Search for course\n for(var i = 1; i < values.length; i++){\n if(values[i][0] == dept){\n const startIndex = parseInt(values[i][1]);\n\n //endIndex has to be one greater because Departments spreadsheet is inclusive but getCourses is exclusive\n const endIndex = parseInt(values[i][2]) + 1;\n\n //Get all courses between those indices\n return getCourses(startIndex, endIndex, null, minSems);\n }\n }\n return null;\n}", "title": "" }, { "docid": "0d7c456b2d68158380d7d3dc5be5f81b", "score": "0.57200885", "text": "viewDepartments() {\n return connection.query(`SELECT * from department`)\n }", "title": "" }, { "docid": "399ee2945e68d5e140e1bfd0a8a7ef1a", "score": "0.57188904", "text": "function departmentTable() { }", "title": "" }, { "docid": "2edaad47b38c93f7eb64521d5d475a68", "score": "0.5704863", "text": "function SelDeptComponent(loadingCtrl, alertCtrl, modalCtrl, navCtrl, service, storage) {\n var _this = _super.call(this, loadingCtrl, alertCtrl) || this;\n _this.loadingCtrl = loadingCtrl;\n _this.alertCtrl = alertCtrl;\n _this.modalCtrl = modalCtrl;\n _this.navCtrl = navCtrl;\n _this.service = service;\n _this.storage = storage;\n _this.deptReqModel = new src_app_data_model_base_model__WEBPACK_IMPORTED_MODULE_7__[\"AccessTokenModel\"]();\n // arrDept: Array<any> = [];\n _this.cacheDept = new src_app_data_model_constant_model__WEBPACK_IMPORTED_MODULE_6__[\"LocalStorageCache\"]();\n return _this;\n }", "title": "" }, { "docid": "46f404eb5d85a8a9f18d0a5fd12a34aa", "score": "0.5701722", "text": "function deptPartido(d) {\n return d.properties.PARTIDO;\n }", "title": "" }, { "docid": "12496964c4c7a196ff9019c0ede90c4b", "score": "0.5699797", "text": "function getDeptClass(classCode){\r\n\t\r\n\tvar deptName = getDeptName(classCode);\r\n\t\r\n\tswitch(deptName){\r\n\t\tcase \"AD\":\r\n\t\tcase \"AT\":\r\n\t\t\treturn \"art\";\r\n\t\tcase \"BA\":\r\n\t\t\treturn \"business\";\r\n\t\tcase \"BE\":\r\n\t\tcase \"BI\":\r\n\t\tcase \"CE\":\r\n\t\t\treturn \"bible\";\r\n\t\tcase \"CA\":\r\n\t\tcase \"CM\":\r\n\t\t\treturn \"comm\";\r\n\t\tcase \"ED\":\r\n\t\t\treturn \"education\";\r\n\t\tcase \"EG\":\r\n\t\t\treturn \"engineering\";\r\n\t\tcase \"HG\":\r\n\t\t\treturn \"history\";\r\n\t\tcase \"ID\":\r\n\t\t\treturn \"interdisciplinary\";\r\n\t\tcase \"ES\":\r\n\t\tcase \"KH\":\r\n\t\t\treturn \"allied-health\";\r\n\t\tcase \"LL\":\r\n\t\t\treturn \"lang\";\r\n\t\tcase \"MS\":\r\n\t\tcase \"MU\":\r\n\t\t\treturn \"music\";\r\n\t\tcase \"NS\":\r\n\t\t\treturn \"nursing\";\r\n\t\tcase \"PH\":\r\n\t\t\treturn \"pharm\";\r\n\t\tcase \"PY\":\r\n\t\t\treturn \"psych\";\r\n\t\tcase \"SM\":\r\n\t\t\treturn \"math\";\r\n\t\tcase \"SW\":\t\r\n\t\t\treturn \"socialwork\";\r\n\t\tdefault:\r\n\t\t\treturn \"misc\";\r\n\t}\r\n\t\r\n\treturn \"\";\r\n}", "title": "" }, { "docid": "3be7fd1aff1829aec2825af76390d97e", "score": "0.56951255", "text": "function viewDepartment() {\n // select from the db\n let query = \"SELECT * FROM department\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n startPrompt();\n });\n \n}", "title": "" }, { "docid": "658e3775d354f7e776e0f66248d6be45", "score": "0.56649643", "text": "async getOrganisationUnits(){\r\n const st=this.setting\r\n let url=\"programs/\"+st.programid+\"/organisationUnits?fields=id,name,organisationUnitGroups[code]\"\r\n return await this.getResourceSelected(url)\r\n }", "title": "" }, { "docid": "d7e28b3ae17b313472c06ec8054fba48", "score": "0.5661605", "text": "async function getDepartmentId(dep) {\n const departments = await getDepartments();\n for (let i = 0; i < departments.length; i++) {\n if (departments[i].name === dep) {\n return departments[i].id;\n }\n }\n}", "title": "" }, { "docid": "7dae010629424c52a937b2727a554649", "score": "0.56374335", "text": "getDepartments() {\n return this.departments;\n }", "title": "" }, { "docid": "cd8864601bfdde727be7cdabe35954b1", "score": "0.56341875", "text": "async function getDepartmentInfo() {\n return inquirer\n .prompt([\n {\n name: \"departmentName\",\n type: \"input\",\n message: \"What's The New Department's Name?\"\n }\n ])\n}", "title": "" }, { "docid": "1e8712be6c0e4274272d513c02fe44d0", "score": "0.5625347", "text": "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "title": "" }, { "docid": "9bb8b582bb0040ee3373b06835beba2d", "score": "0.5612491", "text": "function viewDepartmentBudget() {\n console.log(\"Selecting all departments...\\n\");\n connection.query(\"SELECT SUM(salary),department.name FROM role JOIN department ON role.department_id = department.id GROUP BY role.department_id;\", function (err, resDep) {\n if (err) throw err;\n console.table(resDep);\n mainPrompt()\n });\n}", "title": "" }, { "docid": "b1825e268f6763279a5084c66185ad79", "score": "0.5604106", "text": "function getDeptName(classCode){\r\n\tswitch(classCode){\r\n\t\tcase \"ART\":\r\n\t\tcase \"GDES\":\r\n\t\tcase \"IDES\":\r\n\t\tcase \"THTR\":\r\n\t\tcase \"VCD\":\r\n\t\t\treturn \"AD\";\r\n\t\t\t\r\n\t\tcase \"ATRN\":\r\n\t\t\treturn \"AT\";\r\n\t\t\t\r\n\t\tcase \"ACCT\":\t\t\r\n\t\tcase \"BA\":\r\n\t\tcase \"BUS\":\r\n\t\tcase \"ECON\":\r\n\t\tcase \"EUIS\":\r\n\t\tcase \"FIN\":\r\n\t\tcase \"ITM\":\r\n\t\tcase \"MGMT\":\r\n\t\tcase \"MIS\":\r\n\t\tcase \"MRKT\":\r\n\t\tcase \"SMGT\":\r\n\t\t\treturn \"BA\";\r\n\t\t\t\r\n\t\tcase \"BE\":\r\n\t\tcase \"BEBL\":\r\n\t\tcase \"BECE\":\r\n\t\tcase \"BEGE\":\r\n\t\tcase \"BEGS\":\r\n\t\tcase \"BENT\":\r\n\t\tcase \"BEOT\":\r\n\t\tcase \"BEPH\":\r\n\t\tcase \"BEPT\":\r\n\t\tcase \"BEST\":\r\n\t\tcase \"BETH\":\r\n\t\t\treturn \"BE\";\r\n\t\t\t\r\n\t\tcase \"BEBS\":\r\n\t\tcase \"BEDU\":\r\n\t\tcase \"BEHI\":\r\n\t\tcase \"BTAT\":\r\n\t\tcase \"BTBL\":\r\n\t\tcase \"BTBS\":\r\n\t\tcase \"BTCM\":\r\n\t\tcase \"BTGE\":\r\n\t\tcase \"BTGS\":\r\n\t\tcase \"BTHT\":\r\n\t\tcase \"BTNT\":\r\n\t\tcase \"BTOT\":\r\n\t\tcase \"BTPA\":\r\n\t\tcase \"XBGE\":\r\n\t\tcase \"XBHI\":\r\n\t\tcase \"EGGN\":\r\n\t\t\treturn \"BI\";\r\n\t\t\r\n\t\tcase \"CA\":\r\n\t\tcase \"COM\":\r\n\t\tcase \"COMM\":\r\n\t\tcase \"EMTC\":\r\n\t\tcase \"JOUR\":\r\n\t\t\treturn \"CA\";\r\n\t\t\t\r\n\t\tcase \"CEBE\":\r\n\t\tcase \"CEEE\":\r\n\t\tcase \"CEEM\":\r\n\t\tcase \"CELG\":\r\n\t\tcase \"CENS\":\r\n\t\t\treturn \"CE\";\r\n\t\t\t\r\n\t\tcase \"BRDM\":\r\n\t\tcase \"DCCM\":\r\n\t\tcase \"PWID\":\r\n\t\tcase \"TPC\":\r\n\t\t\treturn \"CM\";\r\n\t\t\r\n\t\tcase \"ECS\":\r\n\t\tcase \"ECSP\":\r\n\t\tcase \"ED\":\r\n\t\tcase \"EDA\":\r\n\t\tcase \"EDEC\":\r\n\t\tcase \"EDMC\":\r\n\t\tcase \"EDR\":\r\n\t\tcase \"EDSE\":\r\n\t\tcase \"EDSP\":\r\n\t\tcase \"EDU\":\r\n\t\tcase \"EDUC\":\r\n\t\t\treturn \"ED\";\r\n\t\t\r\n\t\tcase \"CS\":\r\n\t\tcase \"EG\":\r\n\t\tcase \"EGCP\":\r\n\t\tcase \"EGEE\":\r\n\t\tcase \"EGME\":\r\n\t\t\treturn \"EG\";\r\n\t\t\r\n\t\tcase \"AT\":\r\n\t\tcase \"CCHG\":\r\n\t\tcase \"ES\":\r\n\t\tcase \"ESS\":\r\n\t\tcase \"ESSE\":\r\n\t\tcase \"EXSC\":\r\n\t\tcase \"MAHE\":\r\n\t\tcase \"MAPE\":\r\n\t\tcase \"PASS\":\r\n\t\tcase \"PEAE\":\r\n\t\tcase \"PEAI\":\r\n\t\tcase \"PEAS\":\r\n\t\tcase \"PEAT\":\r\n\t\tcase \"PEH\":\r\n\t\tcase \"PEM\":\r\n\t\tcase \"SES\":\r\n\t\t\treturn \"ES\";\r\n\t\t\r\n\t\tcase \"ANTH\":\r\n\t\tcase \"CRJU\":\r\n\t\tcase \"DCHG\":\r\n\t\tcase \"GEO\":\r\n\t\tcase \"GSS\":\r\n\t\tcase \"HIST\":\r\n\t\tcase \"INTL\":\r\n\t\tcase \"POLS\":\r\n\t\tcase \"PUAD\":\r\n\t\tcase \"SOC\":\r\n\t\tcase \"SS\":\r\n\t\tcase \"SSED\":\r\n\t\tcase \"UNIV\":\r\n\t\t\treturn \"HG\";\r\n\t\t\r\n\t\tcase \"COLL\":\r\n\t\tcase \"GLBL\":\r\n\t\tcase \"HON\":\r\n\t\tcase \"ID\":\r\n\t\tcase \"LART\":\r\n\t\t\treturn \"ID\";\r\n\t\t\r\n\t\tcase \"ALHL\":\r\n\t\tcase \"DCPF\":\r\n\t\tcase \"ESED\":\r\n\t\tcase \"PEAF\":\r\n\t\tcase \"PEAL\":\r\n\t\tcase \"PEAR\":\r\n\t\tcase \"PEAX\":\r\n\t\tcase \"PEF\":\r\n\t\tcase \"XPEF\":\r\n\t\t\treturn \"KH\";\r\n\t\t\r\n\t\tcase \"ARBC\":\r\n\t\tcase \"CHN\":\r\n\t\tcase \"DCLT\":\r\n\t\tcase \"EAP\":\r\n\t\tcase \"ENG\":\r\n\t\tcase \"FILM\":\r\n\t\tcase \"FREN\":\r\n\t\tcase \"GER\":\r\n\t\tcase \"LANG\":\r\n\t\tcase \"LING\":\r\n\t\tcase \"LIT\":\r\n\t\tcase \"LL\":\r\n\t\tcase \"SPAN\":\r\n\t\t\treturn \"LL\";\r\n\t\t\r\n\t\tcase \"AES\":\r\n\t\tcase \"MIL\":\r\n\t\t\treturn \"MS\";\r\n\t\t\r\n\t\tcase \"CDMU\":\r\n\t\tcase \"CHMU\":\r\n\t\tcase \"CLMU\":\r\n\t\tcase \"DCHU\":\r\n\t\tcase \"EDMU\":\r\n\t\tcase \"GMUS\":\r\n\t\tcase \"HLMU\":\r\n\t\tcase \"HUM\":\r\n\t\tcase \"KPMU\":\r\n\t\tcase \"MU\":\r\n\t\tcase \"MUED\":\r\n\t\tcase \"PFMU\":\r\n\t\tcase \"PLMU\":\r\n\t\tcase \"THMU\":\r\n\t\tcase \"TYMU\":\r\n\t\tcase \"WSHP\":\r\n\t\tcase \"XHUM\":\r\n\t\t\treturn \"MU\";\r\n\t\t\r\n\t\tcase \"DCNS\":\r\n\t\tcase \"NS\":\r\n\t\tcase \"NSG\":\r\n\t\t\treturn \"NS\";\r\n\t\t\r\n\t\tcase \"PHAR\":\r\n\t\tcase \"PPHR\":\r\n\t\t\treturn \"PH\";\r\n\t\t\r\n\t\tcase \"DCPY\":\r\n\t\tcase \"PY\":\r\n\t\tcase \"PYCH\":\r\n\t\t\treturn \"PY\";\r\n\t\t\r\n\t\tcase \"BIO\":\r\n\t\tcase \"BIOA\":\r\n\t\tcase \"BIOE\":\r\n\t\tcase \"CHEM\":\r\n\t\tcase \"DEV\":\r\n\t\tcase \"ENVS\":\r\n\t\tcase \"ESCI\":\r\n\t\tcase \"FORS\":\r\n\t\tcase \"GBIO\":\r\n\t\tcase \"GEOA\":\r\n\t\tcase \"GEOG\":\r\n\t\tcase \"GEOL\":\r\n\t\tcase \"GMTH\":\r\n\t\tcase \"GSCI\":\r\n\t\tcase \"MATH\":\r\n\t\tcase \"MTED\":\r\n\t\tcase \"PHYS\":\r\n\t\tcase \"SCED\":\r\n\t\tcase \"SM\":\r\n\t\tcase \"XGBI\":\r\n\t\t\treturn \"SM\";\r\n\t\t\r\n\t\tcase \"SWK\":\r\n\t\t\treturn \"SW\";\r\n\r\n\t\tdefault:\r\n\t\t\treturn \"NULL\";\r\n\t}\r\n}", "title": "" }, { "docid": "abf46d3d72dc3d43173b178e4de03ff0", "score": "0.55955905", "text": "function departmentList() {\n\n\t\t// empty array to store the department names into\n\t\tvar department_list = [];\n\n\t\t// store the query string into a variable to pass to connection.query()\n\t\tvar query = 'SELECT DepartmentName FROM Departments';\n\t\t\n\t\t// grab the department names\n\t\tconnect.connection.query(query, function(err, data) {\n\t\t\t\n\t\t\t// if error, throw error\n\t\t\tif (err) throw err;\n\n\t\t\t// loop through each department name returned from data\n\t\t\tvar i;\n\t\t\tvar data_length = data.length;\n\t\t\tfor (i = 0; i < data_length; i++) {\n\t\t\t\t\n\t\t\t\t// push each department name into the department_list array\n\t\t\t\tdepartment_list.push(data[i].DepartmentName);\n\n\t\t\t} // end for loop\n\n\t\t\t// call addNewProduct and pass the completed department_list array\n\t\t\taddNewProduct(department_list);\n\n\t\t}); // end connect.connection.query()\n\n\t} // end departmentList()", "title": "" }, { "docid": "af34d88ab8d46918e4f82f3bfd2532fa", "score": "0.559405", "text": "function viewDepartments(){\n connection.query(\"SELECT name FROM department\", function(err, result){\n if (err) {\n throw err \n } else {\n console.table(result);\n beginApp();\n }\n });\n}", "title": "" }, { "docid": "3b1f1109404fe9cebcadd058421bd9d6", "score": "0.5590005", "text": "function viewAllActiveEmployeesByDepartment(conn, start) {\n conn.query(`${qry_getDepartments};`, function(err, results) {\n if (err) throw err;\n inquirer\n .prompt({\n name: \"department\",\n type: \"list\",\n message: \"Select a Department\",\n choices: function() {\n var deptArray = [];\n for (var i = 0; i < results.length; i++) {\n deptArray.push(results[i].name);\n }\n return deptArray;\n }\n })\n .then(function(answer) {\n var chosenDept;\n for (var i = 0; i < results.length; i++) {\n if (results[i].name === answer.department) {\n chosenDept = results[i];\n }\n }\n conn.query(`${qry_standardEmpList}\n WHERE e.active = true\n AND d.id = ${chosenDept.id};`, function(err, results) {\n if (err) throw err;\n console.table(results);\n start();\n });\n });\n });\n }", "title": "" }, { "docid": "74527c71f111bc085b51e9c5ae64c363", "score": "0.55893457", "text": "function viewDepartment() {\n const queryDepartment = \"SELECT * FROM department\";\n connection.query(queryDepartment, (err, res) => {\n if (err) throw err;\n console.table(res);\n whatToDo();\n });\n}", "title": "" }, { "docid": "0eb64db3b053d2a42ef5f8a3bf6288a1", "score": "0.5589274", "text": "function viewDept(){\n connection.query(`SELECT name, id FROM department;`, (err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "title": "" }, { "docid": "b956aa23caea8398e14545408d039b0e", "score": "0.5588306", "text": "function findAllDepartments() {\n return connection.query(\"SELECT id AS ID, name AS Department FROM department\");\n}", "title": "" }, { "docid": "2578ea20f6506d5c04973311046260a5", "score": "0.55795544", "text": "async function viewEmployeesByDepartment() {\n const\n departmentNames = await departments.getNamesAll(),\n {departmentName} = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which department's employees would you like to view?\",\n choices: departmentNames,\n name: \"departmentName\"\n }\n ])\n \n const departmentTable = await employees.getTableByDepartment(departmentName)\n\n if (departmentTable.length) {\n showTable(departmentTable)\n } else {\n showMessage(`No employees in ${departmentName} department.`)\n promptMainMenu()\n }\n}", "title": "" }, { "docid": "393ff060ea6ac763f1ef618d2816d25a", "score": "0.5576921", "text": "function showDepartments( facult ) \n{ \n\tvar ajax = new XMLHttpRequest();\t \n\tajax.onreadystatechange = function() \n\t{\n\t\t\n\t\tif (ajax.readyState == 4) \n\t\t{\n\t\t\tif (ajax.status == 200) \n\t\t\t{\n\t\t\t\t//----------------------------------- Update goes here -----------------------------\n\t\t\t\tvar received = ajax.responseText;\t\t\t\t\t\n\t\t\t\tvar depts = received.split( ',' );\n\t\t\t\t\n\t\t\t\t$(\"#student_department\").html('');\t\n\t\t\t\t$(\"#student_department\").append('<option value=\"\">Select Department</option>' );\t\t\n\t\t\t\tfor( var i=0; i<depts.length; i++ )\n\t\t\t\t\t$(\"#student_department\").append('<option value=\"' + depts[i] + '\">' + depts[i] + '</option>' );\t\t\t\t \n\t\t\t} \n\t\t}\n\t}\n\tajax.open(\"GET\", departmentNames + facult , true);\n\tajax.send(null);\t\n}", "title": "" }, { "docid": "5d17156480329009313ecb54ca8b2fc0", "score": "0.55657667", "text": "function deplist(){\n return $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen',\n dataType:'json',\n type:'post'\n });\n }", "title": "" }, { "docid": "03cf68dcdf92631f1d146cb7ec6c2902", "score": "0.5563017", "text": "function departmentAdd() {\n return inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the department name?\"\n }\n ]);\n}", "title": "" }, { "docid": "204c5d061034d5f99d2b20bd852dca3b", "score": "0.55616647", "text": "async function viewEmployeesByDepartment() {\r\n const departments = await db.viewAllDepartments();\r\n\r\n const departmentList = departments.map(record => {\r\n return record.name;\r\n });\r\n const answer = await inquirer.prompt({\r\n name: \"department\",\r\n type: \"list\",\r\n message: \"Which department are you interested in?\",\r\n choices: departmentList\r\n });\r\n\r\n const departmentRecord = departments.find(resultEntry => {\r\n // console.log(answer.department === resultEntry.name);\r\n return answer.department === resultEntry.name;\r\n });\r\n const departmentId = departmentRecord.id;\r\n\r\n const res = await db.viewEmployeesByDepartment(departmentId);\r\n console.table(\"\", res);\r\n}", "title": "" }, { "docid": "f44129af09734173a6095878d6befdde", "score": "0.5560315", "text": "function viewDepartments() {\n db.query('SELECT * FROM department', function (err, results) {\n console.table(results);\n goPrompt();\n });\n}", "title": "" }, { "docid": "1681de899443818cbef765e9473a69a7", "score": "0.555977", "text": "function loadDept(serviceDept,deptName){\n\n\n\t$(\"#serviceDept\").val(serviceDept);\n\t$(\"#deptName\").val(deptName);\n\n\tconsole.log($(\"#servicedept\"))\n\t/*$(\"#xzbm\").appendChild(\"<input id=\\\"deptId\\\" name=\\\"deptId\\\" type=\\\"checkbox\\\" class=\\\"hidden form-check-input>\")*/\n\t// a=$(\"#deptId\").val(deptId).toString();\n\t// b=$(\"#deptName\").val(deptName).toString();\n\t// console.log(a);\n\t// console.log(b);\n}", "title": "" }, { "docid": "5285eb55e7e894ec4db5ca886de8085d", "score": "0.5554417", "text": "function queryDepartments() {\n let departments = [];\n connection.query('SELECT department_name FROM department', (error, response) => {\n if (error) throw error;\n\n response.forEach(department => {\n departments.push(department.department_name);\n })\n })\n\n return departments\n}", "title": "" }, { "docid": "14450ec5a187cd70343acc3c4ebdaad0", "score": "0.55533457", "text": "choices() {\n const choiceArray = [];\n results.forEach(({ department_name }) => {\n choiceArray.push(department_name);\n });\n return choiceArray;\n }", "title": "" }, { "docid": "d185cb4ae8942c407e682668877b7d99", "score": "0.55520916", "text": "function chooseDept(operation) {\n // Get Department data\n const sql = `SELECT * FROM department`;\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n // Store Department name in an array\n let deptNameArr = [];\n response.forEach((dept) => {\n deptNameArr.push(dept.name);\n });\n var statement;\n if (operation === \"linkrole\") {\n statement = \"assign the role\";\n }\n else { \n statement = \"remove\";\n }\n // Ask user which Department they want to remove\n inquirer\n .prompt([\n {\n name: \"deptChoice\",\n type: \"list\",\n message: \"Please select the department you would like to \" + statement + \":\",\n choices: deptNameArr,\n },\n ])\n // Fetch corresponding Department record\n .then(({ deptChoice }) => {\n response.forEach((dept) => {\n if (deptChoice === dept.name) {\n if (operation === \"remove\") {\n deleteDeptRecord(deptChoice);\n }\n // When a role is added it is linked to user selected department\n else if (operation === \"linkrole\") {\n let tempId = dept.id;\n // Link Department to Role table\n addDeptToRole(tempId);\n }\n }\n });\n });\n });\n}", "title": "" }, { "docid": "5bb8cd4935f52d860671dd9e6f957e5b", "score": "0.5544277", "text": "function viewDepartment() {\n db.query(\n \"SELECT * FROM department\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n prompt();\n }\n )\n}", "title": "" }, { "docid": "f642acd222a17c5d66a0c853057a8616", "score": "0.5537382", "text": "viewDeptIdByName() {\n return `SELECT department.id FROM department WHERE department.name = ?`;\n}", "title": "" }, { "docid": "cbe2f8c19914126bc506566300da85ae", "score": "0.5522161", "text": "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "title": "" }, { "docid": "6e1c5891306267470f59db62fb72d1a2", "score": "0.54972416", "text": "async function viewEmployeesByDepartment() {\n const departments = await db.findAllDepartments();\n const departmentChoices = departments.map(function ({\n id,\n name\n }) {\n return ({\n name: name,\n value: id\n });\n });\n const {\n departmentId\n } = await prompt([{\n type: \"list\",\n name: \"departmentId\",\n message: \"Which department would you like to see employees for?\",\n choices: departmentChoices\n }]);\n const employees = await db.findAllEmployeesByDepartment(departmentId);\n console.log(\"\\n\");\n console.table(employees);\n startPrompt();\n}", "title": "" }, { "docid": "cda8d6c4011b558101ba9d9867f6d20f", "score": "0.5494407", "text": "function departmentFilterBinding(){\n var selector = thisInstance.constants.selector;\n $(selector.departmentFilter).change(function(){\n var value = $(this).val();\n fetchAndLoadUserList({department: value});\n });\n }", "title": "" }, { "docid": "797c13243749ced9cbd543dc2176337a", "score": "0.54920924", "text": "function addDepartment() {\n inquirer.prompt(deptQuestions).then(function(answer) {\n addNewDept(answer.department, answer.overheadcosts);\n });\n}", "title": "" }, { "docid": "a392f8a71a3d458ea67a1f60fd26a2a6", "score": "0.54859424", "text": "getEmpByDepartment (callInitiateApp) {\n const sql = `SELECT a.id AS 'Employee Id',\n a.first_name AS 'First Name',\n a.last_name AS 'Last Name',\n departments.name AS Department\n FROM employees a\n left JOIN roles\n ON a.role_id = roles.id\n left JOIN departments\n ON roles.department_id = departments.id\n WHERE departments.id = ?\n ORDER BY a.id` ;\n //console.log(this.data);\n\n db.query ('SELECT id FROM departments WHERE name = ?', this.data, (err, row) => {\n if (err)\n {\n console.log({error : err.message});\n return;\n }\n //console.log ('result', row[0].id);\n let deptId = row[0].id;\n db.query (sql, deptId, (err, result) => {\n if (err)\n {\n console.log({error : err.message});\n return;\n }\n //console.log(result);\n console.table (result);\n console.log (`${COLOR.fgGreen}========================================================${COLOR.reset}`);\n callInitiateApp();\n \n });\n })\n \n }", "title": "" }, { "docid": "a5309c32010d9c2f57590e3b44d897a7", "score": "0.5485016", "text": "function viewDept() {\n connection.query(\n \"SELECT deptid as DeptId, name as Department, CONCAT(e.first_name, ' ', e.last_name) as Employee, title as Title, salary as Salary, CONCAT(m.first_name, ' ', m.last_name) as Manager FROM department LEFT JOIN roles ON department.deptid = roles.department_id LEFT JOIN employee e ON roles.roleid = e.role_id LEFT JOIN employee m ON m.empid = e.manager_id ORDER BY deptid\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "title": "" }, { "docid": "3280b7c9c6d6eb6e16cd3ffed6c2faf9", "score": "0.54846716", "text": "addDepartment (dpt) {\n return this.connection.query(\n `INSERT INTO department SET ? ${dpt}`\n )\n }", "title": "" }, { "docid": "2bdae4273e7624cce69d3dfd1648b111", "score": "0.54685664", "text": "loadDepartments() {\n let getDepts = (departments) => {\n this.setState({departments: departments});\n };\n api.getDepartments(getDepts);\n }", "title": "" }, { "docid": "889eb373985d0598746c6f86abe6d0e3", "score": "0.5448658", "text": "function loadDepartment(type, id, element) {\n //$( \"#loader\" ).show();\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: 'index.php?r=department/load&id='+id,\n\t\t\tdataType : 'json',\n\t\t\tsuccess:function(data) {\n\t\t\t\tif (data) {\n\t\t\t\t\tli = element.append(\"<ul class='Container Department'></ul>\");\t\t\t\n\t\t\t\t\t$.each(data, function(index, element){\n\t\t\t\t\t\tl_class = (index == (data.length-1))?\"IsLast\":\"\";\n\t\t\t\t\t\tul = li.find('ul');\t\t\t\t\t\t\n\t\t\t\t\t\tn_div = $(\"<div class='Expand'></div>\");\n n_b = $(\"<div class='tree-menu-button-department'><a href='#'></a></div>\");\n\t\t\t\t\t\tn_content = $(\"<div class='Content'><a id='depart-\"+this.id_department+\"' href='index.php?r=department/show&id=\"+this.id_department+\"'>\"+this.name+\"</a></div>\");\n\t\t\t\t\t\tnode = $(\"<li id=depart-\"+this.id_department+\" class='Node ExpandClosed \"+l_class+\"'></li>\")\n .append(n_div)\n .append(n_b)\n\t\t\t\t\t\t\t.append(n_content);\n\t\t\t\t\t\tul.append(node);\n\t\t\t\t\t});\n\t\t\t\t}\t\t\t\t\n\t\t\t},\n\t\t\tfailure: function() {\n alert(\"Ajax request broken\");\n }\n /*complete: function() {\n $( \"#loader\" ).hide();\n }*/\n\t\t});\n\t}", "title": "" }, { "docid": "acd509a32682b41222f6c5fb805fd0e3", "score": "0.54483384", "text": "printDept() {\n // get department information\n dbFunctions.viewDepartments()\n // show results in console\n .then((results) => {\n console.table(results)\n startManagement()\n })\n }", "title": "" }, { "docid": "ae1586252532f6b4a073f6cdbeca2605", "score": "0.5444188", "text": "function cmbdepartemen(){\n $.ajax({\n url:dir2,\n data:'aksi=cmbdepartemen',\n dataType:'json',\n type:'post',\n success:function(dt){\n var out='';\n if(dt.status!='sukses'){\n out+='<option value=\"\">'+dt.status+'</option>';\n }else{\n $.each(dt.departemen, function(id,item){\n out+='<option value=\"'+item.replid+'\">'+item.nama+'</option>';\n });\n //panggil fungsi viewTB() ==> tampilkan tabel \n viewTB(dt.departemen[0].replid); \n }$('#departemenS').html(out);\n cmbtahunajaran(dt.departemen[0].replid);\n }\n });\n }", "title": "" }, { "docid": "14a825adc913c38622947688b95aa09a", "score": "0.5439671", "text": "function selectSalesDepartment (id, name) {\n\t$(\"#dropdownMenuButtonDepartment\").text(name);\n\t\n\tif (name == '') {\n\t\t$(\"#dropdownMenuButtonDepartment\").text('Alle avdelinger');\n\t\t$(\"#resetbtn\").fadeOut();\n\t} else {\n\t\t$(\"#resetbtn\").fadeIn();\n\t}\n\tconsole.log(filterOptions[2]);\n\n\tif (filterOptions[2] == '4190527') {\n\t\tfilterOptions[3] = 'Malmø';\n\t\t$(\"#dropdownMenuButtonDepartment\").text('Malmø');\n\t} else {\n\t\tfilterOptions[3] = name;\n\t}\n\t\n\t$('#table-filter-input').val(filterOptions[0] + \" \" + filterOptions[1] + \" \" + filterOptions[2] + \" \" + filterOptions[3]);\n\t\n\tvar inputFilter = document.getElementById('table-filter-input');\n\t\tinputFilter.addEventListener('input', function() {\n\n\t})\n\tinputFilter.dispatchEvent(new Event('input'));\n\t\n\tgetStats();\n}", "title": "" }, { "docid": "b0058b07e0cdd903f4b1d53c852549a0", "score": "0.54352057", "text": "function loadDepsSelector(tx) \n{\t\n\tsql = \"SELECT department, COUNT(*) AS count FROM members GROUP BY department\";\n tx.executeSql\n (\n \tsql, \n \t\tundefined, \n\t \tfunction (tx, result)\n\t \t{\n\t \t\tfor (var i = 0; i < result.rows.length; i++) \n\t {\n\t \t\t\t$(\"#select-department\").append(\"<option value=\" + result.rows.item(i).department.replace(/\\s+/g,\"_\") \n\t \t\t\t\t\t\t\t\t\t\t\t+ \">\" + result.rows.item(i).department + \"</option>\");\n\t\t\t}\n\t\t\t$(\"#select-department\").selectmenu().selectmenu(\"refresh\"); \n\t }, \n\t dbTxError);\n\t \n\tdb.transaction(loadChargesSelector, dbTxError);\n}", "title": "" }, { "docid": "df78caf0081fa66d751f618a311af4d6", "score": "0.5431992", "text": "findByDept(numDept) {\n let sqlRequest = \"SELECT * FROM activite WHERE code_du_departement=$numDept\";\n let sqlParams = {$numDept: numDept};\n return this.common.run(sqlRequest, sqlParams).then(rows => {\n let activite = [];\n for (const row of rows) {\n activite.push(new Activite(row.code_du_departement, row.libelle_du_departement, row.nom_de_la_commune, row.numero_de_la_fiche_equipement, row.nombre_dEquipements_identiques, row.activite_libelle, row.activite_praticable, row.activite_pratiquee, row.dans_salle_specialisable, row.niveau_de_lActivite, row.localisation, row.activite_code));\n }\n return activite;\n });\n }", "title": "" }, { "docid": "51ef541dfc355e5be9f677fcb51c62f2", "score": "0.5423666", "text": "function updateDepartments()\n{\n var departments = $(\"#department\");\n departments.html(\"\");\n departments.append($(\"<option></option>\").text(\"Select a department\"));\n for (var i = 0; i < this.departments.length; i++)\n {\n departments.append($(\"<option></option>\").text(this.departments[i]));\n }\n}", "title": "" }, { "docid": "2f556d2cc2819a71dff0db68fc5e36cb", "score": "0.5421877", "text": "function viewEmpDept() {\n connection.query(\"SELECT name FROM department\", function (err, res) {\n if (err) console.log(err);\n const departments = [];\n res.forEach((department) => {\n departments.push(department.name);\n });\n inquirer\n .prompt([\n {\n type: \"list\",\n message: \"Which department would you like to view?\",\n choices: departments,\n name: \"chosenDept\",\n },\n ])\n .then(function (response) {\n connection.query(\n `SELECT e.id, e.first_name, e.last_name, role.title, department.name AS department, role.salary, CONCAT(m.first_name, \" \" , m.last_name) AS manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id INNER JOIN role ON e.role_id = role.id INNER JOIN department ON role.department_id = department.id WHERE department.name = \"${response.chosenDept}\"`,\n function (err, res) {\n if (err) throw err;\n console.table(res);\n main();\n }\n );\n });\n });\n}", "title": "" }, { "docid": "190e591f52050824a5079d6342c3ddec", "score": "0.5413297", "text": "function viewAllDept() {\n console.log('viewAllDept');\n connection.query('SELECT * FROM department', (err, res) => {\n if (err) throw err;\n console.table(res);\n userSelect()\n })\n}", "title": "" }, { "docid": "6d5981af06e5197b64282d8b72466ba4", "score": "0.54060733", "text": "function seeEmployeesByDepartment(){\n //pulls in list of departments for user to choose from\n db.viewAllDepartments().then(([res]) => {\n \n\n prompt([\n {\n type: \"list\",\n name: \"choices\",\n message: \"Which department would you like to see?\",\n choices: res\n }\n ]).then(res => {\n let param = res.choices;\n // query that filters out the employees not in the department of choice\n db.selectAllEmployeesByDepartment([param]).then(([res])=> {\n console.table(res)\n loadMainPrompt();\n })\n })\n \n })\n}", "title": "" }, { "docid": "20bf8611f9e699e9ea905dc6466ba182", "score": "0.53969854", "text": "function viewDepartments() {\n \n let query =\n \"SELECT department.id, department.dept_name FROM department\";\n return connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "title": "" }, { "docid": "373f94c1a025d1eae7db0dc9ff70f655", "score": "0.5386621", "text": "readAllDepartments() {\r\n return this.connection.query(\r\n \"SELECT department.id, department.name, SUM(role.salary) AS utilized_budget FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id GROUP BY department.id, department.name;\"\r\n );\r\n }", "title": "" }, { "docid": "a7a700f30eccc35186d6b5cd9d7e1a42", "score": "0.5385921", "text": "function viewEmployeeDepartment() {\n\n var query =\n `SELECT d.id AS department_id, d.name AS department, e.first_name, e.last_name, r.salary\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id\n ORDER BY d.id`\n\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n console.table(res); \n init(); \n \n });\n}", "title": "" }, { "docid": "cc2c110ca16bd14a49300803d1008ba7", "score": "0.5381668", "text": "function getDepartments(products) {\n var departments = [];\n for (var i = 0; i < products.length; i++) {\n if (departments.indexOf(products[i].department_name) === -1) {\n departments.push(products[i].department_name);\n }\n }\n return departments;\n}", "title": "" }, { "docid": "9d31cf59f75d922a6c5696ef71253984", "score": "0.5379469", "text": "function viewAllDepartments() {\n connection.query(\n 'SELECT d_id AS id, name AS department_name FROM department ORDER BY d_id ASC;',\n function (err, results) {\n if (err) throw err;\n console.table(results);\n backMenu();\n }\n );\n}", "title": "" }, { "docid": "6c7e91a1c60663044723b8a41f83e987", "score": "0.5370733", "text": "function addDepartment() {\n let question = \"Name of Department to add.\"\n Inquirer.prompt(\n {\n name: \"department\",\n type: \"input\",\n message: question\n }\n ).then((data) => {\n department.insertDepartment(data.department);\n init();\n });\n}", "title": "" }, { "docid": "f8a64557cada599e71d9d010fd8cfab6", "score": "0.53701466", "text": "viewDepartmentIdByName() {\n return `SELECT department.id FROM department WHERE department.name = ?`;\n}", "title": "" }, { "docid": "c0a68646243cc70c50c4203d4976aef7", "score": "0.53683776", "text": "function viewBudget(chosenDepart) {\n\n begin.con.query(\n 'SELECT * FROM role where ?',[{department_id:chosenDepart}], (err, res) => {\n const roleId = res.map(t => t.id)\n const roleSal = res.map(t => t.salary)\n\n viewBudget2(roleId, roleSal)\n }\n\n \n )\n}", "title": "" } ]
455f49f686ed2e7ec579e866b2ce732d
Starts the game after hitting the start button
[ { "docid": "1de14086d26efe97025300b39344fe6b", "score": "0.0", "text": "function startGame() {\n // Submit answer when user presses enter\n userInput.addEventListener(\"keyup\", function (event) {\n if (event.key == \"Enter\") {\n // Trigger the button element with a click\n document.getElementById(\"submit_button\").click();\n }\n });\n // Exit module when user presses escape\n document.addEventListener(\"keyup\", function (event) {\n if (event.key == \"Escape\") {\n // Trigger the button element with a click\n document.getElementById(\"back_button\").click();\n }\n });\n\n document.getElementById(\"pre_game_module\").style = \"display: none;\"; // Hide pre-game screen\n gameActive = true;\n timer();\n}", "title": "" } ]
[ { "docid": "cc5f1542e20dc89121e7d8a902814e5f", "score": "0.83361185", "text": "start() {\n this.started = true;\n this.initGame();\n this.showStopButton();\n this.showTimerAndScore();\n this.startGameTimer();\n sound.playBackground();\n }", "title": "" }, { "docid": "99418a3e122ed71663ce1ef2b648fc57", "score": "0.826936", "text": "function start() {\n startGame(event);\n}", "title": "" }, { "docid": "5584661b3748eb9a31e0d8d3764a8755", "score": "0.8233642", "text": "function startGame() {}", "title": "" }, { "docid": "5584661b3748eb9a31e0d8d3764a8755", "score": "0.8233642", "text": "function startGame() {}", "title": "" }, { "docid": "5831f336bbbdb20d307c1b89af30aced", "score": "0.81659096", "text": "function gameStart() {\n\n if (gameStartCheck === 0) {\n disableAllButtons();\n removeGameHolderAudio();\n removeGameHolder();\n game1.zeroState();\n installGamePackage()\n }\n}", "title": "" }, { "docid": "eab0f9ea6c7fead81da5d28c02660e3a", "score": "0.81242716", "text": "function startGame() {\n console.log('start yo!');\n myGameArea.start();\n swSong.play();\n }", "title": "" }, { "docid": "d6640a2a6c879fc1394a0ac6f94911d9", "score": "0.8114872", "text": "function start(){\n\t\t$('.start').on('click', function(){\n\t\t\t$(this).hide();\n\t\t\trunGame1();\n\t\t});\n\t}", "title": "" }, { "docid": "1207ceb03ab8cf83af23e4219451918c", "score": "0.8036127", "text": "start() {\r\n if (this.gameState == gameStateEnum.LOADING) {\r\n alert(\"Board is loading. Don't forget to open SICStus server!\");\r\n } else if (this.gameState == gameStateEnum.MENU) {\r\n //makes sure the camera is where it should start\r\n this.setPlayer1View();\r\n this.gameState = gameStateEnum.PLAYER_CHOOSING;\r\n this.currentPlayer = playerTurnEnum.PLAYER1_TURN;\r\n this.deselectAll();\r\n this.scoreboard.reset();\r\n this.moves = []; //reset moves\r\n } else {\r\n this.reset();\r\n alert(\"Restarting game! Press Start again to begin\")\r\n }\r\n }", "title": "" }, { "docid": "cda9688327d969ea4116b374686ef4c4", "score": "0.8028053", "text": "function start() {\n if (!gameStarted) {\n nextSequence();\n gameStarted = true;\n }\n}", "title": "" }, { "docid": "3bc4dfdb244eb7cc000020515ba0b9a9", "score": "0.8011757", "text": "function startGame() {\n kill();\n game.init();\n sequence();\n }", "title": "" }, { "docid": "8503bcffcb51949aa79e7f2f3abe62c2", "score": "0.78844744", "text": "function StartGame () {}", "title": "" }, { "docid": "2731d9a20832a026ab4b2b83a45c57eb", "score": "0.7869019", "text": "start() {\n // Only exposed function in module--starts the game.\n this._initialize();\n this._addListeners();\n setTimeout(this._gameLoop(), 0);\n setTimeout(this._renderLoop(), 0);\n }", "title": "" }, { "docid": "5e93530df691ca6db27e432f6240626b", "score": "0.7856912", "text": "function startGame() {\r\n isFirstClick = false;\r\n gGame.isOn = true;\r\n addMines();\r\n getTime();\r\n}", "title": "" }, { "docid": "4ae9dd26b0fe153667b83216bdf71204", "score": "0.78425807", "text": "function startGame () {\n showScreen('game')\n sound.game()\n nextTurn()\n}", "title": "" }, { "docid": "004f27b9fe751c71f0f13cd1f2d8a077", "score": "0.7780829", "text": "function startGame() {\n resetGame();\n var startButton = document.getElementById('start');\n startButton.style.display = 'none';\n isHumanAlive = true;\n pid = setInterval(step, SPEED);\n}", "title": "" }, { "docid": "67d8e58c8a75c8f2d0c61a1cf736414e", "score": "0.77506584", "text": "function start(){\n\tclearInterval(waitScreen);\n\tclearInterval(go);\n\tresetGame();\n\tinterval();\t\n}", "title": "" }, { "docid": "80181dafb2b9331ed3b17c1be7943634", "score": "0.7742138", "text": "function handleStartClick() {\n destroyIntroScreen();\n buildGameScreen(language);\n music.pause();\n }", "title": "" }, { "docid": "2048ab29f6e0b382d804be7447a3f487", "score": "0.77375406", "text": "function RequestStart() {\n GameStateMachine.start();\n}", "title": "" }, { "docid": "ba2dd301eda99498db16b8cb4e3cca9f", "score": "0.77303904", "text": "_startGame () {\n\tthis.game.state.start('game');\n }", "title": "" }, { "docid": "98ab54492dd7142b2c420cc3e4797677", "score": "0.7730063", "text": "function startPress() {\n var startButton = document.getElementById('start');\n startButton.style.display = 'none';\n players[0] = true;\n players[1] = (playerOption === 2);\n inputMode = inputModes.BUSY;\n newGame();\n}", "title": "" }, { "docid": "c4a468be047eb7f7963edbd661b101bb", "score": "0.7708721", "text": "function startGame() {\n theme.play();\n shuffleQuestions();\n displayQuestion();\n }", "title": "" }, { "docid": "d0e9ce87de3beca896ae81fab42cb4ed", "score": "0.7698525", "text": "startGame() {\n this.vp.pauseMenu.fadeIn = null;\n this.fadeOut = new Date().getTime();\n this.vp.world = new World(this.vp);\n this.vp.world.setPlayer(this.states.char);\n switch (this.states.gameType) {\n case \"standard\":\n this.vp.world.startStage(this.states.stage, this.states.difficulty);\n this.resetLocation();\n break;\n case \"extra\":\n this.vp.world.setPlayer(this.states.char);\n this.vp.world.startExtra(4);\n break;\n case \"spell\":\n this.vp.world.startSpellPractice(this.states.difficulty, this.states.spell);\n break;\n }\n }", "title": "" }, { "docid": "7af56737cd8b5c1ec5cec156c924d4cd", "score": "0.7686281", "text": "startClick () {\n /**\n * start the 'play' state\n */\n this.game.state.start('play')\n }", "title": "" }, { "docid": "bc3e1eb585aada9d7e4ed41b5e2c04fd", "score": "0.76649916", "text": "function startGame() {\n start.style.display = 'none';\n game.style.display = 'block';\n\n createEnemy();\n playerControl();\n heartCreated();\n}", "title": "" }, { "docid": "19b328828cc6e5f33c76d36731db8e25", "score": "0.76591295", "text": "function startGame() {\n removeSplashScreen();\n removeGameOverScreen();\n\n game = new Game();\n game.gameScreen = createGameScreen();\n\n // Start the game\n game.start();\n\n // End the game\n game.passGameOverCallback(gameOver);\n }", "title": "" }, { "docid": "8c0da8dedd050100590fe06788588f74", "score": "0.76418966", "text": "function startGame() {\n \n}", "title": "" }, { "docid": "439217334f20e7b6cba3b699c049578f", "score": "0.76333946", "text": "function startGame(){\n initElements();\n activateClick();\n}", "title": "" }, { "docid": "5a5d918794b92b9124ea2716e7580b47", "score": "0.76285005", "text": "function startGame(){\n if(gameDC != null & gameDC.readyState == \"open\"){\n\tcheckersGame.addClickHandlers();\n startGameButton.style.visibility = \"hidden\"\n\tcheckersGame.initGame(\"black\",sendCheckersUpdate,sendCheckersCapture);\n\tgameDC.send(JSON.stringify({type:\"start\"}));\n }\n}", "title": "" }, { "docid": "8cf0bd66df0db39431ba149286502700", "score": "0.76103246", "text": "startGame(){\n\n\n\n}", "title": "" }, { "docid": "0e0a26411df74bd9a4fa8299530fe7d4", "score": "0.7585579", "text": "function start() {\n\t\t\t// call function to add X and O box listeners\n\t\t\taddXandOListeners(); // begin game\n\n\t\t\t// call function to setup reset listener\n\t\t\taddResetListener(); // end game to start again\n\t\t\t// removeXandOListeners(); // this removes them on but it should not be in the start function\n\t\t}", "title": "" }, { "docid": "664a213cee2c6b8a4dda6ddb82991817", "score": "0.75809103", "text": "function startGame() {\n showMenu(tree);\n }", "title": "" }, { "docid": "c3e3955e4035b97964521f989cb386c1", "score": "0.7577641", "text": "function startGame(){\n\t\tresizeWebv();\n\t\twindow.addEventListener('resize', function(){\n\t\t\tresizeWebv();\n\t\t});\n\t\tcurtain.classList.add('on');\n\t\tscoreBox.classList.add('on');\n\t\tscoreBox.innerHTML = templates.landingScreen;\n\t\tdocument.addEventListener('click', function(){\n\t\t\tif(event.target.id === 'newGame' || event.target.id === 'resetGame'){\n\t\t\t\t\tif(event.target.id === 'newGame'){\n\t\t\t\t\t\tscoreBox.classList.remove('on');\n\t\t\t\t\t\tcurtain.classList.remove('on');\n\t\t\t\t\t}\n\t\t\t\t\tfirstLoad = true;\n\t\t\t\t\tstartPage = undefined;\n\t\t\t\t\tendPage = undefined;\n\t\t\t\t\tenableBack = false;\n\t\t\t\t\tgameController.clearClicks();\n\t\t\t\t\tartHeader.innerText = '';\n\t\t\t\t\tinit();\n\t\t\t}\n\t\t\tif(event.target.id === 'rulesButton'){\n\t\t\t\tscoreBox.innerHTML = templates.rulesScreen;\n\t\t\t}\n\t\t\tif(event.target.id === 'toMainMenu'){\n\t\t\t\tscoreBox.innerHTML = templates.landingScreen;\n\t\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "bd550ec02c9f8fa4a4b6f0c681dda5a7", "score": "0.75722384", "text": "function initialStart(){\n\n\t\t\t// Removes button that begins game\n\t\t\t\tdocument.getElementById(\"main\").removeChild(document.getElementById(\"chooseGameOptions\"));\n\n\t\t\t// Displays game parameters to be chosen.\n\t\t\t\tchooseGameOptions();\n\t\t}", "title": "" }, { "docid": "69c461ee505382ba17c107d6d21a0a34", "score": "0.75634056", "text": "function startGame () {\n document.getElementById('game').classList.remove('hidden');\n document.getElementById('startPage').classList.add('slideToTop');\n document.getElementById('startGame').classList.add('started');\n gameLoop.start();\n soundTrack.play();\n createIntroScene();\n}", "title": "" }, { "docid": "ec2049a5a975b1bd81de8d2895dfca8c", "score": "0.753741", "text": "function showStart() {\r\n $screen.fadeIn(2000);\r\n\r\n const $startButton = $('.start-button');\r\n $startButton.on('click', startGame);\r\n}", "title": "" }, { "docid": "8db635be43c58462ccf199c476862e13", "score": "0.7532415", "text": "startGame(){\n this.player = 0; // brown\n this.scene.camera = this.scene.cameraBrown;\n this.board.pickable = true;\n this.started = true;\n if(this.scene.orange) {\n this.scene.camera.orbit([0,1,0], Math.PI);\n this.scene.orange = false;\n }\n }", "title": "" }, { "docid": "f1dd06a31799b98615dc332e3d1ef931", "score": "0.7532238", "text": "function startGame(){\n \n}", "title": "" }, { "docid": "8ebc21ff19633aa49f6ade0516217758", "score": "0.7526563", "text": "function hndStartButton() {\n sound.playBackgroundMusic(true);\n f.Loop.start(f.LOOP_MODE.TIME_REAL, 60);\n f.Loop.addEventListener(\"loopFrame\" /* LOOP_FRAME */, update);\n setGameState(\"Running\");\n timescore = new Dodge.TimeScore();\n enemieOne.startIncreasingSpeed();\n startSettingTraps();\n startPlacingCoins();\n //remove focus on button\n startBtn.blur();\n startBtn.disabled = true;\n }", "title": "" }, { "docid": "cfa05e593d63e83e3a9387c06efcd844", "score": "0.75259036", "text": "function startGame() {\n\n\t\t\tvar p = player;\n\t\t\tvar g = GLOBAL;\n\t\t\t// game loop\n\t\t\t\n\t\t\t// TODO: stop key added\n\t\t\tGLOBAL.STOPKEY = window.setInterval(function () {\n\t\t\t\tController.update(p);\n\t\t\t\tView.draw(p);\n\t\t\t}, 1000 / g.FPS);\n\t\t\t//console.log(GLOBAL.STOPKEY);\n \t \t// TODO: sound on/off\n\t\t\t//g.SOUND.play(\"backgroundMusic\", 0, true);\n \t \t//Controller._gameOver();\n\t\t}", "title": "" }, { "docid": "100f467aa0c4901ca256e61f15c8e461", "score": "0.7524808", "text": "function startGame() {\n\tconsole.log(gameState);\n\tvar startState = findState(\"1\");\n\tcurrentState = startState;\n\trenderState(startState);\n}", "title": "" }, { "docid": "41128a5ce81e540da8e5a93ec24c7bf7", "score": "0.7504404", "text": "function startGame (){\n game = new Game(scene, map);\n game.init();\n}", "title": "" }, { "docid": "5f471e86645fb9e68cfce3a5563eedb6", "score": "0.7499736", "text": "start() {\n this.setVisible(true);\n this.youWinImage.setVisible(false);\n this.youLoseImage.setVisible(false);\n this.playAgainButton.setVisible(false);\n this.startButton.setVisible(false);\n this.snowPal.reset();\n this.incorrectGuesses = 0;\n this.word.generateNewWord();\n this.updateCanvasState();\n }", "title": "" }, { "docid": "f5b8bc28a072dbd9efa384bd272c0bd8", "score": "0.74934953", "text": "function startGame() {\n removeSplashScreen();\n createGameScreen();\n\n game = new Game();\n game.gameScreen = gameScreen;\n game.start();\n}", "title": "" }, { "docid": "da1a4d042a347cedecefeefc3fb9b0c6", "score": "0.74926347", "text": "function gameStart() {\n fallingPiecesGo();\n startStopTimer();\n livesAtStart();\n pointsAtStart();\n loadPieces();\n gameImagesGood();\n gameImagesBad();\n }", "title": "" }, { "docid": "6f857d5829960b9094a7a7029d85af3f", "score": "0.74836284", "text": "function Start() {\n console.log(\"%c Game Started!\", \"color: blue; font-size: 20px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = config.Game.FPS;\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n currentSceneState = scenes.State.NO_SCENE;\n config.Game.SCENE = scenes.State.START;\n }", "title": "" }, { "docid": "e9420efb95a05dc328c149d678c3d129", "score": "0.7483466", "text": "function start()\n{\n // simple prompt to set players' names\n players.p1.name = \"Your\";\n // players.p2.name = prompt('Name for ' + players.p2.name);\n \n // starts the game\n game.gameStarted = true;\n game.setTurn(players.p1, false);\n\n ctx.save();\n ctx.translate(-300, -300); // fixes the canvas position\n ctx.save();\n}", "title": "" }, { "docid": "455df2a67f8deb6a1ffbf82957027c30", "score": "0.74833536", "text": "function startGame() {\n removeSplashScreen();\n // later we need to add clearing of the gameOverScreen\n removeGameOverScreen();\n\n game = new Game();\n game.gameScreen = createGameScreen();\n game.start();\n\n // End the game\n game.passGameOverCallback(function() {\n gameOver(game.score, game.level);\n });\n }", "title": "" }, { "docid": "6797a84e3a8f756202f477128e99db64", "score": "0.7478445", "text": "function start() {\n isActive = true;\n respawn();\n onframe();\n }", "title": "" }, { "docid": "2b67ecaccb75ae1b2f6ebc935fa8c3aa", "score": "0.7470086", "text": "function startGame(){\n\t\t$(\"#start-btn\").on(\"click\",function() {\n\t\t\t$(\"#start\").hide();\n\t\t\t$(\"#trivia-questions\").show();\n\t\t\tdisplayQuestions();\n\t\t\tintervalId = setInterval(qTimer, 1000);\n\t\t});\n\t}", "title": "" }, { "docid": "a96784b6d62817246ae9cd6621cca5e3", "score": "0.74613774", "text": "function startGame() {\n\t\t$('.firstScreen').css('visibility', 'hidden');\n $('.gameOverScreen').css('visibility', 'hidden');\n $('.gamePageScreen').show();\n $('.scoreScreen').css('visibility', 'visible');\n\t\t$direction = \"right\";\n\t\tsnake();\n\t\telement();\n gameInterval();\n $cellSize = 20;\n\t\t$score = 0;\n speed = 180;\n }", "title": "" }, { "docid": "4e1adf0e4231052f1210d2f382b4ad5e", "score": "0.74569136", "text": "function startGame() {\n page = \"play\";\n frame = 0; // The frame counter\n player = new Player();\n fruitAndVegs = [];\n showInfo = false;\n showInfoCounter = 0;\n}", "title": "" }, { "docid": "1af588826cbb92d624738ace2376fc32", "score": "0.7455646", "text": "function start() {\n startMove = -kontra.canvas.width / 2 | 0;\n startCount = 0;\n\n audio.currentTime = 0;\n audio.volume = options.volume;\n audio.playbackRate = options.gameSpeed;\n\n ship.points = [];\n ship.y = mid;\n\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\n showTutorialBars = true;\n isTutorial = true;\n tutorialScene.show();\n}", "title": "" }, { "docid": "2f0ed43cf837afd1d0e0a9b97c4f9fd0", "score": "0.7451842", "text": "function startGame() {\n shuffleInputs(inputs);\n initGame();\n initTimer();\n toggleButton();\n}", "title": "" }, { "docid": "d8c7f7fac0de1fdd311b35010c869eb9", "score": "0.74502623", "text": "function start(){\n console.log(players[playerTurn] + ' start');\n turnBegin(playerIcon[players[playerTurn]]);\n $('#start').hide();\n }", "title": "" }, { "docid": "85f8b2ad1b4193924ee7d488ce89879c", "score": "0.74469644", "text": "function startGame() {\n\tinitGlobals();\n\n\t//set the game to call the 'update' method on each tick\n\t_intervalId = setInterval(update, 1000 / fps);\n}", "title": "" }, { "docid": "70d3feb29803980d29825ebe8378a832", "score": "0.74328387", "text": "function start (){\n var startButton = document.querySelector('.start');\n startButton.innerText = 'restart game';\n clearInterval(gMyInterval);\n gState.numberOfNotes = 0;\n gState.sequence = [];\n gState.turn = 'computer';\n printToSpan('yourScore','Your Score: '+gState.numberOfNotes);\n initGame();\n}", "title": "" }, { "docid": "11de512d5a796bb4515c831e46d7482c", "score": "0.7431988", "text": "function start() {\n playSound(\"advance\");\n prepareNewGame();\n} // Start button clicked", "title": "" }, { "docid": "16b739f74fef429dc183cba2ac3c52c8", "score": "0.7427783", "text": "function gameStart(){\n startTimer();\n toggleEnemyGeneration(true);\n playMusic();\n paintAgent();\n isWaitingAnswer = false;\n $('body').css('cursor', 'none');\n}", "title": "" }, { "docid": "06b58d0e8c167ba0ba1aa77997f0c7f0", "score": "0.7427764", "text": "function start() {\n // If the distance between mouse position and\n // the start button was less than the button size rest the following values and functions\n if (dist(mouseX, mouseY, startButton.x, startButton.y) < startButton.Size / 2) {\n playing = true;\n startIt = true;\n leftPaddle.Score = 0;\n rightPaddle.Score = 0;\n victoryBall.w = 0;\n setupVicBall();\n setupRestart();\n }\n}", "title": "" }, { "docid": "7ac6c591aac10614d10f36d4142caca4", "score": "0.74250346", "text": "function start_game() {\n running = true;\n do_a_question();\n}", "title": "" }, { "docid": "45323dca282bb98a6364d95964d55407", "score": "0.7420173", "text": "function startGame() {\n // Reset variables, turn off any sounds\n correctSequence = [];\n resetPlayer();\n checked = false;\n click = -1;\n round = 0;\n stopAudio();\n // Call first random light\n generateLight();\n }", "title": "" }, { "docid": "5ecb7d7806b03e4b7b6adfd45d20f5e4", "score": "0.74195045", "text": "function startGame() {\n\tif (game) {\n\t\treturn;\n\t}\n\tgame = true;\n\tclearScreen();\n\tsequence = [];\n\tincreaseSequence();\n\tcurrentPosition = 0;\n\tdocument.getElementById('scoreText').innerHTML = \"Current round: \";\n\tdocument.getElementById('scoreScore').innerHTML = sequence.length-1;\n\tupdateHighscore();\n\tvar startStatus = document.getElementById('startStatus');\n\tstartStatus.disabled = true;\n\tplaySequence();\n}", "title": "" }, { "docid": "60e1da7b68e9538b9a667ade541e976e", "score": "0.7405579", "text": "function Start() {\n console.log(\"%c Game Started\", \"color: blue; font-size:20px;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = 60; // declare the framerate as 60FPS\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n Main();\n }", "title": "" }, { "docid": "75e5f3c14bb35cf1866bf299be4555a3", "score": "0.74047124", "text": "processStartButton() {\n\t\tclearTimeout(this.timer);\n\t\tthis.game.switchScreens('play');\n\t}", "title": "" }, { "docid": "b4c8a40b6fbe87f6cc20df6f231ae49d", "score": "0.74043787", "text": "function startNewGame(){\n\tbackToGame();\n\tstartGame();\n}", "title": "" }, { "docid": "52e095f8ddcb077bb6837948df8789f7", "score": "0.74041396", "text": "function startGame() {\r\n if (!isPlaying) {\r\n init();\r\n startGameBtn.classList.add(\"d-none\");\r\n stopGameBtn.classList.remove(\"d-none\");\r\n chooseLevel.disabled = true;\r\n // playAudio(startingSound);\r\n renderNewQuote();\r\n } else {\r\n }\r\n}", "title": "" }, { "docid": "836fb797277fc13911ea661d867615cc", "score": "0.7402803", "text": "function startGame() {\n\t\tif (gameStarted) {\n\t\t\treturn;\n\t\t}\n\t\tcurrent = 0;\n\t\tanswersRight = 0;\n\t\tquestionNumber = 1;\n\t\t$(\"#score\").text(answersRight + \"/10\");\n\t\t$(\".choices\").show();\n\t\tdisplayQuestion();\n\t\t$(\"#timer\").show();\n\t\t$(\"#score\").show();\n\t\ttimer.startTimer();\n\t\tgameStarted = true;\n\t}", "title": "" }, { "docid": "417c9a172c9f1b34a3e5f625a80fb0c9", "score": "0.7395223", "text": "function start() {\n if (!isGameOver) {\n createPlatforms();\n createDoodler();\n setInterval(movePlatforms, 30);\n jump();\n document.addEventListener('keyup', control);\n }\n }", "title": "" }, { "docid": "1a62efd2ddd3c1028357b9f15adc54d3", "score": "0.7385005", "text": "function start() {\n if(!isGameOver) {\n createPlatforms()\n createDoodler()\n setInterval(movePlatforms, 30)\n jump()\n document.addEventListener('keyup', control)\n }\n }", "title": "" }, { "docid": "02e06dcd9ccf0dbee03788616c38ccfe", "score": "0.7383844", "text": "function startGame() {\n toggleViews();\n if (st('input')[1].checked) {\n easy = false;\n } else {\n easy = true;\n }\n createBoard();\n qs(\"#game-view #details-bar #refresh-btn\").addEventListener('click', refreshBoard);\n startTimer();\n }", "title": "" }, { "docid": "4a21c0b7fa609644306446bff3b0cdd7", "score": "0.73824537", "text": "function startGame() {\n \n var message = JSON.stringify({type:'gameState', status:'start'});\n clientList[0].sendUTF(message);\n clientList[1].sendUTF(message);\n \n //enable gameState to true and let the logic-loop do its thing\n gameState = true;\n gameLoop();\n}", "title": "" }, { "docid": "766e36e75e3f800353eb9b74cc927a05", "score": "0.7366331", "text": "function initStart() {\n let startCanvas = new Sprite(resources[\"img/start-canvas.png\"].texture),\n startButton = new Sprite(resources[\"img/start-button.png\"].texture);\n startScreen.addChild(startCanvas);\n startScreen.addChild(startButton);\n startButton.position.set(200, 100);\n app.stage.addChild(startScreen);\n\n startButton.interactive = true;\n startButton.buttonMode = true;\n startButton.on('pointerdown', initGame);\n}", "title": "" }, { "docid": "f13d0a33edfcc31854562f5ce13d6de2", "score": "0.7364598", "text": "function startScreen() {\n\n // push() and pop()\n //\n // To keep the text size, text font, and text alignment\n // from spreading trough other text that I might add\n push();\n\n // Adding a new font\n textFont(quantumfont);\n\n // To adjust my font size\n textSize(30);\n\n // text alignment\n textAlign(CENTER, CENTER);\n\n // No stroke\n noStroke();\n\n // Color fill of the title\n text(\"Press a button to start\", width / 2, height / 4);\n\n pop();\n\n // The game starts when a button is pressed\n if (keyIsPressed) {\n state = \"playGame\";\n }\n}", "title": "" }, { "docid": "afae4056befa0a92c432a80455c483b0", "score": "0.7352979", "text": "function startGame(){\r\n\tgameData.paused = false;\r\n\tinstructionContainer.visible = false;\r\n\t\r\n\tstartCustomerTimer();\r\n\tsaveLevelData()\r\n}", "title": "" }, { "docid": "a3b7dbb95b84fe78deeb3310fa21f1a3", "score": "0.73443663", "text": "function startGame() {\n $('#title').on('click', function(e) {\n //configuration variable before start\n var wfconfig = {\n active: function() {\n $('#wrapper').hide();\n\n $.getScript(\"start\");\n },\n\n \t\tgoogle: {\n \t families: ['Cabin Sketch', 'Cagliostro']\n \t\t}\n };\n\n //configuring the div that'll contain the game so it fits perfectly\n var canvasContent = $('#canvasContent');\n canvasContent.css('position', 'absolute');\n canvasContent.css('margin', '0');\n canvasContent.css('width', '100%');\n canvasContent.css('top', '31px');\n canvasContent.css('bottom', '0');\n\n //actual start\n WebFont.load(wfconfig);\n });\n }", "title": "" }, { "docid": "540aceedbb278b57f8f1461dbf5c406d", "score": "0.7342257", "text": "function startGame() {\n\n // game scene\n createGame();\n\n // game state\n changeState(2);\n}", "title": "" }, { "docid": "6875d1b9256ab59d932e89f55c4a9785", "score": "0.7332702", "text": "function start() {\n\t\tIS_PLAYING = true;\n\t\t\n\t\t// Reset frame counter\n\t\tFRAME_NUMBER = 0;\n\t\t\n\t\t// Handle enabling/disabling state-based buttons\n\t\tdocument.getElementById(\"start\").disabled = true;\n\t\tdocument.getElementById(\"stop\").disabled = false;\n\t\tdocument.getElementById(\"animation\").disabled = true;\n\t\t\n\t\t// Break animation currently on screen into frames and store in global array\n\t\tFRAMES = document.getElementById(\"screen\").value.split(\"=====\\n\");\n\t\t\n\t\t// Start playing the animation\n\t\tTIMER = setInterval(nextFrame, FRAME_SPEED);\n\t}", "title": "" }, { "docid": "a68fdf5f452119503b116e87d50a901c", "score": "0.7323579", "text": "function start_game(){\n\n //hide the initial buttons and form\n startButton.style = \"display:none\"\n instructionsButton.style = \"display:none\"\n startForm.style = \"display:none\"\n gameTitle.style = \"display:none\"\n\n //post user information to API\n let userName = formName.value\n levelMessage()\n Adapter.postUser(userName)\n .then(response => response.json())\n .then(data=> {\n userObj = new User(data)\n })\n .then(() => {\n //start the game\n gameInProgress = true\n //intital drawing animation\n draw()})\n }", "title": "" }, { "docid": "25206adc65bb7ae58c42e32b80d83e1f", "score": "0.7317355", "text": "function onStart() {\n\n\t\t$(this).hide();\n\t\tbuttons.stop.show();\n\n\t\tgame.play = true;\n\t\tanimate();\n\t}", "title": "" }, { "docid": "333ce4a870638b0176d7bb68e769583d", "score": "0.7305175", "text": "static start(game) {\n\n // Start game\n game.state.start('game');\n\n // Music\n game.sound.stopAll();\n game.sound.play('gameMusic');\n }", "title": "" }, { "docid": "f6ebd89dfd71cc295b65951c0585294e", "score": "0.7301085", "text": "function startGame() {\n $('#gameboard').css(\"background-image\", \"url(images/startscreen.png)\");\n var screen = new GameScreen(\"\",\"\",\n function() {\n Game.loadBoard(new GameBoard(1));\n });\n \n Game.loadBoard(screen);\n Game.loop();\n }", "title": "" }, { "docid": "b0ad6b0b1b6b1dc2afc48014a4c29d4d", "score": "0.7300176", "text": "function start() {\n gameon = false;\n swal({\n title: \"Welcome\",\n text: \"This is my version of Frogger. Press ENTER to Continue!\",\n type: \"info\",\n showCancelButton: false,\n confirmButtonText: \"Next!\",\n closeOnConfirm: false},\n function() {\n swal({title:\"Objectives\",\n text:\"Collect as many Blue gems as you can. \\n\\\n Collect 4 Green and Earn an Extra Life.\\n\\\n Orange gems are special! \",\n confirmButtonText: \"Next!\",\n closeOnConfirm: false},\n function() {\n swal({title:\"Instructions\",\n text:\"Use Arrow Keys for Movement. \\n\\\n Key P for Pausing.\\n\\\n Press Enter to Start the Game.\",\n confirmButtonText: \"Start!\"},\n function() {gameon = true;});\n });\n });\n }", "title": "" }, { "docid": "08afdc53f3eb9426211edd544c878af4", "score": "0.7294617", "text": "function startTurn () {\n\t\t// console.log('Starting turn');\n\t\tupdateGameInfo();\n\t}", "title": "" }, { "docid": "574f0e1568815b8921a8b07e05c59558", "score": "0.7293125", "text": "function startGame()\n{\n mainGame();\n}", "title": "" }, { "docid": "2f17e587297450e77abd37a14fb683d2", "score": "0.72913045", "text": "function startButtonPressed() {\r\n if (gameActive) {\r\n return;\r\n }\r\n teams[0] = new Team(\"player\", 0, colors.TEAM_PURPLE);\r\n teams[1] = new Team(\"neutral\", 1);\r\n teams[2] = new Team(\"enemy1\", 2, colors.TEAM_RED);\r\n let map = getMap(cellSize);\r\n mapSetup(map.type);\r\n spawners = map.spawners;\r\n teams[1].changeSpawners(spawners.length-teams.length+1);\r\n drawSpawners();\r\n drawLoopVar = setInterval(drawLoop, 50);\r\n gameLoopVar = setInterval(gameLoopFunction, 250);\r\n gameActive = true;\r\n}", "title": "" }, { "docid": "9f09833555fd31a761ad8c81d0e82794", "score": "0.7279335", "text": "function startGame() {\n var screen = new GameScreen(\"SPACE INVADERS\",\"PRESS SPACE TO START THE ADVENTURE...\",\"\",\n function() {\n Game.loadBoard(new GameBoard(1));\n });\n Game.loadBoard(screen);\n Game.loop();\n }", "title": "" }, { "docid": "636dac8c01f55e6ba7e5e5533c656f0c", "score": "0.7267129", "text": "function startGame(){\n\tif(!gameStarted){\n\t\tscore = 0;\n\t\tlives = 3;\n\t\twave = 1;\n\t\tgameStarted = true;\n\t\t//Reseting things when a new game starts\n\t\tInvaders = [];\n\t\tBullets = [];\n\t\tInvaderBullets = [];\n\t\tinvaderSpeed = 0.15;\n\t\tplayerX = 500;\n\t\tdocument.getElementById('start-button').disabled = true;\n\t\tgameOver = 0;\n\t\tpaused = false;\n\t\t\n\t\t//Creating 10 invaders\n\t\tvar x = 900;\n\t\tfor(var i = 0; i < 10; i++){\n\t\t\tInvaders.push(new Invader(x,15, -1))\n\t\t\tx -= 50;\n\t\t}\n\t\t\n\t}\n}", "title": "" }, { "docid": "b27e31b30228d48128f10e892978d726", "score": "0.72660303", "text": "function startGame() { \n //Llamamos a la funcion \"goSectionCanvas()\" para cambiar a la pantalla de juego y iniciar \"ironhack_BlackJAck.init()\" mediante el callback de la animacion \"goSectionCanvas()\"\"\n\n goSectionCanvas();\n\n //Devolvemos los btn a su estado inicial de la Landing\n btnLess.style.display = \"block\"; \n btnLess.style.opacity = \"1\";\n btnOver.style.display = \"block\"; \n btnOver.style.opacity = \"1\";\n\n btnStart.style.display = \"none\"; \n btnStart.style.opacity = \"0\";\n }", "title": "" }, { "docid": "b1a69602e71e90ba54283d3371180057", "score": "0.72605073", "text": "function startButtonClickHandler( e )\n\t{\n\n // Remove the title screen from the stage\n\tstage.removeChild( titleScreen );\n\t// Add the containers necessary for gameplay to the stage\n\tstage.addChild( gameplayScreen );\n\n\t// Draw the tilemap for our test room\n\tdrawTileMap\n\t\t(\n\t\ttileMapManager.testRoom_layout,\n\t\ttileMapManager.testRoom_height,\n\t\ttileMapManager.testRoom_width,\n\t\tgameplayScreen\n\t\t);\n\n\t// Add the player to the gameplay screen\n\tinitializePlayer( gameplayScreen );\n\n\trenderer.backgroundColor = 0xffb18a;\n\n\t// Give the player the means to exit back to the menu\n\tgameplayScreen.addChild( menuButton );\n if( CAMERA_ZOOM )\n {\n\n menuButton.scale.x = 1/GAME_SCALE;\n \tmenuButton.scale.y = 1/GAME_SCALE;\n }\n\n gameRunning = true;\n\t}", "title": "" }, { "docid": "31caf181d08b3891535253430683aca5", "score": "0.72418106", "text": "function startGame() {\n state = preGame;\n title.visible = false;\n hint.visible = false;\n countdown.visible = true;\n countdown.text = '3...';\n setTimeout(() => {\n countdown.text = '2...';\n }, 1000);\n setTimeout(() => {\n countdown.text = '1...';\n }, 2000);\n setTimeout(() => {\n spawnEnemies();\n countdown.text = 'GO!';\n state = play;\n }, 3000);\n setTimeout(() => {\n countdown.visible = false;\n }, 4000);\n}", "title": "" }, { "docid": "9790f948d73edc32d06d473284dee801", "score": "0.7241508", "text": "start(){\r\n if(gameState === 0){\r\n player = new Player();\r\n player.getCount();\r\n form = new Form()\r\n form.display();\r\n }\r\n }", "title": "" }, { "docid": "ffb5e10a87f327a8d887bc54f11f8c93", "score": "0.7236146", "text": "function startGame(){\n $('#players, #start, #board, #reload').toggleClass('hide');\n setBoard();\n }", "title": "" }, { "docid": "dc35134d5bd5b0979dc1d5d852ef7692", "score": "0.72247237", "text": "startGame(game) {\n startGame(game);\n }", "title": "" }, { "docid": "e5b9ea0fd7817c3ffb86eab07493bbc3", "score": "0.7224293", "text": "function gameStart(){\n\tcurrentState = gameRunningState;\n\t$(\"#intro\").transition({ opacity: 0 }, 500, 'easeInQuad');\n\n\tspriteJump();\n\tgamethread = setInterval( gameThread, FRAME_TIME );\n\tpipethread = setInterval( drawPipes, 1300 );\n\n}", "title": "" }, { "docid": "797e4f9d2ffa7b24197725dc252c6d9a", "score": "0.72228175", "text": "function startGame() {\n Crafty.scene('Game');\n}", "title": "" }, { "docid": "f4f83908561067cb1ce4b8ecc1e60671", "score": "0.7219574", "text": "function startLoop() {\n $rootScope.log('engine', 'Starting game loop');\n\n update();\n }", "title": "" }, { "docid": "b6fcc5c4f7697a1b93988bb38b53d73b", "score": "0.721922", "text": "function startGame() {\n\t// hide the start game button\n\tshowOrHideButton('startGameBtn', 'hide');\n\t\n\t// prompt the user to see if he wants to be X or O?\n\tplayer_letter = getPlayerLetter();\t\n\t\n\t// set the computer letter to the opposite of \n\t// what the player chose.\n\tif(player_letter == 'X')\n\t{\n\t\tcomputer_letter = 'O';\n\t} else {\n\t\tcomputer_letter = 'X';\n\t}\n\t\n\t// display the information for the player to see on the home page.\n\tdocument.getElementById('playerLetter').innerHTML = \"You are Player: \" + player_letter;\t\n\t\n\t// Todo: Randomly choose who goes first\n\tvar firstPlayer = whoGoesFirst();\n\t\n\t// if player goes first, his move.\n\tif (firstPlayer == 'player'){\n\t\tplayersMove();\n\t} else\n\t{\n\t\tcomputersMove();\n\t}\n}", "title": "" }, { "docid": "d87b0a42f24fe737b0b89727ced93d19", "score": "0.7214393", "text": "async function clickStart() {\n $('#gameboard').hide().html(\"\");\n\n $('#start').text(\"Loading...\")\n showLoadingView();\n await setupAndStart();\n hideLoadingView();\n $('#start').text(\"Restart!\")\n $('#gameboard').show();\n\n}", "title": "" }, { "docid": "b541a016cbec04299fd09d97ce0b41df", "score": "0.7208699", "text": "function _startGame() {\n\t\tif (!_gameOver) {\n\t\t\tif (!_gameActive) {\n\t\t\t\t_hideMessageBoard();\n\t\t\t\t_gameActive = true;\n\t\t\t\t_frameInterval = setInterval(function() {\n\t\t\t\t\tvar stateInfo = _board.updateState();\n\t\t\t\t\t_updateDOMBoard(stateInfo);\n\t\t\t\t}, _FRAME_SPEED);\n\t\t\t}\n\t\t} else {\n\t\t\t_gameOver = false;\n\t\t\t_board.initializeStartState();\n\t\t\t_renderDOMBoard();\n\n\t\t\t_setMainMessage(_RESTART_MESSAGE);\n\t\t\t_setMessageDetails(_RESTART_DETAILS);\n\t\t}\n\t}", "title": "" }, { "docid": "15d259b054bb5c02b9e9a262ae71698e", "score": "0.71956456", "text": "function startButtonIsClicked() {\n if (buttonName === \"START\") {\n START = true;\n buttonColor = '#FF5533';\n buttonName = \"RESET\";\n \n } else { //reset the scene\n status_left = \"init\";\n status_right = \"init\";\n v_left = 0.0;\n v_right = 0.0;\n s_left = 0.0;\n s_right = 0.0;\n mouseLeftActive = true;\n mouseRightActive = true;\n buttonColor = '#77FF33';\n buttonName = \"START\";\n redBall_x = redBall_x0;\n redBall_y = redBall_y0;\n redBall_vx = redBall_vy0;\n redBall_vy = redBall_vy0;\n leftScore = 0 ;\n rightScore = 0;\n leftTurn = false;\n rightTurn = false;\n startIsClicked = false;\n }\n}", "title": "" }, { "docid": "85abc008650e3db5eb22256b4d483851", "score": "0.71937704", "text": "function startState(state){\n\tgame.state.start(state);\n}", "title": "" } ]
ec4fbb3e3454bfb5e28f5796d112d024
Center should be [x, y]
[ { "docid": "47e700e8de16738b295dd30747010018", "score": "0.0", "text": "function hexagon(center, rx, ry) {\n var vertices = [];\n for (var i = 0; i < 6; i++) {\n var x = center[0] + rx * cosines[i];\n var y = center[1] + ry * sines[i];\n vertices.push([x, y]);\n }\n //first and last vertex must be the same\n vertices.push(vertices[0]);\n return polygon([vertices]);\n }", "title": "" } ]
[ { "docid": "d4925d730c788947cdab03adcbc6dfd1", "score": "0.80354756", "text": "set center(value) {}", "title": "" }, { "docid": "a02c33e6208906d357fdd09f01b1983f", "score": "0.77006656", "text": "get center()\n {\n return new Point(this.x / 2, this.y / 2);\n }", "title": "" }, { "docid": "c578e68cea71a4dcdc71d814141a750f", "score": "0.7671763", "text": "set Center(value) {}", "title": "" }, { "docid": "d335218a142118f5df39e65f4945397d", "score": "0.76375234", "text": "function centerCoordOfGroup () {\n \n }", "title": "" }, { "docid": "3d29c1e982e2aea349ad2b22ad27cb3b", "score": "0.7624792", "text": "function center() {\n return {\n left: '50%',\n top: '50%',\n transform: 'translate(-50%, -50%)'\n }\n}", "title": "" }, { "docid": "fa415383596c597b5022eabafe1d850e", "score": "0.760267", "text": "get center() {\n return new (0, _math.Point)(this.worldScreenWidth / 2 - this.x / this.scale.x, this.worldScreenHeight / 2 - this.y / this.scale.y);\n }", "title": "" }, { "docid": "347345bd300274f82a4b780ea52ec5ca", "score": "0.75788516", "text": "calcCenter() {\n this.center = new Vector((this.p1.x + this.p2.x + this.p3.x) / 3, (this.p1.y + this.p2.y + this.p3.y) / 3);\n }", "title": "" }, { "docid": "98e484e3c558fee5a3e6d5bcf1b26112", "score": "0.7516418", "text": "function getScotusCenter() {\n return {x:width/2, y:height/2};\n }", "title": "" }, { "docid": "9600aa9a685b2b58e361e30d740c4f15", "score": "0.75142896", "text": "get_centerx() {\n\t\treturn this.x + this.width / 2;\n\t}", "title": "" }, { "docid": "185a583fc1b0b243c9ef76e16fc2b5be", "score": "0.7509155", "text": "center() {\r\n\r\n\r\n return new Gamestack.Vector(this.position.x + this.size.x / 2, this.position.y + this.size.y / 2, 0);\r\n\r\n }", "title": "" }, { "docid": "377c62a2eaf05a6b527574967cec0cb7", "score": "0.74792075", "text": "function getCenter(a, b) {\n return {\n x: (b.x + a.x) / 2,\n y: (b.y + a.y) / 2\n };\n}", "title": "" }, { "docid": "1ad8b38569efc5aa78abd00185b789a1", "score": "0.7463063", "text": "centerX() {\n return this.center().x\n }", "title": "" }, { "docid": "492c26b463fdf054d670bbf9802c9b8d", "score": "0.7423664", "text": "get Center() {}", "title": "" }, { "docid": "0aa64b2f921db2f1e687d03e92f9d2c9", "score": "0.7407321", "text": "putCenter(b, xOffset = 0, yOffset = 0) {\n let a = this;\n b.x = (a.x + a.halfWidth - b.halfWidth) + xOffset;\n b.y = (a.y + a.halfHeight - b.halfHeight) + yOffset;\n }", "title": "" }, { "docid": "3e4b8ba92c779c6231867701b28799f3", "score": "0.7382824", "text": "function center(p) {\n let mx = p.x + p.radius()\n let my = p.y + p.radius()\n\n return [mx, my]\n}", "title": "" }, { "docid": "3f5daf22547cc0dba891a303529afa1a", "score": "0.73559177", "text": "get center() {}", "title": "" }, { "docid": "2353046e91d30bcbda17809ccb969253", "score": "0.735144", "text": "get center() {\n const q = this.props.x;\n const r = this.props.z;\n const x = (this.props.size * 3 * q) / 2.0;\n const y = this.props.size * Math.sqrt(3) * (r + q / 2.0);\n return { x, y };\n }", "title": "" }, { "docid": "a406e01079327cf01aa2ac5c33c8053d", "score": "0.7322367", "text": "function center(rect) {\n return XY.init(rect.x1 + (rect.width >> 1), rect.y1 + (rect.height >> 1));\n }", "title": "" }, { "docid": "c8e7339ed53ab37f9154c4fe5cc25ba5", "score": "0.72078955", "text": "center() {\n this.translationX = this.canvas.width * 0.5\n this.translationY = this.canvas.height * 0.5\n }", "title": "" }, { "docid": "95e6f054bd34eeaeb6adcea8fe4e6078", "score": "0.7189027", "text": "getCenter() {\r\n let o = this.inputs.nodeCanvas.offset;\r\n let z = this.inputs.nodeCanvas.zoom;\r\n let c = this.inputs.nodeCanvas.getCenter();\r\n let widthMod = this.inputs.nodeCanvas.width * (1 / z / 2);\r\n let heightMod = this.inputs.nodeCanvas.height * (1 / z / 2);\r\n return [-o[0] + widthMod, -o[1] + heightMod, 50, 50];\r\n }", "title": "" }, { "docid": "d8a06d1387fe646ba8029d417683d7eb", "score": "0.71524876", "text": "function centerElement(el, x, y) {\n let bounds = el.getBoundingClientRect();\n x = x - bounds.width / 2;\n y = y - bounds.height / 2;\n el.style.left = x + 'px';\n el.style.top = y + 'px';\n}", "title": "" }, { "docid": "875fd4c11878e2dfaf9828416a6b6a82", "score": "0.7151865", "text": "get center() { return this._center; }", "title": "" }, { "docid": "68233bd71299985b0a3028c614f65d50", "score": "0.7107165", "text": "get centerPoint() {\n if (!this._centerPoint) {\n this._centerPoint = new Point(\n this._x + (this._w >> 1),\n this._y + (this._h >> 1)\n )\n }\n return this._centerPoint\n }", "title": "" }, { "docid": "e5c9e08e7779fe7c9e3a41fb9f42ce66", "score": "0.70880777", "text": "function calculateCenter(){\n center = map.getCenter();\n }", "title": "" }, { "docid": "febec5d0988268fc95a92349d9609efb", "score": "0.70853364", "text": "function updateCenterPosition(obj) {\n obj.centerPosition.x = obj.position.x + obj.size.x / 2;\n obj.centerPosition.y = obj.position.y + obj.size.y / 2;\n}", "title": "" }, { "docid": "966beb0b43c21493baaf723076d664eb", "score": "0.70645773", "text": "function nodeCenter(node) {\n return (node.y0 + node.y1) / 2;\n}", "title": "" }, { "docid": "100ed428e5c7bb09179febe23cb56668", "score": "0.70541376", "text": "function calculateCenter() {\r\n center = map.getCenter();\r\n }", "title": "" }, { "docid": "ca6fcc5e99ae5eff23e701f208acd0e2", "score": "0.7014872", "text": "function redefine_Center(){\n\tmax_X = 0;\n\tmax_Y = 0;\n\n\tfor( let i = 0 ; i < punti.length ; i++){\n\t\tif(i % 2 == 0){ // X\n\t\t\tif ( punti[i] > max_X ){\n\t\t\t\tmax_X = punti[i];\n\t\t\t}\t\t\n\t\t}\n\t\telse{ // Y\n\t\t\tif ( punti[i] > max_Y ){\n\t\t\t\tmax_Y = punti[i];\n\t\t\t}\t\n\t\t}\n\t}\n\n\ttranslate((-max_X * multiplSize)/2 , (-max_Y*multiplSize)/2);\n\t\n}", "title": "" }, { "docid": "c011c65bb1d7d548dd18ec62b5c6210a", "score": "0.70022655", "text": "function calculateCenter() {\r\n center = map.getCenter();\r\n }", "title": "" }, { "docid": "656278f4f835ae72cb028abf90b8c7a9", "score": "0.69998795", "text": "function findCenter(t){'use strict';var e,o=$(t.ownerDocument);return t=$(t),e=t.offset(),{x:e.left+t.outerWidth()/2-o.scrollLeft(),y:e.top+t.outerHeight()/2-o.scrollTop()};}", "title": "" }, { "docid": "086eaf1c1f22cc262eee100cc9ff1579", "score": "0.6997061", "text": "get center() { return [this.width/2, this.height/2, this.depth/2] }", "title": "" }, { "docid": "8fcf5b2cbdf6cd69ddd5381728ce0226", "score": "0.697725", "text": "get_center () {\n var bBox = this.path.getBBox();\n var xMean = (bBox.x + (bBox.width + bBox.x)) / 2;\n var xMin = 0;\n var xMax = $(\"#holder\").width();\n xMean = (xMean / xMax) * 2 - 1;\n if (xMean > 1) {\n xMean = 1;\n }\n if (xMean < -1) {\n xMean = -1;\n }\n \n var yMean = (bBox.y + (bBox.height + bBox.y)) / 2;\n var yMin = 0;\n var yMax = $(\"#holder\").height();\n yMean = (yMean / yMax) * 2 - 1;\n if (yMean > 1) {\n yMean = 1;\n }\n if (yMean < -1) {\n yMean = -1;\n }\n\n return {\n x: xMean,\n y: yMean\n }\n }", "title": "" }, { "docid": "8b0fc5a7bf0bbf8d0beebff78b4edee5", "score": "0.6898157", "text": "function center(x) { \n currentAlignment = alignCenter \n}", "title": "" }, { "docid": "16bc625eaca3c65d3a455614e788294f", "score": "0.6896732", "text": "getCenter() {\n return this._center;\n }", "title": "" }, { "docid": "ad309e8fa2b741eb0302c9edb666b3fe", "score": "0.6894319", "text": "function getCenter(point1,point2){\r\n var x_dif = Math.abs(point1.x - point2.x);\r\n var y_dif = Math.abs(point1.y - point2.y);\r\n var x = Math.min(point1.x, point2.x) + x_dif/2;\r\n var y = Math.min(point1.y, point2.y) + y_dif/2;\r\n return new Point(x,y);\r\n }", "title": "" }, { "docid": "0bf40b0f942532717aa4554299a593ae", "score": "0.6892659", "text": "function calculateCenter(){\n\n var x_mean=0, y_mean=0, z_mean=0, numP=0;\n for(r = 0; r< objects[objActive].matrix.length-1; r++){\n for(c = 0; c< objects[objActive].matrix[0].length; c+=3){\n x_mean += objects[objActive].matrix[r][c];\n y_mean += objects[objActive].matrix[r][c+1];\n z_mean += objects[objActive].matrix[r][c+2];\n numP++;\n }\n }\n x_mean = x_mean/numP;\n y_mean = y_mean/numP;\n z_mean = z_mean / numP;\n var center = [x_mean, y_mean, z_mean];\n return center;\n}", "title": "" }, { "docid": "b673bd172c3a5a365b62046fb9f4e385", "score": "0.68886656", "text": "_getCanvasCenter() {\n const canvasRect = this.container.getBoundingClientRect();\n\n return {\n x: canvasRect.x + (canvasRect.width / 2),\n y: canvasRect.y + (canvasRect.height / 2),\n };\n }", "title": "" }, { "docid": "064c6532d7899381fdb103db3a5bb633", "score": "0.6872094", "text": "function getCenter(dimensions) {\n return XY.init(dimensions.width >> 1, dimensions.height >> 1);\n }", "title": "" }, { "docid": "6ac821f03a7e3b525f08a785cf17f5d8", "score": "0.68604195", "text": "setCenter(vecOrX, y = null) {\n let pos;\n if (vecOrX instanceof Vec2_1.default) {\n pos = vecOrX;\n }\n else {\n pos = new Vec2_1.default(vecOrX, y);\n }\n this.view.center = pos;\n }", "title": "" }, { "docid": "4b6f5644accba2d0a1ab6dfeac5f265a", "score": "0.68537426", "text": "center() {\n const centroid = this.centroid();\n return this.withVertices(this.vertices.map(v => v.vec.sub(centroid)));\n }", "title": "" }, { "docid": "07292a03d66f74682d63ee916782e71a", "score": "0.68253654", "text": "getCenter() {\n\t\treturn this.getDimensions(true);\n\t}", "title": "" }, { "docid": "24a6b3a6c84b0cf0c439d04f46d86931", "score": "0.6810665", "text": "centerX() {\n this.translationX = this.canvas.width * 0.5\n }", "title": "" }, { "docid": "20de5b10f1bd171efd9fa9ea6a7e8a41", "score": "0.680105", "text": "getCenter() {\n return this._center;\n }", "title": "" }, { "docid": "20de5b10f1bd171efd9fa9ea6a7e8a41", "score": "0.680105", "text": "getCenter() {\n return this._center;\n }", "title": "" }, { "docid": "20de5b10f1bd171efd9fa9ea6a7e8a41", "score": "0.680105", "text": "getCenter() {\n return this._center;\n }", "title": "" }, { "docid": "ed8575f1ab72c392aec2837fd3b4436d", "score": "0.6796564", "text": "constructor(left, top) {\n this.left = left;\n this.top = top;\n this.centerx = (left + stonesize / 2) + 1;\n this.centery = (top + stonesize / 2) + 2;\n }", "title": "" }, { "docid": "a7fb2d8d746045680c00fe34f06caf00", "score": "0.67949414", "text": "function getCenter(x, y, width, height, angle_rad) {\n\tvar cosa = Math.cos(angle_rad);\n\tvar sina = Math.sin(angle_rad);\n\tvar wp = width/2;\n\tvar hp = height/2;\n return { x: ( x + wp * cosa - hp * sina ),\n y: ( y + wp * sina + hp * cosa ) };\n}", "title": "" }, { "docid": "86923f48b4b98a65aafe74f17814ed8a", "score": "0.67791206", "text": "function SharpMap_GetCenter(obj) {\n var center = new Object();\n center.x = obj.minX + obj.zoom * 0.5;\n center.y = obj.maxY - obj.zoom * obj.container.offsetHeight / obj.container.offsetWidth * 0.5;\n return center;\n}", "title": "" }, { "docid": "a346f76fec1cb6ec9a04a939135b453b", "score": "0.6763523", "text": "moveCenter(...args) {\n let x;\n let y;\n if (typeof args[0] === \"number\") {\n x = args[0];\n y = args[1];\n } else {\n x = args[0].x;\n y = args[0].y;\n }\n const newX = (this.worldScreenWidth / 2 - x) * this.scale.x;\n const newY = (this.worldScreenHeight / 2 - y) * this.scale.y;\n if (this.x !== newX || this.y !== newY) {\n this.position.set(newX, newY);\n this.plugins.reset();\n this.dirty = true;\n }\n return this;\n }", "title": "" }, { "docid": "bf0804b61fa8c4dbb847447d0dbc6687", "score": "0.6758806", "text": "function centerElement(el)\n \n{\n var windowSize = getWindowSize();\n var x = Math.round(windowSize.w/2 -el.clientWidth/2);\n var y = Math.round(windowSize.h/2 -el.clientHeight/2);\n \n el.style.left = x + \"px\";\n //el.style.top = x + \"px\";\n}", "title": "" }, { "docid": "810be9dea24ece2054a68afc55b3c3ef", "score": "0.6755285", "text": "function getCenter(points) {\n var center = {x: 0, y: 0};\n for (var i =0; i < points.length; ++i ) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n center.x /= points.length;\n center.y /= points.length;\n return center;\n}", "title": "" }, { "docid": "5ab6051971c1612d64aae0f31b79e14e", "score": "0.6727529", "text": "function centerCanvas() {\r\n var x = (windowWidth - width) / 2;\r\n var y = (windowHeight - height) / 2;\r\n cnv.position(x, y);\r\n}", "title": "" }, { "docid": "fb009970810214abb1fa6906967cb9e7", "score": "0.6719638", "text": "function circleCenter(pA, pB) {\n\tlet r = [(pB.x - pA.x) / 2, ((pB.y - pA.y) / 2), ((pB.z - pA.z) / 2)];\n\treturn new Coord(pA.x + r[0], pA.y + r[1], pA.z + r[2], 1.0, 0.0, 0.0);\n}", "title": "" }, { "docid": "5e740133b633879be69018b5820b9a8f", "score": "0.6694929", "text": "function center(m) {\n var c = projection(m._lon, m._lat, m._size);\n var d = m._drag;\n if (d) {\n c.x = rem(c.x + (d.x0 - d.x1 || 0), m._size);\n c.y = rem(c.y + (d.y0 - d.y1 || 0), m._size);\n }\n return c;\n }", "title": "" }, { "docid": "c31384d21ed4212feb49faa9d1f7a958", "score": "0.6684209", "text": "function centerCanvas() {\n var x = (windowWidth - width) / 2;\n var y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "c31384d21ed4212feb49faa9d1f7a958", "score": "0.6684209", "text": "function centerCanvas() {\n var x = (windowWidth - width) / 2;\n var y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "155bc2b07f95631265041b6838cc4dd8", "score": "0.6676063", "text": "getRayonToCenter()\n\t\t{\n\t\t\tvar posAbs = this.getAbsolutePosition();\n\t\t\treturn Math.pow(posAbs.x-$(window).width()/2,2)+Math.pow(posAbs.y-$(window).height()/2,2)\n\t\t}", "title": "" }, { "docid": "b5204c76505b8d675cf294c3bb18add1", "score": "0.6664933", "text": "function screenCenter(xL, yL) {\n\tvar scrW = screen.width;\n\tvar scrH = screen.height;\n\t\n\tvar xPos = 0;\n\tvar yPos = 0;\n\t\n\tif(scrW > xL)\n\t\txPos = Math.floor((scrW - xL) / 2);\n\t\t\n\tif(scrH > yL)\n\t\tyPos = Math.floor(((scrH - yL) / 2));\n\t\t\n\tcooArr = new Array(xPos, yPos);\n\treturn cooArr;\n}", "title": "" }, { "docid": "99441b8a9685d84b3b30f5e954e36f42", "score": "0.6659454", "text": "function centerCanvas() {\n let x = (windowWidth - width) / 2;\n let y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "df9bcf546b2017d8e5b57f3e6a283c34", "score": "0.6656288", "text": "function getCenter(points) {\n var center = { x: 0, y: 0 };\n for (var i = 0; i < points.length; ++i) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n center.x /= points.length;\n center.y /= points.length;\n return center;\n }", "title": "" }, { "docid": "604d218616632fc2a8790c9cc182ea0b", "score": "0.6654219", "text": "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "title": "" }, { "docid": "604d218616632fc2a8790c9cc182ea0b", "score": "0.6654219", "text": "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "title": "" }, { "docid": "604d218616632fc2a8790c9cc182ea0b", "score": "0.6654219", "text": "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "title": "" }, { "docid": "604d218616632fc2a8790c9cc182ea0b", "score": "0.6654219", "text": "function ensureCentre(o, target) {\n o.cx = o.cx == null ? target.bbox().cx : o.cx\n o.cy = o.cy == null ? target.bbox().cy : o.cy\n}", "title": "" }, { "docid": "0982df6d8356c8d386946091cc1d546a", "score": "0.6639683", "text": "function zoomToCenter(x, y) {\n\tvar centerPoint = new esri.geometry.Point(x, y);\n\tcenterPoint.spatialReference = map.spatialReference;\n map.centerAt(centerPoint);\n}", "title": "" }, { "docid": "55fc09725fec80160c657a92704d6fa0", "score": "0.6639485", "text": "function getCenter(coords) {\r\n\tvar xCoord = 0;\r\n\tvar yCoord = 0;\r\n\t\r\n\tfor(var x = 0; x < coords.length; x++) {\r\n\t\txCoord += parseInt(coords[x].split(\"|\")[0], 10);\r\n\t\tyCoord += parseInt(coords[x].split(\"|\")[1], 10);\r\n\t}\r\n\t\r\n\treturn Math.floor(xCoord/coords.length).toString() + \"|\" + Math.floor(yCoord/coords.length).toString();\r\n}", "title": "" }, { "docid": "6c3398e66ac445602abdef4d875ff34f", "score": "0.6636124", "text": "function ensureCentre(o, target) {\r\n o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n}", "title": "" }, { "docid": "6c3398e66ac445602abdef4d875ff34f", "score": "0.6636124", "text": "function ensureCentre(o, target) {\r\n o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n}", "title": "" }, { "docid": "6c3398e66ac445602abdef4d875ff34f", "score": "0.6636124", "text": "function ensureCentre(o, target) {\r\n o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n}", "title": "" }, { "docid": "72557bfc8338f46706bd23e7542dfaa5", "score": "0.6633445", "text": "function rectangleCenterH(rectangle) {\n rectangle.x = (rectangle.w + rectangle.x) - (rectangle.w / 2);\n rectangle.y = (rectangle.h + rectangle.y) - (rectangle.h / 2);\n}", "title": "" }, { "docid": "8ca73bde3fb2072d10fe86b91c947eec", "score": "0.66228855", "text": "function findCenter( elem ) {\r\n\t\tvar offset,\r\n\t\t\tdocument = $( elem.ownerDocument );\r\n\t\telem = $( elem );\r\n\t\toffset = elem.offset();\r\n\t\r\n\t\treturn {\r\n\t\t\tx: offset.left + elem.outerWidth() / 2 - document.scrollLeft(),\r\n\t\t\ty: offset.top + elem.outerHeight() / 2 - document.scrollTop()\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "1c0cb08bc0a87440ed44d0d27fd2535d", "score": "0.6613509", "text": "function placeCenter(elem){\n\t\tvar containerElem = document.getElementById('container');\n\t\tvar cr = containerElem.getBoundingClientRect();\n\t\telem.style.left = ((cr.left + cr.right) / 2) + 'px';\n\t\telem.style.top = ((cr.top + cr.bottom) / 2) + 'px';\n\t}", "title": "" }, { "docid": "8646dd9703e3170bbaa9a11b7bc93cc1", "score": "0.6611076", "text": "function getCenter () {\n var lats = 0;\n var lngs = 0;\n for (var i=0; i<markers.length; i++) {\n lats += markers[i].getLatLng().lat;\n lngs += markers[i].getLatLng().lng;\n }\n return new L.LatLng(lats / markers.length, lngs / markers.length);\n}", "title": "" }, { "docid": "3668e56eb23872f7f9b9c05fdb75f499", "score": "0.66054857", "text": "static getCenteredPosition({\n width, height, parentHeight, parentWidth, parentTop, parentLeft\n }) {\n const left = Math.floor((parentWidth / 2) - (width / 2) + parentLeft);\n const top = Math.floor((parentHeight / 2) - (height / 2) + parentTop);\n\n return {\n left,\n top\n };\n }", "title": "" }, { "docid": "8de947b5917c8ec36901c18eaee96d37", "score": "0.660539", "text": "function centerCanvas() {\n let x = (windowWidth - width) / 2;\n let y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "25ad47a5e48f184488d2726e48d1990e", "score": "0.66004264", "text": "get_abs_center() {\n var aabb = this.get_aabb();\n return aabb.position.add(aabb.size.multiply_scalar(0.5));\n }", "title": "" }, { "docid": "40ed25b7800b7a6a2f922bd9f3d0a299", "score": "0.6585938", "text": "function center(player){\n\n}", "title": "" }, { "docid": "a13813a67f8b246531cb278470c6a2a4", "score": "0.65829206", "text": "_getCenter(event) {\n const {center, target} = event;\n const rect = target.getBoundingClientRect();\n return [\n center.x - rect.left - target.clientLeft,\n center.y - rect.top - target.clientTop\n ];\n }", "title": "" }, { "docid": "611fec7f5b476ba8fb190f13daee1eb3", "score": "0.6580717", "text": "function centerViewOn(p) {\n var s = transformation.s;\n transformation.t.x = canvas.width /2 - p.x*s;\n transformation.t.y = canvas.height/2 - p.y*s;\n}", "title": "" }, { "docid": "e88303f55abfce53d9eeb63e100b1305", "score": "0.6573713", "text": "function centerCanvas() {\n var x = (windowWidth - width) / 2;\n var y = (windowHeight - height) / 2;\n this.cnv.position(x, y + 420);\n}", "title": "" }, { "docid": "8ec6bc343c1c3af7523689fd74ca4e13", "score": "0.6557309", "text": "centerLetter() {\n this.g.position.x = calligraphyContainerEl.offsetWidth / 2;\n }", "title": "" }, { "docid": "611122307c897acbb38a74e6adc56990", "score": "0.6554449", "text": "setLocation(x, y) {\n this.centreOfMass = point(x, y)\n }", "title": "" }, { "docid": "65a443d6da482fc7edfa0ba57f9d78f2", "score": "0.65505147", "text": "getMidPoint()\n {\n const mx = this.from.x + (this.to.x - this.from.x) / 2;\n const my = this.from.y + (this.to.y - this.from.y) / 2;\n return [mx, my];\n }", "title": "" }, { "docid": "ea9de523bbac5adab1a27e7ed93c41a8", "score": "0.6550078", "text": "midPoint(x,y){\n xMid = (x + (x+50)) / 2;\n yMid = (y + (y+50)) / 2;\n midCoords = [xMid, yMid];\n return midCoords;\n }", "title": "" }, { "docid": "79623c64bc9d318b36dfa7ee0f352a46", "score": "0.65349954", "text": "calculateCenter() {\n let signedArea = 0;\n let centroid = {\n x: 0,\n y: 0\n };\n\n // For all vertices except last\n for (let i=0; i<this.pointsLength; ++i){\n const point0 = {\n x: this.points[i].x,\n y: this.points[i].y\n } \n const point1 = {\n x: this.points[(i+1) % this.pointsLength].x,\n y: this.points[(i+1) % this.pointsLength].y\n }\n let a = point0.x*point1.y - point1.x*point0.y;\n signedArea += a;\n centroid.x += (point0.x + point1.x)*a;\n centroid.y += (point0.y + point1.y)*a;\n }\n\n signedArea *= 0.5;\n centroid.x /= (6.0*signedArea);\n centroid.y /= (6.0*signedArea);\n this.centroID = centroid;\n \n return centroid;\n }", "title": "" }, { "docid": "270580317b39d8a5210ed8a3ce911b95", "score": "0.653021", "text": "getCenter() {\n return this.view.center;\n }", "title": "" }, { "docid": "3d707aaf102a52262cb35d74cc03f139", "score": "0.6526532", "text": "function Centroid(x, y, id) {\n this.x = x;\n this.y = y;\n this.id = id;\n }", "title": "" }, { "docid": "0840ecf4f10d07144e1151a7453b6b57", "score": "0.6525687", "text": "function getTriangleCenter(x, y, size) {\n return {\n x: Math.floor((x + x + size + x) / 3),\n y: Math.floor((y + y + size + y + size) / 3)\n }\n}", "title": "" }, { "docid": "b0c08ac69551bd949f1c5dec4b1c4d34", "score": "0.652441", "text": "function flatCenter(x0, y0, x1, y1, x2, y2, fn) {\n // Preconditions:\n // 1. x0 < x1 < x2\n\n var edge;\n if (!isFinite(y1)) return;\n\n if (!isFinite(y0)) {\n edge = bisectFinite(x0, y0, x1, y1, fn);\n x0 = edge[0];\n y0 = edge[1];\n }\n\n if (!isFinite(y2)) {\n edge = bisectFinite(x1, y1, x2, y2, fn);\n x2 = edge[0];\n y2 = edge[1];\n }\n\n var flatLeft, flatRight;\n\n if (y0 === y1) {\n flatLeft = [x0, y0];\n } else {\n flatLeft = bisectConstant(x0, y0, x1, y1, fn, y1);\n }\n\n if (y2 === y1) {\n flatRight = [x2, y2];\n } else {\n flatRight = bisectConstant(x1, y1, x2, y2, fn, y1);\n }\n\n var xc = floatMiddle(flatLeft[0], flatRight[0]);\n return [xc, fn(xc)];\n}", "title": "" }, { "docid": "708c1df001828a123b4620ec7e54908b", "score": "0.6523999", "text": "function cornerCenter(a, b) {\r\n\t\treturn a.x+a.width > b.x-b.width/2 && a.y+a.height > b.y-b.height/2 && a.x < b.x+b.width/2 && a.y < b.y+b.height/2;\r\n\t}", "title": "" }, { "docid": "242a60c9a83842113d73886741cb4a8a", "score": "0.6511836", "text": "function getWindowCenter() {\n return {\n x: window.innerWidth / 2,\n y: window.innerHeight / 2,\n top: window.innerHeight / 2,\n left: window.innerWidth / 2\n };\n}", "title": "" }, { "docid": "8ab22b911cf700d05eecb354d50553e3", "score": "0.64992326", "text": "get center() {\n if (this.collider && this.collider.body) {\n return this.offset.add(this.collider.body.pos);\n }\n return this.offset;\n }", "title": "" }, { "docid": "044f89837c13186f7bf94921ebd76781", "score": "0.648965", "text": "getCenter() {\n return glMatrix.vec3.fromValues((this.xmax+this.xmin)/2.0, (this.ymax+this.ymin)/2.0, (this.zmax+this.zmin)/2.0);\n }", "title": "" }, { "docid": "4623543ba61dfac4fa62a137afc7dbc6", "score": "0.6481894", "text": "function placeCenterOfObject(obj, xPos, yPos, isText){\n if(isText){\n obj.x = xPos;\n obj.y = yPos;\n }else{\n obj.x = xPos - obj.width/2;\n obj.y = yPos - obj.height/2;\n }\n}", "title": "" }, { "docid": "2dd3c92f1983570654ff507de0ad8daf", "score": "0.64809954", "text": "function centerPath() {\n var center = { x : 0, y : 0, z : 0 };\n\n //If no GCode given yet\n if(that.gcode.size === undefined) {\n return center;\n }\n var size = that.gcode.size;\n center.x = size.min.x + Math.abs(size.max.x - size.min.x) / 2;\n center.y = size.min.y + Math.abs(size.max.y - size.min.y) / 2;\n center.z = size.min.z + Math.abs(size.max.z - size.min.z) / 2;\n\n if(that.cncConfiguration.initialPosition !== undefined) {\n center.x += that.cncConfiguration.initialPosition.x;\n center.y += that.cncConfiguration.initialPosition.y;\n center.z += that.cncConfiguration.initialPosition.z;\n }\n return center;\n }", "title": "" }, { "docid": "39ea978cc308279b0116c2c01e979969", "score": "0.64653325", "text": "function centerAnchor(Sprite) {\n Sprite.anchor.set(0.5, 0.5);\n}", "title": "" }, { "docid": "f77620557bca7d720ff3fb6a76af9db0", "score": "0.6454287", "text": "function centerCanvas() {\n var cnvPosX = (windowWidth - width) / 2;\n var cnvPosY = (windowHeight - height) / 2;\n canvas.position(cnvPosX, cnvPosY);\n debug.position(cnvPosX + 310, cnvPosY + 370);\n}", "title": "" }, { "docid": "e8a0aa3ec5a1a31c5714ffa5b6ea2982", "score": "0.6450215", "text": "function drawCenter(){\n\tvar centerDraw = [];\n\tcenterDraw.push(new THREE.Vector3( 5,0, 0));\n\tcenterDraw.push(new THREE.Vector3(0, 0,10));\n\tcenterDraw.push(new THREE.Vector3(-5,0, 0));\n\tvar center = new THREE.Shape(centerDraw);\n\t// addShape(center, extrudeSettings, 0xf08000, 0, 10, 0, 0, 0, 0, 1);\t\n\t// var points = center.createPointsGeometry();\n\t// var spacedPoints = center.createSpacedPointsGeometry( 4 );\t\n\tvar geometry = new THREE.ShapeGeometry( center );\n\n\tvar mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( { color: 0xffffff, side: THREE.DoubleSide } ) );\n\tgroup.add( mesh );\t\t\n}", "title": "" }, { "docid": "b4eb1a0777af9da8a01a4a669e14295b", "score": "0.64331245", "text": "GetLocalCenter() {\n return this.m_sweep.localCenter;\n }", "title": "" }, { "docid": "0286b45ae6f08cc909de23100dd0abe7", "score": "0.6431638", "text": "function getBoundingBoxCenter(img){\n \n imgBoundingBox = img.getBoundingClientRect();\n \n var imgX = imgBoundingBox.left;\n var imgY = imgBoundingBox.top;\n\n imgX = imgBoundingBox.left + (50 / 2);\n imgY = imgBoundingBox.top + (50/ 2);\n return [imgX,imgY];\n}", "title": "" }, { "docid": "a0b6157ad3b1b4f35d22468c4d23531a", "score": "0.64129853", "text": "function centerCanvas() {\n\tvar x = (windowWidth - width) / 2;\n\tvar y = (windowHeight - height) / 2;\n\tcanvas.position(x, y);\n}", "title": "" } ]
0b3c6a873ff5308d98a982ac14db21f0
will be updated on registration with Central Logger, but capture everything until then
[ { "docid": "fb2affd8850381d70f07dc73f44f2778", "score": "0.0", "text": "function IsLogMessage(channel) {\n return (channel === \"logger.service.logMessages\");\n}", "title": "" } ]
[ { "docid": "ac8a9640a436cd834392f7140fdcc052", "score": "0.6597249", "text": "atRegistered() {\n INFO(\"the peripheral service is registered ...\");\n }", "title": "" }, { "docid": "39b0693dff610cc594f91e06eb57e0df", "score": "0.6408397", "text": "function startLogging() {\n u_updateEvent = true;\n}", "title": "" }, { "docid": "d3459badde3f00057ab1286c5e8d5b78", "score": "0.6369311", "text": "constructor() {\n this._loggers = [];\n }", "title": "" }, { "docid": "8b5e4d434fc3a7ddf8cebf83727a3b38", "score": "0.6203556", "text": "function startLogging(){\r\n\tu_updateEvent = true;\r\n}", "title": "" }, { "docid": "0860e5922638100a61e71504016e83d5", "score": "0.6068075", "text": "function registerLoggingFunctions() {\n fire.log = getLogger('log');\n fire.info = getLogger('info');\n fire.warn = getLogger('warn');\n fire.error = getLogger('error');\n }", "title": "" }, { "docid": "c70dfbc17bfc1f3bf7c1ed43d7737cc3", "score": "0.5985015", "text": "addLogs() {\n this.addLogs();\n }", "title": "" }, { "docid": "5b8a1b68b372078180879bd7a4d91d16", "score": "0.5980457", "text": "function LoggerManager() {}", "title": "" }, { "docid": "5b8a1b68b372078180879bd7a4d91d16", "score": "0.5980457", "text": "function LoggerManager() {}", "title": "" }, { "docid": "e8379bd4158ad48f4a43ad3e93de6958", "score": "0.5923062", "text": "function dumpRegistrations(){registrations.forEach(_regLog)}", "title": "" }, { "docid": "39969dd531212a51b1c5263f86aaaa85", "score": "0.59191304", "text": "on_start() {\n new_log_message('some event');\n }", "title": "" }, { "docid": "d61922ec6dd6db3bd0a883cdff1a1df4", "score": "0.58886373", "text": "constructor(log) {\n this._loggers = [];\n this._log = log;\n }", "title": "" }, { "docid": "aebdcfe1005c3daf2854d35641a435d2", "score": "0.5870342", "text": "atRegistered() {\n INFO(\"the peripheral service is registered ...\");\n\n /**\n * Update the only one peripheral every 60 seconds. Please note, typically the \n * peripheral state update is not so frequent. Here we just show how to update \n * peripheral state with metadata to SensorWeb3, so ToeAgent or other apps can \n * process the state with metadata.\n */\n var self = this;\n this.updatePeripheralState();\n this.peripheralTimer = setInterval(() => {\n self.updatePeripheralState();\n }, 60000);\n\n this.monitors.forEach(m => {\n m.start();\n });\n }", "title": "" }, { "docid": "6ba0ae9c80e3a3599d95da652b0a44bc", "score": "0.5857708", "text": "function setup(){logger = (0,_coreDebug2['default'])(context).getInstance().getLogger(instance);}", "title": "" }, { "docid": "6ba0ae9c80e3a3599d95da652b0a44bc", "score": "0.5857708", "text": "function setup(){logger = (0,_coreDebug2['default'])(context).getInstance().getLogger(instance);}", "title": "" }, { "docid": "780bb747e6100695cb8b1748abfdf757", "score": "0.5855525", "text": "function getLoggerInfo(){\n request.get('http://' + ip + baseurl + 'GetLoggerInfo.cgi', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n try {\n var data = JSON.parse(body);\n if(\"Body\" in data) {\n var resp = data.Body.LoggerInfo;\n adapter.setState(\"HWVersion\", {val: resp.HWVersion, ack: true});\n adapter.setState(\"SWVersion\", {val: resp.SWVersion, ack: true});\n }else{\n adapter.log.error(data.Head.Status.Reason);\n }\n }catch(e){\n adapter.log.error(e);\n }\n }\n adapter.log.error(error);\n });\n}", "title": "" }, { "docid": "bee155824039c69120ab4058515e5d85", "score": "0.58542734", "text": "function updateLog() {\n\tvar log2 = [];\n\tfor(i = 0; i < 999; i++) {\n\t\tlog2[i+1] = log[i];\n\t}\n\t\n log2[0] = createGumballReport();\n\tlog = log2;\n\t\n\tconsole.log(\"update with \" + log2[0].name);\n\tsetTimeout(updateLog, Math.floor(Math.random()*5000 + 2000));\n}", "title": "" }, { "docid": "d509aa95dcd776292290a1b03ed3f787", "score": "0.5781749", "text": "function updateLogging() {\n chrome.storage.local.get({logging:false},function(obj){\n log.enabled = obj.logging\n })\n}", "title": "" }, { "docid": "6858f167b4291e8ace9f49493b803cb5", "score": "0.57598984", "text": "resetLogger() {\n this._injectLogger(true /** detach */);\n this._injectLogger();\n }", "title": "" }, { "docid": "b8584619ce8b9f9683bc7dfeabd11196", "score": "0.5748069", "text": "function initLog() {\n\n console.log('beersUpdateCtrl init');\n }", "title": "" }, { "docid": "b3dcfb5ea41818320fd9f00a8324a4f0", "score": "0.57293403", "text": "function initLog() {\n\n console.log('usersUpdateCtrl init');\n }", "title": "" }, { "docid": "1b897a24b2ea68c3f1350da70e98c4e9", "score": "0.5722778", "text": "attachDebugHandlers() {\n this.client.on('reconnect', () => {\n log.debug('reconnect');\n });\n\n this.client.on('offline', () => {\n log.debug('offline');\n });\n\n this.client.on('error', (err) => {\n log.debug('iot client error', err);\n });\n\n this.client.on('message', (topic, message) => {\n log.debug('new message', topic, JSON.parse(message.toString()));\n });\n }", "title": "" }, { "docid": "b645228e5c776288a405e3420ae82639", "score": "0.56985307", "text": "function initLog() {\n\n console.log('adminsUpdateCtrl init');\n }", "title": "" }, { "docid": "56a5da02ffa193590098e8edd9ea5df2", "score": "0.5685743", "text": "constructor() {\n this.log = Logger.createRootLogger();\n }", "title": "" }, { "docid": "210b5ffd3343609dc1bd74e83de29b9c", "score": "0.5683762", "text": "__initLogger() {\n var appLogStream = stream({ file: this.paths.log + '/app.log', size: '1m', keep: 5 });\n global.C = {\n logger: require('tracer').console({\n transport: function (data) {\n console.log(data.output);\n appLogStream.write(data.output + \"\\n\");\n }\n })\n }\n }", "title": "" }, { "docid": "d9dd69d93586579c509cc6d7bdf68121", "score": "0.56645334", "text": "async init() {\n for (const server of this.servers.values()) {\n this.getNewLogs(server);\n }\n }", "title": "" }, { "docid": "49ff412c46a29ed31602fc594a669990", "score": "0.56603134", "text": "function EBX_Logger() {\n\n}", "title": "" }, { "docid": "c22825272fe0ec42cfdf4775dec91443", "score": "0.5655272", "text": "initLogger() {\n this.logger = new ConsoleLogger({\n name: 'ParserRegistry'\n });\n }", "title": "" }, { "docid": "a21fd3c0175593bd6845f2c261eb6bbd", "score": "0.55671555", "text": "onRegister() {}", "title": "" }, { "docid": "a8ef321a26486b75b7195505dd21f8e2", "score": "0.5553022", "text": "onAdded() {\n\t\tconst settings = this.getSettings();\n\t\tthis.log(`router ${settings.model_name} added as device @ ${settings.host}:${settings.port}`);\n\t}", "title": "" }, { "docid": "e40fc0f95490a8b5137aa69092948ad0", "score": "0.5525817", "text": "constructor() {\n this.subloggers = [];\n this.options = {\n useConsole: true,\n };\n this.main = this.getLogger('main', LEVELS.Info);\n }", "title": "" }, { "docid": "361204fb34f228d633f66b676ba7c551", "score": "0.5525549", "text": "function init(impl) {\n var logger = get();\n logger.target = impl;\n }", "title": "" }, { "docid": "361204fb34f228d633f66b676ba7c551", "score": "0.5525549", "text": "function init(impl) {\n var logger = get();\n logger.target = impl;\n }", "title": "" }, { "docid": "8db0a0cb27dbd6a9d4d44f68abe61b0d", "score": "0.55240905", "text": "_addedHook() {}", "title": "" }, { "docid": "8e98a04ec9ef9c32fcd4d71590f9eed7", "score": "0.5522568", "text": "resetLoggingCallback() {\n this.loggingCallback_ = this.log_.bind(this);\n }", "title": "" }, { "docid": "3a95dd44c1511631aa287d506127ad01", "score": "0.55136794", "text": "static onProcessDebug() {\n try {\n const debugging = require(\"debug\")(\"KERNEL:\");\n Logger.log = (...msgs: any[]) => {\n debugging(msgs.join(\" \"));\n };\n } catch (err) {\n Logger.onVerbose();\n }\n }", "title": "" }, { "docid": "aa92ce66ef60504e49cca854ff63b2b4", "score": "0.5485116", "text": "function firstTime () {\n if (!loggers._) {\n const loglevel = levelMapping(process.env.CORE_CHAINCODE_LOGGING_LEVEL);\n loggers._ = new winston.createLogger({\n level: loglevel,\n format: formatter('_'),\n transports: [\n new winston.transports.Console({\n handleExceptions: true,\n })\n ],\n exitOnError: false\n });\n\n if (!process.listeners('unhandledRejection').some(e => e.name === 'loggerUnhandledRejectionFn')) {\n const loggerUnhandledRejectionFn = (reason, p) => {\n loggers._.error('Unhandled Rejection reason ' + reason + ' promise ' + util.inspect(p));\n };\n process.on('unhandledRejection', loggerUnhandledRejectionFn);\n }\n\n }\n}", "title": "" }, { "docid": "6b0f226a182529ebcb128d0504d8ce78", "score": "0.54818726", "text": "constructor() {\r\n // Create new winston logger instance and make it log to the console\r\n this.winston = winston.createLogger({\r\n format: winston.format(jsonFormatter)(),\r\n transports: [\r\n new winston.transports.Console(logging.console),\r\n new DailyRotateFile(logConfig)\r\n ],\r\n exitOnError: false\r\n });\r\n }", "title": "" }, { "docid": "28edf1c815ecef4231ccf58d9567e44a", "score": "0.5464864", "text": "function processLoggers(payload){\n\tlogger.info('Launching loggers');\n\tvar clientList = payload[0],\n\t\tapList = payload[1];\n\n\t\tclientList.map( function(data){\n\t\t\tdataLogger.client('sighting',data)\n\t\t} );\n\t\tapList.map( function(data){\n\t\t\tdataLogger.all('sighting',data)\n\t\t});\n\t\tlogger.info('Loggers complete');\n\t\treturn\n}", "title": "" }, { "docid": "737189559a13cceb8adb6ae30dd373b2", "score": "0.5458415", "text": "function setupLogReader() {\n // to use Tail again cuz nginx parse cant not just read the last line\n const tail = new nodejs_tail_1.default(LOG_PATH);\n tail.on('line', (line) => __awaiter(this, void 0, void 0, function* () {\n try {\n const data = (0, parseLog_1.default)(line);\n if (!data) { return; }\n io.emit('updateLiveChart', data);\n } catch (error) {\n console.error(error);\n }\n }));\n tail.on('close', () => {\n console.log('watching stopped');\n });\n tail.watch();\n}", "title": "" }, { "docid": "1c1a0e492866a971b589dd930ff952d1", "score": "0.54466724", "text": "async onInit() {\n this.logmodule = require(\"./logmodule.js\");\n this.broker = new brokerMQTT(this);\n this.triggers = new triggerMQTT(this);\n this.actions = new actionsMQTT(this);\n\n this.broker.updateRef(this);\n }", "title": "" }, { "docid": "734b4c4b0eca711d7cc705ee46a5d28e", "score": "0.5436335", "text": "registerGlobalHotkey() {\n\t\t__WEBPACK_IMPORTED_MODULE_7__clients_configClient___default.a.getValue({ field: \"finsemble.servicesConfig.logger.hotkeyShowCentralLogger\" }, (err, value) => {\n\t\t\tif (value) {\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_9__clients_hotkeysClient___default.a.onReady(() => {\n\t\t\t\t\t__WEBPACK_IMPORTED_MODULE_9__clients_hotkeysClient___default.a.addGlobalHotkey(value, () => {\n\t\t\t\t\t\twindow.showConsole();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "b8afe3ecaaed16a7778d20d9e10d8520", "score": "0.5431245", "text": "static ClearLogCache() {\n Logger.ClearLogCache();\n }", "title": "" }, { "docid": "f48c0918b82581505132939cfa1dfe5a", "score": "0.54199135", "text": "processLog(log) {\n super.processLog(log, this.status, this.yadamuLogger)\n return log\n }", "title": "" }, { "docid": "aa6c98f556b4d09a4fe72a1a8434cf84", "score": "0.5403862", "text": "initWinston() {\n // winston is configured as a private variable to the main app.ts\n // it can then be spread to child modules or routeModules. This way only one winston object needs to be setup\n this.winston.remove(this.winston.transports.Console);\n this.winston.add(this.winston.transports.Console, {\n colorize: true,\n prettyPrint: true,\n timestamp: true,\n });\n this.winston.add(this.winston.transports.File, {\n name: \"error\",\n level: \"error\",\n filename: \"logs/error.log\",\n maxsize: 10485760,\n maxFiles: \"10\",\n timestamp: true,\n });\n this.winston.add(this.winston.transports.File, {\n name: \"warn\",\n level: \"warn\",\n filename: \"logs/warn.log\",\n maxsize: 10485760,\n maxFiles: \"10\",\n timestamp: true,\n });\n this.winston.add(this.winston.transports.File, {\n name: \"info\",\n level: \"info\",\n filename: \"logs/info.log\",\n maxsize: 10485760,\n maxFiles: \"10\",\n timestamp: true,\n });\n this.winston.add(this.winston.transports.File, {\n name: \"verbose\",\n level: \"verbose\",\n filename: \"logs/verbose.log\",\n maxsize: 10485760,\n maxFiles: \"10\",\n timestamp: true,\n });\n this.winston.info(\"Winston has been init\");\n }", "title": "" }, { "docid": "04a1805e806feee1a434d7b35b326c70", "score": "0.54021186", "text": "logCalls() {\n\t\t\tUI.setApiCalls(this.appData.apiCalls);\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.logCalls();\n\t\t\t}, 1000);\n\t\t}", "title": "" }, { "docid": "eea6bfc6f3adb4c6f4ff1608f7201486", "score": "0.5399755", "text": "function updateLog() {\n if (u_updateEvent == true || p_keepUpdating == true) {\n runLog();\n }\n}", "title": "" }, { "docid": "5e00af2a398b655619fa2bc5a969671e", "score": "0.5362716", "text": "function setLoggingRecord( json ) {\n\t\ttry {\n\t\t\tif ( /^1\\d{3}$/.test( getLoggingStatusCode() ) ) {\n\t\t\t\tif ( !isDefined( json.type ) ) { json.type = \"generic\"; }\n\t\t\t\tif ( !isDefined( json.statusCode ) ) { json.statusCode = 1000; }\n\t\t\t\tif ( !isDefined( json.timestamp ) ) { json.timestamp = Date.now(); }\n\t\t\t\tif ( !isDefined( json.continue ) ) { json.continue = true; }\n\n\t\t\t\t/***** BEGIN GLOBAL UPDATE *****/\n\t\t\t\t\tif ( !isDefined( global.settings.logging.recordCount ) ) { global.settings.logging.recordCount = 25; }\n\n\t\t\t\t\tif ( global.logging.length >= global.settings.logging.recordCount ) {\n\t\t\t\t\t\tglobal.logging.shift(); // DELETE THE FIRST ELEMENT\n\t\t\t\t\t}\n\n\t\t\t\t\tglobal.logging[ global.logging.length ] = json;\n\t\t\t\t/***** END GLOBAL UPDATE *****/\n\n\t\t\t\t/***** BEGIN ERROR DIALOG *****/\n\t\t\t\t\tif ( isDefined( json.dialog ) || json.type === \"error\" ) {\n\t\t\t\t\t\tif ( !isDefined( json.dialog ) ) { json.dialog = {}; }\n\t\t\t\t\t\tif ( !isDefined( json.dialog.align ) ) { json.dialog.align = \"center\"; }\n\t\t\t\t\t\tif ( !isDefined( json.dialog.valign ) ) { json.dialog.valign = \"middle\"; }\n\t\t\t\t\t\tif ( !isDefined( json.dialog.height ) ) { json.dialog.height = 300; }\n\t\t\t\t\t\tif ( !isDefined( json.dialog.width ) ) { json.dialog.width = 400; }\n\n\t\t\t\t\t\t/***** BEGIN LOADING SCREEN *****/\n//\t\t\t\t\t\t\thideLoadingScreenDialog( {} );\n\t\t\t\t\t\t/***** END LOADING SCREEN *****/\n\n\t\t\t\t\t\t/***** BEGIN LOADING MESSAGE TO CONTAINER *****/\n\t\t\t\t\t\t\tloadMessage( { \"id\" : \"#loggingDialog\", \"align\" : json.dialog.align, \"valign\" : json.dialog.valign, \"message\" : ( !isDefined( json.dialog.message ) ) ? json.message : json.dialog.message } );\n\t\t\t\t\t\t/***** END LOADING MESSAGE TO CONTAINER *****/\n\n\t\t\t\t\t\t/***** BEGIN DISPLAY CONTENT INTO DIALOG *****/\n\t\t\t\t\t\t\tstringToDialog( \n\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\"id\" : \"#loggingDialog\", \n\t\t\t\t\t\t\t\t\t\"title\" : ( !isDefined( json.dialog.title ) ) ? json.title: json.dialog.title, \n\t\t\t\t\t\t\t\t\t\"height\" : json.dialog.height, \n\t\t\t\t\t\t\t\t\t\"width\" : json.dialog.width, \n\t\t\t\t\t\t\t\t\t\"dialogClass\" : json.type + \"-dialog\", \n\t\t\t\t\t\t\t\t\t\"buttons\" : [ \n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\ttext: \"Close\", \n\t\t\t\t\t\t\t\t\t\t\tclick: function() {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( json.continue ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// CLEAN LAST ERROR TO ALLOW USERS TO CONTINUE\n\t\t\t\t\t\t\t\t\t\t\t\t\tglobal.logging[ global.logging.length ] = { \"type\" : \"system\", \"statusCode\" : 1000, \"title\" : \"Continue\", \"message\" : \"You may continue.\" };\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t$( this ).dialog( \"close\" ); \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} \n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t/***** END DISPLAY CONTENT INTO DIALOG *****/\n\t\t\t\t\t}\n\t\t\t\t/***** END ERROR DIALOG *****/\n\t\t\t}\n\t\t}\n\t\tcatch ( e ) { \n\t\t\ttry { console.log( e ); } catch ( e ) { alert( e ); }\n\t\t}\n\t}", "title": "" }, { "docid": "ee4683d3807e8455dc0ed4fc348c5941", "score": "0.535974", "text": "function initialize() {\n//TODO: buld a function that resets loggs and traces.\n}", "title": "" }, { "docid": "0a6e50d735f0ea6681be22830d11d7ad", "score": "0.5348166", "text": "constructor() {\n this.logs = []; // logs in descending order\n // base class does nothing\n }", "title": "" }, { "docid": "a1849eb7c7c9507e9cf1645b6583396e", "score": "0.5347684", "text": "function init() {\n chrome.storage.sync.get(['logUIConfig', 'trackingConfig'], (res) => {\n if (res.logUIConfig) {\n console.log('Previous configuration found. Using that one');\n logUIConfig = LogUIConfiguration.fromValue(res.logUIConfig);\n trackingConfig = TrackingConfiguration.fromValue(res.trackingConfig);\n console.log(logUIConfig);\n console.log(trackingConfig);\n }\n else chrome.storage.sync.set({ logUIConfig, trackingConfig }, () => {\n console.log('No previous config found. Using default.');\n logUIConfig = LogUIConfiguration.fromValue({\n id: 0, \n websocket: '', \n authToken: '', \n verboseMode: true,\n browserEvents: {\n eventsWhileScrolling: true,\n URLChanges: true,\n contextMenu: true,\n pageFocus: true,\n trackCursor: true,\n pageResize: true\n }\n });\n trackingConfig = new TrackingConfiguration(0);\n });\n });\n}", "title": "" }, { "docid": "0a9a81d05710f0d68d61b6f2d3ef299f", "score": "0.53470796", "text": "constructor(logger) {\n this._logger = logger;\n\n // we need to track these only so we can fixup REFER messages for attended transfer\n this.calls = new Map() ;\n }", "title": "" }, { "docid": "8763a67199c69abb3b3081c1279bddce", "score": "0.5346829", "text": "static initLog(label){\n const logDirectory = config.get('Application.envConfig.logging.directory');\n if(!fs.existsSync(logDirectory)){\n fs.mkdirSync(logDirectory);\n }\n const myFormat = printf(({ level, message, timestamp }) => {\n return `${timestamp} [${label}] ${level}: ${message}`;\n });\n const logFileName = logDirectory + config.get('Application.envConfig.logging.filename');\n let transport = new transports.DailyRotateFile({\n filename : logFileName,\n format: combine(timestamp(), myFormat),\n zippedArchive: true,\n maxSize: '20m',\n maxFiles: '14d'\n });\n console.log(process.env.ENV);\n this._logger = createLogger({\n level : process.env.ENV === config.get('Application.envConfig.logging.level'),\n transports : [ transport, \n new transports.Console({\n level: config.get('Application.envConfig.logging.level'),\n format: format.combine(format.colorize(), timestamp(), myFormat)\n })\n ]\n });\n }", "title": "" }, { "docid": "226fd1071bea392544be427c810528ca", "score": "0.5345087", "text": "trackFallbackEmit() {\n\n\t\tthis._monitor.logFallbackEmit( this.getSnapshot() );\n\n\t}", "title": "" }, { "docid": "194c576b652dfbe4be63e0c19606ee9f", "score": "0.5334158", "text": "function journalEvents(log) {\n}", "title": "" }, { "docid": "f2cde3b1c1ea71752a911b7d3af9d710", "score": "0.5330283", "text": "function Logger() {\r\n this.log = function (event, msg, level) {\r\n if (BackgroundProxy.settings != null && BackgroundProxy.settings.main.general.enable_logging) {\r\n console.log(\"---------\" + event + \"---------\");\r\n if (msg instanceof Array) {\r\n for (m in msg) {\r\n console.log(m + \": \" + msg[m]);\r\n }\r\n } else console.log(msg);\r\n console.log(\"Logged at: \" + Date.now());\r\n }\r\n };\r\n\r\n}", "title": "" }, { "docid": "b51e3deb1058a7840a7609cc92f645b6", "score": "0.53296316", "text": "log() {}", "title": "" }, { "docid": "261ae4edb094455a8d9153b3df3efe98", "score": "0.53177637", "text": "initDebug() {\n this.addCallback((loopInfo) => {\n self.app.log(\"LoopInfos\", JSON.stringify(loopInfo));\n });\n }", "title": "" }, { "docid": "73f09339a806b73b762a5e0e564ba0d0", "score": "0.5314111", "text": "function initLog() {\n\n console.log('usersStoreCtrl init');\n }", "title": "" }, { "docid": "584669c8b6188a37cf3f077bd07722c3", "score": "0.5309001", "text": "function logStuff()\n{\n setInterval(function ()\n {\n var logData = Object.assign({}, data, trader.activeData);\n\n logData.average = trader.currentAverage;\n logData.currentSupportZone = trader.highestSupportZone;\n logData.currentResistanceZone = trader.lowestResistanceZone;\n\n sheet.recordTraderData(logData).catch(console.log);\n }, 60000);\n}", "title": "" }, { "docid": "5bf10ace5a7e35863cc34c7d19fb6777", "score": "0.53089976", "text": "function initLog() {\n\n console.log('adminsDestroyCtrl init');\n }", "title": "" }, { "docid": "b621b7737a22460a0b279ddde7e93a9f", "score": "0.5296353", "text": "trackFallbackSuccess() {\n\n\t\tthis._monitor.logFallbackSuccess( this.getSnapshot() );\n\n\t}", "title": "" }, { "docid": "a5bfa9fbb3266f528b970576a90e5944", "score": "0.52783716", "text": "function initLog() {\n\n console.log('adminsStoreCtrl init');\n }", "title": "" }, { "docid": "fab0b3ff01998a25c9d9d8c1ea7c898a", "score": "0.5277603", "text": "afterSetup() {\n this.tick = 0;\n this.paused = false;\n if (this.parameters.logging.environment)\n this.environment.setLogger(this.logger);\n }", "title": "" }, { "docid": "38aa1257c07a78462bc5232db60b78be", "score": "0.52729213", "text": "async startCapturing() {\n this.keyValueStore = await openKeyValueStore();\n\n await this._maybeLoadStatistics();\n\n if (this.state.crawlerStartedAt === null) {\n this.state.crawlerStartedAt = new Date();\n }\n\n events.on(ACTOR_EVENT_NAMES_EX.PERSIST_STATE, this.listener);\n\n this.logInterval = setInterval(() => {\n this.log.info(this.logMessage, {\n ...this.calculate(),\n retryHistogram: this.requestRetryHistogram,\n });\n }, this.logIntervalMillis);\n }", "title": "" }, { "docid": "efbe1fef4b12f66f573c3d5ed1c640d6", "score": "0.5270688", "text": "function dummyLog()\n {}", "title": "" }, { "docid": "38fcf239c713ac37a15e7e0463a0a550", "score": "0.5261101", "text": "function nullLogger() {}", "title": "" }, { "docid": "4aa3f4c1105b95186ac7d397e52e4481", "score": "0.5260817", "text": "static enableLogging() {\r\n enableLogging = true;\r\n log('logging enabled.');\r\n }", "title": "" }, { "docid": "c3e4cc61b890378514adc52e905fbc10", "score": "0.5255149", "text": "static ClearLogCache() {\n Logger._LogCache = \"\";\n Logger._LogLimitOutputs = {};\n Logger.errorsCount = 0;\n }", "title": "" }, { "docid": "64ec744b03e34e8998f829561f2f6346", "score": "0.5252992", "text": "function runningLogger()\n{\n console.log(\"I am running!\");\n}", "title": "" }, { "docid": "82ed984b65915fb468a4f7275231408c", "score": "0.52482754", "text": "function refresh() {\n refreshLogs();\n}", "title": "" }, { "docid": "15f5bb3e1b5a0f69ee20192a3b02da52", "score": "0.5245856", "text": "function initialize() {\n checkLoggingEnabled();\n}", "title": "" }, { "docid": "81b9206050be3148e2440a0503858f0e", "score": "0.5235415", "text": "static onVerbose() {\n Logger.log = (...msgs: any[]) => {\n process.stderr.write(\"KERNEL: \");\n console.error(msgs.join(\" \"));\n };\n }", "title": "" }, { "docid": "40c982a6d709ff49a3d4af8f22682d17", "score": "0.5235006", "text": "configLogger() {\n log4js_1.default.configure({\n appenders: { openbis: { type: 'file', filename: 'logs/openbis.log' } },\n categories: { default: { appenders: ['openbis'], level: 'info' } }\n });\n this.logger = log4js_1.default.getLogger('openbis');\n }", "title": "" }, { "docid": "751674f58f45cee459e4535460ca287b", "score": "0.5228116", "text": "function enableLogger (){\n\tif(!constant.LOGSETUP.log){\n\t\tconstant.LOGSETUP.log = bunyan.createLogger({\n\t\t\tname: packageJson.name,\n\t\t\tstreams: [ {\n\t\t\t\tlevel: constant.LOGSETUP.level || \"info\",\n\t\t\t\tstream: process.stdout // log DEBUG and above to stdout\n\t\t\t}],\n\t\t\tserializers: bunyan.stdSerializers\n\t\t});\n\t}\n\treturn constant.LOGSETUP.log;\n}", "title": "" }, { "docid": "b0a4cdfe778ae71b0c1cadd7c1601218", "score": "0.5227947", "text": "function updateLog(){\r\n\tif(u_updateEvent == true || p_keepUpdating == true){\r\n\t\trunLog();\r\n\t}\r\n}", "title": "" }, { "docid": "8c53b98740222dc40a3ec15b95cafa28", "score": "0.52224445", "text": "setupMiddlewareHttpLogger_() {\n switch (this.config.magnet.logLevel) {\n case 'silent':\n return;\n }\n if (this.config.magnet.requestLogger) {\n this.getServer()\n .getEngine()\n .use(this.config.magnet.requestLogger);\n }\n }", "title": "" }, { "docid": "5d0b78d7ecb89b86f57a157a4952998b", "score": "0.52145183", "text": "deps({ Log }) {\n this.tell = Log.tell\n }", "title": "" }, { "docid": "e689b2d6fa440bdcef6496b43dffac01", "score": "0.5213545", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/robot_logging\");\n client.subscribe(\"/replay_logging\");\n}", "title": "" }, { "docid": "8162d42335753c98448ebb428911fd6c", "score": "0.5211947", "text": "function initLog() {\n\n console.log('usersDestroyCtrl init');\n }", "title": "" }, { "docid": "e189faf6a07e16323e4e1e2c88454db1", "score": "0.52068067", "text": "__init7() {this.instrumenter = 'sentry';}", "title": "" }, { "docid": "ac306e573eafec6d5223ad8970a553fc", "score": "0.52051145", "text": "mute() {\n forEach(this._loggers, logger => logger.mute());\n }", "title": "" }, { "docid": "b6e86367946705d8778c70c6fed3b61e", "score": "0.52026", "text": "function startup(logger) {\n Logger = logger;\n}", "title": "" }, { "docid": "d0c301c530fa786c66cdb9cca43cea62", "score": "0.5197362", "text": "reload() {\n implementation = reload('./implementations/logger_implementation.js');\n }", "title": "" }, { "docid": "c4b6887549781917bbf7fca982252665", "score": "0.51958054", "text": "function initLog() {\n\n console.log('ticketsShowCtrl init');\n }", "title": "" }, { "docid": "6b6404f4e87b2c5407f05f6205dd05c7", "score": "0.5195105", "text": "pushMetrics() {\n logger.info(`[METRICS] ${JSON.stringify(getMetrics())}`);\n }", "title": "" }, { "docid": "b260fc2a85c94404b8bbcc614365e6ea", "score": "0.51900756", "text": "log (msg) {\n logger.info(`SnapbackSM: ${msg}`)\n }", "title": "" }, { "docid": "79f98003dba0d8cb005fc591f6c86275", "score": "0.5188231", "text": "constructor() {\n this.handlerName = this.constructor.name\n this.logger = loggerFactory(this.handlerName)\n }", "title": "" }, { "docid": "7af6557de4082e710a335df150086861", "score": "0.51775855", "text": "function initLog() {\n\n console.log('ticketsIndexCtrl init');\n }", "title": "" }, { "docid": "93abbc834f081fb20a766de691ef8b81", "score": "0.51687783", "text": "onUpdate (err, logUpdated, request, response) {\n console.log('onUpdate');// TODO: remove on production\n response.json({\n error: err,\n data: logUpdated\n });\n }", "title": "" }, { "docid": "a238309af6d75a5870950432ac681bda", "score": "0.5168028", "text": "function initLog() {\n\n console.log('usersShowCtrl init');\n }", "title": "" }, { "docid": "f119ac9d48d0505ddba8d530735d6c6b", "score": "0.51656455", "text": "function logger() {\n // if $log fn is called directly, default to \"info\" message\n logger.info.apply(logger, arguments);\n }", "title": "" }, { "docid": "f5dc02464b583e1886ba877dffddc137", "score": "0.515142", "text": "trackEmit() {\n\n\t\tthis._activeRequestCount++;\n\t\tthis._metrics.increment( \"emit\" );\n\t\tthis._monitor.logEmit( this.getSnapshot() );\n\n\t}", "title": "" }, { "docid": "03de5d299071f8a3c46c35c3fbc61dc0", "score": "0.51431644", "text": "get log () {\n return this.constructor.log.bind(this.constructor);\n }", "title": "" }, { "docid": "5471f86324d9e9ba2cd09c9fa473735f", "score": "0.51425576", "text": "function doAfterSubscribed() {\n Alloy.CFG.profiling && $.lib.logInfo('Initialising Push', [LOGTAG, 'timeend']);\n $.registered = true;\n\n // Fired when a notifications is received or responded to for iOS\n Alloy.Events.on('action', onAction);\n}", "title": "" }, { "docid": "8a5e1df3785214568826212ffe1047ba", "score": "0.51419336", "text": "function initLog() {\n\n console.log('adminsShowCtrl init');\n }", "title": "" }, { "docid": "d25def8fe3446a4286f2cfd0cecc88e6", "score": "0.5141837", "text": "static get LogCache() {\n return Logger.LogCache;\n }", "title": "" }, { "docid": "b593dc9493352f65f8678522783af160", "score": "0.51356363", "text": "function LogThisInteractionTime() { //This function logs each time we interact with the T5Pusher server\n //we have received a message from SignalR - so reset numREconnects value\n numReconnectsSinceWeLastReceivedASignalRMessage = 0;\n var DateHelper = new Date();\n lastInteractionTime = DateHelper.getTime();\n } //end LogThisInteractionTime", "title": "" }, { "docid": "bfc3082544428825715bd2d837a6f2c4", "score": "0.51318765", "text": "static get LogCache() {\n return Logger._LogCache;\n }", "title": "" }, { "docid": "b226f1b2bf7e0835a17b877c3ec492f7", "score": "0.513168", "text": "registerEventHandlers() {\n // Log task start\n gueEvents.on('GueTask.taskStarted', (task) => {\n if (task.name !== 'default') {\n this.log('started', task.name, 'normal');\n }\n });\n\n // Log task stop and task duration\n gueEvents.on('GueTask.taskFinished', (task) => {\n if (task.name !== 'default') {\n this.log('finished in', task.name, task.getTaskDuration());\n }\n });\n\n // Print stderr and the task finish notification on error\n gueEvents.on('GueTask.taskFinished.error', (task, message) => {\n process.exitCode = 1;\n beeper(1);\n this.errLog('finished with error in', task.name,\n task.getTaskDuration());\n });\n }", "title": "" }, { "docid": "19dd54f7a4b7a5dfdf150e3fc3a62279", "score": "0.5126442", "text": "info(msg: string): void {\n if (!this.options.enabled) {\n return;\n }\n this.logger.info(msg);\n }", "title": "" }, { "docid": "ef357c407ecc866cc787b8cd3b5fb9cc", "score": "0.512433", "text": "function Logger () {\n}", "title": "" } ]
cd787e906b6867c37147d34a1375d6bf
Modals function to load clickhandler for modals
[ { "docid": "a6afd701b45a3f37e64938cf50457617", "score": "0.68144095", "text": "function loadModalClickhandlers() {\n // close modal btn oben rechts im browser\n $('.modal-close').on('click', function () {\n document.getElementsByClassName('modal')[0].setAttribute(\"class\", \"modal\");\n modalActive = false;\n\n if(modalQueue.length > 0) {\n document.body.removeChild(document.getElementById(\"modal-div\"));\n showModal(modalQueue[modalQueue.length-1]);\n modalQueue.pop();\n }\n\n });\n\n // close modal button oben rechts am popup\n $('.delete').on('click', function () {\n document.getElementsByClassName('modal')[0].setAttribute(\"class\", \"modal\");\n modalActive = false;\n\n if(modalQueue.length > 0) {\n document.body.removeChild(document.getElementById(\"modal-div\"));\n showModal(modalQueue[modalQueue.length-1]);\n modalQueue.pop();\n }\n\n\n });\n\n // OK button\n $('#modal-ok-btn').on('click', function () {\n document.getElementsByClassName('modal')[0].setAttribute(\"class\", \"modal\");\n modalActive = false;\n\n if(modalQueue.length > 0) {\n document.body.removeChild(document.getElementById(\"modal-div\"));\n showModal(modalQueue[modalQueue.length-1]);\n modalQueue.pop();\n }\n\n });\n\n}", "title": "" } ]
[ { "docid": "d51420b5e99e6edd4fe7082a22c28ec9", "score": "0.7285429", "text": "#attachClickHandlers() {\n var {openBtn, closeBtn, modalElement, overlayElement} = this.elements\n openBtn.on('click', function () {\n modalElement.css({display: \"block\"})\n overlayElement.css({display: \"block\"})\n })\n\n closeBtn.on('click', function () {\n modalElement.css({display: \"none\"})\n overlayElement.css({display: \"none\"})\n })\n }", "title": "" }, { "docid": "e23de1ab5158ef030e8e3d0f2ca9ad6c", "score": "0.7214017", "text": "function handleClick(){\n if (d.not_modal == 'T'){\n window.location = d.link;\n } else {\n \n if (debug){ \n console.log(' link:' + d.link);\n }\n \n // https://www.drupal.org/node/756722#using-jquery\n (function ($) {\n $('#'+ modal_id).find('iframe')\n .prop('src', function(){ return d.link });\n \n $('#'+ modal_id + '-title').html( d.title );\n \n $('#'+ modal_id).on('show.bs.modal', function () {\n $('.modal-content').css('height',$( window ).height()*0.9);\n $('.modal-body').css('height','calc(100% - 65px - 55.33px)');\n });\n \n $('#'+ modal_id).modal();\n }(jQuery));\n }\n }", "title": "" }, { "docid": "5c7c1810621ea7eeba78c45c7c3a9580", "score": "0.69955826", "text": "function init() {\n\n $('.basic').click(function (e) {\n $('#basic-modal-content').modal({onOpen:openModal, onClose:modalClose});\n return false;\n });\n}", "title": "" }, { "docid": "b8a8d8d831ff3cfe4bac6f54b5770cbf", "score": "0.6956621", "text": "function ipmModal(el, title, width, height, margintop, zindex,cscls) {\n var mTitle = jq('#ipmModal .modal-title');\n var domEl = jq('#ipmModal .modal-dialog');\n jq(document).on('click', el, function(e) {\n e.preventDefault ? e.preventDefault() : e.returnValue = false;\n var url = jq(this).attr('value');\n openModal(url);\n mTitle.html(title);\n domEl.width(width);\n domEl.height(height);\n domEl.css({\n 'margin-top': margintop,\n 'z-index': zindex\n });\n domEl.addClass(cscls);\n });\n \n/* Below script works on key down event. When the user press enter it triggers a click event. */\n jq(document).on('keydown', el, function() {\n var keyCode = (event.keyCode ? event.keyCode : event.which);\n if (keyCode === 13) {\n jq(el).trigger('click');\n }\n });\n}", "title": "" }, { "docid": "c7dd7809212dcea4e60550666450be8b", "score": "0.69248027", "text": "function modalHandler() {\n setModal(!modal);\n }", "title": "" }, { "docid": "7309dafa256ce8ba255994f8c18f6bb7", "score": "0.6791502", "text": "function modalSendInvitation() {\r\n modalLoad('#sendInvitationModal'); \r\n }", "title": "" }, { "docid": "c8e558c528a672a5db35eea8d6c6d53f", "score": "0.6758767", "text": "function modal(){\n $('#botaoAjuda').click(function(){\n $('#myModal').slideToggle();\n });\n $('#closeButton').click(function(){\n $('#myModal').slideToggle();\n });\n $('#perguntaModal1').click(function(){\n $('#respostaModal1').toggle();\n });\n $('#perguntaModal2').click(function(){\n $('#respostaModal2').toggle();\n });\n $('#perguntaModal3').click(function(){\n $('#respostaModal3').toggle();\n });\n $('#perguntaModal4').click(function(){\n $('#respostaModal4').toggle();\n });\n}", "title": "" }, { "docid": "08af42c9448e3e2589b57758564eb09a", "score": "0.6717148", "text": "function modalActivity(){\n let modal = document.getElementById(\"directionModal\");\n $(\"#directions\").click(function(){\n $(\".modal\").show();\n });\n $(\".okBtn\").click(function(){\n $(\".modal\").hide();\n });\n window.onclick = function(event){\n if (event.target == modal){\n $(\".modal\").hide();\n }\n }\n}", "title": "" }, { "docid": "79b5c62de9afb52ffc303f4c6576167c", "score": "0.67089283", "text": "function modalfunc(){\r\n$('[data-toggle=\"mainmodal\"]').bind('click',function(e) {\r\n NProgress.start();\r\n e.preventDefault();\r\n var url = $(this).attr('href');\r\n \r\n if (url.indexOf('#') === 0) {\r\n $('#mainModal').modal('open');\r\n } else {\r\n $.get(url, function(data) { \r\n $('#mainModal').modal();\r\n $('#mainModal').html(data);\r\n\r\n \r\n }).done(function() { NProgress.done(); });\r\n }\r\n}); \r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "6dac8784d98ced92d3e44f10ce063401", "score": "0.6660718", "text": "function openModal() {\n\t$(document).on(\"click\", \"label[for='seller-1-sla-RetiroenSucursalAndreani']\", function() {\n\t\t$(\".vtexcarries\").show();\n\t\tinitMap();\n\t\tcreateListStore();\n\t});\n\t$(document).on(\"click\", \"label[for='seller-1-sla-retirosucursalandreani']\", function() {});\n\t$(document).on(\"click\", \"label[for='seller-1-sla-EnvioaDomicilio']\", function() {});\n\t$(document).on(\"click\", \"#change-other-shipping-option\", function() {});\n}", "title": "" }, { "docid": "14eb6f5bd32f176fd12b05f49a5d1b5e", "score": "0.66305375", "text": "function openModal() {\n var targetModal = $(this).attr('data-href');\n $(targetModal).find('.modal__overlay').addClass('modal__overlay--visible');\n $(targetModal).find('.modal__dialog').addClass('modal__dialog--visible');\n }", "title": "" }, { "docid": "cef1d50aa3a9e4a4e70eb92e77e1bda8", "score": "0.65976703", "text": "function moduleHandler(){\n $('.howToPlay').click(openModule);\n}", "title": "" }, { "docid": "9a288e455cc69131472e531014357d91", "score": "0.6595046", "text": "function openModal() {\r\n}", "title": "" }, { "docid": "2fdfc84d2bab048aa3a013cd6987e4e5", "score": "0.6563975", "text": "function modalBox() {\n $('a[data-role=\"modal-launcher\"], a[rel*=\"extra\"], a.loadinto-modal_box').click(function (e) {\n //Cancel the link behavior\n e.preventDefault();\n var title;\n //Create modal box container and overlay\n if ($('.modal-box').length === 0) {\n $('body').append('<div class=\"modal-box section\"></div><div class=\"overlay\" style=\"filter: alpha(opacity=64)\"></div>');\n }\n var href = $(this).attr('href');\n //Create figcaption text\n if ($(this).attr('title')) {\n title = $(this).attr('title');\n } else {\n title = ':-)';\n }\n //Check href to separate html and pics\n if ($(this).is('a[href$=.png], a[href$=.jpg], a[href$=.gif], a[href$=.gif]')) {\n //Create figure, figcaption and open image in modal box\n $('.modal-box').append('<div class=\"single figure\"><div class=\"figcaption\">' + title + '<button class=\"btn-close\">Закрыть</button></div><img src=\"' + href + '\" alt=\"\" /></div><div class=\"footer\"></div>');\n $.getScript('/a/js/modal-box.js');\n $('.modal-box').fadeIn('300');\n $('.overlay').fadeIn('300');\n } else {\n //Load HTML in modal box\n $('.modal-box').load(href, function () {\n $.getScript('/a/js/modal-box.js');\n });\n $('.modal-box').fadeIn('300');\n $('.overlay').fadeIn('300');\n }\n $(document).keydown(function (e) {\n if (e.keyCode == 27) {\n $('.modal-box').fadeOut('fast').empty();\n // $('.modal-box').empty();\n $('.overlay').fadeOut('fast');\n }\n });\n });\n}", "title": "" }, { "docid": "cfe4845ed381beaf7c77707ca56f24ce", "score": "0.6541183", "text": "clickForaModal(event) {\n if (event.target === this.contantainerModal) {\n this.toggleModal();\n }\n }", "title": "" }, { "docid": "0627786803cd6e76c97eede9fb921f37", "score": "0.65108263", "text": "function handleClickEvent(handler) {\n\tif (isModuleStarter(handler)){\t\n\t\thandler.on(\"click\", function(e){\n\t\t\te.preventDefault();\n\t\t\talert(\"I've been clicked\");\n\t\t\tloader.loadView(\"Authenticator\", \"content.plugin\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "b8af6bb8feb0c05a0955036eda80642e", "score": "0.6495721", "text": "function clickListeners(context) {\n $(context).find(\".showProfile\").once(\"profile-link-listener\").each(function () {\n $(this).click(function (e) {\n e.preventDefault();\n loadModal(\"profile\", $(this).attr('data-id'));\n });\n });\n $(context).find(\".loadDonateForm\").once(\"donate-link-listener\").each(function () {\n $(this).click(function (e) {\n e.preventDefault();\n var donationModal = cpfModal.find('.cfpModalContentWrapper #donate-form');\n if (donationModal.length > 0) {\n presentModal('donate-form');\n }\n else {\n loadModal('donate', $(this).attr('data-id'));\n }\n });\n });\n $(\".cfpLoginForm\").once(\"cfp-login-link-listener\").each(function () {\n $(this).click(function (e) {\n e.preventDefault();\n var loginModal = cpfModal.find('.cfpModalContentWrapper #logn-form');\n if (loginModal.length > 0) {\n presentModal('logn-form');\n }\n else {\n var id = $(this).attr('data-id');\n var redirect_url = $(this).attr('data-redirect');\n var anim_in = $(this).attr('data-animin');\n var anim_out = $(this).attr('data-animout');\n var type = $(this).attr('data-type');\n if(drupalSettings.user.uid > 0){\n window.location = $(this).attr('href');\n } else {\n loadLoginModal(type, id, redirect_url, anim_in, anim_out);\n }\n }\n });\n });\n }", "title": "" }, { "docid": "f77a8021e1c12e96b8f0be91ea44c84c", "score": "0.64952016", "text": "function modalClick(e, menuID){\r\n if($(e.target).hasClass('modal-trigger')){\r\n // e.stopImmediatePropagation()\r\n console.log(menuID);\r\n console.log(menuList);\r\n var menuObj = $.grep(menuList, function(obj){return obj.Id == menuID;})[0];\r\n console.log(menuObj);\r\n $(\"#modalTitle\").text(menuObj.Title)\r\n $(\"#modalBody\").text(menuObj.Description)\r\n $('#modalImage').attr('src',menuObj.Image)\r\n $('.modal').modal();\r\n }\r\n}", "title": "" }, { "docid": "6247c3186a6a62eecf9bb34152f43be3", "score": "0.64818466", "text": "function abreModal() {\n $('#myModal').modal('show');\n}", "title": "" }, { "docid": "96d98d3500bb1f9636d74e5571ecd236", "score": "0.64692795", "text": "function modalClick(d) {\n $(\"#modal-title\").text(d.name);\n $(\"#modal-url\").text(d.url).attr(\"href\", d.url);\n $(\"#exampleModalCenter\").modal({ show: true });\n }", "title": "" }, { "docid": "4583ea83843cbfb897d75a352beb8164", "score": "0.64381", "text": "function modalBoxShow() {\n $(\"#how\").click(function() {\n $(\"#modal\").show();\n });\n\n $(\"#gotIt\").click(function() {\n $(\"#modal\").hide();\n });\n }", "title": "" }, { "docid": "9476ae908e513decbe983c348bf215f6", "score": "0.642793", "text": "function handleModalPopup() {\n let modal = document.querySelector(\".modal\");\n modal.style.display=\"block\";\n }", "title": "" }, { "docid": "c4a9db8d7070bb7f57000f737da53853", "score": "0.6425523", "text": "function emailSentPop(){\n $(\".sentMail\").click(function(){\n $(\"#sentMail\").modal();\n });\n}", "title": "" }, { "docid": "78606e785d3088b7ce0583a9d2139a20", "score": "0.6408393", "text": "function initModal(){\n // Get the modals\n var modal = document.getElementById(\"myModal\");\n var editModal = document.getElementById(\"editModal\");\n\n // Get the <span> element that closes the modal\n var span1 = modal.getElementsByClassName(\"close\")[0];\n\n // When the user clicks on <span> (x), close the modal\n span1.onclick = function() {\n modal.style.display = \"none\";\n }\n\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "50454550be1eb281f4c65f263b29077c", "score": "0.64062107", "text": "setupModal() {\n this.elements.modal.addEventListener(\"click\", function(event) {\n if (this.elements.modal === event.target) {\n this.closeModal()\n }\n }.bind(this))\n\n this.elements.modalClose.addEventListener(\"click\", function(event) {\n this.closeModal()\n }.bind(this))\n\n // On mobile devices we want to hide the prev/next buttons on a click on the mobile\n this.elements.modalContent.addEventListener(\"click\", (event) => {\n if (this.elements.modalContent.className.endsWith(\" clicked\")) {\n let classes = this.elements.modalContent.className\n this.elements.modalContent.className = classes.substring(0, classes.length - 8)\n } else {\n this.elements.modalContent.className += \" clicked\"\n }\n })\n }", "title": "" }, { "docid": "13f09db3aa9cd7fa4029ba69b625b199", "score": "0.6402919", "text": "function modalshow() {\n $('.ui.modal.join').modal('show');\n}", "title": "" }, { "docid": "b3bccb1f41e2967e99892a7baba1dcf1", "score": "0.63912314", "text": "setModalBehaviour(){\n window.onclick = function(event) {\n let modals = document.getElementsByClassName(\"modalBackground\");\n \n for (let i = 0; i < modals.length; i++) {\n const modal = modals[i];\n \n if (event.target == modal) {\n let identifier = modal.id.split(\"-\")[1];\n \n modalsController.hideModal(identifier);\n \n }\n \n }\n \n }\n\n }", "title": "" }, { "docid": "0cef970a12eb40b9346f75521861541a", "score": "0.6388622", "text": "function showHandlerModal() {\n var handlerModal = document.getElementById(\"create-handler-modal\");\n var modalBackdrop = document.getElementById(\"modal-backdrop\");\n handlerModal.classList.remove(\"hidden\");\n modalBackdrop.classList.remove(\"hidden\");\n}", "title": "" }, { "docid": "9e5c051a795a31c42b7f9a18816f56b2", "score": "0.6367651", "text": "function onModalLoad()\n{\n /*\n * Form validation\n */\n\n formValidation();\n\n /*\n * Ajax malsup form\n */\n\n ajaxMalsupForm();\n\n /*\n * Select2\n */\n\n select2();\n\n /*\n * Bootstrap Tooltips, Popovers and AJAX Popovers\n */\n\n bsTooltipsPopovers();\n\n /*\n * Form checkbox switch\n */\n\n $('[data-class]').switcher(\n {\n theme: 'square',\n on_state_content: '<span class=\"fa fa-check\"></span>',\n off_state_content: '<span class=\"fa fa-times\"></span>'\n });\n\n /*\n * Styled file input\n */\n\n $('[type=file].styled').pixelFileInput(\n {\n choose_btn_tmpl: '<a href=\"#\" class=\"btn btn-xs btn-primary\">' + _lang['choose'] + '</a>',\n clear_btn_tmpl: '<a href=\"#\" class=\"btn btn-xs\"><i class=\"fa fa-times\"></i> ' + _lang['clear'] + '</a>',\n placeholder: _lang['no_file_selected']\n });\n}", "title": "" }, { "docid": "87827c4ade58151bd3199263b7a6fc6b", "score": "0.6364039", "text": "function loadAssociatedModalsFunctions() {\n $(\"#associateModal\").on('shown.bs.modal', function () {\n $('#associateModalClose, #associateCloseBtn').on('click', function () {\n hideAssociatedModal();\n });\n\n $('#associateSaveBtn').on('click', function () {\n if ($('#companies-dd').val() != '' || $('#investmentAmount').val() != '' || $('#investmentPercent').val() != '') {\n saveAssociatedCompany(2, function (err, resp) {\n if (resp) {\n hideAssociatedModal();\n }\n });\n } else {\n hideAssociatedModal();\n }\n });\n });\n}", "title": "" }, { "docid": "c005ef039196380023c6b6ac1e6d9de7", "score": "0.63298583", "text": "function modalClick (e) {\n const clickTarget = e.target.getAttribute('data-action')\n \n switch (clickTarget) {\n case 'start':\n startGame()\n break\n case 'restart':\n restartGame()\n break\n case 'information':\n showInformationModal()\n break\n case 'upgrade':\n const upgradeName = e.target.getAttribute('data-upgradename')\n upgradeTower(activeCanvasElement.index, upgradeName)\n break\n case 'close':\n break\n case null:\n return\n default:\n console.log('Uncaught data attribute in modal action', clickTarget)\n return\n }\n removeModal()\n }", "title": "" }, { "docid": "0224c0acd92b2e2afaa4d83cca23c221", "score": "0.63249236", "text": "function openEntryModal() {\n $('#button-container').on('click', '.js-create-button', function() {\n $('.container').addClass('opaque');\n $('.js-modal-container').show();\n });\n}", "title": "" }, { "docid": "f9201d467e4a03ea04d783c3fa5c0b79", "score": "0.6321001", "text": "handleClick(event) {\n\t\tif(event.button == 1){\n\t\t\tthis.openModal();\n\t\t}else if(event.button == 2){\n\t\t\tthis.changeVisibility();\n\t\t}\n\t}", "title": "" }, { "docid": "9dcbe50c132a2617b4f3eed8d83a71fa", "score": "0.6317447", "text": "function bind_transcript_reveal( element_name, modal_name ){\n\t$( element_name ).click(function(){\n\t\t$( modal_name ).foundation('reveal', 'open');\n\t});\n}", "title": "" }, { "docid": "293659d72e858141975c4a8823610ee4", "score": "0.6315736", "text": "function modalDisplay(){\n $(\"#exampleModal\").modal(\"show\");\n $(\"#okDelModalBtn\").hide();\n $(\"#completeModalBtn\").hide();\n $(\"#checkModalBtn\").hide();\n}", "title": "" }, { "docid": "61c65de57d41bc9dc419248f7ab3a367", "score": "0.63137025", "text": "function startModal(){\n\t$(\"#startModal\").modal();\n\t$(\".startModalClass\").on(\"click\",function(){\n\t\t\tstartGame();\n\t});\n}", "title": "" }, { "docid": "1543ca298683e73c44c5764c9b1aef82", "score": "0.6302189", "text": "function taskModal(){\n let section = document.body.querySelector('#modals');\n section.innerHTML += newTaskModal;\n section.addEventListener('click',handleGeneralModal);\n\n}", "title": "" }, { "docid": "39b928bc8090be84f2e4e7a39b03a966", "score": "0.6291173", "text": "function add_item(){\n\t$('#mod_add_item').modal();\n}", "title": "" }, { "docid": "6c6c045010859c0ccf3c84d3b6e32a4c", "score": "0.62863916", "text": "function listenLogin() {\n $('.login-link').on('click', function () {\n toggleLoginModal();\n });\n}", "title": "" }, { "docid": "3ed44022f1ea498773fe5accc5bea8cf", "score": "0.6285607", "text": "function luarModal(e) {\n if (e.target == modal) {\n modal.style.display = 'none';\n }\n }", "title": "" }, { "docid": "765c98ce3ba4f5ca5d618958bba4ebf2", "score": "0.62792", "text": "function openModal(){\n\n // Ouvrir la modal au click sur les boutons\n $('button').click(function(){\n\n // Afficher le titre du projet\n var modalTitle = $(this).prev().text()\n $('#modal span').text(modalTitle);\n\n var modalImage = $(this).parent().prev().attr('src')\n $('#modal img').attr('src', modalImage ).attr('alt, modalTitle');\n\n\n $('#modal').fadeIn();\n });\n\n // Fermer la modal au click sur .fa-times\n $('.fa-times').click(function(){\n $('#modal').fadeOut();\n });\n }", "title": "" }, { "docid": "1e168eaa8daaca4ccc552068e22e0a1f", "score": "0.6270968", "text": "function addModoalListeners() {\n //add event listener for Modal\n let modalView = document.querySelectorAll('.bksModal')\n let closemdl = document.querySelectorAll('.close')\n let mdlbtn = document.querySelectorAll('.modalbtn')\n //help from src:https://blr.design/blog/multiple-modals/ to make multiple modals work\n let modalArray = Array.from(mdlbtn).entries()\n for (let [index, btn] of modalArray) {\n function show() {\n modalView.forEach(modal => modal.style.display = \"none\") //closes all modals before opening a new one\n modalView[index].style.display = \"block\"\n }\n function hide() {\n modalView[index].style.display = \"none\"\n }\n btn.addEventListener(\"click\", show)\n closemdl[index].addEventListener(\"click\", hide)\n }\n}", "title": "" }, { "docid": "b3abf63e22741e5bc92bf193c1291531", "score": "0.62704766", "text": "function startModal(btn, modal, myspan){\r\n// When the user clicks the button, open the modal \r\nbtn.onclick = function(){\r\n modal.style.display = \"block\";\r\n}\r\n\r\nmyspan.onclick = function(){\r\n modal.style.display = \"none\";\r\n}\r\n\r\nwindow.onclick = function(event){\r\n if (event.target === modal){\r\n modal.style.display = \"none\";\r\n }\r\n}\r\n\r\n}", "title": "" }, { "docid": "17c492ca2d7dc8b013857b2d5c631404", "score": "0.626957", "text": "function applyClickHandler(){ \n $(\"#findMore\").click(showMap);\n $(\".backToList\").click(backToList);\n $(\".reset\").click(startOver);\n $(\"#logo\").click(startOver);\n $(\".tablinks\").click(openTab);\n $(\"#pac-input\").hide();\n modalActivity();\n openTab({\n target: {\n innerHTML: \"Nutrition\",\n },\n currentTarget: $(\".tab .tablinks:nth-child(1)\")[0]\n })\n\n\n}", "title": "" }, { "docid": "35fa4417e84864a89aeabec7ba0a46da", "score": "0.6259341", "text": "function _loadModals()\n {\n _loadTravelerModal();\n _loadFauModal();\n\n //Cleanup the modal when we're done with it!\n $scope.$on('$destroy', function() \n {\n $scope.travelerModal.remove();\n $scope.fauModal.remove();\n });\n // Execute action on hide modal\n $scope.$on('modal.hidden', function() \n {\n // Execute action\n });\n // Execute action on remove modal\n $scope.$on('modal.removed', function() \n {\n // Execute action\n });\n\n function _loadTravelerModal()\n {\n $ionicModal\n .fromTemplateUrl('app/requests/request.modal.html', {\n scope: $scope\n , animation: 'slide-in-up'\n })\n .then(function(modal) \n {\n $scope.travelerModal = modal;\n });\n }\n function _loadFauModal()\n {\n $ionicModal\n .fromTemplateUrl('app/requests/request/summary/summary.fau-modal.html', {\n scope: $scope\n , animation: 'slide-in-up'\n })\n .then(function(modal) \n {\n $scope.fauModal = modal;\n });\n }\n }", "title": "" }, { "docid": "b8060b9455e18bc766cd29aff8807fba", "score": "0.6257119", "text": "function initModals(){\n\t$('.button_video_show,.button_video_edit, .button_video_delete, #button_user_edit, .thumbnail_session_tearsheet').off('click'); // removes delegated events as well\n\t\n\t// bind \"watch\" button from videos/index.html.erb and \"edit\" button from users/edit.html.erb\n\t$(document).on('click', '.button_video_show, #button_user_edit, .thumbnail_session_tearsheet', function(event){\n\t\tvar url = $(this).attr('href'); // url may contain parameters specifying video id, etc.\n\t\tvar modalTitle = $(this).data(\"modal-title\"); // data attribute in html is \"modal_title\" but the underscore is turned into a dash, generating \"modal-title\" for use in jquery\n\t\tvar preloader = $(\"#mainModal .preloader\");\n\t\tvar modalBodyContent = $(\"#mainModal .modal-body-content\");\n\t\t\t\n\t\tmodalBodyContent.hide(); // clear content, if any, from previous modal opened.\n\t\tpreloader.show();\n\t\t\t\n\t\t// Open empty modal\n\t\t$('#mainModal').showModal({\n\t\t\ttitle: modalTitle,\n\t\t\tbody: \"\",\n\t\t\tcallback: function(){\n\t\t\t}\n\t\t});\n\t\t\n\t\tloadContent(url);// Get video or user (ultimately, from an Amazon S3 object - in show action of video controller)\n\t\tevent.preventDefault();\n\t});\n\t\n\t// bind \"edit\" button from videos/index.html.erb\n\t$(document).on('click', '.button_video_edit', function(event){\n\t\tvar url = $(this).attr('href'); // url contains parameters specifying video id, etc.\n\t\tloadContent(url)\t\n\t\tevent.preventDefault();\n\t});\n\t\n\t// bind \"delete\" button from videos/index.html.erb\n\t$(document).on('click', '.button_video_delete', function(event){\n\t\tvar url = $(this).attr('href'); // url contains parameters specifying video id, etc.\n\t\tvar videoName = $(this).data(\"video\");\n\t\tvar videoID = url.replace(\"/videos/\", \"\");\n\t\tvar video_selector = \".video_\" + videoID;\n\n\t\t$('#mainModal').showModal({\n\t\t\ttitle: \"Video: \" + videoName,\n\t\t\tbody: \"<p>Are you sure you want to delete this video?</p>\",\n\t\t\tdefaultBtn: \"Cancel\",\n\t\t\tprimaryBtn: \"Delete\",\n\t\t\tcallback: function(){\n\t\t\t\t$(\"#btn-primary\").off('click');\n\t\t\t\t$(\"#btn-primary\").on('click', function(){\n\t\t\t\t\t$(\"#mainModal\").modal(\"hide\"); // hide modal\n\t\t\t\t\t$(video_selector).slideUp(500);\t// video thumbnail row is faded out but not deleted until after controller executes destroy action\t\n\t\t\t\t\t\n\t\t\t\t\t// List of ajax events: http://api.jquery.com/Ajax_Events/\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype: \"DELETE\", // The type of request to make (\"POST\" or \"GET\"), default is \"GET\". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.\n\t\t\t\t\t\turl: url,\n\t\t\t\t\t\tdata: \"\",\n\t\t\t\t\t\tsuccess: function(){ // success callback\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(){\n\t\t\t\t\t\t\t\t$('#mainModal').showModal({\n\t\t\t\t\t\t\t\t\ttitle: \"Notification\",\n\t\t\t\t\t\t\t\t\tbody: \"<p>Your video can not be deleted at this time.</p>\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t$(video_selector).slideDown(500);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdataType: \"script\"\n\t\t\t\t\t}); // $.ajax\n\t\t\t\t}); // $(\"#btn-primary\").on()\n\t\t\t} // callback\n\t\t}); // $('#mainModal')\n\t\t\n\t\tevent.preventDefault();\n\t});\n}", "title": "" }, { "docid": "38f6c6c2659702b90d09da331e8923fd", "score": "0.62543577", "text": "function modal(){\n $('#myModal').modal('show')\n}", "title": "" }, { "docid": "62d2258e23381e10208870f1aa877603", "score": "0.6244099", "text": "function contacts(){$('#contacts_popup').arcticmodal();}", "title": "" }, { "docid": "208a51c23d0ca6afbd8882650fbd5266", "score": "0.6239699", "text": "function OnClicks() {\n\n //get your modal body by id and change its html\n\n modpara.innerHTML = `STEP 2 OF 3`;\n modalbdy.innerHTML = modboddy;\n\n //get your modal body content by id and change its css\n\n // changing css of h1\n let headingh1 = document.getElementById(`headh1`);\n\n headingh1.style.fontFamily = `Georgia`;\n headingh1.style.fontSize = `28px`;\n\n // changing css of para\n let para = document.getElementById(`parah1`);\n para.style.fontSize = `13px`;\n\n // changing css of buttons\n\n btn();\n MouseOver();\n MouseOut();\n LinKs();\n }", "title": "" }, { "docid": "298dcbc699d70ee5d5eebb67820d04f0", "score": "0.6239391", "text": "events() {\n // When a button for opening the modal overlay is clicked...\n this.openModalButton.click(this.openModal.bind(this));\n\n // When the button for closing the modal overlay is clicked...\n this.closeModalButton.click(this.closeModal.bind(this));\n\n // When any key is pressed and released...\n $(document).keyup(this.keyPressHandler.bind(this));\n }", "title": "" }, { "docid": "7adf8276bbe2e41722dabd66aa52bd6b", "score": "0.6235987", "text": "function apriProfilo() {\r\n\t\r\n $('#modalProfilo').modal('show');\r\n\r\n\tvar bottoneModificaNome = document.getElementById(\"modificaNomeUtente\");\r\n\t bottoneModificaNome.addEventListener(\"click\", modificaNomeUtente, false);\r\n\tvar bottoneModificaPassword = document.getElementById(\"modificaPassword\");\r\n\t bottoneModificaPassword.addEventListener(\"click\", modificaPassword, false);\r\n\tvar bottoneModificaEmail = document.getElementById(\"modificaEmail\");\r\n\t bottoneModificaEmail.addEventListener(\"click\", modificaEmailUtente, false);\r\n\t\r\n}", "title": "" }, { "docid": "96bbf8bf2a8230f0bc98f1804ecbd526", "score": "0.62325335", "text": "function setClickHandlers(items){\r\n // Click handler for \"edit\" functionality\r\n $('.show-input-field:not(.atwork-prem-awards-processed)')\r\n .addClass('atwork-prem-awards-processed')\r\n .bind('click', function (){\r\n editButtonClickHandler($(this));\r\n });\r\n\r\n // Click handler for \"cancel\" functionality\r\n $(\".cancel-show-input-field:not(.atwork-prem-awards-processed)\")\r\n .addClass('atwork-prem-awards-processed')\r\n .bind('click', function (){\r\n cancelButtonClickHandler($(this));\r\n });\r\n\r\n // Click handler for \"cancel\" functionality\r\n $(\".save-form-field:not(.atwork-prem-awards-processed)\")\r\n .addClass('atwork-prem-awards-processed')\r\n .bind('click', function (){\r\n saveButtonClickHandler($(this), uid);\r\n });\r\n\r\n // Click handler to add new form\r\n $(\".add-new-form:not(.atwork-prem-awards-processed)\")\r\n .addClass('atwork-prem-awards-processed')\r\n .bind('click', function (){\r\n var blankForm = '';\r\n blankForm = newForm(items);\r\n $('.add-new-form').before(blankForm);\r\n setClickHandlers(items);\r\n });\r\n // Submit handler - this simply redirects form to video\r\n form = dialog.find(\"form\").on(\"submit\", function(event) {\r\n event.preventDefault();\r\n redirectSubmit();\r\n });\r\n }", "title": "" }, { "docid": "25045e8a59094403ab8c43f336e62931", "score": "0.6232344", "text": "bindEvents() {\n document.addEventListener('click', event => {\n if (event.target.closest(SELECTORS.BUTTON_TRIGGER)) {\n event.preventDefault();\n this.modal.show();\n return;\n }\n });\n\n this.modal.getBody().find(SELECTORS.FIELD_TYPE).on(\"change\", () => {\n this.displayLists();\n });\n\n this.modal.getBody().find(SELECTORS.BUTTON_COLLAPSE).on(\"click\", (event) => {\n event.preventDefault();\n event.target.closest(\".collapsible\").classList.toggle('collapsed');\n return false;\n });\n\n this.modal.getBody().find(\"#enrol_simplesco_liste1\").on(\"change\", (event) => {\n this.refreshSearchLists(event.target);\n });\n\n this.modal.getBody().find(SELECTORS.BUTTON_SEARCH).on(\"click\", (event) => {\n event.preventDefault();\n this.search();\n return false;\n });\n this.modal.getBody().find(SELECTORS.FIELD_SEARCH).on(\"keypress\", (event) => {\n if(event.which === 13){\n event.preventDefault();\n this.search();\n return false;\n }\n });\n\n this.modal.getBody().on(\"click\", SELECTORS.BUTTON_LOADMORE, (event) => {\n event.preventDefault();\n this.search(true);\n return false;\n });\n this.modal.getBody().on(\"click\", SELECTORS.BUTTON_ENROL, (event) => {\n event.preventDefault();\n const userid = $(event.target).attr(\"value\");\n this.enrol(userid);\n return false;\n });\n }", "title": "" }, { "docid": "9c5108c90e02f92a2060c3161b2f48c4", "score": "0.6230517", "text": "function addClicks(){\n $( \"#post-list\" ).on( \"click\", \".clickable-post\", function () {\n\n let postTitle = $(this).find(\".post-title\").html();\n let postBody = $(this).find(\".post-body\").html();\n let modal = document.getElementById(\"myModal\");\n modal.style.display = \"block\";\n\n let titleElt = modal.getElementsByClassName(\"post-title-holder\")[0];\n titleElt.innerHTML = postTitle;\n\n let bodyElt = modal.getElementsByClassName(\"post-body-holder\")[0];\n bodyElt.innerHTML = postBody;\n bodyElt.style.display = \"inline-block\";\n });\n\n $(\"#entry-section\").on( \"click\", \".my-post\", function(){\n let clickedId = $(this).find(\".post-id\").html();\n $(\".clickable-post\").find(\".post-id\").each(function(index, value){\n if(value.innerHTML == clickedId){\n $(this).parent().click();\n }\n });\n });\n}", "title": "" }, { "docid": "68f9f73551593d2fde1ba49303baeba6", "score": "0.622759", "text": "function showUpdateHandlerModal() {\n var handlerModal = document.getElementById(\"update-handler-modal\");\n var modalBackdrop = document.getElementById(\"modal-backdrop\");\n handlerModal.classList.remove(\"hidden\");\n modalBackdrop.classList.remove(\"hidden\");\n}", "title": "" }, { "docid": "9d7e22bc7be3c721c113e37c071910ae", "score": "0.62199104", "text": "function btClick() {\n modal.style.display = \"block\";\n }", "title": "" }, { "docid": "e22c8d11f697bdafbcb571b9242b1579", "score": "0.6213836", "text": "function openModal(e) {\n\n\t\t// Add the overlay.\n\t\t\n $('body').prepend(overlay);\n $('.modal-overlay').fadeIn(400);\n\t\t$(e.currentTarget).parents('.our-project').find('.modal').attr('data-modal', 'visible')\n $(e.currentTarget).parents('.our-project').find('.modal').fadeIn(400)\n $(e.currentTarget).parents('.our-project').find('.modal').css('visibility', 'visible');\n }", "title": "" }, { "docid": "0a796819c5c7c0571e0a64b5fd669b35", "score": "0.62125695", "text": "function handleModalClick(e) {\n $('.close').off('click');\n $('.overlay').off('click');\n $('.dialog-container').hide();\n $('main').on('click', '.dog', handleImgClick);\n}", "title": "" }, { "docid": "0c7c2a88b5b31badd3cbf3ac3be5c806", "score": "0.6193709", "text": "function openModal(){modal.style.display='block';}", "title": "" }, { "docid": "90f14074d8cae79a7e805e6de70ae7d8", "score": "0.6193076", "text": "function initialize_view_friend_plan_modal()\n{\n // Opening click handler\n $('.view_friends_plans').click(function(){\n $('#friends_plans_panel').show('fast');\n });\n \n // Closing click handler\n $('#cancel_friends_panel').click(function () {\n // Hide and reset the modal\n $('#friends_plans_panel').hide('fast', function () {\n // Reset\n $('#friend_plan_list').css('display', 'none');\n $('#friend_modal_content').css('display', '');\n });\n });\n \n // Friend tab click handler\n $('.friend_tab').click(function(){\n var friend_id = $(this).attr('user_id');\n load_friend_plans(friend_id);\n });\n \n // Draggable (with a handle).\n $('#friends_plans_panel').draggable({\n handle: '.title_bar'\n });\n}", "title": "" }, { "docid": "5d4656b551ed1262dd23acd17dc93765", "score": "0.6190216", "text": "function mostrarModal(that) {\n $('.ocultable').attr('aria-hidden', 'true');\n\n $(that).find(\".modal\").modal({ keyboard: false, backdrop: \"static\", dismiss: \"modal\" });\n $(that).find(\".modal\").modal('show');\n }", "title": "" }, { "docid": "eeb95eac85bcfaf96ecc838af94d29a0", "score": "0.6182146", "text": "function onclickFunc() {\r\n modal.style.display = \"block\";\r\n}", "title": "" }, { "docid": "faf3d9b19375681d79da37b96b37ec6e", "score": "0.61750954", "text": "modal(action) {\n\t\t$(this.modalUI).modal(action);\n\t}", "title": "" }, { "docid": "faf3d9b19375681d79da37b96b37ec6e", "score": "0.61750954", "text": "modal(action) {\n\t\t$(this.modalUI).modal(action);\n\t}", "title": "" }, { "docid": "3b9ca2f4dd7a09accb9da48d10006a0e", "score": "0.61736405", "text": "__initHandler (event) {\n let target = event.target;\n\n while (target && target !== document) {\n if (target.dataset && target.dataset.toggle === 'modal') {\n event.preventDefault();\n\n this.target = document.querySelector(target.dataset.target);\n\n return this.show()\n }\n\n target = target.parentNode\n }\n }", "title": "" }, { "docid": "bb695ba5d9a95fa9ea7a22203f42e174", "score": "0.61723983", "text": "function openModal(){ modal.style.display = 'block'; }", "title": "" }, { "docid": "5e36cb0861a7ec6c106d6e118f69a9cf", "score": "0.6164585", "text": "function openAddSpecificComponentModalFuntion() {\n $(function () {\n function reposition() {\n var modal = $(this),\n dialog = modal.find('.modal-dialog');\n modal.css('display', 'block');\n\n // Dividing by two centers the modal exactly, but dividing by three \n // or four works better for larger screens.\n dialog.css(\"margin-top\", Math.max(0, ($(window).height() - dialog.height()) / 3));\n }\n // Reposition when a modal is shown\n $('.modal').on('show.bs.modal', reposition);\n // Reposition when the window is resized\n $(window).on('resize', function () {\n $('.modal:visible').each(reposition);\n });\n });\n $(\"#AddSpecificComponentModal\").modal('show');\n }", "title": "" }, { "docid": "b89d8ad0526368d6bf2f9251944f02f5", "score": "0.61600614", "text": "function launchModal() {\n // Set a `disabled` attribute on all the [data-editable] buttons\n // when each button is clicked to launch the edit modal, to avoid\n // multiple clicks resulting to modal errors.\n\n for (let i = 0; i < btns.length; i++) {\n btns[i].setAttribute('disabled', '');\n }\n\n // If the modal does not have a `visible` class, add a `visible` class.\n if (false === modal.classList.contains('visible')) modal.classList.add('visible');\n\n modal.setAttribute('id', `${btnTextLower}_edit`);\n\n // Set modal title based on the innerText of the button clicked.\n modalTitleElem.innerText = `Edit ${btnText}`;\n\n // Set modal description based on the innerText of the button clicked.\n modalDescElem.innerHTML = btnDesc;\n\n // Loop through the theme selector buttons and add its class to <body>.\n for (let i = 0; i < themeBtn.length; i++) {\n themeBtn[i].addEventListener('click', event => {\n let targetTheme = `theme-${event.target.innerText.toLowerCase()}`;\n body.classList.value = targetTheme;\n }, false);\n }\n\n }", "title": "" }, { "docid": "e876d98617b4ec6ec0d12694933295cf", "score": "0.615242", "text": "function productModal() {\n $('#productModal').modal();\n}", "title": "" }, { "docid": "ba036b47c9a654a205cae2a1cee3a4fd", "score": "0.61518586", "text": "handle_click(e) {\n\t\tvar sender = e.target;\n\n\t\tswitch (sender.className) {\n\t\t\tcase 'scifi-nav__orbit':\n\t\t\t\tthis.show_modal();\n\n\t\t\t\tthis.set_project_index(this.nav_count(sender));\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'scifi-nav__satellite':\n\t\t\t\tthis.show_modal();\n\n\t\t\t\tthis.set_project_index(this.nav_count(sender));\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'modal__bg':\n\t\t\t\tthis.hide_modal();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'buttons__next':\n\t\t\t\tthis.change_item(true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'buttons__prev':\n\t\t\t\tthis.change_item(false);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'buttons__close':\n\t\t\t\tthis.hide_modal();\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "efa852a9f4ab85d4c2b24183127990ae", "score": "0.61513156", "text": "function windowOnClick(event) {\n if (event.target === document.querySelector(\".modal\")) {\n toggleModal();\n }\n }", "title": "" }, { "docid": "5afea8cc81b705d8ff18e9ff5ee6d138", "score": "0.6148047", "text": "showModal() {\n this.modal.modal(\"show\");\n this.appendBasicInfo();\n this.appendAttributes();\n this.selectAttributes();\n this.addNewCategory();\n this.appendDimentions();\n this.appendVariants()\n this.appendProductImgs()\n this.appendAditionalInfo();\n this.activatefunctions();\n }", "title": "" }, { "docid": "3d41599e2a5f1ddc3c0800ba796f0fa4", "score": "0.6146691", "text": "function attachClickEvent() {\n google.maps.event.addListener(marker, \"click\", setModalDisplay);\n }", "title": "" }, { "docid": "45c1acb3efb2f33e6edef47ecd95742c", "score": "0.6146656", "text": "addEventosModal() {\n // Adiciona o evento para abrir o modal.\n // Evento executa o método ativarModal. (linha 16)\n this.btnAtivar.addEventListener(\"click\", this.ativarModal);\n\n // Seleciona o botão de fechar do modal.\n const btnFechar = this.modal.querySelector(\".btn-fechar\");\n\n // Adiciona o evento de click no botão.\n // Evento executa o método fecharModal (linha 20).\n btnFechar.addEventListener(\"click\", this.fecharModal);\n\n // Adiciona o evento de click no container do modal.\n // Evento executa uma função que precisa do Event (e).\n this.modalContainer.addEventListener(\"click\", (e) => {\n // Seleciona o alvo do evento\n const alvo = e.target;\n\n // Testa se o alvo do evento, onde foi clicado, é...\n // ... igual ao elemento que recebe o evento, no caso modalContainer.\n if (alvo === e.currentTarget) {\n // Executa o método fecharModal (linha 20).\n this.fecharModal();\n }\n });\n\n // Testa se existe uma opção \"não\" dentro do modal.\n if (this.modal.querySelector(\"#nao\")) {\n // Caso exista adiciona o evento de \"click\" nele.\n // O evento executa o método fecharModal. (linha 20)\n this.modal.querySelector(\"#nao\").addEventListener(\"click\", this.fecharModal);\n }\n }", "title": "" }, { "docid": "e5ec09ed583d8fba97274c6b4c597d06", "score": "0.6143117", "text": "function openModal() {\n /* Get trigger element */\n var modalTrigger = document.getElementsByClassName('jsModalTrigger');\n\n /* Set onclick event handler for all trigger elements */\n for(var i = 0; i < modalTrigger.length; i++) {\n modalTrigger[i].onclick = function() {\n var target = this.getAttribute('href').substr(1);\n var modalWindow = document.getElementById(target);\n console.log(\"opened modal\");\n modalWindow.classList ? modalWindow.classList.add('open') : modalWindow.className += ' ' + 'open'; \n }\n } \n }", "title": "" }, { "docid": "8111faefe8b38c045c08f2bb3affc56c", "score": "0.61425775", "text": "addClickHandler() {\n this.$el.find(this.settings.menuGroupTitleSelector).on('click', e => {\n e.preventDefault();\n e.stopPropagation();\n window.open(this.menu.find(this.settings.firstItemSelector).first().attr('href'), e.metaKey ? '_blank' : '_self');\n });\n this.toggler.on('click', e => {\n e.preventDefault();\n e.stopPropagation();\n this.menu.toggleClass(this.settings.visibleCssClass);\n this.setTogglerIcon(this.settings.icon.selector);\n });\n }", "title": "" }, { "docid": "f419125b836db26b646b14660870124f", "score": "0.61346024", "text": "function modal_bind_like() {\n //modal bonding like\n //onece page load add modal trigger\n const like_text = document.querySelectorAll('.like');\n\n //click on the button on each like text to open modal\n like_text.forEach(element => {\n //check if already add event listenr\n if(element.getAttribute('show_like') === null){\n element.addEventListener('click',(e) => {\n myModal.style.display =\"block\";\n display_like(e);\n })\n element.setAttribute('show_like',true);\n }\n })\n\n //click on the x to close the modal\n cross.onclick = function() {\n close_modal();\n }\n}", "title": "" }, { "docid": "98244cd32e59b877ad922f651511ba48", "score": "0.61320776", "text": "function startPageModal(){\n// Get the modal\n var modal = document.getElementById('modal');\n\n// Get the button that opens the modal\n var btn = document.getElementById(\"popUpButton\");\n\n// Get the <span> element that closes the modal\n var span = document.getElementsByClassName(\"close\")[0];\n\n // When the user clicks on the button, open the modal\n btn.onclick = function() {\n console.log(modal);\n modal.style.display = \"block\";\n }\n\n // When the user clicks on <span> (x), close the modal\n span.onclick = function() {\n modal.style.display = \"none\";\n }\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n //window.onload = startPageModal;\n}", "title": "" }, { "docid": "f0d0202be380ca207440fb15c48a2834", "score": "0.61319876", "text": "function leftBrainClicked(){\n hideAllModals();\n brainLeftModal.style.display = \"block\"; //Display brain modal\n}", "title": "" }, { "docid": "7872d87fe6718399060be792117086e6", "score": "0.6125915", "text": "function openModal() {\n /* Get trigger element */\n var modalTrigger = document.getElementsByClassName('jsModalTrigger');\n\n /* Set onclick event handler for all trigger elements */\n for(var i = 0; i < modalTrigger.length; i++) {\n modalTrigger[i].onclick = function() {\n var target = this.getAttribute('href').substr(1);\n var modalWindow = document.getElementById(target);\n\n modalWindow.classList ? modalWindow.classList.add('open') : modalWindow.className += ' ' + 'open'; \n }\n } \n }", "title": "" }, { "docid": "94b42597e2c7c2e8af06fc3ee4642bc7", "score": "0.6124683", "text": "openModal(mod) {\r\n if (mod === null) return;\r\n mod.classList.add(\"active-popup\");\r\n overlay.classList.add(\"active\");\r\n }", "title": "" }, { "docid": "ba375378767db95da69f8d29eaea62e3", "score": "0.61238897", "text": "function displayChooseItem() {\n $(\"#modal_chooseItem\").modal(\"show\");\n\n}", "title": "" }, { "docid": "ba375378767db95da69f8d29eaea62e3", "score": "0.61238897", "text": "function displayChooseItem() {\n $(\"#modal_chooseItem\").modal(\"show\");\n\n}", "title": "" }, { "docid": "34b84f7f468db12700d372ee6e50050e", "score": "0.61171174", "text": "cliqueForaModal(event) {\n if (event.target === this.containerModal) {\n this.toggleModal();\n }\n }", "title": "" }, { "docid": "a127d3aa625b4c08e5313401ea7797e2", "score": "0.6113025", "text": "function show(e) {\n var id = $(e).attr(\"data-id\");\n var modal = $(\".modal\");\n var modalContentBtn = $(\".modal-content-btn\");\n var showButton;\n\n var linkovi = $(\".linkovi\");\n linkovi.each(function() {\n if ($(this).attr(\"id\") == id) {\n modal.css(\"display\", \"block\");\n showButton = $(this).parent().clone();\n showButton.css(\"display\", \"block\");\n showButton.appendTo(modalContentBtn);\n }\n });\n\n var closeBtn = $('.cursor');\n closeBtn.click(function () {\n modal.css(\"display\", \"none\");\n modalContentBtn.empty();\n });\n}", "title": "" }, { "docid": "c0e05a4aca70bb81fc5460a79877a1fc", "score": "0.61108094", "text": "function modalOkClick(event) {\n document.getElementById('modal').style.display = 'none';\n if (modalOkCallback) modalOkCallback(event);\n}", "title": "" }, { "docid": "e8254b955cc5e50792acf55694bb1716", "score": "0.6108255", "text": "function show_items(){\n items_modal.open();\n }", "title": "" }, { "docid": "26d416ae39830724f2dedceef6b59ba4", "score": "0.61070144", "text": "function register_event_handlers()\n {\n \n \n /* button #btn-sd */\n $(document).on(\"click\", \"#btn-sd\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\"#sd\")); \n return false;\n });\n \n /* button #btn-sair */\n $(document).on(\"click\", \"#btn-sair\", function(evt)\n {\n /* Other options: .modal(\"show\") .modal(\"hide\") .modal(\"toggle\")\n See full API here: http://getbootstrap.com/javascript/#modals \n */\n \n $(\"#md\").modal(\"toggle\"); \n return false;\n });\n \n /* button #btn-sair-sim */\n \n \n /* button #BTN-SAIR-NAO */\n $(document).on(\"click\", \"#BTN-SAIR-NAO\", function(evt)\n {\n /* Other options: .modal(\"show\") .modal(\"hide\") .modal(\"toggle\")\n See full API here: http://getbootstrap.com/javascript/#modals \n */\n \n $(\"#md\").modal(\"toggle\"); \n return false;\n });\n \n /* button #btn-vermelho */\n \n \n /* button #btn-recolher-sd */\n $(document).on(\"click\", \"#btn-recolher-sd\", function(evt)\n {\n /*global uib_sb */\n /* Other possible functions are: \n uib_sb.open_sidebar($sb)\n uib_sb.close_sidebar($sb)\n uib_sb.toggle_sidebar($sb)\n uib_sb.close_all_sidebars()\n See js/sidebar.js for the full sidebar API */\n \n uib_sb.toggle_sidebar($(\"#sd\")); \n return false;\n });\n \n /* button #btn-vermelho */\n $(document).on(\"click\", \"#btn-vermelho\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n }", "title": "" }, { "docid": "8b386368bffa8bf67a2a74d85094b384", "score": "0.6102825", "text": "initEditButtonListener() {\n $('.btn-edit').off('click') // Remove event listener first because this function can be called several times (e.g. after group creation)\n\n $('.btn-edit').on('click', (event) => {\n let item = $(event.currentTarget).parents('li:first')\n let itemId = $(item).data('id')\n this.currentItem = item\n\n // Retrieve item JSON\n this.retrieveCurrentItemJsonById(itemId, JSON.parse(this.menuStructure))\n\n let modal\n switch (item.data('type')) {\n // Group\n case 'group':\n modal = $('#groupModal').modal('open')\n $(\"input[name='label']\", modal).val(item.data('label')).next('label').addClass('active')\n $(\"input[name='icon']\", modal).val(item.data('icon')).next('label').addClass('active')\n break\n\n // Link\n case 'link':\n modal = $('#linkModal').modal('open')\n $(\"input[name='label']\", modal).val(item.data('label')).next('label').addClass('active')\n $(\"input[name='icon']\", modal).val(item.data('icon')).next('label').addClass('active')\n $(\"input[name='url']\", modal).val(item.data('url')).next('label').addClass('active')\n break\n\n // Route link\n case 'route':\n modal = $('#routeLinkModal').modal('open')\n $(\"input[name='label']\", modal).val(item.data('label')).next('label').addClass('active')\n $(\"input[name='icon']\", modal).val(item.data('icon')).next('label').addClass('active')\n $(\"input[name='module']\", modal).val(item.data('module')).next('label').addClass('active')\n $(\"input[name='route']\", modal).val(item.data('route')).next('label').addClass('active')\n break\n }\n })\n }", "title": "" }, { "docid": "05caa8fad56a691453d478bd1f0155ee", "score": "0.60969126", "text": "function instapagoFallo() {\n\n $('#instapagoFallida').modal(\n {\n keyboard: false,\n backdrop: 'static'\n });\n\n $('#instapagoFallida').modal('show');\n \n}", "title": "" }, { "docid": "84b0bad1475aac7b3e6b169df4daa5d9", "score": "0.60916424", "text": "function bindEvents() {\n modalToggle.map(function(element) {\n ML.El.evt(element, 'click', toggleClick);\n });\n\n ML.El.evt(document, 'click', closeClick);\n }", "title": "" }, { "docid": "01e88bae35be8de02a34c29f26073bdf", "score": "0.6087475", "text": "function modalFunctionality() {\n userTopicArray = [];\n // select and initialize modal\n const elemModal = document.querySelector('.modal');\n const instanceModal = M.Modal.init(elemModal);\n\n $('.modal-trigger').click(function(event) {\n event.preventDefault();\n instanceModal.open();\n displayModalTopicChoices();\n });\n}", "title": "" }, { "docid": "69483ad8693bf889896b9867524cbe50", "score": "0.6082422", "text": "function openModal() {\n console.log(\"This has been clicked\");\n var modal = document.getElementById(\"modal\");\n \n modal.style.visibility = \"visible\";\n\n}", "title": "" }, { "docid": "2f6f1956a06e7f5d93deab571873c5a8", "score": "0.6081682", "text": "displayModal(event){\n event.preventDefault();\n $(\"#add-program\").openModal();\n }", "title": "" }, { "docid": "b1daa3e00ef6450dd02e12c29e4497b2", "score": "0.6075947", "text": "function loadUrlModal(heading, url, fucntionOnClickCross, scroll) { \n $('#modalForm').remove();\n var modalUrl =\n $('<div id =\"modalForm\" class=\"modal fade\">' +\n '<div class=\"modal-dialog modal-lg\">' +\n '<div class=\"modal-content\">' +\n '<div class=\"modal-header alert-info\">' +\n '<a id=\"croosModal\" type=\"button\" class=\"close\" >X</a>' +\n '<h4 class=\"modal-title\">' + heading + '</h4>' +\n '</div>' +\n '<div class=\"modal-body\"'+scroll+' >' +\n '<p>Loading...</p>' +\n '</div>' +\n '<div class=\"modal-footer\">' +\n 'Molde' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>');\n\n modalUrl.find('#croosModal').click(function (event) \n { \n modalUrl.modal('hide'); \n });\n\n modalUrl.on('hidden.bs.modal', function ()\n {\n // do something…\n fucntionOnClickCross();\n });\n\n modalUrl.find('.modal-body').load(url);\n modalUrl.modal('show');\n\n}", "title": "" }, { "docid": "91eeb3bf016613249becfd587ecacf35", "score": "0.6072741", "text": "openModal() {\n this.modal.addClass(\"modal--is-visible\");\n // By default, when buttons whose href=# are clicked, the browser will immediately hop to the top of the page.\n // This prevents that default behaviour.\n return false;\n }", "title": "" }, { "docid": "98c0ffad6d1422b3269bb2dce78f21d1", "score": "0.60717267", "text": "addModalEvents() {\n this.botaoAbrir.addEventListener('click', this.eventToggleModal);\n this.botaoFechar.addEventListener('click', this.eventToggleModal);\n this.contantainerModal.addEventListener('click', this.clickForaModal);\n }", "title": "" }, { "docid": "124cb934bba06dd98f68efd0a600dceb", "score": "0.6069104", "text": "function registerClickEvent() {\n var modal = document.getElementById(\"feedbackModal\");\n var feedbackModal = document.getElementById(\"feedbackModalButton\");\n\n feedbackModal.onclick = function () {\n modal.style.display = \"block\";\n }\n\n // 'X' button on the modal\n var feedbackCloseModal = document.getElementById(\"feedbackModalClose\");\n feedbackCloseModal.onclick = function () {\n modal.style.display = \"none\";\n }\n\n // When the user clicks anywhere outside of the modal, close it\n window.addEventListener('click', function (event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n });\n}", "title": "" }, { "docid": "54d2bf61a2e10763a612fc95aca30c67", "score": "0.60631543", "text": "function modalMsg() {\n $(\"#modal\").addClass(\"active-modal\");\n $(\".dark-bgcolor\").addClass(\"active-darkBg\");\n\n function closeModal() {\n $(\"#modal\").removeClass(\"active-modal\");\n $(\".dark-bgcolor\").removeClass(\"active-darkBg\");\n }\n\n $(document).on(\"click\", \".dark-bgcolor\", () => {\n closeModal();\n });\n\n $(document).on(\"click\", \"#modal .close-button\", () => {\n closeModal();\n });\n }", "title": "" }, { "docid": "39e1a1aaa5b201603cf588b66f033220", "score": "0.6061813", "text": "function search_click(iden,actions){\n $('#search').click(function(){\n //console.log(xcolumn);\n //console.log(iden);\n //alert(\"search ja\");\n //show create_search_modal()\n $('#modal_'+iden+'_'+actions).modal('show');\n })\n}", "title": "" } ]
893e092c8634c4e709e8a8faad9844e9
adds listener to open all links externally in video player
[ { "docid": "10742ca9742fe06d5c2fc1698892a67b", "score": "0.68791825", "text": "function listeners(links) {\n links.forEach((link) => {\n link.addEventListener('click', (e) => {\n // var filename = link.getAttribute(\"data-filename\");\n var url = link.getAttribute(\"href\");\n\n if(url.indexOf('file://') == 0) {\n e.preventDefault();\n shell.openExternal(url)\n localStorage.setItem(url, true);\n link.classList.add(\"nd-watched\");\n }\n });\n });\n}", "title": "" } ]
[ { "docid": "c052a842687a8e8e3a02e3b01a2441db", "score": "0.7177888", "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": "2b08d9e5b5d4332a4460eab898d31ae2", "score": "0.6515338", "text": "function run() {\r\n videoLinks();\r\n proxLinks();\r\n}", "title": "" }, { "docid": "3124211f1e1e23da762b9ba37eeb6b6e", "score": "0.63120633", "text": "function init_villains_link() {\n\tcontent = '';\n\tfor (const [key, value] of Object.entries(villains)) {\n\t\tcontent += '<a name=\"villains_anchors\" href=\"#villains_anchors\" id=\"vid_' + key + '\" class=\"a_villain_anchor\">' + value + '</a>';\n\t}\n\tset_html_content('villains_link', content);\n\t\n\t// Add event listeners to react on click for those <a> elements\n\tconst v_anchors = document.querySelectorAll(\".a_villain_anchor\");\n\tadd_villains_click_listener(v_anchors);\n}", "title": "" }, { "docid": "c8815a15ae6be4fb5231addd1f74dcb9", "score": "0.63110757", "text": "bindVideos(){\n\t\tlet self = this;\n\t\tlet videos = document.getElementsByClassName('video-inner');\n\n\t\tfor (let i = 0; i < videos.length; i++ ){\n\t\t\tvideos[i].addEventListener('click', self.playVideo, false);\n\t\t}\n\t}", "title": "" }, { "docid": "5807c1d16f5bf06c115630ee814db3e6", "score": "0.61783004", "text": "function setupExternalLinks() {\n const links = document.querySelectorAll('a:not([href^=\"#\"])')\n\n for (const link of links) {\n if (link.href) { updateElement(link, { target: '_blank' }) }\n }\n}", "title": "" }, { "docid": "a836b7996a99fc45c52c6d21ac77c4c3", "score": "0.6176757", "text": "function bindExternalLinks ()\n {\n $(document).on('click', 'a[href^=\"//\"], a[href^=\"http\"]', function () {\n window.open(encodeURI(this.href), '_system', 'location=yes');\n \n return false;\n });\n }", "title": "" }, { "docid": "bb97ef017b7fb3c13f424852e3deb3df", "score": "0.61686426", "text": "function listeners(){\n\t\t\n\t\t$(document).on('click', 'a.video', function(e){\n\t\t\tif($(this).attr('href').indexOf('youtu') > -1) {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\t\n\t\t\t\ttrace('loading the video' + $(this));\n\n\t\t\t\tvar vidlink = ((typeof this.url) != 'undefined') ? this.url : $(this).attr('href');\n\n\t\t\t\ttrace('the video link is '+ vidlink);\n\n\t\t\t\tvar vimg = $(this).find('img').attr('src');\n\t\t\t\tvar vidtitle = $(this).parent().find('h3:not(\".galleryonly\")').text();\n\t\t\t\tif(vidtitle.length < 2){\n\t\t\t\t\tvidtitle = $(this).parent().find('h3').text();\n\t\t\t\t}\n\t\t\t\ttrace('The image grabbed is :' + vimg);\n\n\t\t\t\tvar jeopv ={\n\t\t\t\t\t'url' : vidlink,\n\t\t\t\t\t'emsrc' : $(this).data('embedsrc'),\n\t\t\t\t\t'title' : vidtitle,\n\t\t\t\t\t'image' : vimg\n\t\t\t\t};\n\t\t\t\ttrace(jeopv);\n\n\t\t\t\tprepModal(jeopv);\n\t\t\t\tsetupVideo(jeopv);\n\t\t\t}\n\t\t});\n\n\t\t$(document).on('click', '#btn_close_modal',function(){\n\t\t\tModalPlayerDiv.empty();\n\t\t\t$('body').css('overflow','auto');\n\t\t});\n\t}", "title": "" }, { "docid": "6b27fad8746f37bf969773f5401840a4", "score": "0.6079367", "text": "function setVideos (videoList) {\n for (let i = 0; i < videoPlayList.length; i++){\n let currVideoElement = videoList[i];\n let currVideoUrl = videoArray[i];\n currVideoElement.addEventListener(\"click\", function(e) {\n loadVideo(currVideoUrl, i);\n });\n }\n}", "title": "" }, { "docid": "92a851de92fb1d45db3fe3c513faf969", "score": "0.6065929", "text": "function openLinks() {\n let links = document.links;\n for (let i = 0; i < links.length; i++) {\n chrome.runtime.sendMessage({'message': 'open_new_tab', 'url': links[i].href});\n }\n}", "title": "" }, { "docid": "97344c2929e0f558951ff605685428ad", "score": "0.60534483", "text": "function externalLinks() {\n if (!document.getElementsByTagName) return;\n var anchors = document.getElementsByTagName(\"a\");\n for (var i=0; i<anchors.length; i++) {\n var anchor = anchors[i];\n if (anchor.getAttribute(\"href\") &&\n anchor.getAttribute(\"rel\") == \"external\")\n anchor.target = \"_blank\";\n }\n }", "title": "" }, { "docid": "0c798edf7a51de3722d3d3dabff1d4bb", "score": "0.6014545", "text": "function playFromLinkUrl (info, tab) {\n sourceHandler([info.linkUrl], info.pageUrl)\n}", "title": "" }, { "docid": "dc37aea83a7d29933c0d7906dbf34383", "score": "0.6009138", "text": "function handler(e) {\n e.preventDefault(); //Prevents default action of links going directly to the source file\n videotarget = this.getAttribute(\"href\"); //looks at the filename in the link's href attribute\n filename = videotarget.substr(0, videotarget.lastIndexOf('.')) || videotarget; //Splits the filename and takes everything before the \".\", giving us jus tname without the extension\n video = document.querySelector(\"#player video\"); //Finds div #player and video\n video.removeAttribute(\"poster\"); //Removes the poster attribute in the video tag\n source = document.querySelectorAll(\"#player video source\"); //Finds source elements inside the video tag\n source[0].src = filename + \".mp4\"; //defines the MP4 source\n // source[1].src = filename + \".webm\"; //defines the WEBM source\n // source[2].src = filename + \".ogv\"; //defines the OGG source\n video.load(); //Loads video when video is selected\n video.play(); //Plays video automatically\n }", "title": "" }, { "docid": "975026ce74b6baecdcddf1a232835d59", "score": "0.60043436", "text": "function addEpisodeHandlers()\n{\n\tvar rows = document.getElementsByTagName(\"tr\"); //get all rows of the table\n\t\n\tfor(i = 2; i < rows.length; i++) //add the onclick to each link so that it launches the video instead of going to page\n\t{\n\t\tif(rows[i].cells && rows[i].cells[0])\n\t\t{\n\t\t\trows[i].cells[0].childNodes[1].setAttribute( \"onclick\", \"return false;\" ); //so it doesn't navigate to the href\n\t\t\trows[i].cells[0].childNodes[1].addEventListener( \"click\", clickVideoHandler); //so it is sent to launch video after click\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "9ac2aa3ecc4c08fc14355d477ac4490c", "score": "0.60022813", "text": "function __openLinks() {\n document.querySelector(\"body\").addEventListener(\n \"click\",\n function (e) {\n var target = e.target;\n while (target != null) {\n if (\n target.matches ? target.matches(\"a\") : target.msMatchesSelector(\"a\")\n ) {\n if (\n target.href &&\n target.href.startsWith(\"http\") &&\n target.target === \"_blank\"\n ) {\n window.__TAURI__.invoke({\n __tauriModule: \"Shell\",\n message: {\n cmd: \"open\",\n uri: target.href,\n },\n });\n e.preventDefault();\n }\n break;\n }\n target = target.parentElement;\n }\n },\n true\n );\n }", "title": "" }, { "docid": "3a47e399fd07488339c804c6fd3a7fee", "score": "0.5997363", "text": "function doExternalLinks() {\n $('a[rel=\"external\"]').on('click', function () {\n $(this).attr({'target':'_blank'});\n });\n}", "title": "" }, { "docid": "5f02f5da4514becd86901040ab22000c", "score": "0.5987302", "text": "applyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}", "title": "" }, { "docid": "bcdc8037e4226d2814641667a0915d85", "score": "0.597466", "text": "function watch(){\r\n window.open(\"https://www.youtube.com/channel/UCqZcO_ImDpXTYnckCNRXb5A/videos\");\r\n}", "title": "" }, { "docid": "d185e0bd03b26fbc77d300bfc9c18431", "score": "0.59694886", "text": "function externalLinks() {\n if (!document.getElementsByTagName) return;\n var anchors = document.getElementsByTagName(\"a\");\n for (var i=0; i<anchors.length; i++) {\n var anchor = anchors[i];\n if (anchor.getAttribute(\"rel\") && anchor.getAttribute(\"rel\").match(\"\\\\bexternal\\\\b\")) {\n anchor.target = \"_blank\";\n }\n }\n}", "title": "" }, { "docid": "f54df5b36df8221c2b1faa5866e1d777", "score": "0.5934043", "text": "function add_link_listener() {\n var links = document.links;\n for (var i = links.length - 1; i >= 0; i--) {\n links[i].addEventListener(\"click\", function(e) {\n ga('send', 'event', 'outgoing', 'click', e.target.href);\n } );\n }\n}", "title": "" }, { "docid": "393d2ae46b085d5fc90c670767f4f41f", "score": "0.5929278", "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": "6b997d2131a14c0ca4a5897865acb660", "score": "0.5928373", "text": "function externalLinks() {\n\tif (!document.getElementsByTagName(\"a\"));\n\n\tvar anchors = document.getElementsByTagName(\"a\");\n\tfor (var i = 0; i < anchors.length; i++) {\n\t\tvar anchor = anchors[i];\n\t\tif (anchor.getAttribute(\"href\") &&\n\t\t\tanchor.getAttribute(\"rel\") == \"external\")\n\t\t\tanchor.target = \"_blank\";\n\t}\n}", "title": "" }, { "docid": "59cc61ec0b1ddcd456cad0b6a618aa1b", "score": "0.58777463", "text": "function externalLinks() {\nif (!document.getElementsByTagName) return; \nvar anchors = document.getElementsByTagName(\"a\"); \nfor (var i=0; i<anchors.length; i++) { \nvar anchor = anchors[i]; \nif (anchor.getAttribute(\"href\") && \nanchor.getAttribute(\"rel\") == \"external\") \nanchor.target = \"_blank\";\n} \n}", "title": "" }, { "docid": "4911b53b5132df8b199a9b60e94c5eb6", "score": "0.5863985", "text": "function addClickListeners() {\n\n\t\t\tvar linkElements = documentAlias.links,\n\t\t\t\ti;\n\n\t\t\tfor (i = 0; i < linkElements.length; i++) {\n\t\t\t\t// Add a listener to link elements which pass the filter and aren't already tracked\n\t\t\t\tif (linkTrackingFilter(linkElements[i]) && !linkElements[i][trackerId]) {\n\t\t\t\t\taddClickListener(linkElements[i]);\n\t\t\t\t\tlinkElements[i][trackerId] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1b4e11a9e0f05a77453be3f103cf39ce", "score": "0.5858021", "text": "function getvideoLinks(callback) {\n // Replace 'your-api-endpoint' with the actual endpoint or JSON file URL\n $.getJSON(\"https://opensheet.elk.sh/1wys3Ep3C1aemJU55aNxlwpAwkcvbCjYKGIzWocSsJ30/Streams\", function (data) {\n // Assuming the data is an array of YouTube links, update videoLinks\n callback(data);\n });\n}", "title": "" }, { "docid": "ae82eff730e57e7bb9a81e96b3aa7f88", "score": "0.58390975", "text": "function externalLinks() { \n if (!document.getElementsByTagName) return; \n var anchors = document.getElementsByTagName(\"a\"); \n for (var i=0; i<anchors.length; i++) { \n   var anchor = anchors[i]; \n   if (anchor.getAttribute(\"href\") && \n       anchor.getAttribute(\"rel\") == \"external\") \n     anchor.target = \"_blank\"; \n } \n}", "title": "" }, { "docid": "91f5dd5186aa5c9a12379dcd0ef7f1af", "score": "0.5832853", "text": "function _trackLinks() {\n if (_tracksInternalLinks() || _tracksExternalLinks()) {\n document.addEventListener('click', function(event) {\n if (!Array.from(Reveal.getCurrentSlide().querySelectorAll('a')).includes(event.target)) return true;\n let baseURL = window.location.href.replace((new RegExp(window.location.hash) || ''), '');\n let path = event.target.href.replace(baseURL, '');\n\n if (path == '#') return true;\n\n let isInternalLink = path.startsWith('#');\n\n if ((isInternalLink && _tracksInternalLinks()) || (!isInternalLink && _tracksExternalLinks())) {\n let linkType = isInternalLink ? 'internalLink' : 'externalLink';\n let href = isInternalLink ? path : event.target.href;\n\n _track(linkType, {\n timestamp: globalTimer.toString(),\n metadata: {\n href: href,\n linkText: event.target.text,\n },\n });\n }\n });\n }\n }", "title": "" }, { "docid": "881b9de48f4d537c9e94a8774084744e", "score": "0.5827164", "text": "function addClickListeners(enable) {\n\t\t\t\tif (!linkTrackingInstalled) {\n\t\t\t\t\tlinkTrackingInstalled = true;\n\n\t\t\t\t\t// iterate through anchor elements with href and AREA elements\n\n\t\t\t\t\tvar i,\n\t\t\t\t\t\tignorePattern = getClassesRegExp(configIgnoreClasses, 'ignore'),\n\t\t\t\t\t\tlinkElements = documentAlias.links;\n\n\t\t\t\t\tif (linkElements) {\n\t\t\t\t\t\tfor (i = 0; i < linkElements.length; i++) {\n\t\t\t\t\t\t\tif (!ignorePattern.test(linkElements[i].className)) {\n\t\t\t\t\t\t\t\taddClickListener(linkElements[i], enable);\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}", "title": "" }, { "docid": "54c8f46f1a58de998989d562b7293a09", "score": "0.58233535", "text": "onPlayerReady() {\n this.videoPlay.addEventListener('click', e => this.playVideo(e));\n }", "title": "" }, { "docid": "df56c9cb04fc98d5b331fd471f94b6f3", "score": "0.58140796", "text": "function external_links()\n{\n\tif (!document.getElementsByTagName)\n\t \treturn;\n\tvar anchors = document.getElementsByTagName(\"a\");\n\tfor (var i=0; i<anchors.length; i++)\n\t{\n\t\tvar anchor = anchors[i];\n\t\tif (anchor.getAttribute(\"href\") && anchor.getAttribute(\"rel\") == \"external\")\n\t\t\tanchor.target = \"_blank\";\n\t}\n}", "title": "" }, { "docid": "f92fe094cb8b49365ca9765c68011e44", "score": "0.5797051", "text": "function clickVideoHandler()\n{\n\tplayerState = PlayerState.CHANGING;\n\tdocument.getElementById('launch_video').click();\n\taddVideoHandler(function(){ //run this code while it waits to get video source\n\t\telem = player.el_;\n\t\tplayer.play(); //get rid of big play button\n\t\telem.classList.add('vjs-seeking'); //show loading circle\t\n\t\tcreateTitle();\n\t\t//player.requestFullscreen(); //auto fullscreen. possible option?\n\t});\n\tloadVideo(this.href, function(){\n\t\tchangeSource(vidSource);\n\t}); //load the video of the link clicked on\n}", "title": "" }, { "docid": "3c25ad1f84301446c2d23d1854a20c5c", "score": "0.57939494", "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": "697588d7f02fece50c225b65a4094dfb", "score": "0.5760339", "text": "openVideoWhenClicked() {\n const video1 = document.getElementById('video1');\n const video2 = document.getElementById('video2');\n\n video1.addEventListener('click', () => this.onVideoClicked(video1, video2));\n video2.addEventListener('click', () => this.onVideoClicked(video2, video1));\n }", "title": "" }, { "docid": "6b9452f535cd1376e94cde01acd917c7", "score": "0.5749996", "text": "function onPlayerReady(event) {\n $('.playerContainer').on('click', function(){\n event.target.playVideo();\n })\n $('.'+vidUrl).on('click', function(){\n event.target.stopVideo();\n })\n }", "title": "" }, { "docid": "acc9683eb3d75c77b457898c419fcd5f", "score": "0.57468635", "text": "function initLink() {\n if (typeof (mSearch2) != 'undefined') {\n $('.js-chess__link').on('click', function () {\n var query = $.param(mSearch2.getFilters());\n // window.location = $(this).attr('href') + '?' + query;\n window.open($(this).attr('href') + '?' + query, '_blank');\n return false;\n });\n }\n }", "title": "" }, { "docid": "7ebb3f15b515ff239416616e87d5de00", "score": "0.5738401", "text": "activateListeners(html) {\n\n // Toggle online/offline\n html.find(\"h3\").click(this._onToggleOfflinePlayers.bind(this));\n\n // Context menu\n const contextOptions = this._getUserContextOptions();\n Hooks.call(`getUserContextOptions`, html, contextOptions);\n new ContextMenu(html, \".player\", contextOptions);\n }", "title": "" }, { "docid": "da92e6cffca425c3a5b255c79ec12546", "score": "0.5732835", "text": "function addVideoEvent() {\n $('#search-video-result-content-box').on('click', 'a', function (e) {\n e.preventDefault();\n var that = $(this);\n \n $('#video-player-box').slideDown(function () {\n $('#video-player-box').empty();\n $('#close-video-box').show();\n \n var images = $(this).find('img');\n var image = '';\n if (images[0] != null)\n image = 'img.first().attr(\"src\")';\n var href = '';\n var arr = that.attr('href').split('?v=');\n if (arr[1] != null)\n href = arr[1];\n var title = that.attr('title');\n \n var vStr = '';\n vStr += '<video id=\"a240e92d\" class=\"sublime\" poster=\"' + image + '\"';\n vStr += 'title = \"' + title + '\"';\n vStr += 'data-embed-type=\"auto\" data-uid=\"a240e92d\" data-autoresize=\"fill\" data-youtube-id=\"' + href + '\" preload=\"none\">';\n vStr += '<p>Sorry, your browser does not support video functionallity!</p></video>';\n $('#video-player-box').append(vStr);\n SublimeVideoLoader();\n });\n \n console.log(that.attr('href'));\n });\n }", "title": "" }, { "docid": "5ff9302bda0417d614f65529dfa5a03b", "score": "0.5725229", "text": "function init() {\n const links = document.getElementsByClassName(\"photo-link\");\n for (let l = 0; l < links.length; l++) {\n links[l].addEventListener(\"click\", launchLightbox);\n };\n}", "title": "" }, { "docid": "09bb65c07e42e605056ec493711cff60", "score": "0.5713702", "text": "activateListeners(html) {\n\n\t\t// Toggle online/offline\n\t\thtml.find(\"h3\").click(this._onToggleOfflinePlayers.bind(this));\n\n\t\t// Context menu\n\t\tconst contextOptions = this._getUserContextOptions();\n\t\tHooks.call(`getUserContextOptions`, html, contextOptions);\n\t\tnew ContextMenu(html, \".player\", contextOptions);\n\t}", "title": "" }, { "docid": "d6d96220486f2d4d85e457e94c4f11e5", "score": "0.5703231", "text": "function openLink(url) {\n if (!url) url = posts[current].permalink;\n pauseVideo();\n window.open(url, \"_blank\");\n }", "title": "" }, { "docid": "7bfe106c159d803f74323c31b2cac4c5", "score": "0.5701523", "text": "function initListeners() {\n\tconsole.log('Initializing DOM Listeners');\n\tvideo = $('#video')[0];\n\tif (video.addEventListener) {\n\t\tvideo.addEventListener(\"timeupdate\", followRoute, false);\n\t} else if (vid.attachEvent) {\n\t\tvideo.attachEvent(\"ontimeupdate\", followRoute);\n\t}\n\tif (video.addEventListener) {\n\t\tvideo.addEventListener(\"ended\", pause, false);\n\t} else if (vid.attachEvent) {\n\t\tvideo.attachEvent(\"ended\", pause);\n\t}\n\t// Disable Secondary Clicking.\n\tdocument.oncontextmenu = function(e) {\n\t\treturn false;\n\t};\n\t$(\"#ramble-logo-button\").click(function(e) {\n\t\tshowHomeSidebar();\n\t});\n\t$(\"#ramble-user-button\").click(function(e) {\n\t\tshowUserSidebar(id);\n\t});\n\t$(\"#ramble-friends-button\").click(function(e) {\n\t\tshowFriendSidebar();\n\t});\t\n\t$('#video_container').draggable({\n\t\tcontainment: \"parent\"\n\t});\n\t$('#video_container').resizable({\n\t\tcontainment: \"parent\",\n\t\taspectRatio: true\n\t});\n\t$('video').dblclick(function() {\n\t\tif (this.paused === true) {\n\t\t\tplay();\n\t\t} else {\n\t\t\tpause();\n\t\t}\n\t});\n\t$('#popup-close').click(function() {\n\t\t$('#popup').css('display', 'none');\n\t});\n\t$('#close-vid').click(function() {\n\t\tcloseViewer();\n\t});\n\t$('#search').keypress(function(event) {\n\t\tif (event.which == 13) {\n\t\t\tpullSearchQuery(this.value);\n\t\t}\n\t});\n\t$('#play-pause').click(function() {\n\t\tif ($('#video')[0].paused === true) {\n\t\t\tplay();\n\t\t} else {\n\t\t\tpause();\n\t\t}\n\t});\n\n\n}", "title": "" }, { "docid": "04635ffda011aa3123c901fc2ca37ade", "score": "0.5681766", "text": "function playerLinks(){\r\n\tvar links = document.getElementsByTagName(\"a\");\r\n\tfor(var i = 0; i < links.length; i++){\r\n\t\tvar igmlink = null;\r\n\t\tif(links[i].href.search(/spieler.php\\?uid=(\\d+)/) > 0) {\r\n\t\t\tigmlink = elem('a', \"<img src='data:image/gif;base64,\" + imagenes[\"igm\"] + \"' style='margin:3px 0px 1px 3px; display: inline' title='Enviar IGM' alt='Msg' border=0>\");\r\n\t\t\tigmlink.href = 'nachrichten.php?t=1&id=' + RegExp.$1;\r\n\t\t}\r\n\t\tif (links[i].href.search(/karte.php\\?d=(\\d+$)/) > 0){\r\n\t\t\tigmlink = elem('a',\"<img src='\" + img(\"img/es/a/att_all.gif\") + \"' style='margin:3px 0px 1px 3px; display: inline' height=10 width=10 title='Atacar' alt='Atk' border=0>\");\r\n\t\t\tigmlink.href = 'a2b.php?z=' + RegExp.$1;\r\n\t\t}\r\n\t\tif(igmlink) links[i].parentNode.insertBefore(igmlink, links[i].nextSibling);\r\n\t}\r\n}", "title": "" }, { "docid": "afc0826d87bf1dcecbc0e0cbf8be38b9", "score": "0.56540024", "text": "function _initClickListener() {\n if (!(com && com.xoz && com.xoz.videoplayer)) {\n return;\n }\n $playlistItems.each(function () {\n $(this).click(function () {\n\n if ($(this).hasClass(_options.css.classes.itemIsPlaying)) {\n return;\n }\n\n var videoID = $(this).data('video-id');\n var videoData = _getDataByVideoID(videoID);\n\n _replaceVideoInformation(videoData);\n _playVideo(videoID, videoData.xml + \"?endscreen=false\", false, 0);\n _sendWebtrekkInfo(_options.webtrekk.videoClick);\n\n playingVideoId = videoID;\n\n _prepareTrackingForPlaylistClick(videoID);\n });\n });\n }", "title": "" }, { "docid": "05194da821deb94111e8b754c24d049e", "score": "0.5649492", "text": "_link() {\n // Because the array's keys are strings, this cats as a foreach loop\n for (var key in this.tracks) {\n if (this.tracks.hasOwnProperty(key))\n this.tracks[key].link();\n }\n }", "title": "" }, { "docid": "369e14edb37763f646a4efb02a4eb9e9", "score": "0.56408423", "text": "function _mediaListeners() {\n // Time change on media\n _on(plyr.media, 'timeupdate seeking', _timeUpdate);\n\n // Update manual captions\n _on(plyr.media, 'timeupdate', _seekManualCaptions);\n\n // Display duration\n _on(plyr.media, 'durationchange loadedmetadata', _displayDuration);\n\n // Handle the media finishing\n _on(plyr.media, 'ended', function() {\n // Clear\n if (plyr.type === 'video') {\n _setCaption();\n }\n\n // Reset UI\n _checkPlaying();\n\n // Seek to 0\n _seek(0);\n\n // Reset duration display\n _displayDuration();\n\n // Show poster on end\n if(plyr.type === 'video' && config.showPosterOnEnd) {\n // Re-load media\n plyr.media.load();\n }\n });\n\n // Check for buffer progress\n _on(plyr.media, 'progress playing', _updateProgress);\n\n // Handle native mute\n _on(plyr.media, 'volumechange', _updateVolume);\n\n // Handle native play/pause\n _on(plyr.media, 'play pause', _checkPlaying);\n\n // Loading\n _on(plyr.media, 'waiting canplay seeked', _checkLoading);\n\n // Click video\n if (config.clickToPlay && plyr.type !== 'audio') {\n // Re-fetch the wrapper\n var wrapper = _getElement('.' + config.classes.videoWrapper);\n\n // Bail if there's no wrapper (this should never happen)\n if (!wrapper) {\n return;\n }\n\n // Set cursor\n wrapper.style.cursor = \"pointer\";\n\n // On click play, pause ore restart\n _on(wrapper, 'click', function() {\n if (plyr.browser.touch && !plyr.media.paused) {\n _toggleControls(true);\n return;\n }\n\n if (plyr.media.paused) {\n _play();\n }\n else if (plyr.media.ended) {\n _seek();\n _play();\n }\n else {\n _pause();\n }\n });\n }\n\n // Disable right click\n if (config.disableContextMenu) {\n _on(plyr.media, 'contextmenu', function(event) { event.preventDefault(); });\n }\n\n // Proxy events to container\n _on(plyr.media, config.events.join(' '), function(event) {\n _triggerEvent(plyr.container, event.type, true);\n });\n }", "title": "" }, { "docid": "7276c5befe77ce47d09509f15085453e", "score": "0.5637643", "text": "function onPlayerReady(event) {\n if(tracks.length > 0 && current_link < (tracks.length - 1)) {\n next();\n }\n setInterval(loadLinks, 5000);\n $(\"#links\").height($('#player').height());\n}", "title": "" }, { "docid": "162d5a2b3b7222061cf0537e4038f376", "score": "0.56135976", "text": "function changeIPCameras(el_ID, link) {\n\n const StreamLive = document.getElementById(el_ID)\n\n StreamLive.src = link\n\n}", "title": "" }, { "docid": "232ba83a565ed0e581a572a62148068f", "score": "0.56080925", "text": "activateListeners(html) {\n\n // Display controls when hovering over the video container\n let cvh = this._onCameraViewHover.bind(this);\n html.find('.camera-view').hover(cvh, cvh);\n\n // Handle clicks on AV control buttons\n html.find(\".av-control\").click(this._onClickControl.bind(this));\n\n // Handle volume changes\n html.find(\".webrtc-volume-slider\").change(this._onVolumeChange.bind(this));\n\n // Hide Global permission icons depending on the A/V mode\n if (this.webrtc.settings.mode === WebRTCSettings.WEBRTC_MODE.VIDEO)\n html.find('[data-action=\"toggle-audio\"]').hide();\n if (this.webrtc.settings.mode === WebRTCSettings.WEBRTC_MODE.AUDIO)\n html.find('[data-action=\"toggle-video\"]').hide();\n\n // Make each popout window draggable\n for (let popout of this.element.find(\".app.camera-view-popout\")) {\n let box = popout.querySelector(\".camera-view\");\n new CameraPopoutAppWrapper(this, box.dataset.user, $(popout));\n }\n\n // Listen to the video's srcObjectSet event to set the display mode of the user.\n for (let video of this.element.find(\"video\")) {\n const view = video.closest(\".camera-view\");\n const userId = view.dataset.user;\n video.addEventListener('srcObjectSet', ev => {\n this._setVideoDisplayMode(view, this.webrtc.isStreamVideoEnabled(event.detail));\n this._setAudioDisplayMode(view, this.webrtc.isStreamAudioEnabled(event.detail));\n });\n\n // Adjust user volume attributes\n video.volume = this.webrtc.settings.users[userId].volume;\n if (userId !== game.user.id) video.muted = this.webrtc.settings.muteAll;\n }\n }", "title": "" }, { "docid": "dcc48db58aa8330613068d46c63cc3b2", "score": "0.56039244", "text": "function _addLinkListeners(link_val_container) {\n $('body').on('click mouseup mousedown keypress keydown keyup', '#wp-link-submit', function (event) {\n var linkAtts = wpLink.getAttrs(),\n linktext = $(\"#wp-link-text\").val(),\n linkTarget = linkAtts.target,\n linkTarget = ( linkTarget === '' ) ? 'target=\"_self\"' : 'target=\"_blank\"',\n builtHTML = '<a href=\"'+linkAtts.href+'\" '+linkTarget+' >'+linktext+'</a>';\n\n link_val_container.val(builtHTML);\n _removeLinkListeners();\n return false;\n });\n\n $('body').on('click mouseup mousedown keypress keydown keyup', '#wp-link-cancel', function (event) {\n _removeLinkListeners();\n return false;\n });\n }", "title": "" }, { "docid": "266185297e814476c89a73f87f661b00", "score": "0.5593668", "text": "function addPlayListener() {\n\t//get playlist songs\n\t$(\".play-song\").each(function() {\n\t\tvar song = this;\n\t\tsong.addEventListener('click', function() {\n\t\t\tvar song_uri = \"spotify:track:\" + this.id;\n\n\t\t\tfetch('https://api.spotify.com/v1/me/player/play', {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\tbody: JSON.stringify({ uris: [song_uri] }),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t'Authorization': `Bearer ${ACCESS_TOKEN}`\n\t\t\t\t\t},\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "ca676c8940615373f5f611a9e73178d6", "score": "0.55870676", "text": "addListeners() {\n\t\tconst self = this;\n\t\t\t$('.menu-item>div').each( function() {\n\t\t\t\tlet name = $(this).attr(\"link\");\n name = (name == \"\") ? \"/home\" : name;\n\t\t\t\t$(this).click( function() {\n\t\t\t\t\tif (name !== self.state.currentPage) {\n\t\t\t\t\t\tself.changeCurrentPage( name.substring(1) );\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t\t$('.home-button').click( function() {\n\t\t\t\tself.changeCurrentPage('home');\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "8c31bb71fd7b6bf936784d8c057cbfcf", "score": "0.558621", "text": "function openLink(link) {\n\n}", "title": "" }, { "docid": "ac0c0297ac1a0f61ba0e1c96531ea95f", "score": "0.5583646", "text": "function playerLinks(){\n var bRpr = getGMcookie(\"showrprinfotooltips\", false);\n if (bRpr == 'false') bRpr = '1';\n\n var bMO = getGMcookie(\"showmesopenlinks\", false);\n if (bMO == 'false') bMO = '1';\n\n var allLinks = document.getElementsByTagName(\"a\");\n for(var i = 0; i < allLinks.length; i++) {\n // if it's a player link\n if (allLinks[i].href.search(/spieler.php\\?uid=(\\d+$)/) > 0) {\n var a = RegExp.$1;\n if (a == 0) continue;\n if (allLinks[i].parentNode.className == 'menu' || allLinks[i].parentNode.nodeName == 'P') continue;\n insertUserLinks(allLinks[i], a, allLinks[i].textContent);\n\n // the attack link for karte.php links\n } else if (allLinks[i].href.search(/karte.php\\?d=(\\d+)/) > 0 && crtPage.indexOf(\"build.php?gid=17\") == -1 && crtPage.indexOf(\"&t=1\") == -1) {\n var vID = RegExp.$1;\n if (vID != aVillage.vID) {\n insertAttSendResLinks(allLinks[i], vID);\n if (bRpr == \"1\" && (crtPage.indexOf(\"build.php?id=39\") != -1 || crtPage.indexOf(\"gid=16\") != -1 || crtPage.indexOf(\"berichte.php\") != -1) || crtPage.indexOf(\"spieler.php?\") != -1) {\n //add a tooltip including distance and troop times\n allLinks[i].addEventListener(\"mouseover\", showCoordAndDist(vID), false);\n allLinks[i].addEventListener(\"mouseout\", function() {\n get(\"tb_tooltip\").style.display = 'none';\n }, false);\n }\n }\n // if it's an alliance link\n } else if (allLinks[i].href.search(/allianz.php\\?aid=(\\d+$)/) > 0){\n var a = RegExp.$1;\n if (a == 0) continue;\n insertAllyLinks(allLinks[i], a, allLinks[i].textContent);\n //if it's a message link\n } else if (bMO == \"1\") {\n if (allLinks[i].href.indexOf(\"nachrichten.php?id=\") != -1 || allLinks[i].href.indexOf(\"berichte.php?id=\") != -1) addReadMesRepInPopup(allLinks[i]);\n }\n }\n\n function showCoordAndDist(vID) {\n return function() {\n var ttHTML = \"<table class='f8' cellpadding='0' cellspacing='0' width='0%'>\";\n var xy = id2xy(vID);\n ttHTML += \"<td colspan='2' style='text-align:center; font-weight:bold; color:green; border-bottom:1px grey solid;'>(\" + xy[0] + \"|\" + xy[1] + \")</td>\";\n ttHTML += getTroopMerchantTooltipHTML(vID, \"blue\", false, true, true);\n ttHTML += \"</table>\";\n var ttDiv = get(\"tb_tooltip\");\n if (ttDiv == null) ttDiv = createTooltip();\n ttDiv.innerHTML = ttHTML;\n ttDiv.style.display = 'block';\n }\n }\n }", "title": "" }, { "docid": "590fc2e755975896f8f4b68aab4f8535", "score": "0.5567066", "text": "activateListeners(html) {\n\n\t\t// Display controls when hovering over the video container\n\t\tlet cvh = this._onCameraViewHover.bind(this);\n\t\thtml.find('.camera-view').hover(cvh, cvh);\n\n\t\t// Handle clicks on AV control buttons\n\t\thtml.find(\".av-control\").click(this._onClickControl.bind(this));\n\n\t\t// Handle volume changes\n\t\thtml.find(\".webrtc-volume-slider\").change(this._onVolumeChange.bind(this));\n\n\t\t// Hide Global permission icons depending on the A/V mode\n\t\tconst mode = this.webrtc.mode;\n\t\tif (mode === AVSettings.AV_MODES.VIDEO) html.find('[data-action=\"toggle-audio\"]').hide();\n\t\tif (mode === AVSettings.AV_MODES.AUDIO) html.find('[data-action=\"toggle-video\"]').hide();\n\n\t\t// Make each popout window draggable\n\t\tfor (let popout of this.element.find(\".app.camera-view-popout\")) {\n\t\t\tlet box = popout.querySelector(\".camera-view\");\n\t\t\tnew CameraPopoutAppWrapper(this, box.dataset.user, $(popout));\n\t\t}\n\n\t\t// Listen to the video's srcObjectSet event to set the display mode of the user.\n\t\tfor (let video of this.element.find(\"video\")) {\n\t\t\tconst view = video.closest(\".camera-view\");\n\t\t\tthis._refreshView(view);\n\t\t\tvideo.addEventListener('webrtcVideoSet', ev => {\n\t\t\t\tconst view = video.closest(\".camera-view\");\n\t\t\t\tif ( view.dataset.user !== ev.detail ) return;\n\t\t\t\tthis._refreshView(view);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "c88b87c4e552d6e504567a0c7ab89246", "score": "0.55661255", "text": "function changeExternalLinks()\n\t\t{\n\t\t\tvar links = $('a');\n\t\t\tvar l_length = links.length;\n\t\t\tvar external_links = [];\n\t\t\tfor (var i=0;i<l_length;i++)\n\t\t\t{\n\t\t\t\tvar href = $(links[i]).attr('href');\n\n\t\t\t\tif (href !== undefined && href.match(/^https?\\:/i) && !href.match(document.domain))\n\t\t\t\t{\n\t\t\t\t\texternal_links.push(links[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar $extlinks = $(external_links);\n\n\t\t\tif(settings.externalLinks === true)\n\t\t\t{\n\t\t\t\t$extlinks.attr('target','_blank');\n\t\t\t}\n\n\t\t\tif(settings.externalClass !== false)\n\t\t\t{\n\t\t\t\t$extlinks.addClass(settings.externalClass);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "43bbaa9884d66ed9af96a259d11ecb6c", "score": "0.5551305", "text": "function onPlayerReady(event) {\nevent.target.playVideo();\n}", "title": "" }, { "docid": "eac6bb95248f5e787003768e73f46765", "score": "0.5542847", "text": "function openAllUrls () {\n chrome.tabs.getSelected((tab) => {\n chrome.tabs.sendMessage(tab.id, { method: 'get-ads-urls' }, (response) => {\n response.result.forEach(url => {\n chrome.tabs.create({ url })\n })\n })\n })\n}", "title": "" }, { "docid": "cd2ad375d2912e126ed95a5af5eaf6f9", "score": "0.5537772", "text": "activateListeners() {\n\n // Disable touch zoom\n document.addEventListener(\"touchmove\", ev => {\n if (ev.scale !== 1) ev.preventDefault();\n });\n\n // Disable right-click\n document.addEventListener(\"contextmenu\", ev => ev.preventDefault());\n\n // Disable mouse 3, 4, and 5\n document.addEventListener(\"mousedown\", ev => {\n if ([3, 4, 5].includes(ev.button)) ev.preventDefault();\n });\n\n // Handle window resizing\n window.addEventListener(\"resize\", event => this._onResize(event));\n\n // Prevent dragging and dropping unless a more specific handler allows it\n document.addEventListener(\"dragstart\", this._onPreventDragstart);\n document.addEventListener(\"dragover\", this._onPreventDragover);\n document.addEventListener(\"drop\", this._onPreventDrop);\n\n // Handle mousewheel form interaction\n $(\"body\").on(\"mousewheel\", 'input[type=\"range\"]', _handleMouseWheelInputChange);\n\n // Entity links\n TextEditor.activateListeners();\n \n // Await gestures to begin audio and video playback\n game.audio.awaitFirstGesture();\n game.video.awaitFirstGesture();\n\n // Handle window shutdown/unload events\n window.onbeforeunload = this._onBeforeUnload;\n\n // Force hyperlinks to a separate window/tab\n document.addEventListener(\"click\", this._onClickHyperlink);\n }", "title": "" }, { "docid": "41b2b051034ccc9b08fa253cc6427a90", "score": "0.5534725", "text": "function addVideoListeners() {\n var isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;\n video.addEventListener('timeupdate', updateVideoCurrentTime, false);\n video.addEventListener('timeupdate', slideProgress, false);\n video.addEventListener('ended', reloadVideo, false);\n videocontrol.addEventListener('mouseout', outVideoControl, false);\n videocontrol.addEventListener('mouseover', overVideoControl, false);\n if (!isFullScreen) {\n overvideo.addEventListener('mouseout', outVideoControl, false);\n overvideo.addEventListener('mouseover', overVideoControl, false);\n }\n }", "title": "" }, { "docid": "1ffced07ddc062bd274d2c77b2b5e71f", "score": "0.5534002", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "37ad77fe78202477d9e09cac29474c5f", "score": "0.5528932", "text": "function enablePreviewLinks( selector ) {\n\n\t\tvar anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.addEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "37ad77fe78202477d9e09cac29474c5f", "score": "0.5528932", "text": "function enablePreviewLinks( selector ) {\n\n\t\tvar anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) );\n\n\t\tanchors.forEach( function( element ) {\n\t\t\tif( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {\n\t\t\t\telement.addEventListener( 'click', onPreviewLinkClicked, false );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "b2bf4292aff47976d29550bbb16b5037", "score": "0.5525411", "text": "function _options() {\n const addLink = document.querySelectorAll('.optionsLink');\n for (var i=0; i < addLink.length; i++) {\n addLink[i].addEventListener('click', function() {\n chrome.runtime.sendMessage('options pls');\n });\n }\n}", "title": "" }, { "docid": "28294f0ce64bb6fb7b11cae6cf1cbe1e", "score": "0.5514731", "text": "function openLinksInOpener() {\n var links = document.querySelectorAll('a');\n Array.prototype.forEach.call(links, function(el, i){\n el.addEventListener('click', function(e) {\n if (window.opener) {\n e.preventDefault();\n window.opener.location.href = e.target.getAttribute('href');\n }\n })\n });\n}", "title": "" }, { "docid": "b7b39ce737959d36c53aacf3b0c3f7aa", "score": "0.5512527", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "title": "" }, { "docid": "7249aa3858677368900ca6becbab1bfd", "score": "0.5512396", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "title": "" }, { "docid": "37879c1745265ed0f058c52d22f04478", "score": "0.5510751", "text": "function extern_links()\n{\n var isExternal = function(href) {\n /*\n * isExternal(\"http://i.liketightpants.net/\")\n * true\n * isExternal(\"/publications/\")\n * false\n * isExternal(\"http://spion.me/publications/\")\n * false\n * isExternal(\"http://localhost:8000/publications/\")\n * false\n * isExternal(\"http://127.0.0.1:8000/publications/\")\n * false\n */\n if (href.indexOf(\"http\") === -1 || href.indexOf(document.location.host) !== -1 || href.indexOf(\"localhost\") !== -1 || href.indexOf(\"127.0.0.1\") !== -1 ) {\n return false;\n }\n return true;\n };\n \n $(\"a[href]\").each(\n function() { \n if (isExternal($(this).attr('href')) ) { \n $(this).attr('target', '_blank')\n }\n }\n )\n \n}", "title": "" }, { "docid": "1aede405b2d3b78e40f6274b71b81793", "score": "0.549684", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "1aede405b2d3b78e40f6274b71b81793", "score": "0.549684", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "7a4d3e3f192dccc52f880b6e4997cf0d", "score": "0.54965043", "text": "function addSkipHandlers()\n{\n\tdocument.addEventListener(\"ka-playNext\", function() { \n\t\tif(nextLink != null)\n\t\t{\n\t\t\tif(playerState == PlayerState.PLAYING) //If the video is playing, go to the load spinner screen and load the video\n\t\t\t{\n\t\t\t\tplayerState = PlayerState.LOADING;\n\t\t\t\tunloadVideo();\n\t\t\t\tloadVideo(nextLink, function(){\n\t\t\t\t\tchangeSource(vidSource);\n\t\t\t\t\tplayerState = PlayerState.CHANGING;\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if(playerState == PlayerState.BGLOADING) //If the video is already loading in the background, just show the loading screen\n\t\t\t{\n\t\t\t\tplayerState = PlayerState.LOADING;\n\t\t\t\tunloadVideo();\n\t\t\t}\n\t\t\telse if(playerState == PlayerState.LOADED) //If the video is already loaded, just change the video\n\t\t\t{\n\t\t\t\tchangeSource(vidSource);\n\t\t\t\tplayerState = PlayerState.CHANGING;\n\t\t\t}\n\t\t\t//Otherwise do nothing since the video is either loading or changing\n\t\t}\n\t});\t\n\n\tdocument.addEventListener(\"ka-playPrev\", function() { \n\t\tif(prevLink != null)\n\t\t{\n\t\t\tif(playerState != PlayerState.INTERRUPT) //Interrupt any loading, changing, etc.\n\t\t\t{\n\t\t\t\tplayerState = PlayerState.INTERRUPT;\n\t\t\t\tunloadVideo();\n\t\t\t\tloadVideo(prevLink, function(){\n\t\t\t\t\tif(player.currentSrc() == vidSource) //If it already loaded the video ahead\n\t\t\t\t\t{\n\t\t\t\t\t\tloadVideo(prevLink, function() //you have to do it twice :(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchangeSource(vidSource);\n\t\t\t\t\t\t\tplayerState = PlayerState.CHANGING;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse //Otherwise you are good\n\t\t\t\t\t{\n\t\t\t\t\t\tchangeSource(vidSource);\n\t\t\t\t\t\tplayerState = PlayerState.CHANGING;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\t\t\n}", "title": "" }, { "docid": "f1b69ebe24bdb599c4ad18e29fb6a8e3", "score": "0.5495702", "text": "function onPlayerReady(event) {\n// event.target.playVideo();\n}", "title": "" }, { "docid": "a1caabd02e3300dada5e1f89f5baeece", "score": "0.5495575", "text": "function checkPlayableLinks(){\n\t\t \n\t\t$('.hap_text_link').each(function(){\n\t\t\t//console.log($(this).attr('href'));\n\t\t\tvar a = $(this), attr = a.attr('href');\n\t\t\tif(typeof attr !== 'undefined' && attr !== false){\n\t\t\t\tif(attr.toLowerCase().indexOf('.mp3')>-1){\n\t\t\t\t\ta.prepend('<img class=\"play_link\" src=\"'+link_play+'\"/>');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t//hap_image_link\n\t\t$('.hap_text_link, .hap_image_link').click(function(e){\n\t\t\tif(!componentInited) return false;\n\t\t\tif(playlistTransitionOn) return false;\n\t\t\t\n\t\t\tvar a = $(this), attr = a.attr('href');\n\t\t\tif(typeof attr === 'undefined' || attr === false) return false;\n\t\t\t\n\t\t\t//console.log(active_song_link_url, attr);\n\t\t\tif(active_song_link_url && active_song_link_url == attr){//click on already active link\n\t\t\t\treturn togglePlayback();\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//enable active item, if exist, but dont dispose current playlist, if exist (optional)\n\t\t\t\tenableActiveItem();\n\t\t\t\tplaylistManager.reSetCounter();\n\t\t\t\n\t\t\t\tactive_song_link_url = attr;\n\t\t\t\tactive_hap_inline = a;\n\t\t\t\tactive_inline_song=true;\n\t\t\t\t\n\t\t\t\tif(active_text_link) active_text_link.attr('src', link_play);\n\t\t\t\tif(a.hasClass('hap_text_link')) active_text_link = a.find('img').attr('src', link_pause);\n\t\t\t\t\t\n\t\t\t\tmp3 = active_song_link_url;\n\t\t\t\t\n\t\t\t\tautoPlay=true;\n\t\t\n\t\t\t\tfindMedia();\n\t\t\t\tactive_inline_song = false;//after clean media\n\t\t\t\n\t\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a982fe56c6ba9021535df2f049accb7c", "score": "0.5485205", "text": "function bindListeners() {\r\n $('#qrcode').on('click', function() {\r\n openRtcConnection();\r\n });\r\n }", "title": "" }, { "docid": "960127ef18cd927d963906e229fe19e2", "score": "0.5482533", "text": "activateListeners() {\n\n\t\t// Disable touch zoom\n\t\tdocument.addEventListener(\"touchmove\", ev => {\n\t\t\tif (ev.scale !== 1) ev.preventDefault();\n\t\t});\n\n\t\t// Disable right-click\n\t\tdocument.addEventListener(\"contextmenu\", ev => ev.preventDefault());\n\n\t\t// Disable mouse 3, 4, and 5\n\t\tdocument.addEventListener(\"pointerdown\", this._onPointerDown);\n\t\tdocument.addEventListener(\"pointerup\", this._onPointerUp);\n\n\t\t// Prevent dragging and dropping unless a more specific handler allows it\n\t\tdocument.addEventListener(\"dragstart\", this._onPreventDragstart);\n\t\tdocument.addEventListener(\"dragover\", this._onPreventDragover);\n\t\tdocument.addEventListener(\"drop\", this._onPreventDrop);\n\n\t\t// Support mousewheel interaction for range input elements\n\t\twindow.addEventListener(\"wheel\", Game._handleMouseWheelInputChange, {passive: false});\n\n\t\t// Entity links\n\t\tTextEditor.activateListeners();\n\t\n\t\t// Await gestures to begin audio and video playback\n\t\tgame.audio.awaitFirstGesture();\n\t\tgame.video.awaitFirstGesture();\n\n\t\t// Handle changes to the state of the browser window\n\t\twindow.addEventListener(\"beforeunload\", this._onWindowBeforeUnload);\n\t\twindow.addEventListener(\"blur\", this._onWindowBlur);\n\t\twindow.addEventListener(\"resize\", this._onWindowResize);\n\t\tif ( this.view === \"game\" ) {\n\t\t\thistory.pushState(null, null, location.href);\n\t\t\twindow.addEventListener(\"popstate\", this._onWindowPopState);\n\t\t}\n\n\t\t// Force hyperlinks to a separate window/tab\n\t\tdocument.addEventListener(\"click\", this._onClickHyperlink);\n\t}", "title": "" }, { "docid": "cd1d493de7ef04ac1e43fa9dada12d00", "score": "0.5482123", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "5900e5d3839ed706edd162a12fdf04a1", "score": "0.54793435", "text": "function setLinks(e){\n let ul = linkFrame.contentDocument.getElementById(\"content\");\n while (ul.hasChildNodes()) {\n ul.removeChild(ul.firstChild);\n }\n let key = tribeFrame.contentDocument.createElement(\"li\");\n key.innerHTML += \"<p id='title'>Maps of Ceded Lands</p>\";\n ul.appendChild(key);\n e.forEach(function(item){\n if(item.link !== null) {\n let li = linkFrame.contentDocument.createElement(\"li\");\n li.innerHTML += item.propName + \":\";\n let a = linkFrame.contentDocument.createElement(\"a\");\n a.onclick = function () {\n window.open(item.link);\n };\n a.innerHTML = item.propContent;\n a.classList.add(\"link\");\n li.appendChild(a);\n ul.appendChild(li);\n }\n });\n}", "title": "" }, { "docid": "6483bb716d61301e54835818a12a9020", "score": "0.5474707", "text": "function onPlayerReady(event) {\n // event.target.playVideo();\n}", "title": "" }, { "docid": "438e8dd1ee297f565818fbbdd46184c1", "score": "0.5474333", "text": "function onPlayerReady(event) {\r\n // event.target.playVideo();\r\n}", "title": "" }, { "docid": "66e37d0fd597422494e220143be4ff00", "score": "0.54640687", "text": "function init() {\n if (selectAll('.walkman').length === 0) return;\n\n openLinksInOpener();\n\n document.addEventListener('DOMContentLoaded', function () {\n initPlayer();\n });\n\n setInterval(function() {\n //openLinksInOpener();\n var request = new XMLHttpRequest();\n request.open('GET', this.location.href, true);\n request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n // Success!\n var content = request.responseText;\n document.getElementById('main-content').innerHTML = content;\n openLinksInOpener();\n } else {\n // We reached our target server, but it returned an error\n if (console) console.log('Impossible de mettre à jour la page ', request);\n }\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n };\n\n request.send();\n }, 10000);\n}", "title": "" }, { "docid": "8929072d6dd05ca7dde92ed166ea83e2", "score": "0.5463959", "text": "function handleOnaddstream (e) {\n console.log('Got remote stream', e.streams);\n var remoteVideo = document.getElementById('remoteVideo');\n remoteVideo.srcObject = e.streams[0];\n}", "title": "" }, { "docid": "5437e6c99758d35f02045391b1df8ebf", "score": "0.54607373", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n }", "title": "" }, { "docid": "5ffc0272f01c19ed61372e87ab319b85", "score": "0.5459199", "text": "function attachListeners() {\n document.getElementById('choosedir').addEventListener('click', function(e) {\n chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function(entry) {\n if (!entry) {\n // The user cancelled the dialog.\n return;\n }\n\n // Send the filesystem and the directory path to the NaCl module.\n common.naclModule.postMessage({\n filesystem: entry.filesystem,\n fullPath: entry.fullPath\n });\n });\n }, false);\n}", "title": "" }, { "docid": "4636f791d7fdfb46d57347fe567efd0d", "score": "0.54530245", "text": "embedURLChanged(data){\n this.room.player.changeVideo(data.url);\n this.room.player.playVideo();\n const message = data.user + \" changed video id to: \" + this.room.player.parseURL(data.url);\n this.room.addNotification(message, data.time);\n }", "title": "" }, { "docid": "7e084a416518bd4f09bd5a8388eacf43", "score": "0.54525477", "text": "function onPlayerReady(event) {\r\n event.target.playVideo();\r\n}", "title": "" }, { "docid": "7e084a416518bd4f09bd5a8388eacf43", "score": "0.54525477", "text": "function onPlayerReady(event) {\r\n event.target.playVideo();\r\n}", "title": "" }, { "docid": "74bd2752da4368ea3e7d9c11d7d82d65", "score": "0.5449025", "text": "addNetworkChangeListeners_() {\n window.addEventListener('online', () => this.updateOnlineStatus(true));\n window.addEventListener('offline', () => this.updateOnlineStatus(false));\n }", "title": "" }, { "docid": "bbb2ab271fb2be5ca7848975a15aaa11", "score": "0.54437816", "text": "function initContextMenu(){\n const anchors = document.querySelectorAll(\"a\");\n anchors.forEach(n => {\n n.addEventListener(\"mouseover\", () => {\n chrome.runtime.sendMessage({\n type: \"linkcontextmenu\",\n linkUrl: n.href,\n });\n });\n });\n\n}", "title": "" }, { "docid": "76f84af9352333fd77e3a4d090cef65f", "score": "0.5433552", "text": "showLinks() {\n for (let link of this.links) {\n link.show();\n }\n }", "title": "" }, { "docid": "fe77063ac38efcae8bab85b4161b8251", "score": "0.54264945", "text": "function init() {\n var regex = /watch\\?\\S*v=|&\\S*/g;\n var urlFromYtAPI = ytExtPlayer.getVideoUrl();\n var urlFromNavbar = window.location.href;\n if (regex.test(urlFromNavbar)) {\n if (urlFromYtAPI.replace(regex, \"\") == urlFromNavbar.replace(regex, \"\")) {\n\n logOnce();\n resetTimer();\n console.log(\"yes video!\");\n\n };\n };\n}", "title": "" }, { "docid": "c66161e5d705c0bc1dec3fd886d5ab24", "score": "0.5418803", "text": "function init(){\r\n audio = document.getElementById(\"audio\");\r\n songTag = document.getElementsByTagName('a');\r\n for(var i = 0; i<songTag.length; i++){\r\n songTag[i].addEventListener(\"click\", playSong);\r\n }\r\n}", "title": "" }, { "docid": "5dbb034e70450f937c24081537405109", "score": "0.5413378", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n }", "title": "" }, { "docid": "5dbb034e70450f937c24081537405109", "score": "0.5413378", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n }", "title": "" }, { "docid": "5dbb034e70450f937c24081537405109", "score": "0.5413378", "text": "function onPlayerReady(event) {\n //event.target.playVideo();\n }", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" }, { "docid": "23d2262c0b5c1e6766fcadbc402087e6", "score": "0.5412093", "text": "function onPlayerReady(event) {\n event.target.playVideo();\n}", "title": "" } ]
a7157da41c768f13183cf1122529f618
Determines if a cube is pointed to at the center of the screen
[ { "docid": "f868ee95d298646b3ab788b6664bd329", "score": "0.7179725", "text": "function centered(cube)\n{\n //console.log(G_atX+\", \"+g_EyeX); \n if(Math.abs(G_atX)<45)\n {\n //console.log(\"forward\");\n if(Math.abs(cube.centerX-G_atX)>.4)return false; \n else return true; \n } \n if(G_atX-g_EyeX>=0)\n {\n //facing quadrant 1\n if(G_atY-g_EyeY>=0)\n {\n if(cube.centerX>=g_EyeX && cube.centerY>=g_EyeY)\n return true; \n }\n //facing quadrant 2\n else\n {\n //if(Math.abs(cube.centerX-g_EyeX)>.2)return false; \n\n if(cube.centerX>=g_EyeX && cube.centerY<=g_EyeY)\n return true; \n }\n }\n else\n {\n //facing quadrant 3 \n if(G_atY-g_EyeY>=0)\n {\n if(cube.centerX<=g_EyeX && cube.centerY>=g_EyeY)\n return true; \n }\n //facing quadrant 4 \n else\n {\n //if(Math.abs(cube.centerX-g_EyeX)>.2)return false; \n\n if(cube.centerX<=g_EyeX && cube.centerY<=g_EyeY)\n return true; \n }\n }\n return false; \n\n}", "title": "" } ]
[ { "docid": "5122ff8446862d77bd3c6533d074bb06", "score": "0.6480537", "text": "function outOfBounds(){\n return (g_EyeX>baseCube.centerX+baseCube.size || g_EyeX<baseCube.centerX-baseCube.size\n || g_EyeY>baseCube.centerY+baseCube.size || g_EyeY<baseCube.centerY-baseCube.size); \n}", "title": "" }, { "docid": "e7c6554ebfc94406d8a3942d298183ab", "score": "0.64018667", "text": "function inBox() {\r\n return (\r\n mouseX > cx - boxw / 2 &&\r\n mouseX < cx + boxw / 2 &&\r\n mouseY > cy - boxh / 2 &&\r\n mouseY < cy + boxh / 2\r\n );\r\n}", "title": "" }, { "docid": "e7c6554ebfc94406d8a3942d298183ab", "score": "0.64018667", "text": "function inBox() {\r\n return (\r\n mouseX > cx - boxw / 2 &&\r\n mouseX < cx + boxw / 2 &&\r\n mouseY > cy - boxh / 2 &&\r\n mouseY < cy + boxh / 2\r\n );\r\n}", "title": "" }, { "docid": "cf83be5c84b19c815fc87c219bf9e961", "score": "0.6357915", "text": "function cameraHasHitWorldBounds()\r\n{\r\n return (game.camera.x + game.camera.view.width) == game.camera.bounds.width\r\n}", "title": "" }, { "docid": "8b3d488e8cb7b5eca311ebc0da18ed8b", "score": "0.6339464", "text": "function cameraHasHitWorldBounds()\n{\n return (game.camera.x + game.camera.view.width) == game.camera.bounds.width\n}", "title": "" }, { "docid": "e00c7b0b8ad322f4db98444210c38bc1", "score": "0.6147956", "text": "function ObjectsCenter()\n{\n var lot = block[Math.round(block.length/2)][Math.round(block.length/2)];\n return lot.position;\n}", "title": "" }, { "docid": "dd2367562434fcd019caca7a44ac037f", "score": "0.6058325", "text": "function cube() {\n quad( 3, 2,1, 0,); // bottom face\n quad( 7, 6,2, 3,); // dx face (view from front face)\n quad( 4, 7,3, 0,); // back face\n quad(2, 6, 5, 1); // front face\n quad( 4, 5,6, 7,); // top face\n quad( 0, 1,5, 4,); // sx face (view from front face)\n}", "title": "" }, { "docid": "2dadd258342c183c8b44e88ec4363963", "score": "0.6051574", "text": "function freeMove(x, y)\n{\n /*figures out the array of adjacent cubes so that we only need to detect collision for the nearest \n few objects\n */ \n let a=findAdjCubes(); \n //iterate through all nearby cubes and look to see if there is collision \n for(let i=0;i<a.length;i++)\n {\n /*if the hypothetical camera position would put it within bounds of a cube then stop that from \n happening */ \n if(x+.05>a[i].centerX-a[i].size && x-.05<a[i].centerX+a[i].size &&\n y+.05>a[i].centerY-a[i].size && y-.05<a[i].centerY+a[i].size) return false; \n //For my original debugging with collision I would set the cubes to white to tell when you collide \n //{a[i].setColor([1,1,1]);return false; }\n\n }\n //if there's no collision with the nearby cubes then all is good \n return true; \n}", "title": "" }, { "docid": "077e4f718850162c15f2688ff3587970", "score": "0.5963504", "text": "_isCenterPosition(position) {\n return position == 'center' ||\n position == 'left-origin-center' ||\n position == 'right-origin-center';\n }", "title": "" }, { "docid": "1d1e2a451d105640c27fc49020bbeed2", "score": "0.5935656", "text": "static center(obj)\n {\n obj.x = game.config.width/2;\n obj.y = game.config.heigth/2;\n }", "title": "" }, { "docid": "3528b20c2f16c453c67f4f40f5b2a892", "score": "0.59139496", "text": "function bounded(ev)\n{\n /*Gets the mousex and mousey coordinates, calibrates them based on a window of any given size, \n and tests to see if they are within the lightCubes bounds for the initial rave light picking*/ \n var x = ev.clientX; \n var y = ev.clientY; \n var rect = ev.target.getBoundingClientRect();\n x = (x-rect.left-(window.innerWidth-150)/2)/((window.innerWidth)*1.8);\n x*=.8;\n x+=g_EyeX; \n y = ((window.innerHeight-100)/2 - (y - rect.top))/(window.innerHeight+200)/2;\n /*console.log(x+\", \"+y);\n console.log(lightCube.centerX-lightCube.size); \n console.log(lightCube.centerX+lightCube.size); \n console.log(lightCube.centerZ+lightCube.size); \n console.log(lightCube.centerZ+lightCube.size); \n\n console.log(x>lightCube.centerX-lightCube.size);\n console.log(x<lightCube.centerX+lightCube.size);*/ \n //console.log(y<lightCube.centerZ+lightCube.size);\n //console.log(y<lightCube.centerZ+lightCube.size); \n\n\n return((x>lightCube.centerX-lightCube.size)&&(x<lightCube.centerX+lightCube.size)\n &&(y<lightCube.centerZ+lightCube.size)&&(y<lightCube.centerZ+lightCube.size)); \n}", "title": "" }, { "docid": "7930cfd1e54c3ede4770a030ccad05f1", "score": "0.59034973", "text": "function isCrossSolved (cube) {\n if (cube.data[DOWN + 1] != WHITE) return false;\n if (cube.data[DOWN + 3] != WHITE) return false;\n if (cube.data[DOWN + 5] != WHITE) return false;\n if (cube.data[DOWN + 7] != WHITE) return false;\n if (cube.data[FRONT + 7] != BLUE) return false;\n if (cube.data[LEFT + 7] != ORANGE) return false;\n if (cube.data[BACK + 7] != GREEN) return false;\n if (cube.data[RIGHT + 7] != RED) return false;\n return true;\n}", "title": "" }, { "docid": "45c14e26f852b64d81c43d98b81742c1", "score": "0.58958393", "text": "centerOn(object) {\n this.position.x = this.screenWidth / 2 - object.position.x * this.scale.x\n this.position.y = this.screenHeight / 2 - object.position.y * this.scale.y\n }", "title": "" }, { "docid": "0a4dddea8989a1c648bd0ef067b57af8", "score": "0.58879185", "text": "_isCenterPosition(position) {\n return position == 'center' ||\n position == 'left-origin-center' ||\n position == 'right-origin-center';\n }", "title": "" }, { "docid": "8c1077ac47eff59d120f15d2d897a1c4", "score": "0.5873751", "text": "get isOrigin() {\n return this.x === 0 && this.y === 0;\n }", "title": "" }, { "docid": "3c873687cdd71087f808c80567a0f6dd", "score": "0.5861665", "text": "function eventoSpace(obj) {\n if ((\n ((camarero.top + camarero.width + 5) < obj.top) ||\n ((obj.top + obj.width + 5) < camarero.top) ||\n ((camarero.left + camarero.height + 5) < obj.left) ||\n ((obj.left + obj.height + 5) < camarero.left))) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "82151d5f9f5f40dcf3d298a2629c7713", "score": "0.5820219", "text": "function CubeCubeCollision(c1, c2)\n{\n\tif(Math.abs(c1.position.x - c2.position.x) < c1.geometry.width + c2.geometry.width)\n\t{\n\t\tif(Math.abs(c1.position.y - c2.position.y) < c1.geometry.height + c2.geometry.height)\n\t\t{\n\t\t\tif(Math.abs(c1.position.z - c2.position.z) < c1.geometry.depth + c2.geometry.depth)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "31121857f9fbe668b194a77bb33457c6", "score": "0.5811425", "text": "function isInMiddleOfSquare(attacker) {\n var centerTileX = attacker.posX * map.tileSize + map.tileSize / 2;\n var centerTileY = attacker.posY * map.tileSize + map.tileSize / 2;\n\n var borderUp = centerTileY - map.tileSize / 2;\n var borderRight = centerTileX + map.tileSize / 2;\n var borderDown = centerTileY + map.tileSize / 2;\n var borderLeft = centerTileX - map.tileSize / 2;\n\n if (attacker.direction == directions.up) {\n if (attacker.locY - map.tileSize / 2 <= borderUp) {\n return true;\n }\n } else if (attacker.direction == directions.right) {\n if (attacker.locX + map.tileSize / 2 >= borderRight) {\n return true;\n }\n } else if (attacker.direction == directions.down) {\n if (attacker.locY + map.tileSize / 2 >= borderDown) {\n return true;\n }\n } else if (attacker.direction == directions.left) {\n if (attacker.locX - map.tileSize / 2 <= borderLeft) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "3b40bea01ff029c3012dd974b8fb553a", "score": "0.5810948", "text": "function OutsideBounds (x, y, z) {\r\n\tif (x < 0 || y < 0 || z < 0 || x > AREA_X_SIZE - 1 || y > AREA_Y_SIZE - 1 || z > AREA_Z_SIZE - 1)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "a60e4c6078c1664de35024c4673c7e81", "score": "0.5784751", "text": "function isOnScreen(el){\n\t\t \n\t\t var win = $(window),\n\t\t \t$this = el;\n\t\t \n\t\t var viewport = {\n\t\t top : win.scrollTop(),\n\t\t left : win.scrollLeft()\n\t\t };\n\t\t viewport.right = viewport.left + win.width();\n\t\t viewport.bottom = viewport.top + win.height();\n\t\t \n\t\t var bounds = $this.offset();\n\t\t bounds.right = bounds.left + $this.outerWidth();\n\t\t bounds.bottom = bounds.top + $this.outerHeight();\n\t\t \n\t\t return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));\n\t\t \n\t\t}", "title": "" }, { "docid": "a288c4913444eaab00df70c34a33e06d", "score": "0.57814944", "text": "function isOnScreen(x, y, r) {\n\t//x offscreen\n\tif (x + r < 0) {\n\t\treturn false;\n\t}\n\tif (x - r > canvas.width) {\n\t\treturn false;\n\t}\n\n\t//y offscreen\n\tif (y + r < 0) {\n\t\treturn false;\n\t}\n\tif (y - r > canvas.height) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "8f2f5079fdecd2d72a81eb83042120ba", "score": "0.5757006", "text": "function CubeSphereCollision(cube, sphere)\n{\n\tif(cube.position.length() <= sphere.forceField)\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "8aea99fc49972629d87f541a2a77c87e", "score": "0.57473904", "text": "function findCenter() {\n sketch.cx = width/2 / sketch.scaleValue;\n sketch.cy = height/2 / sketch.scaleValue;\n}", "title": "" }, { "docid": "06316e5d054d69e71823add17e1067ce", "score": "0.5746115", "text": "function isElInViewportCenter(targetEl, containerEl) {\n let scrollCenterPos = containerEl.scrollTop + (containerEl.clientHeight / 2),\n elOffsetTop = targetEl.offsetTop,\n elOffsetBott = elOffsetTop + targetEl.clientHeight;\n\n return scrollCenterPos > elOffsetTop && scrollCenterPos < elOffsetBott;\n }", "title": "" }, { "docid": "bb79a524f94738542892fee3840b7e21", "score": "0.5733434", "text": "function isInsideCanvas() {\n if (planeX + 150 * scalar > width) {\n return \"over east\";\n } else if (planeX - 130 * scalar < 0) {\n return \"over west\";\n } else if (planeY + 210 * scalar > height) {\n return \"over south\";\n } else if (planeY - 210 * scalar < height * 0.65) {\n return \"over north\";\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "0523c03ab7c52a402cc3c5cba7c3b9b0", "score": "0.5731353", "text": "function isInMiddleOfSquare(attacker){\n var centerTileX = attacker.posX*game.tileSize + game.tileSize/2;\n var centerTileY = attacker.posY*game.tileSize + game.tileSize/2;\n\n var borderUp = centerTileY - game.tileSize/2;\n var borderRight = centerTileX + game.tileSize/2;\n var borderDown = centerTileY + game.tileSize/2;\n var borderLeft = centerTileX - game.tileSize/2;\n \n if (attacker.direction == directions.up) {\n if (attacker.locY - game.tileSize / 2 <= borderUp) {\n return true;\n }\n } else if (attacker.direction == directions.right) {\n if (attacker.locX + game.tileSize / 2 >= borderRight) {\n return true;\n }\n } else if (attacker.direction == directions.down) {\n if (attacker.locY + game.tileSize / 2 >= borderDown) {\n return true;\n }\n } else if (attacker.direction == directions.left) {\n if (attacker.locX - game.tileSize / 2 <= borderLeft) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "286a5e4ab4b3e9237de656552db471d1", "score": "0.57253623", "text": "function colision(obj) {\n if ((\n ((camarero.top + camarero.width - 1) < obj.top) ||\n ((obj.top + obj.width - 1) < camarero.top) ||\n ((camarero.left + camarero.height - 1) < obj.left) ||\n ((obj.left + obj.height - 1) < camarero.left))) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "de532bdb2bac2ca29eb40d18fb03d48d", "score": "0.5707167", "text": "function positionIsUsed (top, left) {\n var position;\n var used = false;\n $(\"#gameField .wall\").each(function (index, wall) {\n position = $(wall).position();\n if (position.top == top && position.left == left) {\n used = true;\n }\n });\n return used;\n}", "title": "" }, { "docid": "6755af4f03176ff362057d60ebb8d96c", "score": "0.5700077", "text": "function PositionInBounds (area, i, j, k) {\r\n\tif (0 <= i && i < area.xSize) {\r\n\t\tif (0 <= j && j < area.ySize) {\r\n\t\t\tif (0 <= k && k < area.zSize) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "b7f6f30a5d39449b292c875b2569e0ec", "score": "0.5698362", "text": "function checkColor(v) {\r\n //****Get object under character****//\r\n //cal is reset variable\r\n var cal = cha.position.clone();\r\n cha.position.copy(v);\r\n\r\n //get screen-relative position\r\n var chaPos = toScreenPosition(cha, camera);\r\n chaPos.x = (chaPos.x / window.innerWidth) * 2 - 1;\r\n chaPos.y = -(chaPos.y / window.innerHeight) * 2 + 1;\r\n\r\n var groundColor;\r\n floorBlock = cha.position.clone();\r\n\r\n raycaster.setFromCamera(chaPos, camera);\r\n var intersects = raycaster.intersectObjects(objects, true);\r\n var fem;\r\n var i;\r\n // var s = cal.distanceTo(camera.position);\r\n // console.log(\"cha\");\r\n // console.log(cha.position.distanceTo(camera.position));\r\n // console.log(\"cal\");\r\n // console.log(cal.distanceTo(camera.position));\r\n for (var k = 0; k < intersects.length; k++) {\r\n if (fem != null) {\r\n if (intersects[k].faceIndex < 12 && intersects[k].distance < fem.distance) {\r\n // if (intersects[k].faceIndex < 12 && (intersects[k].distance < fem.distance && intersects[k].object.position.distanceTo(camera.position) > s)) {\r\n i = k;\r\n }\r\n } else {\r\n if (intersects[k].faceIndex < 12) {\r\n fem = intersects[k];\r\n i = k;\r\n }\r\n }\r\n }\r\n if (typeof i !== \"undefined\" && intersects[i].faceIndex < 12) {\r\n var j = 0;\r\n //change groundColor to correct face color\r\n groundColor = eval(\"cubeColor\" + (Math.floor(intersects[i].faceIndex / 2) + 1));\r\n floorBlock = relFacePos(cha.position, intersects[i]);\r\n\r\n // console.log(\"***** intersects[i]: \");\r\n // console.log(intersects[i]);\r\n // console.log(\"***** floorBlockPos: \");\r\n // console.log(floorBlockPos);\r\n }\r\n\r\n // cha.position.y = .y+0.5;\r\n // chaPos = toScreenPosition(cha, camera);\r\n // chaPos.x = (chaPos.x / window.innerWidth) * 2 - 1;\r\n // chaPos.y = -(chaPos.y / window.innerHeight) * 2 + 1;\r\n\r\n\r\n vector.set(chaPos.x, chaPos.y, 0.5);\r\n vector.unproject(camera);\r\n vector.sub(camera.position).normalize();\r\n // var distance = (floorBlock.y - camera.position.y) / vector.y;\r\n var distance = (floorBlock.z - camera.position.z) / vector.z;\r\n \r\n pos3Dhelper.copy(camera.position).add(vector.multiplyScalar(distance));\r\n console.log(\"******* 3Dhelper:\");\r\n console.log(pos3Dhelper);\r\n\r\n cha.position.set(cal.x, cal.y, cal.z);\r\n return groundColor;\r\n}", "title": "" }, { "docid": "d536987c7fe79288349f0b9bad70871e", "score": "0.5696611", "text": "inside(x, y){\n if(this.x <= x && x <= (this.x + this.width)){\n if(this.y <= y && y <= (this.y + this.height)){ \n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "18eda88e21df98bcff72c9dd3d6b2a38", "score": "0.5692377", "text": "function mouseInRange(){\n return (mouseX > gridX && mouseY > gridY && mouseX < gridX + gridWidth*SQUARE_SIZE && mouseY < gridY + gridHeight*SQUARE_SIZE);\n}", "title": "" }, { "docid": "4e196a07591db1d3f96f7c37c9dda18f", "score": "0.5689294", "text": "function mouseInSpacers() {\n if (p5.mouseX < boxesX || p5.mouseX > boxesX + boxesW) return false;\n if (p5.mouseY < boxesY || p5.mouseY > boxesY + boxesH) return false;\n return true;\n }", "title": "" }, { "docid": "2942ccaa644ff53bf056c0798d1192ec", "score": "0.5688014", "text": "function getCenterOfRoom(roomNumber){\r\n // which column and row are we in?\r\n var col = ((roomNumber-1) % COLS) + 1;\r\n var row = Math.floor((roomNumber-1) / COLS) + 1;\r\n // these are from birdseye (left + top)\r\n var groundLeft = GROUND_WIDTH / 2 * -1;\r\n var groupTop = GROUND_HEIGHT / 2;\r\n // cheat sheet on how to find the center \"X\" based on number of wall widths\r\n // { col, number of widths }\r\n // { 1, 2 }\r\n // { 2, 3.5 }\r\n // { 3, 5 }\r\n // { 4, 6.5 }\r\n // { 5, 8 }\r\n // { 6, 9.5 }\r\n var xPos = groundLeft + WALL_WIDTH + ((1 + (1.5 * (col-1))) * 15);\r\n // cheat sheet on how to find the center \"Z\" based on number of wall widths\r\n // { row, number of widths }\r\n // { 1, 2 } 1\r\n // { 2, 4 } 3\r\n // { 3, 6 } 5\r\n // { 4, 8 } 7\r\n // { 5, 10 } 9\r\n var zPos = groupTop - 36 - ((row-1) * 26); // WALL_WIDTH\r\n // odd columns are shifted down a bit\r\n var oddCol = col % 2;\r\n if (!oddCol) {\r\n zPos -= 13;\r\n }\r\n // x, y, z\r\n var position = new BABYLON.Vector3(xPos, WALL_HEIGHT / 2, zPos);\r\n return position;\r\n}", "title": "" }, { "docid": "2587d6f9ee5741a083b4012568620aed", "score": "0.56580126", "text": "pointInside( p )\n {\n if( p.x < -( this.width * this.origin.x ) ) return false;\n if( p.y < -( this.height * this.origin.y ) ) return false;\n if( p.x > ( this.width * ( 1 - this.origin.x ) ) ) return false;\n if( p.y > ( this.height * ( 1 - this.origin.y ) ) ) return false;\n return true;\n }", "title": "" }, { "docid": "a523edb97349c247b76c35db1e934d23", "score": "0.5655487", "text": "function box_center(box) {\n return point(box.x + box.width / 2,\n box.y + box.height / 2)\n}", "title": "" }, { "docid": "1e0a761f88e0fc1771527555233cddf4", "score": "0.5649433", "text": "isPlacedOnGrid () {\r\n let {x, y, direction} = this;\r\n return x >= 0 && y >= 0 && !!direction;\r\n }", "title": "" }, { "docid": "71cced3ed65755a446591f6ebe0b01f5", "score": "0.56375116", "text": "function checkPlayersSurface() {\n\t\t// Origin, Direction, Length\n\t\tvar surfaceCheckRay = new BABYLON.Ray(trackingBox.position, new BABYLON.Vector3(0, -1, 0), 2.2);\n\n\t\t\n\t\tonInclinedSurface = scene.pickWithRay(surfaceCheckRay, function (mesh) {\n\t\t\tfor(var x=0; x<inclinedMeshes.length; x++){\n\t\t\t\tif(mesh==inclinedMeshes[x]){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t});\t\t\t\n\t}", "title": "" }, { "docid": "d01863e38238c7ab73d27b606e869b3f", "score": "0.5631494", "text": "if( current_m.phys.x == 0.0 &&\n current_m.phys.y == 0.0 ) {\n break;\n }", "title": "" }, { "docid": "44af383f30e42e688f43e0693c891cf2", "score": "0.5629411", "text": "function isCenteredOverCell(sprite) {\n return Math.floor(sprite.x) % world.tilewidth === 0 && Math.floor(sprite.y) % world.tileheight === 0;\n}", "title": "" }, { "docid": "fd83fed0b2016a6c2bc1dd98f2ff6977", "score": "0.5619123", "text": "get isFlat() {\n const E = Sprite3D.E\n return (\n this._z > -E &&\n this._z < E &&\n this._rotationX > -E &&\n this._rotationX < E &&\n this._rotationY > -E &&\n this._rotationY < E &&\n this._pivotZ > -E &&\n this._pivotZ < E\n )\n }", "title": "" }, { "docid": "0cf0176a8dfd2bfbeccb8aa336b372db", "score": "0.5617194", "text": "function isCentered( element ) {\r\n\tlet scrollTop = $( document ).scrollTop(),\r\n\t\tminScrollTop = element.offset().top - $( window ).height() / 2, \r\n\t\tmaxScrollTop = minScrollTop + element.outerHeight( true );\r\n\t\t\r\n\treturn scrollTop < maxScrollTop && scrollTop > minScrollTop;\r\n}", "title": "" }, { "docid": "75ee2da615dce80d2e712127470c821e", "score": "0.56155175", "text": "function inView(node){\n\tlet adjustedX = node.x-cameraX;\n\tlet adjustedY = node.y-cameraY;\n\treturn !(adjustedX+node.radius<=0||adjustedX-node.radius>=width||adjustedY+node.radius<=0||adjustedY-node.radius>=height);\n}", "title": "" }, { "docid": "8d880c2f556a455ea64229395bea86fb", "score": "0.56025684", "text": "function translateCube( x, y, z ) {\n\tif( cube!=null ) {\n\t\tax = parseFloat( cube.position.x )+parseFloat( x );\n\t\tay = parseFloat( cube.position.y )+parseFloat( y );\n\t\taz = parseFloat( cube.position.z )+parseFloat( z );\n\t\tcube.position.set( ax, ay, az );\n\t\t/* sama sahha\n\t\tcube.position.x = parseFloat( cube.position.x )+x;\n\t\tcube.position.y = parseFloat( cube.position.y )+y;\n\t\tcube.position.z = parseFloat( cube.position.z )+z;*/\n\t\t//alert( ax +\" \"+ ay +\" \"+ az );\n\t}\n}", "title": "" }, { "docid": "03cee27c0b47ea3165bf6828fa1204e0", "score": "0.56011635", "text": "function checkBrowserDim(){\n\tSCALAR = Math.floor($(window).height()/SCREEN_HEIGHT);\n\tif(SCALAR === 0){\n\t\tSCALAR =1;\n\t}\n\tCENTER = Math.floor($(window).width()/2)-(SCREEN_WIDTH*SCALAR/2);\n}", "title": "" }, { "docid": "624fba3d57b827b9cb87c44dfddcb3c7", "score": "0.5569743", "text": "posInBounds(x, y) {\n if(x < 0 || x >= this.grid_w) return false;\n if(y < 0 || y >= this.grid_h) return false;\n return true;\n }", "title": "" }, { "docid": "0cebf88f7d12c58c4fff72aab336a360", "score": "0.55668604", "text": "getViewCenter() {\n return mouseToWorld({\n clientX: window.innerWidth / 2,\n clientY: window.innerHeight / 2\n }, this.camera)\n }", "title": "" }, { "docid": "beac5d4ac307852f49a29a191c21b6e3", "score": "0.55623585", "text": "function offScreen(object) {\n // If the objects x coordinate is bigger then the canvas width or lower return true\n if (object.position.x > c.width || object.position.x < 0) {\n return true;\n }\n // If the objects y coordinate is bigger then the canvas height or lower return true\n if (object.position.y > c.height || object.position.y < 0) {\n return true;\n }\n // If it's on the canvas return true\n return false;\n}", "title": "" }, { "docid": "80a81a73e149460219f1dfe10c2ace1d", "score": "0.55567646", "text": "checkCollisions () {\n if (this.xCoordinate + 70 > player.xCoordinate && this.xCoordinate < player.xCoordinate + 70\n && this.yCoordinate + 60 > player.yCoordinate && this.yCoordinate < player.yCoordinate + 60) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "4260d0f50d41ce6a74218fc82c71f980", "score": "0.55498296", "text": "contains(object) {\n const insideX = object.position.x >= this.bounds.x && object.position.x <= this.bounds.x + this.bounds.w;\n const insideY = object.position.y >= this.bounds.y && object.position.y <= this.bounds.y + this.bounds.h;\n return insideX && insideY;\n }", "title": "" }, { "docid": "889d7d08495639f80693b4c3dc66fe5f", "score": "0.5540528", "text": "function mouseIsInCanvas() {\n return 0 <= mouseX && mouseX < CANVAS_WIDTH && 0 <= mouseY && mouseY < CANVAS_HEIGHT;\n}", "title": "" }, { "docid": "7547cbb266821f55ba7ac2de44b32f66", "score": "0.5533219", "text": "mouseinviewport(event) {\n\n if ( this.enabled === false ) return false;\n\n let offset = $(this.domElement).offset();\n let ex=event.clientX-offset.left+$(window).scrollLeft();\n let ey=event.clientY-offset.top+$(window).scrollTop();\n\n ey=this.screen.height-(ey+1);\n let vp;\n if (this.plane===3) {\n vp = [ this.normViewport.old.x0*this.screen.width ,\n this.normViewport.old.x1*this.screen.width ,\n this.normViewport.old.y0*this.screen.height,\n this.normViewport.old.y1*this.screen.height ];\n } else {\n vp = [ this.normViewport.x0*this.screen.width ,\n this.normViewport.x1*this.screen.width ,\n this.normViewport.y0*this.screen.height,\n this.normViewport.y1*this.screen.height ];\n }\n\n\n if (ex <= vp[0] || ex >= vp[1] || ey <= vp[2] || ey>=vp[3])\n return false;\n\n let n = new THREE.Vector3(\n 2.0*(ex-vp[0])/(vp[1]-vp[0])-1.0,\n 2.0*(ey-vp[2])/(vp[3]-vp[2])-1.0,\n 1.0);\n this.lastNormalizedCoordinates[0]=n.x;\n if (this.plane===3) {\n // Scale y coordinate using the proper ratio\n this.lastNormalizedCoordinates[1]=n.y*this.normViewport.ratio;\n } else {\n this.lastNormalizedCoordinates[1]=n.y;\n }\n\n let w=n.unproject(this.camera);\n this.lastCoordinates[0]=w.x;\n this.lastCoordinates[1]=w.y;\n this.lastCoordinates[2]=w.z;\n return true;\n }", "title": "" }, { "docid": "17b67c3d8624be81cde184cfc02ce350", "score": "0.5518927", "text": "hitTest (x, y) {\n const radius = this.attributes.size.array[this.idx] * 0.25\n if (radius === 0) return false\n const xDiff = this.attributes.position.array[this.idx * 3] - x\n const yDiff = this.attributes.position.array[this.idx * 3 + 1] - y\n return xDiff * xDiff + yDiff * yDiff <= radius * radius\n }", "title": "" }, { "docid": "17b67c3d8624be81cde184cfc02ce350", "score": "0.5518927", "text": "hitTest (x, y) {\n const radius = this.attributes.size.array[this.idx] * 0.25\n if (radius === 0) return false\n const xDiff = this.attributes.position.array[this.idx * 3] - x\n const yDiff = this.attributes.position.array[this.idx * 3 + 1] - y\n return xDiff * xDiff + yDiff * yDiff <= radius * radius\n }", "title": "" }, { "docid": "84f131e8af22c6cf26b85aa20aa44a9d", "score": "0.55132324", "text": "function centreCoord(c) { return Math.floor(c)+0.5 }", "title": "" }, { "docid": "2957b1bbc902acf44112d0fb76155174", "score": "0.55131656", "text": "function nearNullIsland(x, y, z) {\n if (z >= 7) {\n var center = Math.pow(2, z - 1),\n width = Math.pow(2, z - 6),\n min$$1 = center - (width / 2),\n max$$1 = center + (width / 2) - 1;\n return x >= min$$1 && x <= max$$1 && y >= min$$1 && y <= max$$1;\n }\n return false;\n }", "title": "" }, { "docid": "bce57dc49189ae60281e002356585bfa", "score": "0.5510626", "text": "inBounds() {\n\t\treturn (this.location.x < width + this.mass &&\n\t\t\tthis.location.x > -this.mass &&\n\t\t\tthis.location.y < height + this.mass &&\n\t\t\tthis.location.y > -this.mass);\n\t}", "title": "" }, { "docid": "f40704a7f3a0961f3347168ace66f724", "score": "0.5505092", "text": "function isCenterLinear(x, w) {\n // const aw = w / 3;\n // const ax = Math.ceil(x / aw);\n // return (ax - 1) % 2 === 1;\n\n // above is same as below\n\n return (Math.ceil(x / (w / 3)) - 1) % 2 === 1;\n }", "title": "" }, { "docid": "68f3488ac69108f764349d2f92869abd", "score": "0.54983", "text": "function onscreen(node) {\r\n if (node.x < -300 || node.y < -1000 || node.y > 1000) {\r\n console.log(\"node: \" + node.x + \", \" + node.y);\r\n }\r\n return !(node.x < -300 || node.y < -1000 || node.y > 1000);\r\n }", "title": "" }, { "docid": "59a9f529b1de095f1c34bf8760aa1813", "score": "0.5498275", "text": "function isCenterLinear(x, w) {\n // const aw = w / 3;\n // const ax = Math.ceil(x / aw);\n // return (ax - 1) % 2 === 1;\n\n // above is same as below\n\n return (Math.ceil(x / (w / 3)) - 1) % 2 === 1;\n }", "title": "" }, { "docid": "c9b2e690d544a92f739115d64e899d77", "score": "0.547982", "text": "function collision_detection() {\r\n\tif ($(\"#canvas\").children().length > 2) {\r\n\t\tfor (var i = 3; i < ($(\"#canvas\").children().length - 1); i++) {\r\n\t\t\tif (($(\"#0\").offset().top === $(\"#\" + i).offset().top) && ($(\"#0\").offset().left === $(\"#\" + i).offset().left)) {\r\n\t\t\t\tgame_counter = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "5f891310bf17a313c15c2260fff84e5a", "score": "0.547879", "text": "mouseIsOverImage() {\n if (this.body) {\n //make sure to update the global position just incase the body has moved\n this.updateGlobalPositionBasedOnBodyAndRelativePositioning();\n\n }\n\n\n let mousePosition = createVector(mouseX, mouseY);\n let positionRelativeToCenter = p5.Vector.sub(mousePosition, this.center);\n positionRelativeToCenter.rotate(-this.angle);\n let pos = p5.Vector.add(this.center, positionRelativeToCenter);\n\n return (pos.x > this.x && pos.x < this.x + this.w && pos.y > this.y && pos.y < this.y + this.h);\n\n\n }", "title": "" }, { "docid": "d9bdc9e72ba297524d3ee59954379290", "score": "0.54754364", "text": "function cubiesEventToCubeCoord(x, y, onAxis) {\n // Convert from the screen coordinates to world coordinates. Note that\n // 0.5 is used because it's somewhere between the near and far clipping\n // planes.\n var worldCoord = new THREE.Vector3();\n worldCoord.set((x / animateCanvasWidth) * 2 - 1, -(y / animateCanvasHeight) * 2 + 1, 0.5);\n worldCoord.unproject(animateCamera);\n\n var bestMove = null;\n var bestMoveScore = eventRotationLockLimit;\n\n var axes = onAxis ? [onAxis] : [\"x\", \"y\", \"z\"];\n for (var i = 0; i < axes.length; i++) {\n var axis = axes[i];\n // Of the two sides for each axis we only need to consider the one\n // closest to the animateCamera.\n var side = (animateCamera.position[axis] >= 0) ? cubiesHalfSide\n : -cubiesHalfSide;\n\n // A unit normal vector that points from the animateCamera toward the point\n // on the cube that we're trying to find.\n var towardCube = worldCoord.clone().sub(animateCamera.position).normalize();\n\n if (!towardCube[axis]) {\n // Avoid division by zero.\n continue;\n }\n\n // The distance from the animateCamera to the side being considered.\n var toCube = -(animateCamera.position[axis] - side) / towardCube[axis];\n\n // The location clicked that may be in the cube.\n var clicked = animateCamera.position.clone().add(\n towardCube.multiplyScalar(toCube));\n\n // For the point clicked to be on the surface of the cube all three\n // coordinates have to be in range, otherwise try the next one.\n // If an axis was specified (onAxis) then accept the point even if it's\n // not in the cube as the user is allowed to drag the mouse out of\n // the cube.\n var move = {\n axis : axis,\n pos : clicked\n };\n\n if (onAxis) {\n // If this is the move end then we use the mouse up location to\n // indicate the direction of cube move regardless of where it is.\n return move;\n }\n\n // Since the calculation attempts to find a point on the surface of\n // cube _cubiesSmallValue is added to allow for rounding errors.\n if ((Math.abs(clicked.x) <= (cubiesHalfSide + _cubiesSmallValue))\n && (Math.abs(clicked.y) <= (cubiesHalfSide + _cubiesSmallValue))\n && (Math.abs(clicked.z) <= (cubiesHalfSide + _cubiesSmallValue))) {\n // The location found was on the cube, so no need to search\n // further.\n return move;\n } else if (eventRotationLock) {\n // For eventRotationLock find the best axis to use for the move begin\n // even if it's not on the cube.\n var moveScore = _cubiesGetMoveScore(move);\n if (moveScore < bestMoveScore) {\n bestMove = move;\n bestMoveScore = moveScore;\n }\n }\n }\n\n // Either location clicked was not on the cube, or eventRotationLock is on in\n // which case we return our best guess.\n return eventRotationLock ? bestMove : null;\n}", "title": "" }, { "docid": "f35c8067a3a5c4a03741fbd96c4ab8a4", "score": "0.54716265", "text": "isInside(location) {\n let gazeRadius = store.getState().gazeCursorRadius;\n var inside = false;\n\n // Find the closest point to the circle within the rectangle\n\n\n let closestX = Math.max(this.state.visibleStyle.left, Math.min((this.state.visibleStyle.left+this.state.visibleStyle.width), location.locX));//-gazeRadius));\n let closestY = Math.max(this.state.visibleStyle.top, Math.min((this.state.visibleStyle.top+this.state.visibleStyle.height), location.locY));//-gazeRadius));\n\n // Calculate the distance between the circle's center and this closest point\n let distanceX = location.locX - closestX;\n let distanceY = location.locY - closestY;\n\n // If the distance is less than the circle's radius, an intersection occurs\n let distanceSquared = (distanceX * distanceX) + (distanceY * distanceY);\n\n if (distanceSquared < (gazeRadius * gazeRadius)) {\n inside = true;\n }\n\n let result = {\n inside: inside,\n distance: distanceSquared\n }\n\n return result;\n }", "title": "" }, { "docid": "e6aa4f8e91321829467c8daf1a915084", "score": "0.5464268", "text": "function example002 () {\n return intersection(\n difference(\n union(\n cube({size: [30, 30, 30], center: true}),\n translate([0, 0, -25], cube({size: [15, 15, 50], center: true}))\n ),\n union(\n cube({size: [50, 10, 10], center: true}),\n cube({size: [10, 50, 10], center: true}),\n cube({size: [10, 10, 50], center: true})\n )\n ),\n translate([0, 0, 5], cylinder({h: 50, r1: 20, r2: 5, center: true})));\n}", "title": "" }, { "docid": "101534155af5ede39d0edd2deed2b0b5", "score": "0.54634184", "text": "boxContains(pointX,pointY){\n\t if(arguments.length === 1) {\n\t\t pointY = pointX.y\n\t\t pointX = pointX.x;\n }\n\t\treturn (pointX >= this.x-this.width/2 && pointX <= this.x+this.width/2 && pointY >= this.y-this.height/2 && pointY <= this.y+this.height/2)\n }", "title": "" }, { "docid": "3b3e85d427a5786ae76aecd418120d27", "score": "0.5460813", "text": "function isInsideBox(posx, posy, x, y) \n{\n\tif((posx >= x && posx <= x+100) && (posy >= y && posy <= y+100))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "5fb0e6bff8071175857100a3307ed9cb", "score": "0.54490674", "text": "boxPosition( triggerElm ) {\n let [ top, right, bottom, left ] = [ true, false, false, true ];\n\n if ( triggerElm instanceof HTMLElement ) {\n let box = triggerElm.getBoundingClientRect();\n let posx = box.left + ( triggerElm.offsetWidth / 2 );\n let posy = box.top + ( triggerElm.offsetHeight / 2 );\n let centerx = ( window.innerWidth / 2 );\n let centery = ( window.innerHeight / 2 );\n\n top = ( posy < centery ) ? true : false;\n right = ( posx > centerx ) ? true : false;\n bottom = ( posy > centery ) ? true : false;\n left = ( posx < centerx ) ? true : false;\n return { top, right, bottom, left };\n }\n }", "title": "" }, { "docid": "1cd81665fd401936cf674f53a64bf27d", "score": "0.54454696", "text": "checkActorUnderPointer(actor) {\n if (this.lastWorldPos) {\n return actor.contains(this.lastWorldPos.x, this.lastWorldPos.y, !Actors.isScreenElement(actor));\n }\n return false;\n }", "title": "" }, { "docid": "ab5ea4bb143b5cc9f1ec717de72221fd", "score": "0.5440173", "text": "isOffscreen() {\n\t\treturn \t(this.getX() < GameObject.getBufferW()) ||\n\t\t\t\t(this.getX() > GameObject.getBufferE()) ||\n\t\t\t\t(this.getY() < GameObject.getBufferN()) ||\n\t\t\t\t(this.getY() > GameObject.getBufferS());\n\t}", "title": "" }, { "docid": "bebeff0782c17b1717e9c0cd519e8cd2", "score": "0.5430029", "text": "snakeHitsWall () {\n let snakeHead = this.snake.head()\n return (\n snakeHead.x === 0 ||\n snakeHead.y === 0 ||\n snakeHead.x === this.squares.x - 1 ||\n snakeHead.y === this.squares.y - 1\n )\n }", "title": "" }, { "docid": "f43285dc63a08a7138c6e331d32a6a71", "score": "0.5428759", "text": "function positionValid (x, y) {\n if (x >= 0 && y >= 0 && x < mapWidth && y < mapHeight)\n return true;\n return false;\n}", "title": "" }, { "docid": "d43d9f010416c4c453f33c8302f6d299", "score": "0.54240406", "text": "function visible( face, vertices, vertex ) {\n\n var va = vertices[ face[ \"a\" ] ];\n var vb = vertices[ face[ \"b\" ] ];\n var vc = vertices[ face[ \"c\" ] ];\n\n var n = normal( va, vb, vc );\n\n // distance from face to origin\n var dist = n.dot( va );\n\n return n.dot( vertex ) >= dist;\n\n }", "title": "" }, { "docid": "5a648a0fa89dfaf503a16bc5de153c8e", "score": "0.54234076", "text": "isOffTheScreen() {\n if(this.x + this.width <= 0) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "bc1fbc52917b89d3530fd6f3e45d52a3", "score": "0.54131734", "text": "function sdfBox(point)\n{\n // Do not care about y though\n var x= Math.max(point.x - cube.position.x - parameters.cube.width / 2 , \n cube.position.x - point.x - parameters.cube.width / 2 );\n // var y= Math.max(point.y - cube.position.y - parameters.cube.height / 2 , \n // cube.position.y - point.y - parameters.cube.height / 2 );\n var z= Math.max(point.z - cube.position.z - parameters.cube.depth / 2 , \n cube.position.z - point.z - parameters.cube.depth / 2 );\n // var d = Math.max(x, y, z);\n var d = Math.max(x, z);\n\n return d;\n}", "title": "" }, { "docid": "2dc13c27128d704db91bd8dedb1b3279", "score": "0.54112226", "text": "getCenterX() {\n return (this.maxX + this.minX) / 2;\n }", "title": "" }, { "docid": "f8842ab8c8bc3c542591e2acd00bc2a9", "score": "0.54076016", "text": "function Start() {\n\tvar cam : Camera = Camera.main;\n\tcamBottomLeft = cam.ScreenToWorldPoint(new Vector3(0, 0, cam.nearClipPlane));\n\tcamTopRight = cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, cam.pixelHeight, cam.nearClipPlane));\n}", "title": "" }, { "docid": "2beffe3975dff4c594bbe7fc514686e9", "score": "0.5407175", "text": "function three_module_middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}", "title": "" }, { "docid": "34bdfcc393111ea92594df9ae91c4d1e", "score": "0.5404842", "text": "center() {\r\n\tvar topLeft;\r\n\tif (this.isHorizontal()) {\r\n\t topLeft = this.east.topLeft();\r\n\t} else if (this.isVertical()) {\r\n\t topLeft = this.north.topLeft();\r\n\t}\r\n\treturn {\r\n\t x: topLeft.x + this.width / 2,\r\n\t y: topLeft.y + this.height / 2\r\n\t}\r\n }", "title": "" }, { "docid": "c72acddc54bdd83007c4327664be3c84", "score": "0.54020846", "text": "static centerV(obj)\n {\n obj.y = game.config.heigth/2;\n }", "title": "" }, { "docid": "4cc3c594f3626ae69b1775253a06a581", "score": "0.54007614", "text": "function isOnScreen( elem ) {\n\t\tvar element = elem.get( 0 );\n\t\tif ( element == undefined ) return false;\n\t\tvar bounds = element.getBoundingClientRect();\n\t\treturn bounds.top + 75 < window.innerHeight && bounds.bottom > 0;\n\t}", "title": "" }, { "docid": "c83c715da0b5049372a8576a868a7b1b", "score": "0.5396984", "text": "function center_coord(x, y){return( ((y - x) / 2) + x );}", "title": "" }, { "docid": "6b0f206c0187bf16c9db6b214a73c47a", "score": "0.53962576", "text": "getCenter(){\r\n let x = this.position[0];\r\n let y = this.position[1];\r\n let z = this.position[2];\r\n let center = [x + length/2, y - length/2, z + length/2];\r\n return center;\r\n }", "title": "" }, { "docid": "ed5ac33f7b6d887a1e24b18043569d9f", "score": "0.5393601", "text": "function isSectionOnScreen(element, buffer) {\n buffer = typeof buffer === 'undefined' ? 0 : buffer;\n // Get element's position in the viewport\n const bounding = element.getBoundingClientRect();\n\n // Check if element is in the viewport \n if (bounding.top >= buffer && bounding.left >= buffer && bounding.right <=\n // fallback for browser compatibility \n ((window.innerWidth || document.documentElement.clientWidth) - buffer) &&\n bounding.bottom <=\n ((window.innerHeight || document.documentElement.clientHeight) - buffer)) {\n return true\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "ed5ac33f7b6d887a1e24b18043569d9f", "score": "0.5393601", "text": "function isSectionOnScreen(element, buffer) {\n buffer = typeof buffer === 'undefined' ? 0 : buffer;\n // Get element's position in the viewport\n const bounding = element.getBoundingClientRect();\n\n // Check if element is in the viewport \n if (bounding.top >= buffer && bounding.left >= buffer && bounding.right <=\n // fallback for browser compatibility \n ((window.innerWidth || document.documentElement.clientWidth) - buffer) &&\n bounding.bottom <=\n ((window.innerHeight || document.documentElement.clientHeight) - buffer)) {\n return true\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "853ccce41af6e8d1f2e6dc6085d44291", "score": "0.53926796", "text": "function isInViewport(element)\n {\n return winTop() + winHeight() >= getTop(element) + getHeight(element)\n && winTop() <= getTop(element) + getHeight(element);\n }", "title": "" }, { "docid": "0e4d4ca6a9d50e5fabebc529896d073b", "score": "0.5391102", "text": "checkMouseHitbox(x,y){\n return (x >= this.x && x <= this.dx && y >= this.y && y <= this.dy);\n }", "title": "" }, { "docid": "e604d615d12e39127bed92de5f218aa4", "score": "0.5387187", "text": "function checkHitBox(){\n if(logo.x+logo.img.width*scale >= canvas.width || logo.x <= 0){\n logo.xspeed *= -1;\n }\n \n if(logo.y+logo.img.height*scale >= canvas.height || logo.y <= 0){\n logo.yspeed *= -1;\n } \n}", "title": "" }, { "docid": "43ea326fb5a1bcbe812366f63bb85c9f", "score": "0.5384257", "text": "function ensureCentre(o, target) {\r\n\t o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n\t o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n\t}", "title": "" }, { "docid": "43ea326fb5a1bcbe812366f63bb85c9f", "score": "0.5384257", "text": "function ensureCentre(o, target) {\r\n\t o.cx = o.cx == null ? target.bbox().cx : o.cx\r\n\t o.cy = o.cy == null ? target.bbox().cy : o.cy\r\n\t}", "title": "" }, { "docid": "2d6d9420440bb7e4f172383925a5c150", "score": "0.53771836", "text": "positionExists({ x, y }) {\n return (\n x > -1 && y > -1 &&\n x <= this.size.x &&\n y <= this.size.y\n );\n }", "title": "" }, { "docid": "55a03cb9848c175ae517b694f675e87e", "score": "0.5374804", "text": "function trackPlayer(ctx){\n myWorld.viewport.centerTo(player);\n}", "title": "" }, { "docid": "28a65363851557ec28eb8aa339073ebe", "score": "0.5369718", "text": "_checkPosition() {\n const context = GameState.current;\n const stageWidth = context.game.stage.width;\n const stageHeight = context.game.stage.height;\n const myUnit = this.sprite;\n\n if (myUnit.x > stageWidth) {\n myUnit.x = 0;\n }\n if (myUnit.x < 0) {\n myUnit.x = stageWidth;\n }\n if (myUnit.y > stageHeight) {\n myUnit.y = 0;\n }\n if (myUnit.y < 0) {\n myUnit.y = stageHeight;\n }\n }", "title": "" }, { "docid": "3efd6685feaf31f3d7a011d907d5ef4e", "score": "0.53677547", "text": "static intersect_cube( p, margin = 0 )\r\n { return p.every( value => value >= -1 - margin && value <= 1 + margin )\r\n }", "title": "" }, { "docid": "0ca8540a44b6d0381bb529e1de7649e9", "score": "0.536453", "text": "isOnSelection() {\n return Math.abs(this.y - player.y) < 30 && Math.abs(this.x - player.x) < 30;\n }", "title": "" }, { "docid": "1070a8c4bf81b2e63695f1c86a972617", "score": "0.5364098", "text": "hitTest(){ //funktioniert noch nicht \n if(mouseX>=this.x+this.width -20 &&\n mouseX<=this.x+this.width-10&&\n mouseY>=this.y+60+this.y+10&&\n mouseY<=this.y+60+this.y+30){\n return true;\n }else {\n return false;\n }\n }", "title": "" }, { "docid": "8753006bbbc9de7a3c3fe655a3d426bc", "score": "0.5362071", "text": "collision() {\n return ((this.x + 101 - 30 > player.x\n && this.x + 101 -30 < player.x + 101\n || this.x >= player.x\n && this.x < player.x + 101 -30))\n && this.y === player.y;\n }", "title": "" }, { "docid": "98e079d63c6c2560b84f6161c5e456bb", "score": "0.5357012", "text": "function three_module_pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "5e0f9079693bfb80697c272e56482372", "score": "0.5356158", "text": "inView(obj) {\n let r = Rectangle.offset(obj, this.offsetX, this.offsetY);\n\n return ((r.bounds.right >= 0 && r.bounds.right <= this.width) || (r.x >= 0 && r.x <= this.width)) &&\n ((r.bounds.bottom >= 0 && r.bounds.bottom <= this.height) || (r.y >= 0 && r.y <= this.height));\n }", "title": "" }, { "docid": "fba6762927ab9be938e4c1af72a7bc49", "score": "0.53540885", "text": "function check(mX, mY, locX, locY, tempRsize){\n if(mX > locX && mX < locX + tempRsize && mY > locY && mY < locY + tempRsize){\n console.log(\"in box\");\n return true; // good for if you have multiple boxes\n }else{\n return false; // true/false or variables or strings or numbers, can return anything\n }\n}", "title": "" } ]
257cd9b33a784523f5e698227036501a
Function to display HTML 5 notification to user.
[ { "docid": "226924cbcbd7b04e15c0615996323231", "score": "0.0", "text": "function myAlert(title, msg) {\n\ttitle = 'PlayIt: ' + title;\n\tchrome.notifications.create({\n\t\ttype: 'basic',\n\t\ticonUrl: 'Icon-48.png',\n\t\ttitle: title,\n\t\tmessage: msg\n\t\t}, function(notification) {\n\tsetTimeout(function() {\n\tchrome.notifications.clear(notification);\n\t}, 3000);\n\t});\n}", "title": "" } ]
[ { "docid": "48cbaab61c765d0d10999f2f191f5c3c", "score": "0.7010865", "text": "function notify (message, klass = ' ') {\n $('.notification-area').css('visibility','visible')\n $('.notification-area').html('<h2 class=' + klass + '>' + message + '</h2>')\n }", "title": "" }, { "docid": "bd4b1c25310c055cb20047fb416cac22", "score": "0.6894005", "text": "function notification()\n{\n\tjQuery(\"zawiw-notification-placeholder\").toggle();\n\tjQuery(\"#zawiw-notification-placeholder\").fadeIn(1);\n\tjQuery(\"#zawiw-chat-notification\").html(\"<b>New message alert</b>\");\n\tjQuery(\"#zawiw-notification-placeholder\").fadeOut(5000);\n}", "title": "" }, { "docid": "7a4bb78c0f7b180367209cf0fbed5fb2", "score": "0.6859213", "text": "function displayMessageNotification(notificationText){\n var messageNotification = document.getElementById('message');\n messageNotification.innerHTML = notificationText;\n messageNotification.className = 'showMessageNotification';\n}", "title": "" }, { "docid": "bdfdfa3b1ec676b96b43d610f77b50e2", "score": "0.6857159", "text": "function notify(html) {\n $.notify(html, { position: \"bottom left\", autoHideDelay: 10000 });\n}", "title": "" }, { "docid": "5861c719cb92bd1835eb5ab326773c09", "score": "0.6852654", "text": "function notifyUser(message) {\n $(\"#notify_container\").html(\"<div class='treatment notify_text'>\"+message+\"</div>\");\n}", "title": "" }, { "docid": "ca7a51acb3052bd6235a8cfdbc5e45af", "score": "0.6810401", "text": "function displayNotification(msg, color) {\r\n let pageMessages = document.getElementById(\"page-messages\");\r\n\r\n // Display in user defined color or follow element CSS rule\r\n color ? (setTextColor(pageMessages, color)) : \"\";\r\n\r\n pageMessages.innerText = msg;\r\n return true;\r\n}", "title": "" }, { "docid": "2f8ed0493549e9fd8f36a1887cbeb62d", "score": "0.67819256", "text": "function showNotification(noteID, title, body, url, appKey) {\n var options = {\n body: body,\n tag: \"hue\",\n icon: _hueSW.host + '/logo?size=100&direct=true&appKey=' + _hueSW.appKey + '&noteID='+ noteID + '&url=' + encodeURIComponent(url)\n };\n return self.registration.showNotification(title, options);\n}", "title": "" }, { "docid": "d78b0dd5d15b7e948864ff434c7b3253", "score": "0.6738171", "text": "function notify(title, content) {\n notification.children[0].textContent = title;\n notification.children[1].textContent = content;\n notification.style.display = \"block\";\n}", "title": "" }, { "docid": "4cdde6607fba97806b43bd5934244f3e", "score": "0.66836584", "text": "function displayNotification(alterMessage) {\n $('.toast-body').replaceWith(\n `<div class=\"toast-body pl-3 pt-2 pr-2 pb-2\">${alterMessage}</div>`\n );\n $('.toast').css('zIndex', 1000);\n $('.toast').toast('show');\n}", "title": "" }, { "docid": "86723571257e6985349fad3b4b903871", "score": "0.66588", "text": "function notify ()\r\n{\r\n\tvar notification = webkitNotifications.createNotification(\r\n\t'48.png', // icon url - can be relative\r\n\t'Hello!', // notification title\r\n\t'Lorem ipsum...' // notification body text\r\n\t);\r\n\tnotification.show();\r\n}", "title": "" }, { "docid": "a9a039ac5654e7f31ac6f8c3cba8ebf8", "score": "0.662906", "text": "function notify() {\r\n\r\n if (postmileYUI &&\r\n env &&\r\n env.message) {\r\n\r\n document.getElementById('notify').innerHTML = env.message;\r\n document.getElementById('notify').style.top = '0px';\r\n\r\n refreshNotifyNode(); // just in case DOM changed\r\n\r\n showAnimation.run();\r\n setTimeout(function () {\r\n hideAnimation.run();\r\n }, 7000);\r\n }\r\n}", "title": "" }, { "docid": "bcfe7630000227e96e050a9927a991a5", "score": "0.64719015", "text": "function showNotify() {\n var notify;\n\n if (window.webkitNotifications.checkPermission() == 0) {\n notify = window.webkitNotifications.createNotification(\n \"\",\n 'Notification Test',\n 'This is a test of the Chrome Notification System. This is only a test.'\n );\n notify.show();\n } else {\n window.webkitNotifications.requestPermission();\n }\n}", "title": "" }, { "docid": "3b3e6a77dbab15df0fa09660ce939c47", "score": "0.6461867", "text": "function defaultNotifiDisplay(){\n $.notify({\n // options\n title: 'Default notify',\n message: 'Turn ing st and ard Bo ots trap al erts in to \"no tif y\" li ke not i i ca ti o ns',\n url: 'https://github.com/',\n target: '_blank'\n },\n {\n // settings\n element: 'body',\n position: null,\n type: \"normal\",\n allow_dismiss: true,\n newest_on_top: false,\n showProgressbar: false,\n placement: {\n from: \"bottom\",\n align: \"left\"\n },\n offset: 20,\n spacing: 10,\n z_index: 1031,\n delay: 4000,\n timer: 1000,\n url_target: '_blank',\n mouse_over: null,\n animate: {\n enter: 'animated fadeInDown',\n exit: 'animated fadeOutUp'\n },\n onShow: null,\n onShown: null,\n onClose: null,\n onClosed: null,\n icon_type: 'class',\n template: \n '<div data-notify=\"container\" class=\"qh-alert qh-alert-{0}\" role=\"alert\">' +\n '<button type=\"button\" aria-hidden=\"true\" class=\"close\" data-notify=\"dismiss\">×</button>' +\n '<div data-notify=\"title\" class=\"alert-title\">{1}</div> ' +\n '<div data-notify=\"message\" class=\"alert-content\">{2}</div>' +\n '<a href=\"{3}\" target=\"{4}\" data-notify=\"url\"></a>' +\n '</div>' \n });\n }", "title": "" }, { "docid": "28fdf695758780e794bbb74bfbe2f25a", "score": "0.6453666", "text": "function notify(message) {\n $(\".notification\").removeClass(\"d-none\")\n $(\".notification\").html(message);\n}", "title": "" }, { "docid": "31f5dda87e8356c3ea5a1d70e2fedda8", "score": "0.644338", "text": "function notify(msg) {\n const $err = document.getElementById('err');\n $err.innerHTML = msg;\n $err.style.display = 'block'\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.6435293", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.6435293", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "72db12ce529574154adb65ce15689731", "score": "0.6428397", "text": "function showNotification(message, isSuccess) {\n\tvar css = isSuccess ? \"alert-success\" : 'alert alert-danger';\n\t// var html = '<h3 id= \"error\" class=\"alert '+ css +'\"> '+ message +' <a href=\"javascript: closeNotification()\" class=\"close\">&times;</a></h3>';\n\tvar html = '<h3 id= \"error\" class=\"alert '+ css +'\"> '+ message;\n\t$(\"#state\").html(html).show().delay(5000).fadeOut();\n}", "title": "" }, { "docid": "dc5cf185020f5fa19c4ab166dabb7f2b", "score": "0.64271474", "text": "function showNotification() {\n const notification = new Notification(\"New message incoming\", {\n body: \"Hi there. Vaccine is Available!\"\n })\n}", "title": "" }, { "docid": "7087e66ff45d47458507855b06240ba1", "score": "0.64140415", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "ec7fcb84ebf0cc9324beae8fd87dc8ae", "score": "0.64082295", "text": "function notify(notification) {\n const elem = document.querySelector('.article > h2');\n const notif = document.createElement('div');\n notif.innerText = notification;\n notif.className = 'notification';\n elem.appendChild(notif);\n setTimeout(function() {\n notif.remove();\n }, 1200);\n }", "title": "" }, { "docid": "2a02d4bebecaeead70596dc970ae2c20", "score": "0.6403379", "text": "function show() {\n\tvar time = /(..)(:..)/.exec(new Date()); // The prettyprinted time.\n\tvar hour = time[1] % 12 || 12; // The prettyprinted hour.\n\tvar period = time[1] < 12 ? 'a.m.' : 'p.m.'; // The period of the day.\n\t\n\t\n\tNotification.requestPermission( function(status) {\n console.log(status); // notifications will only be displayed if \"granted\"\n var n = new Notification(\"title\", {body: \"notification body\"}); // this also shows the notification\n });\n\t\n}", "title": "" }, { "docid": "de184d69a32073922e0740747720beb8", "score": "0.6400536", "text": "function display_adblock_notification() {\n if ( ( ! ad_block_notification_cookie_is_set() ) && ( com_ad_config.ad_blocker_message != \"\" ) ) {\n $( \"body\" ).append( '<div class=\"adblock-notification-wrapper\"><div class=\"adblock-notification\"><div class=\"text\">' + com_ad_config.ad_blocker_message + '</div><div class=\"js-dismiss\">x</div></div></div>' );\n }\n }", "title": "" }, { "docid": "f16bafb53a9f1aa3676f15d81758b5d8", "score": "0.6362949", "text": "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "title": "" }, { "docid": "f16bafb53a9f1aa3676f15d81758b5d8", "score": "0.6362949", "text": "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "title": "" }, { "docid": "f16bafb53a9f1aa3676f15d81758b5d8", "score": "0.6362949", "text": "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.63468015", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.63468015", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.63468015", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.63468015", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.63468015", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "734292aef13030bb19a763b1a85a7bdf", "score": "0.6340325", "text": "notice(message, type) {\n return $.notify({\n message: message\n }, {\n type: type,\n z_index: 1060\n });\n }", "title": "" }, { "docid": "2fffedcb6751be2fb79c2f450db33975", "score": "0.6333072", "text": "function show() {\n var time = /(..)(:..)/.exec(new Date()); // The prettyprinted time.\n var hour = time[1] % 12 || 12; // The prettyprinted hour.\n var period = time[1] < 12 ? 'a.m.' : 'p.m.'; // The period of the day.\n new Notification(hour + time[2] + ' ' + period, {\n icon: '128.png',\n body: getInsult()\n });\n}", "title": "" }, { "docid": "87a8e46c00003b8003bc1748c71e78ac", "score": "0.6311208", "text": "function notifyMe() {\n if (!window.Notification) {\n console.log('Browser does not support notifications.');\n } else {\n\n if (Notification.permission === 'granted') {\n //it shows the notification \n var notify = new Notification('Hi there!', {\n body: 'How are you doing?',\n icon: 'https://bit.ly/2DYqRrh',\n });\n } else {\n // the formula which requests the user for permission\n Notification.requestPermission().then(function (p) {\n if (p === 'granted') {\n // show notification here\n var notify = new Notification('Hi there!', {\n body: 'How are you doing?',\n icon: 'https://bit.ly/2DYqRrh',\n });\n } else {\n console.log('User blocked notifications.');\n }\n }).catch(function (err) {\n console.error(err);\n });\n }\n }\n}", "title": "" }, { "docid": "2aeeda81535bee3b45ca38e4f8a500f8", "score": "0.6305115", "text": "_initHtml() {\n jQuery('#notifyButtonHtml').on('click', (event) => {\n event.preventDefault();\n jQuery.notify(\n {\n title: '<strong>Bold Title</strong> ',\n message: 'Acorn is created by <a href=\"https://themeforest.net/user/coloredstrategies\" target=\"_blank\">ColoredStrategies</a>',\n },\n {type: 'primary', icon_type: 'image'},\n );\n });\n }", "title": "" }, { "docid": "68c3133d6ae88b88bfddd8099435e501", "score": "0.63000816", "text": "static notify(message) {\n\t\tM.toast({\n\t\t\thtml: message,\n\t\t});\n\t}", "title": "" }, { "docid": "23fbd8b831a0438dcb0ade8495b460db", "score": "0.6297383", "text": "function showError(error) {\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "title": "" }, { "docid": "2530611cbf2a0c35eff107b1dfefdfde", "score": "0.6283922", "text": "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "67f35f841f4243ea75d2503b85904784", "score": "0.6282071", "text": "function browserNotification(theBody, theIcon, theTitle) {\n\tvar options = {\nbody: theBody,\nicon: theIcon\n\t}\n\tvar n = new Notification(theTitle, options);\n\t//how long the notification appears\n\tsetTimeout(n.close.bind(n), 4000);\n}", "title": "" }, { "docid": "aa07cad3294dc49c75bbd1740a7aa5d5", "score": "0.6276173", "text": "function displayNotification() {\n if(Notification.permission === 'granted') {\n navigator.serviceWorker.getRegistration().then((reg) => {\n let options = {\n body: \"Notification from web page\",\n icon: \"seaweed.png\",\n vibrate: [100,50,100],\n data: {\n dateOfArrival: Date.now(),\n primaryKey: 1\n },\n actions: [\n {action:'explore',title:\"Explore\"},\n {action:'close', title:\"Close\"}\n ]\n\n };\n reg.showNotification(\"Hello! This is your first notification!\", options)\n })\n } else if(Notification.permission === 'denied') {\n console.log(\"No permission to show notifications\")\n } else {\n requestNotification();\n }\n}", "title": "" }, { "docid": "d63135fd473e0755b9dfbe438a33135f", "score": "0.62694824", "text": "function error(err) {\n notificationElement.style.display = 'block';\n notificationElement.innerHTML = `<p>${err.message}</p>`;\n}", "title": "" }, { "docid": "4d4298897360c6697e9708d5e9543423", "score": "0.6251516", "text": "function notifications(t, e, n) {\n $.notify({\n icon: n,\n message: t\n }, {\n offset: {\n y: 40\n },\n type: e,\n newest_on_top: !0,\n placement: {\n from: \"top\",\n align: \"center\"\n },\n template: '<div data-notify=\"container\" class=\"col-xs-11 col-sm-3 alert alert-{0}\" role=\"alert\"><button type=\"button\" aria-hidden=\"true\" class=\"close\" data-notify=\"dismiss\">×</button><span data-notify=\"icon\"></span> <span data-notify=\"title\">{1}</span> <span data-notify=\"message\">{2}</span><div class=\"progress\" data-notify=\"progressbar\"><div class=\"progress-bar progress-bar-{0}\" role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 0%;\"></div></div><a href=\"{3}\" target=\"{4}\" data-notify=\"url\"></a></div>'\n })\n}", "title": "" }, { "docid": "6c5aa233fe9c31b080a7fc444f128a80", "score": "0.6230975", "text": "function browserNotify(msg) {\n console.log(\"Notification called\");\n // Let's check if the browser supports notifications\n if (!(\"Notification\" in window)) {\n console.log(\"Notifications not working\");\n alert(msg.toString());\n }\n\n // Let's check whether notification permissions have already been granted\n else if (Notification.permission === \"granted\") {\n // If it's okay let's create a notification\n var notification = new Notification(msg.toString());\n }\n\n // Otherwise, we need to ask the user for permission\n else if (Notification.permission !== \"denied\") {\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === \"granted\") {\n var notification = new Notification(msg.toString());\n }\n else {\n alert(msg.toString());\n }\n });\n }\n}", "title": "" }, { "docid": "d92198e6f02bff75fa88df803b5e497b", "score": "0.62283003", "text": "function outputNotification(text) {\n const div = document.createElement('div');\n div.classList.add('date');\n div.innerHTML = `<span>${text.text}</span>`;\n document.getElementById(\"chatContainer\").appendChild(div);\n}", "title": "" }, { "docid": "12eac63fceb63cd9592851c39e545b47", "score": "0.6210688", "text": "function notifyMe() {\n if (!Notification) {\n alert('Desktop notifications not available in your browser. Try Chromium.'); \n return;\n }\n\n if (Notification.permission !== \"granted\")\n Notification.requestPermission();\n else {\n var notification = new Notification('Countdown\\'s Done!', {\n icon: 'assets/checkmark.svg',\n body: \"Click here to stop alarm.\",\n });\n\n notification.onclick = function () {\n $('#reset').click(); \n };\n\n }\n\n}", "title": "" }, { "docid": "7ecf9ef1cdf6906c9e1d02e91be80125", "score": "0.6206137", "text": "function showError(error) {\n notificationElement.getElementsByClassName.display = \"block\";\n notificationElement.innerHTML = `<h3 class=\"your-location\"> ${error.message} </h3>`;\n}", "title": "" }, { "docid": "2c8178cc1af307c6111989e6ad3e2278", "score": "0.62051964", "text": "function showNotification () {\n const notification = {\n title: 'Miqui says',\n body: 'Hi! This is a notification from the Main process'\n }\n new Notification(notification).show()\n}", "title": "" }, { "docid": "54822f5d369a510e93c060f3b5ea96e7", "score": "0.61969537", "text": "function toast(theTitle, theContent) {\n\t$(\"#notifications\").notify(\"create\", {\n\t\ttitle: theTitle,\n\t\ttext: theContent\n\t});\n}", "title": "" }, { "docid": "49e649d1176b8833824c032c2e4e1872", "score": "0.61674803", "text": "function Notification(){\n\tthis.notification, this.timer;\n\t\n\tthis.init = function(){\n\t\tthis.notification = document.createElement(\"div\");\n\t\tthis.notification.className = 'imcm_notification';\n\t\tthis.notification.addEventListener('click', this.clicked.bind(this), false);\n\t\tdocument.body.appendChild(this.notification);\n\t}\n\t\n\tthis.write = function(text, maxtime, append){\n\t\tif(this.timer)clearTimeout(this.timer);\n\t\tthis.notification.innerHTML = (append)?this.notification.innerHTML+'<br/>'+text : text;\n\t\tthis.show();\n\t\tif(maxtime>0){\n\t\t\tthis.timer=setTimeout(this.hide.bind(this),maxtime);\n\t\t}\n\t}\n\t\n\tthis.debug = function(text, maxtime){\n\t\tif(CONFIG.debug.popup)this.write(text, maxtime);\n\t}\n\tthis.error = function(text){\n\t\tthis.write('<h3>ERROR:</h3><p>'+text+'</p>');\n\t}\n\tthis.show = function(){\n\t\tthis.notification.style.visibility = 'visible';\n\t}\n\t\n\tthis.hide = function(){\n\t\tthis.notification.style.visibility = 'hidden';\n\t}\n\t\n\tthis.clicked = function(ev){\n\t\tthis.hide();\n\t}\n\tthis.init();\n}", "title": "" }, { "docid": "11f631fa9dfd257f5cf3ab7b8eda31cb", "score": "0.6162853", "text": "function warningMessage(message) {\n var notification = message;\n $.notify({\n message: notification,\n icon: 'glyphicon glyphicon-info-sign'\n },{\n icon_type: 'class',\n placement: {\n from: \"bottom\",\n align: \"right\"\n },\n type: \"warning\",\n animate: {\n enter: 'animated fadeInUp',\n exit: 'animated fadeOutDown'\n },\n template: template\n });\n}", "title": "" }, { "docid": "6bab53e5447a0e2e02106a65171cc09c", "score": "0.61605847", "text": "function showNotificationBoxMsg(msgStr){\n if(msgStr!=='' && msgStr!==undefined && msgStr!==false){\n Lobibox.notify('info',{\n icon:false,\n title:false,\n sound:false, \n size:'normal', \n msg:msgStr,\n delay:2000,\n width:deviceWidth,\n position:\"bottom right\" \n });\n }\n}", "title": "" }, { "docid": "c81c81cfe68517e90fe9037b266e2004", "score": "0.61442316", "text": "function notifyUser(userNote)\n{\n\t$(\"#notification p\").text(userNote);\n\t$(\"#notification\").slideDown(250, function()\n\t\t{\n\t\t\tnotifyTimer = setTimeout(hideNotification, 2000);\n\t\t});\n}", "title": "" }, { "docid": "da1a48bef7177447abf52b7b9d84c4a9", "score": "0.61297566", "text": "function notify(type, text) {\n $(\"#notification\").removeClass();\n $(\"#notification\").addClass(\"alert alert-\"+ type +\" animated fadeInUp\").html(text);\n}", "title": "" }, { "docid": "404fe5f90e187a11b03096fe5cad33a5", "score": "0.61283034", "text": "function showWarningMessage(msg) {\r\n\t var itemList = document.querySelector('#item-list');\r\n\t itemList.innerHTML = '<p class=\"notice\"><i class=\"fa fa-exclamation-triangle\"></i> ' +\r\n\t msg + '</p>'; //print the message\r\n\t }", "title": "" }, { "docid": "34e57b9ca0b0297cf9782335fb8a2520", "score": "0.61278534", "text": "function showNotification (event) {\n if (!(self.Notification && self.Notification.permission === 'granted')) {\n return;\n }\n\n console.log('\\n\\nevent.data', event.data);\n var data = event && event.data && event.data.json() || null;\n\n var title = data && data.title || 'Push notification demo';\n var options = {\n body: data && data.body || 'Push message no payload',\n icon: data && data.icon || null,\n // tag: 'demo',\n // icon: '/img/apple-touch-icon.png',\n // badge: '/img/apple-touch-icon.png',\n // Custom actions buttons\n /* actions: [\n { action: 'yes', title: 'I ♥ this app!' },\n { action: 'no', title: 'I don\\'t like this app' },\n ], */\n };\n\n event.waitUntil(\n self.registration.showNotification(title, options),\n );\n}", "title": "" }, { "docid": "b59a2e1b43144b14f1c6ea6892954d96", "score": "0.6121489", "text": "function showNotification(title, body) {\n if(hideAlert == 0) {\n new Notification({ title: title, body: body }).show();\n hideAlert = 1;\n }\n}", "title": "" }, { "docid": "7489c0178beff2a966996b51f96c9d38", "score": "0.61082804", "text": "function ajaxSuccessMsg(msg) {\n jQuery(\"div#notification\").html(\"<span class='info'>\" + msg + \"</span>\");\n}", "title": "" }, { "docid": "6247dae33d6534ba3c3e04a43161b50b", "score": "0.6102598", "text": "function showNotification(title, message) {\n title = title || \"Notification\";\n _toastView.add(title, message);\n }", "title": "" }, { "docid": "c0a01bbf6d51b8c5f0577bf8a7b95c52", "score": "0.61012816", "text": "function push_notification(alert) {\n\t\tvar n = $('<div class=\"notification-alert\"></div>');\n\t\tif (alert.new) n.addClass('new');\n\t\tn.append($(\"<div>\" + alert.body_html + \"</div>\"));\n\t\tvar d = $(\"<div class='date'/>\")\n\t\tn.append(d);\n\t\tif (alert.date) d.text(moment(alert.date).calendar());\n\n\t\tnode.append(n)\n\t}", "title": "" }, { "docid": "816755f976885ce0fa7da54cc5055167", "score": "0.6089087", "text": "function notify(message) {\n\n const notification = new Notification('Markup', {\n\n body: message\n })\n\n notification.onclick = () => {\n\n alert(`Clicked on ${message}!`)\n }\n\n}", "title": "" }, { "docid": "d95469d37f89f6199f32aff8f51eb89a", "score": "0.6087155", "text": "function makeNotification(notification) {\n var to = routeNotification(notification);\n var notificationText = makeNotificationText(notification);\n alertify.success(notificationText);\n return '<li><a href=\"' + to + '\">' + notificationText + '</a></li>';\n}", "title": "" }, { "docid": "ba4684921cfb6f078cc6a0f26ed750e9", "score": "0.60867614", "text": "function displayMessage(msg) {\n\tlet messageArea = document.getElementById(\"messageArea\");\n\tmessageArea.innerHTML = msg;\n}", "title": "" }, { "docid": "a19ed38aba8849d2ea22f327bf0b66e6", "score": "0.60801816", "text": "function showError(error) {\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "a19ed38aba8849d2ea22f327bf0b66e6", "score": "0.60801816", "text": "function showError(error) {\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "f4a3944eeeb883a93d006661a3c02ec1", "score": "0.60792834", "text": "function notify_me(){\n\t\n\t // Let's check if the browser supports notifications\n\t if (!(\"Notification\" in window)) {\n\t\talert(\"This browser does not support desktop notification. But Data Loaded Successfully.\");\n\t }\n\n\t // Let's check whether notification permissions have already been granted\n\t else if (Notification.permission === \"granted\") {\n\t\t// If it's okay let's create a notification\n\t\tvar notification = new Notification(\"Data Loaded Successfully!\");\n\t }\n\n\t // Otherwise, we need to ask the user for permission\n\t else if (Notification.permission !== \"denied\") {\n\t\tNotification.requestPermission(function (permission) {\n\t\t // If the user accepts, let's create a notification\n\t\t if (permission === \"granted\") {\n\t\t\tvar notification = new Notification(\"Data Loaded Successfully!\");\n\t\t }\n\t\t});\n\t }\n\n}", "title": "" }, { "docid": "0248ddcc94f2ac9def67ad2febe7d10e", "score": "0.60671747", "text": "function notify(count) {\n var supportsWebkitNotifications = ('webkitNotifications' in window);\n\n if(count > 0 && supportsWebkitNotifications) {\n if(webkitNotifications.checkPermission() == 0) {\n body = (count == 1) ? '1 new message' : count + ' new messages';\n\n webkitNotifications.createNotification(\n null,\n 'You got mail',\n body\n ).show();\n }\n }\n }", "title": "" }, { "docid": "aeeb2c5fdcab2fc1bfa8b4480c4094ac", "score": "0.60570055", "text": "function msg(body) {\n $('#email-feedback').text(body).show();\n }", "title": "" }, { "docid": "7849a0e952a41baaa8d6e9c58ca282a0", "score": "0.6054852", "text": "function showNotification(message, Class){\n const notification = document.createElement('div');\n notification.classList.add(Class, 'notification', 'shadow');\n // Text to show:\n notification.textContent = message;\n\n // formulario:\n // form:\n formContacts.insertBefore(notification, document.querySelector('form legend'));\n\n // Ocultar y mostrar notificación\n // Hide and show notification\n setTimeout(() => {\n notification.classList.add('visible');\n setTimeout(() => {\n notification.classList.remove('visible');\n setTimeout(() => {\n notification.remove();\n }, 500);\n }, 3000);\n }, 100);\n}", "title": "" }, { "docid": "543ee5bd35ba8595d482982733efea83", "score": "0.6039562", "text": "function msg(body) {\n $('#email-feedback').text(body).show();\n }", "title": "" }, { "docid": "543ee5bd35ba8595d482982733efea83", "score": "0.6039562", "text": "function msg(body) {\n $('#email-feedback').text(body).show();\n }", "title": "" }, { "docid": "83793d2961e8b615f41c308577ab328d", "score": "0.60373694", "text": "function notif_button() {\n alert(\"TO DO: Notifications\")\n}", "title": "" }, { "docid": "123b219be3dac39868c35ff23ee5c7d9", "score": "0.6036371", "text": "function notify_me(message_string){\n\t // Let's check if the browser supports notifications\n\t if (!(\"Notification\" in window)) {alert(message_string);}\n\t // Let's check whether notification permissions have already been granted\n\t else if (Notification.permission === \"granted\") {\n\t\t // If it's okay let's create a notification\n\t\t var notification = new Notification(message_string);\n\t }\n\t // Otherwise, we need to ask the user for permission\n\t else if (Notification.permission !== \"denied\") {\n\t\t Notification.requestPermission(function (permission) {\n\t if (permission === \"granted\") { // If the user accepts, let's create a notification\n\t\t\t var notification = new Notification(message_string);\n\t }\n else{\n console.log(message_string);\n }\n\t });\n\t }\n}", "title": "" }, { "docid": "42948fcf3aed3cf43ea913bbc819c927", "score": "0.6021013", "text": "function displayMessage(msg) {\n $('#msg').html('<div class=\"alert alert-warning\">' + msg + '</div>');\n}", "title": "" }, { "docid": "42948fcf3aed3cf43ea913bbc819c927", "score": "0.6021013", "text": "function displayMessage(msg) {\n $('#msg').html('<div class=\"alert alert-warning\">' + msg + '</div>');\n}", "title": "" }, { "docid": "2d0b39d2a39513a02551f9f6cefca11f", "score": "0.601957", "text": "function showUserResignedNotification() {\n $(\"#notification-screenLock\").css(\"display\", \"block\");\n\n var title = \"Your Opponent Has Resigned\";\n\n var msg = \"You win\";\n\n function onClose() {\n window.location.href = \"/gameSelect.html\";\n }\n\n function onReplay() {\n // Removing the gray screen lock\n $(\"#notification-screenLock\").css(\"display\", \"none\");\n \n // todo Travis \n }\n\n var buttons = [\n nfBuilder.makeNotificationButton(\"Return\", onClose).attr(\"class\", \"leftGameInProgressNotification-button\")\n// ,\n// nfBuilder.makeNotificationButton(\"Replay\", onReplay).attr(\"class\", \"leftGameInProgressNotification-button\")\n ];\n\n nf = nfBuilder.makeNotification(title, msg, buttons).attr(\"class\", \"leftGameInProgressNotification\");\n\n $(\"#notificationCenter\").append(nf);\n}", "title": "" }, { "docid": "f37cb4534413c96856776e841dc8c042", "score": "0.6017843", "text": "function makeNotification(notification) {\n var to = routeNotification(notification);\n var notificationText = makeNotificationText(notification);\n var notificationDesc = makeNotificationDesc(notification);\n return '<a href=\"' + to + '\"><div class=\"notifcation\"><img src=\"/storage/public/images/' + notification.data.profile_picture + '\"><div class=\"notifcation-content\"><p class=\"head\">' + notificationText + '</p><p class=\"center\">' + notificationDesc + '</p><p class=\"date\">' + notification.created_at + '</p><section class=\"fix\"></section></div></div></a>';\n}", "title": "" }, { "docid": "03142b97615f19d80de7f5c77865ec97", "score": "0.6007867", "text": "function notifyUser(event) {\n var parameters = event.parameters;\n var notificationText = parameters['notifyText'];\n return CardService.newActionResponseBuilder()\n .setNotification(CardService.newNotification()\n .setText(notificationText)\n .setType(CardService.NotificationType.INFO))\n .build();\n}", "title": "" }, { "docid": "ce131e9b8fca20a27f5532379736f2f6", "score": "0.6003263", "text": "function notifyUpdate(){\n\t\t$(\"updatenotify\").innerHTML = UPDATE_MESSAGE.replace(/%s/, GM_getValue('latestversionurl'));;\n\t}", "title": "" }, { "docid": "2078fdf112a4fdecebd83981d7d37c77", "score": "0.59997046", "text": "function displayMessage(message) {\n\tdocument.getElementById('greeting').innerText = message;\n}", "title": "" }, { "docid": "17f46f68282f746c64297fb490b42432", "score": "0.5990073", "text": "showNotification(type, message){\n n = new notification(type, message, {dismissable: true});\n n.onDidDisplay;\n atom.notifications.addNotification(n);\n }", "title": "" }, { "docid": "77713ecd060a902bfc1a7d98764a1d53", "score": "0.59855", "text": "function errorHtml(text, heading) {\n\t\t\t\t\tNotification.error({message: text, title: heading});\n\t\t\t\t}", "title": "" }, { "docid": "77713ecd060a902bfc1a7d98764a1d53", "score": "0.59855", "text": "function errorHtml(text, heading) {\n\t\t\t\t\tNotification.error({message: text, title: heading});\n\t\t\t\t}", "title": "" }, { "docid": "774106241c9c5449d731aa2e5f4cf1bc", "score": "0.59669954", "text": "function notifyMe(data) {\n const textsPerType = {\n idle: {\n title: \"Don't stay idle!!!\",\n body: data => {\n return \"Hey there! You've been idle for \" + data.idleTime + ' minute(s)';\n }\n },\n done: {\n title: 'Timer complete',\n body: data => {\n return \"Feel free to take a break! Do it!\";\n }\n }\n };\n const texts = textsPerType[data.type];\n // Request permission if not yet granted\n if (Notification.permission !== \"granted\") {\n Notification.requestPermission();\n }\n else {\n var notification = new Notification(texts.title, {\n icon: 'https://ares.gods.ovh/img/Tomato_icon-icons.com_68675.png',\n body: texts.body(data),\n });\n\n notification.onclick = function () {\n window.open(\"http://stackoverflow.com/a/13328397/1269037\"); \n };\n }\n }", "title": "" }, { "docid": "89799fa0c33ba8a6d488f371ffb69f3c", "score": "0.59549904", "text": "function _notify(request) {\n log.debug(\"Notification Received: \" + request.responseText);\n }", "title": "" }, { "docid": "d6515c46000178a387bd6f6b458aa557", "score": "0.59489393", "text": "function showMessageReceiver(message) {\n //display user message in given html format\n messages.innerHTML +=\n \"<div class='space'>\" +\n \"<div class='message-container receiver notranslate'>\" +\n `<p>${message}</p>` +\n \"</div>\" +\n \"</div>\"\n}", "title": "" }, { "docid": "73c9fdc4a703d3e76ae30a3ec04696c0", "score": "0.59382766", "text": "function showNotification(message, type, clickAction) {\n\t\ttype = type || 'alert';\n\n\t\tvar element = $('.notification.blueprint').clone().removeClass('blueprint');\n\t\telement.find('.icon i').addClass('fa-' + notificationIcons[type]);\n\t\telement.addClass('type-' + type);\n\t\telement.find('.content').text(message);\n\t\telement.css({'opacity':0});\n\t\t$('.notification-container').prepend(element);\n\t\tif (clickAction) {\n\t\t\telement.addClass('hoverable');\n\t\t\telement.click(clickAction);\n\t\t}\n\n\t\t// Control the disappearance of notifications\n\t\telement.mouseover(function() {\n\t\t\t// don't let the notification disappear if the user is debating\n\t\t\t// clicking\n\t\t\tclearTimeout(notificationTimeout);\n\t\t});\n\t\telement.mouseout(function() {\n\t\t\t// the user isn't interested, restart deletion timer\n\t\t\tnotificationTimeout = setTimeout(function() {\n\t\t\t\tremoveNotification(element);\n\t\t\t}, 2500);\n\t\t});\n\t\telement.animate({\n\t\t\t'opacity':1,\n\t\t});\n\t\tnotificationTimeout = setTimeout(function() {\n\t\t\tremoveNotification(element);\n\t\t}, 4000);\n\t}", "title": "" }, { "docid": "9e87e68622eebc177dd867b516d44212", "score": "0.59348655", "text": "function showNotification(title, content, width, height) {\n var settings = {\n className: 'magento',\n title: title,\n width: width,\n height: height,\n minimizable: false,\n maximizable: false,\n draggable: false,\n showEffectOptions: {\n duration:0.4\n },\n hideEffectOptions: {\n duration:0.4\n }\n };\n\n notificationWindow = new Window(settings);\n notificationWindow.setHTMLContent(content);\n notificationWindow.setZIndex(100000000);\n notificationWindow.showCenter(true);\n}", "title": "" }, { "docid": "ea1912b980ea91a636f688cd75a62c28", "score": "0.5929873", "text": "function processNotification(endpoint) {\n\n var notification = window.navigator.mozNotification.createNotification(\"ChatFox\", \"You have new messages\");\n \n notification.show();\n }", "title": "" }, { "docid": "a72d8f86a4c8c55c82dacf77d913aa48", "score": "0.59235275", "text": "showMessage(statusCode, meaasge) {\n this.props.actions.addNotify(statusCode, meaasge);\n }", "title": "" }, { "docid": "3e4b9474b9f129f1183c3cfbcc481624", "score": "0.59140766", "text": "function pushSuccessNotification(timestamp) {\n // Remove existing timestamps first\n const successPopupHandle = document.getElementById(\"YT_Timestamps_success_popup\");\n if (successPopupHandle != null) {\n successPopupHandle.remove();\n }\n\n const div = document.createElement(\"div\");\n div.id = \"YT_Timestamps_success_popup\";\n\n div.style.position = \"fixed\";\n div.style.display = \"flex\";\n div.style.justifyContent = \"center\";\n div.style.alignItems = \"center\";\n\n div.style.top = \"75px\";\n div.style.left = \"15%\";\n div.style.width = \"33%\";\n div.style.height = \"25px\";\n\n div.style.background = \"#2171FF\";\n div.style.border = \"2px solid #FFAF21\"\n div.style.color = \"#FFAF21\";\n div.style.fontSize = \"15px\";\n div.style.borderRadius = \"5px\"\n\n div.innerHTML = \"Added new timestamp: \" + convertTimeFormat(timestamp);\n document.body.appendChild(div);\n const fadeHandle = setTimeout(() => {\n div.remove();\n clearTimeout(fadeHandle);\n }, 2000);\n}", "title": "" }, { "docid": "b5fa80577f5d43010396e075ff1e92ba", "score": "0.591172", "text": "function showNotificationPopup(caption, noTimeout) {\n\t\tvar timeout = 750;\n\t\tif (noTimeout) {\n\t\t\ttimeout = 0;\n\t\t}\n\t\tsetTimeout(function () {\n\t\t\ttoastr.info(caption)\n\t\t}, timeout);\n\t}", "title": "" }, { "docid": "81f115a351562fa173d27e06a804ff97", "score": "0.5911193", "text": "function showSuccessmessage(id) {\n $('#'+id).notify(\"Added Successfully\",{className:'success',position:\"right top\",autoHide:'false' ,autoHideDelay: 1500000});\n }", "title": "" }, { "docid": "a1dd2aaeced6051c23956cf3eb23ba5e", "score": "0.59010327", "text": "function showMessage( text ) {\n\n\tdomMessage.innerHTML = text;\n\tdomMessage.style.display = 'inherit';\n\n}", "title": "" }, { "docid": "3362a860f710b943dacb97f78f6ed000", "score": "0.59000885", "text": "function afficheUneNotification() {\n $('div.alert-contact').show(50).delay(2000).hide(800);\n }", "title": "" }, { "docid": "1b80a4c668cdbd0eea4a2744736515e0", "score": "0.58987087", "text": "showImportantNotification (message) {\n this.store.commit('ui/setNotification', { text: message, important: true })\n }", "title": "" }, { "docid": "19afa40de5b710644011a13aa63bb92b", "score": "0.58915854", "text": "displayMessage(message) {\n document.getElementById(\"info\").textContent = message\n }", "title": "" }, { "docid": "0d73702090af00fab2d3c7c9edff8f89", "score": "0.58911854", "text": "function displayMessage(msg) {\n document.getElementById(\"greeting\").innerText = msg;\n}", "title": "" }, { "docid": "01afbbacac199d62cb122b0fae649aaf", "score": "0.588357", "text": "function showNotification(notification) {\n const syncing = Session.set('syncing');\n if (!syncing) {\n if (typeof (notification) !== 'undefined' && notification !== null) {\n const message = notification.message;\n const type = notification.type ? notification.type : 'warning';\n if (lastMessages.indexOf(message) === -1) {\n switch (type) {\n case 'success':\n toastr.success(message);\n break;\n case 'info':\n toastr.info(message);\n break;\n case 'warning':\n toastr.warning(message);\n break;\n case 'danger':\n toastr.error(message);\n break;\n default:\n toastr.warning(message);\n break;\n }\n lastMessages.unshift(message);\n if (lastMessages.length > 3) {\n lastMessages = lastMessages.splice(0, 3);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "16fda1f84b864e50410150692fcdde6f", "score": "0.5880451", "text": "function newmail_notifier_desktop(body, disabled_callback)\n{\n var timeout = rcmail.env.newmail_notifier_timeout || 10,\n icon = rcmail.assets_path('plugins/newmail_notifier/mail.png'),\n success_callback = function() {\n var popup = new window.Notification(rcmail.get_label('title', 'newmail_notifier'), {\n dir: \"auto\",\n lang: \"\",\n body: body,\n tag: \"newmail_notifier\",\n icon: icon\n });\n popup.onclick = function() { this.close(); };\n setTimeout(function() { popup.close(); }, timeout * 1000);\n };\n\n try {\n window.Notification.requestPermission(function(perm) {\n if (perm == 'granted')\n success_callback();\n else if (perm == 'denied' && disabled_callback)\n disabled_callback();\n });\n\n return true;\n }\n catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "2045cfcbd8199f93b59c8f662b4f675a", "score": "0.5876597", "text": "function userNotificationUpdated() {}", "title": "" }, { "docid": "4231cdf73fdb746a56cb2efff61d29c1", "score": "0.5872447", "text": "function showNotification(type, title, message) {\n client.interface.trigger('showNotify', {\n type: `${type}`,\n title: `${title}`,\n message: `${message}`\n }).catch(function (error) {\n console.log('Notification Error : ', error);\n })\n}", "title": "" } ]
019a7c910022e044953c600ba676b18f
Removes all keyvalue entries from the hash.
[ { "docid": "42c2b12f48b3917b139a4c4adaf63715", "score": "0.0", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}", "title": "" } ]
[ { "docid": "85e47774260af2454ea9819ac7f8740f", "score": "0.6528272", "text": "clear() {\n this.hashMap.clear();\n }", "title": "" }, { "docid": "fbf52c87dedd403d11cd58b2eea2ed94", "score": "0.6432439", "text": "clearKeys(){\n this.keyList.clearKeys();\n }", "title": "" }, { "docid": "9886d34fa0cf1d5cf22ca824ed637a60", "score": "0.6291957", "text": "function clear()\n {\n var k = keys();\n _store.clear();\n for(var i = 0; i < k.length; ++i)\n {\n triggerEvent(\"remove_\" + k[i]);\n triggerEvent(\"remove\", k[i]);\n }\n triggerEvent(\"clear\");\n }", "title": "" }, { "docid": "45df8cc5edf704a8bf6d89db8b458d19", "score": "0.6208362", "text": "async clear() {\n this.keys = {};\n }", "title": "" }, { "docid": "e71b42c04935573c2b61630766d569e8", "score": "0.6202558", "text": "function _cleanupKeys()\n {\n if (this._count == this._keys.length) {\n return;\n }\n var srcIndex = 0;\n var destIndex = 0;\n var seen = {};\n while (srcIndex < this._keys.length) {\n var key = this._keys[srcIndex];\n if (_hasKey(this._map, key)\n && !_hasKey(seen, key)\n ) {\n this._keys[destIndex++] = key;\n seen[key] = true;\n }\n srcIndex++;\n }\n this._keys.length = destIndex;\n }", "title": "" }, { "docid": "03e54201d95e48cb68e4b1ebfa372dac", "score": "0.6166736", "text": "remove(key) {\n let index = Hash.hash(key, this.sizeLimit);\n\n if (\n this.hashTable[index].length === 1 &&\n this.hashTable[index][0][0] === key\n ) {\n delete this.hashTable[index];\n } else {\n for (let i = 0; i < this.hashTable[index].length; i++) {\n if (this.hashTable[index][i][0] === key) {\n delete this.hashTable[index][i];\n }\n }\n }\n }", "title": "" }, { "docid": "b617796ffe179cb3e51a2db5f4a12528", "score": "0.5922547", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.5907605", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.5907605", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.5907605", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "9805196a0a5f34b3bd69be9e9f5b95c1", "score": "0.5907122", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "05f8d4fb04792f38ca61d035bcb5e9bb", "score": "0.59013534", "text": "async function clear () {\n try {\n const keys = await getAllKeys()\n keys.length && await multiRemove(keys)\n } catch (e) {\n errorLogger('Storage:CLEAR', e)\n }\n}", "title": "" }, { "docid": "9559c290c0beebca2c7b4c786b676000", "score": "0.5896392", "text": "function hashClear() {\n\t this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};\n\t this.size = 0;\n\t}", "title": "" }, { "docid": "40430abd85993462fffd930206349266", "score": "0.5893213", "text": "clear() {\n this.logger.trace(\"Clearing cache entries created by MSAL\"); // read inMemoryCache\n\n const cacheKeys = this.getKeys(); // delete each element\n\n cacheKeys.forEach(key => {\n this.removeItem(key);\n });\n this.emitChange();\n }", "title": "" }, { "docid": "7b649a8a1f9f2d91cda9b2f5b37d256b", "score": "0.58907753", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.5865123", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "c47577886fe8e4225101c754574e3fe6", "score": "0.5859544", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {}\n this.size = 0\n }", "title": "" }, { "docid": "800ca9f73feb5df8b782dbe94140c6fe", "score": "0.5850008", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.5849991", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" } ]
97086f9038343a55bb80c47eb744b410
click right mouse in table tbody CreatedBy: KYLS(13/5/2019)
[ { "docid": "753f17a6bb7885041e010b429a7c21ea", "score": "0.0", "text": "clickMouseRight(e) {\n if (e.button === 2) {\n // debugger\n e.preventDefault();\n var wMonitor = $(document).width();\n var x = e.pageX - 107;\n if (x + 260 > wMonitor) {\n var du = x + 260 - wMonitor;\n x = x - du;//đo bằng cơm\n // alert(x);\n }\n $(\"#right-mouse\").css(\"top\", (e.pageY - 138));\n $(\"#right-mouse\").css(\"left\", x);\n $(\"#right-mouse\").show();\n\n }\n }", "title": "" } ]
[ { "docid": "00f89cb24c6e0f267f3e69bba57a9f7f", "score": "0.65389144", "text": "function mouseInteractEvent(e) {\n if (e.target.matches('td')) {\n var elid = e.target.getAttribute('id');\n var r = parseInt(elid.split('-')[1]);\n var c = parseInt(elid.split('-')[2]);\n var rightclick;\n if (!e) var e = window.event;\n if (e.which) rightclick = (e.which == 3);\n else if (e.button) rightclick = (e.button == 2);\n if (rightclick) {\n // Right click\n flag(r, c);\n }\n else {\n // Left click\n reveal(r, c);\n }\n }\n}", "title": "" }, { "docid": "d2fdc96f5c611a497f2cd4b80d152c57", "score": "0.6174647", "text": "function getColumnPopupMenu(e)\n{\n}", "title": "" }, { "docid": "b43705239792b31ee0d20fe597cd3be6", "score": "0.607707", "text": "function HandleTblRowClicked(tr_clicked) {\n //console.log(\"=== HandleTblRowClicked\");\n //console.log( \"tr_clicked: \", tr_clicked, typeof tr_clicked);\n\n// --- toggle select clicked row\n t_td_selected_toggle(tr_clicked, false); // select_single = false: multiple selected is possible\n\n// --- update setting_dict.sel_student_pk\n // only select employee from select table\n const row_id = tr_clicked.id\n if(row_id){\n const map_dict = get_mapdict_from_datamap_by_id(student_map, row_id)\n //setting_dict.sel_student_pk = map_dict.id;\n }\n } // HandleTblRowClicked", "title": "" }, { "docid": "8d0cd94081dbb872855d42d9302e9c12", "score": "0.6036067", "text": "function th_click(evt) {\n if ( !$(evt.target).is('th') ) {\n return;\n }\n var pass_event = jQuery.Event('click');\n pass_event.button = 0;\n evt.data.anchor.trigger(pass_event);\n evt.preventDefault();\n return false;\n }", "title": "" }, { "docid": "6b4d7d21798413bbeaddc858c29b1a09", "score": "0.5921209", "text": "onTableRowClick(event, row) {\n this.$emit('tr-click', event,\n this.tableRows[row.indexRef], row.indexRef);\n }", "title": "" }, { "docid": "2aaad033349020806e74db6893b7a8b7", "score": "0.5910859", "text": "onRowClick() {}", "title": "" }, { "docid": "680c585733abec42482e7138859729fe", "score": "0.5899912", "text": "function HandleTblRowClicked(tr_clicked) {\n console.log(\"=== HandleTblRowClicked\");\n //console.log( \"tr_clicked: \", tr_clicked, typeof tr_clicked);\n\n// --- deselect all highlighted rows, select clicked row\n t_td_selected_toggle(tr_clicked, true); // select_single = true\n\n// --- get selected.student_dict\n selected.student_pk = get_attr_from_el_int(tr_clicked, \"data-pk\");\n selected.student_dict = b_get_datadict_by_integer_from_datarows(student_rows, \"id\", selected.student_pk);\n console.log( \"selected.student_pk: \", selected.student_pk);\n console.log( \"selected.student_dict: \", selected.student_dict);\n\n// --- get existing data_dict from data_rows\n const pk_int = get_attr_from_el_int(tr_clicked, \"data-pk\");\n const [index, found_dict, compare] = b_recursive_integer_lookup(student_rows, \"id\", pk_int);\n const data_dict = (!isEmpty(found_dict)) ? found_dict : null;\n selected.student_pk = (data_dict) ? data_dict.id : null\n\n console.log( \"data_dict: \", data_dict);\n\n// --- change caption of submenubutton delete_candidate\n // PR2023-03-13 Sentry error: TypeError Cannot set properties of null (setting 'innerText')\n if (el_submenu_delete_candidate){\n const caption = (data_dict && (data_dict.tobedeleted || data_dict.deleted)) ? loc.Restore_candidate : loc.Delete_candidate;\n\n console.log( \"data_dict: \", data_dict);\n el_submenu_delete_candidate.innerText = caption;\n };\n } // HandleTblRowClicked", "title": "" }, { "docid": "312c63c353af48dd7c73dbe91b5c89ce", "score": "0.58813536", "text": "function RowDoubleClick(){\n\n$('tr.selec > td > input').live(\"dblclick\", function(event){\nSelectAllRow = true;\nCurrentRow.find('input').each(function(){MouseEnter($(this));})//END EACH\n});//END LIVE\n\n}//END ROW DOUBLECLICK", "title": "" }, { "docid": "4adb22bb6e3a5c54a183ab0913372d02", "score": "0.58704245", "text": "function createCollaboratorClick(row, jsonObj) {\n\trow.onclick = function () {\n\t\tcollaboratorLinkQuery(jsonObj);\n\t};\n}", "title": "" }, { "docid": "87bc2b4dd415accdc81cdb0245609bdd", "score": "0.58633494", "text": "function CreateTableOnClickFunctionality()\n{\n let table = document.getElementsByClassName(\"PicrossTable\")[0];\n\n if (table != null) \n {\n // start indices at 1 because we don't need the user clicking on the table headers\n for (let i = 1; i < table.rows.length; i++) \n {\n for (let j = 1; j < table.rows[i].cells.length; j++)\n {\n table.rows[i].cells[j].onclick = function() \n {\n UserClickedTile(i, j);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "d8eabd88f86dd0aefd656e8eafd6fe71", "score": "0.58431095", "text": "function ShowLinkOnColumnClick1(tableName, row, e) {\n try {\n\n $('#' + tableName + '_CCE_Dialog').dialog({\n title: 'Select',\n position: [e.clientX, e.clientY],\n width: '200px',\n height: 'auto',\n show: {\n effect: \"blind\",\n duration: 500\n },\n hide: {\n effect: \"explode\",\n duration: 500\n }\n });\n\n $('#' + tableName + '_CCE_Dialog').attr('cols', $(row).closest('tr').attr('actualrowid'));\n } catch (err) {\n\n alert('Error :: ' + err);\n }\n\n}", "title": "" }, { "docid": "edd072a86c9fdb733e69cb09072a284e", "score": "0.58421874", "text": "function mouse_onclick_table(d,i){\n\t\t$(\"#table-erd-current\").val(d.name);\n\t\t$(\".option-column-erd\").remove();\n\t\tfor(var i = 0 ; i < d.listColumn.length;i++){\n\t\t\t$(\"#column-erd-current\").append($(\"<option></option>\")\n\t .attr(\"value\",d.listColumn[i].name)\n\t .attr(\"class\",\"option-column-erd\")\n\t .text(d.listColumn[i].name));\n\t\t}\n\t\t$(\"#column-erd-current\").change(function(){\n\t\t\tvar value = $(this).val();\n\t\t\tif(value != null){\n\t\t\t\t$(\"#btn-delete-pro\").prop(\"disabled\",false);\n\t\t\t\t$('#form-new-property').hide();\n\t\t\t\t$('#form-btn-default').show();\n\t\t\t}\n\t\t}).change();\n\t\t$(\"#btn-add-pro\").prop(\"disabled\",false);\n\t\td3.event.stopPropagation();\n\t\n\t}", "title": "" }, { "docid": "d77cc11b702da0a0e650c275d3367c15", "score": "0.58035403", "text": "function tbodyClickEvent(event) {\n // Recursive function to find the tr that was clicked.\n function findRow(el) {\n if (el.nodeName === \"TR\") {\n return el;\n }\n return findRow(el.parentNode);\n }\n\n // If they click the link, don't bother highlighting the row, it just looks bad.\n if (typeof event.target.href === \"undefined\") {\n rowClickHandler.clickEvent(findRow(event.target), event.shiftKey);\n }\n }", "title": "" }, { "docid": "fed9cdf19da97a2d7e805848960a50fb", "score": "0.5802243", "text": "function rowClickHandler() {\n // Ask DataTables which data row this is\n var data = dt.row(this).data();\n\n alert('You clicked the row for MSISDN=' + data.msisdn);\n }", "title": "" }, { "docid": "313fc4fe8ec72f6b55d8eb99878559d8", "score": "0.5793475", "text": "function RowSelection() {\n }", "title": "" }, { "docid": "1f1a8d55229034a53499239f34c2a5ed", "score": "0.57863307", "text": "function browseAuditDetailsFunction(clickedIcon, rowActionIsOn) {\n\t\tvar dataTable = $(\"#auditDetailsTable\").dataTable();\n /* Open this row */\n lcCloseTableNodes(dataTable);\n // nTr points to row and has absPath in id\n var objId = $(rowActionIsOn).attr('id');\n //alert(\"absPath:\" + absPath);\n var detailsId = \"details_\" + objId;\n var detailsHtmlDiv = \"details_html_\" + objId;\n var buildDetailsLayoutVal = buildAuditDetailsLayout(detailsId);\n clickedIcon.setAttribute(\"class\", \"ui-icon ui-icon-circle-minus\");\n newRowNode = dataTable.fnOpen(rowActionIsOn,\n buildDetailsLayoutVal, 'details');\n newRowNode.setAttribute(\"id\", detailsId);\n var absPath = $(\"#auditDetailsAbsPath\").val();\n \n // get the audit action and timestamp from the hidden fields\n var auditActionSelector = '#audit_' + objId + '_code';\n var auditAction = $(auditActionSelector).val();\n \n var timestampSelector = '#audit_' + objId + '_timestamp';\n var timestamp = $(timestampSelector).val();\n \n askForAuditDetailsPulldown(absPath, auditAction, timestamp);\n\n}", "title": "" }, { "docid": "35cad66a746a5467a7b75a4205b12e42", "score": "0.5755161", "text": "onTableDataClick(event, column, row) {\n this.$emit('td-click', event,\n this.columns[column.indexRef] || column, column.indexRef,\n this.tableRows[row.indexRef], row.indexRef);\n }", "title": "" }, { "docid": "cbe897617425147fb9df7f686e7f9954", "score": "0.5748192", "text": "function clickOnRow(index, modifiers = {}) {\n if (modifiers.shiftKey) {\n info(`clicking on row ${index} with shift key`);\n } else if (modifiers.ctrlKey) {\n info(`clicking on row ${index} with ctrl key`);\n } else {\n info(`clicking on row ${index}`);\n }\n\n let x = list.clientWidth / 2;\n let y = index * 50 + 25;\n\n selectHandler.reset();\n list.addEventListener(\"select\", selectHandler);\n EventUtils.synthesizeMouse(list, x, y, modifiers, content);\n list.removeEventListener(\"select\", selectHandler);\n Assert.ok(selectHandler.seenEvent, \"'select' event fired as expected\");\n }", "title": "" }, { "docid": "d59956ed05e649772569955f45797f4d", "score": "0.5724958", "text": "function MouseRightClick() {\n}", "title": "" }, { "docid": "23db194a4f091621c7fd900f27e8dfae", "score": "0.5697201", "text": "function triggerRowClick(scope, row) {\n\t\t$(row).click();\n\t\tscope.$digest();\n\t}", "title": "" }, { "docid": "4396796e8759f94508d721c11ae65e36", "score": "0.56780183", "text": "function dyt_doMouseDown(current){\n\tif (this.Owner != null)\n\t{\n\t\tthis.Owner.doMouseDown();\n\t} else\n\t{\n\t\t//var rowIndex = event.srcElement.innerText*1;\n\t\tthis.moveto(current);\n\t}\n}", "title": "" }, { "docid": "8d4e303a78e4001edb30f06ef420b229", "score": "0.5655966", "text": "function mouseRightClickEvent(event) {\n hideMenus();\n let selected = event.srcElement;\n selectedId = selected.id;\n if ( selectedId.includes(\".selectedTable\") ) {\n Selected = selected;\n event.preventDefault();\n //We will now go and get the correct menu\n var menu = document.getElementById(\"contextMenuTable\") \n menu.style.display = \"block\";\n menu.style.left = MouseEvent.pageX + \"px\";\n menu.style.top = MouseEvent.pageY + \"px\";\n } else if ( selectedId.includes(\".server\") ) {\n Selected = selected;\n updateNicknameText(selected.innerText);\n event.preventDefault();\n //We will now go and get the correct menu\n var menu = document.getElementById(\"contextMenuServer\") \n menu.style.display = \"block\";\n menu.style.left = MouseEvent.pageX + \"px\";\n menu.style.top = MouseEvent.pageY + \"px\";\n }\n}", "title": "" }, { "docid": "4570878dab60e00c0171d460f021d2b5", "score": "0.5652597", "text": "function clicked(x,y, row) {\n\tconsole.log(\"X=\",x,\" Y=\",y);\n\tshowCell(x,y,row);\n\treturn;\n}", "title": "" }, { "docid": "afd1f02d12c59c0151bd55b81c5b5e11", "score": "0.5619892", "text": "cellSelectionByClick({ rowData, column }) {\n const { rowKeyFieldName } = this;\n\n const rowKey = getRowKey(rowData, rowKeyFieldName);\n\n // set cell selection and column to visible\n this[INSTANCE_METHODS.SET_CELL_SELECTION]({\n rowKey,\n colKey: column.key,\n isScrollToRow: false,\n });\n // row to visible\n this.rowToVisible(KEY_CODES.ARROW_UP, rowKey);\n this.rowToVisible(KEY_CODES.ARROW_DOWN, rowKey);\n }", "title": "" }, { "docid": "421391625888a4bfcc4f18d1706987e0", "score": "0.56194645", "text": "function dtable_row_clicked(aRow)\r\n{\r\n\t//-- user clicked preview row - so get prev row\r\n\tif(aRow.className == \"row-preview\")\r\n\t{\r\n\t\tif(aRow.previousSibling)\r\n\t\t{\r\n\t\t\taRow = aRow.previousSibling;\r\n\t\t}\r\n\t}\r\n\r\n\tvar strAction = aRow.getAttribute(\"action\");\r\n\tif(strAction!=\"\")process_action(strAction,aRow);\r\n}", "title": "" }, { "docid": "2c2d0a22c20f7a502114f5442ee2ddc8", "score": "0.56080496", "text": "function takeContexMenuOff() {\r\n var elCells = document.querySelectorAll('td');\r\n for (var i = 0; i < elCells.length; i++) {\r\n elCells[i].addEventListener('contextmenu', e => {\r\n e.preventDefault();\r\n });\r\n }\r\n}", "title": "" }, { "docid": "ab2072343e8aaef1f412980c7535e680", "score": "0.5603237", "text": "function tdClickHandler (evt) {\n ctrl._tdClickHandler(evt);\n }", "title": "" }, { "docid": "23e243a3cb0483fc8dc460a6b442f910", "score": "0.5600921", "text": "function eventTableWidgetRowContextMenu(moduleObject, element, event){\n\tif(typeof moduleObject == \"undefined\")\n\t\treturn false;\n\n\tif(element.getAttribute(\"rowID\")){\n\t\tvar rowID = element.getAttribute(\"rowID\");\n\t\tmoduleObject.callRowListener(\"contextmenu\", {rowID: rowID, event: event});\n\t}\n}", "title": "" }, { "docid": "13ce722291a76539c4044958dab2f079", "score": "0.5591527", "text": "function mouseClicked() {}", "title": "" }, { "docid": "9d424d3012310ca1d51ad1d513a42f2e", "score": "0.55896026", "text": "function createStudentClick(row, jsonObj) {\n\trow.onclick = function () {\n\t\tstudentLinkQuery(jsonObj);\n\t};\n}", "title": "" }, { "docid": "433bee4e1274338c463abe30175c06ce", "score": "0.55873024", "text": "handleRowAction(event){\n let rowIndex = event.detail.rowIndex;\n let actionName = event.detail.actionName;\n let obj ={row: this._records[rowIndex], action: {name: actionName}};\n this.dispatchEvent(new CustomEvent('rowaction', {detail: obj}));\n }", "title": "" }, { "docid": "7df7954f0fea19201a681fd92d76b327", "score": "0.5576142", "text": "function createRowClick(row, text) {\n\trow.onclick = function () {\n\t\tdetailedResult(text);\n\t};\n}", "title": "" }, { "docid": "8086853ae5124e8ed66af184f308addd", "score": "0.5575734", "text": "rowClicked(event) {\n console.log(\"rowClicked\",event);\n this.dispatchEvent(\n new CustomEvent('contactrowclicked',\n {detail : event.target.innerHTML,\n bubbles : true,\n composed : true}\n )\n );\n }", "title": "" }, { "docid": "1d6f23333456d11bc8e5bad2b72d5d0d", "score": "0.5566042", "text": "function toggleRow() {\n /* hovering for ipet tables */\n trIndex = $(this).index()+index;\n $(\"#\"+name+'_wrapper table.dataTable').each(function(index) {\n row = $(this).find(\"tr:eq(\"+trIndex+\")\")\n row.toggleClass(\"hover\");\n row.each(function(index) {\n $(this).find(\"td\").toggleClass(\"hover\");\n });\n });\n }", "title": "" }, { "docid": "47a677b083bed3cd89c51fb89f6f4963", "score": "0.5535481", "text": "function OnUserGridDoubleClick(row) {\r\n // Query the server for the \"EmployeeID\" and \"Notes\" fields from the focused row \r\n // The values will be returned to the OnGetRowValues() function \r\n GridViewUsers.GetRowValues(row, 'UserName', OnGetUserRowValues);\r\n }", "title": "" }, { "docid": "e56996ab5a9e7cc8134cc859e4eb81b0", "score": "0.5534424", "text": "function addRowHandlers(tableId) {\r\n\tvar rows = Array.prototype.slice.call(document.getElementById(''+tableId+'').getElementsByTagName('tr'));\r\n\tfor(var i in rows){\r\n\t\trows[i].onclick = function(){TrSec(this, 1);};\r\n\t\trows[i].oncontextmenu = function(){TrSec(this, 2);};\r\n\t}\r\n}", "title": "" }, { "docid": "30d5438016766e9361b895228a22448e", "score": "0.55202734", "text": "_onRowMouseOver(e) {\n\t\tvar rowModel = e.model;\n\t\tvar rowData = rowModel.item;\n\t\tthis.fire(\"row-mouse-over\", {\"item\": rowData, \"model\": rowModel});\n\t}", "title": "" }, { "docid": "7744b703aed5e362d9748d7ef368dec1", "score": "0.55149436", "text": "function handleTableClick ( clickEvent ) {\r\n var slice = $(this).data('slice');\r\n toggleSlice ( slice );\r\n }", "title": "" }, { "docid": "367ab3e9b25a94e92167f98f067c2ab5", "score": "0.55127573", "text": "function confirmUsulan() {\n\n var eventManager = Handsontable.eventManager(this);\n\n function bindMouseEvents() {\n var instance = this;\n\n /*\n eventManager.addEventListener(instance.rootElement, 'mouseover', function (e) {\n if(checkRowHeader(e.target)) {\n var element = getElementFromTargetElement(e.target);\n if (element) {\n var btn = getButton(element);\n if (btn) {\n btn.style.display = 'block';\n }\n }\n }\n });\n\n eventManager.addEventListener(instance.rootElement, 'mouseout', function (e) {\n if(checkRowHeader(e.target)) {\n var element = getElementFromTargetElement(e.target);\n if (element) {\n var btn = getButton(element);\n if (btn) {\n btn.style.display = 'none';\n }\n }\n }\n });\n \n */\n\n// instance.rootElement.on('mouseover.confirmUsulan', 'tbody th, tbody td', function () {\n// getButton(this).show();\n// });\n//\n// instance.rootElement.on('mouseout.confirmUsulan', 'tbody th, tbody td', function () {\n// getButton(this).hide();\n// });\n }\n\n var getElementFromTargetElement = function (element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH' || element.tagName == 'TD') {\n return element;\n } else {\n return getElementFromTargetElement(element.parentNode);\n }\n }\n return null;\n };\n\n var checkRowHeader = function (element) {\n if (element.tagName != 'BODY') {\n if (element.parentNode.tagName == 'TBODY') {\n return true;\n } else {\n element = element.parentNode;\n return checkRowHeader(element);\n }\n }\n return false;\n };\n\n function unbindMouseEvents() {\n eventManager.clear();\n }\n\n function getButton(td) {\n var btn = td.querySelector('.btn');\n\n if (!btn) {\n var parent = td.parentNode.querySelector('th.htconfirmUsulan');\n\n if (parent) {\n btn = parent.querySelector('.btn');\n }\n }\n\n return btn;\n }\n\n this.init = function () {\n var instance = this;\n var pluginEnabled = !!(instance.getSettings().confirmUsulanPlugin);\n\n if (pluginEnabled) {\n bindMouseEvents.call(this);\n Handsontable.Dom.addClass(instance.rootElement, 'htconfirmUsulan');\n } else {\n unbindMouseEvents.call(this);\n Handsontable.Dom.removeClass(instance.rootElement, 'htconfirmUsulan');\n }\n };\n\n this.beforeInitWalkontable = function (walkontableConfig) {\n var instance = this;\n \n /**\n * rowHeaders is a function, so to alter the actual value we need to alter the result returned by this function\n */\n var baseRowHeaders = walkontableConfig.rowHeaders;\n walkontableConfig.rowHeaders = function () {\n\n var pluginEnabled = !!(instance.getSettings().confirmUsulanPlugin);\n\n var newRowHeader = function (row, elem) {\n var child\n , div;\n var kd_item = instance.getData()[row][10];\n \n while (child = elem.lastChild) {\n elem.removeChild(child);\n }\n elem.className = 'htNoFrame htconfirmUsulan';\n if (row > 1) {\n if(kd_item != '' && kd_item != null){ \n div = document.createElement('div');\n div.className = 'btn btn-small btn-warning btn-icon icon-pencil';\n div.appendChild(document.createTextNode(' '));\n elem.appendChild(div);\n \n \n eventManager.addEventListener(div, 'mouseup', function () {\n //alert(\"cek masuk : \"+ instance.getData()[row][10]); \n \n $.ajax({\n url: 'http://localhost/SPPB/c_usulan/getRincianUsulanByKd',\n type: \"POST\",\n data: { \"kd_item\" : kd_item},\n success:function(res){\n //alert(res);\n var data = JSON.parse(res);\n //alert(data + \" tes : \" + data['NM_ITEM']);\n //instance.alter('remove_row', row);\n \n var user_group = $(\"#user_group\").val();\n \n //alert(\"group id : \" + user_group);\n if(user_group == 2){\n alert(\"masuk\");\n $(\"#form-comment\").html($(\"#form_add_comment_unit\").html());\n \n }\n else\n $(\"#form-comment\").html($(\"#form_add_comment\").html()); \n\n \n $(\"#KD_PAKET\").val(data[\"KD_PAKET\"]);\n $(\"#KD_ITEM\").val(data[\"KD_ITEM\"]);\n $(\"#NM_ITEM\").val(data[\"NM_ITEM\"]);\n $(\"#SPESIFIKASI\").val(data[\"SPESIFIKASI\"]);\n $(\"#SETARA\").val(data[\"SETARA\"]);\n $(\"#SATUAN\").val(data[\"SATUAN\"]);\n $(\"#QTY\").val(data[\"QTY\"]);\n $(\"#TOTAL\").val(data[\"TOTAL\"]);\n $(\"#HARGA_SATUAN\").val(data[\"HARGA_SATUAN\"]);\n $(\"#HARGA_HPS\").val(data[\"HARGA_HPS\"]);\n $(\"#PERTANYAAN\").val(data[\"PERTANYAAN\"]);\n $(\"#KONFIRMASI\").val(data[\"KONFIRMASI\"]);\n $(\"#text-pertanyaan\").html(data[\"PERTANYAAN\"]);\n $(\"#text-konfirmasi\").html(data[\"KONFIRMASI\"]);\n //$(\"#change_status\").attr(\"href\", this.id);\n $(\".modal\").attr(\"style\",\"width:950px; left:35%;z-index:1050\");\n jQuery(\"#add_comment\").modal('show', { backdrop: 'static' });\n //e.preventDefault(); \n \n },\n error:function(res){\n alert(res);\n //e.preventDefault();\n }\n })\n \n \n\n \n \n \n });\n }\n \n }\n };\n\n return pluginEnabled ? Array.prototype.concat.call([], newRowHeader, baseRowHeaders()) : baseRowHeaders();\n };\n }\n }", "title": "" }, { "docid": "b889d63dc04a05a6fdff9081848621d7", "score": "0.550777", "text": "function main(){\n \n var builToolTips = function(tableId){\n Event.observe(tableId, 'mouseover', function(event) { \n /**\n * This is a trick to make the cell as event catcher. The cell's mouseover event triggers the input's tooltip construction.\n * If you build the Tooltip when the mouse is over the table cell, then you have to reproduce a mouse over event to display it.\n */\n var cell = $(Event.element(event)).down('input').up('tr.permission-row td');\n \n //The username is stored in the parent row\n var username = cell.up('tr').readAttribute('name');\n //The tooltip will be built againt the checkbox input\n var input = cell.down('input')\n //The role is stored in the child checkbox input\n var role = input.readAttribute('name');\n //Compute an id for this input\n var inputId = username + \"-\" + role; \n \n if (!input.hasAttribute('id')) {\n input.setAttribute('id', inputId); \n \n /**\n * UI enhancement Bascially it take off the \"[ ]\" and split the pair on 2 lines. \n * From [username]-[rolename] or anonymous-[rolename] to\n * User: username\n * Role: rolename \n */ \n var tooltipText = inputId.sub(/(\\[)?(.*?)(\\])?-\\[(.*?)\\]/,\n 'User: #{2}<br />Role: #{4}');\n /*\n * Finally, create a tooltip for the input embeds in this table cell\n * We use the present YUI! libraries to build a YAHOO tooltip\n */ \n new YAHOO.widget.Tooltip(\"Tooltip \" + inputId, \n\t { context:inputId, \n\t text:tooltipText }); \n \n } \n });\n } \n \n builToolTips(globalRoles);\n builToolTips(projectRoles);\n}", "title": "" }, { "docid": "b2394acf2be0ef93af9ec127cc2d858c", "score": "0.5503689", "text": "onCellClick(data) {\n console.log(data);\n }", "title": "" }, { "docid": "90cf7313e6c4efaf1e959d7654fe352a", "score": "0.54840165", "text": "function cellClick(cellNumber) {\n ttt.cellClick(cellNumber);\n}", "title": "" }, { "docid": "b281daa48b32883f26dfbd2bac433641", "score": "0.54661024", "text": "function dblClickEvent() {\n\t\t\t//if enableDblClick is true\n\t\t\tif (settings.enableDblClick) {\n\t\t\t\tvar elementBt = $(this).parent().find(\".\" + settings.classBtEdit);\n\t\t\t\tchangeBt(elementBt);\n\t\t\t\teditTd($(this));\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0ed77871cb12b482017cb9d1d03f5035", "score": "0.5455019", "text": "function mouseClick(event, elCell, i, j) {\r\n gMouseClick = event.button;\r\n document.addEventListener(\r\n 'contextmenu',\r\n function (event) {\r\n gMouseClick = 2;\r\n event.preventDefault();\r\n },\r\n false\r\n );\r\n if (gBoard[i][j].isMarked) {\r\n removeFlag(elCell, i, j);\r\n } else if (gMouseClick === 2 && !gBoard[i][j].isShown) {\r\n cellMarked(elCell, i, j);\r\n }\r\n}", "title": "" }, { "docid": "f52c8a46f699eda05fd04c8797518690", "score": "0.5443093", "text": "function HandleTblRowClicked(tblRow) {\n //console.log(\"=== HandleTblRowClicked\");\n //console.log( \"tblRow: \", tblRow);\n\n// --- deselect all highlighted rows, select clicked row\n t_td_selected_toggle(tblRow, true); // select_single = True\n\n// --- lookup exam_dict in exam_rows\n const tblName = get_attr_from_el(tblRow, \"data-table\")\n const data_rows = get_datarows_from_tblName(tblName);\n\n // PR2022-05-11 Sentry debug: Unhandled Expected identifier with IE11 on Windows 7\n // leave it as it is, maybe error caused by IE 11\n const data_pk = get_attr_from_el_int(tblRow, \"data-pk\")\n const school_pk = get_attr_from_el_int(tblRow, \"data-school_pk\")\n const lookup_1_field = (tblName === \"results\") ? \"exam_id\" : \"id\";\n const lookup_2_field = (tblName === \"results\") ? \"school_id\" : null;\n\n const [index, found_dict, compare] = b_recursive_integer_lookup(data_rows, lookup_1_field, data_pk, lookup_2_field, school_pk);\n const pk_int = (!isEmpty(found_dict)) ? (tblName === \"results\") ? found_dict.exam_id : found_dict.id : null;\n\n// --- update setting_dict.pk_int\n if (tblName === \"grades\"){\n setting_dict.sel_grade_exam_pk = (pk_int) ? pk_int : null;\n\n } else if (tblName === \"results\"){\n setting_dict.sel_exam_pk = (pk_int) ? pk_int : null;\n };\n\n }", "title": "" }, { "docid": "4d6c2fc1ef325f190fc7fcf18fed7162", "score": "0.5438942", "text": "function cr_table(){\n\t$( \".cr_table tbody tr\" ).click(function() {\n\t\tif ($(this).attr('class') != 'cr_select'){\n\t\t\t$('.cr_table tbody tr').removeClass('cr_select');\n\t\t\t$(this).addClass('cr_select');\n\t\t} else {\n\t\t\t$(this).removeClass('cr_select');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "79007d611746f89a5297aab3bd9e778a", "score": "0.54364353", "text": "function textmousedown(p, selectedindex) {\n \n highlight_row(selectedindex);\n\n \n\n }", "title": "" }, { "docid": "05150dfd2fea85a51e7eb168c56ef051", "score": "0.54344475", "text": "function tblEventCreatedRow(row, data, index) {\n\t\t\t$compile(angular.element(row).contents())($scope);\n\t\t}", "title": "" }, { "docid": "187ccefc393892406edf91009e3b4bc2", "score": "0.5429953", "text": "function onEquipmentGridRowClick(){\n\n //get the selected eq_id\n var grid = abBldgOpsReportWrSameEqLocController.abBldgOpsReportWrSameEqLocEquipmentGrid;\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var eqId = selectedRow[\"wr.eq_id\"];\n \n //create restriction\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"wr.eq_id\", eqId, \"=\");\n \n //refresh and show details panel as pop-up\n var detailsGrid = abBldgOpsReportWrSameEqLocController.abBldgOpsReportWrSameEqLocDetailsGrid;\n detailsGrid.refresh(restriction);\n detailsGrid.showInWindow({\n width: 1200,\n height: 400\n });\n \n}", "title": "" }, { "docid": "f9f027bf1440d78376c4bebdb52fbdf1", "score": "0.54257643", "text": "function enableRowHighlighting() {\n /* Get all rows from your 'table' but not the first one \n * that includes headers. */\n var rows = $('tr').not(':first')\n \n /* Create 'click' event handler for rows */\n rows.on('click', function(e) {\n \n /* Get current row */\n var row = $(this)\n \n /* Check if 'Ctrl', 'cmd' or 'Shift' keyboard key was pressed\n * 'Ctrl' => is represented by 'e.ctrlKey' or 'e.metaKey'\n * 'Shift' => is represented by 'e.shiftKey' */\n if ((e.ctrlKey || e.metaKey) || e.shiftKey) {\n /* If pressed highlight the other row that was clicked */\n row.addClass('tableRowHighlight')\n } else {\n /* Otherwise just highlight one row and clean others */\n rows.removeClass('tableRowHighlight')\n row.addClass('tableRowHighlight')\n }\n $('#remove_attendee_table2').prop('disabled', false);\n })\n}", "title": "" }, { "docid": "35d85ac88fbbbec1450eb270c17b6933", "score": "0.5423537", "text": "function rightclick(eveniment){\n eveniment.preventDefault();//ca sa nu mearga cand apas click dreapta\n showContextMenu(eveniment);\n}", "title": "" }, { "docid": "32cc37fcb9b489a8552f7ef82fcea511", "score": "0.54214513", "text": "function node_onClick(d) {\n\t\t\t// add students\n\t\t\tvar stu = [];\n\t\t\td.students.forEach(function(c){\n\t\t\t\tstu.push('<tr><td><a href=\\'' + c.Link + '\\'>' + c.Name + '</a></td></tr>');\n\t\t\t});\n\t\t\tif(stu.length){\n\t\t\t\tstudbox.select('table').html(stu.join('\\n'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstudbox.select('table').html('No students available.');\n\t\t\t}\n\n\t\t\t// set display to inline\n\t\t\tstudbox.transition()\n\t\t\t\t\t.duration(200)\n\t\t\t\t\t.style(\"display\",\"inline\");\t\n\t\n\t\t\t// define starting topleft position on toolTip\n\t\t\tstudbox.style(\"left\", d3.event.pageX + \"px\")\n\t\t\t\t\t.style(\"top\", d3.event.pageY + \"px\");\n\t\t}", "title": "" }, { "docid": "ca68445cb0a382a5393631985307321d", "score": "0.54096645", "text": "function _row_onClick(event)\n{\n\tif(_isWorkingOnSelectedRow())\n\t\treturn;\n\t\t\n\tif(!_allowedToChangeSelection())\n\t{\n\t\tif(event.srcElement.type==\"checkbox\")\n\t\t\tevent.srcElement.checked= !event.srcElement.checked;\n\t\treturn;\n\t}\t\n\t\t\n\tvar bCtrlKey=event.ctrlKey;\n\t\n\tif(! bCtrlKey)\n\t{\n\t\tif(m_bCheckBox)\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we can use checkbox to simulate CtrlKey\n\t\t{\n\t\t\tif( event.srcElement.className==\"ROWHEAD\")\n\t\t\t\tbCtrlKey=true;\n\t\t\telse if(event.srcElement.parentElement.className==\"ROWHEAD\")\n\t\t\t\tbCtrlKey=true;\n\t\t}\n\t}\t\n\t\n\t_row_onClick_UsingCtrlKey(bCtrlKey);\t\t\t\n}", "title": "" }, { "docid": "30ac534243106fb1cfb283fd2be5dde9", "score": "0.54091394", "text": "_onClick(e){if(e.defaultPrevented){// Something has handled this click already, e. g., <vaadin-grid-sorter>\nreturn;}const path=e.composedPath();const cell=path[path.indexOf(this.$.table)-3];if(!cell||cell.getAttribute('part').indexOf('details-cell')>-1){return;}const cellContent=cell._content;const activeElement=this.getRootNode().activeElement;const cellContentHasFocus=cellContent.contains(activeElement)&&(// MSIE bug: flex children receive focus. Make type & attributes check.\n!this._ie||this._isFocusable(activeElement));if(!cellContentHasFocus&&!this._isFocusable(e.target)){this.dispatchEvent(new CustomEvent('cell-activate',{detail:{model:this.__getRowModel(cell.parentElement)}}));}}", "title": "" }, { "docid": "9d2fc30787267d9dd469fbe2b847cc83", "score": "0.5406175", "text": "function doRowClick(event) {\n\t\tbase.currentSelection = event.data;\n\t\tbase.onRowClick(event);\n\t}", "title": "" }, { "docid": "0ff4d478c4d506cf92f3ac7d9163eaad", "score": "0.5405465", "text": "function mouse_onclick_line(d){\n\t\t$('#new-fk').hide();\n\t\t$('#default-fk').show();\n\t\t$(\"#fk-table-erd-current\").val(d.table);\n\t\t$(\"#fk-refertable-erd-current\").val(d.referTbl);\n\t\t$('#btn-delete-rela').prop('disabled',false);\n\t\td3.event.stopPropagation();\n\t}", "title": "" }, { "docid": "e69fe644eef7c692a960a4e9973de1c8", "score": "0.5389793", "text": "_handleCellClick(idx) {\n let user = this.state.filteredDataList.getObjectAt(idx)\n this.props.userActions.requestDetailUser(user)\n Mixpanel.track('Clicked User Row')\n this.setState({\n selectedUser: user,\n userFormDisplayed: false,\n sideDetailDisplayed: true\n });\n }", "title": "" }, { "docid": "188f7a872484f2b220c1e8553236b60b", "score": "0.5384554", "text": "function addRowHandlers() {\n var row = document.getElementById(\"MSUTable\").rows;\n for (i = 0; i < row.length; i++) {\n row[i].onclick = function(){ return function(){\n var slot = this.cells[0];\n showDetails(slot.innerHTML);\n };}(row[i]);\n }\n}", "title": "" }, { "docid": "7d17f8b128cf290755e7b56e54c5537f", "score": "0.5379318", "text": "function on_tr_click(event) {\n if ($(event.target).is(\":not(:checkbox)\")) {\n $(this).find(\"input:checkbox\").click();\n }\n}", "title": "" }, { "docid": "d0a45049a6334359ca98931f9a3d9a9d", "score": "0.5373456", "text": "function tableClickHandler( e ) {\n e.preventDefault();\n e.stopPropagation();\n var tr = e.target.parentNode.parentNode.parentNode,\n td = tr.getElementsByTagName( \"td\" ),\n div = tr.getElementsByTagName( \"div\" )[0];\n\n // change expand/collapse icon\n for( i=0; i<td.length; ++i ) {\n if( td[i].className.match( /exp/ ) ) {\n img = td[i].getElementsByTagName( \"img\" )[0];\n if( img ) {\n img.src = \"images/twisty\" + ( img.src.match( /Closed/ ) ? \"Open\" : \"Closed\" ) + \".png\";\n }\n }\n }\n\n // hide/show the content div\n if( div.className.match( /hid/ ) ) {\n div.className = 'reg';\n } else {\n div.className = 'hid';\n }\n }", "title": "" }, { "docid": "3e487a6239bef3d1cf8eb2c9faf9f3ea", "score": "0.53606284", "text": "function onCanvasMouseDown(event) {\n window.mouseDown = true;\n clickCell(event.offsetX, event.offsetY);\n}", "title": "" }, { "docid": "e7b71622ec818aaf10b8c215d0902826", "score": "0.5345733", "text": "function eltMouseDown()\n{\n mouseIsDown = true;\n pendStartCell = this;\n return false; // suppress default processing\n}", "title": "" }, { "docid": "23ec99c9c85109f482715205e308bb97", "score": "0.53375864", "text": "function popTable(){\n\tvar x = \"\";\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name != undefined){\n\t\t\tx += \"<tr class='EditRow' onclick='EditUser()'>\" + \"<td onclick='passName(this.innerText)'>\" + currentProject.members[i].name + \"</td>\";\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tx += \"<td class='mrole'>\" + currentProject.members[i].role[j] + \"</td>\" + \"</tr>\";\n\t\t\t}\n\t\t}\n\t}\n\tdocument.getElementById(\"bod\").innerHTML = x;\n}", "title": "" }, { "docid": "0273aff2bb817937456732b342eb827e", "score": "0.5329068", "text": "function ip_click(i){\n\t//clear old table.\n\tvar tbl = $(\"#filter_table\");\n\n\tvar row = tbl.find(\"#outer_tbody\");\n\tvar fake_row = row.find(\".fake_row:eq(\"+ i.toString()+\")\");\n\tfake_row.css(\"display\",\"none\");\n\t//fake_row.collapse();\n}", "title": "" }, { "docid": "b0f69b4cb9b7476bd98b5b2d610481b3", "score": "0.53234625", "text": "function addOnclickToDatatableRows() {\n var trs = document.getElementById('form1:dataTable1')\n .getElementsByTagName('tbody')[0]\n .getElementsByTagName('tr');\n for (var i = 0; i < trs.length; i++) {\n trs[i].onclick = new Function(\"highlightAndSelectRow(this)\");\n trs[i].bgColor = getBgColorForRow(i);\n }\n}", "title": "" }, { "docid": "ee3f1d720a1ee54c6c8ac655f1c61e28", "score": "0.5306024", "text": "function satAtrebut(){\n for(var i=0;i<9;i++){\n for(var j=0;j<9;j++){\n mytr[i].children[j].setAttribute(\"oncontextmenu\",`eveen_2(${i},${j})`)\n mytr[i].children[j].setAttribute(\"onclick\",`eveen(${i},${j})`) \n }\n }\n }", "title": "" }, { "docid": "6b9faad6b8a488a852869e81ff6693a5", "score": "0.5304854", "text": "function createAuthorRow(reservationData) {\n var newTr = $(\"<tr>\");\n newTr.data(\"reservation\", reservationData);\n newTr.append(\"<td>\" + reservationData.name + \"</td>\");\n newTr.append(\"<td>\" + reservationData.id + \"</td>\");\n newTr.append(\"<td> \" + reservationData.Orders.length + \"</td>\");\n newTr.append(\"<td><a href='/api/orders/\" + reservationData.id + \"'>List of Orders</a></td>\");\n newTr.append(\"<td><a style='cursor:pointer;color:red' class='delete-author'>Delete Reservation</a></td>\");\n return newTr;\n }", "title": "" }, { "docid": "1b39dd1b21f6f5a0f5bfcf826667e433", "score": "0.53046006", "text": "function rowMouseOver() {\r\n tabContainer.addEventListener(\"mouseover\", function (e) {\r\n const tabRow = e.target.closest(\"tr\");\r\n tabRow.querySelector(\".btn-close-td\").classList.remove(\"hidden\");\r\n tabRow.querySelector(\".btn-close\").classList.remove(\"hidden\");\r\n tabRow.querySelector(\"#title-container\").setAttribute(\"colspan\", \"1\");\r\n tabRow.querySelector(\".url\").style.color = \"#000000\";\r\n tabRow.querySelectorAll(\".tab-data\").forEach(function (span) {\r\n span.style.width = \"228px\";\r\n });\r\n });\r\n}", "title": "" }, { "docid": "0702123e12a87d03ff54d9b53b3f0817", "score": "0.53001076", "text": "function rowMouseOut() {\r\n tabContainer.addEventListener(\"mouseout\", function (e) {\r\n const tabRow = e.target.closest(\"tr\");\r\n tabRow.querySelector(\".btn-close-td\").classList.add(\"hidden\");\r\n tabRow.querySelector(\".btn-close\").classList.add(\"hidden\");\r\n tabRow.querySelector(\"#title-container\").setAttribute(\"colspan\", \"2\");\r\n tabRow.querySelectorAll(\".tab-data\").forEach(function (span) {\r\n span.style.width = \"264px\";\r\n });\r\n\r\n if (tabRow.dataset.inFocus) return;\r\n tabRow.querySelector(\".url\").style.color = \"#9b9b97\";\r\n });\r\n}", "title": "" }, { "docid": "858f00c93a937564ff0bccf6c1cc0f2c", "score": "0.52938277", "text": "function createAwardClick(row, jsonObj) {\n\trow.onclick = function () { \n\t\tawardLinkQuery(jsonObj);\n\t};\n}", "title": "" }, { "docid": "08edb3cf217178c4abb12a8445ed3979", "score": "0.52876806", "text": "function show_table_onclick(id)\n{\n\talert(id);\t\n}", "title": "" }, { "docid": "15a9cfddf734fae5b485281d8edc2e95", "score": "0.528332", "text": "function click_navbar(oItemHolder,oE)\r\n{\r\n\tvar eleSrc = app.getEventSourceElement(oE);\r\n\teleSrc = app.get_parent_owner_by_tag(eleSrc, \"TR\");\r\n\tactivate_navbar(oItemHolder,eleSrc);\r\n\r\n}", "title": "" }, { "docid": "35c44f0ae5b5472215cd0fbc0027c033", "score": "0.5282321", "text": "function clickedTable(event) {\n //console.log(\"clicked table\");\n //console.log(event.target);\n\n const clicked = event.target;\n if (clicked.tagName === \"IMG\") {\n if (clicked.classList.contains(\"deleteBTN\")) {\n clickedDelete(clicked);\n }\n }\n}", "title": "" }, { "docid": "7517c6f0b2cbfd8b3a03682809266ad6", "score": "0.52786034", "text": "function addRowHandlers() {\n if(type != \"used\")\n {\n var table = document.getElementById(\"timeTable\");\n var rows = table.getElementsByTagName(\"tr\");\n for (i = 0; i < rows.length; i++) {\n var currentRow = table.rows[i];\n var createClickHandler = \n function(row) \n {\n return function() \n { \n var tempId = row.getElementsByTagName(\"td\")[0];\n var tempComments = row.getElementsByTagName(\"td\")[1];\n var tempName = row.getElementsByTagName(\"td\")[2];\n var tempTime = row.getElementsByTagName(\"td\")[3];\n var tempType = row.getElementsByTagName(\"td\")[4];\n var id = tempId.innerHTML;\n var comments = tempComments.innerHTML;\n var name = tempName.innerHTML;\n var time = tempTime.innerHTML;\n if((type == \"all\" && tempType.innerHTML == \"Unused\") || type == \"unused\")\n {\n var result = confirm(\"Use this time?\\n\" + name + \": \" + time\n + \"\\n\\nComments: \\\"\" + comments + \".\\\"\");\n if(result)\n {\n document.location.href = \"TimelineController?del=1&\" + \"id=\" + id;\n } \n }\n };\n }; \n\n currentRow.onclick = createClickHandler(currentRow);\n }\n }\n \n}", "title": "" }, { "docid": "3a053b8805738bd43eb2f7f6f27ac9d7", "score": "0.5276936", "text": "function MSELEX_SelectItem(tblRow) {\n //console.log( \"===== MSELEX_SelectItem ========= \");\n //console.log( \"tblRow\", tblRow);\n\n// --- deselect all highlighted rows\n DeselectHighlightedRows(tblRow, cls_selected)\n// --- highlight clicked row\n tblRow.classList.add(cls_selected)\n// --- get pk code and value from tblRow in mod_MSELEX_dict\n mod_MSELEX_dict.exam_pk = get_attr_from_el_int(tblRow, \"data-pk\")\n //console.log( \"mod_MSELEX_dict\", mod_MSELEX_dict);\n MSELEX_validate_and_disable();\n } // MSELEX_SelectItem", "title": "" }, { "docid": "6c7554d20c4730852fa5554740adc597", "score": "0.5274564", "text": "function edit_table(e) {\n e.preventDefault();\n\n switch(e.explicitOriginalTarget.id) {\n case \"add_column\":\n window.dataset.value.forEach(function(row){\n row.push(row[0]);\n });\n refresh_table();\n break;\n\n case \"add_row\":\n window.dataset.value.push(window.dataset.value[0].slice());\n refresh_table();\n break;\n\n case \"add_row_headers\":\n window.dataset.value.push(window.dataset.value[0].slice().fill(1));\n refresh_table();\n break;\n }\n}", "title": "" }, { "docid": "e84515efde1b8d35b726102809c2e4d9", "score": "0.52697396", "text": "function mes_datarow_selected(aRow)\r\n{\r\n\tvar strTable = aRow.getAttribute('keytable');\r\n\tvar strKeyCol = aRow.getAttribute('keycolumn');\r\n\tvar varKeyValue = B64.decode(aRow.getAttribute('keyvalue'));\r\n\r\n\t//-- load data into mes form - so access workspace area\r\n\tapp.datatable_hilight(aRow);\r\n\r\n\tif(aRow.getAttribute(\"type\")==\"sys\")\r\n\t{\r\n\t\t\r\n\t\tapp.fireEvent(aRow,\"click\");\r\n\t\t//aRow.click(aRow);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tload_mes_url(strTable,strKeyCol, varKeyValue);\r\n\t}\r\n}", "title": "" }, { "docid": "7a3d783de5521a82e93fbf8295cbd32f", "score": "0.52612907", "text": "bindMouseClick() {\n board.addEventListener('click', (event) => {\n if (this.active && event.target.className === \"space\") {\n const col = parseInt(event.target.getAttribute(\"col\"));\n this.markAndDrop(col);\n }\n });\n }", "title": "" }, { "docid": "4f4ac507e12902a12d09ab226b3a13ad", "score": "0.52432764", "text": "function setAuthorizations(idUser){\n window.document.getElementsByClassName('b').addEventListener('click', function(){\n let cellIndex = this.cellIndex;\n let rowIndex = this.parentNode.rowIndex;\n let d = window.document.getElementById(\"idAgent\").innerHTML;\n //First query to get the right idData and idPurpose according to the service (its not always gonna be email;stats etc at the same place)\n //Table is called INDECES and rows are : index, datatype, purposetype\n let sqlDataType = 'SELECT datatype FROM '+d+' WHERE index = '+ rowIndex+\";\";\n let sqlPurposeType = 'SELECT purposetype FROM '+d+' WHERE index = '+ cellIndex+\";\";\n let sqlAddAuthor = \"INSERT INTO data (P\"+idPurpose+\") VALUES (\" + d+ \") WHERE idData =\"+idData+\"AND idPurpose = \"+idPurpose+\" AND idUser = \"+idUser+\";\";\n let db = createDB();\n let idData = db.get(sqlDataType, function(err, idData) {\n if (err) return alert(err);\n else return idData\n}); \n let idPurpose = db.get(sqlPurposeType, function(err, idPurpose) {\n if (err) return alert(err);\n else return idPurpose\n}); \n db.run(sqlAddAuthor, function(err, result) {\n if (err) return alert(err);\n}); \n });}", "title": "" }, { "docid": "b5771d3b285b55c1ff98016a115870b6", "score": "0.52338266", "text": "function setClicks(tableId){\n tableId.find(\"tr\").click(function(){\n var ul = $(this).find(\"td:nth-child(2)\");\n animateDisappear(tableId);\n });\n}", "title": "" }, { "docid": "561943a9ad153307f3c3f60a83dfb1e8", "score": "0.5233356", "text": "function BocList_OnRowClick (evt, bocList, currentRow, selectorControl)\n{\n if (_bocList_isCommandClick)\n {\n _bocList_isCommandClick = false;\n return;\n } \n \n if (_bocList_isSelectorControlLabelClick)\n {\n _bocList_isSelectorControlLabelClick = false;\n return;\n } \n\n var currentRowBlock = new BocList_RowBlock (currentRow, selectorControl);\n var selectedRows = _bocList_selectedRows[bocList.id];\n var isCtrlKeyPress = false;\n if (evt)\n isCtrlKeyPress = evt.ctrlKey;\n \n if ( selectedRows.Selection == _bocList_rowSelectionUndefined\n || selectedRows.Selection == _bocList_rowSelectionDisabled)\n {\n return;\n }\n \n if (isCtrlKeyPress || _bocList_isSelectorControlClick)\n {\n // Is current row selected?\n if (selectedRows.Rows[selectorControl.id] != null)\n {\n // Remove currentRow from list and unselect it\n BocList_UnselectRow (bocList, currentRowBlock);\n }\n else\n {\n if ( ( selectedRows.Selection == _bocList_rowSelectionSingleCheckBox\n || selectedRows.Selection == _bocList_rowSelectionSingleRadioButton)\n && selectedRows.Length > 0)\n {\n // Unselect all rows and clear the list\n BocList_UnselectAllRows (bocList);\n }\n // Add currentRow to list and select it\n BocList_SelectRow (bocList, currentRowBlock);\n }\n }\n else // cancel previous selection and select a new row\n {\n if (selectedRows.Length > 0)\n {\n // Unselect all rows and clear the list\n BocList_UnselectAllRows (bocList);\n }\n // Add currentRow to list and select it\n BocList_SelectRow (bocList, currentRowBlock);\n }\n try\n {\n selectorControl.focus();\n }\n catch (e)\n {\n } \n _bocList_isSelectorControlClick = false;\n}", "title": "" }, { "docid": "b6e33eca2c5573773fc0a30f95144739", "score": "0.5233066", "text": "static mouseClicked() {\n for(let e of this.elements) {\n if(e.clickable)\n e.clicked();\n }\n }", "title": "" }, { "docid": "cfafc4376193e99f955c7c12d9541df2", "score": "0.5232227", "text": "function handleDoubleClickColumn() {\n \n }", "title": "" }, { "docid": "1176a4b7f3447151af680c8f1d47546a", "score": "0.52185076", "text": "function click(event) {\n if (!event.target)\n\treturn;\n\n if (!event.shiftKey) {\n\ttbl = event.target.parentNode.parentNode.parentNode;\n\n // clean up table. remove links and internal tables.\n $(\"table\", tbl).remove();\n $(\"td div\", tbl).each(function(td){ $(this).replaceWith($(this).text());});\n\n\tcomputeLogicalTable();\n\tclear(event);\n\tone = event.target;\n\t$(one).addClass(\"selected\");\n } else {\n\tif (one == null)\n\t return;\n \n\ttwo = event.target;\n\t$(two).addClass(\"selected\");\n \n\tupdate(\"selected\");\n };\n return false;\n}", "title": "" }, { "docid": "ed90262dfaf57193699a8f8f7835d8e8", "score": "0.5218241", "text": "function applyTableClickHandlers() {\n $(\"td\").click(placePiece);\n}", "title": "" }, { "docid": "ed90262dfaf57193699a8f8f7835d8e8", "score": "0.5218241", "text": "function applyTableClickHandlers() {\n $(\"td\").click(placePiece);\n}", "title": "" }, { "docid": "0c92471d957441f16a5651c5aa1e0ed2", "score": "0.51964605", "text": "function mouseOverCell(e, id, level, user, comp)\n{\n\n $('compover').show();\n if (e.type == \"mouseover\")\n {\n var scrOfX = 0, scrOfY = 0;\n if (typeof(window.pageYOffset) == 'number')\n {\n // Netscape compliant\n scrOfY = window.pageYOffset;\n scrOfX = window.pageXOffset;\n } else if (document.body\n && (document.body.scrollLeft || document.body.scrollTop))\n {\n // DOM compliant\n scrOfY = document.body.scrollTop;\n scrOfX = document.body.scrollLeft;\n } else if (document.documentElement\n && (document.documentElement.scrollLeft || document.documentElement.scrollTop))\n {\n // IE6 standards compliant mode\n scrOfY = document.documentElement.scrollTop;\n scrOfX = document.documentElement.scrollLeft;\n }\n\n $('compover').style.top = (e.clientY + scrOfY + 10) + \"px\";\n $('compover').style.left = (e.clientX + scrOfX + 10) + \"px\";\n\n if (infoBuffer.get(id + \" \" + level + \" \" + user) == undefined)\n {\n showMouseOver(id, level, user, comp);\n } else\n {\n $('compover').innerHTML = infoBuffer.get(id + \" \" + level + \" \" + user);\n }\n\n }\n}", "title": "" }, { "docid": "6080ef5569bf16f751201968be6940f2", "score": "0.5196337", "text": "function onSelectDocumentRowForBlock(row){\n // Show Project Document Form in a pop-up dialog restricted by clicked document row \n var record = row.row.getRecord();\n var key = record.getValue('rmstd.rm_std');\n var docName = record.getValue('rmstd.doc_block');\n var keys = {\n 'rm_std': key\n };\n View.showDocument(keys, 'rmstd', 'doc_block', docName);\n}", "title": "" }, { "docid": "13a53b727fc3159e52ca31448d7f5ddb", "score": "0.5187309", "text": "function fn_rowclick(id){\n\t\n\tif($('#tr_'+id).hasClass('selected')) {\t\n\t\t$('#tr_'+id).removeClass(\"selected\").removeClass(\"unselected\");\n\t\t$('#tr_'+id).addClass(\"unselected\");\n\t\t$('#tr_'+id+' td').removeAttr(\"style\");\n\t\t$('#tr_'+id+' td:last').css('padding-left','4%');\n\t} else {\n\t\t$('#tr_'+id).removeClass(\"selected\").removeClass('unselected');\n\t\t$('#tr_'+id).addClass(\"selected\");\n\t\t$('#tr_'+id+' td').css(\"background-color\",\"#F3FFD1\");\n\t\t$('#submit').show();\t\t\t\t\t\t\t\t\n\t}\n\t\n\t$('#submit').hide();\t\n\t\t\t\n\t$(\"tr[id^='tr']\").each(function() {\n\t\tif($(this).hasClass('selected')) {\n\t\t\t$('#submit').show();\t\t\t\t\t\n\t\t}\n\t});\t\t\t\n}", "title": "" }, { "docid": "b7263a058222a69aae13f394c8648ab3", "score": "0.5186361", "text": "function triggerClick($elt) {\n var evt = unsafeWindow.document.createEvent(\"MouseEvents\");\n evt.initEvent(\"click\", true, true);\n $elt[0].dispatchEvent(evt);\n }", "title": "" }, { "docid": "0c72ec02b8b3d1166b54b0e59223c640", "score": "0.5172009", "text": "function action_mousedown( obj )\n{\n\taction_mouse( obj, \"mousedown\" );\n}", "title": "" }, { "docid": "9a8a05ab4a0b980a7d09eee5e2d54bdd", "score": "0.51711947", "text": "beforeSelectRow(rowid, e){\n }", "title": "" }, { "docid": "9f28c6b15c53b986a79b74aa8bf50a5f", "score": "0.5170785", "text": "function firstColumnOnMouseUp () {\n var itemIndex = this.getAttribute(\"data-index\")\n bus.emit(\"domain.update-first-column-selected-item\", itemIndex);\n bus.emit(\"domain.update-second-column-selected-item\", itemIndex, 0);\n }", "title": "" }, { "docid": "dafd297195cdd9e6b84c865d2e10aa09", "score": "0.516503", "text": "function highlightRow(name, id){\n //console.log(\"marker clicked. \" + name + \" \" + id);\n if(name == \"crime\"){\n\tcrimeTable.row(id).scrollTo(false);\n }else if(name == \"arrest\"){\n\tarrestTable.row(id).scrollTo(false);\n }\n}", "title": "" }, { "docid": "dc78c2c663af363c7733ad6bfe303eff", "score": "0.5164733", "text": "handleRowAction( event ) {\n \n const row = event.detail.row;\n console.log( 'Row is ' + JSON.stringify( row ) );\n\n }", "title": "" }, { "docid": "df6d60869c0053bb53bc811e348c14e0", "score": "0.5163675", "text": "onTableHeadingClick(event, column) {\n if (column.sortable) {\n if (this.sortBy !== column.path) {\n this.sortBy = column.path;\n this.sortDirection = 'asc';\n } else {\n this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';\n }\n }\n\n this.$emit('th-click', event, this.columns[column.indexRef] || column, column.indexRef)\n }", "title": "" }, { "docid": "c8aaaa50f783b9bc98c68b7f50ceec22", "score": "0.5162101", "text": "function addEvents(){\n\n\t$('table').mouseover(function(){\n //create a string that represent the rgb color\n\t\tvar color = \"rgb(\";\n //add three numbers in the rgb model\n\t\tfor (var i=0; i<3; i++){\n //generate three times a random integer between 0 and 255\n\t\t\tvar random = Math.round(Math.random() * 255);\n //concatenate the string, change the datatype from number to string\n\t\t\tcolor += random.toString();\n //a final string looks like 'rgb(num1,num2,num3)'\n\t\t\tif (i<2){\n\t\t\t\tcolor += \",\";\n\t\t\t} else {\n\t\t\t\tcolor += \")\";\n\t\t\t};\n\n\t\t $(this).css('color', color);\n\t\t};\n //whenever clicking the table, pop up the alert\n\t function clickme(){\n\n\t\t alert('Hey, you clicked me!');\n \t};\n\n\t $('table').on('click', clickme);\n\t });\n}", "title": "" }, { "docid": "3f07af8332274da9a3ff634968634069", "score": "0.5161818", "text": "function tableAddListeners(){\r\n document.getElementById('disp_table').addEventListener('dblclick', setRPOnDblClick, false);\r\n}", "title": "" }, { "docid": "7bd2b710b094f09d171cb325139735a7", "score": "0.5160419", "text": "function infoListener(dataTable, info_action){\n $('tbody tr',dataTable).live(\"click\",function(e){\n\n if ($(e.target).is('input') ||\n $(e.target).is('select') ||\n $(e.target).is('option')) return true;\n\n var aData = dataTable.fnGetData(this);\n if (!aData) return true;\n var id = $(aData[0]).val();\n if (!id) return true;\n\n if (info_action)\n {\n //If ctrl is hold down, make check_box click\n if (e.ctrlKey || e.metaKey || $(e.target).is('input'))\n {\n $('.check_item',this).trigger('click');\n }\n else\n {\n popDialogLoading();\n Sunstone.runAction(info_action,id);\n\n // Take care of the coloring business\n // (and the checking, do not forget the checking)\n $('tbody input.check_item',$(this).parents('table')).removeAttr('checked');\n $('.check_item',this).click();\n $('td',$(this).parents('table')).removeClass('markrowchecked');\n\n if(last_selected_row)\n last_selected_row.children().each(function(){$(this).removeClass('markrowselected');});\n last_selected_row = $(\"td:first\", this).parent();\n $(\"td:first\", this).parent().children().each(function(){$(this).addClass('markrowselected');});\n };\n }\n else\n {\n $('.check_item',this).trigger('click');\n };\n\n return false;\n });\n}", "title": "" }, { "docid": "fd8373c7204ba10975d01d4bb3cb87cf", "score": "0.5156302", "text": "function mouseClicked(){\n\t//revisa las cordenadas del click\n\tfor (var i = FROGS.length - 1; i >= 0; i--) {\n\t\tFROGS[i].clicked(mouseX,mouseY);\n\t}\n}", "title": "" }, { "docid": "e06eb0fbc6fe201813c3f8aedf963fcf", "score": "0.515409", "text": "function MSELEX_SelectItem(tblRow) {\n console.log( \"===== MSELEX_SelectItem ========= \");\n console.log( \"tblRow\", tblRow);\n// --- deselect all highlighted rows\n DeselectHighlightedRows(tblRow, cls_selected)\n// --- highlight clicked row\n tblRow.classList.add(cls_selected)\n// --- get pk code and value from tblRow in mod_MSELEX_dict\n mod_MSELEX_dict.exam_pk = get_attr_from_el_int(tblRow, \"data-pk\")\n console.log( \"mod_MSELEX_dict\", mod_MSELEX_dict);\n MSELEX_validate_and_disable();\n } // MSELEX_SelectItem", "title": "" } ]
cbc11c9a99f9a174be4ccaa7e6a8d52e
/ Get Shopping List Item Details / / This fails with prototype v.1.6. Needs v. 1.7
[ { "docid": "7af70b0d9efb061a8834d7efecd8c451", "score": "0.5915724", "text": "function SiteCatalyst_GetShoppingListDetailsByItemIds(items, CallBackFunction)\n{\n // generate the post body\n var postdata = null;\n \n // Determine if its an array\n var bisArray = Array.isArray(items);\n if (false == bisArray)\n {\n // Create the array\n var itemsArray = new Array();\n \n // Add the item\n itemsArray[0] = items;\n itemsArray[1] = -1;\n \n // Create the post data. \n postdata = { url: document.URL, requestArguments: GSNContext.RequestArguments, itemsInput: itemsArray };\n }\n else\n {\n // Create the post data.\n postdata = {url:document.URL, requestArguments:GSNContext.RequestArguments, itemsInput:items};\n }\n\n // Make the request\n $jq.ajax(\n {\n type : 'post',\n dataType: 'json',\n data: JSON.stringify(postdata),\n contentType: 'application/json; charset=utf-8',\n url : (mSiteCatalystShoppingListPageWebServiceUrl + 'GetSiteCatalystItemDetails'),\n success: CallBackFunction\n }\n );\n}", "title": "" } ]
[ { "docid": "ce0c37b276a86db67514c4edc043ac34", "score": "0.7410444", "text": "function getItemDetails(listingID) {\n \n}", "title": "" }, { "docid": "35f30f55b7b5d924f9a107975e4637f5", "score": "0.65530103", "text": "function SiteCatalyst_GetDescriptionById(itemId)\n{\n var description = new String(\"\");\n \n // Loop through the shopping list items.\n for(var index = 0; index < mSiteCatalystShoppingListItems.length; index++)\n {\n // Get the shopping list info.\n var shoppingListItemInfo = mSiteCatalystShoppingListItems[index];\n \n // If the info is not null, then return the description.\n if ((shoppingListItemInfo != null)\n && (shoppingListItemInfo.itemId == itemId))\n {\n description = shoppingListItemInfo.description;\n }\n }\n \n return description;\n}", "title": "" }, { "docid": "419758414046108b7d30cd8d51ee10f8", "score": "0.6440313", "text": "function list_items()\n{\n\tif(validate_xpath_only('//*[@id=\"j-product-info-sku\"]')) // check exist or not\n\t{\n\t\t// take list of item options\n\t\tvar iterator = document.evaluate('//*[@id=\"j-product-info-sku\"]/dl/dt', document, null, XPathResult.ANY_TYPE, null );\n\t\t\n\t\ttry {\n\t\t var thisNode = iterator.iterateNext();\n\t\t var list_items = [];\t\t \n\t\t var i = 1;\n\t\t while (thisNode) {\n\t\t\t\t\tif(thisNode.textContent !== null && thisNode.textContent !== '') {\n\t\t\t\t\t list_items[i] = thisNode.textContent;\n\t\t\t\t\t thisNode = iterator.iterateNext();\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t } \n\t\t}\n\t\tcatch (e) {\n\t\t console.log( 'Error: Document tree modified during iteration ' + e );\n\t\t}\t\t\n\t\tconsole.log(list_items);\n console.log(list_item_details(list_items));\n return list_item_details(list_items);\n\t}\n}", "title": "" }, { "docid": "e9daebf8340bd0ca19b0a73de331658c", "score": "0.6344188", "text": "function item_info(item) {\n return parent.G.items[item.name];\n}", "title": "" }, { "docid": "50d02e128ea2c004120d6f9df74fe34e", "score": "0.6295575", "text": "function getItemInfo(item){\n // Create an Object with Item Data\n const itemDetails = document.querySelector('.show-details');\n const itemInfo = {\n id: itemDetails.dataset.id,\n brand: itemDetails.dataset.brand,\n category: itemDetails.dataset.category,\n price: itemDetails.dataset.price,\n img: itemDetails.dataset.img\n }\n // Insert into the shopping bag\n addIntoBag(itemInfo);\n}", "title": "" }, { "docid": "93d066bfae29fefc23042dcd74efbc89", "score": "0.6288951", "text": "function list_cart_items() {\r\n\tvar location_id = CheckNumeric(document.getElementById(\"txt_location_id\").value);\r\n\tvar status = document.getElementById(\"txt_status\").value;\r\n\tvar cart_session_id = CheckNumeric(document .getElementById(\"txt_session_id\").value);\r\n\t// From po,git,grn To git,grn,pr\r\n\tvar voucherclass_id = CheckNumeric(document .getElementById(\"txt_voucherclass_id\").value);\r\n\tvar vouchertype_id = CheckNumeric(document .getElementById(\"txt_vouchertype_id\").value);\r\n\tvar voucher_po_id = CheckNumeric(document .getElementById(\"txt_voucher_po_id\").value);\r\n\tvar voucher_git_id = CheckNumeric(document .getElementById(\"txt_voucher_git_id\").value);\r\n\tvar voucher_grn_id = CheckNumeric(document .getElementById(\"txt_voucher_grn_id\").value);\r\n\tshowHintFootable('../accounting/purchase-details.jsp?cart_session_id=' + cart_session_id \r\n\t\t\t+ '&status=' + status\r\n\t\t\t+ '&location_id=' + location_id\r\n\t\t\t+ '&cart_vouchertype_id=' + vouchertype_id\r\n\t\t\t+ '&voucherclass_id=' + voucherclass_id \r\n\t\t\t+ '&voucher_po_id=' + voucher_po_id\r\n\t\t\t+ '&voucher_git_id=' + voucher_git_id\r\n\t\t\t+ '&voucher_grn_id=' + voucher_grn_id \r\n\t\t\t+ '&list_cartitems=yes', 'po_details');\r\n}", "title": "" }, { "docid": "fbfa56be81c3e7546067f0bea5bee0b2", "score": "0.6218267", "text": "function SiteCatalyst_GetAllShoppingListDescriptions() \n{\n // Declare the string.\n var ShoppingListDesc = new String(\"\");\n var sDescription = new String(\"\");\n \n for (var index=0; index < mSiteCatalystShoppingListItems.length; index++)\n {\n // Get the shopping list info.\n var shoppingListItemInfo = mSiteCatalystShoppingListItems[index];\n if (shoppingListItemInfo != null)\n {\n sDescription = shoppingListItemInfo.description;\n }\n \n // Make sure that there is actually a value.\n if (sDescription.length > 0)\n {\n if (ShoppingListDesc.length > 0)\n {\n ShoppingListDesc = ShoppingListDesc + \",\";\n }\n ShoppingListDesc = ShoppingListDesc + sDescription;\n }\n }\n \n return ShoppingListDesc;\n}", "title": "" }, { "docid": "cef49b04ff7932692154b1cdf2e41abd", "score": "0.61829066", "text": "function loadItems()\r\n{\r\n\t//Declaring the local variables\r\n\t/*var itemSearch = new Array();\r\n\tvar itemFilters = new Array();\r\n\tvar itemColumns = new Array();\r\n\tvar itemShippingCost = 0.0;*/\r\n\r\n\ttry\r\n\t{\r\n\t\t//var record = nlapiLoadRecord('item', itemIntID);\r\n\t\tnlapiLogExecution('Audit', 'item record', itemIntID);\r\n\t\t/*//Adding filters to search the active items \r\n\t\titemFilters[0] = new nlobjSearchFilter('isinactive',null, 'is','F');\t\t//filtering by active Items\r\n\t\t\r\n\t\t//Getting particular columns in item search results \r\n\t\titemColumns[0] = new nlobjSearchColumn('internalid');\t\t\t\t\t\t//Getting Item's Internal ID\r\n\t\titemColumns[1] = new nlobjSearchColumn('custitem_averageshippingcost');\t\t//Getting Item's 'Average Shipping Cost'\r\n\t\t\r\n\t\t//Searching the items using filters and columns \r\n\t\titemSearch = nlapiSearchRecord('item', null, itemFilters, itemColumns);\t\t\r\n\r\n\t\t// Getting the values of particular columns returned from search results\r\n\t\tfor(var index=0; index <itemSearch.length; index++)\r\n\t\t{\r\n\t\t\t// Getting the location name\r\n\t\t\titemShippingCost = itemSearch[index].getValue(itemColumns[1]);\r\n\r\n\t\t}*/\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"loadItems : \" +e);\r\n\t} \r\n}", "title": "" }, { "docid": "2f6f794c96a3a477639f9582c8b91492", "score": "0.6158635", "text": "function SiteCatalyst_InitializeShoppingListDetails()\n{\n // generate the post body\n var postdata = {url:document.URL, requestArguments:GSNContext.RequestArguments};\n\n // Make the request\n $jq.ajax(\n {\n type : 'post',\n dataType: 'json',\n data: JSON.stringify(postdata),\n contentType: 'application/json; charset=utf-8',\n url : (mSiteCatalystShoppingListPageWebServiceUrl + 'GetSiteCatalystShoppingListDetails'),\n success: SiteCatalyst_InitializeShoppingListDetailsEvent\n }\n );\n\n}", "title": "" }, { "docid": "43bf3ee17eaf2f205569fd09fc700e8c", "score": "0.6131337", "text": "function getProductDetails() {\n //query product details\n let productTitle = document.querySelector(\".az-product-title\"),\n price = document.querySelector(\".az-product-price\").dataset.price,\n variantSpan = document.querySelector(\".az-product-variant\"),\n variant = variantSpan.innerText,\n imgSrc = variantSpan.getAttribute(\"data-img\"),\n size = document.querySelector(\".az-product-size-main\").innerText,\n quantity = document.getElementById(\"az-quantity-field\").value,\n maxAvailable = document\n .querySelector(\".az-product-qnt-max\")\n .textContent.trim(),\n shipping = document.getElementById(\"az-shipping\").value;\n if (quantity == 0) quantity = 1;\n return {\n productId: productTitle.getAttribute(\"data-id\"),\n title: productTitle.textContent.trim(),\n img: imgSrc,\n price: parseInt(price, 10),\n variant,\n size,\n quantity: parseInt(quantity, 10),\n max: parseInt(maxAvailable, 10),\n shipping,\n };\n}", "title": "" }, { "docid": "201a29d4662caf80c8bb5eaf25eaeb17", "score": "0.61064637", "text": "function getShoppingList(eventId, callback) {\n // returns the event's shopping list (list of item objects)\n // each item can have: item_id, display_name, quantity, cost, supplier, ready\n\tvar authToken = LetsDoThis.Session.getInstance().getAuthToken();\n\tvar shoppingListUrl = \"http://159.203.12.88/api/events/\"+eventId+\"/shoppinglist/\";\n\n\t$.ajax({\n\t\ttype: 'GET',\n\t\turl: shoppingListUrl,\n\t\tdataType: 'json',\n\t\tbeforeSend: function(xhr) {\n\t\t\txhr.setRequestHeader(\"Authorization\", \"JWT \" + authToken);\n\t\t},\n\t\tsuccess: function (resp) {\n\t\t\tconsole.log(\"Received Shopping List\");\n\t\t\tcallback(resp);\n\t\t},\n\t\terror: function(e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8f20f48e695b8370cee832ce8b90ad89", "score": "0.6100464", "text": "function SiteCatalyst_AddShoppingListItemDetailEvent(response) \n{\n // Get the data\n var siteCatalystDataList = response.d;\n\n // Loop through the data.\n for(var index = 0; index < siteCatalystDataList.length; index++)\n {\n // get the item.\n var siteCatalystData = siteCatalystDataList[index];\n if (siteCatalystData != null)\n {\n // Get the site catalyst data.\n var itemId = siteCatalystData.itemId;\n var itemType = siteCatalystData.itemType;\n var description = siteCatalystData.description;\n \n // Post the data to site catalyst.\n SiteCatalyst_AddItemToShoppingListByTypeId(itemId, itemType, description);\n }\n }\n}", "title": "" }, { "docid": "6c6d36c45ecf8ab5ca663f3063df07a4", "score": "0.60756785", "text": "function displayItems(request, response, stPO)\n{\t\n\tvar LOGGER_TITLE = 'displayItems';\n\t\n\tvar form = nlapiCreateForm('Mark Notify Vendor');\n\tform.setScript('customscript_prevent_notify_vendor_unchk');\n\tform.addField('custpage_stage', 'text', 'Stage').setDisplayType('hidden').setDefaultValue('sublistSubmitted');\n\tform.addField('custpage_po', 'text', 'PO').setDisplayType('hidden').setDefaultValue(stPO);\n\t\n\t// Loop through the item sublist of the Purchase Order and populate the fields on the suitelet\n\tvar sublistItems = form.addSubList('custpage_item_list', 'list', 'Items');\n\tsublistItems.addField('custpage_mark_notify_vendor', 'checkbox', 'Mark Notify Vendor');\n\tsublistItems.addField('custpage_do_not_allow_uncheck', 'checkbox', 'Allow Uncheck').setDisplayType('hidden');\n\tsublistItems.addField('custpage_item', 'select', 'Item', '-10').setDisplayType('inline');\n\tsublistItems.addField('custpage_description', 'text', 'Description').setDisplayType('inline');\n\tsublistItems.addField('custpage_vendor_milestone', 'text', 'Vendor Milestone').setDisplayType('inline');\n\tsublistItems.addField('custpage_vendor_bsch_trigger', 'text', 'Vendor BSch Trigger').setDisplayType('inline');\n\tsublistItems.addField('custpage_amount', 'text', 'Amount').setDisplayType('inline');\n\t\n\tvar recPO = nlapiLoadRecord('purchaseorder', stPO);\n\tvar intLineItemCount = recPO.getLineItemCount('item');\n\tnlapiLogExecution('DEBUG', LOGGER_TITLE, 'Line Item Count = ' + intLineItemCount);\n\tfor (var i = 1; i <= intLineItemCount; i++)\n\t{\n\t\tsublistItems.setLineItemValue('custpage_item', i, recPO.getLineItemValue('item', 'item', i));\n\t\tsublistItems.setLineItemValue('custpage_description', i, recPO.getLineItemValue('item', 'description', i));\t\t\n\t\tsublistItems.setLineItemValue('custpage_vendor_milestone', i, recPO.getLineItemText('item', 'custcol_3pp_vendor_milestone', i));\n\t\tsublistItems.setLineItemValue('custpage_vendor_bsch_trigger', i, recPO.getLineItemText('item', 'custcol_3pp_vendor_bsch_trigger', i));\n\t\tsublistItems.setLineItemValue('custpage_amount', i, recPO.getLineItemValue('item', 'amount', i));\n\t\t\n\t\tvar bCurrentMark = recPO.getLineItemValue('item', 'custcol_3pp_notify_vendor', i);\n\t\tsublistItems.setLineItemValue('custpage_mark_notify_vendor', i, bCurrentMark);\n\t\tsublistItems.setLineItemValue('custpage_do_not_allow_uncheck', i, bCurrentMark);\n\t}\n\t\n\t// Create the following buttons: Mark All, Save, Cancel\n\tform.addSubmitButton('Submit');\n\tform.addButton('custpage_cancel_button', 'Cancel', 'window.location=\\'/app/center/card.nl?sc=-29\\'');\n\t\n\tresponse.writePage(form);\t\n}", "title": "" }, { "docid": "bcd408ec0344abc11835028a5789f047", "score": "0.60705835", "text": "function loadDetails(item) {\n showLoadingMessage();\n let url = item.detailsUrl;\n return fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(json) {\n let details = [json.sprites.front_default, json.types, json.height];\n return details;\n })\n .catch(function(e) {\n console.log(e);\n });\n }", "title": "" }, { "docid": "bbb6bcc6984f83df603b7d72b52a6aa9", "score": "0.6069667", "text": "function GetSpecificItem(listName, itemId) {\n var endpointUrl = appweburl + \"/_api/web/lists/getbytitle('\" + listName + \"')/items(\" + itemId + \")\";\n return $.ajax({\n url: endpointUrl,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n}", "title": "" }, { "docid": "c4bf6bb9c23612e0ba104372cd24411e", "score": "0.6049811", "text": "function getItemInfo(collectionName, itemPointer) {\n var endpointString = (\"dmGetItemInfo/\" + collectionName + \"/\" +\n itemPointer + \"/json\");\n var itemRequest = new AjaxGetPromise(\"server.php?url=\" + endpointString);\n return itemRequest\n .then(JSON.parse)\n .then(function(parsedResponse) {\n return parsedResponse;\n })\n .catch(function(error) {\n return error;\n });\n }", "title": "" }, { "docid": "2d688e905053df05289e7b97c4a98d1f", "score": "0.6045176", "text": "function SiteCatalyst_GetAllShoppingListItemDescriptions() \n{\n // Declare the string.\n var ShoppingListItems = new String(\"\");\n var sItemId = new String(\"\");\n \n // Loop through the array\n for (var index=0; index < mSiteCatalystShoppingListItems.length; index++)\n {\n var shoppingListItemInfo = mSiteCatalystShoppingListItems[index];\n if (shoppingListItemInfo != null)\n {\n if ((shoppingListItemInfo.itemTypeId != 2) \n && (shoppingListItemInfo.itemTypeId != 9) \n && (shoppingListItemInfo.itemTypeId != 10) \n && (shoppingListItemInfo.itemTypeId != 13))\n {\n sDescription = shoppingListItemInfo.description;\n if ((sDescription != null) \n && (sDescription.length > 0))\n {\n if (ShoppingListItems.length > 0)\n {\n ShoppingListItems = ShoppingListItems + \",\";\n }\n ShoppingListItems = ShoppingListItems + sDescription;\n }\n }\n }\n }\n \n return ShoppingListItems;\n}", "title": "" }, { "docid": "6d41c75397488657d0c86c29e835eeca", "score": "0.6043312", "text": "function displayItems() {\n db.product.list(promptPurchase, products);\n}", "title": "" }, { "docid": "dbd462dd5c7a4a01d805f90e94017ced", "score": "0.6036863", "text": "function loadDetails(item) {\n\t\tvar url = item.detailsUrl;\n\t\treturn fetch(url).then(function (response) {\n\t\t return response.json();\n\t\t}).then(function (details) {\n\t\t // Now we add the details to the item\n\t\t item.imageUrl = details.sprites.front_default;\n\t\t item.height = details.height;\n\t\t //item.types = Object.keys(details.types);\n\t\t if (details.types.length === 2 ) {\n\t\t\t\t\titem.types = [details.types[0].type.name, details.types[1].type.name];\n\t\t\t\t} else {\n\t\t\t\t\titem.types = [details.types[0].type.name];\n\t\t\t\t}\n\t\t}).catch(function (e) {\n\t\t console.error(e);\n\t\t});\n\t }", "title": "" }, { "docid": "6840cfbaec75c96b1354b285b1ae1225", "score": "0.60150355", "text": "function loadDetails(item) {\n var $url = item.detailsUrl;\n return $.ajax($url)\n .then(function(details) {\n // Now we add the details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.types = Object.keys(details.types);\n })\n .catch(function(e) {\n console.error(e);\n });\n }", "title": "" }, { "docid": "787f07076673132934ed8d10c0681e12", "score": "0.6014712", "text": "function SiteCatalyst_InitializeShoppingListDetailsEvent(response) \n{\n // Get the data\n var siteCatalystDataList = response.d;\n\n // Loop through the data.\n for(var index = 0; index < siteCatalystDataList.length; index++)\n {\n // get the item.\n var siteCatalystData = siteCatalystDataList[index];\n if (siteCatalystData != null)\n {\n // Get the site catalyst data.\n var itemId = siteCatalystData.itemId;\n var itemType = siteCatalystData.itemType;\n var description = siteCatalystData.description;\n \n // Post the data to site catalyst.\n SiteCatalyst_InsertShoppingListItem(itemId, itemType, description);\n }\n }\n}", "title": "" }, { "docid": "bb029dd747aab2a6c15335a67c092ebc", "score": "0.6004204", "text": "function loadDetails(item) {\n var url = item.detailsUrl;\n return $.ajax(url, { dataType: 'json' }).then(function (details) {\n // Now we add the details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n\n if (details.types.length == 2 ) {\n item.types = [details.types[0].type.name, details.types[1].type.name];\n } else {\n item.types = [details.types[0].type.name];\n }\n }).catch(function (e) {\n /* eslint-disable no-console */\n console.error(e);\n /* eslint-enable no-console */\n });\n }", "title": "" }, { "docid": "2f51542d18e105f51f4a1a465d5c7010", "score": "0.5998633", "text": "function getItemDetails(event, ui) {\n\n\t$.get(\"/sale_item_lookup\", {\n\t\titemId : ui.item.value,\n\t\tlocationId : txn_locationId\n\t}, function(data, status) {\n\n\t\ttxnAction.showSaleLineItem(data);\n\t\treCalculateTenders();\n\t\t\n\t});\n\n\t$('#searchText').val('');\n\n}", "title": "" }, { "docid": "9d650bc8a5dd3d70aa2a02fade7d2ad4", "score": "0.5996338", "text": "function getItemDescription(listingID) {\n let itemToReturn = {\n price: listing[listingID].price,\n blurb: listing[listingID].blurb\n };\n return itemToReturn;\n}", "title": "" }, { "docid": "80f07f4ffc8f1c31f34ca103c4adc328", "score": "0.5996155", "text": "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url).then(function (response){\n return response.json();\n }).then(function (details) {\n //adds details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n // calls the types array\n item.types = details.types[0].type.name;\n }).catch(function (e) {\n console.error(e);\n });\n }", "title": "" }, { "docid": "9276b58ef891d6052c0e39203eda80e3", "score": "0.5988328", "text": "static async getItemDetails(item) {\n\t\tthis.cleanItem(item);\n\n\t\tlet promises = [];\n\t\tlet filmsKey = Constants.items.films;\n\t\tif (filmsKey in item) {\n\t\t\tpromises.push(this.getAllItems(filmsKey, item));\n\t\t}\n\t\t\n\t\tlet speciesKey = Constants.items.species;\n\t\tif (speciesKey in item) {\n\t\t\tpromises.push(this.getAllItems(speciesKey, item));\n\t\t}\n\t\t\n\t\tlet peopleKey = Constants.items.people;\n\t\tlet aliases = Constants.peopleAliases;\n\t\t\n\t\taliases.forEach((alias) => {\n\t\t\tif (alias in item) {\n\t\t\t\tpromises.push(this.getAllItems(peopleKey, item, alias));\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn await Promise.all(promises);\n\t}", "title": "" }, { "docid": "2a288f8150d66886b37321d3a1c26019", "score": "0.59751105", "text": "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url)\n .then(function (response) {\n return response.json();\n })\n .then(function (details) {\n //add details to item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.types = \"\";\n details.types.forEach(function (result) {\n item.types += result.type.name + \" \";\n });\n })\n .catch(function (e) {\n console.error(e);\n });\n }", "title": "" }, { "docid": "e6f6d52b75664c4f94464eedd8d988eb", "score": "0.59676164", "text": "function parseShoppingList(){\n var encodeURIShoppingList = window.location.hash.substr(1);\n console.log(encodeURIShoppingList);\n var jsonShoppingList = decodeURIComponent(encodeURIShoppingList);\n var parsedShoppingList = JSON.parse(jsonShoppingList);\n var itemInfo = \"\";\n parsedShoppingList.forEach(getShoppingListInfo);\n document.getElementById(\"parsedShoppingList\").innerHTML = itemInfo;\n\n function getShoppingListInfo(shoppingItem){\n itemInfo += shoppingItem.name + shoppingItem.amount + \"<br>\";\n }\n}", "title": "" }, { "docid": "634d7a802e50aa24fa07f21e330e3ec9", "score": "0.5967408", "text": "function loadDetails(item) {\n const url = item.detailsUrl;\n return fetch(url).then(response => {\n return response.json();\n }).then(details => {\n //add details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.types = [];\n for (let i = 0; i < details.types.length; i++){\n item.types.push(details.types[i].type.name);\n }\n }).catch(function(e) {\n console.error(e);\n })\n }", "title": "" }, { "docid": "2afc9466d5403677781a793102bddee2", "score": "0.59666455", "text": "function loadDetails(item) {\n var url = item.detailsUrl;\n return $.ajax(url)\n .then(function(details) {\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n\n item.types = [];\n\n $.each(details.types, function(i, types) {\n $.each(types.type, function(property, value) {\n if (property == 'name') {\n item.types.push(value);\n }\n });\n });\n })\n .catch(function(e) {\n alert(e.message);\n });\n }", "title": "" }, { "docid": "af579fa0031c56ed97365bd98583ca36", "score": "0.5957128", "text": "function showSourceDetails()\n{\n var listID = decodeURIComponent(getQueryStringParameter(\"SPListId\"));\n itemID = decodeURIComponent(getQueryStringParameter(\"SPListItemId\"));\n lists = hostWeb.get_lists();\n list = lists.getById(listID);\n listItem = list.getItemById(itemID);\n context.load(lists);\n context.load(list);\n context.load(listItem);\n context.executeQueryAsync(\n function () {\n if (list.get_title() == \"Ideas\") {\n $('#sourceItemTitle').text(listItem.get_item(\"Title\"));\n $('#sourceItemDescription').text(listItem.get_item(\"Description\"));\n $('#taggedItemTitle').text(listItem.get_item(\"Title\"));\n $('#taggedItemDescription').text(listItem.get_item(\"Description\"));\n }\n else {\n $('#configPanel').show();\n $('#searchPanel').hide();\n $('#tagsPanel').hide();\n operation = \"\";\n }\n },\n function (sender, args) {\n renderError(args.get_message());\n $('#searchPanel').show();\n }\n );\n}", "title": "" }, { "docid": "4760631562780a4e22db0b40d20fb0b6", "score": "0.5949093", "text": "function getItem(type, name, linenum)\r\n{\r\n\r\n\t\r\n\tgetFormInformation();\r\n\r\n\t// Back office only\r\n\tif (name == 'custbody_order_offers' && promotionCodeEnteredByUser.length > 0)\r\n\t{\r\n\r\n\t\t// check if the campaign is valid 1.4.4\r\n\t\tif(runSavedSearchCampaigns(promotionCodeEnteredByUser, 0) == true)\r\n\t\t{\r\n\t\t\t// 1.5.3 Set the current campaign as the lead source\r\n\t\t\tvar campaignId = genericSearch('campaign', 'title', derivedCampaignCode);\r\n\t\t\tnlapiSetFieldValue('leadsource', campaignId, false, true);\r\n\t\t\t\r\n\t\t\tfetchOffers();\r\n\t\t\tupdateScreenErrorInformation();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\talert('Please enter a valid campaign code.');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Web only - apply offers if this field changes\r\n\tif (name == 'custbody_applied_order_offers_string')\r\n\t{\r\n\t\t// Reset JavaScript output\r\n\t\tnlapiSetFieldValue('custbody_js', '', false, true);\r\n\t\t\r\n\t\tlookUpCampaignCode();\t\t// 1.5.3\r\n\t\tstorePromoCodesWeb(name);\r\n\t\tapplyOffers();\r\n\t\tcalcShipping(); // 1.4.6 mrf_shipping.js\r\n\t\tcartLineBugWorkaround(); // 1.3.9\r\n\t\tupdateScreenErrorInformation();\r\n\t}\r\n\r\n\r\n}", "title": "" }, { "docid": "b2c3ced462a28150eb636a7215303cc3", "score": "0.5941742", "text": "function list_cart_items() { \r\n\tvar location_id = CheckNumeric(document.getElementById(\"txt_location_id\").value); \r\n\tvar status = document.getElementById(\"txt_status\").value;\r\n\tvar cart_session_id = CheckNumeric(document.getElementById(\"txt_session_id\").value); \r\n\t// From po,git,grn To git,grn,pr \r\n\tvar voucherclass_id = CheckNumeric(document.getElementById(\"txt_voucherclass_id\").value); \r\n\tvar vouchertype_id = CheckNumeric(document.getElementById(\"txt_vouchertype_id\").value); \r\n\tvar voucher_dcr_request_id = CheckNumeric(document.getElementById(\"txt_voucher_dcr_request_id\").value);\r\n\tvar voucher_dcr_id = CheckNumeric(document.getElementById(\"txt_voucher_dcr_id\").value); \r\n\tvar voucher_grn_return_id = CheckNumeric(document.getElementById(\"txt_voucher_grn_return_id\").value); \r\n\tshowHintFootable('../accounting/returns-details.jsp?cart_session_id='+ cart_session_id+'&status='+status+'&location_id='+location_id \r\n\t\t\t+ '&cart_vouchertype_id='+ vouchertype_id \r\n\t\t\t+ '&voucherclass_id='+ voucherclass_id \r\n\t\t\t+ '&voucher_dcr_request_id='+voucher_dcr_request_id+ '&voucher_dcr_id='+voucher_dcr_id+'&voucher_grn_return_id='+voucher_grn_return_id \r\n\t\t\t+ '&list_cartitems=yes', 'invoice_details'); \r\n}", "title": "" }, { "docid": "8100f4a1f9395ee7b0bc3b69c3a21c62", "score": "0.59376097", "text": "function setItemDetails() {\n if (app.dinamicType == \"SEARCHABLE_BILL\" || app.dinamicType == \"NON_SEARCHABLE_BILL\") {\n var k = app.dinamicOptionKey;\n app.dinamicPItemId = app.billArray[k][\"pItemId\"];\n var details =\n '<table class=\"table table-striped\">' +\n '<tbody>' +\n '<tr>' +\n '<td>Amount:</td>' +\n '<td>' + app.billArray[k][\"amount\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Penalty:</td>' +\n '<td>' + app.billArray[k][\"penalty\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Bill Number:</td>' +\n '<td>' + app.billArray[k][\"billNum\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Date: </td>' +\n '<td>' + app.billArray[k][\"date\"][\"date\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Due date: </td>' +\n '<td>' + app.billArray[k][\"dueDate\"][\"date\"] + '</td>' +\n '</tr>' +\n '</tbody>' +\n '</table>' +\n '<a href=\"#\" class=\"btn btn-block\" id = \"quote\" style=\"background-color:orange; color:white\" onClick = \"getQuote(' + app.billArray[k][\"amount\"] + ', \\'' + app.billArray[k][\"merchant\"] + '\\')\"> Get a Quote </a>';\n\n return details;\n }\n else if (app.dinamicType == \"TOPUP\" || app.dinamicType == \"CASHIN\") {\n\n var k = app.dinamicOptionKey;\n app.dinamicPItemId = app.topupArray[k][\"pay_item_id\"];\n\n if (app.topupArray[k][\"amount_type\"] == \"FIXED\") {\n\n var details =\n '<table class=\"table table-striped\">' +\n '<tbody>' +\n '<tr>' +\n '<td>Amount:</td>' +\n '<td>' + app.topupArray[k][\"amount_local_cur\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Currency:</td>' +\n '<td>' + app.topupArray[k][\"local_cur\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Offer: </td>' +\n '<td>' + app.topupArray[k][\"name\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Description: </td>' +\n '<td>' + app.topupArray[k][\"description\"] + '</td>' +\n '</tr>' +\n '</tbody>' +\n '</table>' +\n '<a href=\"#\" class=\"btn btn-block\" id = \"quote\" style=\"background-color:orange; color:white\" onClick = \"getQuote(' + app.topupArray[k][\"amount_local_cur\"] + ', \\'' + app.topupArray[k][\"merchant\"] + '\\')\"> Get a Quote </a>';\n\n } else {\n var details =\n '<div class=\"form-group\">' +\n '<input type=\"text\" class=\"form-control\" name=\"txt-amount\" id=\"txt-amount\" placeholder=\"Amount\" required>' +\n '</div>' +\n '<table class=\"table table-striped\">' +\n '<tbody>' +\n '<tr>' +\n '<td>Currency:</td>' +\n '<td>' + app.topupArray[k][\"local_cur\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Offer: </td>' +\n '<td>' + app.topupArray[k][\"name\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Description: </td>' +\n '<td>' + app.topupArray[k][\"description\"] + '</td>' +\n '</tr>' +\n '</tbody>' +\n '</table>' +\n '<a href=\"#\" class=\"btn btn-block\" id = \"quote\" style=\"background-color:orange; color:white\" onClick = \"callQuoteMethod()\"> Get a Quote </a>';\n\n }\n\n\n return details;\n }\n\n else if (app.dinamicType == \"PRODUCT\") {\n\n var k = app.dinamicOptionKey;\n app.dinamicPItemId = app.productArray[k][\"pay_item_id\"];\n\n if (app.productArray[k][\"amount_type\"] == \"FIXED\") {\n\n var details =\n '<table class=\"table table-striped\">' +\n '<tbody>' +\n '<tr>' +\n '<td>Amount:</td>' +\n '<td>' + app.productArray[k][\"amount_local_cur\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Currency:</td>' +\n '<td>' + app.productArray[k][\"local_cur\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Offer: </td>' +\n '<td>' + app.productArray[k][\"name\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Description: </td>' +\n '<td>' + app.productArray[k][\"description\"] + '</td>' +\n '</tr>' +\n '</tbody>' +\n '</table>' +\n '<a href=\"#\" class=\"btn btn-block\" id = \"quote\" style=\"background-color:orange; color:white\" onClick = \"getQuote(' + app.productArray[k][\"amount_local_cur\"] + ', \\'' + app.productArray[k][\"merchant\"] + '\\')\"> Get a Quote </a>';\n\n } else {\n\n var details =\n '<div class=\"form-group\">' +\n '<input type=\"text\" class=\"form-control\" name=\"txt-amount\" id=\"txt-amount\" placeholder=\"Amount\" required>' +\n '</div>' +\n '<table class=\"table table-striped\">' +\n '<tbody>' +\n '<tr>' +\n '<td>Currency:</td>' +\n '<td>' + app.productArray[k][\"local_cur\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Offer: </td>' +\n '<td>' + app.productArray[k][\"name\"] + '</td>' +\n '</tr>' +\n '<tr>' +\n '<td>Description: </td>' +\n '<td>' + app.productArray[k][\"description\"] + '</td>' +\n '</tr>' +\n '</tbody>' +\n '</table>' +\n '<a href=\"#\" class=\"btn btn-block\" id = \"quote\" style=\"background-color:orange; color:white\" onClick = \"callQuoteMethod()\"> Get a Quote </a>';\n\n }\n\n\n return details;\n }\n\n}", "title": "" }, { "docid": "d417ac044b6435898496204ca9c2bb1d", "score": "0.5935161", "text": "function filterRequestItems () {\n gs.print(\"Getting items as :\" + gs.getUserName() + \":\" + gs.getUserID()); \n var availableItems = [],table = \"sc_cat_item\",catItem = new GlideRecord(table); \n catItem.addActiveQuery(); \n catItem.query(); //For each Catalog item \n gs.print (\"row count is:\" + catItem.getRowCount());\n while ( catItem.next() ) {\n //carbon 04b7e94b4f7b4200086eeed18110c7fd \n var item = GlideappCatalogItem.get(catItem.sys_id + ''); \n \n if ( item != null && item.canView() && catItem.getClassDisplayValue() == table ) {\n availableItems.push(catItem.sys_id + '');\n } \n } \n //Return the advanced Ref Qualifier \n return 'sys_idIN' + availableItems; \n}", "title": "" }, { "docid": "e1bbeb02cd66f4092fbd7d3c937b8892", "score": "0.5934763", "text": "function getItems(){\n $.ajax({\n url: 'https://woofshop.herokuapp.com/items',\n headers: {\n 'Content-Type':'application/json'\n },\n method: 'GET',\n success: function(data){\n itemsFromData = data\n createItemCards(getItemsWithFilter(data));\n },\n error: function(error_msg) {\n var err = (error_msg.responseText)\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "64904812ff1456bd1a611fb32951aa64", "score": "0.59344405", "text": "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(details) {\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n item.types = details.types;\n\n //ARRAY to loop throgh the item of types\n item.types = []; // let pokemonTypes =[];\n details.types.forEach(function(pokemon) {\n item.types.push(cap(pokemon.type.name));\n //pokemonTypes.push(pokemon.type.name);\n });\n // join function to add a space between the items\n let types = item.types.join(', '); //let types = pokemonTypes.join(', ')\n item.types = types;\n })\n .catch(function(e) {\n console.log(e);\n });\n }", "title": "" }, { "docid": "38bd217a1b453df141f29243a56476c0", "score": "0.58999854", "text": "function get_item (sku) {\n var product = null;\n for (p_ind in products){\n if (products[p_ind]['sku'] == sku) {\n product = products[p_ind];}\n }\n return product;\n}", "title": "" }, { "docid": "daf046158a46bdc70e91efb0c69dfc19", "score": "0.5899628", "text": "function getShoppingList()\n {\n var userData = getUserData();\n\n return userData.shoppingList;\n }", "title": "" }, { "docid": "686d42686d3859eb043d9d1bd36ea6e1", "score": "0.58990544", "text": "function fetchDetail(props){\n var busno =document.getElementById('Busno').value\n var printThis=\"\";\n if(data[busno]!==undefined){\n for(var i=0;i<data[busno].length;i++){\n printThis+=i+1+\". \"+\"<CollectionItem>\"+data[busno][i]+\"</CollectionItem>\"+\"<br>\";\n }\n }\n else{\n printThis=\"NO BUS FOUND\";\n }\n document.getElementById('list').innerHTML=printThis;\n}", "title": "" }, { "docid": "8112ea8bce979f7b7075ac5cb7570dc2", "score": "0.58903086", "text": "function populateItemPage()\n{\n var itemID = getCurrentItem();\n var itemToView;\n \n //get item object \n for(var i = 0; i < storeItems.length; i++)\n {\n if(itemID == storeItems[i].getItemID())\n {\n itemToView = storeItems[i];\n }\n }\n \n //populate page with values\n \n document.getElementById(\"itemName\").innerHTML = itemToView.getItemDescription();\n document.getElementById(\"itemImage\").setAttribute(\"src\", itemToView.getImage());\n document.getElementById(\"itemPrice\").innerHTML = \"€\" + itemToView.getItemPrice();\n \n}", "title": "" }, { "docid": "f0ffc1b02acf017de58c6c30f2060133", "score": "0.5855101", "text": "function loadDetails(item) {\n var url = item.detailsUrl;\n return fetch (url). then(function (response) {\n return response.json();\n }).then (function (details) {\n // Add details of the item\n item.image.url = details.sprites.front_default;\n item.height = details.height;\n item.types = details.types;\n}).catch(function (e) {\n console.error(e);\n});\n}", "title": "" }, { "docid": "48a23f7e4953ae46ba10b497c72c9fdf", "score": "0.5852327", "text": "function getResults(item) {\n var concatenatedUrl = 'https://openapi.etsy.com/v2/listings/active.js?keywords=' + item + '&limit=12&includes=Images:1&api_key=' + 'dk88st01cks0as9cv2iwr4hg';\n var result = $.ajax({\n url: concatenatedUrl,\n dataType: 'jsonp',\n //type: 'GET'\n })\n\n .done(function (result) {\n console.log(result);\n $('.item-details').html('');\n var itemResults = \"\";\n\n $.each(result.results, function (i, item) {\n\n itemResults += '<li>';\n itemResults += '<h2>' + item.title + '</h2>';\n itemResults += '<a href = ' + item.url + ' target=\"_blank\">';\n itemResults += '<div class = \"product-image\" style=\"background-image: url(' + item.Images[0].url_fullxfull + ')\"></div>';\n itemResults += '</a>';\n itemResults += '<div class = \"product-details\">';\n itemResults += '<h3> ' + item.description + '</h3>';\n itemResults += '</div>';\n itemResults += '</li>';\n\n });\n\n $('.item-details').append(itemResults);\n\n });\n }", "title": "" }, { "docid": "dc79696a8e43f68e90be9478b371e8a8", "score": "0.58490616", "text": "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(details) {\n // Now we add the details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n item.types = [];\n for (let i = 0; i < details.types.length; i++) {\n item.types.push(details.types[i].type.name);\n }\n item.abilities = [];\n for (let i = 0; i < details.abilities.length; i++) {\n item.abilities.push(details.abilities[i].ability.name);\n }\n })\n .catch(function(e) {\n /* eslint-disable no-console */\n console.error(e);\n /* eslint-enable no-console */\n });\n }", "title": "" }, { "docid": "37b75c16063e8f077de6c87e75cce51f", "score": "0.58306897", "text": "function OnSuccess() {\n var enumerator = listItemCollection.getEnumerator();\n // iterating data from listItemCollection\n while (enumerator.moveNext()) {\n var results = enumerator.get_current();\n // data can be utilized here.. \n console.log(results.get_item(\"ID\") + ' -- ' + results.get_item(\"Title\"));\n }\n }", "title": "" }, { "docid": "c1ae9a534a86d9cdfab98c15bd7a797f", "score": "0.58202916", "text": "getItemCustom1Detail(item) {\n return item.PlaceMenuItem.custom_1_detail\n ? item.PlaceMenuItem.custom_1_detail\n : ''\n }", "title": "" }, { "docid": "028cd848c6e3c26a758af898bb9f7992", "score": "0.5807768", "text": "function getListItem(url, idFlag) {\n var ListItem = \"\";\n $.ajax({\n url: _spPageContextInfo.webAbsoluteUrl + url,\n type: \"GET\",\n async: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n }, success: function (data) {\n if (idFlag) {\n ListItem = data.d;\n }\n else {\n ListItem = data.d.LoginName;\n }\n },\n error: function (data) {\n //AddErrorLog(\"getListItem\", data.message);\n }\n });\n return ListItem;\n}", "title": "" }, { "docid": "976555719b9c4ad3b328c7a50f3523d8", "score": "0.5784792", "text": "getItemCustom2Detail(item) {\n return item.PlaceMenuItem.custom_2_detail\n ? item.PlaceMenuItem.custom_2_detail\n : ''\n }", "title": "" }, { "docid": "9b7ae6f3128fd3d5fb920f7bf91f980e", "score": "0.57678974", "text": "function getItemInfo(obj){\n\tif(obj.value != \"\"){\n\t\tvar formObj=document.form;\n\t\t// Contract No 체크\n\t\tif (isNull(formObj.ctrt_no)) {\n\t\t\tComShowCodeMessage(\"COM0278\", \"Contract No\");\n\t\t\treturn;\n\t\t}\n\t\t/*$.ajax({\n\t\t\turl : \"searchWHItemCodeInfo.clt?ctrt_no=\"+ComGetObjValue(formObj.ctrt_no) + \"&item_cd=\" + obj.value,\n\t\t\tsuccess : function(result) {\n\t\t\t\tif(getXmlDataNullToNullString(result.xml,'exception_msg')!=\"\"){\n\t\t\t\t\talert(getXmlDataNullToNullString(result.xml,'exception_msg'));\n\t\t\t\t}\n\t\t\t\tresultItemInfo(result.xml);\n\t\t\t}\n\t\t});*/\n\t\tajaxSendPost(resultItemInfo, 'reqVal', '&goWhere=aj&bcKey=searchWHItemCodeInfo&ctrt_no='+formObj.ctrt_no.value+ \"&item_cd=\" + obj.value, './GateServlet.gsl');\n\t}\n\telse\n\t{\n\t\t$(\"#item_nm\").val(\"\");\n\t}\n}", "title": "" }, { "docid": "ff8538a12680c333e397c5471f419900", "score": "0.57577175", "text": "getProductData(e) {\n return instance.get('/api/item/' + e)\n }", "title": "" }, { "docid": "22b4807694ee248797cdd9a39eec7834", "score": "0.5755888", "text": "function extractItemDetails(item) {\n const { name, external_urls: { spotify: spotify_url} } = item;\n const artist_details = extractArtistDetails(item);\n const image_details = extractImageDetails(item);\n const track_details = extractTrackDetails(item);\n\n return {\n name,\n spotify_url,\n ...artist_details,\n ...image_details,\n ...track_details\n };\n}", "title": "" }, { "docid": "c8d6d473a634201718e519b8b1091347", "score": "0.5753727", "text": "function loadDetails(item) {\n var url = item.detailsUrl;\n return $.ajax(url)\n .then(function(response) {\n item.imageUrl = response.sprites.front_default;\n item.height = response.height;\n item.types = Object.keys(response.types);\n item.weight = response.weight;\n })\n .catch(function(e) {\n console.error(e);\n /* eslint-enable no-console */\n });\n }", "title": "" }, { "docid": "adb6b0f527ef6724f3f7e5a67ece26d5", "score": "0.5746149", "text": "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url)\n .then(function (response) {\n return response.json();\n })\n .then(function (details) {\n item.imageUrl = details.sprites.other.dream_world.front_default;\n item.height = details.height;\n item.types = [];\n details.types.forEach(function (pokemonType) {\n item.types.push(pokemonType.type.name);\n });\n item.abilities = [];\n details.abilities.forEach(function (pokemonAbility) {\n item.abilities.push(pokemonAbility.ability.name);\n });\n })\n .catch(function (e) {\n console.error(e);\n });\n }", "title": "" }, { "docid": "f42edb626dbb41be968b2d248f8445f1", "score": "0.5730715", "text": "function SiteCatalyst_AddYourOwnToShoppingList(itemId, itemType, description) \n{\n var s = s_gi(mSiteCatalystInfo.ReportSuiteId);\n s.linkTrackVars = 'events,eVar22,eVar24,eVar25';\n s.linkTrackEvents = 'event32';\n s.prop22 = itemId;\n s.eVar22 = s.prop22;\n s.prop24 = itemType;\n s.eVar24 = s.prop24;\n s.prop25 = description;\n s.eVar25 = s.prop25;\n s.events = 'event32';\n s.tl(this, 'o', 'Add Your Own Item To Shopping List');\n}", "title": "" }, { "docid": "7721083fa8a79cf746b08f74b8ebce15", "score": "0.57178754", "text": "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url)\n .then(function (response) {\n return response.json();\n })\n .then(function (details) {\n // Now we add the details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n item.abilities = details.abilities;\n item.types = details.types;\n })\n .catch(function (e) {\n console.error(e);\n });\n }", "title": "" }, { "docid": "794397480c3041c3a6b557b01a052fb3", "score": "0.5713579", "text": "get url() { return \"product-details\"; }", "title": "" }, { "docid": "5eb4c4045f71319f3a64b1f9239341d8", "score": "0.5708033", "text": "async function list_Item(){\n let _name= listItemNameField.value;\n let _price= listItemPriceField.value;\n let _quantity= listItemQuantityField.value;\n window.web3 = await Moralis.Web3.enable();\n let contractInstance = new web3.eth.Contract(window.abi, \"0xcF2E4550d68bF506Dd5E7B33073260eC3816D252\")\n contractInstance.methods.listItem(_name, _price, _quantity).send({from: ethereum.selectedAddress, value:0})\n .on('receipt', function(receipt){\n console.log(receipt);\n alert(receipt.events.newProduct.returnValues);\n })\n }", "title": "" }, { "docid": "3a91acd64c428c125385b2b4a541f6c1", "score": "0.5707511", "text": "function details() {\n\n var storeID = request.httpParameterMap.StoreID.value;\n var store = dw.catalog.StoreMgr.getStore(storeID);\n\n var pageMeta = require('*/cartridge/scripts/meta');\n pageMeta.update(store);\n\n app.getView({Store: store})\n .render('storelocator/storedetails');\n\n}", "title": "" }, { "docid": "65155c501277136e54dfe1f5582e3219", "score": "0.57048947", "text": "function get_the_menu_cart_summary(){\n\t$.ajax({\n type:\"get\",\n url:'shopping_cart.php',\n data:{ get_cart_summary:\"get\" },\n beforeSend:function (request){ },\n success:function(result){\n \t$('#menu_cart_preview').html(result);\n },\n error:function (xhr, ajaxOptions, thrownError){\n \tconsole.log('error trying to add item');\n }\n });\n\t//end of getting the cart summary\n}", "title": "" }, { "docid": "8742aa22469042afc774bee3cae4bd5c", "score": "0.56879807", "text": "function SiteCatalyst_GetAllShoppingListCouponDescriptions() \n{\n // Declare the string.\n var ShoppingListItems = new String(\"\");\n var sItemId = new String(\"\");\n \n // Loop through the array\n for (var index=0; index < mSiteCatalystShoppingListItems.length; index++)\n {\n var shoppingListItemInfo = mSiteCatalystShoppingListItems[index];\n if (shoppingListItemInfo != null)\n {\n if ((shoppingListItemInfo.itemTypeId == 2) \n || (shoppingListItemInfo.itemTypeId == 9) \n || (shoppingListItemInfo.itemTypeId == 10) \n || (shoppingListItemInfo.itemTypeId == 13))\n {\n sDescription = shoppingListItemInfo.description;\n if ((sDescription != null) \n && (sDescription.length > 0))\n {\n if (ShoppingListItems.length > 0)\n {\n ShoppingListItems = ShoppingListItems + \",\";\n }\n ShoppingListItems = ShoppingListItems + sDescription;\n }\n }\n }\n }\n \n return ShoppingListItems;\n}", "title": "" }, { "docid": "ada602d0efc7fbbcdc4af0c08172cedc", "score": "0.5678994", "text": "function showDetails(item) {\n pokemonRepository.loadDetails(item).then(function () {\n console.log(item);\n });\n}", "title": "" }, { "docid": "34c3aa97c8ec7b31c6096d09fa055ac3", "score": "0.56743693", "text": "function getPOIdetails (id){\r\nconsole.log(id);\r\n\r\nvar url=\"https://www.triposo.com/api/20200405/property.json?poi_id=\"+id+\"&fields=name,value&account=I0OEOPWQ&token=0d843xcrheh2r5cz6qj5a0b1kos2qjbp\";\r\nfetch(url)\r\n.then( response => {\r\n return response.json();\r\n}).then(data =>{\r\n \r\n \r\nbuildLocationList(data);\r\n\r\n /**\r\n * Add a listing for each store to the sidebar.\r\n **/\r\n function buildLocationList(data) {\r\n var listings = document.getElementById('poi-details');\r\n\r\n data.results.forEach(function(store, i){\r\n\r\n var prop = store;\r\n\r\n\r\n var listing = listings.appendChild(document.createElement('div'));\r\n \r\n listing.className = 'item';\r\n var link = listing.appendChild(document.createElement('h3'));\r\n\r\n link.innerHTML = prop.name;\r\n var details = listing.appendChild(document.createElement('div'));\r\n link.className = \"info-type\";\r\n \r\n details.innerHTML = prop.value;\r\n details.className = \"info-detail\";\r\n //details.innerHTML = prop.booking_info.price.amount+' '+prop.booking_info.price.currency;\r\n\r\n\r\n });\r\n }\r\n\r\n\r\n})\r\n}", "title": "" }, { "docid": "c711004f34f885bb586be22157e8c2d4", "score": "0.5674353", "text": "function SiteCatalyst_AddIngredientItemToShoppingList(itemId, itemType, description) \n{\n var s = s_gi(mSiteCatalystInfo.ReportSuiteId);\n s.linkTrackVars = 'events,eVar22,eVar24,eVar25';;\n s.linkTrackEvents = 'event47';\n s.prop22 = itemId;\n s.eVar22 = s.prop22;\n s.prop24 = itemType;\n s.eVar24 = s.prop24;\n s.prop25 = description;\n s.eVar25 = s.prop25;\n s.events = 'event47';\n s.tl(this, 'o', 'Add Ingredient Item To Shopping List');\n}", "title": "" }, { "docid": "b7a36916f564c12e0814529f7f695225", "score": "0.5674336", "text": "function extractUsefulData (etsyItem) {\n var title = etsyItem.title;\n var image = etsyItem.Images[0].url_75x75;\n var storeName = etsyItem.Shop.shop_name;\n var storeUrl = etsyItem.Shop.url;\n var price = etsyItem.price;\n var url = etsyItem.url;\n\n return {\n title: title,\n image: image,\n store: storeName,\n storeUrl: storeUrl,\n url: url,\n price: price\n };\n}", "title": "" }, { "docid": "43133e579ebba8ca57c791f4778f0a53", "score": "0.56690717", "text": "openItemDetails(item){if(!this._isDetailsOpened(item)){this.push('detailsOpenedItems',item);}}", "title": "" }, { "docid": "0c5e3bc3bdc294659143c9641fa757e8", "score": "0.56489545", "text": "get itemPriceFromList () { return this.productContainer.$('div.desktop-price-cart-btn>div.media-component>div.product-price-and-logo>div>div>span:nth-of-type(1)') }", "title": "" }, { "docid": "ac3a8b1cdbbd383a88d49adc991e1127", "score": "0.563356", "text": "function getItemDescription(listingID) {\n let itemDescription = {\n price: globalInventory[listingID].price,\n description: globalInventory[listingID].description\n };\n return itemDescription;\n}", "title": "" }, { "docid": "84ba55456cee2e1f583aee6e9201f956", "score": "0.5630463", "text": "findProductID() {\n // object data for the cart\n const data = {\n lineItems: [],\n locale: 'en',\n };\n\n // loop through every item in the page and add them to the lineItems array.\n $('.productGrid li').each(function () {\n const item = $(this).find('.quickview');\n const itemId = parseInt($(item[0]).attr('data-product-id'));\n\n data.lineItems.push({\n quantity: 1,\n productId: itemId,\n optionSelections: [],\n });\n });\n\n return data;\n }", "title": "" }, { "docid": "3c68f6e09595b09467da3c45f847e201", "score": "0.5622813", "text": "function fillItemInfo(itemId) {\n $.ajax({\n type: \"get\",\n url: \"api/getItemInfo.php\",\n dataType: \"json\",\n data: {\n 'item_id' : itemId,\n },\n success: function(data, status) {\n // console.log(data);\n\n //fill in information about item selected\n var item = data[0];\n $('#pageTitle').html(item['item_name'] + \" Review Page\");\n $('#itemLogoImage').attr('src', 'img/'+item['item_image_url']);\n $('#itemName').html(\"<a href='//\" + item['item_name'] + \"'>\" + item['item_name'] + \"<a>\");\n $('#itemDescription').html(item['item_description']);\n },\n error: function(error) {\n console.log(error);\n $('#error').html(error['responseText']);\n },\n complete: function(data, status) {\n //console.log(status);\n },\n });\n}", "title": "" }, { "docid": "05c2d90629a3ce86818812b42f293379", "score": "0.5614788", "text": "function get_product_page(value) {\n return \"product.html\" + \"?name=\" + value.name + \"&supplier=\" + value.supplier + \"&quantity=\" + value.quantity + \"&unit_cost=\" + value.unit_cost\n}", "title": "" }, { "docid": "8757e79c8e39bbe5969a23108d23841a", "score": "0.56115955", "text": "function suiteletFunction_poprofit(request, response)\r\n{\r\n\r\n\t/* Suitelet:\r\n\t - EXPLAIN THE PURPOSE OF THIS FUNCTION\r\n\t -\r\n\t FIELDS USED:\r\n\t --Field Name--\t\t\t\t--ID--\r\n\t */\r\n\t// LOCAL VARIABLES\r\n\t\r\n\t\r\n\t// SUITELET CODE BODY\r\n\t\r\n\tif (request.getMethod() == 'GET') \r\n\t{\r\n\t\tvar form = nlapiCreateForm('Purchase Order Profitability');\r\n\t\t\r\n\t\tform.setScript('customscript_cli_po_profit_report');\r\n\t\t\r\n\t\tvar purchaseOrdersearch = request.getParameter('purchaseOrdersearch');\r\n\t\t\r\n\t\tvar o_posearch_Obj = form.addField('custpage_puchaseordersearch', 'text', 'Purchase Order Search');\r\n\t\t\r\n\t\tvar o_po_Obj = form.addField('custpage_puchaseorder', 'Select', 'Purchase Order');\r\n\t\to_po_Obj.addSelectOption('', '')\r\n\t\t\r\n\t\tif (purchaseOrdersearch != null && purchaseOrdersearch != '' && purchaseOrdersearch != undefined) \r\n\t\t{\r\n\t\t\to_posearch_Obj.setDefaultValue(purchaseOrdersearch);\r\n\t\t\tpopulatePurchaseOrder(o_po_Obj, purchaseOrdersearch);\r\n\t\t}\r\n\t\t\r\n\t\tvar purchaseOrder = request.getParameter('purchaseOrder');\r\n\t\t\r\n\t\tif (purchaseOrder != null && purchaseOrder != '' && purchaseOrder != undefined) \r\n\t\t{\r\n\t\t\to_po_Obj.setDefaultValue(purchaseOrder);\r\n\t\t}\r\n\t\t\r\n\t\tform.addButton('custpage_searchpo', 'Search', 'searchPurchaseOrder()')\r\n\t\t\r\n\t\tvar ItemWisesublist = form.addSubList('custpage_poprofititemlist', 'list', 'Item Wise');\r\n\t\t\r\n\t\tvar BrandWisesublist = form.addSubList('custpage_poprofitbrandlist', 'list', 'Brand Wise');\r\n\t\t\r\n\t\tvar sublist1 = form.addSubList('custpage_poprofitlist', 'list', 'Serail Wise');\r\n\t\t\r\n\t\tvar InvAdjustSublist = form.addSubList('custpage_inventoryadjustlist', 'list', 'Inventory Adjustment');\r\n\t\t\r\n\t\tsetSubList(InvAdjustSublist,BrandWisesublist, ItemWisesublist, sublist1, form, request, response, purchaseOrder)\r\n\t\t\r\n\t\tresponse.writePage(form);\r\n\t}\r\n}", "title": "" }, { "docid": "007437532deda51743987409ad85a3db", "score": "0.5610835", "text": "function buildLocationList(data) {\r\n var listings = document.getElementById('poi-details');\r\n\r\n data.results.forEach(function(store, i){\r\n\r\n var prop = store;\r\n\r\n\r\n var listing = listings.appendChild(document.createElement('div'));\r\n \r\n listing.className = 'item';\r\n var link = listing.appendChild(document.createElement('h3'));\r\n\r\n link.innerHTML = prop.name;\r\n var details = listing.appendChild(document.createElement('div'));\r\n link.className = \"info-type\";\r\n \r\n details.innerHTML = prop.value;\r\n details.className = \"info-detail\";\r\n //details.innerHTML = prop.booking_info.price.amount+' '+prop.booking_info.price.currency;\r\n\r\n\r\n });\r\n }", "title": "" }, { "docid": "b59ea4c25e2d65daf061cb5420c5619f", "score": "0.5606512", "text": "function moreProdDetailTemplate(miniPipString, item, pageStatus) {\r\n var moreOptionsForTxt, measureDiv, dimensionTemplate;\r\n dimensionTemplate = new Template('<div class=\\\"prodDimension\\\">#{dimension}</div>');\r\n miniPipString.append(\"<div class=\\\"cartContainer moreInfo\\\">\");\r\n if (item.warningDescAttr !== undefined && item.warningDescAttr !== null) { \r\n miniPipString.append('<div id=\"warningsection\"><img class=\"warningImg\" src=\"#{warningDescAttr.attrImage1}\" alt=\"#{warningDescAttr.attrValue}\" border=\"0\" />#{warningDescAttr.attrValue}</div>');\r\n } \r\n if (item.isCalTitle20) {\r\n // Compare with prodinfo - Modified\r\n miniPipString.append(\"<div class='lightSource'>\" + js_fn_CAL_LEGAL_TEXT + js_fn_CAL_URL_TEXT + \"</div><div id='lightSourceMoreInfo'><a href='\" + js_fn_CAL_URL_REF + \"'>\" + js_fn_CAL_MORE_INFO + \"</a></div>\");\r\n }\r\n measureDiv = Iows.getMeasures(item.measure, dimensionTemplate);\r\n miniPipString.append(measureDiv); \r\n if (item.isGPR) {\r\n moreOptionsForTxt = js_fn_MORE_OPTIONS_FOR;// Compare with prodinfo - Modified\r\n moreOptionsForTxt = moreOptionsForTxt.replace('{0}', '#{name} #{facts}');\r\n // Compare with prodinfo - Modified\r\n miniPipString.append(\"<a href=\\\"#{URL}\\\" id=\\\"lnkMoreOptProduct7\\\" class=\\\"moreOptions\\\" title=\\\"\" + moreOptionsForTxt + \"\\\">\");\r\n miniPipString.append(js_fn_MORE_OPTIONS);// Compare with prodinfo - Modified\r\n miniPipString.append(\"</a>\");\r\n }\r\n miniPipString.append(\"<div class=\\\"compare\\\" style=\\\"display: block;\\\">\");\r\n miniPipString.append(\"<input type=\\\"checkbox\\\" id=\\\"#{compare}\\\" >\");\r\n miniPipString.append(\"<label for=\\\"#{compare}\\\">\" + compareText + \"</label>\");\r\n miniPipString.append(\"</div>\"); \r\n miniPipString.append(\"<div class=\\\"buttonsContainer\\\">\");\r\n // Compare with prodinfo - Modified\r\n if (item.isBuyable === true) {\r\n miniPipString.append(\"<div class=\\\"buttonContainer\\\"><a onclick=\\\"activateShopListPopup('addToCart',$('popupAddToCart#{partNumber}'),\" + storeId + \",\" + langId + \"); return false;\\\" href=\\\"#\\\" class=\\\"button\\\" id=\\\"popupAddToCart#{partNumber}\\\"><div class=\\\"buttonLeft\\\">&nbsp;</div><div class=\\\"buttonCaption\\\">#{keyBuyOnline}</div><div class=\\\"buttonRight\\\">&nbsp;</div></a></div><div class=\\\"clear\\\"></div>\");\r\n } \r\n miniPipString.append(\"<div><a onclick=\\\"activateShopListPopup('add',$('popupShoppingList#{partNumber}'),\" + storeId + \",\" + langId + \"); return false;\\\" class=\\\"listLink floatLeft\\\" id=\\\"popupShoppingList#{partNumber}\\\" href=\\\"#\\\">#{keySaveToList}</a></div><div class=\\\"clear\\\"></div>\");\r\n if (item.ssc !== undefined) {\r\n miniPipString.append(\"<span class=\\\"linkContainer\\\">\" + item.ssc + \"</span>\");\r\n }\r\n miniPipString.append(\"</div>\"); \r\n miniPipString.append(\"</div>\"); \r\n miniPipString.append(\"</div>\");\r\n return miniPipString;\r\n }", "title": "" }, { "docid": "c8e7ac054d394b658e0bf21c4f71f3e9", "score": "0.56024617", "text": "function GetCurrentItem() {\n var endpointUrl = appweburl + \"/_api/web/lists/getbytitle('Activity')/items(\" + getQueryStringParameter(\"ID\") + \")?$select=*,Project/Title,Author/Title,Editor/Title,AssignedTo/Name,ActivityDroppedReason/Title,ActivityDroppedReason/ID&$expand=Project,Author,Editor,AssignedTo,ActivityDroppedReason\";\n\n return $.ajax({\n url: endpointUrl,\n method: \"GET\",\n headers: { \"Accept\": \"application/json;odata=verbose\" }\n });\n}", "title": "" }, { "docid": "c83a55b6c194ad0fa4bd85b8b8ce7ad1", "score": "0.5592344", "text": "function showList(ao_items, g_nLoc){ \n var s_List = \"\"; \n for (var i=0; i< ao_items.length; i++){\n s_List = s_List + \"\\n\" + ao_items[i].Name(g_nLoc); \n } \n return s_List; \n}", "title": "" }, { "docid": "67b7fcef7000d8bff882ad8955f8255d", "score": "0.55901235", "text": "function getItemsFromSO()\r\n{\r\n\tvar record = '';\r\n\tvar lineCountSO = '';\r\n\tvar itemType = '';\r\n\tvar name = '';\r\n\tvar description = '';\r\n\tvar quantity = '';\r\n\r\n\t//zzzzzz\r\n\ttry\r\n\t{\r\n\t\t\t//Loads related sales order.\r\n\t\t\trecord = nlapiLoadRecord('salesorder', salesNo);\r\n\t\t\tlineCountSO = record.getLineItemCount('item');\r\n\t\t\t\r\n\t\t\tnlapiLogExecution('debug', 'getItemsFromSO lineCountSO', lineCountSO);\r\n\t\t\t//nlapiSelectLineItem('item', k);\r\n\t\t\tfor (var k = 1; k <= lineCountSO ; k++)\r\n\t\t\t{\r\n\t\t\t\t//Gets items values from the ralated sales order.\r\n\t\t\t\tname = record.getLineItemValue('item', 'item', k);\r\n\t\t\t\t\r\n\t\t\t\tdescription = record.getLineItemValue('item', 'description', k);\r\n\t\t\t\tquantity = record.getLineItemValue('item', 'quantity', k);\r\n\t\t\t\ttaxCode = nlapiLookupField('item', name, 'salestaxcode');\r\n\t\t\t\t//Looks up the item type.\r\n\t\t\t\titemType = nlapiLookupField('item', name, 'type');\r\n\t\t\t\t\r\n\t\t\t\tnlapiLogExecution('debug', 'k', k + ',' + itemType);\r\n\t\t\t\tnlapiLogExecution('debug', 'name, item type, desc, qty, taxCode, k', name + ','+ itemType + ',' + description + ','+ quantity+','+taxCode + ',' +k );\r\n\t\t\t\t\r\n\t\t\t\t//alert(k);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (itemType != 'Description')\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tsetNonDescriptionItem(k,name,description,quantity);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\r\n\t\t\r\n\t\t\t\t\tsetDescriptionItem(k,name,description);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//nlapiSelectNewLineItem('item');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\talert(\"Please review the Purchase Order and remove any items that are not required.\");\r\n\t\t}\r\n\tcatch(e)\r\n\t{\r\n\t\tnlapiLogExecution('DEBUG', 'getItemsFromSO', e.message);\r\n\t}\r\n}", "title": "" }, { "docid": "92ebb99ea96508b1af89cb496f9f8f7e", "score": "0.55872977", "text": "function createItemQuery(itemId){\n let query = \"http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=JSON\";\n query += \"&appid=\"+appId+\"&siteid=0&version=967\";\n query +=\"&ItemID=\" + itemId;\n query += \"&IncludeSelector=Description,Details,ItemSpecifics\"\n return query;\n}", "title": "" }, { "docid": "0c81e24203a2298b5baff39819156d88", "score": "0.5572364", "text": "function renderItem(item, itemId, itemTemplate, itemDataAttr ) {\n\tlet element = $(itemTemplate);\n//WHERE DOES SHOPPING LIST ITEM COME FROM\n\telement.find('.js-shopping-item').text(item.displayName);\n\tif (item.checkedOff) {\n\t\telement.find('.js-shopping-item').addClass('shopping-item__checked');\n\t}\n\t\telement.find('js-shopping-item-toggle')\n\t\telement.attr(itemDataAttr, itemId);\n\t\treturn element;\n}", "title": "" }, { "docid": "1fad99f6d487e121e632486127911ebb", "score": "0.5562746", "text": "function showDetails(item) {\n showModal('COVID-19', item);\n }", "title": "" }, { "docid": "1751805c030253972a869f55a32bec6b", "score": "0.5553513", "text": "function getItemInfo(id, callback) {\n //var d = $.Deferred();\n //var context = SP.ClientContext.get_current();\n //var listID = SP.ListOperation.Selection.getSelectedList();\n //var list = context.get_web().get_lists().getById(listID);\n //var item = list.getItemById(id);\n //var label = null;\n //context.load(item);\n //context.executeQueryAsync(\n // Function.createDelegate(this, function () {\n // var taxField = item.get_item(IH1600.field.info.Typologie.internalName);\n // var target = taxField.get_label();\n // if (target == undefined) target = taxField.Label;\n // d.resolve(target);\n // }),\n // RNVO.common.onQueryFailed\n //);\n\n //return d.promise();\n\n\n var familleDocRestUrl = _spPageContextInfo.webAbsoluteUrl + \"/_vti_bin/speedeau/suivi.svc/GetSuiviitem/\" + id;\n return $.ajax({ \"url\": familleDocRestUrl, \"headers\": { \"Accept\": \"application/json; odata=verbose\" } });\n \n \n //.done(function (t) {\n // var suivi = JSON.parse(t.GetSuiviItemResult);\n // if (suivi.Term == \"Déploiement\") {\n // var codif = suivi.CodificationSystem;\n // if (codif == \"\") {\n // alert(\"Cet élément n'a pas de codification.\");\n // return;\n // }\n // var url = _spPageContextInfo.webAbsoluteUrl + \"/_layouts/15/speedeau/DocumentPicker.aspx?CID=\" + codif;\n // openDialog(url, \"Sélectionnez le document à mettre à jour\");\n\n // }\n // else if (suivi.Term == \"Référentiel\") alert(\"Vous ne pouvez pas télécharger de document de référence à partir de la liste de suivi.\");\n // else alert(\"le système n'a pas pu déterminer quel formulaire ouvrir.\\n Assurez-vous que la famille documentaire soit bien renseignée pour cette entrée.\");\n //});\n}", "title": "" }, { "docid": "078aec57b44a1582d8e6526df98cb615", "score": "0.5539282", "text": "function SiteCatalyst_PrintShoppingList(shoppingList)\n{\n var s = s_gi(mSiteCatalystInfo.ReportSuiteId);\n s.linkTrackVars = 'events,List1';\n s.linkTrackEvents = 'event40';\n s.List1 = shoppingList;\n s.events = 'event40';\n s.tl(this,'o','Print Shopping List');\n}", "title": "" }, { "docid": "47fbda81d293bfc847ad18b9cf23220d", "score": "0.5539236", "text": "function collect_item_data(obj) {\n\n\t\tvar quantity = obj.find(\".sel_quantity\").val().trim();\n\t\tif (! /^(?!0)\\d+$/.test(quantity)) {\n\t\t\tquantity = 1;\n\t\t}\n\t\telse {\n\t\t\tquantity = parseInt(quantity);\n\t\t}\n\n\t\treturn {\n\t\t\tcategory_id : obj.data(\"cid\"),\n\t\t\tproduct_id : obj.data(\"pid\"),\n\t\t\tquantity : quantity,\n\t\t\tinstructions : obj.find(\".sel_special_instructions\").val(),\n\t\t\tadditions : collect_additions_selected(obj)\n\t\t};\n\t}", "title": "" }, { "docid": "9734b56e3c7852acef7475fb6483d79f", "score": "0.5524085", "text": "function SiteCatalyst_GetAllShoppingListIds() \n{\n // Declare the string.\n var ShoppingListID = new String(\"\");\n var sItemId = new String(\"\");\n \n for (var index=0; index < mSiteCatalystShoppingListItems.length; index++)\n {\n var shoppingListItemInfo = mSiteCatalystShoppingListItems[index];\n if (shoppingListItemInfo != null)\n {\n sItemId = shoppingListItemInfo.itemId;\n }\n \n // Make sure that there is actually a value.\n if (sItemId.length > 0)\n {\n if (ShoppingListID.length > 0)\n {\n ShoppingListID = ShoppingListID + \",\";\n }\n ShoppingListID = ShoppingListID + sItemId;\n }\n }\n \n return ShoppingListID;\n}", "title": "" }, { "docid": "416b7ae2f49a88d6e1a97a71ba74b554", "score": "0.55181277", "text": "function SiteCatalyst_EmailShoppingList(itemList, descriptionList)\n{\n var s = s_gi(mSiteCatalystInfo.ReportSuiteId);\n s.linkTrackVars = 'events,List1, List3';\n s.linkTrackEvents = 'event46';\n s.List1 = itemList;\n s.List3 = descriptionList;\n s.events = 'event46';\n s.tl(this, 'o', 'Email Shopping List');\n}", "title": "" }, { "docid": "7365ddaa3db7c21b45bf33e2eacfd15e", "score": "0.55148697", "text": "function GetStoreList() {\n\n}", "title": "" }, { "docid": "9175e130b1f4da72317b5c04dee391f4", "score": "0.5512391", "text": "function GetAllQuoteItems(ID) {\n debugger;\n try {\n\n var data = { \"ID\": ID };\n var ds = {};\n ds = GetDataFromServer(\"ProformaInvoice/GetQuateItemsByQuateHeadID/\", data);\n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n notyAlert('error', ds.message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "title": "" }, { "docid": "48b4233052bdef92587fc56e104873a1", "score": "0.55037355", "text": "function dbGetDish(item)\n{\n action=\"getDishDetail\";\n request = 'ordercode=getDish&name='+item;\n sendHttpReq(request,action); \n}", "title": "" }, { "docid": "819b7e06d06e79eabe3ddd59c659ab76", "score": "0.54926676", "text": "function getInventory(callback) {\n _oodb.inventoryDetails(query, function(response) {\n if (response.status == 200) {\n shareData.inventoryDetails = response.data\n callback({\n status: 200,\n data: shareData\n });\n } else {\n callback({\n status: 500,\n msg: response.msg\n });\n }\n });\n }", "title": "" }, { "docid": "5addd32a959a2f7559f8807bbcb43245", "score": "0.5484967", "text": "function myShoppingList(shoppingListId, shoppingList) {\n var returnObj = {\n ShoppingListId: shoppingListId\n };\n var $mySavedData = {\n list: shoppingList,\n items: {},\n hasLoaded: false,\n countCache: 0,\n itemIdentity: 1\n };\n\n returnObj.getItemKey = function(item) {\n var itemKey = item.ItemTypeId;\n if (item.ItemTypeId === 7 || item.AdCode) {\n itemKey = item.AdCode + gsnApi.isNull(item.BrandName, '') + gsnApi.isNull(item.Description, '');\n }\n\n return itemKey + '_' + item.ItemId;\n };\n\n // replace local item with server item\n function processServerItem(serverItem, localItem) {\n if (serverItem) {\n var itemKey = returnObj.getItemKey(localItem);\n\n // set new server item order\n serverItem.Order = localItem.Order;\n\n // remove existing item locally if new id has been detected\n if (serverItem.ItemId !== localItem.ItemId) {\n returnObj.removeItem(localItem, true);\n }\n\n // Add the new server item.\n $mySavedData.items[returnObj.getItemKey(serverItem)] = serverItem;\n saveListToSession();\n }\n }\n\n returnObj.syncItem = function(itemToSync) {\n var existingItem = returnObj.getItem(itemToSync.ItemId, itemToSync.ItemTypeId) || itemToSync;\n if (existingItem !== itemToSync) {\n existingItem.Quantity = itemToSync.Quantity;\n }\n\n if (parseInt(existingItem.Quantity) <= 0) {\n returnObj.removeItem(existingItem);\n }\n\n saveListToSession();\n $rootScope.$broadcast('gsnevent:shoppinglist-changed', returnObj);\n };\n\n // add item to list\n returnObj.addItem = function(item, deferSync) {\n if (gsnApi.isNull(item.ItemId, 0) <= 0) {\n\n // this is to help with getItemKey?\n item.ItemId = ($mySavedData.itemIdentity++);\n }\n\n $mySavedData.countCache = 0;\n var existingItem = $mySavedData.items[returnObj.getItemKey(item)];\n\n if (gsn.isNull(existingItem, null) === null) {\n // remove any ties to existing shopping list\n item.Id = undefined;\n item.ShoppingListItemId = undefined;\n item.ShoppingListId = returnObj.ShoppingListId;\n item.CategoryId = item.CategoryId || -1;\n item.Quantity = gsnApi.isNaN(parseInt(item.Quantity || item.NewQuantity), 1);\n\n existingItem = item;\n $mySavedData.items[returnObj.getItemKey(existingItem)] = existingItem;\n } else { // update existing item\n\n var newQuantity = gsnApi.isNaN(parseInt(item.Quantity), 1);\n var existingQuantity = gsnApi.isNaN(parseInt(existingItem.Quantity), 1);\n if (newQuantity > existingQuantity) {\n existingItem.Quantity = newQuantity;\n } else {\n existingItem.Quantity = existingQuantity + newQuantity;\n }\n }\n\n if (existingItem.IsCoupon) {\n\n // Get the temp quantity.\n var tmpQuantity = gsnApi.isNaN(parseInt(existingItem.Quantity), 0);\n\n // Now, assign the quantity.\n existingItem.Quantity = (tmpQuantity > 0) ? tmpQuantity : 1;\n }\n\n existingItem.Order = ($mySavedData.itemIdentity++);\n existingItem.RowKey = returnObj.getItemKey(existingItem);\n\n if (!gsnApi.isNull(deferSync, false)) {\n returnObj.syncItem(existingItem);\n } else {\n saveListToSession();\n }\n\n return existingItem;\n };\n\n returnObj.addItems = function(items) {\n var toAdd = [];\n angular.forEach(items, function(v, k) {\n var rst = angular.copy(returnObj.addItem(v, true));\n toAdd.push(rst);\n });\n\n saveListToSession();\n\n return returnObj;\n };\n\n // remove item from list\n returnObj.removeItem = function(inputItem) {\n var item = returnObj.getItem(inputItem);\n if (item) {\n item.Quantity = 0;\n\n // stupid ie8, can't simply delete\n var removeK = returnObj.getItemKey(item);\n try {\n delete $mySavedData.items[removeK];\n } catch (e) {\n\n var items = {};\n angular.forEach($mySavedData.items, function(v, k) {\n if (k !== removeK)\n items[k] = v;\n });\n\n $mySavedData.items = items;\n }\n\n saveListToSession();\n }\n\n return returnObj;\n };\n\n // get item by object or id\n returnObj.getItem = function(itemId, itemTypeId) {\n // just return whatever found, no need to validate item\n // it's up to the user to call isValidItem to validate\n var adCode, brandName, myDescription;\n if (typeof(itemId) === 'object') {\n adCode = itemId.AdCode;\n brandName = itemId.BrandName;\n myDescription = itemId.Description;\n itemTypeId = itemId.ItemTypeId;\n itemId = itemId.ItemId;\n }\n\n var myItemKey = returnObj.getItemKey({\n ItemId: itemId,\n ItemTypeId: gsnApi.isNull(itemTypeId, 8),\n AdCode: adCode,\n BrandName: brandName,\n Description: myDescription\n });\n return $mySavedData.items[myItemKey];\n };\n\n returnObj.isValidItem = function(item) {\n var itemType = typeof(item);\n\n if (itemType !== 'undefined' && itemType !== 'function') {\n return (item.Quantity > 0);\n }\n\n return false;\n };\n\n // return all items\n returnObj.allItems = function() {\n var result = [];\n var items = $mySavedData.items;\n angular.forEach(items, function(item, index) {\n if (returnObj.isValidItem(item)) {\n result.push(item);\n }\n });\n\n return result;\n };\n\n // get count of items\n returnObj.getCount = function() {\n if ($mySavedData.countCache > 0) return $mySavedData.countCache;\n\n var count = 0;\n var items = $mySavedData.items;\n var isValid = true;\n angular.forEach(items, function(item, index) {\n if (!item) {\n isValid = false;\n return;\n }\n\n if (returnObj.isValidItem(item)) {\n count += gsnApi.isNaN(parseInt(item.Quantity), 0);\n }\n });\n\n if (!isValid) {\n $mySavedData.items = {};\n $mySavedData.hasLoaded = false;\n returnObj.updateShoppingList();\n }\n\n $mySavedData.countCache = count;\n return count;\n };\n\n returnObj.getTitle = function() {\n return ($mySavedData.list) ? $mySavedData.list.Title : '';\n };\n\n returnObj.getStatus = function() {\n return ($mySavedData.list) ? $mySavedData.list.StatusId : 1;\n };\n\n // cause shopping list delete\n returnObj.deleteList = function() {\n // call DeleteShoppingList\n $mySavedData.items = {};\n $mySavedData.itemIdentity = 1;\n $mySavedData.countCache = 0;\n saveListToSession();\n return returnObj;\n };\n\n // cause change to shopping list title\n returnObj.setTitle = function(title) {\n\n $mySavedData.countCache = 0;\n $mySavedData.list.Title = title;\n return returnObj;\n };\n\n returnObj.hasLoaded = function() {\n return $mySavedData.hasLoaded;\n };\n\n returnObj.getListData = function() {\n return angular.copy($mySavedData.list);\n };\n\n function saveListToSession() {\n betterStorage.currentShoppingList = $mySavedData;\n\n // Since we are chainging the saved data, the count is suspect.\n $mySavedData.countCache = 0;\n }\n\n function loadListFromSession() {\n var list = betterStorage.currentShoppingList;\n if (!list || !list.list) {\n saveListToSession()\n list = betterStorage.currentShoppingList;\n }\n\n list.list.Id = shoppingListId;\n $mySavedData.hasLoaded = list.hasLoaded;\n $mySavedData.items = list.items;\n $mySavedData.itemIdentity = list.itemIdentity;\n $mySavedData.countCache = list.countCache;\n $mySavedData.hasLoaded = true;\n }\n\n\n function processShoppingList(result) {\n $mySavedData.items = {};\n\n angular.forEach(result, function(item, index) {\n item.Order = index;\n item.RowKey = returnObj.getItemKey(item);\n $mySavedData.items[returnObj.getItemKey(item)] = item;\n });\n\n $mySavedData.hasLoaded = true;\n $mySavedData.itemIdentity = result.length + 1;\n $rootScope.$broadcast('gsnevent:shoppinglist-loaded', returnObj, result);\n saveListToSession();\n }\n\n returnObj.updateShoppingList = function() {\n if (returnObj.deferred) return returnObj.deferred.promise;\n\n var deferred = $q.defer();\n returnObj.deferred = deferred;\n\n if ($mySavedData.hasLoaded) {\n $rootScope.$broadcast('gsnevent:shoppinglist-loaded', returnObj, $mySavedData.items);\n deferred.resolve({\n success: true,\n response: returnObj\n });\n returnObj.deferred = null;\n } else {\n $mySavedData.items = {};\n $mySavedData.countCache = 0;\n loadListFromSession();\n }\n\n return deferred.promise;\n };\n\n loadListFromSession();\n\n return returnObj;\n }", "title": "" }, { "docid": "777e8474e1ea020089cd6f9b6ad0c587", "score": "0.5482758", "text": "function getSelectedProduct()\r\n{\r\n\tonDetailsPage = true;\r\n\tvar url = document.URL;\r\n\tvar queryString = url.substring( url.indexOf('?') + 1 );\r\n\tvar idString = queryString.substring(0, queryString.indexOf('&'));\r\n\tvar id = parseInt(idString.substring(idString.indexOf('=') + 1));\r\n\tvar ctypeString = queryString.substring(queryString.indexOf('&') + 1);\r\n\tvar ctype = ctypeString.substring(ctypeString.indexOf('=') + 1);\r\n\r\n\tdisplayRangeTotals();\r\n\tdisplaySelectedProduct(id, ctype);\r\n}", "title": "" }, { "docid": "da463dc80ee6faea85df4164870d3a6c", "score": "0.54825205", "text": "getShoppingListItems() {\n // global.showSpinner(this);\n global.clearMessages(this);\n //Make an HTTP request to the API to get all shopping list items of the shopping list\n global.callAPI('/shoppinglists/' + this.state.id + '/items/1000/1', 'GET')\n //Handle promise response\n .then((responseJson) => {\n if (responseJson.status && responseJson.status === \"success\") {\n if (this._mounted) {\n this.setState({\n shoppingListItems: responseJson.shoppingListItems\n });\n global.dismissSpinner(this.props.home_component);\n }\n }\n })\n //Handle errors\n .catch((error) => {\n global.dismissSpinner(this.props.home_component);\n });\n }", "title": "" }, { "docid": "5cfe36778d9a8e561ff00347db27cd5d", "score": "0.5482448", "text": "function getInvoiceLineDetails()\r\n{\r\n\r\n\t//========================================\r\n\t// items\r\n\t//========================================\r\n\tif(invoiceElement.indexOf('<ServiceCode>')!=-1)\r\n\t{\r\n\t\titemObj=new Object();\r\n\t\titemObj.code= splitOutValue(invoiceElement,'ServiceCode');\r\n\t}\r\n\tif(invoiceElement.indexOf('<Description>')!=-1)\r\n\t{\r\n\t\titemObj.desc = splitOutValue(invoiceElement,'Description');\r\n\t}\r\n\tif(invoiceElement.indexOf('<ServiceTotal>')!=-1)\r\n\t{\r\n\t\titemObj.serviceAmount = splitOutValue(invoiceElement,'ServiceTotal');\r\n\t}\r\n\r\n\tif(invoiceElement.indexOf('<SurgeonAmount>')!=-1)\r\n\t{\r\n\t\titemObj.surgeonAmount = splitOutValue(invoiceElement,'SurgeonAmount');\r\n\t}\r\n\r\n\tif(invoiceElement.indexOf('<ServiceDate>')!=-1)\r\n\t{\r\n\t\titemObj.serviceDate = splitOutValue(invoiceElement,'ServiceDate');\r\n\t\titemObj.serviceDate = reverseDate(itemObj.serviceDate);\r\n\t}\r\n\r\n\tif(invoiceElement.indexOf('<SurgeonName>')!=-1)\r\n\t{\r\n\t\titemObj.surgeonName = splitOutValue(invoiceElement,'SurgeonName');\r\n\t}\r\n\tif(invoiceElement.indexOf('<AnaesthetistAmount>')!=-1)\r\n\t{\r\n\t\titemObj.anaesthetistAmount = splitOutValue(invoiceElement,'AnaesthetistAmount');\r\n\t}\r\n\tif(invoiceElement.indexOf('<AnaesthetistName>')!=-1)\r\n\t{\r\n\t\titemObj.anaesthName = splitOutValue(invoiceElement,'AnaesthetistName');\r\n\t}\r\n\r\n\tif(invoiceElement.indexOf('<FacilityAmount>')!=-1)\r\n\t{\r\n\t\titemObj.facilityAmt = splitOutValue(invoiceElement,'FacilityAmount');\r\n\t}\r\n\r\n\r\n\tif(invoiceElement.indexOf('<Hospital>')!=-1)\r\n\t{\r\n\t\titemObj.hospital = splitOutValue(invoiceElement,'Hospital');\r\n\t\titemsArray[itemsCount] = itemObj;\r\n\t\titemsCount = itemsCount + 1;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "72a25d2e65c4ddfc0ede2487e5198748", "score": "0.5478041", "text": "function extractProductsInCart() {\n return [\n {\n 'imageUrl': 'https://example.com/image.jpg',\n 'title': ''\n }\n ];\n}", "title": "" }, { "docid": "d510cfacdef256b8012cce993a85a49e", "score": "0.5475584", "text": "function GetReports(position) {\n $('.load_more_box').show();\n var list = \"TestList\";\n var method = \"GetListItems\";\n var id = position;\n // console.log(id);d\n var query = \"<Query>\" +\n \"<Where>\" +\n \"<Gt>\" +\n \"<FieldRef Name='ID'/><Value Type='Number'>\"+id+\"</Value>\" +\n \"</Gt>\" +\n \"</Where>\" +\n \"<OrderBy>\" +\n \"<FieldRef Name='Form_x0020_Groups'/>\" +\n \"</OrderBy>\" +\n \"</Query>\";\n\n var fieldsToRead = \"<ViewFields>\" +\n \"<FieldRef Name='Title' />\" +\n \"<FieldRef Name='Path' />\" +\n \"<FieldRef Name='Department' />\" +\n \"<FieldRef Name='ReportType' />\" +\n \"<FieldRef Name='listItemId' />\" +\n \"<FieldRef Name='PublishDate' />\" +\n \"<FieldRef Name='ID' />\" +\n \"<FieldRef Name='Status' />\" +\n \"<FieldRef Name='Owner' />\" +\n \"<FieldRef Name='Recipients' />\" +\n \"<FieldRef Name='Description' />\" +\n \"</ViewFields>\";\n $().SPServices({\n operation: method,\n async: false,\n listName: list,\n CAMLViewFields: fieldsToRead,\n CAMLQuery: query,\n // viewName: \"QueryView\",\n CAMLRowLimit: \"10\",\n completefunc: function(xData, Status) {\n $('.load_more_box').show();\n $('.load_more_reports').text('Load More Reports');\n $(xData.responseXML).SPFilterNode(\"z:row\").each(function() {\n\n var name = ($(this).attr(\"ows_Title\")); //name\n var path = ($(this).attr(\"ows_Path\")); //path\n var department = ($(this).attr(\"ows_Department\")); //department\n var report_type = ($(this).attr(\"ows_ReportType\")); //report type\n var pub_date = ($(this).attr(\"ows_PublishDate\")); //pub date\n var listItemId = ($(this).attr(\"ows_listItemId\")); //listItemId\n var itemID = ($(this).attr(\"ows_ID\")); //listItemId\n var itemStatus = ($(this).attr(\"ows_Status\")); //listItemId\n var owner = ($(this).attr(\"ows_Owner\")); //listItemId\n var itemRecipients = ($(this).attr(\"ows_Recipients\")); //Recipients\n var itemDescription = ($(this).attr(\"ows_Description\")); //description\n // console.log(itemDescription);\n // console.log(itemRecipients);\n // console.log(owner);\n $('.load_more_reports').attr('id', itemID);\n $('.load_more_reports').attr('data-type', report_type);\n $('.load_more_reports').attr('data-department', department);\n displayList(name, department, report_type, listItemId, report_type, pub_date, path, itemID, itemStatus, owner, itemRecipients, itemDescription);\n\n });\n }\n });\n }", "title": "" }, { "docid": "af58b1e6d78b25c5c253132bba9e670b", "score": "0.5471723", "text": "function getProductInfo(product){\r\n let productInfo = {\r\n id: cartItemID,\r\n imgSrc: product.querySelector('.product-img img').src,\r\n name: product.querySelector('.product-name').textContent,\r\n category: product.querySelector('.product-category').textContent,\r\n price: product.querySelector('.product-price').textContent\r\n }\r\n cartItemID++;\r\n addToCartList(productInfo);\r\n saveProductInStorage(productInfo);\r\n}", "title": "" }, { "docid": "5f7b0b6014ee3eed1cd89b2ba44ff0ba", "score": "0.54609436", "text": "function buildItemDetails(item)\n{\n var s = \"\";\n\n // ***TODO: Concatenate strings to build the details HTML for an item.\n\n // Here is an example to get you started...\n\n // ...read some values from the XML...\n var itemID = getItemTagValue(item, \"ID\");\n var itemURL = getItemTagValue(item, \"IMDB\");\n\n // ...put everything into a block...\n s += \"<div>\";\n\n // ...first the movie poster (made small), followed by a line break...\n // (The image sizing should probably be in CSS.)\n s += \"<img src=\\\"images/\" + itemID + \".jpg\\\"\" +\n \"width=\\\"100px;\\\"></img>\" + \"<br/>\";\n\n // ...then a link to the movie on IMDB...\n // (IMDB's URL format for movies is https://www.imdb.com/title/tt#######/.)\n s += \"<a href=\\\"http://www.imdb.com/title/\" + itemURL + \"/\\\">\" +\n itemURL + \"</a>\" + \"<br/>\"\n\n // ...and finally close the block.\n s += \"</div>\";\n\n return s;\n}", "title": "" }, { "docid": "d4a6a8f36463c6eabf3a8e1b3840921f", "score": "0.546068", "text": "function ItemDetails(inv_multivoucher_id, item_id, item_name, item_code, uom_id, alt_uom_id, alt_qty, qty, price_amt, cart_amount, \r\n\t\t\tdiscpercent, price_discount1_customer_id, discamount, tax_id1, tax_id2, tax_id3, tax1_name, tax2_name, tax3_name, \r\n\t\t\ttax_rate1, tax_rate2, tax_rate3, tax_customer_id1, tax_customer_id2, tax_customer_id3, \r\n\t\tprice_sales_customer_id, cart_id, mode) { \r\n\tvar price_tax2_after_tax1 = 0.0, cart_item_serial = '';\r\n\tvar price_tax3_after_tax2 = 0.0; cart_item_batch = 0, cart_boxtype_size =0; \r\n\t//cart_amount Main item Amount(i.e qty * alt_qty * price) without tax disc \r\n//\talert(\"mode===\"+mode); \r\n//\talert(\"inv_multivoucher_id===\"+inv_multivoucher_id); \r\n\tvoucherclass_id = CheckNumeric(document .getElementById(\"txt_voucherclass_id\").value); \r\n\tvouchertype_id = CheckNumeric(document.getElementById(\"txt_vouchertype_id\").value);\r\n\tvar cart_session_id = CheckNumeric(document.getElementById(\"txt_session_id\").value); \r\n//\talert(\"cart_session_id===\"+cart_session_id); \r\n\tvar location_id = CheckNumeric(document.getElementById(\"txt_location_id\").value);\r\n//\talert(\"location_id===\"+location_id); \r\n\tvar branch_id = CheckNumeric(document.getElementById(\"txt_branch_id\").value);\r\n//\talert(\"branch_id===\"+branch_id); \r\n\tvar config_inventory_current_stock = CheckNumeric(document.getElementById(\"txt_config_inventory_current_stock\").value); \r\n//\talert(\"config_inventory_current_stock===\"+config_inventory_current_stock);\r\n\tdocument.getElementById(\"cart_id\").value = cart_id;\r\n\tdocument.getElementById(\"uom_id\").value = uom_id;\r\n\tdocument.getElementById(\"alt_uom_id\").value = alt_uom_id; \r\n\tdocument.getElementById(\"cart_multivoucher_id\").value = inv_multivoucher_id; \r\n//\talert(\"price_amt===\"+price_amt); \r\n\tif (discpercent == '' || discpercent == null) {\r\n\t\tdiscpercent = 0.0;\r\n\t}\r\n\t \r\n\tif (item_id != 0) { \r\n//\t\talert(\"item_id==\"+item_id);\r\n\t\tshowHintFootable('../accounting/returns-details.jsp?cart_session_id=' \r\n\t\t\t\t+ cart_session_id \r\n\t\t\t\t+ '&branch_id=' + branch_id\r\n\t\t\t\t+ '&location_id=' + location_id \r\n\t\t\t\t+ '&cart_vouchertype_id=' + vouchertype_id \r\n\t\t\t\t+ '&voucherclass_id=' + voucherclass_id \r\n\t\t\t\t+ '&cart_multivoucher_id=' + cart_multivoucher_id\r\n\t\t\t\t+ '&cart_item_id=' + item_id \r\n\t\t\t\t+ '&item_name='+ item_name \r\n\t\t\t\t+ '&item_code='+ item_code \r\n\t\t\t\t+ '&cart_discpercent=' + discpercent\r\n\t\t\t\t+ '&disc=' + discamount \r\n\t\t\t\t+ '&price_discount1_customer_id=' + price_discount1_customer_id\r\n\t\t\t\t+ '&tax1_name=' + tax1_name+ '&tax2_name=' + tax2_name + '&tax3_name=' + tax3_name \r\n\t\t\t\t+ '&tax_rate1=' + tax_rate1 + '&tax_rate2='+ tax_rate2 + '&tax_rate3=' + tax_rate3 \r\n\t\t\t\t+ '&tax_id1=' + tax_id1+ '&tax_id2=' + tax_id2 + '&tax_id3=' + tax_id3\r\n\t\t\t\t+ '&tax_customer_id1=' + tax_customer_id1 + '&tax_customer_id2='\r\n\t\t\t\t+ tax_customer_id2 + '&tax_customer_id3=' + tax_customer_id3\r\n\t\t\t\t+ '&cart_boxtype_size='+ cart_boxtype_size\r\n\t\t\t\t+ '&config_inventory_current_stock='+ config_inventory_current_stock \r\n\t\t\t\t+ '&price_sales_customer_id=' + price_sales_customer_id\r\n\t\t\t\t+ '&cart_item_serial=' + cart_item_serial \r\n\t\t\t\t+ '&cart_item_batch='+ cart_item_batch \r\n\t\t\t\t+ '&price_tax2_after_tax1=' + price_tax2_after_tax1\r\n\t\t\t\t+ '&price_tax3_after_tax2=' + price_tax3_after_tax2 \r\n\t\t\t\t+ '&cart_alt_qty='+ alt_qty \r\n\t\t\t\t+ '&cart_qty='+ qty \r\n\t\t\t\t+ '&cart_price=' + price_amt \r\n\t\t\t\t+ '&cart_amount=' + cart_amount \r\n\t\t\t\t+ '&price_sales_customer_id =' + price_sales_customer_id \r\n\t\t\t\t+ '&cart_uom_id=' + uom_id \r\n\t\t\t\t+ '&cart_alt_uom_id=' + alt_uom_id + '&mode=' + mode + '&cart_id=' \r\n\t\t\t\t+ cart_id + '&configure1=yes','itemdetails'); \r\n\t\t \r\n\t\t// setTimeout('document.getElementById(\"txt_item_qty\").focus()', 500);\r\n\t\t// setTimeout('CalculateNewTotal()', 200); \r\n\t} \r\n\tif(mode == 'add'){\r\n\tdocument.getElementById(\"hint_search_item\").style.display = 'none';\r\n\t} \r\n}", "title": "" }, { "docid": "06aecc4e778f49754423e385673352b3", "score": "0.54573196", "text": "function readDs_catalog_itemsList() {\n var connection = datasource.getConnection();\n try {\n var sql = \"SELECT T.ID, T.NAME, I.TITLE, I.SHORT_DESCRIPTION, I.LONG_DESCRIPTION, I.IMAGE FROM CATALOG_TYPE T JOIN CATALOG_ITEM I ON T.ID = I.TYPE_ID\";\n var statement = connection.prepareStatement(sql);\n var resultSet = statement.executeQuery();\n var value;\n // while (resultSet.next()) {\n // result.push(createEntity(resultSet));\n // }\n var result = createResultData(resultSet);\n var text = JSON.stringify(result, null, 2);\n response.getWriter().println(text);\n } catch(e){\n var errorCode = javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;\n makeError(errorCode, errorCode, e.message);\n } finally {\n connection.close();\n }\n}", "title": "" }, { "docid": "ad77625f1547f9eafc248ff2a2e7729c", "score": "0.5449171", "text": "function getItemsDevoured() {\n console.log(\"Devour: \" + data)\n // $.get(\"/api/items/1\", function(data) {\n // console.log(\"burgers\", data);\n // itemsDevoured = data;\n // initializeDevouredRows();\n // });\n }", "title": "" }, { "docid": "ccecad7fe65a5023cbaac5ce53fa4da3", "score": "0.54429096", "text": "function SiteCatalyst_RemoveItemFromShoppingList(itemId) \n{\n // Loop through the shopping list items.\n for(var index = 0; index < mSiteCatalystShoppingListItems.length; index++)\n {\n // Get the shopping list info.\n var shoppingListItemInfo = mSiteCatalystShoppingListItems[index];\n \n // If the info is not null, then return the description.\n if (shoppingListItemInfo != null)\n {\n if (shoppingListItemInfo.itemId == itemId)\n {\n // Remove the item\n mSiteCatalystShoppingListItems.splice(index, 1);\n \n // Success\n return 1;\n }\n }\n }\n \n return 0;\n}", "title": "" } ]
a8c8b43f15a4bb74e445ff72c241ba32
Fill in incomeRemoveModal (AjAX request)
[ { "docid": "ab50837898e9ec015701e27122ee4d04", "score": "0.58165777", "text": "function fillDeleteIncomeSelect() {\n\t\t$button = $(this);\n\t\tlet delValue = $button.attr(\"value\");\n\t\tlet delName = $button.attr(\"name\");\n\t\t$('#deleteIncomeLabel').text(delName);\n\t\t$('#deleteIncomeId').val(delValue);\n\t\t$.ajax({\n\t\t\turl: '/settings/get-user-income-cats-ajax',\n\t\t\tmethod : \"POST\",\n\t\t}).done(function(response) {\n\t\t\tlet array = JSON.parse(response);\n\t\t\t$('#deleteIncomeSelect').empty();\n\t\t\t$('#deleteIncomeSelect').append('<option></option>');\n\t\t\t$.each(array, function(){\n\t\t\t\tif(this['id'] != $button.attr('value')) {\n\t\t\t\t\t$('#deleteIncomeSelect').append('<option value=\"'+this['id']+'\">'+this['name']+'</option>');\n\t\t\t\t}\n\t\t\t});\n\t\t}).fail(function() {\n\t\t\talert(\"income delete fail\");\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "5b09b8f03a5a36dd21e09dcbc7dbcfe4", "score": "0.6110146", "text": "function removeExpenses(id = null)\n{\n\tif(id) {\n\t\t$(\"#removeExpensesBtn\").unbind('click').bind('click', function() {\n\t\t\t$.ajax({\n\t\t\t\turl: 'accounting/removeExpenses/'+id,\n\t\t\t\ttype: 'post',\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess:function(response) {\n\t\t\t\t\t$(\"#removeExpensesModal\").modal('hide');\n\n\t\t\t\t\tif(response.success == true) {\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#remove-expenses-messages\").html('<div class=\"alert alert-success alert-dismissible\" role=\"alert\">'+\n\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\n\t\t\t\t\t\t response.messages + \n\t\t\t\t\t\t'</div>');\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\tmanageExpeneseTable.ajax.reload(null, false);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t\telse {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#remove-expenses-messages\").html('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">'+\n\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\n\t\t\t\t\t\t response.messages + \n\t\t\t\t\t\t'</div>');\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t} // /else\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "ce265282d46a7d87dfff0c63eb3d0357", "score": "0.6035397", "text": "function closeModalGetCompanyCoupons(){\n\t\t\tGetCompanyCouponsModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "0d29f2bb0b6cabc40712c93bffcbc26d", "score": "0.6017802", "text": "function budgetcloseModal(){\n budgetmodal.style.display='none';\n }", "title": "" }, { "docid": "0ff36dc57e0e0efbc2c8883ec7c1fb17", "score": "0.60014427", "text": "function editIncomeClicked() {\n const userIncome = parseFloat($(this).attr(\"userIncome\"));\n const userId = parseInt(\n window.location.href.split(\"/\")[window.location.href.split(\"/\").length - 1]\n );\n\n renderModal(\"Edit Income\", userId, { userId, userIncome });\n}", "title": "" }, { "docid": "e9b1edbdfd1f0893801e9d36120d6fba", "score": "0.5993583", "text": "function removeItemIncome(id) {\r\n \r\n let aux_name = [];\r\n let aux_sum = [];\r\n aux_name = name_incomes.map((x) => x);\r\n aux_sum = sum_incomes.map((x) => x);\r\n name_incomes = [];\r\n sum_incomes = [];\r\n index_income = 1;\r\n\r\n let removeTable = document.getElementById('incomeTable');\r\n let parentElement = removeTable.parentElement;\r\n parentElement.removeChild(removeTable);\r\n\r\n document.getElementById(\"income\").innerHTML = `\r\n <h2 class=\"smallTitle\">Incomes</h2>\r\n <table id=\"incomeTable\">\r\n <td>Name</td>\r\n <td>Sum</td>\r\n </table>\r\n `\r\n\r\n for (let i = 0; i<aux_name.length; i++)\r\n if(i != id - 1) {\r\n name_incomes.push(aux_name[i]);\r\n sum_incomes.push(aux_sum[i]);\r\n addIncomeToTable();\r\n }\r\n\r\n calculateBudget();\r\n\r\n }", "title": "" }, { "docid": "c40ef9a86f83ceed11ea6a949352e00e", "score": "0.59609264", "text": "function openDeleteLoanModal(modalId, loanId, userData, barcode, title, isbn, createdAt, dueDate) {\n openModal(modalId);\n var form = document.querySelector(\"#form-loan-delete\");\n form.setAttribute(\"action\",\"/loans/\"+loanId);\n var idDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-id-value\");\n idDiv.innerHTML = loanId;\n var userDataDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-user-data-value\");\n userDataDiv.innerHTML = userData;\n var barcodeDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-barcode-value\");\n barcodeDiv.innerHTML = barcode;\n var titleDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-title-value\");\n titleDiv.innerHTML = title;\n var isbnDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-isbn-value\");\n isbnDiv.innerHTML = isbn;\n var createdAtDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-createdAt-value\");\n createdAtDiv.innerHTML = createdAt;\n var dueDateDiv = document.querySelector(\"#\"+modalId+\" #delete-loan-dueDate-value\");\n dueDateDiv.innerHTML = dueDate;\n\n var bookDataDeleteLoanModalDiv = document.getElementById(\"book-data-delete-loan-modal\");\n bookDataDeleteLoanModalDiv.value = title;\n var userDataDeleteLoanModalInput = document.getElementById(\"user-data-delete-loan-modal\");\n userDataDeleteLoanModalInput.value = userData;\n var barcodeDataDeleteLoanModalInput = document.getElementById(\"barcode-data-delete-loan-modal\");\n barcodeDataDeleteLoanModalInput.value = barcode;\n var isbnDataDeleteLoanModalInput = document.getElementById(\"isbn-data-delete-loan-modal\");\n isbnDataDeleteLoanModalInput.value = isbn;\n}", "title": "" }, { "docid": "b594d4cda59ff5ce9bfb343506d0bd5a", "score": "0.59317756", "text": "function deleteModal(key, name) {\n $(\"#train_delete\").text(name);\n $(\"#delete_name\").attr(\"value\", name);\n $(\"#delete_key\").attr(\"value\", key);\n $(\"#deleteTrainModal\").modal(\"show\");\n return;\n}", "title": "" }, { "docid": "4ac5324b06f36fd6025c44dd4467f917", "score": "0.591529", "text": "function clearOrderModal(){\n $(\"#oiPriceId\").val(\"\");\n $(\"#oiSP\").val(\"\");\n $(\"#oiName\").html(\"\");\n $(\"#oiDate\").html(\"\");\n $(\"#oiPrice\").html(\"\");\n $(\"#oiQty\").val(\"1\");\n $(\"#oiCus\").html(\"\");\n $(\"#oiRemark\").val(\"\");\n $(\"#oiTotal\").html(\"\");\n}", "title": "" }, { "docid": "fe4ac9e6f1299137b845d90b65ba2d86", "score": "0.5883071", "text": "function kopage_blockRemovePrompt(i){\n\t\n\t// if there's menu opened, hide it:\n\tkeditableToolbar('hide');\n\t\n\tbasicModal.show({\n\t\tbody: '<p>'+langPhrase.blockRemoving+'</p>',\n\t\tclosable: true,\n\t\tbuttons: {\n\t\t\tcancel: {\n\t\t\t\ttitle: langPhrase.cancel,\n\t\t\t\tfn: basicModal.close\n\t\t\t},\n\t\t\taction: {\n\t\t\t\ttitle: langPhrase.continue,\n\t\t\t\tfn: function(){$('#blockId').val(i);kopage_blockRemove();basicModal.close();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\n\t\t\t}\n\t\n\t\t\t}\n\t\t}\n\t})\n\n\n\n\t\n}", "title": "" }, { "docid": "3f8d3b05b181523e7d77a61eeccc0ee8", "score": "0.58633906", "text": "function removeItem(item) {\n\n item.ativo = false;\n\n $scope.modalQuantidade = \"\";\n $scope.modalPercentual = \"\";\n }", "title": "" }, { "docid": "e8d8b4ad97ea17b97e7a73b9760747f4", "score": "0.584713", "text": "function deleteModal() {\n modal = document.getElementById(\"FactCheck_Modal\");\n modal.remove();\n }", "title": "" }, { "docid": "6eef5de73f764c3d0a5add7e75e84c8c", "score": "0.5845631", "text": "function cusAddAction() {\n //document.getElementById('product').reset();\n\n $('#modalCompose').modal('show');\n}", "title": "" }, { "docid": "f7dd3632cd6d7507bb035e98751837f9", "score": "0.5831619", "text": "function closeModalUpdateCompany(){\n\t\t\tUpdateCompanyModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "0f639b9ec97081d99d1bc226b95daaba", "score": "0.5812352", "text": "function deletionHandling(projectClaimId) \n{ \n     jq('#removeClaim .deleteclaimbtn').on(\"click\",function(){deleteClaim(projectClaimId);}); \n    jq(\"#removeClaim\").modal('show'); \n}", "title": "" }, { "docid": "f5eb1c5696a0216ca6f1b740e28ff87f", "score": "0.58101165", "text": "function remover(id, total, restante) {\n let newDispo = (total - restante)\n $('#idtransh').html(id)\n $('#idtransi').val(id)\n $('#restante').html(restante)\n $('#newdispo').html(newDispo)\n $('#myModal2').modal('show')\n}", "title": "" }, { "docid": "2ef069fadfe37356b162a71e0294c6df", "score": "0.5797247", "text": "function deleteAccount() {\n openModal()\n}", "title": "" }, { "docid": "618ff6c69db59b9e97ebbeb0dbdb4991", "score": "0.579453", "text": "function addCompany(){\n if (choiceCount < 10 && intSupll < 20) {\n intSupll = intSupll + 1;\n choiceCount = choiceCount+1;\n PostDataPromitheftiki();\n var contentID = document.getElementById('entrycol');\n var newTr = document.createElement('tr');\n var name = $('#suplCompany_Name').val();\n newTr.setAttribute('id','entry'+intSupll);\n newTr.innerHTML ='<td><strong>'+intSupll+'</strong></td><td>'+name+'</td><td><input type=\"image\" src=\"../images/Deep_Edit.png\" data-toggle=\"modal\" data-target=\"#suplCompanyModal\"></td><td><input type=\"image\" src=\"../images/delete-icon.png\" onclick= \"removeCompanyID('+intSupll+');\"></td>';\n\n contentID.appendChild(newTr);\n\n document.getElementById(\"suplCompany_Name\").value = \"\";\n document.getElementById(\"suplCompany_CommercialName\").value= \"\";\n document.getElementById(\"suplCompany_OtherName\").value = \"\";\n document.getElementById(\"suplCompany_legalForm\").value= \"\";\n document.getElementById(\"suplCompany_CEO\").value= \"\";\n document.getElementById(\"suplCompany_Address\").value= \"\";\n document.getElementById(\"suplCompany_PC\").value= \"\";\n document.getElementById(\"suplCompany_City\").value= \"\";\n document.getElementById(\"suplCompany_Phone\").value= \"\";\n document.getElementById(\"suplCompany_fax\").value= \"\";\n document.getElementById(\"suplCompany_email\").value= \"\";\n document.getElementById(\"suplCompany_info\").value= \"\";\n document.getElementById(\"suplEmpl_name\").value= \"\";\n document.getElementById(\"suplEmpl_Surname\").value= \"\";\n document.getElementById(\"suplEmpl_address\").value= \"\";\n document.getElementById(\"suplEmpl_pc\").value= \"\";\n document.getElementById(\"suplEmpl_city\").value= \"\";\n document.getElementById(\"suplEmpl_phone\").value= \"\";\n document.getElementById(\"suplEmpl_fax\").value= \"\";\n document.getElementById(\"suplEmpl_email\").value= \"\";\n \n } else {\n alert(\"Φτάσατε το μέγιστο όριο εισαγωγής στοιχείων προμηθευτών\");\n }\n }", "title": "" }, { "docid": "fc482425d65723e47cbc1e25b966dd7c", "score": "0.57666785", "text": "function addFundsModal(btn){\n var selectedAmount = $(btn).attr('data-id');\n $('#add-funds-modal').modal('close');\n $('#confirm-add-funds-modal').modal('open');\n $('.add-funds-amount').html(\"US$ \" + selectedAmount);\n var available_cash = $('#cash-available-invisible').html().replace(/,/g, \"\");\n var new_total_cash = parseFloat(available_cash) + parseFloat(selectedAmount.replace(/,/g, \"\"));\n $('#new-cash-available').html(formatter.format(new_total_cash));\n $('#confirm-add-funds-input').val(selectedAmount);\n}", "title": "" }, { "docid": "febc432785b663891ec4d5fed2ace9ad", "score": "0.57494396", "text": "function closeModalGetCompanyDetails(){\n\t\t\tGetCompanyDetailsModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "16207cafee11b1c7d745ab3fe15a16da", "score": "0.5719191", "text": "function removeGeust() {\n $.ajax({\n url: '/api/geust/' + geustIdtoDelet,\n type: 'DELETE',\n success: function () {\n getGeust();\n $('#confirm2').modal('hide');\n\n },\n error: function () {\n alert('Something went wrong!!');\n }\n });\n}", "title": "" }, { "docid": "e0d5f34ac44d0ebf65d494b25a82564d", "score": "0.5716042", "text": "function cerrarValoracion() {\n LimpiaDesa('requiredDes');\n $('#ModalValoraciones').modal('hide');\n}", "title": "" }, { "docid": "a0d7524f734171e24a6332053246c8bd", "score": "0.57154965", "text": "function confirmDelete() {\n openConfirmModal(); \n\n let id = $('#modal-header-id').text();\n let name = $('#modal-header-name').text();\n\n // Name and confirmation message\n $('#confirm-modal-content-inside').append('<h2><span id=\"mgrConfirmDelete\"></span></h2>');\n $('#confirm-modal-content-inside').append('<h2>' + name + '?</h2>');\n\n // Cancel and remove buttons\n $('#confirm-modal-content-inside').append('<button id=\"mgrCancel\" class=\"modal-button\" onclick=\"closeConfirmModal()\"></button>');\n $('#confirm-modal-content-inside').append('<button id=\"mgrRemoveItem\" class=\"modal-button modal-button-red\" onclick=\"deleteStock(' + id + ')\"></button>');\n update_view();\n}", "title": "" }, { "docid": "61ef1fa79bbaf6641c01988c2b391ed1", "score": "0.5699543", "text": "function removeItemExpense(id) {\r\n\r\n let aux_name = [];\r\n let aux_sum = [];\r\n let aux_necessity = [];\r\n aux_name = name_expenses.map((x) => x);\r\n aux_sum = sum_expenses.map((x) => x);\r\n aux_necessity = expense_necessity.map((x) => x);\r\n name_expenses = [];\r\n sum_expenses = [];\r\n expense_necessity = [];\r\n index_expense = 1;\r\n\r\n let removeTable = document.getElementById('expensesTable');\r\n let parentElement = removeTable.parentElement;\r\n parentElement.removeChild(removeTable);\r\n\r\n document.getElementById(\"expense\").innerHTML = `\r\n <h2 class=\"smallTitle\">\r\n Expenses\r\n </h2>\r\n\r\n <table id=\"expensesTable\">\r\n <td>Name</td>\r\n <td>Sum</td>\r\n <td>Necessity</td>\r\n </table>\r\n `\r\n\r\n for (let i = 0; i<aux_name.length; i++)\r\n if(i != id - 1) {\r\n name_expenses.push(aux_name[i]);\r\n sum_expenses.push(aux_sum[i]);\r\n expense_necessity.push(aux_necessity[i]);\r\n addExpenseToTable();\r\n }\r\n\r\n calculateBudget();\r\n necessityStatistics();\r\n\r\n }", "title": "" }, { "docid": "24957da7aac3a07d32cb151f1290c19a", "score": "0.56823367", "text": "function del_prj(value, state = '') {\n $('#del_id').val(value);\n $('#del_state').val(state);\n $('.del_prj').modal();\n}", "title": "" }, { "docid": "54f138cced3bfa94086c4041059e77c0", "score": "0.56735057", "text": "function closeModalCreateCompany(){\n\t\t\tCreateCompanyModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "c31a32d71be5f719faadfdc6af6f8070", "score": "0.5661037", "text": "function deleteExpenseClicked() {\n const deleteId = parseInt($(this).attr(\"deleteId\"));\n renderConfirmationModal(\"Are you sure you want to delete the Expense?\", () => {\n deleteExpense(deleteId);\n });\n\n // deleteExpense(deleteId);\n}", "title": "" }, { "docid": "f54d4db2a1b8ebb235b2135abfe3800f", "score": "0.56603175", "text": "function cierraModal () {\n $(\".modal\").css(\"display\", \"none\");\n $('.modal').remove();\n e.preventDefault();\n}", "title": "" }, { "docid": "71f9ead84411e15d9b6b41477ab450f2", "score": "0.56586385", "text": "cancelAddBudget() {\n\t\tthis.setState({\n\t\t\tshowBudgetModal: false,\n\t\t});\n\t}", "title": "" }, { "docid": "af8c118183a5247fc4b11f98e0c66359", "score": "0.5653333", "text": "function GetPurchasedCouponsCloseModal(){\n\t\t\tGetPurchasedCouponsModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "62b4486e99b8b55eb20a960f8a0b431c", "score": "0.56493855", "text": "function closeModal(){\n\t\t\tCreateCouponModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "b79f9dc6f71ec34cf7a2e645467b5801", "score": "0.56267893", "text": "function deleteitemconfirm(){\n var modalbod = document.getElementById(\"deletemodalbody\");\n var id = modalbod.innerHTML;\n var row = document.getElementById(id);\n console.log(id);\n\n var data = getdelrow(row);\n row.parentElement.removeChild(row);\n var xml = new XMLHttpRequest();\n xml.open(\"POST\", \"/delete\");\n xml.onreadystatechange = handle_res_post;\n xml.send(JSON.stringify(dataset));\n}", "title": "" }, { "docid": "9e56e977274fa0658ac5a619dd0e630a", "score": "0.5624102", "text": "function clearAEmail() {\n\n let modalA = $('#addStudentModal')\n modalA.find('#AddE').text('');\n}", "title": "" }, { "docid": "bb95a1920c8587246110c5938aae9956", "score": "0.56075305", "text": "function closeModalOnModify(){\n $(\"#insNuovaDomanda\").modal('hide');\n $(\"#dettEsameMod\").modal('show');\n}", "title": "" }, { "docid": "968ef21abb49c5bfc57b88af4e2f6c9c", "score": "0.55947953", "text": "function resetearModalAgregar(){\r\n sku.value = \"\";\r\n nombreProducto.value = \"\";\r\n pesoProducto.value = \"\";\r\n }", "title": "" }, { "docid": "2070afb37ef72fb0600428c006ca26d1", "score": "0.5592015", "text": "function closeModalUpdate(){\n\t\t\tUpdateCouponModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "07fdb4c4d7a4df7c671b49c48a63bb94", "score": "0.55919784", "text": "function confirmStock() {\n openConfirmModal();\n\n let id = $('#modal-header-id').text();\n let name = $('#modal-header-name').text();\n \n // Name, restock message and number input\n $('#confirm-modal-content-inside').append('<h2><span id=\"mgrConfirmRestock\"></span></h2>');\n $('#confirm-modal-content-inside').append('<h2>' + name + '</h2>');\n $('#confirm-modal-content-inside').append('<input id=\"mgrRestockCount\" class=\"mgrInput\" type=\"number\"></input>');\n \n // Cancel and restock buttons\n $('#confirm-modal-content-inside').append('<button id=\"mgrCancel\" class=\"modal-button\" onclick=\"closeConfirmModal()\"></button>');\n $('#confirm-modal-content-inside').append('<button id=\"mgrRestockItem\" class=\"modal-button modal-button-brown\" onclick=\"replenishStock(' + id + ')\"></button>');\n update_view();\n}", "title": "" }, { "docid": "c9f08d2ce2bf0f697a3131c1eccf36b2", "score": "0.5584498", "text": "function FecharEsqueciMinhaSenhaModal() {\n $(\"#esqueciMinhaSenhaEmailInput\").val(\"\");\n $(\"#esqueciMinhaSenhaNomeInput\").val(\"\");\n $(\"#esqueciMinhaSenhaSenhaInput\").val(\"\");\n $(\"#esqueciMinhaSenhaConfirmsenhaInput\").val(\"\");\n\n $(\"#esqueciMinhaSenhaModal\").modal(\"hide\");\n}", "title": "" }, { "docid": "8dbddd2f5092ab7a792d8312f71d28f3", "score": "0.5572892", "text": "function handleCloseModal() {\n document.getElementById(\"inviteNewUser\").style.display = \"none\";\n }", "title": "" }, { "docid": "26695a94fd1c2ee5c99c841baba7cb62", "score": "0.55670124", "text": "function PurchaseCouponsCloseModal(){\n\t\t\tPurchaseCouponsModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "ae0817e8ae6fcd561aaac0d7f131ed39", "score": "0.55662686", "text": "function closeMoneyFlow(){\r\n var modal=document.getElementById(\"MoneyFlow\");\r\n modal.style.display=\"none\";\r\n}", "title": "" }, { "docid": "860e87cd9387f897300736de218efb91", "score": "0.5566127", "text": "function closeCartIsEmptyModal(){return{type:types.HIDE_EMPTY_CART_MODAL};}", "title": "" }, { "docid": "ad333a303126d9c661a000efef629b41", "score": "0.555765", "text": "function closeModal() {\n //clear input box\n getElement(\"im1\").value = \"\";\n getElement(\"im2\").value = \"\";\n //close modal\n getElement(\"dm\").style.display = \"none\";\n\n}", "title": "" }, { "docid": "1829ba4711e6f835bc3cab70d7d78977", "score": "0.5547", "text": "function ShowCashTransfer() {\n transferclear();\n $(\"#AddCashWithdrawalModel\").modal('show');\n $(\"#TransferAmt\").show();\n\n}", "title": "" }, { "docid": "744310ddef0e28634ed845352e7f9d7c", "score": "0.5545723", "text": "function onModalClose(){\n document.getElementById(\"searchbar\").value = \"\";\n document.getElementById(\"protein_list\").innerHTML = \"\";\n}", "title": "" }, { "docid": "f14eda5fa158e776802f1aec6d1ab1eb", "score": "0.55429184", "text": "function cargarModalAuditoria(){\n\n \n document.getElementById(\"numero\").disabled = false;\n $('#modalAuditoria #accion').val(\"insert\");\n //limpiar formulario\n document.getElementById('formAuditoria').reset();\n $.jgrid.gridUnload(\"gridVinculados\");\n \n //mostrar modal\n $('#modalAuditoria').modal({'show':true, backdrop: 'static', keyboard: false});\n \n \n }", "title": "" }, { "docid": "4b25324d34cf8b7a9cfec4a2dbae57b2", "score": "0.5538708", "text": "function cancel_delete() {\n document.getElementById('form_del').innerHTML = \"\";\n console.log(\"DELETE canceled\");\n modalOff();\n}", "title": "" }, { "docid": "5e8fff85d871ef6150caca27cce3a3c2", "score": "0.5535775", "text": "function agregarCargo(){\n $(\"#btAgregarCargo\").click(function(e){\n $(\"#modalCargo\").modal('show');\n $('#tituloModelCargo').html('Ingresar Cargo')\n $('#idCargo').val('');\n $('#cargo').val(''); \n $('#GuardarCargo').show();\n //NOS LIBRAMOS PRINCIPALMENTE DE ESTOS BOTONES QUE CARGAMOS EN LAS FUNCIONES DE EDITAR MARCA\n $(\"#guardarCambios\").remove(); \n })\n}", "title": "" }, { "docid": "1b027f8c984921c584ebacd9716de430", "score": "0.5533204", "text": "function delpren(id) {\n $.ajax({\n url: './ownbooks',\n dataType: 'json',\n type: 'post',\n data: {\n 'rtype': 'delPren',\n 'idPren': id\n },\n success: function (data) {\n $('#infobox').modal('dispose');\n var message = data.message;\n\n var mhead = '<div class=\"modal-dialog modal-dialog-centered modal-lg\">' +\n ' <div class=\"modal-content\" style=\"background-color: antiquewhite;\"> ' +\n '<div class=\"modal-header\"> <h4 class=\"modal-title\">Esito Annullamento</h4> ' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal text-center\">&times;</button> ' +\n '</div> ' +\n '<div class=\"modal-body text-center\">'+ message+'. Ora verrai reinderizzato.</div> ' +\n '<div class=\"modal-footer\"> <button type=\"button\" class=\"btn btn-danger\" data-dismiss=\"modal\">OK</button> '+\n '</div> </div> </div>';\n\n $('#delconf').html(mhead);\n\n $('#delconf').modal('toggle');\n\n setTimeout(function() {\n location.reload();\n }, 3000);\n\n },\n error: function (errorThrown) {\n console.log(errorThrown);\n }\n });\n\n}", "title": "" }, { "docid": "c73a4599e3925127fdcd8b735892941a", "score": "0.55259806", "text": "function closeModalAdminUpdateCoupon(){\n\t\t\tAdminUpdateCouponModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "5272a4602a7d5da398423500f860a78c", "score": "0.5515172", "text": "function supprimer(idbudget){ \n\t\n\tif (idbudget > 0 && document.getElementById(idbudget) != null){\n\t\tswal({\n\t\t\ttitle: \"Supression\", \n\t\t\ttext: \"Etes-vous sûr de vouloir supprimer ce budget ?\\nToutes les données seront perdues !\", \n\t\t\ttype: \"warning\", \n\t\t\tshowCancelButton: true, \n\t\t\tconfirmButtonColor: \"#DD6B55\", \n\t\t\tconfirmButtonText: \"Supprimer\", \n\t\t\tcancelButtonText: \"Annuler\"\n\t\t\t}, function(){\n\n\t\t\t\tstartLoad(idbudget);\n\t\t\t\tvar xhttp0 = new XMLHttpRequest();\n\t\t\t\txhttp0.onreadystatechange = function(){\n\t\t\t\t\tif(xhttp0.readyState === XMLHttpRequest.DONE){\n\t\t\t\t\t\tif (xhttp0.status === 200){\n\t\t\t\t\t\t\tbudgetglobaledepense -= +document.getElementById(\"totaldepense\"+idbudget).innerHTML.replace(\"€\", \"\");\n\t\t\t\t\t\t\tupdatebudgetglobal();\n\n\t\t\t\t\t\t\tdocument.getElementById(idbudget).remove();\n\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tendLoad(idbudget);\n\t\t\t\t\t\t\tserverLost();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txhttp0.open(\"POST\", \"budget-modifie.php\", true);\n\t\t\t\txhttp0.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\txhttp0.send(\"idbudget=\"+idbudget+\"&action=supprimer\");\n\t\t});\n\t\t\n\t}else{\n\t\tdonnéesInvalides();\n\t}\n\t\n}", "title": "" }, { "docid": "41e3edc6af98fc1b0dcdd4b37b1b4aa6", "score": "0.55129826", "text": "function limpiarCamposModal(){\r\n\t\t$(\".nombreMascota\").val(\"\");\r\n\t\t$('#btnPatitaGrande').removeClass(\"icon-button-active\");\r\n\t\t$('#btnPatitaMediana').removeClass(\"icon-button-active\");\r\n\t\t$('#btnPatitaChica').removeClass(\"icon-button-active\");\r\n\t\t$('#btnTijeraChica').removeClass(\"icon-button-active\");\r\n\t\t$('#btnTijeraGrande').removeClass(\"icon-button-active\");\r\n\t\t$('#completartamanio').remove();\r\n\t\t$('#completarpelaje').remove();\r\n\t\t$('#completarfechanacimiento').remove();\r\n\t\t$('#completarnombreMascota').remove();\r\n\t\t$(\"#fechaNacimientoMascota\").val(\"\");\r\n\t\t$(\"#observacionesMascota\").val(\"\");\t\r\n\t\t$(\"#idMascotaHidden\").val(\"\");\t\r\n}", "title": "" }, { "docid": "d2be776d257ec8bd10c1e45d6dd477bc", "score": "0.5511561", "text": "function deleteInsurance() {\n var id = $(this).data(\"id\");\n\n $.ajax({\n method: \"DELETE\",\n url: \"/api/insurance/\" + id\n }).done(function(){\n\n displayInsurance();\n });\n }", "title": "" }, { "docid": "dfcfec14bbf40e64e48a1aefcb3f8d8f", "score": "0.5511474", "text": "removeModal() {\n this.removaAllEvents();\n this.closeModalPage(this.componentElem);\n }", "title": "" }, { "docid": "8cea73585897809aa632a32ebf2da526", "score": "0.55102336", "text": "function eliminarAsignatura(pk, nombre, ngrado){\n \tpk_asignatura=pk;\n \tnombre_asignatura = nombre;\n \t\n \t$('.formAsignatura').hide();\n \t$('.formAsignaturaMod').hide();\n \t$('.formAsignaturaElim').show();\n \t$('#confirmacion').text(\"¿Desea desactivar la asignatura \"+ nombre + \" de \"+ ngrado + \"?\");\n \testado_asignatura =\"Inactivo\";\n\n}", "title": "" }, { "docid": "2f433681cb8d26bfd713fb45988fe4e1", "score": "0.5509566", "text": "function AdminCreateCouponCloseModal(){\n\t\t\tAdminCreateCouponModal.style.display = 'none';\n\t\t}", "title": "" }, { "docid": "43b8d829a5140058574ce7faf3267a37", "score": "0.5509187", "text": "function clearCusLevelModal(){\n $(\"#cusLvlName\").val(\"\");\n $(\"#cusScoreName\").val(\"\");\n}", "title": "" }, { "docid": "f929c3a8b7adeb9c7c181fe3916af148", "score": "0.55054265", "text": "function limparModal(){\n$(\"#registrosContatos\").html(\"\");\n}", "title": "" }, { "docid": "8566a94f618f80ecf90b943ef7cb7efa", "score": "0.5501356", "text": "function showNewInvestmentModal() {\n\n // clean previous values from the form\n $('#inputBank-new').val('');\n $('#inputType-new').val('');\n $('#inputName-new').val('');\n $('#inputOperationDate-new').val('');\n $('#inputOperationAmount-new').val('');\n $('#inputBalanceDate-new').val('');\n $('#inputBalanceAmount-new').val('');\n\n // show the new Investment modal\n $('#newInvestment').modal({\n show: true\n });\n\n // TODO: fix the focus\n $('#inputBank-new').focus();\n}", "title": "" }, { "docid": "6246abbc76e9d1283e1e11b78168907f", "score": "0.5497622", "text": "function alertEliminar(image,product){\n $('#image_id_modal').val(image);\n $('#product_id_modal').val(product);\n $(\"#ModalEliminar\").modal(\"toggle\");\n \n}", "title": "" }, { "docid": "290285fc43b96b7cab66e94f93819e52", "score": "0.54948604", "text": "function addButtonEvent(){\n const addButton = mainDash.querySelectorAll(\".btn-primary\")[0]\n addButton.addEventListener(\"click\", () => {\n event.preventDefault()\n const newIncomeBox = ce(\"form\")\n newIncomeBox.className = \"new-income\"\n newIncomeBox.innerHTML = `\n <div class=\"form-row\">\n <div class=\"form-group col-md-6\">\n <input type=\"text\" placeholder=\"Income Source\" size=\"60\">\n </div>\n <div class=\"form-group col-md-2\">\n <div class=\"input-group\">\n <div class=\"input-group-prepend\">\n <div class=\"input-group-text\">$</div>\n </div>\n <input type=\"text\" placeholder=\"Amount\" size=\"10\">\n </div>\n </div>\n <button style=\"height:30px; width:80px; margin:5px;\" type=\"submit\" id=\"add-income-btn\" class=\"btn-primary\">Add</button>\n <button style=\"height:30px; width:80px; margin:5px;\" id=\"del-income-btn\" class=\"btn-primary\">Delete</button>\n </div>\n `\n \n const cardBody = mainDash.querySelector(\".card-body\")\n cardBody.append(newIncomeBox)\n\n const addIncomeData = cardBody.querySelector(\"form.new-income\")\n addIncomeData.addEventListener(\"submit\", () => {\n event.preventDefault()\n const configObj = {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${localStorage.token}`,\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify({\n user_id: localStorage.id, \n name: event.target[0].value,\n value: event.target[1].value\n })\n }\n fetch(`http://localhost:3000/api/v1/incomes`, configObj)\n .then(res => res.json())\n .then(newIncome => addIncome(newIncome))\n newIncomeBox.innerHTML = \"\"\n })\n\n const delIncomeData = newIncomeBox.querySelector(\"#del-income-btn\")\n delIncomeData.addEventListener(\"click\", () => {\n event.preventDefault()\n const configObj = {\n method: \"DELETE\",\n headers: {\n Authorization: `Bearer ${localStorage.token}`,\n },\n }\n fetch(`http://localhost:3000/api/v1/incomes/${this.id}`, configObj)\n .then(() => newIncomeBox.remove())\n })\n\n })\n}", "title": "" }, { "docid": "1cf8fe309c0a57084450f55b830cbd79", "score": "0.5493403", "text": "function cancelsale(){\n \t $('#barcode').val('');\n \t $( '#customerpanel').val('');\n \t\t$( \"#barcode\" ).focus();\n \t\t$(\".journal ul li\").remove();\n \t\t$('.simpleCart_total').val('0.00');\n \t\t$('.tablenum').hide();\n \t\t$( \".tablenum span\" ).text(\"\");\n \t\t$( \".parkkey\" ).text('TABLES');\n getattachment('0');\n $.modal.close();\n }", "title": "" }, { "docid": "b479c765e415cc56f7cdf55610058ccf", "score": "0.5487196", "text": "function removeModal() {\n if (current !== null) {\n ArView.manageAr({all: true});\n return current.remove();\n } else {\n return $q.reject('No active modal to remove');\n }\n }", "title": "" }, { "docid": "0e0d8c7e74d9195e2ea4afd7b826da5b", "score": "0.5485899", "text": "function closecreateEntryModal() {\n\n var modalBackdrop = document.getElementById('modal-backdrop');\n var createEntryModal = document.getElementById('create-entry-modal');\n\n // Hide the modal and its backdrop\n modalBackdrop.classList.add('hidden');\n createEntryModal.classList.add('hidden');\n\n clearEntryInputValues();\n\n}", "title": "" }, { "docid": "870c94bd417b523b480a7a74de0f84af", "score": "0.54842347", "text": "function closeEntityModal(modelId) {\n $(modelId).hide();\n}", "title": "" }, { "docid": "92878603fedb94b538d4b96cbd18938a", "score": "0.5481361", "text": "function deleteApplianceModal(id) {\n console.log(id);\n modalMessage('Odstrániť zariadenie?', \"deleteAppliance('\" + id + \"')\", 'appliancesForm');\n}", "title": "" }, { "docid": "02736d8afe5f852414d6421f1e081673", "score": "0.54794973", "text": "function outsideClickGetCompanyCoupons(e){\n\t\t\tif(e.target == GetCompanyCouponsModal){\n\t\t\t\tGetCompanyCouponsModal.style.display = 'none';\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3172fc823b0376688f03655dccaf9712", "score": "0.5475461", "text": "function removePayment(id = null) \n{\n\tif(id) {\n\t\t$(\"#removePaymentBtn\").unbind('click').bind('click', function() {\n\t\t\t$.ajax({\n\t\t\t\turl: 'accounting/removePayment/'+id,\n\t\t\t\ttype: 'post',\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess:function(response) {\t\t\t\t\n\n\t\t\t\t\tif(response.success == true) {\n\t\t\t\t\t\t$(\"#removePayment\").modal('hide');\n\n\t\t\t\t\t\t$(\"#remove-payment-message\").html('<div class=\"alert alert-success alert-dismissible\" role=\"alert\">'+\n\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\n\t\t\t\t\t\t response.messages + \n\t\t\t\t\t\t'</div>');\n\n\t\t\t\t\t\tmanagePaymentTable.ajax.reload(null, false);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$(\"#remove-payment-message\").html('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">'+\n\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\n\t\t\t\t\t\t response.messages + \n\t\t\t\t\t\t'</div>');\n\t\t\t\t\t}\n\t\t\t\t} // /.success\n\t\t\t});\t // /.ajax\n\t\t});\n\t}\n}", "title": "" }, { "docid": "62d66e5b83330c242909e1b8597a35f3", "score": "0.5472868", "text": "function update_modal_data(element, data) {\n // show the mdodal\n $(\"#delete_title\").text(data[\"title\"]);\n $('#deleteModal').modal('toggle');\n\n // get the id of the assessment\n let assessment_data = $(element).val().split(\",\");\n\n let assessment_id = assessment_data[0];\n let assessment_name = assessment_data[1];\n\n // message body\n $(\"#modal-delete-assessment-body\")\n .empty()\n .append(`<p>${data[\"bodyMsg\"]}<strong>${assessment_name}</strong>?</p>`);\n\n // Button text\n $(\"#remove_submit\").text(`Move Assessment to Archive`);\n\n if (data[\"action\"] == 'D') {\n $(\"#formDelete\").attr(\"action\", `/professor/assessment/${assessment_id}?_method=DELETE`);\n } else {\n $(\"#formDelete\").attr(\"action\", `/professor/assessment/changeStatus/${assessment_id}?_method=PUT`);\n }\n // change the action of form\n}", "title": "" }, { "docid": "d78bd98618c32be68ffdc9c6c17944a2", "score": "0.54654783", "text": "function deleteDepto(iddepto, nameDepto){ \n document.formDeleteDepto.deptoId.value = iddepto;\n document.formDeleteDepto.nameDepto.value = nameDepto;\n document.formDeleteDepto.Accion.value = \"eliminar\";\n $('#myModalDelete').on('shown.bs.modal', function () {\n $('#myInput').focus()\n });\n }", "title": "" }, { "docid": "0be8028b98bf66acd9242da28391f16d", "score": "0.5463211", "text": "function removeBoat() {\n $.ajax({\n url: '/api/boat/' + boatIdtoDelete,\n type: 'DELETE',\n success: function () {\n getNames();\n $('#confirm').modal('hide');\n\n },\n error: function () {\n alert('Something went wrong!!');\n }\n });\n}", "title": "" }, { "docid": "6e6dd40a978ced17df5396a6fa8fcca0", "score": "0.54609793", "text": "function limpiar_modal(){\n $('#formSede').val('')\n $('#formDir').val('')\n $('#selectPais').val('0')\n $('#selectCiudad').empty()\n }", "title": "" }, { "docid": "5e31fe453cd67f8d97579b1f7e496574", "score": "0.5460285", "text": "function clearTenancyHouseholdModal() {\n $('#selLeadTenantRelationship').val('1');\n $('#selJointTenantRelationship').val('1');\n $('#selectedHouseholdPersonId').val('');\n $('#selectedHouseholdPersonDisplay').val('');\n\n}", "title": "" }, { "docid": "4011049f74e9d8444cf2982c8c0f8060", "score": "0.5453105", "text": "_order_canceled(event) {\n const order = event.detail;\n\n this.$.modal.modal_text = 'Are you sure you want to remove this order?';\n this.$.modal.on_close_callback = (accepted) => {\n if (!accepted)\n return;\n\n this.$.trader_state.cancel_order(order);\n };\n this.$.modal.show();\n }", "title": "" }, { "docid": "001c58f63d1d7ade2497e2880b706747", "score": "0.54526246", "text": "function subtractrow(i){ \n\n verificarCod = $('#deploy_'+i).val();\n \n row = $('#row_'+i).val();\n\n\n if(verificarCod != ''){\n \n id_sw = 'id_sw=' + i;\n\n\n $.ajax({\n type:\"GET\",\n url:\"renglon_comp/renglon_destroy.php\",\n data:id_sw,\n })\n .done(function(resultado){\n\n $('#row_'+i).remove();\n\n alertify.success(\"Se elimino con exito!\");\n setInputTotal();\n\n })\n .fail(function(resultado){\n alertify.error(\"Hubo un fallo!\");\n\n })\n \n }\n }", "title": "" }, { "docid": "4820f64b169c7901b265e3d7ffc69424", "score": "0.5451779", "text": "function cancelNewUnit(event) {\n var deliverableModel;\n deliverableModel = event.data.param1;\n// addDeliverableModel(deliverableModel);\n $(\"#insertRow\").remove();\n }", "title": "" }, { "docid": "e367474e05131c329426f46f413c9aa8", "score": "0.5446987", "text": "function supprimerTache(idtache) {\n $.post(server + \"ajouttemps.php?gmba=\" + sessionStorage['session_id'], { delete: 1, idtache: idtache }, function(messageJson) {\n if (messageJson.error) {\n $(\"#texteModal\").html(\"Erreur : \" + messageJson.error);\n $('#myModal').modal('show');\n } else if (messageJson.success) {\n $(\"#texteModal\").html(messageJson.success);\n $('#myModal').modal('show');\n }\n });\n}", "title": "" }, { "docid": "a6eca6c3a626b5b517f0ce315c76d779", "score": "0.54469556", "text": "function clearItemData() {\n document.getElementById(\"modalMessage\").style.display = \"none\";\n $('#modalMessageCheck').prop('checked', false);\n $('#modalMessage').val('');\n message = \"\";\n personalization = false;\n selectedQty = 1;\n $('#modalQty :selected').text('1');\n}", "title": "" }, { "docid": "9757b43914316dd278fe1bfd0729a99b", "score": "0.5444998", "text": "function showDelete (data ,title) {\n\tbootbox.dialog ({\n\t\ttitle: function(){\n\t\t\treturn '<p>'+'<i class=\"fa fa-info-circle\" aria-hidden=\"true\" style=\"margin-right: 8px;\">'+'</i>'+ title +'</p>';\n\t\t},\n\t\tmessage: $('#popupDelete'),\n\t\tbuttons: {\n\t\t\treset: {\n\t\t\t\tlabel: \"Reset\",\n\t\t\t\tclassName: \"btn-default\",\n\t\t\t\tcallback: function () {\n\t\t\t\t\t$('#remove-owner-form')[0].reset();\n\t\t\t\t\tremoveOwnerValidator.resetForm();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tremove: {\n\t\t\t\tlabel: \"Remove Owner\",\n\t\t\t\tclassName: \"btn-warning\",\n\t\t\t\tcallback: function () {\n\t\t\t\t\tif($('#remove-owner-form').valid()) {\n\t\t\t\t\t\tshowLoading();\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\turl: 'removeOwner.html',\n\t\t\t\t\t type: 'POST',\n\t\t\t\t\t dataType: 'json',\n\t\t\t\t\t data:{\n\t\t\t\t\t \trestaurantId: $(data).attr('resId'),\n\t\t\t\t\t \tuserId: $(data).attr('userId'),\n\t\t\t\t\t \tanswer: $(\"#remove-owner-content\").val()\n\t\t\t\t\t },\n\t\t\t\t\t success: function(rs, textStatus, xhr) {\n\t\t\t\t\t \tif(rs.msg) {\n\t\t\t\t\t \t\t$('#request-owner-datatable').DataTable().draw();\n\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\tshowPopup(crud.information, \"Remove Owner Success!\", crud.added);\n\t\t\t\t\t }\n\t\t\t\t\t\t}).fail(function () {\n\t\t\t\t\t\t\tshowPopup(crud.information, \"Remove Owner Failure!\", crud.error);\n\t\t\t\t\t\t}).always (function() {\n\t\t\t\t\t\t\thideLoading();\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).on('hide.bs.modal', function(e) {\n\t\tremoveOwnerValidator.resetForm();\n\t\tclonePopUp = $('#popupDelete').clone();\n\t}).on('hidden.bs.modal', function(e) {\n\t\tremoveOwnerValidator.resetForm();\n\t\tclonePopUp.appendTo('#deleteDialog');\n\t});\n\n}", "title": "" }, { "docid": "18c2f1ea8df07ce6e46742b0050eaf03", "score": "0.5443801", "text": "function showDeleteInvestmentModal(_line) {\n\n console.log('[debug] showDeleteInvestmentModal()');\n\n // set the investmentId to be deleted\n let investment = funnelledInvestments[_line - 1];\n\n $('#deleteConfimationMessage').empty();\n $('#deleteConfimationMessage').append('<p>Delete the investment \"' + investment.name + '\" at ' + investment.bank + '</p>');\n $('#formDeleteInvestment').empty();\n $('#formDeleteInvestment').append('<button type=\"button\" class=\"btn btn-outline-primary\" onclick=\"confirmDeleteInvestment(' + _line + ');\">Confirm</button> &nbsp;');\n $('#formDeleteInvestment').append('<button type=\"button\" class=\"btn btn-outline-secondary\" data-dismiss=\"modal\">Cancel</button>');\n\n // show the new Investment modal\n $('#confirmExclusion').modal({ show: true });\n}", "title": "" }, { "docid": "533e619dc3c2adcfc6c678922802f2b6", "score": "0.54394585", "text": "removeThisModal() {\n\t this.props.removeModal();\n\t}", "title": "" }, { "docid": "b05824e19cae51bd6fa7d287731a87e8", "score": "0.54334444", "text": "function confimEliminar(idreunion) {\n try {\n $('#btndelete').val(idreunion);\n var $mdobj = $('#modalDelete');\n $mdobj.modal('show');\n } catch (e) {\n console.log('Error en confirmEliminar en js');\n }\n}", "title": "" }, { "docid": "4a7c2677623527a5854b194a0d7bed0b", "score": "0.54287547", "text": "function btnEditarUni(idunidad)\n{\n document.getElementById(\"title\").innerHTML= \"Actualizar Unidad de medida\";\n document.getElementById(\"btnAccion\").innerHTML= \"Modificar\";\n const url= base_url + \"Unidades/editar/\"+idunidad;\n const http = new XMLHttpRequest();\n http.open(\"GET\", url, true);\n http.send();\n http.onreadystatechange = function(){\n if (this.readyState == 4 && this.status ==200){\n const res = JSON.parse(this.responseText);\n document.getElementById(\"idunidad\").value = res.idunidad;\n document.getElementById(\"nombre\").value = res.nombre;\n document.getElementById(\"clave\").value = res.clave;\n document.getElementById(\"descripcion\").value = res.descripcion;\n $(\"#nuevo_unidad\").modal(\"show\");\n }\n }\n \n}", "title": "" }, { "docid": "bf09564cad64a606e18a7a645ce9c570", "score": "0.54274845", "text": "function fnAgregarCatalogoModal(){\n\t$('#divMensajeOperacion').addClass('hide');\n\n\tproceso = \"Agregar\";\n\n\t$(\"#txtClave\").prop(\"readonly\", false);\n\t$('#txtClaveId').val(\"\");\n\t$('#txtClave').val(\"\");\n\t$('#txtDescripcion').val(\"\");\n\n\tvar titulo = '<h3><span class=\"glyphicon glyphicon-info-sign\"></span> Agregar Ramo</h3>';\n\t$('#ModalUR_Titulo').empty();\n $('#ModalUR_Titulo').append(titulo);\n\t$('#ModalUR').modal('show');\n}", "title": "" }, { "docid": "be9db95f5d4aae46b71104224538e134", "score": "0.5426549", "text": "function handling_action_modal_discount() {\n $(notification_modal_discount.modal).delegate(notification_modal_discount.btn_close,'click', () => {\n notification_modal_discount.allow = false;\n action_notification_modal_discount();\n });\n }", "title": "" }, { "docid": "e9cdbede87397c0e9155e15dba0d686f", "score": "0.54171544", "text": "function delPrModal() {\n var title = document.getElementById(\"modal_title\");\n title.innerHTML = \"Delete Project \";\n\n var body = document.getElementById(\"modal_body\");\n var a = \"<div class='form-group' style='text-align:center;'>Do you want to delete this project?</div>\" + \"<div class='form-group'><div class='col-sm-offset-2 col-sm-10'>\" + \"<button class='btn btn-danger' onclick = 'call.delProject()'>Delete</button>\" + \"<button class='btn btn-primary' style = 'margin-left: 10px;' onclick = 'call.closeModal()'>Cancel</button></div>\" + \"</div>\"\n body.innerHTML = a;\n $(\"#modal_form\").bPopup();\n }", "title": "" }, { "docid": "c91590b152f1570b267c23d772e68497", "score": "0.5415221", "text": "function signUpClose() {\n signUpModal.modal(\"hide\");\n clearSignUp();\n}", "title": "" }, { "docid": "2706b0bb4b12cce75b8a0ac5d12177ad", "score": "0.5413512", "text": "function clearPositionModal(){\r\n\t$(\"#tbx_description\").val(\"\");\r\n\t$(\"#tbx_numberofpackagingunits\").val(\"\");\r\n\t$(\"#tbx_packagingunit\").val(\"\");\r\n\t$(\"#tbx_weightpackagingunit\").val(\"\");\r\n\t$(\"#tbx_mdd\").val(\"\");\r\n\t$(\"#tbx_pricepackagingunit\").val(\"\");\r\n}", "title": "" }, { "docid": "ca3fcbe80a70861a17d6e89e2e595269", "score": "0.5403182", "text": "function incluirHabilidades(){\n dialogCadastro = document.getElementById(\"abreInclusaoHabilidades\");\n dialogPolyfill.registerDialog(dialogCadastro);\n dialogCadastro.showModal();\n selectPessoas();\n selectHabilidades();\n}", "title": "" }, { "docid": "540f53595a9a73dbf355e7f3057981c6", "score": "0.5403135", "text": "function rimuoviEsame(idEsame){\n $(\"#dettEsameMod .modal-title\").html(\"Eliminazione dell'Esame\");\n $(\"#dettEsameMod .modal-body\").children().remove();\n $(\"#btnSalvaModifiche\").show().html(\"Conferma Rimozione\");\n \n clickSalvaModifiche();\n\n let cod = \"\";\n cod += '<div class=\"row\">';\n cod += '<div class=\"col-sm-12 col-md-12 col-lg-12 text-center\">';\n cod += '<p>Sei sicuro di voler rimuovere l\\'esame? Tutti i dati ad esso collegati verranno rimossi</p>';\n\n cod += '<div class=\"row\"><div class=\"col-sm-12 col-md-7 col-lg-7 mx-auto\"><div id=\"msgRimEsame\" idEsame=\"' + idEsame + '\" role=\"alert\" style=\"text-align: center;\"></div></div></div>';\n cod += '</div>';\n cod += '</div>';\n\n $(\"#dettEsameMod .modal-body\").append(cod);\n}", "title": "" }, { "docid": "0fa1f5dc567590bda0656b7af94ee788", "score": "0.54015464", "text": "function deleteExpense(id) {\n console.log(\"DELETE BUTTON WORKS\");\n }", "title": "" }, { "docid": "466ea9c0c54cd48e90f201933645d443", "score": "0.5401438", "text": "function clearLeaveModal() {\n $('#leaveModal').find('input').val(\"\");\n \n $(\"#leave_title\").text(\"Add a New Schedule\");\n\n // format modal buttons\n $('#leaveAddBtn').attr('disabled', false);\n $('#leaveAddBtn').show();\n $('#leaveUpdateBtn').attr('disabled', true);\n $('#leaveUpdateBtn').hide();\n $('#leaveDeleteBtn').attr('disable', true);\n $('#leaveDeleteBtn').hide();\n }", "title": "" }, { "docid": "af62313455b7e431a7844f6a466344e4", "score": "0.54014176", "text": "function cancelModal() {\r\n $(\".modalContainer\").remove();\r\n}", "title": "" }, { "docid": "5ff625e75bb03b3b39fcf0441b277d1b", "score": "0.5401147", "text": "function closeModal() {\n $uibModalInstance.dismiss('cancel');\n }", "title": "" }, { "docid": "6581230508860314744c92511f68d8ac", "score": "0.5397759", "text": "function buycloseModal(){\n buymodal.style.display='none';\n }", "title": "" }, { "docid": "06c288ff8179899bd4f8de3d66b7b77b", "score": "0.5395982", "text": "function addIncomeToTable() {\r\n var table = document.getElementById(\"incomeTable\");\r\n var row = table.insertRow(index_income);\r\n var cell1 = row.insertCell(0);\r\n var cell2 = row.insertCell(1);\r\n var cell3 = row.insertCell(2);\r\n cell1.innerHTML = name_incomes[name_incomes.length - 1];\r\n cell2.innerHTML = sum_incomes[sum_incomes.length - 1];\r\n cell3.innerHTML = '<button onclick=\"removeItemIncome('+String(index_income)+')\">X</button>';\r\n index_income += 1;\r\n }", "title": "" }, { "docid": "9777583502c63d2e4391e52745571ba7", "score": "0.5389221", "text": "function deletingDataModal(recipeID) {\n recipeId.value = recipeCollection.deletecurrentRecipe(recipeID);\n recipeCollection.deletecurrentRecipe(recipeID);\n recipeCollection.save();\n clearFormValues();\n addRecipeItemsToBody();\n console.log(recipeCollection.recipe);\n}", "title": "" }, { "docid": "639880fc801f7ce12b32b108d2c04118", "score": "0.5388808", "text": "function showConfirmDecline() {\n $(confirmDeleteModal).modal();\n }", "title": "" }, { "docid": "d9753dfd788d3ee399db6288dad46744", "score": "0.53869736", "text": "resetAddBadgePopup(event) {\n $('#input-client-badge').val('');\n const clientId = $(event.target).closest(\"tr\").data(\"client-id\");\n $('input[name=\"clientId\"]').val(clientId);\n const testDayId = $(event.target).closest(\"tr\").data(\"test-day-id\");\n $('input[name=\"testDayId\"]').val(testDayId);\n }", "title": "" }, { "docid": "3ab67d8ffaa2a5f8ecb48336a72818e2", "score": "0.53859204", "text": "function outsideClickUpdateCompany(e){\n\t\t\tif(e.target == UpdateCompanyModal){\n\t\t\t\tUpdateCompanyModal.style.display = 'none';\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f1dce083f9a73c0b28bbd68eb0dd1e11", "score": "0.53845793", "text": "function askDeletePackage ()\r\n{\r\n\tevent.stopPropagation();\r\n\r\n\t// Get the delete modal\r\n\tvar modal = document.getElementById('deleteModal');\r\n\r\n\t// Create the modal content\r\n\tvar modalContent = document.createElement('div');\r\n\tmodalContent.setAttribute(\"id\", \"deleteModalContent\");\r\n\tmodalContent.setAttribute(\"class\", \"modal-content\");\r\n\r\n\tmodal.appendChild(modalContent);\r\n\r\n\t// Create the modal header\r\n\tvar modalHeader = document.createElement('div');\r\n\tmodalHeader.setAttribute(\"id\", \"deleteModalHeader\");\r\n\tmodalHeader.setAttribute(\"class\", \"modal-header\");\r\n\r\n\tvar title = document.createElement(\"h2\");\r\n\ttitle.appendChild(document.createTextNode(\"Suppression d'un domaine\"));\r\n\tmodalHeader.appendChild(title);\r\n\r\n\t// Create the <span> element that closes the modal\r\n\tvar span = document.createElement(\"span\");\r\n\tspan.setAttribute(\"class\", \"close\");\r\n\tspan.appendChild(document.createTextNode(\"x\"));\r\n\tmodalHeader.appendChild(span)\r\n\r\n\t// When the user clicks on <span> (x), close the modal\r\n\tspan.onclick = function() {\r\n\t\tmodal.removeChild(modalContent);\r\n\t\tmodal.style.display = \"none\";\r\n\t}\r\n\r\n\tmodalContent.appendChild(modalHeader);\r\n\r\n\t// Create the modal body\r\n\tvar modalBody = document.createElement('div');\r\n\tmodalBody.setAttribute(\"id\", \"deleteModalBody\");\r\n\tmodalBody.setAttribute(\"class\", \"modal-body\");\r\n\t\r\n\tvar body = document.createElement(\"p\");\r\n\tbody.appendChild(document.createTextNode(\"Vous êtes sur le point de supprimer un package de la base de donnée. Êtes-vous sûr de vouloir continuer ?\"));\r\n\tmodalBody.appendChild(body);\r\n\r\n\tmodalContent.appendChild(modalBody);\r\n\r\n\t// Create the modal footer\r\n\tvar modalFooter = document.createElement('div');\r\n\tmodalFooter.setAttribute(\"id\", \"deleteModalFooter\");\r\n\tmodalFooter.setAttribute(\"class\", \"modal-footer\");\r\n\t\r\n\t// Create the yes button to proceed deletion\r\n\tvar yesButton = document.createElement(\"button\");\r\n\tyesButton.setAttribute(\"id\", \"Oui Modal\");\r\n\tyesButton.appendChild(document.createTextNode(\"Oui\"));\r\n\r\n\t// Proceed to deletion\r\n\tyesButton.onclick = function() {\r\n\t\t$.ajax({\r\n url: '/deletePackage',\r\n type: 'POST',\r\n data: {\r\n arr: [ \t\r\n \t\t \tpackageID\r\n ]\r\n },\r\n success: function(data){\r\n console.log(data);\r\n\t\t\t\tlocation.reload(true); // Reload the page to print the new database\r\n }\r\n });\r\n\t\tconsole.log (\"Package to delete: \", packageID);\r\n\t\tmodal.removeChild(modalContent);\r\n\t\tmodal.style.display = \"none\";\r\n\t}\r\n\tmodalFooter.appendChild(yesButton);\r\n\r\n\tmodalContent.appendChild(modalFooter);\r\n\r\n\t// Create the no button to cancel deletion\r\n\tvar noButton = document.createElement(\"button\");\r\n\tnoButton.setAttribute(\"id\", \"Non Modal\");\r\n\tnoButton.appendChild(document.createTextNode(\"Non\"));\r\n\r\n\t// Cancel deletion\r\n\tnoButton.onclick = function() {\r\n\t\tmodal.removeChild(modalContent);\r\n\t\tmodal.style.display = \"none\";\r\n\t}\r\n\tmodalFooter.appendChild(noButton);\r\n\r\n\r\n\t// When the user clicks anywhere outside of the modal, close it\r\n\twindow.onclick = function(event) {\r\n\t\tif (event.target == modal) {\r\n\t\t\tmodal.removeChild(modalContent);\r\n\t\t\tmodal.style.display = \"none\";\r\n\t\t}\r\n\t}\r\n\r\n\tmodal.style.display = \"block\";\r\n}", "title": "" } ]
48615c81b1ad0e379b9daafa9d763cda
TEST DIRECTORIES const sourcePath = path.join('C:/Users/Anthony Radin/Desktop/images'); const outputPath = path.join('C:/Users/Anthony Radin/Desktop/output'); CONSOLE STATS
[ { "docid": "fa4c497adcfe6311969e2e73d909234a", "score": "0.49752557", "text": "function updateConsole(imageArray, folderArray) {\n var photoCount = document.getElementById('photo-count');\n var folderCount = document.getElementById('folder-count');\n \n photoCount.innerHTML = imageArray.length;\n folderCount.innerHTML = folderArray.length;\n}", "title": "" } ]
[ { "docid": "564f312b483f497d379418146f2706dc", "score": "0.6457006", "text": "async function main(){\n\tconst dir = fs.readdirSync('./input/screenshots')\n\t\t.sort((a, b) => parseInt(a.split('.')[0]) - parseInt(b.split('.')[0]));\n\tconst x = Math.ceil(Math.sqrt(dir.length));\n\tconst y = x + Number(x === Math.sqrt(dir.length));\n\n\tconst canvas = createCanvas(x * xW, y * yW);\n\tconst context = canvas.getContext('2d');\n\n\tlet curX = 0;\n\tlet curY = 0;\n\tfor (const img of dir){\n\t\tconst image = await loadImage('./input/screenshots/' + img);\n\t\tcontext.drawImage(\n\t\t\timage,\t\t//The screenshot taken\n\t\t\t1325,\t//The leftmost pixel to extract image from\n\t\t\t135,\t//The topmost pixel to extract image from\n\t\t\txW,\t\t\t//Line 4\n\t\t\tyW,\t\t\t//Line 5\n\t\t\tcurX,\t\t//Current X position to draw (don't edit below this)\n\t\t\tcurY,\t\t//Current Y position to draw\n\t\t\txW,\t\t\t//Line 4\n\t\t\tyW\t\t\t//Line 5\n\t\t);\n\n\t\tconsole.log('Drew ' + img);\n\n\t\tcurX += xW;\n\t\tif (curX === x * xW) {\n\t\t\tcurX = 0;\n\t\t\tcurY += yW;\n\t\t}\n\t}\n\n\tfs.writeFileSync('./output.png', canvas.toBuffer('image/png'));\n}", "title": "" }, { "docid": "151c8c988b50c30d88f238b7c3403ae8", "score": "0.6191403", "text": "onTestResult(testRunConfig, testResults) {\n for (const test of testResults.testResults) {\n if (test.status === \"failed\") {\n const name = test.title.replace(/[ \\.']/g, \"_\");\n let desc = test.fullName\n .replace(\".html\", \"\")\n .replace(/ /g, \"_\");\n desc = desc.slice(0, desc.length - name.length - 1);\n const candidates = [\n `${testRunConfig.path.split(\"/test\")[0]}/test/screenshots/${\n paths.RESULTS_TAGNAME\n }/${desc}/${name}.diff.png`,\n `test/screenshots/${desc}/${name}.diff.png`,\n `${testRunConfig.path.split(\"/test\")[0]}/test/screenshots/${\n paths.RESULTS_TAGNAME\n }/${desc}/${name}.failed.png`,\n `test/screenshots/${desc}/${name}.failed.png`,\n `${testRunConfig.path.split(\"/test\")[0]}/test/screenshots/${\n paths.RESULTS_TAGNAME\n }/${desc}/${name}.png`,\n `test/screenshots/${desc}/${name}.png`,\n ];\n\n for (const filename of candidates) {\n if (fs.existsSync(filename)) {\n this.write_img(\n test.title,\n test.ancestorTitles,\n filename\n );\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "5bf684ed633d3a34a0275d1978552cbb", "score": "0.6099874", "text": "function imagePath(example){\n return imagesDir + example + '.png';\n}", "title": "" }, { "docid": "47877c07edd3b679b3ef5bb456f02a19", "score": "0.6089995", "text": "function getTestDirPath() {\n return \"../data/\";\n}", "title": "" }, { "docid": "e2a479154803e627185ff9528edf00f1", "score": "0.5539021", "text": "function buildOutputFileName (test) {\n let fileName = clearString(test.title);\n if (test.ctx && test.ctx.test && test.ctx.test.type === 'hook') {\n fileName += clearString(`_${test.ctx.test.title}`);\n }\n return screenshotOutputFolder(fileName);\n}", "title": "" }, { "docid": "a815550a0378df65bf3060e2699c6d1f", "score": "0.54932934", "text": "function generatePSDs() {\n\tif (sourceFolder != null)\n\t{\t\t\n\t// Check that valid files are available\n\tfor (var i = 0; i < fileListPNG.length; i++)\n\t{\n\t\tfileNameExt = fileListPNG[i].toString().match(reValidName);\n\t\t// if this is a valid filename\n\t\tif (fileNameExt != null)\n\t\t{\n\t\t\tjvNameArr.push(fileListPNG[i]);\n\t\t}\n\t}\n\n\t// stop execution if sources are not even number\n\tif (isOdd(jvNameArr.length))\n\t{\n\t\talert(\"Source file count error: \" + jvNameArr.length);\n\t\treturn;\n\t}\n\n\t\t// Process all cam files\n\tfor (var i = 0; i < jvNameArr.length; i++)\n\t{\n\t\tfileNameExt = fileListPNG[i].toString().match(reValidName);\t\t\t\n\t\tjvNameStr = fileNameExt.toString().substr(1,6);\n\t\tif (fileNameExt.toString().match(\"cam\"))\n\t\t{\n\t\t\tif (fileNameExt.toString().match(\"_200x216\"))\n\t\t\t{\n\t\t\t\tpTemplate200x216Doc = app.open(source200x216PSD);\n\t\t\t\tcreate200x216(i);\n\t\t\t}\n\t\t\telse if (fileNameExt.toString().match(\"_320x480\"))\n\t\t\t{\n\t\t\t\tpTemplate320x480Doc = app.open(source320x480PSD);\n\t\t\t\tcreate320x480(i);\n\t\t\t}\n\t\t\telse if (fileNameExt.toString().match(\"_320x240\"))\n\t\t\t{\n\t\t\t\tpTemplate320x240Doc = app.open(source320x240PSD);\n\t\t\t\tcreate320x240(i);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t\talert(\"Weird png found \" + i);\n\t\t\t}\n\n\t\t}\n\t}\n\t}\n}", "title": "" }, { "docid": "0668735dc7690e04723cf814d2f5a3f6", "score": "0.5466597", "text": "function createTestDirs () {\n console.log(__dirname)\n}", "title": "" }, { "docid": "7988e92be674543ad352bb0946e1dff0", "score": "0.544375", "text": "log(src = this.src, output = this.output) {\n logger\n .heading(`Fetching ${_.capitalize(this.name)} Source Files...`)\n .filesPath(src.path || src, true);\n\n if (output) {\n logger\n .heading('Saving To...')\n .filesPath(output.path || output);\n }\n }", "title": "" }, { "docid": "14ad8b387c61893f75c1a4f81a57bd80", "score": "0.5391553", "text": "function resolveDefaultImagePath() {\n var defaultImagePath = _resolvePath();\n defaultImagePath = defaultImagePath.substring(0, defaultImagePath.lastIndexOf(Packages.java.io.File.separator));\n java.lang.System.out.println(\"set default path for images to the test case folder \\\"\" + defaultImagePath + \"\\\"\");\n return defaultImagePath;\n }", "title": "" }, { "docid": "6930434f40b67a9bdb6a0376bb8f93bd", "score": "0.5384058", "text": "function testAndAddIntoImages(fileStats) {\n\tif(fileStats.path.match(regexForImage)) {\n\t\tallImages.push({\n\t\t\tpath : fileStats.path,\n\t\t\tsize : fileStats.size\n\t\t});\n\t}\n\telse if(fileStats.path.match(regexForCSS)) {\n\t\tallCSSFiles.push({\n\t\t\tpath : fileStats.path,\n\t\t\tsize : fileStats.size\n\t\t});\n\t}\n\n}", "title": "" }, { "docid": "24a4293a6a07d9287464b5ecdebc37c1", "score": "0.5370918", "text": "function images() {\n if (pauseProcessing) return;\n\n return gulp.src(\"./dev/images/**/*\")\n .pipe(gulp.dest(\"./public/content/images/\"))\n .pipe(gulp.dest(\"./release/content/Content/ExtendedControls/images/\"));\n}", "title": "" }, { "docid": "24cf345c416e16c663b5e9db94556acd", "score": "0.5367547", "text": "function tomiImageSample(startPosition, endPosition, xInterval, yInterval, circleSize, theFolderVar, myIndexx) {\r\r\r var sourceName = theFolderVar.item(parseInt(myIndexx + 1)).name;\r\ralert(sourceName);\r var myComp = app.project.activeItem;\r var myNull = myComp.layers.addNull();\r\r\r\r var startPosition = startPosition\r var endPosition = endPosition;\r var xInterval = xInterval\r var yInterval = yInterval;\r\r\r\r var xSize = endPosition[0] - startPosition[0];\r var ySize = endPosition[1] - startPosition[1];\r\r\r var xTimes = Math.floor(xSize / xInterval);\r var yTimes = Math.floor(ySize / yInterval);\r\r\r var gridCount = xTimes * yTimes;\r //alert([gridCount, xTimes, yTimes]);\r\r\r\r if (circleSize == null) {\r var circleSize = xInterval / 2;\r } else {\r var circleSize = circleSize\r };\r\r\r\r var capturedData = \"\";\r\r //start of calc loop\r var nothingCounter = 0;\r \r \r for (i = 0; i < gridCount; i++) {\r var positionToInspect = startPosition + [(i % xTimes) * xInterval, Math.floor(i / xTimes) * yInterval];\r //alert(positionToInspect);\r var myExp = 'target = comp(\"' + sourceName + '\").layer(1);\\nresult=target.sampleImage([' + positionToInspect[0] + ',' + positionToInspect[1] + '], [.5, .5]/2, true, time);\\n[(result[1]+result[2]+result[0]/3),result[3]];'\r myNull.property(\"position\").expression = myExp;\r //alert(myNull.property(\"rotation\").valueAtTime(0, false));\r var myFoundAlpha = parseFloat(myNull.property(\"position\").valueAtTime(0, false)[1]);\r //alert(myFoundVal);\r\r if (myFoundAlpha == 1) { //something is there ... do something\r //alert(\"triggered\")\r var myFoundVal = parseFloat(myNull.property(\"position\").valueAtTime(0, false)[0]);\r\r //if over a certain amount, put it in the list\r if (myFoundVal <= .6) {\r capturedData += positionToInspect[0] + \":\" + positionToInspect[1] + \",\";\r }\r\r } else \r \r { //nothin is ther, keep count\r nothingCounter++;\r if (nothingCounter % 100 == 0) {\r //alert(nothingCounter +\" out of \"+ gridCount);\r }\r\r\r }//end of found alphaElse case \r \r \r }//end of gridCount\r\r\r\rmyNull.remove();\r//alert(capturedData+\" aye\");\r\r var myChangeToTheText = capturedData.split(\"\");\r myChangeToTheText.pop();\r //myChangeToTheText.push('\"');\r\r var brandNewText = myChangeToTheText.join(\"\");\r return brandNewText;\r\r\r}", "title": "" }, { "docid": "a78659c997b3c0a7f0196579a4791a11", "score": "0.53609794", "text": "function main(){\n\n\t// get version from our animatics name\n\tvar version = animaticName.split('_');\n\tversion = version[version.length - 1];\n\tversion = version.split('.');\n\tversion = version[0];\n\n\tvar animaticAFX = animaticFolder + episodeName + \"_ATK_\" + version + \".aep\";\n\n\t// set path to output folder\n\t// (ex. W:\\PROJECTNAME\\05_PROD\\EPISODES\\EP003_TEST\\02_ANIMATIC\\v##\\)\n\tvar outputFolderPath = animaticFolder + version + \"\\\\\";\n\n\t// check that outputFolder exisits && otherwise create it\n\tvar outputFolder = new Folder(outputFolderPath);\n\n\tif(!outputFolder.exists){\n\t\toutputFolder.create();\n\t}\n\n\t// continue ONLY if the loading of the xml has been done successfully\n\tif(xmlList = LoadXML(animaticXML)){\n\n\t\t// get the episodes duration\n\t\tvar episodeDuration = (xmlList.@duration);\n\n\t\t// create the compositing file from the full animatic\n\t\tanimaticComp = setupProject(animaticMOV, animaticAFX, episodeDuration);\n\n\t\t// get all shots from the xml\n\t\tvar shots = xmlList.elements().elements();\n\n\t\t// Read through the episodes sub nodes\n\t\tfor (var i=0; i < shots.length(); i++){\n\n\t\t\t// get the shot information from xml\n\t\t\tvar shotName = shots[i].@name;\n\t\t\tvar start = shots[i].@framein;\n\t\t\tvar end = shots[i].@frameout;\n\t\t\tvar shotDuration = shots[i].@duration;\n\t\t\tvar sequenceName = shots[i].@attachedto;\n\n\t\t\t// set the output file name\n\t\t\tvar outputFileName = episodeName+\"_\"+sequenceName+\"_\"+shotName+\"_ATK_\"+version+\".mov\";\n\n\t\t\t// set output file path\n\t\t\tvar outputFilePath = outputFolderPath + outputFileName;\n\n\t\t\t// check if the output file path already exists\n\t\t\tvar filePath = new File(outputFilePath);\n\t\t\tif(filePath.exists){\n\t\t\t\toutputFileName = episodeName+\"_\"+sequenceName+\"_\"+shotName+\"_ATK_\"+version+\"_recut.mov\";\n\t\t\t\toutputFilePath = outputFolderPath + outputFileName;\n\t\t\t}\n\n\t\t\trenderAnimatic(animaticComp, outputFilePath, start, end, shotDuration); \n\t\t}\n\t}\n\telse{\n\n alert(\"Error : the file : '\"+animaticXML+\"' can't be loaded.\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "2add2b1d3fef8d8b4dffc1141952387f", "score": "0.5357165", "text": "function _getActualImagePath() {\n\n const imageName = browser.imageComparisonName;\n\n return path.join('screenshots/actual/', imageName);\n}", "title": "" }, { "docid": "0303ce69d7a6ef41b3f59932137ad05a", "score": "0.5354855", "text": "static run () {\n\t\tconsole.log(`##### Reconciling the PNG tokens against the bestiary JSON #####`);\n\n\t\t// Loop through each bestiary JSON file push the list of expected PNG files.\n\t\tfs.readdirSync(\"./data/bestiary\")\n\t\t\t.filter(file => file.startsWith(\"bestiary\") && file.endsWith(\".json\"))\n\t\t\t.forEach(file => {\n\t\t\t\tconst result = JSON.parse(fs.readFileSync(`./data/bestiary/${file}`));\n\t\t\t\tresult.monster.forEach(m => {\n\t\t\t\t\tconst source = Parser.sourceJsonToAbv(m.source);\n\t\t\t\t\tconst implicitTokenPath = `${source}/${Parser.nameToTokenName(m.name)}.png`;\n\n\t\t\t\t\tif (m.hasToken) this.expectedFromHashToken[implicitTokenPath] = true;\n\n\t\t\t\t\tif (fs.existsSync(`./img/${source}`)) {\n\t\t\t\t\t\tthis.expected.add(implicitTokenPath);\n\n\t\t\t\t\t\t// add tokens specified as part of variants\n\t\t\t\t\t\tif (m.variant) {\n\t\t\t\t\t\t\tm.variant.filter(it => it.token).forEach(entry => this.expected.add(`${Parser.sourceJsonToAbv(entry.token.source)}/${Parser.nameToTokenName(entry.token.name)}.png`));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// add tokens specified as alt art\n\t\t\t\t\t\tif (m.altArt) {\n\t\t\t\t\t\t\tm.altArt.forEach(alt => this.expected.add(`${Parser.sourceJsonToAbv(alt.source)}/${Parser.nameToTokenName(alt.name)}.png`));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else this.expectedDirs[source] = true;\n\t\t\t\t});\n\t\t\t});\n\n\t\tconst IGNORED_PREFIXES = [\n\t\t\t\".\",\n\t\t\t\"_\",\n\t\t];\n\n\t\tconst IGNORED_EXTENSIONS = [\n\t\t\t\".git\",\n\t\t\t\".gitignore\",\n\t\t\t\".png\",\n\t\t\t\".txt\",\n\t\t];\n\n\t\tconst IGNORED_DIRS = new Set([\n\t\t\t\"adventure\",\n\t\t\t\"backgrounds\",\n\t\t\t\"dmscreen\",\n\t\t\t\"deities\",\n\t\t\t\"variantrules\",\n\t\t\t\"rules\",\n\t\t\t\"objects\",\n\t\t\t\"bestiary\",\n\t\t\t\"roll20\",\n\t\t\t\"book\",\n\t\t\t\"items\",\n\t\t\t\"races\",\n\t\t\t\"vehicles\",\n\t\t\t\"characters\",\n\t\t\t\"conditionsdiseases\",\n\t\t\t\"languages\",\n\t\t\t\"plutonium\",\n\t\t\t\"covers\",\n\t\t\t\"spells\",\n\t\t\t\"charcreationoptions\",\n\t\t\t\"recipes\",\n\t\t\t\"feats\",\n\t\t]);\n\n\t\tfs.readdirSync(\"./img\")\n\t\t\t.filter(file => !(IGNORED_PREFIXES.some(it => file.startsWith(it) || IGNORED_EXTENSIONS.some(it => file.endsWith(it)))))\n\t\t\t.forEach(dir => {\n\t\t\t\tif (!IGNORED_DIRS.has(dir)) {\n\t\t\t\t\tfs.readdirSync(`./img/${dir}`).forEach(file => {\n\t\t\t\t\t\tthis.existing.add(`${dir.replace(\"(\", \"\").replace(\")\", \"\")}/${file}`);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\tconst results = [];\n\t\tthis.expected.forEach((img) => {\n\t\t\tif (!this.existing.has(img)) results.push(`[ MISSING] ${img}`);\n\t\t});\n\t\tthis.existing.forEach((img) => {\n\t\t\tdelete this.expectedFromHashToken[img];\n\t\t\tif (!this.expected.has(img)) {\n\t\t\t\tif (this._IS_CLEAN_MM_EXTRAS && this._isMmToken(img)) {\n\t\t\t\t\tfs.unlinkSync(`./img/${img}`);\n\t\t\t\t\tresults.push(`[ !DELETE] ${img}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tresults.push(`[ EXTRA] ${img}`);\n\t\t\t}\n\t\t});\n\n\t\tObject.keys(this.expectedDirs).forEach(k => results.push(`Directory ${k} doesn't exist!`));\n\t\tresults\n\t\t\t.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))\n\t\t\t.forEach((img) => console.warn(img));\n\n\t\tif (Object.keys(this.expectedFromHashToken).length) console.warn(`Declared in Bestiary data but not found:`);\n\t\tObject.keys(this.expectedFromHashToken).forEach(img => console.warn(`[MISMATCH] ${img}`));\n\n\t\tif (!this.expected.size && !Object.keys(this.expectedFromHashToken).length) console.log(\"Tokens are as expected.\");\n\n\t\treturn !!this.expected.size;\n\t}", "title": "" }, { "docid": "a90ed60a7511599c64fd727e40c356ce", "score": "0.5338849", "text": "function buildImages() {\n return src(paths.devImages)\n .pipe(gulp.dest(\"dist/img\"))\n}", "title": "" }, { "docid": "8811bd0d0b9c4dcea8bccbb9a9bc9748", "score": "0.5336229", "text": "function sourcePath() {\n var path = \"\";\n var source = \"\";\n //var countLike = 0;\n if (arr.video != null) {\n path = `\"./Sample Photos/${photographerName}/${arr.video}\"`\n source = `<video src=${path} type=\"video/mp4\" \n title= \"Video de ${arr.title}\"\n class=\"modal_lightbox\" data-id=\"${arr.id}\" aria-label=\"video de ${arr.title}\"></video>`\n return source;\n } else if (arr.image != null) {\n path = `\"./Sample Photos/${photographerName}/${arr.image}\"`\n source = `<img src=${path} alt=\"Photo de ${arr.title}\"\n class=\"modal_lightbox\" data-id=\"${arr.id}\">`\n return source;\n } \n }", "title": "" }, { "docid": "a20b05de6d285dad8f6b641ff7bad066", "score": "0.5333686", "text": "function getProlapse() {\n /*\n imagePrefix is the name of the image (for example, by default, it is dechet, and all my images are named \"dechet0.png\", \"dechet1.png\")\n the first image need to be 0 because the first number of the index is 0.\n */\n var imagePrefix = process.env.IMAGE || 'dechet'\n try {\n var totalFile = fs.readdirSync(path.join(__dirname, 'images')).length\n var int = Math.floor(Math.random() * totalFile)\n var imageName = imagePrefix + int.toString() + '.png'\n return imageName;\n } catch (e) {\n return e.message;\n }\n}", "title": "" }, { "docid": "1150754e09bcd6864594eb95cb475544", "score": "0.5323481", "text": "function getImagePath(src) {\n const index = src.indexOf(twelvety.dir.images);\n const position = index >= 0 ? index + twelvety.dir.images.length : 0;\n const imageFilename = src.substring(position);\n return path.join(\n process.cwd(),\n twelvety.dir.input,\n twelvety.dir.images,\n imageFilename\n );\n}", "title": "" }, { "docid": "28191943e059dbaf9410d9dfd0c85d16", "score": "0.5276207", "text": "function main() {\n\toutputEl = document.getElementById(\"output2\");\n\toutputEl.innerHTML = \"Vibing. <br>\";\n\n\tvar new2El = document.createElement(\"img\"); \n \tnew2El.src = \"./img/patrick.png\"; \n\tvar src = document.getElementById(\"output2\");\n\tsrc.appendChild(new2El);\n}", "title": "" }, { "docid": "1f291c3f841e989f43793b47bb72a2d7", "score": "0.5248396", "text": "function main () {\r\n var i = 0;\r\n var importFolder = new Folder;\r\n importFolder = Folder.selectDialog(\"Open a folder\");\r\n \r\n if(importFolder == null) {\r\n alert(\"No folder selected\", \"Please run it again!\");\r\n return false;\r\n }\r\n\r\n var files = importFolder.getFiles();\r\n \r\n if(files.length < 1) {\r\n alert(\"No files detected\", \"Select folder with files dude!\");\r\n main(); // LOVE it :)\r\n } \r\n\r\n var imageFiles = getImagePaths(files);\r\n \r\n if(imageFiles.length < 1) {\r\n alert(\"No image files in this folder\", \"Dude, use folder with images, doh!\");\r\n main();\r\n }\r\n\r\n var project = app.project;\r\n var projectItem = project.rootItem;\r\n \r\n project.importFiles(imageFiles);\r\n \r\n var moduleName = prompt(\"Set module name\", \"module01\", \"\");\r\n \r\n var imageFolder = projectItem.createBin(moduleName);\r\n \r\n var slideshowSequence = project.createNewSequence(moduleName + \" Sequence\", \"id\");\r\n \r\n // we need now images from project...\r\n var importedImages = getImageProjectItems(projectItem);\r\n \r\n var videoTracks = slideshowSequence.videoTracks;\r\n\r\n var trackNoString = prompt(\"Video Track No? (like in VB from 1)\", \"1\", \"\");\r\n var trackNo = parseInt(trackNoString, 10) - 1;\r\n \r\n var videoTrackOne = videoTracks[trackNo];\r\n \r\n var time = new Time();\r\n // how many ticks is one frame\r\n time.ticks = slideshowSequence.timebase.toString();\r\n \r\n // convert ticks to seconds\r\n var frameLength = time.seconds;\r\n \r\n var startTime = 0;\r\n \r\n var thisTime = new Time();\r\n var seconds = 5;\r\n thisTime.seconds = seconds;\r\n \r\n startTime = insertImagesToTimeline(importedImages, imageFolder, startTime, videoTrackOne, frameLength);\r\n}", "title": "" }, { "docid": "22f8c46422cd41486fac288b5f2c6708", "score": "0.5231646", "text": "function TestCommandLineResources(\n){\n \n const command = \"node cli.js --json --sha256 --sha512 \" + srcs[0] + \" \" +srcs[1];\n const options = {'cwd':__dirname};\n \n require('child_process').exec(\n command,\n options,\n (error,stdout,stderr) => {\n \n stdout = JSON.parse(stdout);\n \n if(error !== null) failTest(error);\n \n if(stderr.length > 0) failTest(stderr);\n \n if(stdout.error) failTest(stdout);\n \n testShas(stdout.results,'CLI');\n \n }\n \n );\n \n}", "title": "" }, { "docid": "2172e12e51e6b70b18dc3b0ce646444e", "score": "0.52279174", "text": "function save_images() {\n\n let colours = [\"#e2d7fa\", \"#faeed7\", \"#effad7\", \"#fad7ef\", \"#fadad7\", \"#f7eade\", \"#fffac6\", \"#e0ffdb\", \"#d1fff5\", \"#e9daff\"];\n\n deleteFolderContents(output_dir);\n\n console.log(\"deleted folders\");\n\n for (let list_name in lists_by_name) {\n\n // restrict only to our currrent one otherwise there are a bazillion\n if(our_col_names.includes(list_name)){\n\n let colour = colours[getRandomIntInclusive(0, colours.length - 1)];\n let list_id = lists_by_name[list_name];\n let list_length = cards_by_id[list_id].length;\n\n console.log(list_name + \" \" + list_length);\n\n for (let i = 0; i < list_length; i++) {\n let text = cards_by_id[list_id][i];\n\n let filename = output_dir + \"/\" + prefix + \"\" + list_name + \"_\" + i + \".png\";\n console.log(\"colour \" + colour + \" list \" + list_name + \" card \" + text + \" filename \" + filename);\n const canvas = createCanvas(1000, 696);\n const ctx = canvas.getContext('2d');\n ctx.fillStyle = colour;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = \"black\";\n ctx.textAlign = \"center\";\n\n //coudl be better! https://sourcoder.blogspot.com/2012/12/text-wrapping-in-html-canvas.html\n if (text.length > 13) {\n text = text.replace(/(.{13}[^ ]* )/g, \"$1\\n\");\n }\n\n let lines = text.split('\\n');\n let x = canvas.width / 2;\n let y = canvas.height / (lines.length === 2 || lines.length === 1 ? 2 : lines.length === 3 ? 2.5 : 2.75);\n ctx.font = '80px sans-serif';\n for (let i = 0; i < lines.length; i++) {\n const textMetrics = ctx.measureText(lines[i]);\n ctx.fillText(lines[i], x, y);\n y = y + (textMetrics.emHeightAscent + textMetrics.emHeightDescent);\n }\n fs.writeFileSync(filename, canvas.toBuffer());\n }\n }\n }\n\n}", "title": "" }, { "docid": "891d209496b649a2d14a1b0a45593b1f", "score": "0.52264035", "text": "function split(name){\n exec(\"/usr/bin/gs -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300 -sOutputFile=files/\"+name+\"-images/%03d.png files/\"+name, function (error, stdout, stderr) {\n if ( error !== null ) {\n console.log(error);\n }\n else {\n // var img = fs.readFileSync('files/'+name+'.png');\n // pngs.push(name + '.png');\n }\n }); \n }", "title": "" }, { "docid": "e7d59ea9188c9de2ff43074046c70ec7", "score": "0.52195674", "text": "function prepare(mxAssetsPath, output) {\n const config = 'config'\n const images = 'images'\n const resolvedMxPath = path.resolve(__dirname, mxAssetsPath)\n if (fs.existsSync(resolvedMxPath)) {\n const configBasePath = path.join(resolvedMxPath, config)\n const imagesBasePath = path.join(resolvedMxPath, images)\n\n const out = path.resolve(`dist/${output}`)\n fs.mkdirSync(out)\n if (fs.existsSync(configBasePath)) {\n fse.copySync(configBasePath, path.join(out, config))\n } else {\n console.info(`Directory: ${configBasePath} not found. Skipping...`)\n }\n\n if (fs.existsSync(imagesBasePath)) {\n fse.copySync(imagesBasePath, path.join(out, images))\n } else {\n console.info(`Directory: ${imagesBasePath} not found. Skipping...`)\n }\n } else {\n console.error(`Directory: ${mxAssetsPath} not found. Aborting.`)\n }\n}", "title": "" }, { "docid": "5c7ccc08bff5ba03bd572b95e924cc28", "score": "0.5213258", "text": "function main() {\n\n// have the user select a folder where their images are located\nvar importFolder = new Folder;\nimportFolder = Folder.selectDialog(\"Open a folder\");\n\n// if folder is not selected, tell them to run script again\nif(importFolder == null) {\n alert(\"No folder selected\", \"Please run again\");\n return false;\n }\n\n// if folder is selected, get all the files inside of it\nvar files = importFolder.getFiles();\n\n// no files were found. rerun script and tell user to select a valid folder\nif(files.length < 1) {\n alert(\"No files detected\", \"Select a valid folder\");\n main();\n } \n\n// gets the paths for all the images in the folder\nvar imageFiles = getImagePaths(files);\n\n// if there are no image files in the folder, have the user to try again\nif(imageFiles.length < 1) {\n alert(\"No image files in this folder\", \"Try again!\");\n main();\n }\n\n// let the user decide how many seconds each image will be\nvar seconds = prompt(\"Seconds per image\", \"5\", \"\");\n\n// project setup\nvar project = app.project;\nvar projectItem = project.rootItem;\n\n// import the files we found earlier\nproject.importFiles(imageFiles);\n\n// create a Bin called \"Image Folder\"\nvar imageFolder = projectItem.createBin(\"Image Folder\");\n// create a new sequence to put our photos in\nvar slideshowSequence = project.createNewSequence(\"Your Slideshow\", \"id\");\n\n// after importing our images, we need to locate them in the project\nvar importedImages = getImageProjectItems(projectItem);\n\n\n// get list of tracks\nvar videoTracks = slideshowSequence.videoTracks;\n\n// get the first video track (where all the images will be)\nvar videoTrackOne = videoTracks[0];\n\n// the length of one frame in premiere pro time (comes in handy later)\nvar frameLength = time.seconds;\n\nvar startTime = 0;\n\n// create a new time object for easier calculations later\nvar thisTime = new Time();\nthisTime.seconds = parseInt(seconds);\n\n// move images into image folder\nfor(var e = 0; e < importedImages.length; e++) {\n importedImages[e].moveBin(imageFolder);\n // automatically scale image to fit sequence size\n importedImages[e].setScaleToFrameSize();\n // insert the current image into the slideshow sequence\n videoTrackOne.insertClip(importedImages[e], startTime);\n // change the current start time of the image\n startTime+=parseInt(seconds)+frameLength;\n // change the end pont of the current image\n videoTrackOne.clips[e].end = videoTrackOne.clips[e].start.seconds+parseInt(seconds);\n }\n\n// get all the images that were inserted to the sequence\nvar trackItems = getTrackClips(videoTrackOne);\n\nfor(var i = 0; i < trackItems.length; i++) {\n// get effect objects of the current image\nvar components = trackItems[i].components;\n\n// [motionObj, opacityObj]\nvar videoComponentObjs = getComponentObjs(components);\n\n// adjust opacity (add keys too)\nvar opacityParam = videoComponentObjs[1].opacity;\nfadeOpacity(opacityParam, 1, trackItems[i], parseInt(seconds));\n\n// get scale, position, and anchor point values\nvar positionValue = videoComponentObjs[0].position.getValue();\nvar scaleHeight = videoComponentObjs[0].scale.getValue();\nvar scaleWidth = videoComponentObjs[0].scaleWidth.getValue();\nvar anchorPointValue = videoComponentObjs[0].anchorPoint.getValue();\n\n// animate the scale of the current image (with keyframes)\nanimateScale(videoComponentObjs[0].scale, 1, trackItems[i], scaleHeight, parseInt(seconds));\n}\n}", "title": "" }, { "docid": "de8ed6ec88c3d6d7505f72679e29bbba", "score": "0.5200272", "text": "function addOutputFile() {\n listOfCommands.push('./created/'+fileName+'_'+(resolution*(16/9))+'x'+resolution+fileExtension);\n}", "title": "" }, { "docid": "5a9e9829afe1cb73f54e3f0ee1cab830", "score": "0.51924515", "text": "function cpr(source, target) {\n for (s of scandir(source)) {\n const reldir = s.path.replace(source, '') \n const tpath = path.join(target, reldir)\n const tdir = path.dirname(tpath)\n mkdirp.sync(tdir)\n cp(s.path, tpath)\n }\n}", "title": "" }, { "docid": "ed92f761fa8db0537c9cafa174cfceef", "score": "0.518905", "text": "function setup(){\r\n for (i=0; i<12; i++){\r\n imgs[i].src = \"imgs/b.png\";\r\n }\r\n if (doneList.length > 1){\r\n for(i=0; i<doneList.length; i++){\r\n doneList[i].src = \"imgs/match.png\"\r\n }\r\n }}", "title": "" }, { "docid": "b890d17f4f9282802caf65e2fd173fee", "score": "0.51787", "text": "function doStuff() {\n\tconst strings = config.words_input.value.split(\" \").map(word => word.toLowerCase());\n\tconfig.output.innerHTML = \"\";\n\n\tfor (let string of strings) {\n\t\tconst decomps = decompose(string, symbols);\n\t\tlet start = Date.now();\n\t\tlet n = 0;\n\n\t\tfor (; n < decomps.length; ++n) {\n\t\t\tconst decomp = decomps[n];\n\t\t\tconst decompNames = [];\n\n\t\t\tfor (let element of decomp) {\n\t\t\t\tconst index = symbols.indexOf(element);\n\t\t\t\tdecompNames.push(names[index]);\n\t\t\t}\n\n\t\t\tconst data = getImageData(\n\t\t\t\tdecompNames,\n\t\t\t\timages,\n\t\t\t\tparseInt(config.tile_size_input.value)\n\t\t\t);\n\n\t\t\tconst link = document.createElement(\"a\");\n\t\t\tlink.download = `${string}_${n+1}`;\n\t\t\tlink.href = data;\n\n\t\t\tconst img = document.createElement(\"img\");\n\t\t\timg.src = data;\n\n\t\t\tlink.appendChild(img);\n\t\t\tconfig.output.appendChild(link);\n\t\t}\n\n\t\tlogger(`Generating ${n} images for ${string} in ${Date.now() - start} ms`, config.logger);\n\t}\n}", "title": "" }, { "docid": "b89ab1397abfc804fc66666597da3a7d", "score": "0.5178127", "text": "function initImg(imgPath) {\n fs.createReadStream(`${imgPath}source.jpg`).pipe(fs.createWriteStream(`${imgPath}test0.jpg`));\n}", "title": "" }, { "docid": "fc2968e68298aa599d1b8d160a50220f", "score": "0.51775116", "text": "function copyFiles(sourceFolder,targetFolder)\n{\n\tconst fs = require('fs');\n\tconst path = require('path');\n\tlet dir = path.join(targetFolder + '\\\\' +'.Temp');\n\n\tif (!fs.existsSync(dir)){\n\t\tfs.mkdirSync(dir);\n\t}\n\tconsole.log(\"The folder from source: \" + String(sourceFolder) + \" hase been copied to destination: \" + String(targetFolder));\n\tconsole.log(returnAllFilesInDirectory(sourceFolder));\n\tlet len = returnAllFilesInDirectory(sourceFolder).length;\n\t\n\t//creates manifest file\n\t\n\n\tlet location = path.join(String(targetFolder) + \"\\\\\" + \".Temp\" + \"\\\\\" + \".man\" + String(Number(getLatestManifestNum(sourceFolder)) + 1) + \".rc\" )\n\tfs.appendFile(location, \"Commit \" + ((Number(getLatestManifestNum(sourceFolder))) + 1) + \".source:\\n\", function (err) {\n\t\n\t\t//throws error if could not append file \n\tif (err) throw err;\n\t});\n\t\n\t//goes through array of file paths and copies them into temp\n\tfor(let i = 0; i < len; i++){\n\t\n\t\t//gets copy of script to use function to get CPL\n\t\t//copy file to folder\n\t\tfs.copyFile(String(returnAllFilesInDirectory(sourceFolder)[i]), path.join(String(targetFolder) + \"\\\\\" + \".Temp\" + \"\\\\\" + CreateArtifact(String(returnAllFilesInDirectory(sourceFolder)[i]))), (err) => {\n\t\t\t//throws error if could not copy file to destination \n\t\tif (err) throw err;\n\t\t});\n\t\t\n\t\t//MANIFEST\n\t\t//create file info that will be stored in manifest\n\t\tlet fileInformation = CreateArtifact(String(returnAllFilesInDirectory(sourceFolder)[i])) + \"=\" + String(returnAllFilesInDirectory(sourceFolder)[i]) + \"\\n\";\n\n\t\tconsole.log(location)\n\t\tconsole.log(fileInformation)\n\t\t//appends info into files (file destination, content, error)\n\t\tfs.appendFile(location, fileInformation, function (err) {\n\t\tif (err) throw err;\n\t\t});\n\t}\n\t//append Date and time to manifest\n\tlet d = new Date();\n\tfs.appendFile(location, d + \"\\n\", function (err) {\n\t\tif (err) throw err;\n\t});\n\t\t//document.write(\"The folder from source: \" + sourceFolder + \" hase been copied to destination: \" + targetFolder);\n\t\t\n}", "title": "" }, { "docid": "76b5be3d3107557a80f60c4940952898", "score": "0.5156917", "text": "function createImageFolders() {\n\n\tconst imgFolderPaths = PATHS.IMAGE_FOLDER_PATHS;\n\n\timgFolderPaths.map(path => {\n\t\n\t\tfse.ensureDir(path, err => {\n\t\t\tconsole.log(err) // => prints 'null' if it succeeds\n\t\t})\n\t});\n} // end createImageFolders()", "title": "" }, { "docid": "2c2a1de3461f35436889aa5ce2d88566", "score": "0.5156724", "text": "_copyTestFiles() {\n var dirOk = true;\n\n try {\n mkdirp.sync('test');\n } catch (e) {\n dirOk = false;\n\n this.log('\\n' + chalk.red.bold('Couldn\\'t create directory:') + ' ' +\n chalk.magenta.bold('test'));\n this.log(chalk.yellow(e.message) + '\\n');\n }\n\n if (!dirOk) {\n return this.error(new Error('Failed to create directory: test'));\n }\n\n this.fs.copyTpl(\n this.templatePath('test/_karma.conf.js'),\n this.destinationPath('test/karma.conf.js'),\n this.props);\n\n this.fs.copyTpl(\n this.templatePath('test/_main.js'),\n this.destinationPath('test/main.js'),\n this.props);\n }", "title": "" }, { "docid": "0a6713db31041512110cdad2a8385301", "score": "0.5149851", "text": "function compareResults() {\n html.h1('Comparing petite and compiler output files ..\\n');\n var errorOccurred = false;\n\n var testList = '';\n var listItems = [];\n var results = '';\n var testFilePath, codeGenFilePath, petiteFilePath,pair;\n\n for(var i=0; i < testFiles.length; i++){\n testFilePath = path.join(params.TESTS_PATH,testFiles[i]);\n codeGenFilePath = path.join(params.CODEGEN_OUTPUT_PATH,testFiles[i].substr(0, testFiles[i].lastIndexOf('.')) + '.txt');\n petiteFilePath = path.join(params.OUTPUTS_PATH,testFiles[i].substr(0, testFiles[i].lastIndexOf('.')) + '.txt');\n\n if( typeOf(testFiles[i], 'scm') ){\n total++;\n\n if( !fs.existsSync(codeGenFilePath) ){\n fileNotFoundError(testFiles[i],codeGenFilePath);\n failCounter++;\n continue;\n }\n\n if( !fs.existsSync(petiteFilePath) ){\n fileNotFoundError(testFiles[i],petiteFilePath);\n failCounter++;\n continue;\n }\n\n listItem = sc_makeList([\"\\\"\"+testFiles[i]+\"\\\"\", \"\\\"\"+codeGenFilePath+\"\\\"\", \"\\\"\"+petiteFilePath+\"\\\"\"]);\n listItems.push(listItem);\n }\n }\n testList = sc_makeList(listItems);\n\n\n var petite = spawn('petite',['-q'],{cwd: params.compilerDirectoryPath});\n html.bold(\"> running petite on environment (\"+params.compilerDirectoryPath+')');\n\n petite.stdin.write( scm_loadCommand(compilerPath) );\n if(!errorOccurred) petite.stdin.write( scm_loadCommand(schemeUtil) );\n\n petite.stderr.on('data', function (data) {\n html.error('Oops! Error: '+ data);\n errorOccurred = true;\n petite.kill();\n });\n\n petite.stdout.on('data', function (data) {\n results += data;\n });\n\n petite.on('close', function (code) {\n console.log(results);\n });\n\n if(!errorOccurred) petite.stdin.write( scm_cmpFilesCommand(testList) );\n}", "title": "" }, { "docid": "f222c2bd1480c1c1d97e4c1533030300", "score": "0.51441675", "text": "function preloadImages() {\n consoleMsg('Preloading images');\n const trainingFolderUrl = 'images/training';\n const testingFolderUrl = 'images/testing';\n \n const trainingFolders = new Array(NUM_TRAIN).fill(0).map((_, i) => i + 1);\n const testingFolders = [9];\n const imagesNames = new Array(10).fill(0).map((_, i) => `${i}.png`);\n \n trainingFolders.forEach((folderName) => {\n imagesNames.forEach((imageName, i) => {\n const imageUrl = `${trainingFolderUrl}/${folderName}/${imageName}`;\n trainingImages.push({ image: createImg(imageUrl), label: i });\n })\n })\n\n testingFolders.forEach((folderName) => {\n imagesNames.forEach((imageName, i) => {\n const imageUrl = `${testingFolderUrl}/${folderName}/${imageName}`;\n testingImages.push({ image: createImg(imageUrl), label: i });\n })\n })\n}", "title": "" }, { "docid": "a60f086db41b2bee3b90e35d0fbe0558", "score": "0.5141787", "text": "function makePath(err, result) {\n if (err) {\n console.log('Error occurred:', err);\n }\n\n result.forEach( function (elem) {\n var path = './avatars/' + elem.login + '.jpg';\n downloadImageByURL(elem.avatar_url, path);\n });\n\n console.log('Your images have been downloaded to the avatars directory!');\n}", "title": "" }, { "docid": "3eada698a5ede66065189a4c00a50ee0", "score": "0.5135013", "text": "function _getDiffImagePath() {\n\n const imageName = browser.imageComparisonName;\n\n return path.join('screenshots/diff/', imageName);\n}", "title": "" }, { "docid": "9a554b63ada67edd0876243b55e7647a", "score": "0.5125646", "text": "getWorkFiles() {\n this.workBlob = \"static/input\"; // \"https://devrosbag.blob.core.windows.net/labeltool/3d_label_test\";\n this.curFile = 0; // For test (please make labeling tool start with frame:1)\n this.fileList = this.getFileList('PCD', false);\n this.JPEGFileList = this.getFileList('JPEG', false);\n this.JPEGNumsList = this.getFileList('JPEG', true);\n /* Note the formats\n this.fileList - pcd_1504861087834944\n this.JPEGFileList - camera-000000-1504861084.747\n this.JPEGNumsList - 1504861084747000\n */\n this.results = new Array(this.fileList.length);\n this.originalSize[0] = 1600;\n this.originalSize[1] = 1200;\n if (this.dataType == \"JPEG\") {\n dirBox.value = this.workBlob;\n } else {\n if (!Detector.webgl) Detector.addGetWebGLMessage();\n init();\n animate();\n }\n this.showData();\n }", "title": "" }, { "docid": "3fe50452f0d6bc3ee0d97ce6a362a5e8", "score": "0.51245695", "text": "function _copyExamples() {\n if (!_opts.skipExamples) {\n log(chalk.yellow('Copying examples folder...'));\n fsExtra.mkdirSync(`${_exampleBuild}/components`);\n fsExtra.copySync(`${_testScriptFolder}/examples-scaffold`, `${_exampleBuild}`);\n fsExtra.copySync(_exampleSrc, `${_exampleBuild}/components`);\n _examples = _getDirectories(`${_exampleBuild}/components`);\n }\n}", "title": "" }, { "docid": "26724ef7de2de960cec4459b3d3811e3", "score": "0.5123467", "text": "function getApplyDirPath() {\n return gTestID + \"/dir.app/\";\n}", "title": "" }, { "docid": "c0a44acdb23aee0b88515b41e7fe3ea4", "score": "0.51048887", "text": "function setup () {\n var topImages = [\n \"images/celeb1.jpg\",\n \"images/celeb2.jpg\",\n \"images/celeb3.jpg\",\n \"images/celeb4.jpg\",\n \"images/celeb5.jpg\",\n \"images/celeb6.jpg\",\n \"images/celeb7.jpg\",\n \"images/celeb8.jpg\",\n \"images/celeb9.jpg\",\n \"images/celeb10.jpg\",\n ];\n var bottomImages = [\n \"images/celeb1.jpg\",\n \"images/celeb2.jpg\",\n \"images/celeb3.jpg\",\n \"images/celeb4.jpg\",\n \"images/celeb5.jpg\",\n \"images/celeb6.jpg\",\n \"images/celeb7.jpg\",\n \"images/celeb8.jpg\",\n \"images/celeb9.jpg\",\n \"images/celeb10.jpg\",\n ];\n\n // Randomize an array passed as argument\n function randomizeArray (arr) {\n for (var i = arr.length - 1; i > 0; i--) {\n var r = getRandomInt(0,i);\n var tmp = arr[i];\n arr[i] = arr[r];\n arr[r] = tmp;\n }\n }\n\n randomizeArray(topImages);\n randomizeArray(bottomImages);\n randTop = topImages;\n randBottom = bottomImages;\n}", "title": "" }, { "docid": "5b906ff806790d9574ebba23e207cc09", "score": "0.5104623", "text": "function handleImage(roll, selector, directory) {\n const rolled = document.querySelector(selector);\n rolled.src = directory + roll + '.png';\n console.log(`directory: ${directory}`);\n console.log('roll: ' + roll);\n console.log('selector: ' + selector);\n}", "title": "" }, { "docid": "accae261ac61abb0fdbe8e89ed88a1c4", "score": "0.5099472", "text": "expandFilePathInOutput(output, cwd) {\n let lines = output.split('\\n');\n for (let i = 0; i < lines.length; i++) {\n let matches = lines[i].match(/^\\s+(\\S+_test.go):(\\d+):/);\n if (matches) {\n lines[i] = lines[i].replace(matches[1], path.join(cwd, matches[1]));\n }\n }\n return lines.join('\\n');\n }", "title": "" }, { "docid": "815a619608df65ab05d940742f0a034c", "score": "0.5096273", "text": "function sourceImage(source) {\n var image = source;\n if (source == null || source == \"\") {\n return source;\n } else if (source.match(/HPO/)) {\n image = '<img class=\"source\" src=\"../image/source-hpo.png\"/>';\n } else if (source.match(/MGI/)) {\n image = '<img class=\"source\" src=\"../image/source-mgi.png\"/>';\n } else if (source.match(/OMIM/)) {\n image = '<img class=\"source\" src=\"../image/source-omim.png\"/>';\n } else if (source.match(/ZFIN/)) {\n image = '<img class=\"source\" src=\"../image/source-zfin.png\"/>';\n } else if (source == \"PubMed\" || source.match(/NCBI/i) || source.match(/PMID/)) {\n image = '<img class=\"source\" src=\"../image/source-ncbi.png\"/>';\n } else if (source.match(/ORPHANET/i)) {\n image = '<img class=\"source\" src=\"../image/source-orphanet.png\"/>';\n } else if (source.match(/ClinVar/i)) {\n image = '<img class=\"source\" src=\"../image/source-clinvar.png\"/>';\n } else if (source.match(/KEGG/i)){\n image = '<img class=\"source\" src=\"../image/source-kegg.png\"/>';\n } else if (source.match(/PANTHER/i)) {\n image = '<img class=\"source\" src=\"../image/source-panther.jpg\"/>';\n } else if (source.match(/Coriell/i)) {\n image = '<img class=\"source\" src=\"../image/source-ccr.jpg\"/>';\n }\n return image;\n}", "title": "" }, { "docid": "88f4077b6addde45ee0af0ab0eea6d4d", "score": "0.509193", "text": "function imagesToDist() {\n return src(files.src.images).pipe(dest(files.dist.images));\n}", "title": "" }, { "docid": "167308c94946e837f0c12ec2332b128d", "score": "0.5080555", "text": "function clashingToolImageURL(imgType, imgLevel) {\n var imgPath = \"https://images.wikia.nocookie.net/clashofclans/images/\";\n\n switch (imgType) {\n case \"gold\":\n return imgPath + \"1/10/Gold.png\";\n case \"elixir\":\n return imgPath + \"4/43/Elixir.png\";\n case \"dark elixir\":\n return imgPath + \"3/3b/Dark_elixir.png\";\n case \"barracks\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"2/2c/Barracks1.png\";\n case \"2\":\n return imgPath + \"f/f0/Barracks2.png\";\n case \"3\":\n return imgPath + \"5/54/Barracks3.png\";\n case \"4\":\n return imgPath + \"8/84/Barracks4.png\";\n case \"5\":\n return imgPath + \"6/66/Barracks5.png\";\n case \"6\":\n return imgPath + \"4/4c/Barracks6.png\";\n case \"7\":\n return imgPath + \"2/29/Barracks7.png\";\n case \"8\":\n return imgPath + \"8/85/Barracks8.png\";\n case \"9\":\n return imgPath + \"3/39/Barracks9.png\";\n case \"10\":\n return imgPath + \"6/6a/Barracks10.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"army camp\":\n return imgPath + \"b/be/Army_Camp8.png\";\n case \"dark barracks\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"a/ab/Darkbarracks1.png\";\n case \"2\":\n return imgPath + \"c/ce/Darkbarracks2.png\";\n case \"3\":\n return imgPath + \"6/6b/Darkbarracks3.png\";\n case \"4\":\n return imgPath + \"3/3c/Darkbarracks4.png\";\n case \"5\":\n return imgPath + \"9/9e/Darkbarracks5.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"town hall\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"f/fd/Town_Hall1.png\";\n case \"2\":\n return imgPath + \"7/7d/Town_Hall2.png\";\n case \"3\":\n return imgPath + \"d/dd/Town_Hall3.png\";\n case \"4\":\n return imgPath + \"e/e7/Town_Hall4.png\";\n case \"5\":\n return imgPath + \"a/a3/Town_Hall5.png\";\n case \"6\":\n return imgPath + \"5/52/Town_Hall6.png\";\n case \"7\":\n return imgPath + \"7/75/Town_Hall7.png\";\n case \"8\":\n return imgPath + \"f/fa/Town_Hall8.png\";\n case \"9\":\n return imgPath + \"e/e0/Town_Hall9.png\";\n case \"10\":\n return imgPath + \"5/5c/Town_Hall10.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"gold mine\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"b/bf/Gold_Mine1.png\";\n case \"2\":\n return imgPath + \"5/55/Gold_Mine2.png\";\n case \"3\":\n return imgPath + \"e/e4/Gold_Mine3.png\";\n case \"4\":\n return imgPath + \"9/97/Gold_Mine4.png\";\n case \"5\":\n return imgPath + \"1/1a/Gold_Mine5.png\";\n case \"6\":\n return imgPath + \"8/86/Gold_Mine6.png\";\n case \"7\":\n return imgPath + \"1/11/Gold_Mine7.png\";\n case \"8\":\n return imgPath + \"5/52/Gold_Mine8.png\";\n case \"9\":\n return imgPath + \"b/bf/Gold_Mine9.png\";\n case \"10\":\n return imgPath + \"e/eb/Gold_Mine10.png\";\n case \"11\":\n return imgPath + \"0/0d/Gold_Mine11.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"elixir collector\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"5/5e/Elixir_Collector1.png\";\n case \"2\":\n return imgPath + \"0/05/Elixir_Collector2.png\";\n case \"3\":\n return imgPath + \"6/6d/Elixir_Collector3.png\";\n case \"4\":\n return imgPath + \"9/95/Elixir_Collector4.png\";\n case \"5\":\n return imgPath + \"4/44/Elixir_Collector5.png\";\n case \"6\":\n return imgPath + \"0/07/Elixir_Collector6.png\";\n case \"7\":\n return imgPath + \"3/35/Elixir_Collector7.png\";\n case \"8\":\n return imgPath + \"f/fc/Elixir_Collector8.png\";\n case \"9\":\n return imgPath + \"7/79/Elixir_Collector9.png\";\n case \"10\":\n return imgPath + \"f/f0/Elixir_Collector10.png\";\n case \"11\":\n return imgPath + \"9/9f/Elixir_Collector11.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"dark elixir drill\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"d/d9/Dark_Elixir_Drill1.png\";\n case \"2\":\n return imgPath + \"7/7f/Dark_Elixir_Drill2.png\";\n case \"3\":\n return imgPath + \"f/f2/Dark_Elixir_Drill3.png\";\n case \"4\":\n return imgPath + \"c/cc/Dark_Elixir_Drill4.png\";\n case \"5\":\n return imgPath + \"a/a0/Dark_Elixir_Drill5.png\";\n case \"6\":\n return imgPath + \"d/d8/Dark_Elixir_Drill6.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"gold storage\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"4/4f/Gold_Storage1.png\";\n case \"2\":\n return imgPath + \"f/f0/Gold_Storage2.png\";\n case \"3\":\n return imgPath + \"0/09/Gold_Storage3.png\";\n case \"4\":\n return imgPath + \"7/7c/Gold_Storage4.png\";\n case \"5\":\n return imgPath + \"6/62/Gold_Storage5.png\";\n case \"6\":\n return imgPath + \"3/36/Gold_Storage6.png\";\n case \"7\":\n return imgPath + \"b/bd/Gold_Storage7.png\";\n case \"8\":\n return imgPath + \"0/05/Gold_Storage8.png\";\n case \"9\":\n return imgPath + \"8/86/Gold_Storage9.png\";\n case \"10\":\n return imgPath + \"c/c2/Gold_Storage10.png\";\n case \"11\":\n return imgPath + \"5/5f/Gold_Storage11.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"elixir storage\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"f/f6/Elixir_Storage1.png\";\n case \"2\":\n return imgPath + \"3/38/Elixir_Storage2.png\";\n case \"3\":\n return imgPath + \"9/9c/Elixir_Storage3.png\";\n case \"4\":\n return imgPath + \"e/e6/Elixir_Storage4.png\";\n case \"5\":\n return imgPath + \"c/ce/Elixir_Storage5.png\";\n case \"6\":\n return imgPath + \"e/eb/Elixir_Storage6.png\";\n case \"7\":\n return imgPath + \"8/8c/Elixir_Storage7.png\";\n case \"8\":\n return imgPath + \"7/74/Elixir_Storage8.png\";\n case \"9\":\n return imgPath + \"6/65/Elixir_Storage9.png\";\n case \"10\":\n return imgPath + \"2/2c/Elixir_Storage10.png\";\n case \"11\":\n return imgPath + \"3/3b/Elixir_Storage11.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n case \"dark elixir storage\":\n switch ('' + imgLevel) {\n case \"1\":\n return imgPath + \"1/1a/Dark_Elixir_Storage1.png\";\n case \"2\":\n return imgPath + \"c/cd/Dark_Elixir_Storage2.png\";\n case \"3\":\n return imgPath + \"c/c1/Dark_Elixir_Storage3.png\";\n case \"4\":\n return imgPath + \"b/b2/Dark_Elixir_Storage4.png\";\n case \"5\":\n return imgPath + \"0/07/Dark_Elixir_Storage5.png\";\n case \"6\":\n return imgPath + \"4/4b/Dark_Elixir_Storage6.png\";\n default:\n return imgPath + \"a/ae/Barracks0.png\";\n }\n }\n}", "title": "" }, { "docid": "a6e0ae14866f99cd6199916f59114b42", "score": "0.5080481", "text": "function images() {\n\tconst tasks = CONFIGS.map(config => {\n \treturn gulp.src(config.images.sourcePaths, {allowEmpty: true })\n \t\t.pipe(imagemin())\n \t\t.pipe(gulp.dest(config.images.exportPath))\n \t\t.pipe(browserSync.stream());\n \t});\n\n \treturn merge(tasks);\n}", "title": "" }, { "docid": "afff826e49d576933120377a86d93e99", "score": "0.5079995", "text": "function writeResults () {\n const results = global.__instrumenter.files\n const message = JSON.stringify(results, null, 2)\n debug(message)\n\n const files = keys(results)\n console.log('covered source files', files)\n\n const outputDir = 'output'\n files.forEach(writeFileResults(outputDir)(results))\n\n const filePages = files\n .map(relativeTo)\n .map(md5)\n .map(name => name + '.html')\n\n const links = files.map((filename, k) => {\n const relativeName = relative(process.cwd(), filename)\n return {\n link: filePages[k],\n name: relativeName\n }\n })\n\n saveIndex(outputDir, links)\n}", "title": "" }, { "docid": "cc21a66e520b236726228db51314a543", "score": "0.50612867", "text": "function findImage(err, results) {\r\n\r\n if (err)\r\n console.error(err);\r\n else\r\n status.html(\r\n 'Image Analysis complete. The analysis results are the following: <br> A: ' + \r\n round(results[0].probability * 100) + '% ' + results[0].className + '<br> B: ' + \r\n round(results[1].probability * 100) + '% ' + results[1].className + '<br> C: ' + \r\n round(results[2].probability * 100) + '% ' + results[2].className);\r\n}", "title": "" }, { "docid": "23bc3c3549f1c6b637e4cc5b992be18e", "score": "0.50487554", "text": "static imageSrcSetUrlForRestaurant(restaurant, directory) {\n let image = restaurant.photograph;\n\n return (`/img/${directory}/${image}_2x.jpg 2x, /img/${directory}/${image}_1x.jpg 1x`);\n }", "title": "" }, { "docid": "b36535aab40d6d5b1e261a1d7441fb65", "score": "0.50449777", "text": "computeDevFiles(component) {\n const devPatterns = this.computeDevPatterns(component);\n const rawDevFiles = Object.keys(devPatterns).reduce((acc, aspectId) => {\n if (!acc[aspectId]) acc[aspectId] = [];\n const patterns = devPatterns[aspectId];\n acc[aspectId] = component.state.filesystem.byGlob(patterns).map(file => file.relative);\n return acc;\n }, {});\n return new (_devFiles2().DevFiles)(rawDevFiles);\n }", "title": "" }, { "docid": "4093b02b84a5e24d8d891cf081016702", "score": "0.50308895", "text": "function images () {\n return gulp.src('src/img/**/*')\n .pipe(gulp.dest(PATHS.dist + '/img'))\n}", "title": "" }, { "docid": "587fa62d122432bafc9b8ee3c169e7f2", "score": "0.5001743", "text": "loadFiles(files) {\n files = Array.from(files).filter( file => file.type.match(/image.*/) );\n if (!files.length) { return; }\n const size = ~~(files.reduce((total, file) => total + file.size, 0) / 1024);\n this.dropZone.innerHTML = '';\n this.results.innerHTML = `Testing started...<br /> Total Size: ${size} kb...<br/>`;\n // binary conditions, check the binary 1 position in method\n (this.method & 1) && this.fileReaderTest(files);\n // binary conditions, check the binary 1 position in method\n (this.method & 2) && this.createObjectUrl(files);\n }", "title": "" }, { "docid": "433c660124fe889709c25b03d5d88bbf", "score": "0.49947914", "text": "function prepare_For_Output(Input_Folder)\n{\n Output_Folder = new Folder(Input_Folder.parent + \"/\" + Input_Folder.name + \"_Epub 3\");\n Output_Image_Folder = new Folder(Output_Folder + \"/images\");\n Output_CSS_Folder = new Folder(Output_Folder + \"/css\");\n Output_HTML_Folder = new Folder(Output_Folder + \"/html\");\n var InputFonts = new Folder(Input_Folder + \"/Fonts\");\n var AllFonts = InputFonts.getFiles();\n Output_Font_Folder = new Folder(Output_Folder + \"/fonts\");\n if (Output_Folder.exists)\n {\n Output_Folder.remove();\n Output_Folder.create();\n }\n else\n {\n Output_Folder.create();\n }\n \n if (Output_Font_Folder.exists)\n {\n Output_Font_Folder.remove();\n Output_Font_Folder.create();\n for (var t = 0; t < AllFonts.length; t++)\n {\n AllFonts[t].copy(new File(Output_Font_Folder + \"/\" + AllFonts[t].name));\n }\n }\n else\n {\n\n Output_Font_Folder.create();\n for (var t = 0; t < AllFonts.length; t++)\n {\n AllFonts[t].copy(new File(Output_Font_Folder + \"/\" + AllFonts[t].name));\n }\n }\n\n if (Output_Image_Folder.exists)\n {\n Output_Image_Folder.remove();\n Output_Image_Folder.create();\n }\n else\n {\n Output_Image_Folder.create();\n }\n\n if (Output_CSS_Folder.exists)\n {\n Output_CSS_Folder.remove();\n Output_CSS_Folder.create();\n }\n else\n {\n Output_CSS_Folder.create();\n }\n\n if (Output_HTML_Folder.exists)\n {\n Output_HTML_Folder.remove();\n Output_HTML_Folder.create();\n }\n else\n {\n Output_HTML_Folder.create();\n }\n return Output_Folder;\n}", "title": "" }, { "docid": "f5cc87e23edd4c09f441b085270c4bf1", "score": "0.49902588", "text": "apply(compiler) {\n compiler.hooks.done.tap('Copy Images', function(){\n fse.copySync('./app/assets/images', './docs/assets/images')\n })\n }", "title": "" }, { "docid": "369bbef004ae34e6f97f9c4bcbd1c9ef", "score": "0.4977506", "text": "loadData() {\n console.log('Loading images...');\n this.baseData = loadImages(IMAGES_DIR1);\n this.retrainData = loadImages(IMAGES_DIR2);\n console.log('Images loaded successfully.')\n }", "title": "" }, { "docid": "7b6153528dd817a5b9252eb499578660", "score": "0.4974386", "text": "function saveSingleLinkfinderDirectory(){\n\n let singleDir = `../LemonBooster-Results/SingleTools/`;\n let linkfinderDir = `${singleDir}LinkFinder/` \n\n if( fs.existsSync(singleDir) ){\n console.log('SingleTools Directory Exists.');\n } else { \n shell.exec(`mkdir ${singleDir}`)\n }\n\n if( fs.existsSync(linkfinderDir) ){\n console.log('Single LinkFinder Directory Exists.');\n } else { \n shell.exec(`mkdir ${linkfinderDir}`)\n }\n\n return linkfinderDir;\n\n}", "title": "" }, { "docid": "326db44286d32c739ae0432800ed9f85", "score": "0.49723202", "text": "function CreateArtifact(filePath){\n\tconst fs = require('fs');\n\tconst path = require('path');\n\tlet result = 0;\n\tlet temp = 0;\n\t\n\t//calulation for the file path. Use the string for file path and calculate each character ascii value with the mulitplication\n\t//\"loop\" of 1,7,3,11. The values are all added up afterward and modded by 10000 to get the last 4 values for the P part of\n\t// the artifact\n\tfor (let index = 0; index < filePath.length; index++) {\n\t\tif(index % 4 == 0){\n\t\t\ttemp += (filePath.charCodeAt(index) * 1);\n\t\t}\n\t\telse if(index % 4 == 1){\n\t\t\ttemp += (filePath.charCodeAt(index) * 7);\n\t\t}\n\t\telse if(index % 4 == 2){\n\t\t\ttemp += (filePath.charCodeAt(index) * 3);\n\t\t}\n\t\telse if(index % 4 == 3){\n\t\t\ttemp += (filePath.charCodeAt(index) * 11);\n\t\t}\n\t}\n\t//Else if statements habdle the number values to see if it is less than 4 digits characters to add in extra zeros before the\n\t//number of the Path\n\tif(temp <10){\n\t\tresult = \"P000\" + temp + \"-\";\n\t}\n\telse if(temp <100){\n\t\tresult = \"P00\" + temp + \"-\";\n\t}\n\telse if( temp < 1000 ){\n\t\tresult = \"P0\" + temp+ \"-\";\n\t}\n\telse{\n\t\t\n\t\tif(temp % 10000 <10){\n\t\t\tresult = \"P000\" + temp % 10000 + \"-\";\n\t\t}\n\t\telse if(temp % 10000 <100){\n\t\t\tresult = \"P00\" + temp % 10000 + \"-\";\n\t\t}\n\t\telse if(temp % 10000 < 1000 ){\n\t\t\tresult = \"P0\" + temp % 10000+ \"-\";\n\t\t}\n\t\telse{\n\t\t\tresult = \"P\" + temp % 10000 + \"-\";\n\t\t}\n\t}\n\n\t//handle calulation for the L/file size of the artifact. The returned values is then modded by 100 to return the 2 most right\n\t//values for the part of in the returned artifact\n\tlet stats = fs.statSync(filePath);\n\tlet fileSizeInBytes = stats[\"size\"];\n\n\t//Else if statements habdle the number values to see if it is less than 4 digits characters to add in extra zeros before the\n\t//number of the File size in byte\n\tif(fileSizeInBytes < 10){\n\t\tresult += \"L0\" + (fileSizeInBytes % 100) + \"-\";\n\t}\n\telse{\n\t\tif(fileSizeInBytes % 100 < 10){\n\t\t\tresult += \"L0\" + (fileSizeInBytes % 100) + \"-\";\n\t\t}\n\t\telse{\n\t\t\tresult += \"L\" + (fileSizeInBytes % 100) + \"-\";\n\t\t} \n\t}\n\t\n\n\t//calulation for the file content. Use the string for file path and calculate each character ascii value with the mulitplication\n\t//\"loop\" of 1,7,3,11. The values are all added up afterward and modded by 10000 to get the last 4 values for the C/content part\n\t//of the artifact\n\ttemp = 0;\n\tfor (let index = 0; index < getContent(filePath).length; index++) {\n\t\tif(index % 4 == 0){\n\t\t\ttemp += (getContent(filePath).charCodeAt(index) * 1);\n\t\t}\n\t\telse if(index % 4 == 1){\n\t\t\ttemp += (getContent(filePath).charCodeAt(index) * 7);\n\t\t}\n\t\telse if(index % 4 == 2){\n\t\t\ttemp += (getContent(filePath).charCodeAt(index) * 3);\n\t\t}\n\t\telse if(index % 4 == 3){\n\t\t\ttemp += (getContent(filePath).charCodeAt(index) * 11);\n\t\t}\n\t}\n\t//Else if statements habdle the number values to see if it is less than 4 digits characters to add in extra zeros before the\n\t//number of the Content\n\tif(temp <10){\n\t\tresult += \"C000\" + temp % 10000 + \".txt\";\n\t}\n\telse if(temp <100){\n\t\tresult += \"C00\" + temp % 10000 + \".txt\";\n\t}\n\telse if(temp <1000){\n\t\tresult += \"C0\" + temp % 10000 + \".txt\";\n\t}\n\telse{\n\t\tif(temp % 10000 < 10){\n\t\t\tresult += \"C000\" + temp % 10000 + \".txt\";\n\t\t}\n\t\telse if(temp % 10000 < 100){\n\t\t\tresult += \"C00\" + temp % 10000 + \".txt\";\n\t\t}\n\t\telse if(temp % 10000 < 1000 ){\n\t\t\tresult += \"C0\" + temp % 10000+ \".txt\";\n\t\t}\n\t\telse{\n\t\t\tresult += \"C\" + temp % 10000 + \".txt\";\n\t\t}\n\t}\n\tconsole.log(result);\n\t//return the result as \"P####-L##-C####.txt\"\n\treturn result;\n}", "title": "" }, { "docid": "b8c7a4cdf60df5720f0abffc6ccbea0e", "score": "0.4968735", "text": "function flowerPath() {\n const flowerPathArray = [\"flower0.jpg\", \"flower1.jpg\", \"flower2.jpg\", \"flower3.png\", \"flower4.jpg\"];\n\n let num = Math.round(Math.random() * 4);\n //grab an image and return its path for use in update and create flowr fxns\n return \"image/\" + flowerPathArray[num];\n\n}", "title": "" }, { "docid": "f44ea42d12fdff8e90828d4605b8b197", "score": "0.49649954", "text": "function imageCopy() {\n return gulp\n .src(pathconf.paths.src.img)\n .pipe(gulp.dest(pathconf.paths.temp.img));\n}", "title": "" }, { "docid": "a84bc155665f83f9e8f4123837db0242", "score": "0.49534392", "text": "function getImageSourceSet(image) {\n const src = image.src.split('.')[0]\n return `${src}-500px.jpg 500w, ${src}-1000px.jpg 1000w, ${src}-1500px.jpg 1500w`\n}", "title": "" }, { "docid": "a84bc155665f83f9e8f4123837db0242", "score": "0.49534392", "text": "function getImageSourceSet(image) {\n const src = image.src.split('.')[0]\n return `${src}-500px.jpg 500w, ${src}-1000px.jpg 1000w, ${src}-1500px.jpg 1500w`\n}", "title": "" }, { "docid": "622e88086dc13dcf8899439ced102728", "score": "0.49493074", "text": "setResultsDir() {\n this.resultsDir = path.join(process.cwd(), 'tests', this.outputDir, 'reports');\n }", "title": "" }, { "docid": "3c7b6a7a25577664d3740b8c1c8f395a", "score": "0.49447998", "text": "function getApplyDirPath() {\n return TEST_ID + APPLY_TO_DIR_SUFFIX;\n}", "title": "" }, { "docid": "26f67ec209af73c2b8072d3061e5e6bf", "score": "0.4939124", "text": "function setup() {\n // Create the gamble image\n var gamble_img = div.appendChild(document.createElement('img'));\n gamble_img.id = 'gamble-img';\n if(trial.gamble_images.length)\n gamble_img.src = trial.gamble_images[gamble];\n else\n gamble_img.src = \"img/unknown_outcome.png\";\n // Create the outcome image\n var result_div = div.appendChild(document.createElement('div'));\n result_div.id = 'result';\n var cover = result_div.appendChild(document.createElement('img'));\n cover.classList.add('cover');\n cover.src = \"img/Win.png\";\n var result_img = result_div.appendChild(document.createElement('img'));\n result_img.classList.add('result-img');\n result_img.src = result_img_src;\n var result_p = result_div.appendChild(document.createElement('p'));\n result_p.innerText = result_text;\n // Create the participant images\n for(var i = 0; i < trial.gamble_player_names.length; i++) {\n var player_div = div.appendChild(document.createElement('div'));\n player_div.id = 'player-' + i;\n player_div.classList.add('player', 'player-' + i);\n if(i == winning_id)\n player_div.classList.add('winner');\n var player_img = player_div.appendChild(document.createElement('img'));\n player_img.src = i == 2? \"img/Self_single.png\" : \"img/Other_single.png\";\n // Label\n var label = player_div.appendChild(document.createElement('p'));\n label.innerText = trial.gamble_player_names[i];\n }\n }", "title": "" }, { "docid": "b03f74aa1d69f1d73b204e98828d3421", "score": "0.4926247", "text": "function getMockupImagesCommand() {\n const urls = Object.values(getMockupAssets()).reduce((urls, assets) => {\n const { image, background_image } = assets\n const background = background_image.replace(/(url\\(|\\)|\")/g, \"\")\n if (image && urls.indexOf(image) < 0) urls.push(image)\n if (background && urls.indexOf(background)) urls.push(background)\n return urls\n }, [])\n const result = \"curl -O \" + urls.join(\" \")\n window.prompt(\"cmd+c\", result)\n}", "title": "" }, { "docid": "3adcbbdc7e53bf3b2d7d843d6182386c", "score": "0.49261552", "text": "function copyFilesToRepository(UpSourceTreeDir, RepositoryDir){\n\tconst fs = require('fs');\n\tconst path = require('path');\n\t\t\n\t//gets the files from the source\n\tlet SourceFiles = getProjectTree(UpSourceTreeDir);\n\t\n\t//creates the new manifest file and saves the manifest file directory\n\tlet location = createManifestFile(RepositoryDir);\n\n\t//goes through array of file paths and checks if they are similar to any file in the repository\n\t//if they are, overwrite them and update the manifest file per file added\n\tconsole.log(ArraySourceLen);\n\tfor(let i = 0; i < ArraySourceLen; i++){\n\t\n\t\t//gets the artifact ID of each file and compares it to the \n\t\tlet artifact = CreateArtifact(String(SourceFiles[i]));\n\n\n\t\t//copy file to folder, if it already exists, overwrite it\n\t\tfs.copyFile(String(SourceFiles[i]), path.join(String(RepositoryDir) + \"\\\\\" + \".Temp\" + \"\\\\\" + artifact), (err) => {\n\t\t\t//throws error if could not copy file to destination \n\t\t\tif (err) throw err;\n\t\t});\n\n\t\t//MANIFEST\n\t\t//write the file into the manifest file\n\t\tlet fileInformation = artifact + \"=\" + SourceFiles[i] + \"\\n\";\n\n\t\t//appends info into files (file destination, content, error)\n\t\tfs.appendFile(location, fileInformation, function (err) {\n\t\t\t\tif (err) throw err;\n\t\t});\n\t}\n\n\t//append Date and time to manifest\n\tlet d = new Date();\n\tfs.appendFile(location, d + \"\\n\", function (err) {\n\t\tif (err) throw err;\n\t});\n\n\t//append the command line and the arguments into the manifest\n\tlet command = \"Command: check-in, \" + UpSourceTreeDir + \", \" + RepositoryDir;\n\tfs.appendFile(location, command + \"\\n\", function (err) {\n\t\tif (err) throw err;\n\t});\n}", "title": "" }, { "docid": "fcf858d5596a045e9833f049b68f4255", "score": "0.49192345", "text": "function images() {\n return src(\"./src/img/**/*.{jpg,jpeg,png,gif,tiff,svg}\")\n .pipe(imgMin())\n .pipe(dest(\"./dist/img\"))\n .on(\"end\", browserSync.reload);\n}", "title": "" }, { "docid": "d5979721324ddbb0dbf50f4aa373ffac", "score": "0.49189663", "text": "function images() {\n return gulp.src(config.img.src)\n .pipe(gulp.dest(config.img.dest));\n}", "title": "" }, { "docid": "4bd680d86c0166543753f087124f5bd4", "score": "0.49150774", "text": "function executePlan( ) {\n out('cd \"'+readPathFromURL()+'\"');\n out('astrotest \"'+getText(\"plan-file\")+'\" \"'+getText(\"source-file\")+'\"');\n var output = executeCommand({\n cmd:'astrotest \"'+getText(\"plan-file\")+'\" \"'+getText(\"source-file\")+'\"',\n path:readPathFromURL()\n });\n out(output);\n }", "title": "" }, { "docid": "79001147dba63ef05da34084f4b7da0f", "score": "0.4913542", "text": "function compSources(srcList, params, writeImg)\n{\n assert (\n params instanceof CompParams,\n 'expected compilation parameters'\n );\n\n // Function to get the name string for a code unit\n function getSrcName(srcIdx)\n {\n var src = srcList[srcIdx];\n if (typeof src === 'object')\n return src.desc;\n else\n return src;\n }\n\n // List for parsed ASTs\n var astList = [];\n\n measurePerformance(\n \"Parsing\",\n function ()\n {\n // For each source unit\n for (var i = 0; i < srcList.length; ++i)\n {\n var src = srcList[i];\n\n log.trace('Parsing Tachyon source: \"' + getSrcName(i) + '\"');\n\n // Parse the source unit\n if (typeof src === 'object')\n var ast = parse_src_str(src.str, params);\n else\n var ast = parse_src_file(src, params);\n\n // Parse static bindings in the unit\n params.staticEnv.parseUnit(ast);\n\n // Add the parsed AST to the list\n astList.push(ast);\n }\n }\n );\n\n // List for parsed IR function objects\n var irList = [];\n\n measurePerformance(\n \"IR generation\",\n function ()\n {\n // For each AST\n for (var i = 0; i < astList.length; ++i)\n {\n var ast = astList[i];\n\n log.trace('Generating IR for: \"' + getSrcName(i) + '\"');\n\n // Generate IR from the AST\n var ir = unitToIR(ast, params);\n\n // Add the IR function to the list\n irList.push(ir);\n }\n }\n );\n\n measurePerformance(\n \"IR lowering\",\n function ()\n {\n // For each IR\n for (var i = 0; i < irList.length; ++i)\n {\n var ir = irList[i];\n\n log.trace('Performing IR lowering for: \"' + getSrcName(i) + '\"');\n\n // Perform IR lowering on the primitives\n lowerIRFunc(ir, params);\n\n //print('Done lowering for: \"' + getSrcName(i) + '\"');\n\n // Validate the resulting code\n ir.validate();\n\n //print('Done validation for: \"' + getSrcName(i) + '\"');\n }\n }\n );\n\n measurePerformance(\n \"Machine code generation\",\n function ()\n {\n // Compile the IR functions to machine code\n for (var i = 0; i < irList.length; ++i)\n {\n var ir = irList[i];\n\n log.trace('Generating machine code for: \"' + getSrcName(i) + '\"');\n\n compileIR(ir, params, writeImg);\n }\n }\n );\n\n // If we are not writing an image\n if (writeImg !== true)\n {\n measurePerformance(\n \"Machine code linking\",\n function ()\n {\n // Link the primitives with each other\n for (var i = 0; i < irList.length; ++i)\n {\n var ir = irList[i];\n\n if (ir.linking.linked)\n continue;\n\n var addr = getBlockAddr(ir.runtime.mcb, 0);\n log.trace('Linking machine code for: \"' + getSrcName(i) + \n '\" at address ' + addr);\n\n linkIR(ir, params);\n }\n }\n );\n }\n\n // Return the list of IR functions\n return irList;\n}", "title": "" }, { "docid": "96d1d030ab3d8f984712341d6dd266f1", "score": "0.48998043", "text": "constructor(){\n this._rockComp = \"./images/rockComp.jpg\";\n this._scissorsComp = \"./images/scissorsComp.jpg\";\n this._paperComp = \"./images/paperComp.jpg\";\n\n this._rockUser = \"./images/rockUser.jpg\";\n this._scissorsUser = \"./images/scissorsUser.jpg\";\n this._paperUser = \"./images/paperUser.jpg\";\n this._curWinStreak = 0;\n this._longestWinStreak = 0;\n this._gameResolution = \"\";\n }", "title": "" }, { "docid": "6827a953d83cc0527f72358a820c4d09", "score": "0.4897609", "text": "runFromImage() {\n return '';\n }", "title": "" }, { "docid": "ca529213c8ae780886715d992e361e96", "score": "0.48953137", "text": "for (let path of paths) {\n // Check if any file is a directory and bail out if not\n try {\n // We do this synchronously\n // in testing, this is instantaneous\n // even when dragging many files\n const stat = fs.lstatSync(path)\n if (stat.isDirectory()) {\n // TODO: Show a red error banner on failure: https://zpl.io/2jlkMLm\n return\n }\n } catch (e) {\n // TODO: Show a red error banner on failure: https://zpl.io/2jlkMLm\n }\n }", "title": "" }, { "docid": "d532f42569f55cc9a09a58f231833757", "score": "0.48850495", "text": "async function copySources() {\n if (!fs.existsSync(itFolder)) {\n fs.mkdirSync(itFolder);\n }\n // clean old stuff\n ['target', 'node_modules', 'src', 'frontend']\n .forEach(f => {\n const dir = `${itFolder}/${f}`;\n if (fs.existsSync(dir)) {\n console.log(`removing ${dir}`);\n fs.rmSync(`${dir}`, { recursive: true } );\n }\n });\n\n modules.forEach(parent => {\n const id = parent.replace('-parent', '');\n console.log(`Copying ${parent}/${id}-integration-tests`);\n // copy frontend sources\n copyFolderRecursiveSync(`${parent}/${id}-integration-tests/frontend`, `${itFolder}`);\n // copy java sources\n copyFolderRecursiveSync(`${parent}/${id}-integration-tests/src`, `${itFolder}`, (source, target, content) => {\n return /\\n\\s*@Theme.*Material/.test(content) ? []: [target, content];\n });\n });\n}", "title": "" }, { "docid": "f79fc8de48c50aad12be27fb2030b383", "score": "0.48843136", "text": "function onChange(path, stats) {\n\t\t// run image processor\n\t\tvar img = proc(path)\n\t\t// output filename based on input\n\t\tvar outfile = output + /[^/\\\\]*$/.exec(path)[0]\n\t\t// save output\n\t\timg.write(outfile, function(err) {\n\t\t\tif (err) console.error('GM Error: ', err)\n\t\t})\n\t}", "title": "" }, { "docid": "12b13b1a997791ca59e212282891d8e3", "score": "0.48831064", "text": "function getImage2() {\n document.getElementById(\"holder2\").addEventListener(\"drop\", function (x) {\n x.preventDefault();\n x.stopPropagation();\n for (let i of x.dataTransfer.files) {\n imagePath = i.path;\n imageName = imagePath.split(\".\");\n console.log(\"Image path is: \" + imagePath);\n counter();\n break;\n }\n\n //console.log('File you dragged here: ',filePath);\n document.getElementById(\"output2\").src = imagePath;\n document.getElementById(\"myImage2\").innerHTML = \"Image Path : \" + imagePath;\n });\n \n}", "title": "" }, { "docid": "1f6d08d0484541d44ce8ec62a55ba27d", "score": "0.48806316", "text": "setUpOutputDir() {\n fs.emptyDirSync(this.outputDir);\n }", "title": "" }, { "docid": "1769a56ad0868084fe1386e0a53ab42b", "score": "0.48728105", "text": "function runMyCode() {\n console.log(\"All images have been loaded too\");\n}", "title": "" }, { "docid": "62f2d9c15ca64e486ea77aed2a0f1b31", "score": "0.4872723", "text": "function outputDirectory(filePath) {\n // .then(callback) - resolved\n promisedFS.stat(filePath).then((stats) => {\n // if statement to determine whether directory or not\n if (stats.isDirectory()) {\n console.log(filePath + ' is a directory');\n // call another function to show the contents of the directory\n traverseFolder(filePath);\n } else {\n console.log(filePath + ' is a file');\n }\n // add an catch for error case\n }).catch((error) => {\n console.log(error);\n })\n}", "title": "" }, { "docid": "ffd88cb73be943dd67d892fafa88ee63", "score": "0.48726153", "text": "doesFolderExist(){if(!(0,_fs.existsSync)(this.filename)){throw\"Output folder not found:\"+this.filename}}", "title": "" }, { "docid": "3622ffb6fa5ddafef497e634691dc2c4", "score": "0.48688507", "text": "function copyFiles(){\n return gulp.src('./src/images/**/*')\n .pipe(gulp.dest('./dist/images'))\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "2f09c1d946b42e2117f427f6e493c794", "score": "0.48680833", "text": "function getImagePath(src) {\n const index = src.indexOf(config.dir.media)\n const position = index >= 0 ? index + config.dir.media.length : 0\n const imageFilename = src.substring(position)\n return path.join(\n process.cwd(),\n config.dir.input,\n config.dir.media,\n imageFilename\n )\n}", "title": "" }, { "docid": "d63b571251059bd992cecb0458550827", "score": "0.48629385", "text": "function interactives() {\n return src([\n `${paths.interactives_source}/**/*`,\n `!${paths.interactives_source}/**/node_modules/**/*`,\n `!${paths.interactives_source}/**/*.scss`,\n `!${paths.interactives_source}/**/*.js`\n ])\n .pipe(dest(paths.interactives_output))\n}", "title": "" }, { "docid": "31a4647efdb5aa0b011080c0c9495734", "score": "0.48573148", "text": "function traverseFolder(path) {\n // contents of the directory\n promisedFS.readdir(path).then((files) => {\n // we want to loop over each file in the directory/array created\n // for the next call we need to set a new filePath\n for (let file of files) {\n const filePath = pathMod.join(path, file);\n // call(back) the outputDirectory with the new path for each file/folder\n outputDirectory(filePath);\n // then we call the outputDirectory function to rerun the test - this will continuously loop until all files have been targeted\n };\n }).catch((error) => {\n console.log(error);\n })\n}", "title": "" }, { "docid": "cb950ef9723c10739bf5ee647324e843", "score": "0.48569816", "text": "function copyImg() {\r\n return gulp.src(files.imgPath).pipe(gulp.dest(\"dist/images\"));\r\n}", "title": "" }, { "docid": "94eda924895a0cef6ed87d4cdc71bb38", "score": "0.48478696", "text": "function preloader() {\r\n const imagesPaths = [\r\n \"./img/hydro.jpg\",\r\n \"./img/wind.jpg\",\r\n \"./img/solar.jpg\"\r\n ];\r\n const images = [];\r\n for (let i = 0; i < imagesPaths.length; i++) {\r\n images[i] = new Image();\r\n images[i].src = imagesPaths[i];\r\n }\r\n\r\n // Images ready to be used:\r\n console.log(`Preloaded images:\\n\\t${images[0].src}\\n\\t${images[1].src}\\n\\t${images[2].src}`);\r\n}", "title": "" }, { "docid": "07b51e6803d58b8e86ba6da1f282d626", "score": "0.4846515", "text": "function capture(selector, filename) {\n\n // find the element on screen or exit\n var clip,\n el = $(selector);\n\n if (el) {\n if (el.offsetWidth <= 0 || el.offsetHeight <= 0) {\n log_error(\"NotVisibleError: Unable to capture '\" + selector + \"'\");\n TestResults.error(filename);\n return;\n }\n clip = el.getBoundingClientRect();\n } else {\n log_error(\"NotFoundError: Unable to capture '\" + selector + \"'\");\n TestResults.error(filename);\n return;\n }\n\n if (!configuration.testroot.contains(testFile, false)) {\n log('\\nConfigError: Test files are not within \"testroot\".');\n exit(-255);\n }\n // determine the relative path to the test file from the base dir\n let _dirs = [], _testfile = testFile.parent.clone();\n while (!_testfile.equals(configuration.testroot)) {\n _dirs.unshift(_testfile.leafName);\n _testfile = _testfile.parent;\n }\n\n // build the name of the capture file\n var capture_name = [testName, filename, pagesize].join('-');\n\n // determine the expected location of the baseline image\n var baseline = configuration.baseline.clone();\n for (let i=0; i<_dirs.length; i++) {\n baseline.append(_dirs[i]);\n }\n baseline.append(capture_name + '.png');\n\n // if rebasing, delete old baseline\n if (configuration.rebase) {\n if (baseline.exists()) {\n baseline.remove(false);\n }\n }\n\n if (baseline.exists()) {\n // capture and compare\n let content = imagelib.capture(window, clip, null);\n let blob = File(baseline);\n let basedata = imagelib.createImage(blob);\n let diff = imagelib.compare(content, basedata);\n if (diff) {\n let diffFile = configuration.diffdir.clone();\n for (let i=0; i<_dirs.length; i++) {\n diffFile.append(_dirs[i]);\n }\n diffFile.append(capture_name + '-diff.png');\n imagelib.saveCanvas(diff, diffFile);\n _dirs.unshift(configuration.diffdir.path);\n _dirs.push(capture_name + '-diff.png');\n TestResults.fail(_dirs.join('/'));\n } else {\n TestResults.pass(capture_name);\n }\n } else {\n // capture and save\n imagelib.capture(window, clip, baseline);\n TestResults.rebase(capture_name);\n }\n return;\n}", "title": "" }, { "docid": "dbd9ca7c56f895395064809795727d02", "score": "0.48439562", "text": "function displayImages (imageArray) {\n imageArray.forEach(function(image) {\n console.log('name: ' + image.name + ', sourcePath: ' + image.sourcePath + ', date: ' + image.date + ', index: ' + image.index);\n }); \n}", "title": "" }, { "docid": "7cee18570b1fd6563d5d3930806d70f4", "score": "0.48403868", "text": "copyAssets (verbose = false) {\n this.tasks.add('Copy Assets', next => {\n let assetTasks = new this.TaskRunner()\n\n this.ASSETS.forEach(assetPath => {\n assetTasks.add(`Copying ${assetPath} to output.`, cont => {\n if (verbose) {\n console.log(this.COLORS.verysubtle(` - Copy ${assetPath} to `) + this.COLORS.subtle(this.outputDirectory(assetPath)))\n }\n\n this.copyToOutput(assetPath, cont)\n })\n })\n\n assetTasks.on('complete', next)\n assetTasks.run()\n })\n }", "title": "" }, { "docid": "8be58e351f07252d5f0f348e882b0006", "score": "0.4836899", "text": "start() {\n // Import array of URLs\n let urlsContent = fs.readFileSync(this.urlFileName, 'utf8');\n let urls = JSON.parse(urlsContent);\n\n // Make sure results directory exists.\n if (!fs.existsSync(this.resultsDir)) {\n fs.mkdirSync(this.resultsDir);\n }\n\n // Make sure this specific results datetime directory exists.\n let datetime = moment().format('YYYY-MM-DDTHHmmss')\n this.resultsDirDateTime_ = this.resultsDir + '/' + datetime\n if (!fs.existsSync(this.resultsDirDateTime_)) {\n fs.mkdirSync(this.resultsDirDateTime_)\n }\n\n let driver = new WebDriver.Builder()\n .forBrowser('firefox')\n .build()\n\n urls.forEach((url, index) => {\n driver\n .get(url)\n .then(() => {\n\n AxeBuilder(driver)\n .withTags(this.axeTags)\n .analyze((results) => {\n\n // Save results to file.\n let dateTime = moment(results.timestamp);\n let fileName = 'axe-results_'\n + index + '_'\n + url.replace(/[^a-z0-9]/gi, '-').replace(/-{2,}/g, '-').replace(/^-|-$/g, '').toLowerCase() + '_'\n + dateTime.format('YYYY-MM-DDTHHmmss')\n + '.json'\n let jsonString = JSON.stringify(results, null, ' ')\n fs.writeFile(this.resultsDirDateTime_ + '/' + fileName, jsonString, 'utf8', (err) => {\n if (err) {\n console.log('ERROR: ' . err)\n }\n });\n\n if (results.inapplicable.length > 0 || results.incomplete.length > 0 || results.violations.length > 0) {\n this.output_ += fileName\n this.output_ += ' | inapplicable ' + results.inapplicable.length\n this.output_ += ' | incomplete ' + results.incomplete.length\n this.output_ += ' | violations ' + results.violations.length\n this.output_ += ' | passes ' + results.passes.length\n this.output_ += '\\n'\n }\n\n if (this.output_ === '') {\n this.output_ += fileName\n this.output_ += ' | SUCCESS | passes ' + results.passes.length\n this.output_ += '\\n'\n }\n\n // Close the driver and output results at the end of the loop.\n if (index+1 === urls.length) {\n driver.quit()\n console.log(this.output_)\n }\n })\n\n }).catch ((err) => {\n console.log(err)\n })\n })\n }", "title": "" }, { "docid": "3295d45012b2ec461edc85655f7ba381", "score": "0.48346707", "text": "function selectImageFile(inputStatus, outputStatus, prefix)\n{\nvar selection;\n\tif (outputStatus)\n\t{\n\t\tselection = pathToImages + prefix + \"Gr.png\";\n\t}\n\telse if ((inputStatus) && (!outputStatus))\n\t// TODO change \"Bl.png\" to \"Gr_Bl.png\" when icons made\n\t{\n\t\tselection = pathToImages + prefix + \"Bl.png\";\n\t}\n\telse\n\t{\n\t\tselection = pathToImages + prefix + \"Bl.png\";\n\t}\nreturn selection\t\n}", "title": "" }, { "docid": "2a1ba457d82a966391fd2ad6aef9ebc2", "score": "0.48341197", "text": "function getImgPath(cmdArr) {\n return (cmdArr.synchroConditionId ? `${cmdArr.imagePath.split('\"')[0]}/${cmdArr.synchroConditionId}.png` : cmdArr.imagePath.split('\"')[0]);\n}", "title": "" }, { "docid": "4fe5a41b2189bedc9c1d5eb3713c53a7", "score": "0.4829172", "text": "function TestProgrammaticResources(\n){\n \n Virtue.apply(null,srcs)\n .then(\n (results) => {\n \n testShas(results,'programmatic');\n \n TestCommandLineResources();\n \n }\n )\n .catch(failTest)\n \n}", "title": "" }, { "docid": "cc03fc24990fefa771c41d28bf7f7e1d", "score": "0.48203138", "text": "function images() {\n return gulp.src( 'src/assets/images/**/*' )\n .pipe( gulp.dest( PATHS.dist + '/assets/images' ) );\n}", "title": "" }, { "docid": "cecace572066903a2b4b5282aaa32fef", "score": "0.48138773", "text": "iteratorAssets(outputPath) {\n return (source, file, done) => {\n let targetFile = file;\n const queryStringIdx = targetFile.indexOf('?');\n if (queryStringIdx >= 0) {\n targetFile = targetFile.substr(0, queryStringIdx);\n }\n // Write file content to target path and return callback done() after completed\n const writeOut = err => {\n if (err) return done(err);\n const targetPath = this.outputFileSystem.join(\n outputPath,\n targetFile\n );\n let content = source.source();\n if (!Buffer.isBuffer(content)) {\n content = Buffer.from(content, 'utf8');\n }\n this.outputFileSystem.writeFile(targetPath, content, done);\n };\n\n if (targetFile.match(/\\/|\\\\/)) {\n const dir = this.outputFileSystem.dirname(targetFile);\n this.outputFileSystem.mkdirp(\n this.outputFileSystem.join(outputPath, dir),\n writeOut\n );\n } else writeOut();\n };\n }", "title": "" }, { "docid": "05b7586b6f3d1e75786db87190da46e8", "score": "0.48092884", "text": "get path() {\n let found = null;\n if (fs.existsSync(this.userDir)) found = this.userDir;\n else if (fs.existsSync(this.defaultDir)) found = this.defaultDir;\n else if (fs.existsSync(this.path404)) found = this.path404;\n\n if (!found) logger('ImageFile: While looking for a PNG, not only was it not found in the user dir, it also wasn\\'t found in the default dir. The specified blank tile is also missing! Try reinstalling this app');\n return found || null;\n }", "title": "" }, { "docid": "8b0c0629c2cc3350915fb06493e9f9ed", "score": "0.48068985", "text": "function testImageFileName() {\n if (displayedImages.length === 2) {\n if (displayedImages[0] === displayedImages[1]) {\n //console.log('images match. Do something cool!');\n // add a score or message in footer or header?\n var targetClass = displayedImages[0].split('/');\n var newTest = targetClass.pop();\n var target = newTest.split('.');\n var result = target[0];\n var result2 = '.' + result + ' .col-md-3 .card-container';\n \n console.log(targetClass);\n console.log(newTest);\n console.log(result);\n console.log(result2);\n \n $(result2).css('display', 'none');\n \n //mask.css('background', '#fff');\n //mask.css('display', 'block');\n \n //console.log(targetElements);\n emptyImgArray();\n \n \n \n /*\n if ($('.card-container').hasClass(result)) {\n $(result2).css('display', 'none');\n }\n */\n \n \n } else {\n console.log('images do not match. Sorry!');\n // toggle display of images that are displayed\n // toggle their sibling as well\n emptyImgArray();\n \n }\n } else {\n console.log('Length of image array is ' + displayedImages.length);\n } \n}", "title": "" }, { "docid": "d8f0b5d311ee600786fe77335ba5a931", "score": "0.47988558", "text": "function _getReferenceImagePath() {\n\n const imageName = browser.imageComparisonName;\n\n return path.join('screenshots-reference/', imageName);\n}", "title": "" } ]
f6cd10e5a9c78accebbb0f222bf3d65a
An error function. Using this function will plumber will prevent gulp to crash when error occurs
[ { "docid": "33d26cb48770c5bbc34e9e63f6edbbe5", "score": "0.62411386", "text": "function onError(err) {\n gutil.log(gutil.colors.red(err));\n}", "title": "" } ]
[ { "docid": "d9d19c1df7250967cbb0c25b22da2a49", "score": "0.7410037", "text": "function handleErrors() {\n //arguments needs to be an array, so slicey-dicey.\n var args = Array.prototype.slice.call(arguments)\n console.log(args);\n notify.onError({\n title: \"Gulp done fucked up\",\n message: '<% error.message %>'\n }).apply(this, args); //apply - not call - the notify.onError to every \n this.emit('end'); //keeps gulp from hanging on task\n}", "title": "" }, { "docid": "1d8852b8560520988a6efb22a1f55964", "score": "0.73269653", "text": "function handleErrors() {\n var args = Array.prototype.slice.call(arguments);\n notify.onError({\n title: \"Compile Error\",\n message: \"<%= error.message %>\"\n }).apply(this, args);\n this.emit('end'); // Keep gulp from hanging on this task\n}", "title": "" }, { "docid": "3d0780ffda4d2a889f2e7f6e0c37f274", "score": "0.71903056", "text": "function handleErrors() {\n var args = Array.prototype.slice.call(arguments);\n notify.onError({\n title: 'Compile Error',\n message: '<%= error.message %>'\n }).apply(this, args);\n this.emit('end'); // Keep gulp from hanging on this task\n}", "title": "" }, { "docid": "d089941c6437f6a2af2a08e59a3b5d8e", "score": "0.7109991", "text": "function plumberErrorHandler(err) {\n // notify by console log\n $.util.log($.util.colors.white.bgRed(\"Build error:\"), err.message);\n\n beeper();\n\n // notify by notification\n notifier.notify({\n title: config.siteName,\n message: 'Build error! \"' + err.message + '\"',\n icon: iconError\n });\n\n this.emit('end');\n}", "title": "" }, { "docid": "b86b3d79bcec3313525558455efda1ae", "score": "0.70963097", "text": "function errorHandler(error) {\n // Logs out error in the command line\n console.log(error.toString());\n // Ends the current pipe, so Gulp watch doesn't break\n this.emit('end');\n}", "title": "" }, { "docid": "80d1db748e447a378c639f64399f2004", "score": "0.6916586", "text": "function customPlumber(errTitle) {\n return plumber({\n errorHandler: notify.onError({\n // Custom error titles go here\n title: errTitle || 'Error running Gulp',\n message: \"<%= error.message %>\",\n sound: 'Submarine',\n })\n });\n}", "title": "" }, { "docid": "80d1db748e447a378c639f64399f2004", "score": "0.6916586", "text": "function customPlumber(errTitle) {\n return plumber({\n errorHandler: notify.onError({\n // Custom error titles go here\n title: errTitle || 'Error running Gulp',\n message: \"<%= error.message %>\",\n sound: 'Submarine',\n })\n });\n}", "title": "" }, { "docid": "81c9ba614e171170bd6d5adce4c8e979", "score": "0.6739168", "text": "function errorFn() {\n\n}", "title": "" }, { "docid": "f522389fcd657237fddf4eb7e1b51bf1", "score": "0.6685309", "text": "function FailToPulish(err){\n console.log(\"Publish local stream error: \" + err);\n }", "title": "" }, { "docid": "e4ae86c9739cadb77f58c836edfe2c16", "score": "0.66373545", "text": "function error() {\n console.log(\"error\")\n}", "title": "" }, { "docid": "c1dc6ee21f9f76853c12a72539414e09", "score": "0.6579593", "text": "function errorAlertJS(error) {\n notify.onError({\n title: \"Gulp JavaScript\",\n subtitle: \"Algo esta mal en tu JavaScript!\",\n sound: \"Basso\"\n })(error);\n console.log(error.toString());\n this.emit(\"end\");\n}", "title": "" }, { "docid": "6ab40e26bed2e3bad6a041706a224493", "score": "0.6478789", "text": "function error(error) {\n // Parameter error berhasil dari Proise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "1f24180e2d4bc1f13238d0553a79fd9f", "score": "0.64507973", "text": "function errorAlertPost(error) {\n notify.onError({\n title: \"Gulp postCSS\",\n subtitle: \"Algo esta mal en tu CSS!\",\n sound: \"Basso\"\n })(error);\n console.log(error.toString());\n this.emit(\"end\");\n}", "title": "" }, { "docid": "77c19f2ea54de3d2608a99cf1111b5b7", "score": "0.6412125", "text": "function error(error) {\n\t// Parameter error berasal dari Promise.reject()\n\tconsole.log('Error : ' + error);\n}", "title": "" }, { "docid": "023dbf07fd437ddf2c7eddcb6200fe51", "score": "0.6411792", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error: \" + error);\n}", "title": "" }, { "docid": "d5f654d3de810b68d3d3fd2656414dbc", "score": "0.6392696", "text": "function erro(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error: \" + error);\n}", "title": "" }, { "docid": "c72c8ed370a023a034b016e0f5b97608", "score": "0.63900864", "text": "function error(error) {\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "11ade381fa95cd2a9cae6a51b891c822", "score": "0.63851416", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(`Error : ${error}`);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.63827413", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "f2c17c932babb0ef60b629c1345c3c66", "score": "0.6381138", "text": "function error(error) {\n console.log(\"Error: \" + error);\n}", "title": "" }, { "docid": "005cefcadf0176ab659c9bb58d9547d7", "score": "0.63694113", "text": "function reportError(error) {\n console.error(`Could not install plexiglass: ${error}`);\n }", "title": "" }, { "docid": "6125371478c28baf6fcb3e9d06ff8797", "score": "0.6367554", "text": "function error(error) {\n //parameter error dari promise.reject\n console.log(\"Error: \" + error);\n}", "title": "" }, { "docid": "9670894d6673230f2229c1a08287c7a1", "score": "0.63651454", "text": "function err(error){\n\tconsole.log('Error!');\n\tconsole.log(error);\n}", "title": "" }, { "docid": "5e558f71ce3f5bfdba11f8f7f0d5bae0", "score": "0.63590246", "text": "function error(error) {\r\n // Parameter error berasal dari Promise.reject()\r\n console.log(\"Error : \" + error);\r\n }", "title": "" }, { "docid": "528d20b8cfc3ed6f354057728881be8a", "score": "0.6348343", "text": "onError(err) {\n\t\t\tconsole.warn(`sourcePipe: ${err.stack||err.message||err}`);\n\t\t}", "title": "" }, { "docid": "d92b86169f98bb4f6b5e24b8aac56d96", "score": "0.6345653", "text": "function onError(err){\n console.log(err.message);\n\n $.notify.onError({\n title: \"Compile Error\",\n message: \"<%= error.message %>\"\n }).apply(this, Array.prototype.slice.call(arguments));\n\n if (browserSync.active) {\n this.emit('end');\n }\n}", "title": "" }, { "docid": "4e18dbcf5ccccbb2b648e1c71cccc029", "score": "0.63411903", "text": "function error(err) {\n console.log(err);\n}", "title": "" }, { "docid": "36c065403c3f1ac2ca176310d168b8f4", "score": "0.63293517", "text": "function error(error) {\r\n// Parameter error berasal dari Promise.reject()\r\n}", "title": "" }, { "docid": "dc52c148bb46538d099a12f3a9850cc1", "score": "0.63279176", "text": "function reportError(error) {\n console.error(`Could not beastify: ${error}`);\n }", "title": "" }, { "docid": "0dc37ee35afa870babb078bd0f4e3019", "score": "0.6323659", "text": "function error(error) {\n //Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "70639c24ead8cfdb31135c55b3e60ba9", "score": "0.63212854", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "70639c24ead8cfdb31135c55b3e60ba9", "score": "0.63212854", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "a9f03a112837ca5a5f22c9998bc702d1", "score": "0.631488", "text": "function onError(error) {\n notify.onError({\n //display the error message in the console\n message: error.message\n })(error);\n this.emit('end'); //allow task to end gracefully without killing watch tasks\n}", "title": "" }, { "docid": "a0fef7217718133d3ca2a384b6f608f1", "score": "0.62826324", "text": "function erroHandler(err) {\n notifierService.error(err.Message);\n }", "title": "" }, { "docid": "c79d1ef1149f4725a4078b1263a13d51", "score": "0.6268394", "text": "function reportError(error) {\n console.error(`Could not realoadify: ${error}`);\n }", "title": "" }, { "docid": "2ebe2da61664a75b2ef94ff474901d33", "score": "0.6254412", "text": "function emitError(e) {\n file.contents.emit('error', new Error('gulp-download-stream', e));\n }", "title": "" }, { "docid": "6885f1cb1164f968bc7843d101800dce", "score": "0.621876", "text": "function errorReportCallback (err) {\n if (err) {\n process.nextTick(function () {\n if (typeof err === 'string') {\n throw new Error(err)\n } else {\n throw err\n }\n })\n }\n}", "title": "" }, { "docid": "6885f1cb1164f968bc7843d101800dce", "score": "0.621876", "text": "function errorReportCallback (err) {\n if (err) {\n process.nextTick(function () {\n if (typeof err === 'string') {\n throw new Error(err)\n } else {\n throw err\n }\n })\n }\n}", "title": "" }, { "docid": "a89a28c671a0ee9587104a28fa3a3357", "score": "0.6216791", "text": "function error(err) {\r\n console.warn(`ERROR(${err.code}): ${err.message}`);\r\n}", "title": "" }, { "docid": "a89a28c671a0ee9587104a28fa3a3357", "score": "0.6216791", "text": "function error(err) {\r\n console.warn(`ERROR(${err.code}): ${err.message}`);\r\n}", "title": "" }, { "docid": "a0b451b0840b20d8a068ecbe22f0409d", "score": "0.62140954", "text": "function errorFunction (e) {\n console.log(e);\n}", "title": "" }, { "docid": "6e588bd90bcb650e47a60e5280664e33", "score": "0.61964095", "text": "function error(error) {\n // parameter error dari Promise.reject()\n console.log(\"error : \" + error);\n}", "title": "" }, { "docid": "d8385f5ca023a52c8d76b683f656c60a", "score": "0.61890525", "text": "function reportError(error) {\n console.error(`Could not do the thing: ${error}`);\n }", "title": "" }, { "docid": "9f4e739525bf5411cb1c79b705ae2a6e", "score": "0.6171812", "text": "function fail() {\n return error(\"Something failed\");\n}", "title": "" }, { "docid": "9f4e739525bf5411cb1c79b705ae2a6e", "score": "0.6171812", "text": "function fail() {\n return error(\"Something failed\");\n}", "title": "" }, { "docid": "5da9138fbc3684fcc91a1405426a4113", "score": "0.61638105", "text": "function pluginError (message) {\n return new PluginError('gulp-jade-jst-concat', message);\n}", "title": "" }, { "docid": "2d1012fda52bd4f4e8e9b012ad0c6e53", "score": "0.6163016", "text": "function pingError(error) {\n // if you want details of the error in the console\n console.log(\"=============================\");\n console.log(\"=+=+=+=+=+=+=+=+=+=+=+=+=+=+=\");\n console.log(error.toString());\n console.log(\"=+=+=+=+=+=+=+=+=+=+=+=+=+=+=\");\n console.log(\"=============================\");\n\n // display a message to the dev!\n notifier.notify({\n // 'contentImage': '',\n icon: false,\n message: \"The file you just edited has an error..\",\n sound: \"Basso\",\n timeout: 10,\n title: \"Web Starter NSE\",\n wait: true\n });\n\n this.emit(\"end\");\n}", "title": "" }, { "docid": "53fcc07e8c616b5d5c1931badf0e5f3c", "score": "0.6156664", "text": "function error(err) {\n\t console.warn('ERROR(' + err.code + '): ' + err.message);\n }", "title": "" }, { "docid": "7879687ce3619a023efb4fbf24b6bca3", "score": "0.615457", "text": "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}", "title": "" }, { "docid": "d2c8ae639a20dc710d5051573102be56", "score": "0.615133", "text": "function onError(){\n\tconsole.error(\"We dun goofed!\");\n}", "title": "" }, { "docid": "865ce3e1ee8f0c53ea98c65da21f37c9", "score": "0.61501724", "text": "function error(error) {\n //param form Promise.reject\n console.log(\"Error: \" + error);\n\n}", "title": "" }, { "docid": "fbe4bd9c5fc37d0fc7573198ef4ea817", "score": "0.6128263", "text": "function error(err) {\n next('ENOENT' == err.code\n ? null\n : err);\n }", "title": "" }, { "docid": "0cabbd58878fba90f2cc6c38cf2ac403", "score": "0.61209077", "text": "function onError(error) {\n do {\n if (!error) {\n console.error(chalk.white.bgRed(' [failed] '));\n break;\n };\n // ex: reject('error');\n if (typeof error === 'string' || error instanceof String) {\n console.error(chalk.white.bgRed(' [failed] ' + error));\n break;\n };\n // ex: reject({\"msg\":\"failed to clean\", \"data\": [{field:2,fieldd:'youpi'}, \"deux\"] });\n if (error.msg) {\n console.error(chalk.white.bgRed(' [failed] ' + error.msg));\n error = error.data;\n } \n // ex: reject(['error1','error2']);\n if (typeof error === 'array' || error instanceof Array) {\n console.error(chalk.red('-------------------------------'));\n error.forEach((d) => {\n console.error((typeof d === 'string' || d instanceof String) ? chalk.red(d) : d );\n console.error();\n });\n break;\n };\n // ex: reject({field:2,fieldd:'youpi'});\n console.error(chalk.white.bgRed(' [failed] '));\n console.error(error);\n } while(0);\n process.exit(/*1*/);\n}", "title": "" }, { "docid": "de9922d44ca1ac758aef02d2888944ba", "score": "0.6117816", "text": "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "title": "" }, { "docid": "5dfa7479142a2ddd3683ee7c1d92d286", "score": "0.6112269", "text": "function Err() { }", "title": "" }, { "docid": "3121639bf4778517617821d2330f59a8", "score": "0.611062", "text": "function errors(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "title": "" }, { "docid": "4b4f1ca51bbe37a023e40540aa3f4ba4", "score": "0.6106082", "text": "onError(err) {\n return err;\n }", "title": "" }, { "docid": "662752f59442104797fe14b98bbf592e", "score": "0.6105616", "text": "get error() {}", "title": "" }, { "docid": "4a33253f14a92c7a27d73c46508c8471", "score": "0.609065", "text": "onError(err) {\n console.log(err);\n return err;\n }", "title": "" }, { "docid": "5f134887b731492ef0fc48129f9d4342", "score": "0.60744864", "text": "function errorHandler(){\n var html;\n isProcessAborted = true;\n if(arguments.length === 3){\n //window.onerror\n html = '<p>' + arguments[0] + '</p><p>File: ' + arguments[1] + '</p><p>Line: ' + arguments[2] + '</p>';\n //v1.4.0 For external reporting.\n publishStatusUpdate({\n status: 'error',\n error: arguments[0] + '. File: ' + arguments[1] + '. Line: ' + arguments[2]\n });\n }else{\n //catch(e)\n html = '<p>An error occurred, \"' + arguments[0] + '\" and all further processing has been terminated. Please check your browser console for additional details.</p>';\n publishStatusUpdate({\n status: 'error',\n error: 'An error occurred, \"' + arguments[0] + '\" and all further processing has been terminated. Please check your browser console for additional details.</p>'\n\n });\n }\n elStatusContainer.innerHTML = html;\n }", "title": "" }, { "docid": "3079ed70b190da58cb431473f96f8732", "score": "0.60528725", "text": "function errorGenerator() {\n console.log(\"The error is intended >:)\")\n console.log(error);\n}", "title": "" }, { "docid": "8c7731f234046e978d9c1e48380901fe", "score": "0.6039259", "text": "function envErr(){\n if (process.env.NODE_ENV === \"production\"){\n let message = \"Error: Set env var(s)\";\n\n for(let arg of arguments){\n message += \" '\" + arg + \"'\"\n }\n\n console.error(message);\n process.exit(1);\n }\n }", "title": "" }, { "docid": "d9b7f5be6b67908180c80289b1fd2080", "score": "0.60256106", "text": "function reportError(error) {\r\n console.log(\"Something went wrong \" + error)\r\n}", "title": "" }, { "docid": "2f08c8a876290515495ba667c5ba6e05", "score": "0.6019265", "text": "function fsOperationFailed(stream, sourceFile, error) {\n\tif (error.code !== 'ENOENT') {\n\t\tstream.emit('error', new PluginError('gulp-changed', error, {\n\t\t\tfileName: sourceFile.path\n\t\t}));\n\t}\n\n\tstream.push(sourceFile);\n}", "title": "" }, { "docid": "0fc22cc3cbec326094027e2a181ada54", "score": "0.6011378", "text": "function reportError(error) {\r\n console.error(`${error}`);\r\n }", "title": "" }, { "docid": "6bab851e52a2a438bb54a00291071eec", "score": "0.600896", "text": "function error (message) {\n console.error(`${Program}: ${message}`)\n}", "title": "" }, { "docid": "cd6a893532c6e07de58259c1dfb33dd4", "score": "0.60073924", "text": "errorHandler(err, invokeErr) {\n const message = err.message && err.message.toLowerCase() || '';\n if (message.includes('organization slug is required') || message.includes('project slug is required')) {\n // eslint-disable-next-line no-console\n console.log('Sentry [Info]: Not uploading source maps due to missing SENTRY_ORG and SENTRY_PROJECT env variables.')\n return;\n }\n if (message.includes('authentication credentials were not provided')) {\n // eslint-disable-next-line no-console\n console.warn('Sentry [Warn]: Cannot upload source maps due to missing SENTRY_AUTH_TOKEN env variable.')\n return;\n }\n invokeErr(err);\n }", "title": "" }, { "docid": "721622cf764dcb0d7a31bb322c01547f", "score": "0.6007137", "text": "throwError(msg, err){\n\t\tif(err){\n\t\t\tconsole.log(\"Unexpected Module Error Stack Trace:\");\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t\tconsole.log(err);\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t}\n\n\t\tthrow new Error(\"Template Function Calls Error: \" + msg.toString());\n\t}", "title": "" }, { "docid": "15893c52e0c7c87e7ef583511ea2ed21", "score": "0.6001656", "text": "function error(err) {\n if (error.err) return;\n callback(error.err = err);\n }", "title": "" }, { "docid": "3bfc9cc34968c75b5b3372ab486f50b5", "score": "0.59952176", "text": "function envErr(){\n if (process.env.NODE_ENV === \"production\"){\n let message = \"Error: Set env var(s)\";\n\n for(let arg of arguments){\n message += \" '\" + arg + \"'\"\n }\n\n console.error(message);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "d1aece153552ba767fb4d57ff7ae15c0", "score": "0.598922", "text": "function fail(err) {\n console.log('Error');\n console.log(err);\n }", "title": "" }, { "docid": "41ffc1de5105e09f85cf403ac77aee8b", "score": "0.5978841", "text": "function errorAlert(error){\n notify.onError({\n title: \"Error in plugin '\" + error.plugin + \"'\",\n message: 'Check your terminal',\n sound: 'Sosumi'\n })(error);\n console.log(error.toString());\n this.emit('end');\n}", "title": "" }, { "docid": "b2446b779a549ca201e4e147ea0a0506", "score": "0.59696853", "text": "_logError(error) {\n if (this.options[this.LOGGING])\n this.log(`::GENERATOR::ERROR:: >> ${error}`);\n }", "title": "" }, { "docid": "bbb1a521d0f1e888cd26b0f428f600b2", "score": "0.596877", "text": "function error() {\n console.warn(`ERROR(${error.code}): ${error.message}`);\n }", "title": "" }, { "docid": "d9ff1a16afd50b24d0b077d65d264069", "score": "0.59677684", "text": "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "title": "" }, { "docid": "f37f5834a266220eb2bf655d236bf104", "score": "0.59636253", "text": "function poseErrorFunc(err) {\n console.log(`Error parsing pose: ${err}`);\n}", "title": "" }, { "docid": "b472b3b5bf4be35345df32400b10fa59", "score": "0.5949406", "text": "static logError() {\n const args = Array.prototype.slice.call(arguments)\n args.unshift('GDocsPlugin error')\n console.error.apply(null, args)\n }", "title": "" }, { "docid": "0fbd7fd40f3d316a4b04e695af2c6785", "score": "0.5948643", "text": "function loading_error(error, filename, lineno) {\n console.log(\"Error when loading files: \" + error);\n}", "title": "" }, { "docid": "0fbd7fd40f3d316a4b04e695af2c6785", "score": "0.5948643", "text": "function loading_error(error, filename, lineno) {\n console.log(\"Error when loading files: \" + error);\n}", "title": "" }, { "docid": "e6f0d8cac008f8ee10f91028bd48710b", "score": "0.5940521", "text": "function reportError(error) {\n console.error(`Could not shopify: ${error}`);\n }", "title": "" }, { "docid": "20d4250b8ea507f9fd43ec3fedc3d94c", "score": "0.5939746", "text": "function error(msg)\n{\n print(\"RES: ERR \" + msg);\n quit(true);\n}", "title": "" }, { "docid": "44871dd575f41f754e98602a665f331f", "score": "0.5937295", "text": "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "title": "" }, { "docid": "44871dd575f41f754e98602a665f331f", "score": "0.5937295", "text": "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "title": "" }, { "docid": "44871dd575f41f754e98602a665f331f", "score": "0.5937295", "text": "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "title": "" }, { "docid": "e394ca080e06126792ca97b8c17f0747", "score": "0.591667", "text": "function fotoError(error) {\n // Maak een notificatie als er een error is en print het naar de console voor debuging\n navigator.notification.alert(`Error code: ${error}`, null, \"Foto Error\");\n console.error(error);\n}", "title": "" }, { "docid": "7b8b79a73389020c7892addb53d886a5", "score": "0.5912502", "text": "function error (err){\n console.log(\"ERRO\",err.code);\n }", "title": "" }, { "docid": "7b8b79a73389020c7892addb53d886a5", "score": "0.5912502", "text": "function error (err){\n console.log(\"ERRO\",err.code);\n }", "title": "" }, { "docid": "7b8b79a73389020c7892addb53d886a5", "score": "0.5912502", "text": "function error (err){\n console.log(\"ERRO\",err.code);\n }", "title": "" }, { "docid": "7b8b79a73389020c7892addb53d886a5", "score": "0.5912502", "text": "function error (err){\n console.log(\"ERRO\",err.code);\n }", "title": "" }, { "docid": "7b8b79a73389020c7892addb53d886a5", "score": "0.5912502", "text": "function error (err){\n console.log(\"ERRO\",err.code);\n }", "title": "" }, { "docid": "7b8b79a73389020c7892addb53d886a5", "score": "0.5912502", "text": "function error (err){\n console.log(\"ERRO\",err.code);\n }", "title": "" }, { "docid": "6ecc0bc292051c30e1713e1847ee2f9f", "score": "0.591059", "text": "function onError(error) {\n console.log(`Error: ${error}`);\n}", "title": "" } ]
e0e33f173ed363a426c78f921d0bbddd
Collect dispatches (must be entirely collected before dispatching see unit tests). Lazily allocate the array to conserve memory. We must loop through each event and perform the traversal for each one. We cannot perform a single traversal for the entire collection of events because each event may have a different target.
[ { "docid": "d138168d23f6845d259f08c39492c18a", "score": "0.0", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n}", "title": "" } ]
[ { "docid": "533f30e074da42835581d44b2532a8c6", "score": "0.6166486", "text": "function accumulateDispatches(e,t,n){if(e&&n&&n.dispatchConfig.registrationName){var r=getListener(e,n.dispatchConfig.registrationName);r&&(n._dispatchListeners=accumulateInto(n._dispatchListeners,r),n._dispatchInstances=accumulateInto(n._dispatchInstances,e))}}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6036641", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6036641", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6036641", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6036641", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "97ef213baab86fd218c79c32b5eb51ca", "score": "0.6036641", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "ad61d71bb589707e764080b303341bad", "score": "0.5949713", "text": "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\n\texecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58931667", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58931667", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58931667", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "b3be74fe47e4e5c4748d76fc84020a54", "score": "0.58931667", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "dcb5d57b6cd5270b9d87daa21462d2ab", "score": "0.5867001", "text": "function executeDispatchesInOrder(event) {\n const dispatchListeners = event._dispatchListeners;\n const dispatchInstances = event._dispatchInstances;\n if (isArray(dispatchListeners)) {\n for (let i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and Instances are two parallel arrays that are always in sync.\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "9b52d06f15eb3cdeffa79f62ee4dbd1b", "score": "0.58447534", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "44143017a54a83040bee1006987423aa", "score": "0.5832364", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" }, { "docid": "21ba6eb517243ad3897f6cf13b4232c4", "score": "0.58027613", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchInstances = accumulateInto(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "21ba6eb517243ad3897f6cf13b4232c4", "score": "0.58027613", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchInstances = accumulateInto(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "21ba6eb517243ad3897f6cf13b4232c4", "score": "0.58027613", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchInstances = accumulateInto(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "21ba6eb517243ad3897f6cf13b4232c4", "score": "0.58027613", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchInstances = accumulateInto(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "21ba6eb517243ad3897f6cf13b4232c4", "score": "0.58027613", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchInstances = accumulateInto(event._dispatchInstances,inst);}}}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.5790434", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "5528292c26e248f6e33ee03c4527a4f6", "score": "0.57869184", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners,dispatchInstances=event._dispatchInstances;if(Array.isArray(dispatchListeners))for(var i=0;i<dispatchListeners.length&&!event.isPropagationStopped();i++)\n// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);else dispatchListeners&&executeDispatch(event,simulated,dispatchListeners,dispatchInstances);event._dispatchListeners=null,event._dispatchInstances=null}", "title": "" }, { "docid": "e108c5ccf6f0aaf3d0aeef2237936146", "score": "0.5782672", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;if(process.env.NODE_ENV!=='production'){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "e61a20a037c9bbebb4dd50fc7b2e7f34", "score": "0.5775854", "text": "function executeDispatchesInOrder(event,simulated){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;if(process.env.NODE_ENV!=='production'){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,simulated,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,simulated,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.57736194", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "a49eff5a7191bc44b2343d7fd67334f8", "score": "0.57710296", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t\t if (event && event.dispatchConfig.registrationName) {\n\t\t var registrationName = event.dispatchConfig.registrationName;\n\t\t var listener = getListener(inst, registrationName);\n\t\t if (listener) {\n\t\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t\t }\n\t\t }\n\t\t}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.57666594", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.57666594", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" }, { "docid": "d53b538701aab66c01f362dd68b1f119", "score": "0.57666594", "text": "function executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}", "title": "" } ]
cc0516a347fee8c78e7dd689c8882be4
START GAME FUNCTION When the user clicks on the "Let's Play!" button, the user will be directed the the lyrics page
[ { "docid": "dc9c5437630ffc99b16c013c1bc0ea22", "score": "0.0", "text": "function startGame(){\n $(\"#progressbar\").progressbar().show();\n setupGame();\n} // end of startGame", "title": "" } ]
[ { "docid": "5e1cec0c26ce8e297b561a1848b04501", "score": "0.7012655", "text": "function startGame() {\n console.log('\\n');\n inquirer.prompt([{\n name: 'play',\n type: 'confirm',\n message: 'Would you like to play?',\n }]).then(function(answer) {\n if (answer.play) {\n newGame();\n } else {\n console.log('\\nOkay. See you another time!');\n }\n });\n}", "title": "" }, { "docid": "9bc00a0367dde8154f63958413fd28dc", "score": "0.6936419", "text": "function startGame() {\n\tgenerateBaseHTML();\n\tsetBoard();\n\tifAnswerClicked();\n}", "title": "" }, { "docid": "3a2fc43636f34fdff8841c3013c318c0", "score": "0.6835952", "text": "function startGame() {\r\n gameOverlay.classList.remove('hide-item');\r\n exitBtn.classList.remove('hide-item');\r\n currentSong.pause();\r\n currentSong = new Audio(musicArray[0]);\r\n currentSong.volume = config.audioVolume;\r\n currentSong.loop = true;\r\n currentSong.play();\r\n exitBtn.addEventListener('click', event =>{\r\n menuScreen.classList.remove('hide-item');\r\n homeScreen.classList.remove('hide-item');\r\n gameOverlay.classList.add('hide-item');\r\n exitBtn.classList.add('hide-item');\r\n currentSong.pause();\r\n lightningSound.pause();\r\n currentSong = new Audio(musicArray[1]);\r\n currentSong.volume = config.audioVolume;\r\n currentSong.load();\r\n currentSong.currentTime = 5;\r\n currentSong.play();\r\n endAllTimeouts();\r\n console.log(\"exit game\");\r\n });\r\n handleFlickerTimeOut();\r\n }", "title": "" }, { "docid": "877f5194d5f572fffa30fe6339c69dcf", "score": "0.6817074", "text": "function actionOnClick(){\n\t\tthis.game.state.start('playGame1');\n\t }", "title": "" }, { "docid": "e3e14b538e71627bf211899f7a91abe1", "score": "0.681468", "text": "function startGame() {\n console.log(chalk.blueBright.bgBlack(\"-----------------------------\" + \"\\n\" +\n \"Astronomer's Paradise Hangman\" + \"\\n\" +\n \"-----------------------------\"));\n\n // Clears lettersGuessed before a new game begins\n if (lettersGuessed.length > 0) {\n lettersGuessed = [];\n }\n\n inquirer.prompt([{\n name: \"play\",\n type: \"confirm\",\n message: \"Ready to Play?\"\n }]).then(function(answer) {\n if (answer.play) {\n console.log(chalk.whiteBright(\"\\n\" + \"You get 10 turns to guess the right word.\" + \"\\n\" + \"Good Luck!\"));\n newGame();\n\n }\n else {\n console.log(\"Fine then. We'll play another time.\");\n }\n });\n}", "title": "" }, { "docid": "f5a5756caf29846418ac0c34de4a18dd", "score": "0.6801194", "text": "function startGame(){\n\t// Init players\n\tplayingPlayers = sessionStorage.getItem('playersPlaying');;\n\t// Init Cards\n\tif(!Number.isInteger(parseInt(playingPlayers))){\n\t\tplayingPlayers = 2;\n\t}\n\t/*\n\t// TODO: Add so cards can be loaded before hand, not important\n\tcards_global = JSON.parse(sessionStorage.getItem('Cards'));\n\tcards_global_id = JSON.parse(sessionStorage.getItem('Cards_id'));\n\tcards_treasure = JSON.parse(sessionStorage.getItem('Cards_Treasure'));\n\tcards_action = JSON.parse(sessionStorage.getItem('Cards_Action'));\n\tcards_victory = JSON.parse(sessionStorage.getItem('Cards_Victory'));\n\t*/\n\tinitCardsGlobal();\n\tfor(var i = 0; i < playingPlayers; i++){\n\t\tvar tempPlayer = new Player(i);\n\t\ttempPlayer.initPlayer();\n\t\tplayers.push(tempPlayer);\n\t\tplayers[i].drawHand();\n\t}\n\n\t// Choosing turn and start\n\tturn = Math.floor(Math.random() * playingPlayers);\n\tinitNewUIElement('div', new Map().set('id', 'turn'), 'info', ['inline']);\n\tinitNewUIElement('div', new Map().set('id', 'turn_box'), 'turn', ['inline', 'bold', 'size3_text_medium', 'text_shadow']);\n\tinitNewUIElement('div', new Map().set('id', 'helpDiv'), 'info', ['inline']);\n\tinitNewUIElement('audio', new Map().set('id', 'audioMain').set('src', 'res/villageMusicShort.mp3').set('loop', ''), //.set('controls', '')\n\t\t'helpDiv', ['inline', 'margin_top_10']).innerHTML = 'Your browser does not support the audio element';\n\t// TODO: Move the strings to vars\n\tcreateButton(MUSIC_STRING_PLAY, 'audioButton', 'helpDiv', togglePlay, ['normalButton', 'margin_left_10', 'margin_top_2']);\n\tcreateButton(HELP_MESSAGE_OPEN, 'helpButton', 'helpDiv', (function(){\n\t\tvar currentName = document.getElementById('helpButton').innerHTML;\n\t\tif(currentName === HELP_MESSAGE_OPEN){\n\t\t\tchangeText('helpButton', HELP_MESSAGE_CLOSE);\n\t\t} else{\n\t\t\tchangeText('helpButton', HELP_MESSAGE_OPEN)\n\t\t}\n\t\tmodifyCSSID('toggle', 'helpMessage', 'invis');\n\t}).bind(this), ['normalButton', 'margin_left_10', 'margin_top_2']);\n\tinitNewUIElement('div', new Map().set('id', 'helpMessage'), 'helpDiv', ['flex_container', 'invis']);\n\tvar stringActions = getHelpString();\n\tvar splitted = stringActions.split('\\n');\n\tfor(var i = 0; i < splitted.length; i++){\n\t\tvar el = initNewUIElement('div', new Map().set('id', 'helpMessage_' + i), 'helpMessage', ['inline', 'bold', 'size2_text_medium', 'text_shadow']);\n\t\tel.innerHTML = splitted[i];\n\t}\n\tchangeText('turn_box', getPlayer(turn).name + \":s turn\");\n\tdocument.getElementById('turn_box').style.backgroundColor = getPlayerColor(turn);\n\tfor(var i = 0; i < playingPlayers; i++){\n\t\tdocument.getElementById(id_player + i).style.order = 2;\n\t}\n\tdocument.getElementById(id_player + turn).style.order = 1;\n\tplayers[turn].startTurn();\n}", "title": "" }, { "docid": "db5c727dea9a89d295e5c21fe9aefc48", "score": "0.6791306", "text": "function start(){\n //Event Listeners for Player Options\n playerOptions[0].addEventListener(\"click\", ()=>{\n playRound(\"rock\");\n })\n playerOptions[1].addEventListener(\"click\", ()=>{\n playRound(\"paper\");\n })\n playerOptions[2].addEventListener(\"click\", ()=>{\n playRound(\"scissors\");\n })\n\n playButton.addEventListener(\"click\", () =>{\n playGame();\n })\n\n playGame();\n}", "title": "" }, { "docid": "3bae3767a55aae250a09e8db2a17e53e", "score": "0.67747897", "text": "function startGame() {\n $backgroundMusic[0].pause();\n $gameMusic.prop('volume', 0.1);\n $gameMusic[0].play();\n $startBtn.hide();\n startTime();\n }", "title": "" }, { "docid": "cf8a07c3232efea5e2b2eb2b76ccb1de", "score": "0.6743593", "text": "startGame() {\n document.querySelector(\"#overlay\").style.display = \"none\";\n document.querySelector(\"#phrase>ul\").innerHTML = \"\";\n document.querySelectorAll(\"#scoreboard li img\").forEach((img) => {\n img.src = \"images/liveHeart.png\";\n });\n document.querySelectorAll(\"#qwerty button\").forEach((button) => {\n button.className = \"key\";\n button.disabled = false;\n });\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "dc99b4820380f18409d5fc5572e535db", "score": "0.674344", "text": "startGame() {\n hideOverlay.style.display = 'none';\n hideOverlay.classList.remove('win');\n hideOverlay.classList.remove('lose');\n this.getRandomPhrase(this.createPhrases());\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "f7034a2bfcbd46ace0fdd1469eba1fb3", "score": "0.67314446", "text": "function quickPlayButtonPress()\n{\n\twindow.location=\"GuestGameSingleOrMultiplayer.html\";\n}", "title": "" }, { "docid": "f32d800ed99d74c75ca79cd964b11858", "score": "0.6725724", "text": "function callGameplay() {\n state = `gameplay`;\n hurt = false;\n phraseNum = 1;\n}", "title": "" }, { "docid": "08519329f0d79cecd0f3cacccdd82652", "score": "0.67208844", "text": "function startGame() {\n controller.playing = true;\n document.body.className = \"\";\n init();\n}", "title": "" }, { "docid": "424b89551e6523626ac871151736d876", "score": "0.67132485", "text": "function startGame() {\n updateScore();\n newQuestion();\n }", "title": "" }, { "docid": "8a9bee57ca7d295eaac0dc70c9b48426", "score": "0.66991776", "text": "function togglePlay() {\n playButtonExplode(togglePlay);\n initializePlayerCar();\n titleFlyOut();\n makeHud();\n tutorialAppear(1000);\n }", "title": "" }, { "docid": "8243f96d1cd078097803a310eb378091", "score": "0.6697327", "text": "function executeGame() {\n document.querySelector('#play').addEventListener('click',function(){\n startGame()\n })\n}", "title": "" }, { "docid": "e238b719cd77200bc7db6d30c74e4bbf", "score": "0.6681337", "text": "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n const currentPhrase = this.getRandomPhrase();\r\n this.activePhrase = currentPhrase;\r\n currentPhrase.addPhraseToDisplay(currentPhrase);\r\n }", "title": "" }, { "docid": "9c7da69a7b298ff219cea2eaa0afdb40", "score": "0.66808844", "text": "startGame() {\n // Hide the overlay\n const overlay = document.getElementById('overlay');\n overlay.style.display = 'none';\n\n // Choose a random phrase and show in the board\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "151aa7f1b5f42e450a43579e6086a8dc", "score": "0.6674995", "text": "startGame() {\n\t\tconst gameOverlay = document.getElementById('overlay');\n\t\tgameOverlay.style.display = 'none';\n\t\tthis.activePhrase = this.getRandomPhrase();\n\t\tthis.activePhrase.addPhraseToDisplay();\n\t}", "title": "" }, { "docid": "7256127a01282c70ef41fb7e1ac683bf", "score": "0.6662965", "text": "function startgame () {\n Timer();\n QuestionDisplay(); \n AnswerList();\n \n }", "title": "" }, { "docid": "921a126aefd3e7c921d73600bc8a8957", "score": "0.6662117", "text": "function startGame() {\n // todo: implement restart of the game\n }", "title": "" }, { "docid": "2e43c1edd47cebe7b418d12b04ae7a06", "score": "0.6658356", "text": "function startGame() {\n location.href= \"racetrack.html\";\n }", "title": "" }, { "docid": "71a4dbe023e7341482ed4216a4563167", "score": "0.664718", "text": "function startGame(event) {\n // // console.log('Click')\n // gameRunning = true\n // const soundTrack = document.querySelector('.soundtrack')\n // soundTrack.src = './assets/SoundTrack.wav'\n // soundTrack.play()\n // // //? \n // // //? \n }", "title": "" }, { "docid": "8480af969a4001a4b069f47b0fc7ff0d", "score": "0.66392136", "text": "function startPlaying() {\n\n}", "title": "" }, { "docid": "761841b8ea7b6bbe7b1da32e871b1da4", "score": "0.6634289", "text": "function playAi(){\r\n //redirect to gameGUI\r\n window.location.href=\"basicGame.html\";\r\n}", "title": "" }, { "docid": "9fd07d3f9ac23b78dd312b625bbab07c", "score": "0.66326314", "text": "function startGame() {\n // start loading spinner\n loadingSpinner.style.display = 'block';\n keyboard.style.display = 'none';\n\n readTextFile().then((res) => {\n chosenPhrase = chooseRandomPhrase(res);\n displayPhraseUnderscores(chosenPhrase); // display \"_\" for each letter in phrase\n drawHangmanPost();\n drawFreeWilly();\n drawDeadWilly();\n keyboard.addEventListener('click', handleLetterSelection);\n }).then(() => {\n //remove loading spinner\n loadingSpinner.style.display = 'none';\n keyboard.style.display = 'flex';\n })\n startGameBtn.removeEventListener('click', startGame);\n startGameBtn.addEventListener('click', restartGame);\n startGameBtn.innerHTML = \"Restart\";\n }", "title": "" }, { "docid": "7be57fe295249356da62057e2673efea", "score": "0.6628802", "text": "function playGameButtonEvent() {\n // Hide the home page section and show the game page section\n $(ID_SECTION_HOME).hide();\n $(ID_SECTION_GAME).show();\n // Start the GameSystem\n SGE.System.start();\n }", "title": "" }, { "docid": "9c0135f1678a47a6367b42403c2e3d4e", "score": "0.66097826", "text": "function playButtonListener(){\r\n\t\t\tconsole.log(\"play button hit\");\r\n\t\t\tgame.state.start(\"Game\");\r\n\t\t}", "title": "" }, { "docid": "dc95259e4b6d889d656edd38cd3c99d7", "score": "0.66083133", "text": "startGame() {\n this.resetBoard();\n document.getElementById(\"game-over-message\").innerHTML = \"\";\n document.getElementById(\"overlay\").style.visibility = \"hidden\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "4144b5ede036607c63a1760cd6c3ea25", "score": "0.6604035", "text": "startGame() {\n overlay.style.display = 'none';\n overlay.className = 'start';\n /* sets property with chosen phrase */\n this.activePhrase = this.getRandomPhrase();\n /* adds that phrase to the board */\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "4b40bf082734fb9d45526412f63a0b9f", "score": "0.6602558", "text": "function start() {\n $(\"#layer2\").hide();\n $(\"#layer3\").show();\n g( 'teach' ).style.display = 'none';\n g( 'start' ).style.display = 'none';\n g( 'share' ).style.display = 'none';\n //g( 'more' ).style.display = 'none';\n g( 'game' ).style.display = 'block';\n g( 'timer' ).style.display = 'block';\n g('score').innerHTML = '战果:0';\n g( 'timer' ).innerHTML = '15,00';\n score = 0;\n fingers = 0;\n timerStart = 0;\n nextSymbol = generate();\n next();\n running = true;\n document.title = '感恩节到了,吃货大作战!';\n}", "title": "" }, { "docid": "d4651cc9719368877f998e1fbee5555b", "score": "0.6588521", "text": "startGame() {\r\n document.getElementById('overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n document.getElementById('hint').style.display = 'none';\r\n }", "title": "" }, { "docid": "cbdcc20e0f78c48e1b65053aa7102696", "score": "0.658318", "text": "startGame(){\n $('#overlay').hide();\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "4f717cad9cfafb68b161619dcb181b5d", "score": "0.65814453", "text": "onPlayClick() {\n this.game.state.start('play');\n }", "title": "" }, { "docid": "9d7d4e848cc2e8df2636a322b73e35e2", "score": "0.65693265", "text": "startGame() {\r\n \t\tconst overlay = document.getElementById('overlay');\r\n \t\toverlay.style.display = \"none\";\r\n \t\tthis.getRandomPhrase().addPhraseToDisplay()\r\n \t}", "title": "" }, { "docid": "f67529b7144af5354dd3ae5c54f8beb7", "score": "0.65643245", "text": "playGame() {\n let playlist = this.state.playlist;\n let signal = this.state.signal;\n Game.start(playlist, signal);\n }", "title": "" }, { "docid": "d0dc518957b2b17be9daa72972eea058", "score": "0.65633065", "text": "startGame(){\r\n this.activePhrase = this.getRandomPhrase();\r\n const startOverlay = getDomElement('#overlay');\r\n startOverlay.style.display = 'none';\r\n this.phrases[this.activePhrase].addPhraseToDisplay();\r\n }", "title": "" }, { "docid": "fff2ae643910a02c11b9aa5f120e1ee6", "score": "0.65524185", "text": "play(){\n\t\tif(!this.gameIsOn)\n\t\t\tthis._playNewGame();\n\t}", "title": "" }, { "docid": "ac643a270009276d96935f3dc5de3b08", "score": "0.6552231", "text": "function playHangman()\n{\n\tinitializeSession();\t\n\tdoGuess();\t\n}", "title": "" }, { "docid": "ef7c1175f2a4057d16eb1347be6651a2", "score": "0.65519345", "text": "function start() {\n gamePhases.nextPhase();\n goTo.view('square.game.play.play');\n $rootScope.$broadcast('timer-start');\n }", "title": "" }, { "docid": "f416f93d60b7f65e0a2b5a036e8067d7", "score": "0.65490186", "text": "startGame() {\n let overlay = document.querySelector('#overlay')\n overlay.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "title": "" }, { "docid": "a6c4518b53827f16e2daf8d772cd2d63", "score": "0.6546345", "text": "startGame(){\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "6915e9be2796f172a71d6513b0470106", "score": "0.6544062", "text": "function startGame() {\n player1Message = \"It is your turn. Choose rock, paper, or scissors.\"\n player2Message = \"It is player 1's turn to choose rock, paper, or scissors.\"\n playerTurn = \"player1\";\n updateTurn();\n updateMessages();\n }", "title": "" }, { "docid": "6b352c28e1d6cbc07d3e9ecd551ca91d", "score": "0.65402955", "text": "function startGame() {\n\n\n\taudio.play(); \n\n\tbeats = 0;\n score = 0;\n text = \"\";\n letters = \"\";\n\tstart = true;\n\n}", "title": "" }, { "docid": "6c503eeaf299c9ee3e56e4973156b97a", "score": "0.6531573", "text": "startGame() {\n\t\tthis.currentPhrase = new Phrase(this.getRandomPhrase());\n\t\tthis.currentPhrase.addPhraseToDisplay();\n\t}", "title": "" }, { "docid": "fea18e85589618411ecc6390f0699220", "score": "0.6527635", "text": "function requestLyrics() {\n var song = Grooveshark.getCurrentSongStatus().song;\n var songInfo;\n\n if (song) { \n songInfo = { 'song': song.songName, 'artist': song.artistName };\n ges.messages.send('lyrics', songInfo, displayLyrics);\n } else {\n ges.ui.notice('Play a song before requesting its lyrics.', { title: 'No active song', type: 'error' });\n }\n }", "title": "" }, { "docid": "5642a6df00a3fbdae5c0119775df9a4d", "score": "0.65236396", "text": "function startGame() {\n //initialize game variables\n genRandom();\n clueHoldTime = 1500;\n progress = 0;\n gamePlaying = true;\n \n //swaps start to end button\n document.getElementById(\"startBtn\").classList.add(\"hidden\");\n document.getElementById(\"stopBtn\").classList.remove(\"hidden\");\n \n //starts playing clue sounds\n playClueSequence()\n}", "title": "" }, { "docid": "c639ebdec5628066141c1d0877373717", "score": "0.6512829", "text": "function startGame() {\r\n $(\"#start\").hide();\r\n $(\".h1 .h2\").show();\r\n $(\"#prompt\").text(\"Click on the correct answer:\");\r\n getQuestion();\r\n }", "title": "" }, { "docid": "50fbcde0db0cf46029027e75034d0e16", "score": "0.6512613", "text": "function playSong() {\n\n}", "title": "" }, { "docid": "2a81e5a38448c7a68b0beb9b463f75ac", "score": "0.6511012", "text": "function startGame(){\n\n\t\t$('#startGame').on('click', function(){\n\n\t\t\t$('#time').show();\n\n\t\t\t$('#startGame').remove();\n\n\t\t\taddQuestion();\n\n\t\t})\n\n\t}", "title": "" }, { "docid": "99d8a7161f1e6c65cd25566e45d51141", "score": "0.65100473", "text": "startGame() {\n $('#overlay').hide();\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "a91f493f74c90a68ed296a17258f00b3", "score": "0.650359", "text": "function startGame(event) {\r\n window.location.href = window.location.href;\r\n}", "title": "" }, { "docid": "80677c4a1831c6e3d2b7cf2bf86fec60", "score": "0.6500493", "text": "function startGame() {\n document.querySelector('#start-game').style.display = \"none\";\n document.querySelector('#game').style.display = \"block\";\n let choices = document.querySelectorAll('.choice')\n choices.forEach(choice => choice.addEventListener('click', playGame))\n}", "title": "" }, { "docid": "23c48470edd264d226b8cae62c0495e1", "score": "0.6500074", "text": "startGame(){\n \t\tthis.gameReset();\n \t\t$('#overlay').fadeOut('slow'); let phrase = this.getRandomPhrase();\n \t\tphrase.addPhraseToDisplay(phrase);\n \t\tthis.activePhrase = phrase;\n \t}", "title": "" }, { "docid": "d9542838ad62550912c0ab38163cef20", "score": "0.64995307", "text": "function startButtonClick() {\n currentState = constants.PLAY_STATE;\n changeState(currentState);\n }", "title": "" }, { "docid": "52b4f74fc2e29ee404855e5a57c06b64", "score": "0.64950556", "text": "function startPage() {\n gameIntroPage();\n}", "title": "" }, { "docid": "971f419274da8d4f65fc1a98a0999262", "score": "0.6492529", "text": "function startGame() {\n setNumbers();\n setWords();\n chooseWord();\n guessLetter();\n}", "title": "" }, { "docid": "89c3c8ac67440a64c2dd539e04ecef59", "score": "0.649129", "text": "function startGamePlay() {\n $timer.show();\n $coder.show();\n $scoreBoard.show();\n $scoreDisplay.text(0);\n $timer.text(60);\n }", "title": "" }, { "docid": "95d83cf5d994d16149f239b647090c7a", "score": "0.648541", "text": "function play(){_core2.default.play();_configState2.default.setPlayerState()}", "title": "" }, { "docid": "55a6543776e39cdce54a42a21316042d", "score": "0.6471656", "text": "startGame() {\n\t\t//**Initializing Game Variables.**//\n\t//\tthis.getRuleSet(); //Get settings for each round from local server.\n//\t\tthis.wordset = this.getWordSet(); //Gather words for current game.\n/*\t\tthis.p1points = 0;\n\t\tthis.p2points = 0;\n\t\tthis.waiting= 1;\n\t\tthis.round = 0;\n\t\tthis.currentplayer = 0;\n\t\tthis.roundgifs = [];\n\t\tthis.roundwords = [];\n\t\tthis.p1guess;\n\t\tthis.p2guess;\n\t\tthis.button = $(\"#startbutt\").clone(); //Cloning play button for future use. */\n\n\t//\tthis.questionSet = null;\n\t\tthis.getQuestionSet();\n\t\t\n\n\t\t//**Changing HTML Content.**//\n\t\tlet content = $(\"#content\");\n\t\tlet header = $(\"#header\");\n\t\tcontent.empty();\n\t\theader.empty();\n\t\n\t}", "title": "" }, { "docid": "151a9b3427f0c2ca5ebf83db723ebcda", "score": "0.64642507", "text": "function replay () {\n\tstartGame();\n}", "title": "" }, { "docid": "d5eac89913fc199f97e5ccd46bded008", "score": "0.64565146", "text": "function startGame() {\n \n}", "title": "" }, { "docid": "93fe3ca2ed40f553a1f5e7d2ea3161b4", "score": "0.64562553", "text": "function play(e) {\n restart.style.display = 'inline-block';\n const playerChoice = e.target.id;\n const computerChoice = getComputerChoice();\n const winner = getWinner(playerChoice, computerChoice);\n showWinner(winner,playerChoice,computerChoice);\n}", "title": "" }, { "docid": "ad102082a9ba76b869ef1b936cb5b8a2", "score": "0.64492893", "text": "function startMusicGame() {\n\tresetScoreCounter();\n\tquestionsContainer.style.display = 'block';\n\tcurrentMusicQuestionIndex = 0;\n\tscoreUpdater.innerHTML = '1 of 5 questions';\n\tdisplayMusicQuestion();\n}", "title": "" }, { "docid": "c87b96f15c5b85bbbacf133bbad12759", "score": "0.644636", "text": "function startGame() {\n pickWord();\n initBoard();\n updateBoard();\n createLetters();\n}", "title": "" }, { "docid": "30cf04e3c8bba1d494370ab4e121a385", "score": "0.6443524", "text": "startGame(){\n $('#overlay').delay(1000).slideUp(800);\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "7f0c240e611163bd9e0b52ec1c7aefb4", "score": "0.64419246", "text": "function startGame() {\n setPlayButton(\"none\");\n setBoardState(\"\");\n }", "title": "" }, { "docid": "85a4532967c1adb02f8ca4173b982410", "score": "0.6431329", "text": "start () {\n this.db.addPlay();\n this.state = 'start';\n this.vp = new VideoPlayer(BACKGROUND, OFFICE);\n this.ap = new AudioPlayer(OFFICE_AUDIO);\n this.vp.start();\n this.ap.start();\n\n // When we finished playing a particular oneshot\n // this is used mostly for voice cues\n this.vp.onplayed = (id) => {\n if (id === 'intro') {\n // Tell the user they look tired\n this.assistant.say(OFFICE_TIRED, OFFICE_TIRED_CC, true).then(() => {\n this.tiredButton = new Button(440, 420, 'CLOSE EYES');\n this.tiredButton.onclick = () => {\n this.onAction({ action: 'close_eyes' });\n };\n });\n } else if (id === 'office') {\n // Play the next audio source\n this.ap.advance();\n }\n };\n\n // When we are done playing this loop\n this.vp.onDone = () => {\n // hopefull the gc picks this up\n this.vp = null;\n this.ap = null;\n this.nextScene();\n };\n\n this.startbutton = new StartButton(512, 350, BUTTON);\n this.startbutton.onclick = () => {\n this.onAction({ action: 'start' });\n };\n }", "title": "" }, { "docid": "a9f60bc5dc61b007abce815c4d2d7e01", "score": "0.6429745", "text": "function startGame() {\n\tstart.classList.add('hide');\n\trandomQuestions = questions.sort(() => Math.random() - .5);\n\tquestionIndex = 0;\n\tquestionbox.classList.remove('hide');\n\tsetNextQuestion();\n\t/*this starts a timer when the first answer is chosen by the user*/\n\tvar timer = setInterval(function() {\n\t\tvar minutes = Math.floor(time / 60);\n\t\tlet seconds = time % 60;\n\t\tseconds = seconds < 10 ? `0` + seconds : seconds;\n\t\tif (time <= 0) {\n\t\t\tclearInterval(timer);\n\t\t\twindow.open('highscores.html');\n\t\t} else {\n\t\t\tcountdownEl.innerHTML = `${minutes}:${seconds}`;\n\t\t}\n\t\ttime -= 1;\n\t}, 1000);\n}", "title": "" }, { "docid": "2f5fd7ec891c9f79c702015cb72003d0", "score": "0.64292884", "text": "function start() {\n switch (askLiri) {\n case 'concert-this':\n concert();\n break;\n\n case 'spotify-this-song':\n spotify();\n break;\n\n case 'movie-this':\n movie();\n break;\n\n case 'do-what-it-says':\n whatitSays();\n break;\n\n }\n}", "title": "" }, { "docid": "ae00c5082584389fb48c6e0ed3bd9126", "score": "0.64247316", "text": "startGame() {\n $('#overlay').hide();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "d8c5be10fc365fc696852532acfa27a7", "score": "0.6424359", "text": "function playGame() {\n if (!randomWord.wordFound()) {\n if (numGuesses > 0) {\n getLetter();\n }\n else {\n console.log(chalk.red(`You ran out of guesses. Too bad, you lose!\\n`));\n // console.log(\"Next word:\")\n resetGame();\n }\n }\n else {\n console.log(chalk.green(`Congratulations, you got it right!\\n`));\n // console.log(\"Next word:\")\n resetGame();\n }\n}", "title": "" }, { "docid": "5bb1d5906112cb3ff2794db766374fae", "score": "0.6422738", "text": "function mainMenuClick() {\n //load landing screen of the game\n loadHomeScreen();\n //play button audio sound\n playButtonAudio();\n}", "title": "" }, { "docid": "3d3791db633ed559bf24c0358cd9eb6c", "score": "0.6419751", "text": "function firstAction() {\n changePage(\"player\");\n}", "title": "" }, { "docid": "de4cf45991de496dd8dde81525bec7a1", "score": "0.6417542", "text": "function Play() {}", "title": "" }, { "docid": "20c4c2d10c8ab25c3a5ddcc09a8bf9a4", "score": "0.64175093", "text": "function load(){\n loadSongs();\n correct();\n}", "title": "" }, { "docid": "51f2fb5ebe8f69ca27637313d3c85f38", "score": "0.6409949", "text": "startGame(){\n this.resetTheGame();\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = new Phrase(this.getRandomPhrase());\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "2c694c86343a30552bca1b2f9c461188", "score": "0.64037824", "text": "startGame() {\r\n // hide the element with the id \"overlay\"\r\n $(\"#overlay\").hide();\r\n // set activePhrase property to the phrase returned by the getRandomPhrase method\r\n this.activePhrase = this.getRandomPhrase();\r\n // call the addPhraseToDisplay method on the activePhrase to display the phrase to the user\r\n this.activePhrase.addPhraseToDisplay(); \r\n }", "title": "" }, { "docid": "a705b1d4a0c53b3ff01b65ff201d5350", "score": "0.6403664", "text": "startGame() {\n this.activePhrase = this.RandomPhrase;\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "d067bf9f2c00a2ea65eb4081c5f29cb7", "score": "0.6402512", "text": "startGame() {\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n this.resetGame(); //calls the reset game for a new game\n }", "title": "" }, { "docid": "be41dbab4cf22f27dcccb90b4c3fe137", "score": "0.64024156", "text": "start() {\n this.score = 0;\n this.lastFrame = Date.now();\n \t\n \t// MUSIC STARTS\n \t\n \tmyMusic = new sound(\"gametheme.mp3\");\n \tmyMusic.play();\n\n // Listen for keyboard left/right and update the player\n document.addEventListener('keydown', e => {\n if (e.keyCode === LEFT_ARROW_CODE) {\n this.player.move(MOVE_LEFT);\n }\n else if (e.keyCode === RIGHT_ARROW_CODE) {\n this.player.move(MOVE_RIGHT);\n }\n });\n\n this.gameLoop();\n }", "title": "" }, { "docid": "b59b37d3bd7f716f592329de44f2e739", "score": "0.63989854", "text": "function startGame() {\n questionCounter = 0;\n score = 0;\n // availableQuesions = questions;\n getNewQuestion(Movie.currentSlide);\n }", "title": "" }, { "docid": "16ae6c4b056a9dbe14caa13c999f050a", "score": "0.63927937", "text": "startGame() {\r\n this.reset();\r\n this.gameStarted = true;\r\n document.getElementById('overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n document.getElementById('banner').style.background = 'red';\r\n document.getElementById('phrase').style.background = 'silver';\r\n document.getElementById('qwerty').style.background = 'black';\r\n document.getElementById('scoreboard').style.background = 'silver';\r\n\r\n }", "title": "" }, { "docid": "67a4e4eb50c61cacafc4cd1aee12b676", "score": "0.6383562", "text": "function play_game(e) {\n\t\tmodal.parentNode.removeChild(modal);\n\t\tgoat_wrapper.style.display = 'block';\n\t\tmain();\n\t}", "title": "" }, { "docid": "937581feffd43d0298123e944ec3f411", "score": "0.6373803", "text": "function setupGame(){\n // once the player has clicked on the $startPlay or $playAgain button, the image of the egg and the background color of the lyrics div will change\n $egg.attr(\"src\", happyEgg);\n $lyrics.css(\"background-color\", \"#72cc5c;\");\n\n // get a random word from each list of the json objects (a random insect, place, liquid, noun and verb)\n insect = getRandomElement(dataIn.insect);\n place = getRandomElement(dataIn.place);\n liquid = getRandomElement(dataIn.liquid);\n noun = getRandomElement(dataIn.noun);\n verb = getRandomElement(dataIn.verb);\n\n // get a random surprise from the surprises stored in the json file\n surpriseEgg = getRandomElement(dataIn.surprise);\n\n // the lyrics will be appended to the lyrics display div\n container = document.getElementById(\"lyrics_display\");\n\n // the lyrics are divided into three strings (three parts)\n // part ONE\n let lyrics_one = insect + \" climbed up my \" + place + \",\" + \" Down came the \" + liquid + \" and clean the \" +insect;\n firstLine = document.createTextNode(\"Itsy bitsy \" +lyrics_one+\" out.\");\n container.appendChild(firstLine);\n // part TWO\n let lyrics_two = noun + \" and \" + verb + \" up all the \" + liquid;\n secondLine = document.createTextNode(\" Out came the \" +lyrics_two+\",\");\n // part THREE\n let lyrics_three = insect + \" climbed up my \" + place;\n thirdLine = document.createTextNode(\" And the itsy bitsy \" +lyrics_three+\" again.\");\n\n // Use the three strings for annyang\n voiceCommands(lyrics_one, lyrics_two, lyrics_three, container);\n\n // Hide the title, message and buttons in the lyrics section of the game\n $title.hide();\n $message.hide();\n $startPlay.hide();\n $playAgain.hide();\n\n} // end of setupGame", "title": "" }, { "docid": "6d799f6abd64bbf7015fa8c417983688", "score": "0.6372099", "text": "function startGame() {\n\tlet levelSelected = document.querySelector(\".btn-level.selected\").dataset.level;\n\n\tsounds.gameTheme.load();\n\n\tinitialiseGame(levelSelected);\n}", "title": "" }, { "docid": "ac43f865b94d604e5a0d213db529d9d3", "score": "0.63705605", "text": "function startGame() {\n let rulesContainer = document.getElementById('rules-container');\n rulesContainer.style.display = 'none';\n let gameArea = document.getElementById('game-container');\n gameArea.style.display = 'table';\n let answerContainer = document.getElementById('answer-btn-container')\n answerContainer.style.display = 'flex';\n changeQuestionAndOptions();\n audio.play();\n}", "title": "" }, { "docid": "a1d9f3fd6ed8b78f13f0ee7deabea85c", "score": "0.63652086", "text": "function startGame() {\n setupGame();\n listenForKeyboardEvents();\n showScores();\n requestInterval(gameLoop, 100);\n }", "title": "" }, { "docid": "91ad70f19d6137eaf0c156a9147e2c9b", "score": "0.6353809", "text": "function listenClick() {\n event.target === start ? startGame() : isStrict()\n}", "title": "" }, { "docid": "70fd6cd7e98fddeb92db7820bc3fc2df", "score": "0.63492614", "text": "function play_the_song(){\r\n if(playing_song == false){\r\n playSong();\r\n }else{\r\n pauseSong();\r\n }\r\n }", "title": "" }, { "docid": "a071683143d2e24c5f31a9bf8c1d581b", "score": "0.63449925", "text": "startGame(){\n const overlayDiv = document.getElementById('overlay');\n overlayDiv.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "6551f3b31d4c6a653a93d3095f5f190f", "score": "0.6342146", "text": "function play() {\n forwardGeneration();\n show();\n}", "title": "" }, { "docid": "92f549642e870df1eb13ebaaac47d621", "score": "0.6339141", "text": "function startGame() {\n\n}", "title": "" }, { "docid": "b561ef52b39db608ddeb1afe966a0f7e", "score": "0.632832", "text": "function startGame() {\n\t\t$('#start-btn').fadeOut();\t// Hide start btn\n\n\t\tshuffledQstns = qstnsLst.sort( () => Math.random() - 0.5 )\t// Sort questions randomly\n\t\tiQstn = 0\t// Index of current question\n\n\t\t\n\t\t$('#question-container').fadeIn()\t// Show question/answers \n\t\tsetNxtQstn()\t\t\t\t\t\t// run setNxtQstn()\n\t}", "title": "" }, { "docid": "1e374c410ec1f5cbe0d7246dbce05415", "score": "0.63278013", "text": "startGame() {\n if (!DATA.playing) {\n DATA.playing = true;\n VIEW.disableOptions(true);\n requestAnimationFrame(this.update);\n }\n }", "title": "" }, { "docid": "5bc0652ae04edf335bcec8b5daac9d70", "score": "0.63224804", "text": "function gameStart(){\n\n\t// if the game has finished change the click functionality\n\tif (timerVal < 0){\n\t\tlocation.reload();\n\t}\n\n\t// if the game is not in progress then start it\n\tif(!runGame){\n\t\trunGame = !runGame;\n\t\trender();\n\t\tonTimer();\n\t}\n\n}", "title": "" }, { "docid": "542ce431372bcc274e714dfbdec7227f", "score": "0.63186127", "text": "function play_game() {\r\n welcome_note.style.display = \"none\";\r\n if (white_alias.value != \"\")\r\n turn.innerHTML = `White's turn (${white_alias.value})`;\r\n\r\n else\r\n turn.innerHTML = `White's turn`;\r\n\r\n if (black_alias.value.trim() != \"\")\r\n board_black.innerHTML = `Black (${black_alias.value})`;\r\n if (white_alias.value.trim() != \"\")\r\n board_white.innerHTML = `White (${white_alias.value})`;\r\n start();\r\n}", "title": "" }, { "docid": "6db74f377c5f9f1feb00fca9dc41096b", "score": "0.6317815", "text": "startGame() {\r\n // Hide the start screen overlay \r\n const gameOverlay = document.getElementById('overlay');\r\n gameOverlay.style.display = 'none';\r\n // Set the activePhrase property and add to the display\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "title": "" }, { "docid": "253de5d9fdd8e407fb95929b9eb5a800", "score": "0.63159907", "text": "function startGameScreen() {\n content.html(startButton);\n }", "title": "" }, { "docid": "c26f9680aedb83d3b1e6d07a9eb5f0a4", "score": "0.6315276", "text": "function play() {\n console.log('clicked start')\n rank = Math.floor(width/3)\n row = Math.floor(rank/2)\n const player = new Player(width*width-width)\n}", "title": "" }, { "docid": "c8243c8b96b63d742c74ceb0cb5ca90f", "score": "0.63142574", "text": "function startGame() {\n resetGame();\n // remove robots from scene if any\n robotSettings.robots.forEach(robot => scene.remove(robot));\n robotSettings.robots = [];\n // reset score time and lives in html\n document.getElementById(\"score\").innerText = `Score: ${gameSettings.score.toString()}`;\n document.getElementById(\"time\").innerText = `Time: ${gameSettings.playTime} seconds`;\n document.getElementById(\"lives\").innerHTML = 'Lives: ';\n Array.from({length: gameSettings.lives}, () => document.getElementById(\"lives\").innerHTML += ' &#9829;');\n document.getElementById(\"play\").innerText = \"Restart\";\n // start game - clock and robot making\n gameSettings.gameOver = false;\n clock();\n makeRobots();\n}", "title": "" } ]
a995aaea543cae73a2bf638c1acbfd41
Click View Button for more details
[ { "docid": "8459ebdcc69613330ccb951574971f8d", "score": "0.0", "text": "viewBookClicked(id) {\n console.log('View Ranks ID ' + id)\n this.props.history.push(`/book/${id}`)\n }", "title": "" } ]
[ { "docid": "e3a9e28ce52db723deb88fcf1137c3da", "score": "0.695147", "text": "function clickViewDocument(){\n\tclickMsds();\n\tabRiskMsdsRptByProviderController.tabsBldgManagement.selectTab('document');\n\tshowDocument();\n}", "title": "" }, { "docid": "e079e147eb68a2a2d5bfc9c29f1c0f34", "score": "0.6742655", "text": "goToDashboard()\n\t{\n\t\tthis.newViewButton.click()\n\t}", "title": "" }, { "docid": "ecddf5a7d7173b738a11b0979d68af1d", "score": "0.65935653", "text": "#tapInfo() {\n const button = this.#getInfoButton();\n if (button) {\n button.click();\n }\n }", "title": "" }, { "docid": "eb2a69f49db43d31e21fdcc23b348a7f", "score": "0.6540966", "text": "detailsView() {\n list.listViewSetup()\n this.detailsViewSetup()\n cy.contains('Total Additions')\n cy.contains('Total Deletions')\n cy.contains('Total Overall')\n cy.get('.v-image__image').should('exist')\n cy.get('.font-weight-bold').should('exist')\n\n cy.get('.v-btn__content').click()\n cy.url().should('include', '/commits?page=1&per_page=10', {timeout: 3000})\n cy.contains('Commits', {timeout: 3000})\n\n }", "title": "" }, { "docid": "9e345df29fe447fa4e8583e7503a1825", "score": "0.652345", "text": "open() {\n this._view.open();\n }", "title": "" }, { "docid": "aa581d6a6af683ec9f4b7d93fc391002", "score": "0.64803374", "text": "function launchView(table, uid, bP) {\n\tvar thePreviewWindow = \"\";\n\tthePreviewWindow = window.open(TYPO3.settings.ShowItem.moduleUrl + '&table=' + encodeURIComponent(table) + \"&uid=\" + encodeURIComponent(uid),\n\t\t\t\"ShowItem\" + TS.uniqueID,\n\t\t\t\"width=650,height=600,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0\");\n\tif (thePreviewWindow && thePreviewWindow.focus) {\n\t\tthePreviewWindow.focus();\n\t}\n}", "title": "" }, { "docid": "e8892651ba121950e61342433c7b7039", "score": "0.64138514", "text": "function clickHandler(_evt) {\n\t/* Navigate to another screen */\n\tviews.navigate(\"view-2\");\n}", "title": "" }, { "docid": "6a245ec443b594fb02378ca4da903692", "score": "0.6274495", "text": "function viewQuestionBtn_click( event ) {\n event.preventDefault();\n \n var questionId = $( this ).data( 'questionId' );\n\n toggleQuestionDetails( questionId );\n }", "title": "" }, { "docid": "07290cbe0e31880ae924da077e175d44", "score": "0.62163794", "text": "clickAction(eventData){\n\t\t\t\t\tthisRef.showModalDetail(this.link,this.title,this.desc,this.pubDate)\n\t\t\t\t}", "title": "" }, { "docid": "5d2a64d357695b85d39211848900de29", "score": "0.6213903", "text": "performClickFunctionality(){}", "title": "" }, { "docid": "b0012362c1ab2925a508be78c20b19a9", "score": "0.61926836", "text": "function _openView(){\r\n\t\t\twindow.open(ParseXMLContent.Constants.VIEWSOURCEURL);\r\n\t\t}", "title": "" }, { "docid": "23308272f27afbaf512969df6e6a6b62", "score": "0.6152665", "text": "function goToVisualization(e) {\n sendInteractionClickData('file upload button', 'clicked from upload view');\n visualizeScreenView();\n}", "title": "" }, { "docid": "00fbde5b6ba4d7b7e9d1c2791f4856d9", "score": "0.61320055", "text": "function displayAddEventView() {\r\n nav.navigate(\"/pages/events/addEvent.html\");\r\n }", "title": "" }, { "docid": "980a21837304dee491977159bfbe8e49", "score": "0.6130924", "text": "function view() {\n vm.action = 'view';\n }", "title": "" }, { "docid": "9e4e9e85939f142e68e5a891f95acf6e", "score": "0.6130418", "text": "clickBlogButton() {\n this.blogButton.click();\n }", "title": "" }, { "docid": "6370581c72153f2b9787ba8be809181a", "score": "0.60753113", "text": "ACTION_SHOW_DETAILS_ANCHOR () {\n this.$el.find('a.showPreview')\n .off('click')\n .on('click', (e) => {\n e.preventDefault();\n const selectedItemId = e.currentTarget.dataset.candidateId;\n RecruiterApp.core.vent.trigger('candidateViewRecord', selectedItemId);\n });\n }", "title": "" }, { "docid": "71a125906c7627247451c68dd7ce9335", "score": "0.6067402", "text": "function showView(viewName) {\n $('.view').hide();\n $('#' + viewName).show();\n console.log('control4')\n }", "title": "" }, { "docid": "e4b1904f5e321dde67a2b2ba1e7333b6", "score": "0.60009307", "text": "showMethod() {\n\t\tthis.gotoPage(1);\n\t}", "title": "" }, { "docid": "b9977c55df2c1d1baf97d047904471ab", "score": "0.59803843", "text": "handleClick() {\n // TODO: reveal node + go to first trace of package\n }", "title": "" }, { "docid": "f99ccceec14bb42b3bce73801d63bdca", "score": "0.5979071", "text": "function changeView(e){\n var name = e.getAttribute('id');\n var toOpen = name + 'View';\n currentViewContainer.innerHTML = e.innerHTML;\n for (var i = 0; i < view.length; i++) {\n view[i].style.display = 'none';\n }\n document.getElementById(toOpen).style.display = 'grid';\n}", "title": "" }, { "docid": "6591d79398a2bdd4f35e2aa0f1fb0520", "score": "0.59733695", "text": "clickDocsButton() {\n this.docsButton.click();\n }", "title": "" }, { "docid": "838d6eb03de9a77e2e0caa0e1a86ca23", "score": "0.59478647", "text": "function onClick(object) {\n const id = object.srcElement.id;\n gotoDetailsPage(id);\n}", "title": "" }, { "docid": "7e22b92171c357f0808126ccb5b348aa", "score": "0.59192073", "text": "function view(fixture) {\n $scope.states.detail.title = fixture.name;\n $scope.states.detail.panel = $scope.detailPanels.viewing;\n $scope.models.viewing.fixture = fixture;\n\n $scope.states.detail.visible = true;\n }", "title": "" }, { "docid": "66e9ce59322f47647f89b7c7b1bf7475", "score": "0.59108955", "text": "goTo(){\n this.home.click(); \n }", "title": "" }, { "docid": "61a3a26b4d5fa5ae105cffd3ec582ea0", "score": "0.5897596", "text": "openElement(_el) {\n this.view.openElement(_el);\n }", "title": "" }, { "docid": "20a42d5eb7df0768bffcf8cc6feab05b", "score": "0.5889344", "text": "handleOpenRecordClick() {\n const selectEvent = new CustomEvent('bearview', {\n detail: this.bear.Id\n });\n this.dispatchEvent(selectEvent);\n }", "title": "" }, { "docid": "51b8e905999c3630624d6ef33797e3ca", "score": "0.5888249", "text": "function view_page() {\n\tvar self = this;\n\tself.page(self.url);\n}", "title": "" }, { "docid": "f5bd6e6ef52c972eda5477c05a961311", "score": "0.588506", "text": "clicarVerDetalhes(){\n cy.get(homeElements.botaoVerDetalhes()).contains('Ver detalhes').click({force:true})\n }", "title": "" }, { "docid": "d52552afb9d7abc548317060733963da", "score": "0.5882424", "text": "@action\n handleClick() {\n if (this.args.click !== undefined) {\n this.args.click();\n }\n }", "title": "" }, { "docid": "5f57009d0fc6746a8bcd7a983cef460f", "score": "0.5862827", "text": "click () {\n maybeAction(this.get('clickItem'), this.get('index'))\n }", "title": "" }, { "docid": "f3016096f4900cee4a2c16012e253827", "score": "0.58558387", "text": "function handleWebviewClick() {\n document.getElementsByTagName('body')[0].click();\n }", "title": "" }, { "docid": "4a178e62f8157be9f4c4de7d0107c67c", "score": "0.5846825", "text": "function view() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"views\",\n message: \"What would you like to view?\",\n choices: [\n \"View departments\",\n \"View roles\",\n \"View all employees\",\n \"BACK\",\n ],\n },\n ])\n .then((answer) => {\n switch (answer.views) {\n case \"View departments\":\n viewDepartment();\n break;\n\n case \"View roles\":\n viewRoles();\n break;\n\n case \"View all employees\":\n viewAllEmps();\n break;\n\n default:\n start();\n break;\n }\n });\n}", "title": "" }, { "docid": "02a48b91c4cbd86015bc9fd470311db3", "score": "0.5842375", "text": "viewDetails() {\n const self = this;\n let compareProductsString = '';\n const prodArr = self.products.map(item => item.code);\n compareProductsString = self.generateProductsString(prodArr);\n this.globals.navigateToUrlWithParams(\n 'compareProducts',\n compareProductsString,\n 'productCodes',\n );\n }", "title": "" }, { "docid": "d7082869442c641550ee59bbd578ec0a", "score": "0.5842092", "text": "click(e) {\n\t\tthis._currentLevel.click(e);\n\t\tif (this._isRecording) {\n\t\t\tthis._record.click(e);\n\t\t}\n\t}", "title": "" }, { "docid": "5e116cffcd2bd011e4c29685729caafc", "score": "0.5841521", "text": "showConfirmPage() {\n // TODO (vecore): Extract share target state or pass in.\n this.getViewManager_().switchView(Page.CONFIRM);\n }", "title": "" }, { "docid": "c2b33e43b20bf7a9d39b9b3191d5b0f9", "score": "0.5818733", "text": "function moreclick(url) {\n\t\turl = \"http://\" + url ;\n\t\tif (typeof (intel.xdk.device) === 'undefined') \n\t\t\twindow.open(url,'_system');\n\t\telse\n\t\t\tintel.xdk.device.launchExternal(url);\n\t}", "title": "" }, { "docid": "7c0bed6b029e65faf1ef375132fc8904", "score": "0.5806584", "text": "open () {\n return super.open('https://www.ruimtelijkeplannen.nl/viewer/view');\n }", "title": "" }, { "docid": "6dfeb702db6c893560d00a836cec2b95", "score": "0.5803892", "text": "function viewDetails() {\n \n event.stopPropagation();\n if (!$(this).hasClass('expanded')) {\n \n $(this).parent().addClass('details');\n $(this).addClass('expanded');\n $(this).find('.label').delay(650).fadeIn();\n $(this).find('.other').delay(800).fadeIn();\n $(this).find('.ctrl.dismiss').delay(1000).fadeIn();\n }\n}", "title": "" }, { "docid": "9d8088953d65216fb93e59e2872654ce", "score": "0.5802849", "text": "clickCatalogMenu() {\n this.catalogMenu.click();\n }", "title": "" }, { "docid": "9ed6e3b388f3b5a3806d50e78a9fb6ca", "score": "0.5796018", "text": "function AboutButtonClick() {\n console.log(\"About Button Clicked!\");\n }", "title": "" }, { "docid": "9032aad051397c0d5ab52aaa9520315d", "score": "0.57948655", "text": "heroButton() {\n this.heroMsgButton.click();\n }", "title": "" }, { "docid": "dcc53026ee1954390ce23b9ef6c622a7", "score": "0.57861495", "text": "click() {\n // creatAboutWindow();\n }", "title": "" }, { "docid": "99a5e4466c40d0515d3a7da81b538bf0", "score": "0.5784703", "text": "function showView(by){\n\t\tvar view = this;\n\t\tvar $e = view.$el; \n\t\t\n\t\tview.getAllData(by).done(function(dataAll){\n\t\t\tshowChart.call(view,by,\"opens\",dataAll);\n\t\t\tshowTable.call(view,by,\"opens\",dataAll);\n\t\t\tshowChart.call(view,by,\"clicks\",dataAll);\n\t\t\tshowTable.call(view,by,\"clicks\",dataAll);\n\t\t});\n\t}", "title": "" }, { "docid": "6b77f6817f58f334c98d4b1c8fa33482", "score": "0.57838804", "text": "function openShowView(e) {\n\t\tvar movie = e.rowData.movie;\n\t\tvar movieDetailViewController = Alloy.createController('MovieDetailView', {movie:movie, theaterId:theaterId});\n\t\tcontext.openNewWindow(movieDetailViewController.getView());\n\t}", "title": "" }, { "docid": "fc4e693123267dedf745c7120f9c78b5", "score": "0.5780192", "text": "function productsButtonClicked() {\n// TODO show products\n}", "title": "" }, { "docid": "b362e89a17b5856d0c67c1f32ce2c399", "score": "0.576112", "text": "click() {\n this.element.click();\n }", "title": "" }, { "docid": "b362e89a17b5856d0c67c1f32ce2c399", "score": "0.576112", "text": "click() {\n this.element.click();\n }", "title": "" }, { "docid": "b362e89a17b5856d0c67c1f32ce2c399", "score": "0.576112", "text": "click() {\n this.element.click();\n }", "title": "" }, { "docid": "b362e89a17b5856d0c67c1f32ce2c399", "score": "0.576112", "text": "click() {\n this.element.click();\n }", "title": "" }, { "docid": "8da3d152a13bbe1eb0cfc1df692f0e84", "score": "0.5745011", "text": "function viewOption(param) {\n\n //gw_com_api.show(\"frmOption\");\n var args = { target: [{ id: \"frmOption\", focus: true }] };\n gw_com_module.objToggle(args);\n\n}", "title": "" }, { "docid": "ae46a5a53bfc89eb62abd6a498ac3525", "score": "0.57378083", "text": "click() {\n\n this.$rootScope.$broadcast('Analytics:select-channel-card');\n\n if (this.channel.isEntitled) {\n const name = this.onDemandData.formatCategoryNameForRoute(this.channel.name);\n this.$state.go(`ovp.ondemand.networks.network`, {name, index: null, page: null});\n } else {\n this.alert.open({\n message: this.errorCodesService.getMessageForCode('WEN-1000', {\n IVR_NUMBER: this.config.ivrNumber\n }),\n buttonText: 'OK'\n });\n }\n }", "title": "" }, { "docid": "5a9b6a661db28fb76a6f0d5060dd5ed0", "score": "0.5737701", "text": "function createOnClick() {\n $('#learn-more').on('click', function() {\n mixpanel.track('DEMO | Demo complete learn more Button Click');\n })\n }", "title": "" }, { "docid": "6f7d8cc0f9985988b835558fba35d6a9", "score": "0.573464", "text": "function openEditView() {\n\t\tif (!editView)\n\t\t\treturn debug.error('editView not set');\n\t\teditView.classList.toggle('overlay');\n\t\t// we will set the fragement identifier to the title tab to trigger the :target selector for foreground style assignment\n\t\tselectTab('title');\n\t}", "title": "" }, { "docid": "8e141212636f055c42d563cbc5195ef4", "score": "0.57332027", "text": "function showGenerate() {\n changeView('generate');\n}", "title": "" }, { "docid": "2265ad0f83e628da3551294dcb7f3429", "score": "0.57239884", "text": "function showView(viewName) {\n $('main > section').hide();\n $('#view' + viewName).show();\n }", "title": "" }, { "docid": "d8389eb54ed22c9107730719e676e912", "score": "0.5720222", "text": "function onViewClick() {\n\t\n\t$(\"#viewDlg\").dialog(\"open\"); // opens the view dialog for admin users\n\t\n\tvar selEvType = $(this).attr(\"etid\"); // The ID of the selected event type to be viewed\t\n\t\n\tconsole.log(\"Selected view event type: \" + selEvType);\n\t\n\t// retrieve event type details\n\t$.ajax({\n\t\tmethod : \"GET\",\n\t\turl : \"/srv/eventTypes/ajax/eventType/\" + selEvType,\n\t\tcache : false,\n\t\tdataType: \"json\"\n\t})\n\t/*\n\t * If success, then prepopulate the selected event type's fields in the view dialog\n\t */\n\t.done(function(evType) {\n\t\t\n\t\tconsole.log(evType);\n\t\t\n\t\t$(\"#viewEtName\").val(evType.name);\n\t\t$(\"#viewEtDescr\").val(evType.description);\n\t\t$(\"#viewDefHrs\").val(evType.defHours);\n\t\t$(\"#viewEtSc\").val(evType.defClient.name);\n\t\t$(\"#viewScId\").val(evType.defClient.scid);\n\t\t\n\t\t// toggles the radio button based on value of pin hours\n\t\tif (evType.pinHours) {\n\t\t\tradiobtn = document.getElementById(\"viewYesPinHrs\");\n\t\t\tradiobtn.checked = true;\n\t\t}\n\t\telse {\n\t\t\tradiobtn = document.getElementById(\"viewNoPinHrs\");\n\t\t\tradiobtn.checked = true;\n\t\t}\n\t\t\t\n\t})\n\t/*\n\t * If unsuccessful (invalid data values), display error message and reasoning.\n\t */\n\t.fail(function(jqXHR, textStatus) {\n\t\talert(\"Error\");\n\t\tupdateTips(jqXHR.responseText);\n\t});\n}", "title": "" }, { "docid": "ec7f1516906167dd62fc70be4dbaa4fe", "score": "0.5718067", "text": "show() {\n this.view.show();\n }", "title": "" }, { "docid": "ad39d3475c4817d3d5ceb040a12705e3", "score": "0.5717456", "text": "function cardView(e,vid) {\n debug(\"Event \"+e+\" target: \"+e.target.id);\n var c = cardsList[vid.slice(1)];\n c.view();\n}", "title": "" }, { "docid": "cc1575ce88302a30d9344ce301461853", "score": "0.57114685", "text": "function navigate_CREChecker() {\n\n\tcreProfileHome.click_menu_item('Admin Tools', 'Checker View');\n}", "title": "" }, { "docid": "c6ebf276289302061d483cacd8707842", "score": "0.5708488", "text": "openBoatDetailPage(event) {\n // View a custom object record.\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: event.detail.boatId,\n actionName: 'view'\n }\n });\n }", "title": "" }, { "docid": "666feec36253d7c498b1ce784bf95034", "score": "0.57010233", "text": "function btnHndlr_LearnMore() {\n $('.card-footer').on('click', '.card-button', event => {\n event.preventDefault();\n let targetID = $(event.target).parents('.card').attr('id');\n renderDetailsView(targetID);\n });\n}", "title": "" }, { "docid": "833ff6f265020a5d8aa7d8fabf2cc671", "score": "0.5696512", "text": "clickConsultationTab() {\n this.clickTab(this.tabs.consultation);\n }", "title": "" }, { "docid": "a5d0cb0fc9b1a91ad138c044735654d4", "score": "0.56947184", "text": "onPrimaryActionButtonClicked_() {\n this.authenticator.sendMessageToWebview('primaryActionHit');\n this.focusWebview_();\n }", "title": "" }, { "docid": "7ac124ec18594cddac96842bfd5582b5", "score": "0.569282", "text": "clickSaveContinueButton() {\n this.saveContinueEdit.click();\n }", "title": "" }, { "docid": "96117f67508f79ecb2f72737bc976076", "score": "0.56878877", "text": "showSequenceViewer() {\n this.props.focusBlocks([]);\n this.props.detailViewSelectExtension(sequenceViewerName);\n this.props.uiToggleDetailView(true);\n }", "title": "" }, { "docid": "3a444a65d176bfe949e19bea3fb28fd6", "score": "0.56845134", "text": "clickOnProductCatalogLink(){\n commonActions.waitForClickable(personalizedHomePage_loc.PRODUCT_CATLOGlINK,waitTime.MEDIUMWAIT,\"Product Catalog Link On Personalized Homepage\");\n commonActions.safeVisibleClick(personalizedHomePage_loc.PRODUCT_CATLOGlINK,waitTime.MEDIUMWAIT,\"Product Catalog Link On Personalized Homepage \");\n }", "title": "" }, { "docid": "d3c2e48eb8124cb90abd37cff7216b10", "score": "0.5677876", "text": "function fileView(){\n\t\t$('ul.tool-box > li').click(function(e){\n\t\t\te.preventDefault();\n\t\t\tif(this.id == 'gride-view'){\n\t\t\t\t// console.log('gride-view clicked..!');\n\t\t\t\t$('.divTableRow').addClass('grid-view-mode').removeClass('list-view-mode');\n\n\t\t\t} else if(this.id == 'list-view'){\n\t\t\t\t// console.log('list-view clicked..!');\n\t\t\t\t$('.divTableRow').addClass('list-view-mode').removeClass('grid-view-mode');\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.56683815", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.56683815", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.56683815", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.56683815", "text": "function LView() { }", "title": "" }, { "docid": "dbbc135d4d29a8de031d793dc2e06470", "score": "0.5667342", "text": "goToCheckout() {\n this.checkoutButton.click();\n }", "title": "" }, { "docid": "dbbc135d4d29a8de031d793dc2e06470", "score": "0.5667342", "text": "goToCheckout() {\n this.checkoutButton.click();\n }", "title": "" }, { "docid": "faeb85d308244d24190a29f711f112fc", "score": "0.56656665", "text": "async show ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "faeb85d308244d24190a29f711f112fc", "score": "0.56656665", "text": "async show ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "faeb85d308244d24190a29f711f112fc", "score": "0.56656665", "text": "async show ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "faeb85d308244d24190a29f711f112fc", "score": "0.56656665", "text": "async show ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "faeb85d308244d24190a29f711f112fc", "score": "0.56656665", "text": "async show ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "faeb85d308244d24190a29f711f112fc", "score": "0.56656665", "text": "async show ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "df5b8a4b9e5843919801cef09023c0d9", "score": "0.56650674", "text": "function onViewOnPacklinkClicked() {\n openNewTab(data.referenceUrl)\n }", "title": "" }, { "docid": "55da66f357d033789e011b2ac4fc435e", "score": "0.5663148", "text": "function view() {\n inquirer.prompt({\n name: 'view',\n type: 'list',\n message: 'What would you like to view?',\n choices: [\n 'Departments',\n 'Roles',\n 'Employees',\n 'All data'\n ]\n }).then((answers) => {\n switch (answers.view) {\n case 'Departments':\n viewDept();\n break;\n\n case 'Roles':\n viewRole();\n break;\n\n case 'Employees':\n viewEmployee();\n break;\n \n case 'All data':\n viewAll();\n break;\n };\n });\n}", "title": "" }, { "docid": "2639711b393f6b764ed6d7e944a1262b", "score": "0.5656161", "text": "clickContinueButton(){\n genericActions.click(purchaseDataFormPage.continueButton);\n }", "title": "" }, { "docid": "72dea8ffd19be80ddade99871bb53691", "score": "0.56561416", "text": "navigateToViewAccountPage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.recordId,\n objectApiName: 'Account',\n actionName: 'view'\n },\n });\n }", "title": "" }, { "docid": "6467b400ab9d76d3d8a5f809f737011b", "score": "0.56556433", "text": "onView() {\r\n const {onView} = this.props;\r\n onView(this.state.name, this.state.contents, this.state.id);\r\n }", "title": "" }, { "docid": "71075bd7be93a68e3fd80c9734e8ec47", "score": "0.56507134", "text": "click() {\n assert(this.isVisible());\n assert(this.isEnabled());\n this.element().click();\n }", "title": "" }, { "docid": "64fc8f8ba6e11c054002e06410f71f67", "score": "0.56445193", "text": "function btnClick(e){\n var item = e.section.items[e.itemIndex];\n var itemType = item.btn.type;\n var address = item.btn.address;\n\n Ti.API.debug(\"Button Click!\");\n Ti.API.debug(\"item.btn.address: \" + item.btn.address + \" type: \" + itemType);\n Ti.API.debug(\"item: \" + JSON.stringify(item));\n if(!address){\n return;\n }\n if(itemType == \"light\"){\n device.toggle(address)\n .then(updateStatus());\n }\n}", "title": "" }, { "docid": "cfb90301043aef0b5320960ea3929787", "score": "0.56365174", "text": "function toggleView(event) { \n switch (event.target.textContent) {\n case 'Volunteer View':\n if(volunteerVisibility){\n setVolunteerVisibility(false);\n } else {\n setShiftVisibility(false);\n setVolunteerVisibility(true);\n }\n break;\n case 'Shift View':\n if(shiftVisibility){\n setShiftVisibility(false);\n } else {\n setVolunteerVisibility(false);\n setShiftVisibility(true);\n }\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "3c9df8493fc209edb16f72f2b43c5422", "score": "0.5634485", "text": "function View() {}", "title": "" }, { "docid": "047404bca6a5e5aef1401d2fdfa38a26", "score": "0.5631986", "text": "function showView(viewsContainer, action){\n \n var viewId = action.collection;\n \n if($$(viewId)){\n viewsContainer.setValue(viewId);\n } else {\n\n var collection = action.resources + \"/\" + action.collection;\n //var detailsCollection = \"/collections/transactiondetails\";\n// var treeOptions = \"?data-format=tree&nested-format=ids\";\n// var columnsPath = \"/webix-columns?options=true\";\n// var formPath = \"/webix-form\";\n// var suggestionsPath = \"/suggestions\";\n\n var collectionUrl = serverUrl + baseUrl + collection;\n //var detailsCollectionUrl = serverUrl + baseUrl + detailsCollection;\n\n webix.ajax(collectionUrl + webix.appRoutes.columnsPath,).then(function(data){\n var columnsConfig = data.json();\n var dataUrl = collectionUrl + webix.appRoutes.treeOptions;\n\n var view = getDataView(collectionUrl, viewId, columnsConfig, action);\n\n viewsContainer.addView(view);\n viewsContainer.setValue(viewId);\n });\n \n }\n \n}", "title": "" }, { "docid": "9a5a100ab5bfc2827fdaaa48fd123224", "score": "0.56316745", "text": "tapOnFoodItem() {\n wx.navigateTo({\n url: '/pages/food_items/show/show',\n })\n }", "title": "" }, { "docid": "5b8eeea27691e5f74bd20da5a0462d57", "score": "0.562972", "text": "function loopDetailsClicked(detButton){\n\t$('#action').val(ACTION_VIEW_LOOP_RESULTS)\n\t$('#payLoad').val(detButton.value)\n\t$('#flaskForm').submit()\n}", "title": "" }, { "docid": "d835d65b32c347644a8f4d33a12ae5bc", "score": "0.56245416", "text": "function click(event) {\n if (Hrcms.debugEnabled)\n console.log(\"Not support now !\");\n }", "title": "" }, { "docid": "48b9c25f81658a626332a51054dc3297", "score": "0.5622083", "text": "viewRecord(event){\n this[NavigationMixin.GenerateUrl]({\n type: 'standard__recordPage',\n attributes: {\n recordId: event.target.dataset.id,\n actionName: 'view',\n },\n }).then(url => {\n window.open(url, '_blank');\n });\n }", "title": "" }, { "docid": "e453018832e20126e87f322e59e4af78", "score": "0.5621426", "text": "function toggleDetails() {\n\t\t\tToggleComponent('order.detailView').toggle();\n\t\t}", "title": "" }, { "docid": "3a85ce9480afed2e266bf010c40b0199", "score": "0.5619942", "text": "async show({ params, request, response, view }) {\n }", "title": "" }, { "docid": "8ba01ff34cb74f29ef9a583081e34d2e", "score": "0.56111306", "text": "buttonClicked() {\n\n\t}", "title": "" }, { "docid": "93d1380c27e0558ae8949592bbd71796", "score": "0.56076074", "text": "function showProductTour() {\n alert(\"It is Preview Mode. This link works only on Checker side!\");\n}", "title": "" }, { "docid": "e9ff94ab0172d8967567fb9c16f46e2b", "score": "0.56062603", "text": "showTeam() {\n\t\tthis.gotoPage(2);\n\t}", "title": "" }, { "docid": "4c7023b1359bbff092ded6ea21aa3081", "score": "0.5605149", "text": "function onClicked() {\r\n\ttablet.gotoWebScreen(APP_URL);\r\n}", "title": "" }, { "docid": "4c9b6073d2d19a19d2c150f1dac81457", "score": "0.5595492", "text": "function infoOpen(){\n detailView.play();\n}", "title": "" }, { "docid": "3854377a9345af1b1c278d13dc94d72e", "score": "0.5593136", "text": "clickProductsLink() {\n this.productsLink.click();\n }", "title": "" } ]
0d6bbbf0cb9a3d77012579dfe7666539
function to generate markdown for README
[ { "docid": "9eff6a137732c2ea144eed45d22ba53f", "score": "0.78181034", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n![License](${data.license.badge})\n\n## Table Of Contents\n1. [Description](#description)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [License](#license)\n5. [Contributing](#contributing)\n6. [Tests](#tests)\n7. [Questions](#questions)\n\n## Description\n${data.description} \n## Installation\n${data.installation}\n## Usage\n${data.usage}\n## License\n<b>${data.license.name}</b>\n\n${data.license.summary}\n\nRead more about the full license here: ${data.license.linkToMoreInfo}\n## Contributing\n${data.contributing}\n## Tests\n${data.tests}\n## Questions\ngithub me at ${data.githubUsername}\n\nemail me at ${data.email}\n`;\n }", "title": "" } ]
[ { "docid": "a9d853e23377b67e7044b333af895117", "score": "0.8181495", "text": "function generateMarkdown({\n name,\n description,\n installation,\n usage,\n license,\n contribution,\n tests,\n}) {\n return `\n ## ${name} ${renderLicenseBadge(license)}\n \n ## Description \n ${description}\n \n ## Installation\n ${installation}\n \n ## Usage\n ${usage}\n\n ## Contributing\n ${contribution}\n\n ## Tests\n ${tests}\n \n ## License\n ${license}\n`;\n}", "title": "" }, { "docid": "108217fc7bccdf58f8e03083e0c0eebf", "score": "0.81210214", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n ${renderLicenseLink(data.license)}\n\n ## Github\n this project was made by: ${data.github}\n ${renderLicenseSection(data.license)}\n\n ## Table of Contents:\n \n ### Languages\n This project uses the following languages: ${data.languages}\n\n ### Description\n This project is a generator that will ask the user specific questions on what they would like to be put into their README file.\n This was made for ease of use for individuals who have a hard time writing effective README files.\n\n ### Installation\n npm i inquirer\n\n This application is invoked by using the following command:\n node index.js\n`;\n}", "title": "" }, { "docid": "756f46534f84fc6cfce4242c2ba82aca", "score": "0.8088218", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n ## Table of contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [License](#licensing)\n - [Contributors](#contributors)\n - [Github Username](#github)\n - [Email Address](#email)\n - [Badges](#badges)\n - [Questions](#questions)\n\n ## Description\n\n ${data.description}\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Licensing\n\n ${data.license}\n\n ## Contributors\n\n ${data.contributors}\n\n ## Github Username\n\n ${data.username}\n\n ## Email Address\n\n ${data.email}\n\n ## Badges\n\n ${data.badges.join('\\n')}\n\n **Thank you for your interest. This document was created using the [ReadMe Generator](https://github.com/ryanbrowne360/09ReadMeGenerator.git)**\n \n\n`;\n\n\n}", "title": "" }, { "docid": "ab978259d19fb24b2069a437bab30796", "score": "0.8042155", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ![License](https://img.shields.io/badge/license-${data.license}-green.svg)\n \n ## Table of Contents\n * [Description](#description)\\n\n * [Install](#installation)\\n\n * [Usage](#usage)\\n\n * [License](#license)\\n\n * [Contributing](#contributing)\\n\n * [Tests](#tests)\\n\n * [Questions](#questions)\\n\n \n ## Description\n ${data.description} \n\n ## Installation\n ${data.install}\n\n ## Usage\n ${data.usage}\n\n ## Contributing\n ${data.contributions}\n\n ## Tests\n ${data.testing} \n\n ## Questions\n Link to my GitHub: https://github.com/${data.github}\n Email: ${data.email} \n ## License\n ${data.license}\n`;\n}", "title": "" }, { "docid": "231c494d44c2e42dace4c44daa7ffeae", "score": "0.79688495", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.licensure)}\n\n ## Table of Contents\n\n * [Description](#Description)\n\n * [Media](#Media)\n\n * [Installation](#Installation)\n\n * [Contributors](#Contributors)\n\n * [Contact](#Contact)\n\n * [Status](Status)\n\n\n ## Description\n ${data.description}\n\n ## Media\n ${data.media}\n [Click this link to watch the mock-up video.](./utils/readme-generator-vid.mov)\n \n ## Installation\n ${data.installation}\n\n ## Contributors\n This project was created by ${data.contributors}.\n\n ## Contact\n If you have any questions about this repository, contact ${data.contact} via GitHub or reach out via email:\n ${data.email}.\n\n ## Project Status\n ${data.projectStatus}\n\n`;\n}", "title": "" }, { "docid": "5262435c1ee5739c8d9c292d44e265bd", "score": "0.79613507", "text": "function generateMarkdown(data) {\n //This will write the Readme content using a template literal input data should include, Project name, description, Instructions for use, use case, license badge, contributors, tests, and contact information\n return `# ${data.project}\n\n ## Description\n\n ${data.description}\n\n ## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributors](#contributors)\n * [Questions](#questions?)\n * [Tests](#tests)\n\n ## Installation\n\n ${data.instructions}\n\n ## Usage\n\n ${data.usage}\n\n ## License\n\n ${renderLicenseSection(data.license)}\n\n ## Contributors\n\n ${data.contributors}\n\n ## Questions?\n Follow me on Github\n [${data.github}](${data.githublink}) \n or \n email me at ${data.email}\n\n ## Tests\n\n ${data.tests}\n\n`;\n}", "title": "" }, { "docid": "afa62f4a796c592756c711e373262a29", "score": "0.7954283", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## Github username ${data.username}\n\n ## Table of Contents\n [Description](#description)\n\n [Installations](#installations)\n\n [Usage](#usage)\n\n [Contributing](#contributing)\n\n [License](#license)\n\n [Questions](#questions)\n\n\n\n\n\n\n\n\n ## App Name \n ${data.aapname}\n\n ## license \n ${renderLicenseBadge(data.license)}\n\n ## Github\n ${data.username}\n ## Email :- \n ${data.email}\n\n ## Installations\n\n ${data.dependencies}\n\n ## Description\n ${data.description}\n\n ## Usage\n ${data.usage}\n\n ## Tests\n ${data.test}\n\n \n \n\n ## Contributing\n\n ${data.contribution}\n ## Questions\n \n What is your Github uername \n What is the command to run dependencies \n What is your Github uername\n What is your email address \n What is your APP name \n Please write short description of your project \n What kind of license should your project have MIIT\n What is the title of the project \n What is the command to run dependencies \n What is the command to run tests\n What does user need to know about using the repo?\n What does user need to know about contributing to the repo? \n`;\n}", "title": "" }, { "docid": "19ee7302fe3b505ad68078c3491c5b03", "score": "0.79459465", "text": "function generateMarkdown(data) {\n const licenseSection = renderLicenseSection(data.license);\n\n//This const is the readme content\n const readMePageContent = createReadme(data, licenseSection);\n\n //This shouldd write the file\n fs.writeFile('README.md', readMePageContent, (err) =>\n err ? console.log(err) : console.log('Successfully created README.md!')\n );\n \n}", "title": "" }, { "docid": "e5b2cc929d700c6dc83cb32ea359d5ec", "score": "0.7933845", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n${licenseGrab(data.licenses)}\n## Github Account\n ${'https://github.com/' + data.user}\n## Email / Contact\n ${data.contact}\n## Table of Contents \n\n 1. [Description](#Description)\n 2. [Installation](#Installation)\n 3. [Application Usage](#Usage)\n 4. [Testing Parameters](#Testing)\n 5. [Get involved / Contribute](#Contribution)\n\n\n## Description \n${data.description}\n\n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n## Testing\n${data.testing}\n\n## Contribution\n${data.contribution}\n\n`;\n}", "title": "" }, { "docid": "86715e6edf22189e23607904ffc7a0fb", "score": "0.7926765", "text": "function generateMarkdown(data) {\nreturn `\n# ${data.title}\n\n${returnLicenseBadge(data.license)}\n\n## Project Title\n\n${data.title}\n\n## Discription \n\n${data.discription}\n\n## Table of Contents\n\n* [Installation](#installation)\n* [use](#usage)\n* [license](#license)\n* [contributors](#contributors)\n* [test](#test)\n* [questions](#questions)\n* [username](#username)\n\n\n## installation\n\nplease install the following dependencies: \n\n\\`\\`\\`\n${data.installation}\n\\`\\`\\`\n\n## Usage\n\n${data.usage}\n\n## Contributors\n\n${data.contributors}\n\n## Test Instructions\n\n${data.test}\n\n## Questions\n\n${data.questions}\n\n## GitHub Username\n\n${data.username}\n\n## email\n\n${data.email}\n\n \n`;\n}", "title": "" }, { "docid": "426c161ae41ddaa82242486ab35be6db", "score": "0.7909875", "text": "function generateMarkdown(data) {\n return `\n# ${data.titleProject}\n![License](https://img.shields.io/badge/License-${data.license}-purple)\n# Description \n${data.description}\n# Table of Contents \n${data.tableOfContents}\n ## [Description](#description)\n ## [Installation](#installation)\n ## [Usage](#usage)\n ## [License](#license)\n ## [Contributing](#contributing)\n ## [Test](#tests)\n ## [Questions](#questions)\n# Installation\n${data.installation}\n# Usage \n${data.usage}\n# License\n${data.license}\n# Contributing\n${data.contributing}\n# Test\n${data.tests}\n# Questions\n${data.questions}\nIf you have any questions you can contact me at jo_anne.javillo@outlook.com or you can visit my gitHub page: (https://github.com/joannejavillo)\n`;\n}", "title": "" }, { "docid": "8c6f883251f06985ff09cddd11d0fd8b", "score": "0.7908151", "text": "function generateMarkdown(data) {\n\n return `# ${data.title} \n\n\n## Description\n${data.description}\n \n## Table of contents\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contributers](#contributers)\n- [Test](#test)\n \n \n## Installation\n${data.installation}\n \n## Usage\n${data.usage}\n \n## License\n${data.license} \n\n\n## Contributers\n${data.contributers}\n \n## Tests\n${data.testinstructions}\n \n## Questions\nIf you have an questions please contact me at ${data.githubURL} or at ${data.contact}`;\n}", "title": "" }, { "docid": "fa017309ed707017336ab3e6ceee6ae5", "score": "0.7868695", "text": "function generateMarkdown(data) {\n return `# ${data.title} \\n\n ## **Table of Contents**\n 1. [license](#license)\n 2. [Description](#description)\n 3. [Installation Instructions](#installation-instructions)\n 4. [Usage information](#usage-information)\n 5. [Contribution Guidelines](#contribution-guidelines)\n 6. [Test Instructions](#test-instructions)\n 7. [Questions?](#questions)\\n\n ## ${renderLicenseSection(data.licensetype)}\\n\n This application is covered under license type: ${data.licensetype}\\n\n ## **Description:** \\n ${data.description} \\n\n ## **Installation Instructions:**\\n ${data.instructions} \\n\n ## **Usage Information:** \\n${data.usage} \\n\n ## **Contribution Guidelines:**\\n ${data.contribute} \\n\n ## **Test Instructions:** \\n${data.tests}\\n\n ## **Questions:**\\n\n Github Profile: [${data.github}](https://github.com/${data.github}).\\n\n Contact me by email with additional questions: [${data.email}](mailto:${data.email})\\n\n`;\n}", "title": "" }, { "docid": "1b51b89efee49d5ef7772f15edfe027d", "score": "0.7850875", "text": "function generateMarkdown(data) {\n \n if (typeof data.haveGuidelines === 'undefined' || data.haveGuidelines === null)\n {\n theGuidelines = \"None\";\n }\n else\n {\n theGuidelines = data.haveGuidelines;\n }\n\n return `# ${data.name}\n\n## Table of Contents\n\n* [Description](#description)\n* [Installation](#installation)\n* [License](#license)\n* [Usage](#usage)\n* [Contributions](#contributions)\n* [Tests](#tests)\n* [Questions](#questions)\n\n\n## Description\n${data.description}\n\n## Installation\n${data.install}\n\n## License \n${renderLicenseSection(data.license)}\n\n## Usage\n${data.useage}\n\n## Contribution Guidelines\n${theGuidelines}\n\n## Tests\n${data.tests}\n\n## Questions\nPlease feel free to contact me using the following means. \nGithub Username: ${data.gitName} \nEmail: ${data.email} \n`;\n}", "title": "" }, { "docid": "fa1beb2a942d03da09d2754f42fa2d91", "score": "0.78504807", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n # Description\n ${data.description}\n\n ## Table of Contents\n\n * [Installation](#install)\n\n * [Contributers](#contributers)\n \n * [Usage](#usage)\n\n * [License](#license)\n\n * [Tests](#tests)\n\n * [Profile](#profile)\n\n * [Contact](#contact)\n\n ## Install\n\n ${data.install}\n ## Contributers\n\n ${data.contributers}\n ## Usage\n\n ${data.usage}\n ## License\n\n ${data.license}\n\n ![GitHub license](https://img.shields.io/badge/license-${data.license}-blue.svg)\n \n ## Tests\n\n ${data.tests}\n\n ## Profile\n [GitHub](https://github.com/${data.profile})\n\n ## Contact\n [Contact Us](mailto:${data.contact})\n`;\n}", "title": "" }, { "docid": "d9eda395b81578e58bf7956181d7423c", "score": "0.78372186", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## Description\n ${data.description}\n\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Collaboration](#Collaboration)\n * [Test](#test)\n * [Contact](#contact)\n\n ## Installation\n The following command is used to install the necessary dependencies:\n\n \\`\\`\\`\n ${data.installation}\n \\`\\`\\`\n\n ## License\n ${renderLicenseBadge(data.license)}\n \n ## Usage\n ${data.usage}\n\n ## Collaboration\n ${generateCollaborators(data.collaboratorInfo)}\n\n ## Test\n The following command is used to test this project:\n\n \\`\\`\\`\n ${data.test}\n \\`\\`\\`\n\n ## Contact\n To see more of my projects view my github at [${data.githubUsername}](https://github.com/${data.githubUsername})\n If you have any questions you can contact me at ${data.email}\n`\n}", "title": "" }, { "docid": "8f5ed1821065abd954ca12621350ecf6", "score": "0.783649", "text": "function generateMarkdown(data) {\n return `\n\n# ${data.title}\n\\n\n${renderLicenseBadge(data.license)} [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)\n\\n\n\n## Description\n${data.description}\\n\n -${data.whybuild}\\n\n -${data.problem}<\\n\n -${data.learn}\\n\n\\n\n## Table of Contents\n\n[Installation](#installation)\\n\n[Usage](#usage)\\n\n[License](#license)\\n\n[Credits](#credits)\\n\n[Contribute](#contribute)\\n\n[Testing](#testing)\\n\n[Questions](#questions)\\n\n\\n\n## Installation\n${data.installation}\\n\n\\n\n## Usage\n${data.usage}\\n\n\\n\n## License\nThis application is utilizing the ${renderLicenseSection(data.license)} license.\\n\nFor more information on the ${renderLicenseSection(data.license)} license, click on this link: ${renderLicenseLink(data.license)}.\\n\n\\n\n## Credits\nBig thank you to ${data.creditNames} for helping with the project!\\n\nA few tools used on this project were: ${data.creditTools}\\n\n\\n\n## Contribute\n${data.contribute}\\n\n\\n\n## Testing\n${data.testing}\\n\n\\n\n## Questions\nFor any questions or suggestions please contact me through the following:\\n\nEmail: ${data.email}\\n\nGitHub profile: https://github.com/${data.github}\\n\n`;\n}", "title": "" }, { "docid": "bffee615a9115a47fcc70c2a4564c5b9", "score": "0.78298575", "text": "function generateMarkdown(data) {\n const badge = renderLicenseBadge(data.license);\n const link = renderLicenseLink(data.license);\n const section = renderLicenseSection(data.license);\n\n return `# ${data.title} <a href=${link}>![ScreenShot](${badge})</a>\n\n # Table of Contents\n 1. [Description](#Description)\n 2. [Installation](#Installation)\n 3. [Usage](#Usage)\n 4. [License](#License)\n 5. [Contributing](#Contributing)\n 6. [Tests](#Tests)\n 7. [Questions](#Questions)\n \\n\n ## <a id='Description'></a>Description\n ${data.description}\n \\n\n ## <a id='Installation'></a>Installation\n ${data.installation}\n \\n\n ## <a id='Usage'></a>Usage\n ${data.usage}\n \\n\n ${section}\n \\n\n ## <a id='Contributing'></a>Contributing\n ${data.contributing}\n \\n\n ## <a id='Tests'></a>Tests\n ${data.tests}\n \\n\n ## <a id='Questions'></a>Questions\n If you have any questions please check out my GitHub page: [www.github.com/${data.username}](https://www.github.com/${data.username})\n \\n\\nIf you have any other questions please reach out to me at: [${data.email}](mailto:${data.email})\n \n \\n\\n\n <a href=\"https://drive.google.com/file/d/1-4PNnst9RS5meEwkvbtke4JrOciADOoU/view\">README.md demonstration</a>`;\n}", "title": "" }, { "docid": "e037333830f72a53b70770e97deb7544", "score": "0.7818965", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${data.description}\n ----------------------------------------\n ${data.tableOfContents}\n ##### Table of Contents \n [Installation](#installation) \n [Usage](#usage)\n [License] (#license)\n [Contributing] (#contributing)\n [Tests] (#tests)\n [Questions] (#questions)\n \n \n\n ## Installation \n \n These are the steps for installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Contributing\n\n ${data.contributors}\n\n ## Tests\n\n To run tests, run this command:\n\n \\`\\`\\`\n ${data.test}\n \\`\\`\\`\n\n ## Questions\n\n If you have questions about the repo, you can contact me at ${data.email}. \n My work is listed at [${data.github}](https://github.com/${data.github}/).\n\n `;\n }", "title": "" }, { "docid": "d0ae1aad9c879d5584f8ff33af534244", "score": "0.78096837", "text": "function generateMarkdown(data) {\n return ` \n# ${data.title}\n\n### Project Created By: ${data.name}\n## **Description**\n${data.description} \n \n***\n## **Table of Contents**\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license) \n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n***\n \n## Installation \n${data.install}\n \n## Usage\n${data.usage}\n \n## Configuring\n${data.config}\n\n## Technologies Used\n${data.tech}\n \n## Contributing\n${data.contrib}\nIf you would like to add to this project, you can [follow me on GitHub](https://github.com/${data.username}). \n \n## Tests\n${data.testing}\n \n## Questions:\nIf you have any questions about this project, you can reach me [on GitHub](https://github.com/${data.username})\nor via email at ${data.email}.\n \n## License\n${data.license}\n${renderLicenseBadge(data.license)}\n \n**${data.title} created ${data.date}, by ${data.name}.** \n `;\n}", "title": "" }, { "docid": "1fa01c30fdf35b40448529dc3d04836b", "score": "0.7801078", "text": "function generateMarkdown(data) {\nvar licenseBadge = generateLicenseBadge(data.license);\nvar licenseNotice = generateLicenseNotice(data.license);\n\n return `\n# ${data.title}\n# ${licenseBadge}\n\n\n## Description\n${data.description}\n\n## Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n \n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n## License\n${data.license}\n${licenseNotice}\n\n## Contributing\n${data.contribution}\n\n## Tests\n${data.tests}\n\n## Questions\nFor questions, you can reach me on GitHub at http://github.com/${data.username}/ or via email at ${data.email}.\n`;\n}", "title": "" }, { "docid": "0b9eeba5e99ceff73490899674498504", "score": "0.7795167", "text": "function generateMarkdown(data) { \n return `# ${data.title}\n Direct Link: https://github.com/${data.userName}/${data.title}\n <br/>\n Repo Link: https://github.com/${data.userName}\n <br/>\n ${renderLicenseBadge(data)}\n\n # Description\n ${data.description}\n \n # Table of Contents \n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Steps](#steps)\n * [Contact](#contact)\n \n # Installation\n The following must be installed or linked in order to run the application properly: ${data.install}\n \n # Usage\n ​${data.usage}\n \n # License\n This project is licensed under the ${data.license} license.\n \n # Contributing\n ​Contributors: ${data.contributors}\n \n # Steps\n ${data.steps}\n \n # Contact\n If you have any questions about the repo, open an issue or contact me directly at ${data.email}.\n`;\n}", "title": "" }, { "docid": "1fcaaae150312cb5e07103e8836c0827", "score": "0.77948326", "text": "function generateMarkdown(data) {\n const badge = licence(data.license)\n\n\n return `${badge}\n # ${data.title}\n ${data.describe}\n ## Table of Contents \n * [License](#license)\n \n * [Installation](#installation)\n \n * [Usage](#usage)\n \n * [Tests](#tests)\n \n * [Contributing](#contribute)\n \n * [Questions](#questions)\n## Installation\n${data.install}\n## Usage\n${data.usage}\n## Tests\n${data.test}\n## Credits\n${data.contribute}\n## Questions\n<https://github.com/${data.github}></br>\n${data.email}\n`;\n}", "title": "" }, { "docid": "d5384a1ea3d0e725cc74741c6efad3cb", "score": "0.7792874", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n https://github.com/${data.git}/${data.title}\n ## Table of Contents:\n - [Title](#Title)\n - [Summary](#Summary)\n - [Installation](#Installation)\n - [Usage](#Usage)\n - [Contribute](#Contribute)\n - [Contributors](#Contributors)\n - [Licence](#Licence)\n - [Contact](#Contact)\n # Title\n # ${data.title}\n ### Licence \n ${badge(data.license)} ${licenselink(data.license)}\n ### Summary\n ${data.summary}\n ### Installation \n ${data.installation}\n ### How to use your application \n ${data.usage}\n ### How to contribute to this project?\n ${data.contribute}\n ### Contributors \n ${contributorLink(data.username)}\n ### Acknowledge \n ${data.acknowledge}\n ## Test\n ${data.test}\n # Contact\n ### Questions \n If you have any questions reachout on \\n https://github.com/${data.git}\\n\n ### E-mail\n For more information bout this project e-main me on: \\n${data.email}\\n\n`;\n}", "title": "" }, { "docid": "7718e5d46e97def3819e8c8d386a3895", "score": "0.7786713", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n## Description\n\n${data.description}\n\n##Table of Contents (Optional)\n\n\n## Installation\n${data.installation}\n\n## Usage \n${data.usage}\n\n## Credits\n${data.credits}\n##License\n${renderLicenseLink(data.license)}\n\n## Tests\n${data.tests}\n\n\n##Questions\nPlease contact me at ${data.questions} if you have any questions about my project.\nAlso please visit my GitHub to see more projects i have worked on at ${data.github}.\n\nOptional\n## Badges\n\n## Features\n\n## How to Contribute\n\n\n`;\n}", "title": "" }, { "docid": "dd4dcd10ba90566513a6cee53a2e56c2", "score": "0.77736187", "text": "function generateMarkdown(readMeContent) {\n return `# ${readMeContent.projectTitle} ${renderLicenseBadge(readMeContent)}\n\n ## Description \n ${readMeContent.description}\n\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * \n ## Installation\n ${readMeContent.installation}\n\n ## Usage \n ${readMeContent.usage}\n\n ## License\n ${renderLicenseSection(readMeContent)}\n\n ## Demo\n <img src=\"assets/${readMeContent.demo}\">\n\n ## Questions\n For additional questions feel free to contact: ${readMeContent.emailAddress}\n GitHub: https://github.com/${readMeContent.username}\n `;\n }", "title": "" }, { "docid": "99ae1fb3067343a99f3cbc27974c8868", "score": "0.77654797", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## Table of Contents:\n 1. [Description](#description)\n 2. [Questions](#questions)\n 3. [Installation](#installation)\n 4. [Usage](#usage)\n 5. [License](#license)\n 6. [Contributing](#contributing)\n 7. [Tests](#tests)\n\n\n ## Description\n ${data.description}\n\n ## Questions\n If you need to reach me with additional questions, contact me via: \n * Email: ${data.email}\n * Github Username: ${data.github}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## License\n ${renderLicenseBadge(data.license)}\n ${renderLicenseLink(data.license)}\n\n ## Contributing \n ${data.contribution}\n\n ## Tests\n ${data.tests}\n\n \n`;\n}", "title": "" }, { "docid": "7cb72ae6ebcae9f3a2fc1329f0e961f3", "score": "0.7754687", "text": "function generateMarkdown(answers) {\n return `\n # ${answers.title}\\n\n\n # Description ${answers.description}\\n\n\n # Table Of Contents \n * [Installation](#Installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributors](#contributors)\n * [Tests](#tests)\n * [Questions](#questions)\n \n # Installation\\n\n $(answers.installation)\\n\n\n # Usage \\n\n $(answers.usage)\\n\n\n # License \\n\n $(answers.license)\\n\n\n # Contributors \\n\n $(answers.contributors) \\n\n\n # Tests \\n\n $(answers.tests) \\n\n\n # Questions \\n\n $(answers.questions) \\n\n\n `;\n}", "title": "" }, { "docid": "7247af2efc5da48ceaafd711b26c7b7d", "score": "0.77539235", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} \n ${renderLicenseBadge(data.license)} \n \n ## Table of Contents\n * [Title](#title)\n * [License](#license)\n * [Description](#description)\n * [Installing the program](#installation)\n * [Using the program](#usage)\n * [contribute](#contributing)\n * [contact](#contact)\n \n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n \n ## Usage\n ${data.usage}\n \n ## Contributing\n ${data.contribute}\n \n ## Contact\n Reach out to me via email at ${data.email} or through [github](https://github.com/${data.github}) if you have any questions\n`;\n}", "title": "" }, { "docid": "fce896929053d59359a1694780be40ef", "score": "0.7742781", "text": "function generateMarkdown(data) {\n const {license, description, username, projectTitle:title, email, installation, usage, contributions, test} = data;\n return `# **${title}**\n ${renderLicenseBadge(data.license)} \n ## Description\n ${description}\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n ${renderLicenseLink(license)}\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n ## Installation\n Run this command to install the necessary dependencies:\n ~~~\n ${installation}\n ~~~\n ## Usage\n ~~~\n ${usage}\n ~~~\n ## Contributing\n ${contributions}\n ${renderLicenseSection(license)}\n ## Tests\n This is the command to run for testing: \n ~~~\n ${test}\n ~~~\n ## Questions\n For questions or comments about the project, feel free to open an issue in the repository or contact me directly at ${email}. To see my other projects, check out my GitHub: [${username}](https://github.com/${username}).\n `;\n }", "title": "" }, { "docid": "7517866ddd59c6053efa17d50c606e76", "score": "0.77410126", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\n${renderLicenseBadge(data.license)}\n## Table of Contents\nI. [Description](#description) \nII. [Install Instructions](#install-instructions) \nIII. [Usage Information](#usage-information) \nIV. [Contribution Guidelines](#contribution-guidelines) \nV. [Testing Instructions](#testing-instructions) \nVI. [Questions / Contact](#contact) \nVII. [License](#license) \n\n## <a id=\"description\">I. Description</a>\n${data.description}\n\n## <a id=\"install-instructions\">II. Install Instructions</a>\n${data.install}\n## <a id=\"usage-information\">III. Usage Information</a>\n${data.usage}\n### Project Screenshot\n![alt text](../images/screenshot.png)\n### Credits\n(Collaborators, packages used <a href=\"URL\" target=\"_blank\">package</a>, shout-outs)\n## <a id=\"contribution-guidelines\">IV. Contribution Guidelines</a>\n${data.contribute}\n## <a id=\"testing-instructions\">V. Testing Instructions</a>\n${data.testing}\n## <a id=\"contact\">VI. Questions / Contact</a>\nIf you have any questions, or want to contribute to this or any other project feel free to contact me.\n### email\n${data.email}\n### GitHub\n<a href=\"https://github.com/${data.github}\" target=\"_blank\">${\n data.github\n } @ Github</a>\n${renderLicenseSection(data.license)}\n`;\n}", "title": "" }, { "docid": "d516d6acfd0fdd4502d3e3973e970a1c", "score": "0.77410066", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n[![GitHub license](https://img.shields.io/badge/license-${data.license.split(' ').join(\"\")}-blue.svg)](https://github.com/${data.github}/${data.title.toLowerCase().split(' ').join(\"-\")})\n\n## Description\n\n${data.description}\n\n## Table of Contents\n\n* [Installation](#install)\n\n* [Usage](#usage)\n\n* [License](#license)\n\n* [Contributing](#contributing)\n\n* [Tests](#tests)\n\n* [Questions](#questions)\n\n## Installation\n\nTo install dependencies, please run the following command:\n\n\\`\\`\\`\n${data.install}\n\\`\\`\\`\n\n## Usage\n\n${data.usage}\n\n## Contributing\n\n${data.contributing}\n\n## Tests\n\nTo run tests, please run the following commands:\n\n\\`\\`\\`\n${data.test}\n\\`\\`\\`\n\n## Questions\n\nIf you have any questions about this repo, please contact \n[${data.github}](${data.url}) \nEmail me at: ${data.email}.\n`;\n}", "title": "" }, { "docid": "9524c4576f6c2795dce45365c72d130e", "score": "0.77338505", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ## Description\n ${data.description}<br>\n ${data.link}\n\n ${generateBadge(data.license)}\n\n ## Table of Contents\n - [Installation](#installation)\n - [Usage](#usage)\n ${contToc(data.credits)}\n - [License](#license)\n - [Tests](#tests)\n - [Questions](#questions)\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n ${generateCont(data.credits)}\n\n ## License\n ${data.license}\n\n ## Tests\n ${data.tests}\n\n ## Questions\n Check out my github profile at [Github](http://github.com/${data.github})\n\n Contact me at <${data.email}>\n`;\n}", "title": "" }, { "docid": "aa4c6fab4517052d470b059a29aba559", "score": "0.77121776", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\n\n${renderLicenseBadge(data.license)}${renderLicenseLink(data.license)}\n\n## Description\n\n ${data.description}\n\n## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Links](#links)\n * [License](#license)\n * [Contributions](#contributions)\n * [Tests](#tests)\n * [Questions](#questions)\n \n \n## Installation\n\n ${data.installation}\n\n## Usage\n\n ${data.usage}\n\n ## Links\n \n * Application URL: (https://${data.username}.github.io/${data.repository}/)\n * Github Repository URL: (https://github.com/${data.username}/${data.repository})\n\n${renderLicenseSection(data.license)}\n\n ${renderLicenseBadge(data.license)}${renderLicenseLink(data.license)}\n\n## Contributions\n\n ${data.contributing}\n\n## Tests\n\n ${data.tests}\n\n## Questions\n\n [![GitHub](https://img.shields.io/badge/My%20GitHub-Click%20Me!-blueviolet?style=plastic&logo=GitHub)](https://github.com/${data.username}) \n [![LinkedIn](https://img.shields.io/badge/My%20LinkedIn-Click%20Me!-grey?style=plastic&logo=LinkedIn&labelColor=blue)](https://www.linkedin.com/in/morin-clifford-129888a9/)\n\n Feel free to reach me at ${data.email} with any question regarding this project!\n `;\n}", "title": "" }, { "docid": "3ae3a5af876a02eec62a269bdb673654", "score": "0.77011234", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n ## Table of Contents \n \n - [Installation](#installation)\n - [Usage](#usage)\n - [Credits](#credits)\n - [License](#license)\n \n \n ## Installation\n ${data.installation}\n \n ## Usage\n ${data.usage}\n \n ## Credits\n ${data.credits}\n \n ## License\n ${renderLicenseSection(data.license)}\n \n \n ## How to Contribute\n ${data.contributions}\n \n ## Tests\n ${data.tests}\n \n \n `;\n}", "title": "" }, { "docid": "f079a829e16d0f2b964c613f8c1465ba", "score": "0.76990867", "text": "function generateMarkdown(data) {\n return [data.title,\n `\n # ${data.title}\n\n ${renderLicenseBadge(data.license)}\n\n ## Description \n ${data.description}\n \n \n \n ## Table of Contents \n \n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Questions?](#Questions?)\n \n \n ## Installation\n ${data.install}\n \n \n \n ## Usage \n ${data.usage}\n \n \n ## Contributing\n ${data.contribute}\n \n ## Tests\n ${data.test}\n \n ## License\n ${renderLicenseSection(data.license)} \n ${renderLicenseLink(data.license)}\n \n ## Questions?\n ${data.contact} \n [GitHub](https://github.com/${data.gitHub}) \n ${data.email} \n \n`];\n}", "title": "" }, { "docid": "4a34e9cc2165225a885f9f38ef40c581", "score": "0.76968133", "text": "function generateMarkdown(data) {\n return `# ${data.Title} ${renderLicenseBadge(data)}\n \n # Description\n ${data.Description}\n\n # Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#License)\n * [Contributors](#contributors)\n * [Tests](#tests)\n * [Questions](#questions)\n \n # Installation\n The following dependencies are needed to be installed to run the application: \n ${data.Installation}\n # Usage\n ${data.Usage}\n # License\n This application runs under the ${data.License} license.\n ${renderLicenseLink(data)}\n # Contributors:\n ${data.Contributors}\n # Tests\n How to run tests: ${data.Tests}\n # Questions\n If there are any questions, issues contact ${data.Username} or email at ${data.Email}\n`;\n}", "title": "" }, { "docid": "032a68f0210a4c63e206de2a9e3475e1", "score": "0.76963603", "text": "function generateMarkdown(data) {\n\n if(data.description !== '') {\n\n var desc = `\n ## Description\n ${data.description}`\n\n } else {\n desc = ``\n }\n\n if (data.installation !== '') {\n var intallTOC = ` - [Installation](#Installation)<br>`\n var intallation = `\n ## Installation\n ${data.installation}`\n\n } else {\n installation = ``\n installTOC = ``\n }\n\n if (data.usage !== '') {\n var usageTOC = ` - [Usage](#Usage)<br>`\n var usage = `\n ## Usage\n ${data.usage}`\n\n } else {\n usage = ``\n usageTOC = ``\n }\n\n if(data.contribution !== '') {\n var contributionTOC = ` - [Contributing](#Contributing)<br>`\n var contribution = `\n ${data.contribution}`\n\n } else {\n contribution = ``\n contributionTOC = ``\n }\n\n\n if (data.test !== '') {\n var testTOC = ` - [Tests](#Tests)<br>`\n var test = `\n ## Tests\n ${data.test}`\n\n } else {\n test = ``\n testTOC = ``\n }\n\n if (data.license !== '') {\n var licenseTOC = ` - [License](#License)<br>`\n var section2 = `\n ## License\n ${section}`\n \n } else {\n section = ``\n licenseTOC = ``\n }\n\n if (data.username !== '' || data.email !== '') {\n var questionTOC = ` - [Question](#Questions)`\n var question = `\n ## Questions\n Github: [@${data.username}](www.github.com/${data.username}) <br>\n Email: ${data.email}`\n \n } else {\n question = ``\n questionTOC =``\n }\n\n return `\n # ${data.title}\n\n ${renderLicenseBadge(data.license)}\n ${renderLicenseSection(data.license)}\n\n\n ${newBadge}\n\n ${desc}\n\n ## Table of Contents\n\n ${intallTOC}\n ${usageTOC}\n ${contributionTOC}\n ${testTOC}\n ${licenseTOC}\n ${questionTOC}\n\n ${installation}\n\n\n\n ${usage}\n\n\n\n ${contribution}\n\n\n\n ${test}\n\n\n\n ${section2}\n\n\n\n ${question}\n`;\n}", "title": "" }, { "docid": "69a756a17c2ff84dbb5a911a44c0addb", "score": "0.7681239", "text": "function generateMarkdown(data) {\r\n return `\r\n # Project Title : ${data.title}\r\n ## Project Description: ${data.desc}\r\n ## Table of Contents\r\n * [Installation](#installation)\r\n * [Usage](#usage)\r\n * [Contributing](#contributing)\r\n * [Test](#test)\r\n * [Questions](#questions)\r\n * [License](#license)\r\n * [Author] (#Author)\r\n * [Badges](#badges)\r\n ## Installation\r\n ${data.install}\r\n ## Usage\r\n ${data.usage}\r\n ## Contributors\r\n ${data.contributors}\r\n ## Test\r\n ${data.test}\r\n ## Questions\r\n If you have any questions, contact ${data.username} on GitHub.\r\n\r\n ## Author \r\n ![GitHub profile pic](${data.image})\r\n ## Badges\r\n ![badmath](https://img.shields.io/github/repo-size/${data.username}/${data.repo})\r\n `;\r\n }", "title": "" }, { "docid": "93a095c019122db57ece41dcbfa07ed1", "score": "0.76808965", "text": "function generateMarkdown(data) {\n return `# ${data.title} ${renderLicenseLink(data.license)}\n\n # Table of Contents\n * [Project Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributions](#contributions)\n * [Tests](#tests)\n * [License](#license)\n * [Questions](#questions)\n \n # Description\n ${data.description}\n\n # Installation\n ${data.instructions}\n\n # Usage\n ${data.usage}\n\n # Contributions\n ${data.contribution}\n\n # Tests\n ${data.test}\n\n # License\n ${renderLicenseSection(data.license)}\n\n # Questions\n If you have any questions, you can reach me at [${data.email}](${data.email})\n or you can reach me at at my [github repo](https://github.com/${data.username})\n\n\n\n\n`;\n}", "title": "" }, { "docid": "acad12d8d03d4ef6594ee1b842d9e990", "score": "0.7680384", "text": "function generateMarkdown(data) {\n return `# ${data.Title}\n\n## Table of Content\n1. [Description](#description)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [License](#license)\n5. [Contributing](#contributing)\n6. [Tests](#test)\n7. [Questions](#qontact)\n\n## Description \n${data.Description}\n\n## Installation \n${data.Installation}\n\n## Usage\n${data.Usage}\n\n## License\n${renderLicenseBadge(data)}\n\n## Contributing \n${data.Contributing}\n\n## Tests\n${data.Tests}\n\n## Questions \n\n-Github: [GitHub](http://www.github.com/${data.Github}) \n-Email: ${data.Email}\n`\n}", "title": "" }, { "docid": "27463e8dea31af91453e05db64aad155", "score": "0.7675917", "text": "function generateMarkdown(data) {//returns a md with temp lits and format\n // const objData= JSON.parse(data)\n return `# ${data.Title}\n ${renderLicenseBadge(data.Licenses)} \n\n\n## Description \n${data.Description}\n\n## Table of Contents\n* [Installation](#Installation)\n* [Tests](#Tests)\n* [Contributing](#Contributing)\n* [Usage](#Usage)\n${renderLicenseLink(data.Licenses)}\n* [Get in Touch](#Get-in-Touch)\n\n\n## Installation\n${data.Installation}\n\n## Tests\n${data.Tests}\n\n## Contributing\n${data.Contributing}\n\n## Usage\n${data.Usage}\n \n${renderLicenseSection(data.Licenses)}\n\n\n## Get In Touch\nEmail me at: ${data.Email}\nCheck out my Github: https://github.com/${data.Github}\n\n`;\n}", "title": "" }, { "docid": "e63f3beb64388eb751a9d375ffde2424", "score": "0.7672729", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n # Table of Contents\n * [Description](#description)\n * [Installation Instructions](#Installation-Instructions)\n * [Usage](#usage)\n ${renderLicenseLink(data.license)}\n * [Contributors](#contributors)\n * [Tests](#tests)\n * [Questions](#questions)\n\n # Description\n ${data.description}\n # Installation Instructions\n ${data.installation}\n # Usage\n ${data.usage}\n ${renderLicenseSection(data.license)}\n ${renderLicenseBadge(data.license)}\n # Contributors\n ${data.contributing}\n # Tests\n ${data.tests}\n # Questions\n If you have any questions, please contact me.\n Github: [${data.username}](http://github.com/${data.username})\n Email: [${data.email}](mailto:${data.email})\n \n`;\n}", "title": "" }, { "docid": "f80e2ffe28510465866968c78355b981", "score": "0.7666402", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n ${renderLicenseBadge(data)}\n\n ## Table of Contents\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## License\n ${renderLicenseLink(data)}\n\n ## Contributing\n ${data.contributing}\n\n ## Tests\n ${data.tests}\n\n ## Questions\n Want to see more of my work? Check out my GitHub page:\n [${data.username}](https://github.com/${data.username}) \n\n If you have any questions, feel free to contact me via email:\n ${data.email}\n\n`;\n}", "title": "" }, { "docid": "fd61651a60c912052f5b606ce36a3b3f", "score": "0.7664143", "text": "function generateMarkdown(data) {\n return `# ${data.projectTitle}\n\n${renderLicenseBadge(data)}\n\n## Description\n🔍 ${data.description}\n\n## Table of Contents:\n1. [Description](#description)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [License](#license)\n5. [Contributing](#contributing)\n6. [Tests](#tests)\n7. [Questions](#questions)\n\n## Installation\n💾 ${data.installation}\n\n## Usage\n💻 ${data.usage}\n\n## License\n📜 This Application is licensed under ${data.license}<br>\nLearn more about ${data.license} here: ${renderLicenseLink(data)}\n\n## Contributing\n👪 ${data.contributors}\n\n## Tests\n🧪 ${data.tests}\n\n## Questions\n😺 Find me on GitHub: https://github.com/${data.username}<br>\n📧 Or send me an email at ${data.email}\n`;\n}", "title": "" }, { "docid": "59dd51afd1a78e5b051958029f0f87d1", "score": "0.766209", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## ${data.description}\n\n\n ## Installation ${data.installation}\n\n ## Usage ${data.usage}\n\n ## Contributions ${data.contributions}\n\n ## Tests ${data.tests}\n\n ## Questions \n You can contact me here: ${data.email} ${data.github} for questions about this project.\n\n ## License ${data.license}\n`;\n}", "title": "" }, { "docid": "e42b10d4e2b21d81fd12942b94fe4b5f", "score": "0.7658634", "text": "function generateMarkdown(data) {\n return `\n# ${data.title} \n\n ${license[data.license]}\n ${data.description}\n \n## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contribute](#contribute)\n * [Tests](#test)\n * [Questions](#questions)\n\n## Installation \n ${data.installation}\n\n## Usage\n ${data.usage}\n\n## License\n ${license[data.license]} \n Click badge for license information.\n\n## Contribute\n ${data.contribute}\n\n## Tests\n ${data.test}\n\n## Questions\n [${data.questionsGitHub}](http://github.com/${data.questionsGitHub})\n [${data.questionsEmail}](mailto:${data.questionsEmail})\n\n`;\n}", "title": "" }, { "docid": "f8742ca4495d9a10a3b6505c0956ace0", "score": "0.76547366", "text": "function generateMarkdown(data) {\r\n return `\r\n # ${data.title}\r\n ${renderLicenseBadge(data.license)}\r\n ## Description\r\n ${data.description}\r\n\r\n ## Table of Contents\r\n *[Installation](#installation)\r\n *[Usage](#usage)\r\n ${renderLicenseLink(data.license)}\r\n *[Contributiong](#contributing)\r\n *[Tests](#tests)\r\n *[Questions](#questions)\r\n\r\n ## Installation\r\n To install dependencies run these commands:\r\n \r\n ${data.installation}\r\n \r\n\r\n ## Usage\r\n ${data.usage}\r\n \r\n ## Contributing\r\n ${data.contributing}\r\n\r\n ## Tests\r\n Run the following commands to run tests:\r\n ${data.test}\r\n\r\n ## Questions\r\n For questions contact me at [email: ${data.email}](mailto:${data.email})\r\n Find me at [${data.github}](https://github.com/${\r\n data.github\r\n }/).\r\n\r\n\r\n\r\n`;\r\n}", "title": "" }, { "docid": "c6c0963fe2dd457e01b5c718ac85cdbd", "score": "0.7653311", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n${renderLicenseBadge(data.license)}\n\n## Description\n${data.description}\n\n## Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [Credits](#credits)\n* [Tests](#tests)\n* [License](#license)\n* [Questions](#questions)\n \n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n## Credits\n${data.credits}\n\n## Tests\n${data.tests}\n\n## License\n${data.license} \n\n${renderLicenseSection(data.license)}\n\n## Questions\nGithub: https://github.com/${data.username} \n\nEmail: ${data.email}\n\n`;\n}", "title": "" }, { "docid": "9adfddb2c0b7ce30bed836e326b5bcf0", "score": "0.7651168", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n ## **Description**\n ${data.description}\n\n ## **Images**\n ![${data.altText}](assets/images/${data.images})\n \n ## **Table of Contents**\n \n * [Installation](#dependencies)\n * [Usage](#usage)\n * [Credits](#credits)\n * [License](#license)\n * [Features](#features)\n * [Languages](#languages)\n * [Technology](#technology)\n * [Tests](#tests)\n * [Contribute](#contribute)\n \n ## **Installation**\n ${data.dependencies}\n\n ## **Usage**\n ${data.usage}\n\n ## **Credits**\n ${data.credits}\n\n ## **License**\n ${renderLicenseBadge(data.license)}\n <br>\n ${renderLicenseLink(data.license)}\n <br>\n\n ## **Features**\n ${data.features}\n\n ## **Languages**\n ${data.languages}\n\n ## **Technology**\n ${data.technology}\n\n ## **Tests**\n ${data.tests}\n\n ## **Contribute**\n Find me on [GitHub](https://www.github.com/${data.github})\n <br>\n Send me an [Email](mailto:${data.email})\n <br>\n ${data.contribute}\n`;\n}", "title": "" }, { "docid": "8d33511cebc4f3d4aff3da9fb0cf0711", "score": "0.7643133", "text": "function generateMarkdown(answers) {\n return `\n# ${answers.title}\n\n## Description\n\n${answers.description}\n\n## Table of Contents\n* [Installation](##installation)\n* [Usage](##usage)\n* [License](##license)\n* [Contributers](##contributers)\n* [Tests](##tests)\n\n## Installation\n\n${answers.install}\n\n## Usage\n\n${answers.usage}\n\n## License\n\n${answers.license}\n\n## Contributors\n\n${answers.contributors}\n\n## Tests\n \n${answers.tests}\n\n## Questions\n\nShould you have any questions, please refer to: ${answers.questions}\n`;\n\n}", "title": "" }, { "docid": "24dc76b5b19921df8cd218c4bdc70fd0", "score": "0.76413476", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\n\n## License section\n${renderLicenseBadge(data.license)} \n${renderLicenseLink(data.license)}\n\n## Walk-through Video \n[Screencastify](https://drive.google.com/file/d/1HDfRueEOTdsaocSlia7IzKquC_BmP2jG/view)\n\n ## Table of contents \n * [ Installation ](#Installation)\n * [ Usage ](#Usage)\n * [ Decsritpion ](#description)\n * [ Contributions ](#Contributions)\n * [ Tests ](#Testing)\n * [ Questions ](#Questions)\n\n## Installation \n${data.installation}\n\n## Usage \n${data.usage}\n\n## Description \n${data.description}\n\n## Contributions\n${data.contributing}\n\n## Testing \n${data.testing}\n\n## Questions \n* ${data.github}\n* ${data.email}\n\n`;\n}", "title": "" }, { "docid": "e2e266648a46905565ddad98b50dc21c", "score": "0.7640662", "text": "function generateMarkdown(value) {\n return `# ${value.title}\n\n## Table of Contents:\n1. [Description](#description)\n2. [Installation](#install)\n3. [Usage](#use)\n4. [Contribution](#contribute)\n5. [Tests](#test)\n6. [License](#license)\n\n7. [Questions](#questions)\n\n## Description\n${value.description}\n\n## Installation\n${value.install}\n\n## Usage\n${value.use}\n\n## Contributing\n${value.contribute}\n\n## Tests\n${value.test}\n\n## License\n${licenseBadge(value)}\n\n## Questions\nIf you have any questions or need further assistance with this project do not hesitate to reach me at this github profile and email.\n* Profile: ${value.githubuser}\n* Email: ${value.email}`\n}", "title": "" }, { "docid": "9d173cf20d2081f8569fc52ab048356c", "score": "0.7639441", "text": "function generateMarkdown(data) {\n return `# ${data.titleName}\n\n # Table of Contents\n - [Installation](#installation)\n - [License](#license)\n ${data.projectName}\n # License\n ${renderLicenseLink(data.chooseLicenseBox)}\n # Badge\n${renderLicenseBadge(data.chooseLicenseBox)}\n\n`;\n}", "title": "" }, { "docid": "5a0624bcbfc447cf634c9a35f1bf4ca6", "score": "0.76305854", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n >## Description\n ${data.description}\n## Table of contents\n* [Description](#Description)\n* [Installation Instructions](#Installation-Instructions)\n* [Usage Information](#Usage-Information)\n* [Contributing](#Contributing)\n* [Test Instructions](#Test-Instructions)\n* [License](#License)\n* [Questions](#Questions)\n## Installation Instructions\n${data.instruction}\n## Usage Information\n${data.usage}\n## Contributing\n${data.guildline}\n## Test Instructions\n${data.test}\n## License\n* [License](#${data.license})\nThis Project is licensed under ${data.license}\n## Questions\n### For further enquiries you can contact me via:\n* GitHub username: ${data.Github}\n* [Github Link](https://github.com/${data.githubUsername}/)\n* Email Address: ${data.email}\n\n`;\n}", "title": "" }, { "docid": "480ec6d2dc87851cb85a69deae727ee3", "score": "0.76297593", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n${renderLicenseBadge(data.license)}\n## Description\n${data.description}\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [How To Contribute](#how-to-contribute)\n- [Tests](#tests)\n- [Questions](#questions)\n## Installation\n${data.installation}\n## Usage\n${data.usage}\n## License\n${renderLicenseSection(data.license, data.year, data.fullName)}\n## How to Contribute\n${data.contributing}\n## Tests\n${data.tests}\n## Questions\nIf you have any question you can view my GitHub Profile [here](https://www.github.com/${data.github}), or you can contact me here: ${data.email}\n`;\n}", "title": "" }, { "docid": "d918a43dd924cd050f9ca6a15bdeee60", "score": "0.7629744", "text": "function generateMarkdown(response){\n return `\n ${response.title}\n\n Table of Contents\n\n [Discription](#discription)\n [Installation](#installation)\n [usage](#usage)\n [Contributing](#contributing)\n [test](#test)\n [Questions](#questions)\n\n DESCRIPTION:\n ${response.discription}\n INSTALLATION:\n ${response.installation}\n USAGE:\n ${response.usage}\n CONTRIBUTING:\n ${response.contributing}\n TEST:\n ${response.testing}\n LICENSE: \n The license being used is ${response.license}\n \n\n\n Questions:\n Click here to view my github page\n (https://github.com/${response.github})\n\n If you have any questions feel free to email me at ${response.email}.`;\n \n}", "title": "" }, { "docid": "e507576dc30eeccad3b402ffa42904dd", "score": "0.7619764", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseSection(data.license)}\n\n # Table of Contents \n * [Installation](#installation)\n * [Technologies](#technologies)\n * [Usage](#usage)\n * [License](#license)\n * [Contribution](#contribution)\n * [Tests](#tests)\n * [Questions](#questions)\n \n # Description\n ${data.description}\n\n # Installation\n ${data.installation}\n\n # Technologies\n ${data.technologies}\n\n # Usage\n ${data.usage}\n\n # License\n This project is licensed under the ${data.license} license. \n\n # Contribution\n ​Contributors: \n ${data.contributor}\n\n # Tests\n The following is needed to run the test: \n ${data.test}\n\n # Questions\n Please contact if there is any question:\n - Github: [${data.github}](https://github.com/${data.github})\n - Email: ${data.email} `;\n}", "title": "" }, { "docid": "bac8b36024d069047438b778c04f4da9", "score": "0.76149356", "text": "function generateMarkdown(data) {\n let newLicense = ''\n let licenseCheck = (data) => {\n if (data.license === 'MIT') {\n newLicense = `[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)`\n } else if (data.license === 'GNU v3.0') {\n newLicense = `[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)`\n } else if (data.license === 'Apache v2.0' ){\n newLicense = `[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)`\n } else {\n newLicense = ''\n }\n }\n\n licenseCheck(data)\n\n return `# ${data.title}\n${newLicense}\n(https://${data.github}.github.io/${data.title})\n## Table of contents\n* [General info](#general-info)\n* [Install](#install)\n* [Technologies](#technologies)\n* [Use](#use)\n* [Test](#test)\n* [Dependancies](#dependencies)\n* [Contribute](#contribute)\n\n## General info\n${data.description}\n\n## Install\n${data.install}\n\t\n## Technologies\n${data.tech}\n\n## Use\n${data.usage}\n\n## Test\n${data.test}\n\n## Dependencies\n${data.dependencies}\n\n## Contribute\n${data.contribute}\n`;\n}", "title": "" }, { "docid": "d9139827b6fc2971aa8630018b837033", "score": "0.761481", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n \n ## Description\n \n ${data.description}\n\n ## Table of Contents\n * [Installation](#Installation)\n * [Usage](#Usage)${renderLicenseLink(data.license)}\n * [Contributing](#Contributing)\n * [Tests](#Tests)\n * [Questions](#Questions)\n \n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage} \n ${renderLicenseSection(data.license)}\n ## Contributing\n ${data.contribute}\n\n ## Tests\n ${data.tests}\n\n ## Questions\n here is the link to my Github: [github.com/${data.github}](github.com/${data.github})\n If you have any questions regarding the project or anything else you can contact me at:\n \n Email: [${data.email}](${data.email}) \n`;\n}", "title": "" }, { "docid": "2fc32e227186637e6a22efccb5200fd1", "score": "0.7606162", "text": "function generateMarkdown(data) { \n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)} <br />\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [License](#license)\n - [Contributing](#contributing)\n - [Tests](#tests)\n - [Questions](#questions)\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## License\n ${renderLicenseSection(data.license)}\n\n ## Contributing\n ${data.contributing}\n\n ## Tests\n ${data.tests}\n\n ## Questions\n GitHub: [${data.username}](https://github.com/${data.username}) <br />\n <br />\n Email me with any questions: ${data.email}\n`;\n}", "title": "" }, { "docid": "4524af23cdffbb4402b22a76effcae80", "score": "0.76047707", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license, data.color)}\n\n***\n\n ## Description:\n ${data.description}\n \n***\n ## Table of Contents:\n 1. [Description](#description)\n 2. [Installation](#installation)\n 3. [Usage](#usage)\n 4. [License](#license)\n 5. [Contributing](#contributing)\n 6. [Tests](#tests)\n 7. [Questions](#questions)\n\n***\n ## Installation:\n ${data.installation}\n\n***\n ## Usage:\n ${data.usage}\n \n***\n ## License:\n This project falls under the ${data.license} License. The full documentation for this license can be found at ${renderLicenseLink(data.license)}.\n\n Below is an excerpt of the ${data.license} License.\n <br>\n ${renderLicenseSection(data.license)}\n\n ## Contributing:\n The contributors for this project are: ${data.contributors}.\n <br>\n ${data.contributing}.\n\n***\n ## Tests:\n ${data.tests}\n\n***\n ## Questions:\n - The GitHub profile for this project is ${data.questions}.\n \n - If there are any questions, the contributor can be reached at ${data.email}.\n\n`\n}", "title": "" }, { "docid": "a415def619e45c7ae30714e9ff1bbdd7", "score": "0.7603953", "text": "function generateMarkdown(data) {\n return `\n# ${data.name}\n\n## About \n${data.about}\n\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [Questions](#questions)\n\n \n\n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n${renderLicenseBadge(data.license)}\n\n${renderCollab(data.credits)}\n\n${renderTests(data.testsConfirm)}\n\n## Questions?\n[Github](www.github.com/${data.github})\n\nOr contact me at: ${data.email}\n\n `;\n}", "title": "" }, { "docid": "eaa016c44047e26fbbf0d12c71c357a3", "score": "0.76014435", "text": "function generateMarkdown(data) {\n return `\n # Project Title:\n ${data.name}\n\n ## Description\n ${data.description}\n\n # Table of contents\n 1. [Usage](#Usage)\n 2. [License](#License)\n 3. [Contributing](#Contributing)\n 4. [Languages](#Languages)\n 5. [Installation](#Installation)\n 6. [GitHub Link](#GitHubLink)\n 7. [Questions](#Questions)\n\n ## Usage\n ${data.usage}\n\n ## License\n ${data.license}\n\n ## Contributing\n ${data.contributors}\n\n ## Languages\n ${data.language}\n\n ## Installation\n ${data.installation}\n\n ## GitHub Link\n https://github.com/${data.link}\n\n ## Questions\n For any and all questions please email me @ ${data.email} or https://github.com/${data.link} Thank you!\n `;\n}", "title": "" }, { "docid": "e02a7938f1cd9cc4f578a1fa55f35038", "score": "0.7597539", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\nhttps://github.com/${data.Username}/${data.Title}\n# Description\n${data.description} \n# Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n# Installation\n${data.installation}\n# Usage\n${data.usage}\n# License\n![](https://img.shields.io/badge/LICENSE-${data.license}-<ORANGE>)\n# Contributing\nContributors: ${data.contributors}\n# Testing\n${data.tests}\n# Questions\nPlease see my github: ${data.githubinfo}\nYou can ask me questions here: ${data.email}\n`;\n}", "title": "" }, { "docid": "d793ff531e67747e62aea4b81779c1ae", "score": "0.7583596", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n ## Table of Contents\n\n [License](#license)\n [Description](#description)\n [Installation Instructions](#installation-instructions)\n [Usage Information](#usage-information)\n [Contribution Guidelines](#contribution-guidelines)\n [Test Instructions](#test-instructions)\n [Github Username](#github-username)\n [Email](#email)\n\n ## License\n\n ${renderLicenseSection(data.license)}\n\n ## Description\n\n ${data.description}\n\n ## Installation Instructions\n\n ${data.installationInstructions}\n\n ## Usage Information\n\n ${data.usageInformation}\n\n ## Contribution Guidelines\n\n ${data.contributionGuidelines}\n\n ## Test Instructions\n\n ${data.testInstructions}\n\n ## Github Username\n\n ${data.githubUsername}\n\n ## Email\n\n ${data.email}\n`;\n}", "title": "" }, { "docid": "110f9b9d21720acc657746b31cd929dd", "score": "0.75823027", "text": "function generateMarkdown(data) {\n return `\n${renderLicenseBadge(data)}${addCCBadge(data)}\n\n# ${data.title}\n\n## Description\n\n${data.what}\n\n${data.why}\n\n${data.how}\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Credits](#credits)\n* [License](#license)\n\n## Installation\n\n${data.install}\n\n## Usage\n\n${data.usage}\n\n## Credits\n\n${data.credit}\n\n## License\n\n${renderLicenseSection(data)}\n\n${renderLicenseLink(data)}\n\n## Contributing \n\nFeel free to contribute to this repository by logging bugs, submitting a pull request, or leaving a comment.\n\n${addContributorCovenant(data)}\n \n## Tests\n\n${data.tests}\n\n## Questions\n\nIf you have any questions about this project, contact me on [GitHub](github.com/${data.username}) or by email at ${data.email}.\n`;\n}", "title": "" }, { "docid": "3ec6e9656a4af397f90e57423744fc0a", "score": "0.7578216", "text": "function generateMarkdown(data) {\n return `\n # ${data.reponame} ${renderLicenseBadge(data.license)}\n \n ${generateTOC(data.license)}\n\n ## Description <a name=\"abstract\"></a>\n ${data.abstract}\n\n ## Installation Guide <a name=\"installation\"></a>\n ${data.install}\n\n ## Usage Guide <a name=\"usage\"></a>\n ${data.usage}\n\n ## Contribution Guildline <a name=\"coontribution\"></a>\n ${data.contribution}\n\n ## Test Guidlines <a name=\"test\"></a> \n ${data.test}\n \n ### Questions \n ${renderQuestions(data.username, data.email)}\n \n ${renderLicenseSection(data.license)}`\n}", "title": "" }, { "docid": "df5236d37c602015c6b4874803357ed3", "score": "0.7571162", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} \n ### ${data.user}\n ${renderLicenseBadge(data.license)}\n\n ## Description\n ${data.description}\n\n ## Usage\n ${data.usage}\n\n ## Installation\n ${data.installation}\n\n ## License\n\n\n## Demo\nYou can find a walk through of this project **here**\n\n## Submission Requirements\n`;\n}", "title": "" }, { "docid": "fc86a0061f2914986409dc012e386bf9", "score": "0.7567249", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contribution](#contribution)\n * [Testing](#testing)\n * [Link](#link)\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ${renderLicenseSection(data.license)}\n\n ## Contribution\n ${data.contributes}\n\n ## Testing\n ${data.tests}\n\n ## Questions\n You can find the link to my application [here](${data.link}).\n If you have any questions about ${data.projectTitle}, contact me at will. \n\n ## Contact Info\n - Github: [${data.username}](https://github.com/${data.username})\n - Email: ${data.email}\n\n`;\n}", "title": "" }, { "docid": "ff50d49ce082343edb1498093e4495e4", "score": "0.75648665", "text": "function generateMarkdown(data) {\n tableOfContents = [];\n tableOfContents.push(\"[Description](#description)\");\n if (data.confirmInstall) {tableOfContents.push(\"[Installation](#installation)\")};\n if (data.confirmUsage) {tableOfContents.push(\"[Usage](#usage)\")}\n if (data.confirmContribution) {tableOfContents.push(\"[Contributing](#contributing)\")}\n if (data.confirmTests) {tableOfContents.push(\"[Tests](#tests)\")}\n if (data.confirmLicense) {tableOfContents.push(\"[License](#license)\")}\n if (data.confirmContact) {tableOfContents.push(\"[Questions](#questions)\")}\n\n // Add Title, Description, and TOC header to content\n content = `\n# ${data.title}\n`\n\nif (data.confirmLicense) {\n content += `\n\n![Licence Badge](https://img.shields.io/static/v1?label=License&message=${data.license.replace(/ /g,\"%20\")}&color=blue)\n`\n}\n\ncontent += `\n\n## Description\n${data.description}\n\n## Table of Contents\n`;\n\n // Add Table Of Contents\n tableOfContents.forEach(item => {\n content += `- ${item}\n`;\n });\n\n // Adds Installation Instructions if desired\n if (data.confirmInstall) {\n content += `\n\n## Installation\n${data.install}\n`;\n }\n\n // Add Usage Instructions if desired\n if (data.confirmUsage) {\n content += `\n\n## Usage\n${data.usage}\n`;\n }\n\n // Adds Contribution Guidelines if desired\n if (data.confirmContribution) {\n content += `\n \n## Contributing\n${data.contribution}\n`;\n }\n\n // Adds Tests if desired\n if (data.confirmTests) {\n content += `\n \n## Tests\n${data.tests}\n`;\n }\n\n // Adds License if selected\n if (data.confirmLicense) {\n content += `\n \n## License\nThis code is covered under ${data.license}\n`;\n }\n\n // Adds Questions area if desired\n if (data.confirmContact) {\n content += `\n \n## Questions\n- My [GitHub](https://github.com/${data.githubUsername})\n- My [Email](mailto:${data.email})\n`\n }\n\n return content;\n} // End Function", "title": "" }, { "docid": "0c6806523303325c7ee4632edf7ab827", "score": "0.75598437", "text": "function generateMarkdown(data) {\n const badge = renderLicenseBadge(data.license)\n return `\n# ${data.projectTitle}\n${badge}\n## Description\n${data.projectDesc}\n## Table of Contents\n* [Installation](#Installation)\n* [Usage](#Usage)\n${tableOfContentsLicense(data.license)}\n* [Contributing](#Contributing)\n* [Tests](#Tests)\n* [Questions](#Questions)\n## Installation\n${data.installation}\n## Usage\n${data.usage}\n${renderLicenseSection(data.license)}\n## Contributing\n${data.contributing}\n## Tests\n${data.tests}\n## Questions\nIf need more information, please checkout my [github account](https://github.com/${data.github}). You can also reach me via [email](mailto:${data.email}?subject=${data.projectTitle}).\n`;\n}", "title": "" }, { "docid": "e9c43a8519d4cb9f194e92ce68d44ab2", "score": "0.7550543", "text": "function generateMarkdown(data) {\n return `\n # ${data.projectTitle} \n <br>\n\n ${renderLicenseBadge(data.license)} \n <br>\n\n # Table of Contents\n - [Description](#Description)\n - [Installation](#Installation)\n - [Usage](#Usage)\n - [Contributing](#Contributing)\n - [License and Copyright](#License-and-Copyright)\n - [Citations](#Citations)\n - [Questions](#Questions)\n \n # Description\n \n ${data.description} <br>\n ![](${data.screenshot}) <br>\n \n # Installation\n \n ${data.installation} <br>\n \n # Usage\n \n ${data.usage} <br>\n \n # Contributing\n \n ${data.contribute} <br>\n \n # Tests\n \n ${data.tests} <br>\n \n # License and Copyright\n \n Copyright ${data.year} ${data.authorName}\n \n <br>\n\n ${renderLicenseSection(data.license)}\n\n <br>\n\n ${renderLicenseLink(data.license)}\n\n <br>\n\n # Citations\n\n ${data.citations}\n \n # Questions?\n Please reach out to ${data.authorName} using the contact options below: <br>\n [GitHub Profile](<https://github.com/${data.gitId}>)<br>\n [Email](<mailto:${data.email}>)\n \n`;\n}", "title": "" }, { "docid": "6cf91c17e4d5e1e8fdfda259ded522f6", "score": "0.75465167", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)}\n \n \n ## Description\n ${data.description}\n\n\n ## Table of Contents\n - [Description](#description)\n - [Instructions](#instructions)\n - [Usage](#usage)\n - [License](#license)\n - [Contribute](#contribute)\n - [Link](#link)\n - [Contact Info](#contact-info)\n\n\n ## Instructions\n ${data.installation}\n\n\n ## Usage\n ${data.usage}\n \n\n ## Contribute\n ${data.howToContribute}\n\n\n ## Link\n ${data.link}\n\n ## Contact Info\n * ${data.email}\n * https://github.com/${data.github}\n\n\n\n ${renderLicenseSection(data.license)}\n`\n;\n}", "title": "" }, { "docid": "bdc2775c17a3613363cf800b28466664", "score": "0.75459963", "text": "function generateMarkdown(data) {\n return `\n # Project Title \n ${data.title}\n\n ## Table of Contents\n- [Project Description](#Project Description)\n- [Installation Instructions](#Installation Instructions)\n- [Usage Information](#Usage Information)\n- [Collaborators of the application](#Collaborators of the application)\n- [Questions](#Questions)\n- [Still Have Questions?](#Still Have Questions?)\n\n ## Project Description\n ${data.description}\n\n ## Installation Instructions\n ${data.installation}\n\n ## Usage Information\n ${data.usage}\n\n ## Collaborators of the application\n ${data.collaborators}\n\n ## Questions\n My GitHub Profile: https://github.com/${data.githubUsername}\n\n ### Still Have Questions?\n Please feel free to contact us: ${data.email}\n`;\n}", "title": "" }, { "docid": "a9a4b2dca1e2dab2f8a95ae8efb9c490", "score": "0.754248", "text": "function generateMarkdown(data) {\n return `\n## ${data.title}\n\n## Description\n${data.description}\n\n## Table of Content\n* [Description](#Description)\n* [Usage](#usage)\n* [Contribution](#Contribution)\n* [Test](#Test)\n* [License](#license)\";\n\n## Usage Information\n${data.usage}\n\n## Contribution Information\n${data.contribution}\n\n## Test Information\n${data.test}\n\n## License\n${renderLicenseBadge(data.license)}\n${renderLicenseSection(data.license)}\n${renderLicenseLink(data.license)}\n\n## Questions\nIf you have any questions regarding this app you can reach me through my email or github below.\nhttps://github.com/${data.github}\n${data.email}\n`;\n}", "title": "" }, { "docid": "18b7ad88a8acc866b2fa4242c3ecf49e", "score": "0.754137", "text": "function generateMarkdown(data) {\n return `\n![${data.license}](https://img.shields.io/badge/license-${data.license}-blue)\n\n# ${data.title} \n\n## Description\n${data.description}\n ## Table of Contents\n * [Installation Instructions](https://github.com/UNCValladaresHamlet/09_NodeJS/blob/main/Develop/README.md#installation)\n * [Usage Information](https://github.com/UNCValladaresHamlet/09_NodeJS/blob/main/Develop/README.md#usage)\n * [Contribution Guidelines](https://github.com/UNCValladaresHamlet/09_NodeJS/blob/main/Develop/README.md#contributing)\n * [Test Instructions](https://github.com/UNCValladaresHamlet/09_NodeJS/blob/main/Develop/README.md#tests)\n * [Questions](https://github.com/UNCValladaresHamlet/09_NodeJS/blob/main/Develop/README.md#questions)\n## Installation\n${data.install}\n\n## Usage\n${data.usage}\n\n## Contributing\n${data.contribution}\n\n## Tests\n${data.test}\n\n## Questions\nIf you have any questions, you can contact me directly at ${data.email} . Click here to check out my Github profile https://github.com/${data.github} .\n\n${renderLicenseSection(data.license)}\n\n`;\n\n}", "title": "" }, { "docid": "ed6f9a4a80478a25f678cd3f5862f2fb", "score": "0.754131", "text": "function generateMarkdown(data) {\n let license = renderLicenseSection(data.license)\n return `# ${data.title}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contributing](#contributing)\n - [Tests](#tests)\n - [License](#license)\n - [Contact me](#questions)\n\n ## Installation\n ${data.install}\n\n ## Usage\n ${data.usage}\n\n ## Contributing\n ${data.contribution}\n\n ## Tests\n ${data.test}\n\n ## License\n ${license}\n\n ## Questions\n If you have any problems or questions, you can email me at ${data.email} or contact me on my Github.\n Github Page: [${data.github}](github.com/${data.github})\n\n`;\n}", "title": "" }, { "docid": "647fc6056b436a22c2e1417c3b02f0ca", "score": "0.7537179", "text": "function generateMarkdown(data) {\n //if (data.license != \"None\" && )\n return `# ${data.title}\n\n ## Description \n\n ${data.description}\n\n ${renderDeployedLinkSection(data)}\n\n ## Table of Contents \n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Credits](#credits)\n * [License](#license)\n\n\n ## Installation\n\n In order to install this project on your own system you would need to enter the following in your command line: ${data.dependencies}\n\n\n ## Usage \n\n ${data.userNeedToKnow}\n\n ## Tests\n\n You can test this project after you have installed it by running the following in the command line: ${data.tests}\n\n ## Credits\n\n Github: [${data.github}](https://github.com/${data.github})\n Email: ${data.email}\n\n ${renderLicenseSection(data.license)}\n\n ---\n\n ## Badges\n\n ![badmath](https://img.shields.io/github/languages/top/nielsenjared/badmath)\n\n\n ## Contributing\n\n ${data.userContributingInfo}\n See the [Contributor Covenant](https://www.contributor-covenant.org/) for more information on how you can contribute. \n\n`;\n}", "title": "" }, { "docid": "7be70baec03377ffa6771d34e1a0ac3e", "score": "0.7534794", "text": "function generateMarkdown(data) {\n let renderSection = renderLicenseSection(data.license);\n\n return `\n # ${data.title}\n\n ${renderSection}\n\n ## Description\n ${data.description}\n\n ## Table of contents\n - [Installation](#installation)\n - [Usage](#usage)\n - [Credits](#credits)\n - [License](#license)\n - [How to contribute](#contribute)\n - [Tests](#tests)\n\n ## Installation\n ${data.install}\n\n ## Usage\n ${data.usage}\n\n ## Credits\n ${data.credits}\n\n ## License\n ${data.license}\n ${renderSection}\n\n ## How to contribute\n ${data.contribute}\n\n \n ## Tests\n ${data.tests}\n `;\n}", "title": "" }, { "docid": "fbdbd22102961c95c09b32b1c5c2c567", "score": "0.7528519", "text": "function generateMarkdown(data) {\n const licenseLink = renderLicenseLink(data.license);\n const licenseSection = renderLicenseSection(data.license);\n const markdownTemplate = \n `# ${data.title}\n \n ## Description\n ${data.description} \n\n ## Table of Contents \n\n ## License \n\n ${licenseSection}\n\n ${licenseLink}\n \n * [Installation](#installation)\n\n * [Usage](#usage)\n\n * [Contributing](#contributing)\n\n * [Tests](#tests)\n\n * [Questions](#questions)\n\n You can reach me at ${data.email} or visit my github at https://github.com/${data.github}\n\n ## Installation\n\n To install necessary dependencies, install the following\n \\`\\`\\`\n ${data.install}\n \\`\\`\\`\n\n ## Usage\n\n ${data.usage}\n\n ## Contributing\n\n ${data.contributing}\n\n ## Tests\n\n To run tests, run the following command:\n \n ${data.tests}\n \n ## Questions;\n \n ${data.questions}\n\n `;\n\n return markdownTemplate;\n}", "title": "" }, { "docid": "e012914c48dfb822a5fa49e5d89b105f", "score": "0.7528086", "text": "function generateMarkdown(data, ghAvatar, ghLink) {\n return `\n# ${data.title}\n${renderLicenseBadge(data.license)}\n\n## Description \n ${data.description}\n\n## Table of contents\n - [Description](#Description)\n - [Installation](#Installation)\n - [Usage](#Usage)\n - [Licence](#Licence)\n - [Contributors](#Contributors)\n - [Test](#Test)\n - [Repository Link](#Repository)\n - [GitHub Info](#GitHub) \n\n## Installation\n ${data.install}\n\n## Usage\n ${data.usage}\n\n## Contributors\n ${data.contributors}\n\n## Licence\n ${renderLicense(data.license)}\n\n## Test\n ${data.tests}\n\n## Github\n * Username: ${data.github}\n * Github Profile Image:\n![Avatar](${ghAvatar})\n\n * Link to Github Profile:\n[${ghLink}](${ghLink})\n\n## Contact info\n If you have any more questions, please contact me via email:\n[${data.email}](mailto:${data.email})\n\n `;\n}", "title": "" }, { "docid": "0ad276a0ec4b05a41b750df02b4de2db", "score": "0.7527078", "text": "function generateMarkdown(data) {\n const badge = renderLicenseBadge(data.license)\n const licensePart = renderLicenseSection(data.license)\n return `# ${data.title} \\n ${badge}\n\\n \\n ## Description \\n ${data.description} \n\\n \\n ## Table of Contents \n\\n * [Installation](#installation) \n\\n * [Usage](#usage) \n\\n * [License](#license) \n\\n * [Contributing](#contributing) \n\\n * [Tests](#Tests) \n\\n * [Questions](#questions)\n\\n \\n ## Installation \\n${data.installation}\n\\n \\n ## Usage \\n ${data.usage}\n\\n \\n ## License \\n ${licensePart}\n\\n \\n ## Contributing \\n ${data.contributing}\n\\n \\n ## Tests \\n ${data.test}\n\\n \\n ## Questions \\n Please find me on GitHub or email me with further questions:\n\\n * GitHub: [${data.github}](https://github.com/${data.github})\n\\n * Email: ${data.email} \n`;\n}", "title": "" }, { "docid": "782d7d9884357e24f9872350a8b20e83", "score": "0.7512761", "text": "function generateMarkdown(data) {\n console.log(data)\n return `## ${data.Title}\nhttps://github.com/${data.Username}/${data.Title}\n\n## Description\n${data.Description}\n## Table of Contents.\n- [Installation](#installation)\n- [Usage](#usage)\n- [Credits](#credits)\n- [License](#license)\n- [Tests](#tests)\n- [Features](#features)\n- [Question](#question)\n## Installation\nThe following necessary dependencies mut be installed to run the application. ${data.Dependencies}\n\n## Usage\nIn order to use this app, ${data.Usage}\n\n## Credits\nList your contributors with links to their GitHub profiles.\nContributers: ${data.Contributor}\nLink of github: ${data.ContributorGithubLink}\n\n${renderLicenseSection(data.License)}\n\n## Tests\nThe following in needed to run the test : ${data.Tests}\n\n\n## Features\nList of features in this project : ${data.Features}\n\n## Question\nIf you have any question about Repo, open an issue or contact ${data.Questions}\n\n`;\n}", "title": "" }, { "docid": "098af3ae3516a1b224f7cd1ceb372826", "score": "0.7510401", "text": "function generateMarkdown(data) {\n const kebalCaseTitle = data.title.toLowerCase().split(\" \").join(\"-\");\n const userAvatar = `https://github.com/${data.github}.png?size=150`;\n const projectURL = `https://github.com/${data.github}/${kebalCaseTitle}`;\n const licenseBadge = `https://img.shields.io/github/license/${data.github}/${kebalCaseTitle}`;\n const repoSize = `https://img.shields.io/github/repo-size/${data.github}/${kebalCaseTitle}?color=Green&style=plastic`;\n const mainLang = `https://img.shields.io/github/languages/top/${data.github}/${kebalCaseTitle}?color=blueviolet&style=plastic`;\n const languageTypes = `https://img.shields.io/github/languages/count/${data.github}/${kebalCaseTitle}?color=red&style=plastic`;\n\n const githubAPI = `https://api.github.com/users/${data.github}/events/public`;\n\n return `\n# ${data.title}\n\n[![GitHub license](${licenseBadge})](${projectURL})\n[![GitHub Repo](${repoSize})](${projectURL})\n[![Main Repo Language](${mainLang})](${projectURL})\n[![Repo Languages](${languageTypes})](${projectURL})\n\n# Table of Contents\n* [Description](#description)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Licnese](#license)\n* [Contributers](#contributers)\n* [Testing](#testing)\n\n\n# Description\n ${data.description}\n\n# Installation\n ${data.installation}\n\n# Usage\n ${data.usage}\n\n# License\n ${data.license}\n\n# Contibuters\n ${data.contributers}\n\n# Testing\n ${data.testing}\n\n # GitHub\n ![Image description](${userAvatar})\n ${projectURL}\n\n # Credits\n\n * [Shileds.io](https://shields.io/)\n\n # Author\n\n * ${data.name}\n`;\n}", "title": "" }, { "docid": "af02a1562180cca137f21b79fe403a5a", "score": "0.7507639", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)}\n\n## Description\n${data.description}\n\n## Table of Contents\n-[Description](#description)\n\n-[Usage](#Usage)\n\n-[Test](#Test)\n\n-[Questions](#Questions)\n\n-[Contributors](#Contribution)\n\n-[License Resources](#license)\n\n## Tests\n${data.test}\n\n## Contribution\n${data.contributer}\n\n## License\n${data.license}\n\n## My Github\n[Profile](https://github.com/${data.github})\n\n### email\n(${data.email})\n\n\n`;\n}", "title": "" }, { "docid": "a1fd78e5330bed4119c50f06c5c692f4", "score": "0.74986917", "text": "function generateMarkdown(data) {\n return `\n\n # ${data.title}\n\n ## Description:\n\n ${renderLicenseBadge(data.License)}\n \n ${data.description}\n\n ## Table of Contents:\n ${tableOfContents(data.toc)}\n\n ## Installation:\n > ${data.Installation}\n\n ## Usage:\n ${data.Usage}\n\n ## Credits:\n ( https://github.com/${data.Credits} )\n\n ## License:\n ${data.License}\n\n ## Test\n > ${data.Test}\n\n ## Questions: \n * Name: ${data.name}\n * Github: ( https://github.com/${data.github} )\n * ${data.about}\n\n `;\n}", "title": "" }, { "docid": "4625e20e0a0c85ddcbfd2515d17c4295", "score": "0.7493864", "text": "function generateMarkdown(data) {\n console.log(data)\n\n return `# ${data.title},\n\n${renderLicenseBadge(data.license)}\n \n## Description\n${data.description}\n## Table Of Contents\n* [Installation](#installation)\n* [Usage](#Usage)\n* [Contribution](#Contribution)\n* [License](#License)\n* [Questions](#questions)\n\n## Installation\n\nTo install necessary dependencies,\nrun the following command line:\n\\`\\`\\`\n${data.installation}\n\\`\\`\\`\n\n\n## Usage\n${data.license}\n${renderLicenseLink(data.license)}\n \n## Contribution\n ${data.contribute}\n## License\n${renderLicenseSection(data.license)}\n\n## Questions\n\nif you have any questions about the repo, open an issue or contact me directly at ${\n data.email\n}. You can find more of my work at [${data.username}](https://github.com/${\n data.username\n}/).\n\n \n\n\n \n`;\n}", "title": "" }, { "docid": "530b7824a42f9fcdb6076603f67f666d", "score": "0.74910694", "text": "function generateMarkdown(data) {\n renderLicenseLink(license);\n let licenseBadge = renderLicenseBadge(license);\n let licenseSection = renderLicenseSection(license);\n return `# ${data.title}\n ${licenseBadge}\n\n## Description\n\n${data.description}\n\n***\n\n## Table of Contents\n\n* [Installation](#installation)\n\n* [Usage](#usage)\n\n* [License](#license)\n\n* [Contributing](#contributing)\n\n* [Tests](#tests)\n\n* [Questions](#questions)\n\n\n\n***\n\n## Installation\n\n${data.installation}\n\n***\n\n## Usage \n\n${data.usage}\n\n***\n\n\n${licenseSection}\n\n\n## Contributing\n\n${data.contribution}\n\n***\n\n## Tests\n\n${data.testing}\n\n***\n\n## Questions\n\nCheckout my GitHub profile [here](https://github.com/${data.github}/)\n\nIf you have any questions, you can email me at: ${data.email}\n\n`;\n}", "title": "" }, { "docid": "acfea35b125eaa1f27d33d42394e6c40", "score": "0.7490618", "text": "function generateMarkdown(answers) {\n\n return `\n# ${answers.title}\n\n[![License: ${licenseArray[0]}](${licenseArray[1]})](${licenseArray[2]})\n\n#### Table of Contents\n* [Description](##Description)\n* [Installation](##Installation)\n* [Usage](##Usage)\n* [License](##License)\n* [Contributing](##Contributing)\n* [Tests](##Tests)\n* [Questions](##Questions)\n\n## Description\n\n${answers.description}\n\n## Installation\n\n${answers.installation}\n\n## Usage \n\n${answers.usage}\n\n\n## License\n\n${licenseArray[3]}\n\n## Contributing\n\n${answers.contributing}\n\n## Tests\n\n${answers.test}\n\n## Questions\n\nFor questions, email me at: ${answers.email} <br />\nOr visit my Github [here](https://github.com/${answers.github})\n\n `\n}", "title": "" }, { "docid": "31819256db3dff90c778d03626ca8096", "score": "0.74897414", "text": "function generateMarkdown(data) {\n const {title, license, description, installation, usage, contributing, tests, username, email} = data;\n const licenseBadge = renderLicenseBadge(license);\n const licenseSection = renderLicenseSection(license);\n const markdownText = `# ${title}\n${licenseBadge}\n\n## Table of Contents\n* [Description](#description)\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n\n\n## Description\n\n${description}\n\n## Installation\n\n${installation}\n\n## Usage\n\n${usage}\n\n${licenseSection}\n\n## Contributing\n\n${contributing}\n\n## Tests\n\n${tests}\n\n## Questions\n\nFind me on GitHub: https://github.com/${username}\\n\nEmail me with questions: ${email}\n`;\n\nreturn markdownText;\n}", "title": "" }, { "docid": "275e104a976ddce36b00c4aa8243e05d", "score": "0.7488107", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n \n ## Description\n ${data.description}\n\n ## Table of Contents\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contributing](#contributing)\n - [Tests](#tests)\n - [Questions](#questions)\n ${renderLicenseLink(data.license)}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## Contributing\n ${data.contributing}\n\n ## Tests\n ${data.tests}\n \n ## Questions\n To find more information and the repository on this project please visit my [GitHub](https://github.com/${data.username}).\n\n For any additional questions please email me at ${data.email}.\n \n ${renderLicenseSection(data.license)}\n`;\n}", "title": "" }, { "docid": "1a314d03a3533d667b8228ca39406835", "score": "0.74817497", "text": "function generateMarkdown(data) {\n console.log(\"inside markdown\", data)\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n\n ## Description \n ${data.description}\n\n ## Table of Contents\n * [Installation](#installation)\n * [License](#license)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n\n ## License\n\n Link to License (if applicable) : ${renderLicenseLink(data.license)}\n \\n\n ${renderLicenseSection(data.license)}\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Contributing\n\n ${data.contribution}\n\n ## Tests\n\n ${data.tests}\n\n ## Questions\n\n ${\"Github profile: https://github.com/\" + data.username}\\n\n ${\"Email me here to contact me: \" + data.email}\\n\n`;\n}", "title": "" }, { "docid": "9a788ec4016fec464b45aebc75a91042", "score": "0.74735576", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n`;\n}", "title": "" }, { "docid": "18112131b72ad1823ec2bfc70d1fd505", "score": "0.7463054", "text": "function generateMarkdown(data) {\n console.log(data);\n return `\n # ${data.title}\n ${renderLicenseBadge(data.license)}\n\n ## Description\n ${data.description}\n \n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [Testing](#testing)\n ${renderTableOfContent(data.license)}\n * [Questions](#questions)\n \n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n \n ## Contributing\n ${data.contributing}\n\n ## Testing\n ${data.testing}\n\n ${renderLicenseSection(data.license)} \n ${renderLicenseLink(data.license)}\n\n ## Questions\n If you have additional questions, I'm reachable via ${data.email}, and [My Github](https://github.com/${data.github}).\n`;\n}", "title": "" }, { "docid": "a48ea37ab3de4b0225851a01439f3911", "score": "0.7455911", "text": "function generateMarkdown(data) {\n console.log(data)\n return `${renderLicenseBadge(data.license)}\n # ${data.title}\n ## Table of Contents\n - ### [Description](#Description)\n - ### [Installation](#Installation)\n - ### [Usage](#Usage)\n - ### [License](#License)\n - ### [Contributors](#Contributors)\n - ### [Test](#Test)\n - ### [Questions](#Question)\n ## Description\n ${data.description}\n ## Installation\n ${data.installation}\n ## Usage\n ${data.usage}\n ## Contributors\n ${data.contributors}\n ## Test\n ${data.test}\n ## Questions\n ${data.questions}\n ## License\n ${data.license}\n ## E-mail\n Contact: ${data.email}\n ## Github\n Created by: [${data.github}](https://github.com/${data.github})\n `\n}", "title": "" }, { "docid": "b61b3eba60535be81ae1cd95659fd067", "score": "0.74549055", "text": "function generateMarkdown(data) {\n return `\n \n <h1 align=\"center\">${data.title}</h1>\n \n <p align=\"center\">${renderLicenseBadge(data.license)}</p>\n \n ## Description\n ${data.description}\n ***\n\n <br/><br/>\n\n ## Table of Contents\n >* [License](#license)\n >* [Installation](#installation)\n >* [Tests](#tests)\n >* [Usage](#usage)\n >* [Contributing](#contributing)\n >* [Questions](#questions)\n\n <br/><br/>\n\n ## License\n Copyright © ${data.name} 2021 \n This application is covered under the ${data.license} license. \n For more information, visit ${renderLicenseLink(data.license)}.\n ***\n\n <br/><br/>\n \n ## Installation\n ${data.installation}\n ***\n\n <br/><br/>\n\n ## Tests\n ${data.tests}\n ***\n\n <br/><br/>\n\n ## Usage\n ${data.usage}\n ***\n\n <br/><br/>\n\n ## Contributing\n ${data.contributing}\n ***\n\n <br/><br/>\n\n ## Questions\n For questions, please contact ${data.name} at \n https://github.com/${data.github} \n ${data.email}\n ***\n \n `;\n}", "title": "" }, { "docid": "7fda63a05beb425eb1eaacc73d245a8f", "score": "0.7425985", "text": "function generateMarkdown(data) {\n return `# ${data.Title}\n ${renderLicenseBadge(data.License)}\n\n ## Description\n ${data.Description}\n\n ## Table of Contents\n * [Description](#Description)\n * [Installation](#Installation)\n * [Usage](#Usage)\n * [License](#license)\n * [Contributing](#Contributing)\n * [Tests](#Tests)\n * [Questions](#Questions)\n\n \n ## Installation\n ${data.Installation}\n\n ## Usage\n ${data.Usage}\n\n \n ## License \n ${data.License}:\n ${renderLicenseLink(data.License)}\n \\n\n ${renderLicenseSection(data.License, data.Github_username)}\n\n ## Contributing\n ${data.Contributing}\n\n ## Tests\n ${data.Tests}\n\n \n ## Questions\n ${data.Questions}\n\n **GitHub**: [@${data.Github_username}](https://github.com/${data.Github_username})\n \\n\n **Email**: ${data.Email}\n\n\n`;\n}", "title": "" }, { "docid": "6e135911676221b321c548bd66ec6e78", "score": "0.7410097", "text": "function generateMarkdown(data) {\n\nvar lsection = renderLicenseSection(data.license);\n\n return `\n # ${data.title} \n\n\n ## Description\n ${data.desctiption}\n \n ## Technologies Used\n ${data.tech}\n \n ## Install\n ${data.install}\n \n ## Usage\n ${data.usage}\n \n ## Credits\n ${data.contributions} \n ${data.resources}\n \n ## License Info\n ${lsection}\n\n\n \n ## Links\n [Repo](${data.repo}) \n [Site](${data.deployed}) \n \n ## Contact Info\n [email me](mailto:${data.email}) \n [find me on github](https://github.com/${data.github}) \n `\n}", "title": "" }, { "docid": "41fdea6c98bde494d3c36c061037bd9c", "score": "0.74052703", "text": "function generateMarkdown(answers) {\n return `# ${answers.title}\n ${renderLicenseBadge(answers.license)}\n # Description:\n ${answers.description}\n ## Table of Contents: \n - [Installation](#Installation:)\n\n - [Usage](#Usage:)\n\n - [License](#License:)\n\n - [Contributing](#Contributing:)\n\n - [Tests](#Tests:)\n\n - [Questions](#Questions:)\n\n ## Installation:\n ${answers.installation}\n ## Usage:\n ${answers.usage}\n ## License:\n ${renderLicenseSection(answers.license)}\n ## Contributing:\n ${answers.contributionGuidelines}\n ## Tests:\n ${answers.testInstructions}\n ## Questions:\n If you have any questions please contact me at: ${answers.email}\n [${answers.githubUsername}](https://github.com/${answers.githubUsername})\n\n `;\n}", "title": "" } ]
603c50e516f4565e18025657173362ff
Ritorno la pagina visualizzata
[ { "docid": "170adf2fce42d13944793c631959466a", "score": "0.0", "text": "render() {\n return (\n <div>\n <section id=\"clientiSection\">\n <h3>Clienti Disponibili: {this.state.NumCli}</h3>\n\n <div>\n <button style={{ display: \"inline-block\" }} type=\"button\" className=\"btn btn-primary\" onClick={this.Cerca}><i className=\"fa fa-search\"></i></button>\n <div style={{ display: \"inline-block\" }} className=\"filter-group\">\n <label>Fltro: </label>\n <input name=\"CodFid\" type=\"text\" className=\"form-control\" value={this.state.CodFid} onChange={this.GestMod} />\n </div>\n </div>\n {this.DatatablePage()}\n </section>\n </div>\n );\n }", "title": "" } ]
[ { "docid": "08bbdad05f919f9cb08ed58d07076653", "score": "0.6374898", "text": "function afficheHistoire(donnees) {\n\tvar HTML = Twig.twig({ href: \"templates/histoire.twig.html\", async: false}).render();\t\t\n\t$(\"#content\").html(HTML);\n\t$(\".link-side-nav\").removeClass(\"active\");\n\t$(\".nav-link\").removeClass(\"active\");\n\n\t$(\".social\").removeClass(\"none\");\n\n\t$(\".histoire-nav\").addClass(\"active\");\n}", "title": "" }, { "docid": "265bf1168109efd8493a7365fa0f95bc", "score": "0.63524604", "text": "function inicia(){\n controlVisualizacion.iniciaControlVisualizacion();\n controlVisualizacion.creaHTMLGeneral(); \n controlVisualizacion.iniciaElementosDOM();\n\n //iniciamos con la escena 1\n controlVisualizacion.comenzamos();\n}", "title": "" }, { "docid": "265bf1168109efd8493a7365fa0f95bc", "score": "0.63524604", "text": "function inicia(){\n controlVisualizacion.iniciaControlVisualizacion();\n controlVisualizacion.creaHTMLGeneral(); \n controlVisualizacion.iniciaElementosDOM();\n\n //iniciamos con la escena 1\n controlVisualizacion.comenzamos();\n}", "title": "" }, { "docid": "766e2607379adaf0db04409848e4be03", "score": "0.6254821", "text": "function limpaPesquisa() {\n document.getElementsByTagName(\"header\")[0].style.display = \"none\";\n document.getElementsByTagName(\"main\")[0].style.display = \"grid\";\n document.getElementsByTagName(\"footer\")[0].style.display = \"grid\";\n }", "title": "" }, { "docid": "55cad6579d19e87ff005d72cf116bdca", "score": "0.6096108", "text": "function visUre() {\n container.textContent = \"\";\n alleUre.forEach((ur) => {\n if (filter == ur.Farve || filter == \"alle\") {\n let klon = temp.cloneNode(true).content;\n klon.querySelector(\"img\").src = \"images/\" + ur.Billede + \".webp\";\n klon.querySelector(\".navn\").textContent = ur.Navn;\n klon.querySelector(\".farve\").textContent = ur.Farve;\n klon.querySelector(\".pris\").textContent = ur.Pris + \",-\";\n klon.querySelector(\"article\").addEventListener(\"click\", () => {\n location.href = \"produkter_detaljer.html?id=\" + ur._id;\n });\n\n container.appendChild(klon);\n }\n });\n}", "title": "" }, { "docid": "530bceaf443804d6985df6deb6cf8c64", "score": "0.6077461", "text": "function visualiserAuteurControls(){\n var vControles = [\"lbledNomAuteur\",\"txtedNomAuteur\",\n \"lbledPreAuteur\",\"txtedPreAuteur\",\"lbledSaveAute\",\"btnedSaveAute\"];\n visualiserControls(\"btnedaddAute\" ,vControles,\"cboxedAute\");\n} // end visualiser", "title": "" }, { "docid": "777b4563ff8d8292063a10a9e41cc96a", "score": "0.6000346", "text": "render () {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{/*Se coloca el titulo que va ha mostrar la pagina */}\n\t\t\t\t<h1>Pagina de Inicio</h1>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "aaee691aea90ec8cb15b894f2c21b5c4", "score": "0.59826493", "text": "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._renderBoatTiles(pageDom);\n\n this._app.setPageTitle(\"Startseite\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "title": "" }, { "docid": "d00ed9ade6f4737ae9bc1c05ea14deb7", "score": "0.5965853", "text": "function alternaReinicia(tipoDisplay) {\n $reiniciaDom.css({\n display: tipoDisplay\n });\n\n }", "title": "" }, { "docid": "af56b3095538bad83f0574584ba30b17", "score": "0.5926364", "text": "function visSingleView() {\n console.log(\"visSingleView\");\n //add history.back();\n //Konstant der bestemmer window.location.search\n //Konstant der definerer en unik egenskab (her fx. navn).\n //Konstant der definerer URL til json\n //Andre lokale variabler\n //opret en klon med alle info fra json og sæt ind på siden vha textContent, link til billede + alt.\n}", "title": "" }, { "docid": "f313e7161fd71b8649f430240eed6427", "score": "0.59142363", "text": "function renderizaInimigos(){\n\tinimigos.forEach(desenhaInimigo);\n\tinimigosAndam();\n}", "title": "" }, { "docid": "6bfce56bcc5846b622d09c248325a99d", "score": "0.59082586", "text": "function showAllPairesRender()\n {\n for (var i=0; i<renderItineraireArray.length; i++)\n {\n renderItineraireArray[i].setMap(carteItineraire);\n polylineForHoverItineraireArray[i].setMap(carteItineraire);\n }\n }", "title": "" }, { "docid": "f3df97b190b1ecf8a3b57750a9780360", "score": "0.5894115", "text": "function showtableau() {\n console.log(\"showing viz\");\n viz.show();\n}", "title": "" }, { "docid": "93db1a5bac9311f335351d2852e9a88d", "score": "0.5892654", "text": "function renderAllPatrimonios(){\n $('.padraoPatrimonios').show();\n}", "title": "" }, { "docid": "e81c6fe291c3415f45bdb8712f7f4c63", "score": "0.58546495", "text": "function renderizaBalas(){\n\tbalas.forEach(desenhaBala);\n\tbalasAndam();\n}", "title": "" }, { "docid": "a721b30c90863057e76ba48c4f6d5cfe", "score": "0.583349", "text": "function visLande() {\n console.log(\"Funktion visLande\");\n // container til lande og info fra json:\n const dest = document.querySelector(\"#liste\");\n const skabelon = document.querySelector(\"template\").content;\n // Fjern al eksisterende tekst:\n dest.textContent = \"\";\n // loop igennem lande/json:\n lande.forEach(land => {\n if (filter == land.kontinent || filter == \"alle\") {\n const klon = skabelon.cloneNode(true);\n klon.querySelector(\".h2_land\").textContent = land.land;\n klon.querySelector(\".foto\").src = medieurl + land.billede;\n klon.querySelector(\".kort_beskrivelse\").textContent = land.kortBeskrivelse;\n //kommer ind på single view ved klik på info knap\n klon.querySelector(\".info\").addEventListener(\"click\", () => visDetaljer(land));\n dest.appendChild(klon);\n }\n })\n}", "title": "" }, { "docid": "bc44701b25e5de55ed194b1935a9d954", "score": "0.5826286", "text": "function renderizar(objetoDePersonas) {\n\n\t//crear h1\n\tvar h1Container = document.createElement('h1')\n\t//meter text\n\th1Container.innerHTML = objetoDePersonas.titulo;\n\t//apendearlo en la pantalla\n\tvar contenedorDeTitulo = document.querySelector('header');\n\n\tcontenedorDeTitulo.appendChild(h1Container);\n\n\t//crear ul\n\tvar ul = document.createElement('ul');\n\n\tfor (var i = 0; i < objetoDePersonas.actores.length; i++) {\n\t\n\t\tvar li = document.createElement('li');\n\t\tli.innerHTML = objetoDePersonas.actores[i];\n\t\tul.appendChild(li);\n\n\t}\n\n\tvar section = document.getElementById('personas');\n\tsection.appendChild(ul);\n\n}", "title": "" }, { "docid": "2f0e28c77c7a5aa910d29f7c7eb3890c", "score": "0.58230793", "text": "function getPrevouseRides(){\n if(vm.currentPage > 1)\n vm.currentPage -=1;\n else\n vm.currentPage = 1;\n \n if(vm.currentPage < 4)\n vm.showCurrentPage = false;\n \n vm.getAllRides();\n \n }", "title": "" }, { "docid": "e466b48b9a86b782b7f3ec64b0030307", "score": "0.5820125", "text": "function pageVisibility() {\n //affichage de la pagination si le contenu est suffisant\n if (globalData.length > 15){\n document.getElementById(\"pg\").innerHTML = page+1;\n console.log(\"display\");\n document.getElementById(\"pagination\").style.display = \"block\";\n console.log(document.getElementById(\"pagination\").style.display);\n }\n else{\n //pagination invisible\n document.getElementById(\"pagination\").style.display = \"none\";\n }\n\n //premiére page \n if (page == 0 ) {\n // rendre la page précedente non clickable\n var leftArrow = document.getElementById(\"la\");\n leftArrow.classList.add(\"nonClickable\");\n leftArrow.style.color = \"grey\";\n }\n\n //derniére page \n if ((page+1) * 15 > globalData.length) {\n // rendre la page suivante non clickable\n var rightArrow = document.getElementById(\"ra\");\n rightArrow.classList.add(\"nonClickable\");\n rightArrow.style.color = \"grey\"; \n \n } else{\n\n var rightArrow = document.getElementById(\"ra\");\n rightArrow.classList.remove(\"nonClickable\");\n rightArrow.style.color = \"black\"; \n }\n\n // toutes les pages sauf la premiére\n if (page > 0) {\n var leftArrow = document.getElementById(\"la\");\n leftArrow.classList.remove(\"nonClickable\");\n leftArrow.style.color = \"black\";\n }\n\n}", "title": "" }, { "docid": "94c7f158f95dea10f0cc3d769cea4577", "score": "0.580476", "text": "function graficar(conjunto,relacion) \n{\n\t//arreglo de los nodos y las arista o relacion de pares\n\tvar nodes_object = [];\n\tvar edges_object = [];\n\tfor(var i=0;i<conjunto.length;i++)\n\t{\n\t\tnodes_object.push({id: conjunto[i], label:conjunto[i]})\n\t}\n\tfor(var j=0;j<relacion.length;j++)\n\t{\n\t\tvar aux = relacion[j].entrada;\n\t\tif(relacion[j].salida!=\"n\")\n\t\t\taux = relacion[j].entrada + \", \" + relacion[j].salida;\n\t\tedges_object.push({from:relacion[j].de, to: relacion[j].a, label: aux, arrows:'to'})\n\t}\n\n\t//grafica \n\tvar nodes = new vis.DataSet(nodes_object);\n var edges = new vis.DataSet(edges_object);\n crearPopup(1,ventanaGrafica);\n\tvar container = ventanaGrafica.document.getElementById('visualization');\n \tvar data = {nodes: nodes,edges: edges};\n var options = {};\n var network = new vis.Network(container, data, options);\n}", "title": "" }, { "docid": "7879e1d77294c1e787ad15189144a58b", "score": "0.5803883", "text": "function graficar(conjunto,relacion,rel,conj) \n{\n\t//arreglo de los nodos y las arista o relacion de pares\n\tvar nodes_object = [];\n\tvar edges_object = [];\n\tfor(var i=0;i<conjunto.length;i++)\n\t{\n\t\tnodes_object.push({id: conjunto[i], label:conjunto[i]});\n\t}\n\tfor(var j=0;j<relacion.length;j++)\n\t{\n\t\tedges_object.push({from:relacion[j].izquierda, to: relacion[j].derecha, label:relacion[j].valor});\t\t\n\t}\n \n\t//grafica \n\tvar nodes = new vis.DataSet(nodes_object);\n var edges = new vis.DataSet(edges_object);\n\tcrearPopup(rel,conj);\n var container = ventanaGrafica.document.getElementById(\"visualization\");\n \tvar data = {nodes: nodes,edges: edges};\n var options = {};\n var network = new vis.Network(container, data, options);\n}", "title": "" }, { "docid": "ab397511fdb86d6c10cd43aeafac0f02", "score": "0.57978433", "text": "function mostrarPagRPD() {\n document.getElementById(\"pagRP\").style.visibility = \"hidden\";\n document.getElementById(\"pagCP\").style.visibility = \"hidden\";\n document.getElementById(\"pagMP\").style.visibility = \"hidden\";\n document.getElementById(\"pagEP\").style.visibility = \"hidden\";\n\n document.getElementById(\"pagRI\").style.visibility = \"hidden\";\n document.getElementById(\"pagCI\").style.visibility = \"hidden\";\n document.getElementById(\"pagMI\").style.visibility = \"hidden\";\n document.getElementById(\"pagEI\").style.visibility = \"hidden\";\n\n document.getElementById(\"pagRPD\").style.visibility = \"visible\";\n document.getElementById(\"pagCPD\").style.visibility = \"hidden\";\n document.getElementById(\"pagMPD\").style.visibility = \"hidden\";\n document.getElementById(\"pagEPD\").style.visibility = \"hidden\";\n\n document.getElementById(\"pagRC\").style.visibility = \"hidden\";\n document.getElementById(\"pagCC\").style.visibility = \"hidden\";\n document.getElementById(\"pagMC\").style.visibility = \"hidden\";\n document.getElementById(\"pagEC\").style.visibility = \"hidden\";\n\n}", "title": "" }, { "docid": "33c3dcb52fe1fd9ab47e5c67ecb4ca61", "score": "0.57891226", "text": "function afficheEtudiant(donnees) {\n\tvar HTML = Twig.twig({ href: \"templates/fiches.twig.html\", async: false}).render({\"etudiants\" : donnees});\t\t\n\t$(\"#content\").html(HTML);\n\t$(\".link-side-nav\").removeClass(\"active\");\n\t$(\".nav-link\").removeClass(\"active\");\n\n\t$(\".social\").addClass(\"none\");\n\n\t$(\".etudiant\").addClass(\"active\");\n}", "title": "" }, { "docid": "2271c73cad8f27f1689731df1329ecaf", "score": "0.5780078", "text": "mostrarTarefas() {\n printPlanejamentoAtual(this.getPlanejamentoAtual());\n printListaTarefa(this.listaQuadros());\n }", "title": "" }, { "docid": "deec75ccc93c064455fa71c8c74a6811", "score": "0.5760865", "text": "function mostrarPrimPantalla(){\n\n \t\t$('#cuadro-preguntas').addClass(\"hidden\");//ocultar\n\t\t$('#segunda-pantalla').removeClass(\"hidden\");//mostrar\n \t}", "title": "" }, { "docid": "af43857ef144bf57474c55e1709e6447", "score": "0.57599133", "text": "function displayNei(){\n activaTab(\"boxdashboard-body-nei-generic\");\n }", "title": "" }, { "docid": "9ea182da8010b5b3cbe215f977548323", "score": "0.5757614", "text": "function mostrar() {}", "title": "" }, { "docid": "9ea182da8010b5b3cbe215f977548323", "score": "0.5757614", "text": "function mostrar() {}", "title": "" }, { "docid": "db78cb0208d2f024bf85b2df16665cf5", "score": "0.5755123", "text": "function afficherGraphe() {\n\t\n\t\n\t\t// Création du graphe\n\t\tvar chart = new AmCharts.AmSerialChart();\n\t\tchart.dataProvider = chartData;\n\t\tchart.categoryField = \"country\";\n\t\tvar graph = new AmCharts.AmGraph();\n\t\tgraph.valueField = \"visits\";\n\t\tgraph.type = \"column\";\n\t\tchart.addGraph(graph);\n\t\tchart.write('statistiques');\n\n\n}", "title": "" }, { "docid": "9d23f6897ae9e870c3f018e60685f23c", "score": "0.5736721", "text": "function mostrarPlantearEje(){ // Cuando toque el boton \"plantear ejercicios\" voy a ver la seccion (plantear tarea a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"block\"; // muestro plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "title": "" }, { "docid": "bc65c022b30c2a4c890e22a6208556f7", "score": "0.573671", "text": "function visualizza() {\n for (let i = 0; i < parola_length; i++) {\n lettere[i].innerHTML = parola_scelta[i];\n if (!trovate[i]) {\n lettere[i].style.transition = \".8s\";\n lettere[i].style.transform = \"translateY(1rem)\";\n lettere[i].style.backgroundColor = \"var(--non-indovinata)\";\n }\n }\n res.style.display = \"none\";\n return false;\n}", "title": "" }, { "docid": "20a84333852796e5df2101814f6ca31e", "score": "0.57335156", "text": "function layoutIntacto(){\n\t// make the links to the previous pages / sgte work like the back / next buttons\n\tif(confBool('overwrite_links', true)){\n\t\ttry{\n\t\t\tvar next = contenido(document.documentElement.innerHTML, getNext, 0);\n\t\t\tvar linksNext = xpath('//*[@href=\"'+next+'\"]', document, true);\n\t\t\tfor(var i=0;i<linksNext.length;i++){\n\t\t\t\tlinksNext[i].href = '#next';\n\t\t\t\tsetEvt(linksNext[i], 'click', btnnext);\n\t\t\t}\n\t\t}catch(e){}\n\t\ttry{\n\t\t\tvar back = contenido(document.documentElement.innerHTML, getBack, 0);\n\t\t\tvar linksBack = xpath('//*[@href=\"'+back+'\"]', document, true);\n\t\t\tfor(var i=0;i<linksBack.length;i++){\n\t\t\t\tlinksBack[i].href = '#back';\n\t\t\t\tsetEvt(linksBack[i], 'click', btnback);\n\t\t\t}\n\t\t}catch(e){}\n\t}\n\n\t// replace the image with the default layout\n\tvar img;\n\tif(layoutElement) img = xpath(layoutElement);\n\telse{\n\t\timg = contenido(document.documentElement.innerHTML, getImagen, 0);\n\t\tvar src = typeof(img)=='string' ? match(img, /src=\"(.+?)\"/i, 1, img) : xpath('@src', img);\n\t\ttry{ img = xpath('//img[@src=\"'+src+'\"]'); }\n\t\tcatch(e){ img = xpath('//img[@src=\"'+decodeURI(src)+'\"]'); }\n\t}\n\n\tvar padre = img.parentNode;\n\tvar div = document.createElement('div');\n\tdiv.innerHTML = layoutDefault;\n\tpadre.insertBefore(div, img);\n\tpadre.removeChild(img);\n\n\t// if I am inside a link, I delete it\n\twhile(padre){\n\t\tif(padre.href){\n\t\t\twhile(padre.childNodes.length) padre.parentNode.insertBefore(padre.childNodes[0], padre);\n\t\t\tpadre.parentNode.removeChild(padre);\n\t\t\tbreak;\n\t\t}\n\t\telse if(padre == document.body) break;\n\t\tpadre = padre.parentNode;\n\t}\n\n\tget('wcr_btnlayout').innerHTML = 'Use Minimalistic Layout';\n}", "title": "" }, { "docid": "cd7fe48230e83240035a6065de90cbe8", "score": "0.57175726", "text": "function _CarregaBotoesVisao() {\n var div_visoes = Dom('div-visoes');\n if (div_visoes == null) {\n // Testes nao possuem o div.\n return;\n }\n for (var visao in tabelas_visoes) {\n var botao_visao = CriaSpan(Traduz(tabelas_visoes[visao].nome), 'span-' + visao, null);\n var handler = {\n visao_handler: visao,\n handleEvent: function(evt) { ClickVisao(this.visao_handler); }\n };\n botao_visao.addEventListener('click', handler);\n div_visoes.appendChild(botao_visao);\n }\n // Aba do modo mestre\n var input_modo_mestre = CriaInputCheckbox(false, 'input-modo-mestre', null);\n input_modo_mestre.addEventListener('change', ClickVisualizacaoModoMestre);\n TituloSimples(Traduz('Modo Mestre'), input_modo_mestre);\n input_modo_mestre.style.paddingBottom = '0';\n //input_modo_mestre.textContent = 'modo-mestre';\n var span_input = CriaSpan();\n span_input.appendChild(input_modo_mestre);\n div_visoes.appendChild(span_input);\n // Aba do Desfazer e Refazer.\n var botao_desfazer = CriaBotao(Traduz('Desfazer'));\n botao_desfazer.style.paddingBottom = '0';\n botao_desfazer.style.marginBottom = '0'\n botao_desfazer.style.marginLeft = '10ch';\n botao_desfazer.addEventListener('click', ClickDesfazer);\n div_visoes.appendChild(botao_desfazer);\n}", "title": "" }, { "docid": "5014a993c3de2c13c338de82e8b14336", "score": "0.5713021", "text": "function visualiserEditeurControls(){\n //\"lbledPays\",\"cboxedPays\",\n var vControles = [\n \"lbledNomEditeur\", \"txtedNomEditeur\",\n \"lbledVille\", \"btnedaddVill\", \"cboxedVill\",\n \"lbledSaveEdit\",\"btnedSaveEdit\"//,\n //\"lbledaddVille\" , \"txtedaddVille\"\n ];\n visualiserControls(\"btnedaddEdit\",vControles,\"cboxedEdit\");\n} // end visualiser", "title": "" }, { "docid": "fbc2263b5c84ab9a6ee11218f4247d33", "score": "0.570957", "text": "function visualiserVilleControls(){\n var vControles = [\"lbledaddVille\",\"txtedaddVille\",\n \"lbledSaveVill\",\"btnedSaveVill\"];\n visualiserControls(\"btnedaddVill\",vControles,\"cboxedVill\");\n} // end visualiser", "title": "" }, { "docid": "f4a3761b6198717817a1a6ca37c849c2", "score": "0.57088494", "text": "function mostrarDevoluciones(){ // Cuando toque el boton \"devoluciones\" voy a ver la seccion (hacer devoluciones)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; // habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto tabla\r\n document.querySelector(\"#divDevoluciones\").style.display = \"block\"; // muestro redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "title": "" }, { "docid": "f40f424f18f2c267cf000a7e3f3c3797", "score": "0.57077336", "text": "function display(resultat) {\n Erase();\n let blocButton = document.createElement(\"restitution\");\n blocButton.innerText = boutonSelectionne;\n document.getElementById(\"restitution\").appendChild(blocButton);\n\n let blocValue = document.createElement(\"restitution\");\n blocValue.innerText = \"Mesure relevée: \" + resultat.type;\n document.getElementById(\"restitution\").appendChild(blocValue);\n\n let blocData = document.createElement(\"restitution\");\n blocData.innerText = resultat.value + \" \" + resultat.unit;\n document.getElementById(\"restitution\").appendChild(blocData);\n\n let blocDate = document.createElement(\"restitution\");\n FormateDate(resultat.measureDate);\n blocDate.innerText = \"date et heure du relevé: \" + dateDisplay;\n document.getElementById(\"restitution\").appendChild(blocDate);\n}", "title": "" }, { "docid": "2457bd30c242fba2c16777e7c7643aad", "score": "0.5704812", "text": "function visVare(snap) {\n const key = snap.key;\n const vare = snap.val();\n\n let index = 4;\n\n let pris = `${vare.Pris}`\n\n allDisplay.innerHTML += `\n <section class=\"productSection\">\n <h1>${vare.Navn}</h1>\n <a href=\"produkt.html?id=${key}&pris=${pris}\"><img src=\"${vare.Bilder[index]}\"></a>\n <p class=\"nyPris\" id=\"egPris\">${pris},-</p>\n <a href=\"produkt.html?id=${key}&pris=${pris}\" class=\"purchaseLink\">Se mer</a>\n </section>\n `;\n}", "title": "" }, { "docid": "d1167b14ef883221e369537dd4a754ef", "score": "0.5702559", "text": "function AffichagePatho(end) {\n \n var i,\n RegExpMeridien = new RegExp(document.getElementById(\"filtreMeridien\").value),\n RegExpType = new RegExp(document.getElementById(\"filtrePatho\").value + document.getElementById(\"filtreCarac\").value);\n\n //Masquage des pathologies que l'on ne souhaite pas afficher\n var nb_patho_page = document.getElementById(\"nb_patho_page\").value,\n nb_bas = nb_patho_page * Page_patho - nb_patho_page,\n nb_haut = nb_patho_page * Page_patho - 1,\n\n patho_correspondant = 0;\n for (i = 0; i < end; i += 1) {\n if (!RegExpMeridien.test(document.getElementById(\"patho\" + i).className)\n || !RegExpType.test(document.getElementById(\"patho\" + i).className)) {\n document.getElementById(\"patho\" + i).style.display = \"none\";\n } else if (patho_correspondant < nb_bas) {\n document.getElementById(\"patho\" + i).style.display = \"none\";\n patho_correspondant += 1;\n } else if (patho_correspondant >= nb_bas && patho_correspondant <= nb_haut) {\n document.getElementById(\"patho\" + i).style.display = \"block\";\n patho_correspondant += 1;\n } else {\n document.getElementById(\"patho\" + i).style.display = \"none\";\n patho_correspondant += 1;\n }\n }\n\n //Affichage du placement dans les pages dans le pager du haut\n nb_bas = nb_patho_page * Page_patho - nb_patho_page + 1;\n nb_haut = nb_patho_page * Page_patho;\n document.getElementById(\"CptPatho\").innerHTML = \"Pathologies \" + nb_bas + \"-\" + nb_haut + \" sur \" + (patho_correspondant);\n}", "title": "" }, { "docid": "c9cd050b644d318f3938918115d828b8", "score": "0.56914747", "text": "function mostrar(){\r\n\tdocument.all.mE1.style.display='none';\r\n\tdocument.all.mE2.style.display='';\r\n\tdocument.getElementById('preV').innerHTML = '<a href=\"javascript:;\" onclick=\"esconder()\" class=\"link_claro\"><br>Esconder miniatura<br></a><br><img onload=\"getSize()\" width=\"200\" src=\"'+escondido+'\" name=\"imgP\" id=\"imgP\">';\r\n\tdocument.getElementById('preVM').innerHTML = '';\r\n}", "title": "" }, { "docid": "4957e385fcbbb3783c96c20eb4203534", "score": "0.5690367", "text": "function VisulizzaAnnunci(Cancella = false){\n let Vetrina = document.querySelector(\"#blocco-vetrina\");\n let ColoreAnnuncio = document.querySelector(\"#colore1\").value;\n let AnnXPagina = (parseInt)(document.querySelector(\"#limite-annunci\").value);\n\n if(Cancella){\n IndiceRicerca = 0;\n let AnnunciDOM = Vetrina.querySelectorAll(\"div\");\n AnnunciDOM.forEach(function(AnnuncioDOM){\n AnnuncioDOM.remove();\n });\n } else {\n IndiceRicerca = (parseInt)(IndiceRicerca + AnnXPagina);\n let MostraAltroDOM = Vetrina.querySelector(\"#mostra-altro\");\n MostraAltroDOM.remove();\n }\n\n // Creiamo attraverso JS l'annuncio\n for(let i=IndiceRicerca; i<((parseInt)(IndiceRicerca)+(parseInt)(AnnXPagina)); i++){\n if(AnnunciRicerca.length <= i) return;\n // Creazione Blocco che contiene l'annuncio\n let ContainerDOM = document.createElement(\"div\");\n ContainerDOM.style.backgroundImage = \"-webkit-linear-gradient(left, #F0F0F0 0%, \"+ColoreAnnuncio+\" 200%)\";\n Vetrina.appendChild(ContainerDOM);\n\n // Inserimento foto annuncio\n let ImmagineDOM = document.createElement(\"div\");\n ImmagineDOM.id = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000IdAnnuncio\"];\n ImmagineDOM.setAttribute(\"onclick\", \"PaginaAnnuncio(this)\");\n ImmagineDOM.className = \"fotografia\";\n if(AnnunciRicerca[i][\"Foto\"] != undefined){\n ImmagineDOM.style.backgroundImage = \"url(\"+AnnunciRicerca[i][\"Foto\"][0]+\")\";\n } else {\n ImmagineDOM.style.backgroundImage = \"url(\"+NO_FOTO+\")\";\n }\n ContainerDOM.appendChild(ImmagineDOM);\n\n // Inserimento Provincia\n let ProvinciaDOM = document.createElement(\"div\");\n ProvinciaDOM.className = \"casella-testo-doppia\";\n ProvinciaDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Comune\"]+\" (\"+AnnunciRicerca[i][\"\\u0000Annuncio\\u0000SiglaProvincia\"]+\")\";\n ContainerDOM.appendChild(ProvinciaDOM);\n\n // Inserimento Categoria\n let CategoriaDOM = document.createElement(\"div\");\n CategoriaDOM.className = \"casella-testo-semplice\";\n CategoriaDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Categoria\"];\n ContainerDOM.appendChild(CategoriaDOM);\n\n // Inserimento Descrizione\n let DescrizioneDOM = document.createElement(\"div\");\n DescrizioneDOM.className = \"casella-descrizione\";\n DescrizioneDOM.innerHTML = \"<i>[Rif: \"+AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Rif\"]+\"]</i></br>\";\n DescrizioneDOM.innerHTML += AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Descrizione\"];\n ContainerDOM.appendChild(DescrizioneDOM);\n\n // Inserimento Contratto\n let ContrattoDOM = document.createElement(\"div\");\n ContrattoDOM.className = \"casella-testo-semplice\";\n ContrattoDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Contratto\"];\n ContainerDOM.appendChild(ContrattoDOM);\n\n // Inserimento Prezzo\n let PrezzoDOM = document.createElement(\"div\");\n PrezzoDOM.className = \"prezzo-annuncio\";\n PrezzoDOM.innerHTML = AnnunciRicerca[i][\"\\u0000Annuncio\\u0000Prezzo\"];\n ContainerDOM.appendChild(PrezzoDOM);\n }\n\n let MostraAltroDOM = document.createElement(\"div\");\n MostraAltroDOM.id = \"mostra-altro\";\n MostraAltroDOM.setAttribute(\"onclick\", \"VisulizzaAnnunci();\");\n MostraAltroDOM.innerHTML = \"Mostra altro\";\n Vetrina.appendChild(MostraAltroDOM);\n}", "title": "" }, { "docid": "3e7be184686cf86ccd43777bb0e30dae", "score": "0.56898844", "text": "function siguientePagina() {\n document.getElementById('pagina1').style.display = 'none';\n document.getElementById('pagina2').style.display = 'block';\n }", "title": "" }, { "docid": "e6cbb66a1dafda49f8d90c84a5ac03c1", "score": "0.5681044", "text": "function renderizaMunicoes(){\n\tmunicoes.forEach(desenhaMunicao);\n\tmunicoesAndam();\n}", "title": "" }, { "docid": "5759665b45776432cc75880faf50f418", "score": "0.56761503", "text": "function mostrarPalabra(){\n \n}", "title": "" }, { "docid": "c68590cbf46edc2d758ffda1cbb83059", "score": "0.56717634", "text": "function visualizarGrafico(chData, item, pregunta) {\n const aData = chData;\n const aLabels = aData[0];\n const aDatasets1 = aData[1];\n const aPromedio = aData[2];\n const aMediana = aData[3];\n const aDesviacion = aData[4];\n let tamanio = 0;\n let texto = \"\";\n for (let data in aDatasets1) {\n let valor = parseInt(aDatasets1[data]);\n tamanio = tamanio + valor;\n }\n texto = texto + \"Cantidad de Estudiantes que respondieron: \" + (tamanio).toString() + \"<br>\";\n if (pregunta == 5 || pregunta == 6) {\n //Promedio\n texto = texto + \"Promedio: \" + (aPromedio).toString() + \"<br>\";\n //Mediana\n texto = texto + \"Mediana: \" + (aMediana).toString() + \"<br>\";\n //Desviacion Estandar\n texto = texto + \"Desviacion estandar: \" + (aDesviacion).toString() + \"<br>\";\n }\n const item_id = \"graf_\" + item;\n document.getElementById(item_id).innerHTML = texto;\n\n const dataT = {\n labels: aLabels,\n datasets: [{\n label: \"Cantidad de Respuestas\",\n data: aDatasets1,\n fill: false,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n };\n const chart_id = \"#pie_chart_\" + item;\n const ctx = $(chart_id).get(0).getContext(\"2d\");\n if (pregunta == 2 || pregunta == 3 || pregunta == 6) {\n const barChart = new Chart(ctx, {\n type: 'pie',\n data: dataT,\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: { xaxes: [{ ticks: { beginAtZero: true } }] },\n legend: { display: true },\n\n },\n })\n } else if (pregunta == 4 || pregunta == 5) {\n const barChart = new Chart(ctx, {\n type: 'horizontalBar',\n data: dataT,\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: { xAxes: [{ ticks: { beginAtZero: true } }] },\n legend: { display: true },\n },\n })\n }\n}", "title": "" }, { "docid": "b9f5ea59ad6bd738809563dffe4c9708", "score": "0.5669832", "text": "function affichePresse(donnees) {\n\tvar HTML = Twig.twig({ href: \"templates/presse.twig.html\", async: false}).render();\t\t\n\t$(\"#content\").html(HTML);\n\t$(\".link-side-nav\").removeClass(\"active\");\n\t$(\".nav-link\").removeClass(\"active\");\n\n\t$(\".social\").addClass(\"none\");\n\n\t$(\".presse\").addClass(\"active\");\n}", "title": "" }, { "docid": "22ae29ebc1e1178d7833e7a819d117b5", "score": "0.5665102", "text": "function visStil() {\n const container = document.querySelector(\"#data_container\");\n const stilTemplate = document.querySelector(\"template\");\n\n container.textContent = \"\";\n\n //her tilføjes indhold fra vores google sheet til DOM i form af en array\n alleStile.feed.entry.forEach(stil => {\n if (filter == \"alle\" || filter == stil.gsx$kategori.$t) {\n let klon = stilTemplate.cloneNode(true).content;\n\n //Dette forkorter lang string så man klikker for at læse mere, men vi ændrede det til at lave en kort tekst i google sheet\n //let str = stil.gsx$lang.$t;\n //let cut = str.slice(0, 45) + \" [...]\";\n //klon.querySelector(\".lang\").textContent = cut;\n\n\n klon.querySelector(\".navn\").textContent = stil.gsx$navn.$t;\n klon.querySelector(\".kort\").textContent = stil.gsx$kort.$t + \" [...]\";\n klon.querySelector(\"img\").src = \"japan_img/imgs/\" + stil.gsx$billede.$t + \".jpg\";\n klon.querySelector(\"img\").alt = \"billede af \" + stil.gsx$navn.$t;\n\n klon.querySelector(\".oversigt\").addEventListener(\"click\", () => {\n location.href = `single.html?id=${stil.gsx$id.$t}`;\n });\n\n container.appendChild(klon);\n }\n });\n}", "title": "" }, { "docid": "dd704c870fed2d035f8ce7a5819df0a6", "score": "0.5664952", "text": "function mostrarIngresar(){ \r\n limpiar();\r\n document.querySelector(\"#auxLanding\").style.display = \"none\"; //Oculto botones de registrar e ingresar\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto el body de la landing page\r\n document.querySelector(\"#registro\").style.display = \"none\"; //Oculto formulario registrar\r\n document.querySelector(\"#ingreso\").style.display = \"block\"; //Muestro el formulario\r\n document.querySelector(\"#pagPrincipal\").style.display = \"block\"; //Muestro pag principal\r\n}", "title": "" }, { "docid": "fd20a572827635ca36c4594c1fbbfb7e", "score": "0.566444", "text": "function mostrarCarrito() {\n // Limpiamos el HTML\n\n limpiarHTML();\n\n // Recorre el carrito y genera el HTML\n\n articulos_carrito.forEach((curso) => {\n const { img, titulo, precio, cantidad, id } = curso;\n\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td>\n <img src=\"${img}\">\n </td>\n\n <td>\n ${titulo}\n </td>\n <td>\n ${precio}\n </td>\n <td>\n ${cantidad}\n </td>\n \n <td>\n <a href='#' class=\"borrar-curso\" data-id=\"${id}\"> X </a>\n </td>\n `;\n\n // Agrega el contenido del carrito en el tbody\n contenedor_carrito.appendChild(row);\n });\n\n // Sincronizamos con el localStorage\n\n sincronizarLocalStorage();\n}", "title": "" }, { "docid": "f96505522a21ccf492f21ab31abc9d23", "score": "0.5661698", "text": "function PrintSeccion() {\n document.getElementsByClassName(\"Print-Seccion\")[0].id = \"Print-chart-seccion\"\n if ($(\"#WebChart\").is(\":visible\")) {\n var chart = document.getElementById(\"WebChart\").getElementsByTagName(\"img\")[0].cloneNode(true)\n } else {\n var chart = document.getElementById(\"WebChart1\").getElementsByTagName(\"img\")[0].cloneNode(true)\n }\n var center = document.createElement(\"center\")\n center.setAttribute(\"id\", \"centerDiv\")\n center.appendChild(chart)\n document.getElementsByClassName(\"Print-Seccion\")[0].appendChild(center)\n chart.style.zIndex = \"10000\"\n $(\"#contenedor-print\").hide()\n $(\"#cssmenu\").hide()\n $(\"header\").hide()\n window.print()\n $(\"#centerDiv\").remove()\n document.getElementsByClassName(\"Print-Seccion\")[0].removeAttribute(\"id\")\n $(\"#contenedor-print\").show()\n $(\"#cssmenu\").show()\n $(\"header\").show()\n}", "title": "" }, { "docid": "d231bef7d8d04bf3e0ca393faf3ad02e", "score": "0.56596327", "text": "function ordenar() {\n //Muestra el gráfico de cargar\n var cargando = '<span><img src=\"images/loader.gif\" id=\"cargando\" /></span>';\n\n $(\"#contenedor\").html(cargando);\n }", "title": "" }, { "docid": "3a9115d84944504a46f9d1fb3980bac6", "score": "0.565847", "text": "function mostrarEstDocente(){ // Cuando toque el boton \"estadisticas\" voy a ver la seccion (ver estadisticas)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"block\"; // muestro visualizar estadisticas\r\n generarListaAlumnos();\r\n}", "title": "" }, { "docid": "c349aea880559a3dfb15bb415c357e2a", "score": "0.56549853", "text": "function Visualizer() {\n return <h1> Visualizer is working </h1> \n}", "title": "" }, { "docid": "b47ed367548ffff3fc7e7dc3abb4256f", "score": "0.5647593", "text": "function displayFacture(){\n\n // Si elle existe déjà, on la détruit\n $(\"#factureDetail\").empty();\n $(\"#factureSomme\").empty();\n\n // Titre\n var titre = document.createElement(\"h2\");\n titre.setAttribute(\"class\", \"w3-center\");\n titre.innerHTML= \"La Livrairie vous remercie !\";\n\n // Si la personne a fournie ses coordonnées, on les affiches (Pas de vérification demandée dans le TP)\n if(coordonnees.nom){\n $(\"#factureCoord\").show();\n $(\"#factureNom\").text(\"Nom : \" + coordonnees.nom);\n $(\"#facturePrenom\").text(\"Prénom : \" + coordonnees.prenom);\n $(\"#factureAdresse\").text(\"Adresse : \" + coordonnees.address);\n }\n\n // On crée les éléments correspondants aux achats\n for(var p in panier){\n $(\"#factureDetail\").append(createFactureElement(panier[p]));\n }\n\n // On crée la zone somme\n var somme = createSumZone(); \n \n // Ajout de la somme\n var list = $(\"#factureSomme\").append(somme);\n\n\n // On affiche\n document.getElementById(\"factureModal\").style.display='block';\n\n // On remplie les montants de la somme\n refreshSomme();\n}", "title": "" }, { "docid": "ce864d7728550d970e72106a5325241a", "score": "0.5641648", "text": "function mostrarDevoluciones() {\n elementos.mensajePanel.addClass('hide');\n elementos.devolucionesTabla.removeClass('hide');\n\n NumberHelper.mascaraMoneda('.mascaraMoneda');\n }", "title": "" }, { "docid": "109ded1eb08308cf5566f16a86d84352", "score": "0.56372076", "text": "function mostrarRegistro (){ \r\n limpiar();\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto el body de la landing page\r\n document.querySelector(\"#auxLanding\").style.display = \"none\"; //Oculto botones de registrar e ingresar\r\n document.querySelector(\"#registro\").style.display = \"block\"; //Muestro solo el formulario\r\n document.querySelector(\"#pagPrincipal\").style.display = \"block\"; //Muestro boton a pag principal\r\n \r\n}", "title": "" }, { "docid": "3aa88d836053717427dea34bb25ef910", "score": "0.5631179", "text": "function renderPrestamo(data, id_prestamo){\n \n var divInfoPrestamoId = `info_pre_${id_prestamo}`;\n const divInfoPrestamo = document.querySelector(`#${divInfoPrestamoId}`);\n divInfoPrestamo.classList.replace(\"hide\",\"show\");\n\n\n divInfoPrestamo.innerHTML =\n\n `<div class=\"prestamo-item view-prestamo-info\">\n <div class=\"\">\n <label for=\"planillaIdPr\">Planilla No.: ${data[0].peticion_pago_id}</label>\n <a id=\"verPlanillaInfo\" href=\"#\" onclick=\"getDataPlanilla(${data[0].id_planilla})\">Ver Planilla</a>\n </div>\n <div class=\"\">\n <label for=\"cedulaPr\">Contratista: ${data[0].cedula}</label>\n </div>\n <div class=\"\">\n <label for=\"descripcionPr\">Razon: ${data[0].detalles}</label>\n </div>\n <div class=\"\">\n <label for=\"estadoPr\">Estado: ${data[0].estado}</label>\n </div>\n <div class=\"\">\n <label for=\"nombrePr\">Nombre: ${data[0].nombre}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido1Pr\">Primer Apellido: ${data[0].apellido1}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido2Pr\">Segundo Apellido: ${data[0].apellido2}</label>\n </div>\n <div class=\"\">\n <label for=\"apellido1Pr\">Monto: ${data[0].monto}</label>\n </div>\n <div class=\"\">\n <label for=\"fecha_creacionPr\">Creada: ${data[0].fecha_creacion}</label>\n </div>\n </div>\n <div class=\"prestamo-item\" id=\"view-info-planilla_${data[0].id_planilla}\"></div>\n `;\n\n\n switch (data[0].estado) {\n\n case \"pendiente\":\n\n divInfoPrestamo.innerHTML +=\n `<div class=\"planilla-item\" id=\"view-info-acciones\">\n <a id=\"verUsuario href=\"#\" onclick=\"cerrarFormularioPrestamo(${id_prestamo})\">Cerrar</a>\n <a id=\"verUsuario href=\"#\" onclick=\"rechazarPrestamo(${id_prestamo})\">Rechazar</a>\n <a id=\"pagarItem\" href=\"#\" onclick=\"autorizarPrestamo(${id_prestamo})\">Aprobar</a>\n \n \n </div>`;\n \n break;\n \n default:\n\n divInfoPrestamo.innerHTML +=\n `<div class=\"planilla-item\" id=\"view-info-acciones\">\n <a id=\"verUsuario href=\"#\" onclick=\"cerrarFormularioPrestamo(${id_prestamo})\">Cerrar</a>\n \n </div>`;\n\n break;\n }\n \n \n }", "title": "" }, { "docid": "c6c0f1a774884aefffa6daecbc4fbea2", "score": "0.5617571", "text": "render() { // permite vc escrever o que vai ser renderizado.\n\t\t// OBS sempre que o JSX for mais de uma linha tem que ser envolvido por parentese\n\t\treturn <PlacarContainer {...dados} />; //ES6 - Repassa as propriedades dados dentro Plcarcontainer\n\t}", "title": "" }, { "docid": "fc311daa2f128e94e19e5686b8b1b677", "score": "0.5612274", "text": "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-start/page-start.html\");\n let css = await fetch(\"page-start/page-start.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n this._pageDom = document.createElement(\"div\");\n this._pageDom.innerHTML = html;\n\n await this._renderReciepts(this._pageDom);\n\n this._app.setPageTitle(\"Startseite\", {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(this._pageDom.querySelector(\"header\"));\n this._app.setPageContent(this._pageDom.querySelector(\"main\"));\n\n this._countDown();\n }", "title": "" }, { "docid": "1a38f62018224ec2d404fb05a139f0c6", "score": "0.56105393", "text": "function visualiserFb(){\n // service pour visualiser facebook\n var url = \"https://www.facebook.com/conservatoireculinaireduquebec/\";\n window.open(url,\"_blank\");\n} // end visualiser pdffeed", "title": "" }, { "docid": "b931864e75452987513368d9f709d1d8", "score": "0.5608547", "text": "function afficheInfos(donnees) {\n\tvar HTML = Twig.twig({ href: \"templates/infos.twig.html\", async: false}).render();\t\t\n\t$(\"#content\").html(HTML);\n\t$(\".link-side-nav\").removeClass(\"active\");\n\t$(\".nav-link\").removeClass(\"active\");\n\n\t$(\".social\").addClass(\"none\");\n\n\t$(\".infos\").addClass(\"active\");\n}", "title": "" }, { "docid": "92b334dd9f048ffee71be2646c03d39e", "score": "0.5602633", "text": "function show_encontrado (Ibanda_encontrada) {\n bandas.forEach(function() {\n var banda_activa = bandas.find(o => o.ID === Ibanda_encontrada.bandId);\n console.log(banda_activa.name + \", perfil encontrado\");\n $(\".clapp .fondo img\").attr(\"src\", banda_activa.imagen);\n $(\".act .name\").html(\"<b>\" + banda_activa.name + \"</b>\").attr(\"href\", \"perfil.html?id=\" + banda_activa.ID);\n });\n }", "title": "" }, { "docid": "7a08165b236dbfcdfbc5a98b1f32cb8e", "score": "0.5600079", "text": "function _drawVisualization() {\n // Create and populate a data table.\n var data = new google.visualization.DataTable();\n data.addColumn('datetime', 'start');\n data.addColumn('datetime', 'end');\n data.addColumn('string', 'content');\n data.addColumn('string', 'group');\n\n var date = new Date(2014, 04, 25, 8, 0, 0);\n\n var loader_text = '<img src=\"/res/qsl/img/loader33x16.png\" width=\"33px\" height=\"16px\"> L-105';\n var inspe_text =\n '<div title=\"Inspection\" class=\"order\">' +\n '<i class=\"fa fa-lg fa-wrench\"></i> ' +\n 'Inspection' +\n '</div>';\n var inspe_start = new Date(date);\n var inspe_end = new Date(date.setHours(date.getHours() + 6));\n\n data.addRow([inspe_start, inspe_end, inspe_text, loader_text]);\n\n var vessl_text =\n '<div title=\"Snoekgracht\" class=\"order\">' +\n '<i class=\"fa fa-lg fa-anchor\"></i> ' +\n 'Snoekgracht' +\n '</div>';\n var inspe_start = new Date(date.setHours(date.getHours() + 6));\n var inspe_end = new Date(date.setHours(date.getHours() + 48));\n\n data.addRow([inspe_start, inspe_end, vessl_text, loader_text]);\n\n // specify options\n var options = {\n width: \"100%\",\n //height: \"300px\",\n height: \"auto\",\n layout: \"box\",\n editable: true,\n eventMargin: 5, // minimal margin between events\n eventMarginAxis: 0, // minimal margin beteen events and the axis\n showMajorLabels: false,\n axisOnTop: true,\n // groupsWidth : \"200px\",\n groupsChangeable: true,\n groupsOnRight: false,\n stackEvents: false\n };\n\n // Instantiate our timeline object.\n that.timeline = new links.Timeline(document.getElementById(that.optio.vva_id_regn));\n\n // Draw our timeline with the created data and options\n that.timeline.draw(data, options);\n }", "title": "" }, { "docid": "c3a3afcfe8b30cf793ac22f697f7f549", "score": "0.5599106", "text": "function afficherLesResultats(){\n\tdocument.getElementById(\"divImage\").style.display = 'none';\n\n\tmvButtons.display=\"none\";\n\n\tmvResultats.title=formatTitle(DIFFICULTE);\n\tmvResultats.score=formatScore(score, MAX_IMAGES);\n\tmvResultats.feedback=formatFeedback();\n\tmvResultats.display=\"block\";\n}", "title": "" }, { "docid": "8823e6399352115bb4393235a61621d3", "score": "0.5595024", "text": "function picusek(x) {\r\n let y = \"#BL\" + x;\r\n x = '#' + x;\r\n\r\n //rucne pohideuje resp poshowuje potrebne kokotiny pretoze na zobrazenie\r\n //mobil big luda sme hideovali divy v celom dokumente skurvenom\r\n\r\n //aka totalna sracka ale funguje to\r\n\r\n $(\"body div\").show();\r\n $(\".mobigLudo\").hide();\r\n\r\n $(\".ludo\").addClass(\"mobileLudo\");\r\n $(\".bengoroKontakt\").hide();\r\n $(\".miniButtony\").hide();\r\n\r\n $(\"#triangel\").hide();\r\n $(\"#triangel2\").hide();\r\n $('.navbar').hide();\r\n $('.pcJazyky').hide();\r\n $('.logo').hide();\r\n $('.bezovyPanel').hide();\r\n $('.popis').hide();\r\n $('.mavbar #menuButton').show();\r\n $('.dlhyOpis').hide();\r\n\r\n $('.pravo').removeClass(\"medzeraNapravo\");\r\n $('.lavo').addClass(\"medzeraNapravo\");\r\n\r\n //vrati logu v mavbare kliknutelnost\r\n $('.mavbar a').attr(\"onclick\", \"scrollni('#page1')\");\r\n\r\n slide(0);\r\n\r\n $(window).scrollTop( $('#page3').offset().top);\r\n\r\n otvoreny = 'nikto';\r\n}", "title": "" }, { "docid": "78d4679a8d65e573ccfc245c6a18abaa", "score": "0.5591557", "text": "function mostrarPaginaPrincipal() {\n $('#fondo').hide();\n $(\"#wrapper\").show();\n}", "title": "" }, { "docid": "31de1503bc0c886da47f2f21eb8688f9", "score": "0.55882484", "text": "function visualisaRepor(idrepor,nombre,idtable,opt,sec)\n{\n //console.log(idrepor+\" \"+nombre+\" \"+idtable+\" \"+opt);\n $('#bntHistorial').hide();\n if (opt == 0) {\n $('#regReport').removeAttr('onclick');\n $('#regReport').removeAttr('href');\n $('#regReport').attr('onclick','procesar_plantilla();');\n $('#regReport').attr('href','#reportes-sec');\n $('#tit_vista_repo').empty();\n $('body #bntHistorial').hide();\n $('body #btnGps').hide();\n $('body #btnPublicar').hide();\n }else\n {\n $('#regReport').removeAttr('onclick');\n $('#regReport').attr('onclick','capturaInfo(\\''+idtable+'\\',\\''+nombre+'\\')');\n $('#tit_vista_repo').empty();\n $('#tit_vista_repo').append('Historial '+nombre);\n }\n $('#listReporteFinal_end ul').empty();\n \n window.db.transaction(function(txt2){\n //console.log(\"select rows.contenido as id, option.contenido as nombre,rows.id_row from jb_dinamic_tables_rows rows, jb_dinamic_tables_option_row option where rows.position=0 and rows.id_reporte=\\'\"+idrepor+\"\\' and rows.id_table=\\'\"+idtable+\"\\' and rows.contenido=option.id;\");\n txt2.executeSql(\"select rows.contenido as id, option.contenido as nombre,rows.id_row from jb_dinamic_tables_rows rows, jb_dinamic_tables_option_row option where rows.position=0 and rows.id_reporte=\\'\"+idrepor+\"\\' and rows.id_table=\\'\"+idtable+\"\\' and rows.contenido=option.id;\",[],function(txt, results){\n //console.log('dinamic_tables_rows ->'+results.rows.length);\n if (results.rows.length == 0) {\n // console.log(\"select * from jb_dinamic_tables_rows where id_reporte=\\'\"+idrepor+\"\\' and id_table=\\'\"+idtable+\"\\'\");\n txt2.executeSql(\"select * from jb_dinamic_tables_rows where id_reporte=\\'\"+idrepor+\"\\' and id_table=\\'\"+idtable+\"\\' limit 1;\",[],function(txt,res){\n for (var i =0; i < res.rows.length; i++) {\n var k = res.rows.item(i);\n //console.log(i+\" \"+k);\n listaVistaHistorial2(nombre,k.id_column,idtable,k.id_row);\n };\n });\n }else\n {\n for (var i = 0; i < results.rows.length; i++) {\n var p = results.rows.item(i);\n listaVistaHistorial(p.nombre,p.id,idtable,p.id_row); \n }\n }\n });\n });\n}", "title": "" }, { "docid": "dbf07835a7a84b3e6ca105a71d87f1ef", "score": "0.5587708", "text": "function anteriorPagina() {\n document.getElementById('pagina2').style.display = 'none';\n document.getElementById('pagina1').style.display = 'block';\n \n \n \n}", "title": "" }, { "docid": "6586000bcf8f488f54a244e855f44921", "score": "0.5577038", "text": "function afficherTableau(){\n\tdocument.getElementById(\"statistiques\").innerHTML=\"<img src='Ressources/Logo.png'/>\";\n}", "title": "" }, { "docid": "3782f7d4eb89fb6a3544228d9f3cb18b", "score": "0.55756104", "text": "function carritoHTML() {\n // Limpiar el HTML\n limpiarHTML();\n\n // Recoore el carrito y genera el HTML\n articulosCarrito.forEach((curso) => {\n const { imagen, titulo, precio, cantidad, id } = curso\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td>\n <img src=\"${imagen}\" width=\"100\">\n </td>\n <td>\n ${titulo} \n </td>\n <td>\n ${precio} \n </td>\n <td>\n ${cantidad} \n </td>\n\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\">X</a>\n </td>\n `;\n // Agrega el HTML del carrito en el body\n contenedorCarrito.appendChild(row);\n });\n}", "title": "" }, { "docid": "f64c955c5b00e51795b398eeb3d5cce4", "score": "0.55728793", "text": "function showPage(n) {\n var i;\n //hide all pages\n var pages = document.getElementsByClassName(\"autobiografia-page\");\n for (i = 0; i < pages.length; i++) {\n pages[i].style.display = \"none\";\n }\n //show the top of the loaded page\n pages[n-1].scrollTo(0,0);\n //load page\n pages[n-1].style.display=\"grid\";\n}", "title": "" }, { "docid": "7ea6cfc3fae667972f4afff8f9d83c4e", "score": "0.5572034", "text": "function convertir(){\n \n \t\n \n\t\tvar countHijos = $('.content-list').children().length - 1; //21\n\t\tvar entran = countHijos / columna; // 3\n\t\tvar entran = parseInt(entran); // 3\n\t\tvar aumentar = ((entran + 1) * columna)-countHijos;\n\t\tvar func = (aumentar / columna)*100;\n\n\t\tif(columna == 1){\n\t\t\t$('.content-list .liunico').css('display', 'none');\n\t\t}else{\n\t\t\t$('.content-list .liunico').css(\"width\", func +\"%\");\n\t\t\tif(countHijos % columna == 0){\n\t\t\t\t$('.content-list .liunico').css('display', 'none');\n\t\t\t}else{\n\t\t\t\t$('.content-list .liunico').css('display', 'block')\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "925eeb71b1aafc0fb3404fb7c295c107", "score": "0.55708903", "text": "static rendered () {}", "title": "" }, { "docid": "925eeb71b1aafc0fb3404fb7c295c107", "score": "0.55708903", "text": "static rendered () {}", "title": "" }, { "docid": "60315684d84330df2798f55d5187771d", "score": "0.55693644", "text": "function abrir(){\n \tvar miVentana = window.open(\"\", \"\", \"width=300, height=200, top=0, left=0\");\n \tmiVentana.document.open();\n \tmiVentana.document.write(\n \t\t\"<!DOCTYPE HTML>\"+\n\t\t\t\"<html>\"+\n\t\t\t\t\"<head>\"+\n\t\t\t\t\t\"<meta charset=\\\"UTF-8\\\">\"+\t\t\t\t\n\t\t\n\t\t\t\t\t\"<title>Ventana de Prueba</title>\"+\n\t\t\t\t\"</head>\"+\n\n\t\t\t\t\"<body>\"+\n\t\t\t\t\t\"<p>Se han utilizado las propiedades:\"+\n\t\t\t\t\t\t\"<ul>\"+\n\t\t\t\t\t\t\t\"<li>height=200</li>\"+\n\t\t\t\t\t\t\t\"<li>width=300</li>\"+\n\t\t\t\t\t\t\"</ul>\"+\n\t\t\t\t\t\"</p>\"+\n\t\t\t\t\"</body>\"+\n\t\t\t\"</html>\"\n \t);\n \tmiVentana.document.close();\n }", "title": "" }, { "docid": "9c33af34fc70f9d5df171a49387d9d9b", "score": "0.55672413", "text": "function afficheProgramme(donnees) {\n\tvar HTML = Twig.twig({ href: \"templates/programme.twig.html\", async: false}).render();\t\t\n\t$(\"#content\").html(HTML);\n\t$(\".link-side-nav\").removeClass(\"active\");\n\t$(\".nav-link\").removeClass(\"active\");\n\n\t$(\".social\").removeClass(\"none\");\n\n\t$(\".programme\").addClass(\"active\");\n}", "title": "" }, { "docid": "43d3da3f5107fb8f2c53557d59bc4d50", "score": "0.5565681", "text": "function t() {\n //$content.css('paddingTop', $pageMaskee.height());\n y.height(h.height()).width(h.width());\n }", "title": "" }, { "docid": "a82aab40eb31f9a6894a2dd4c3748919", "score": "0.5563308", "text": "function start() {\n let dest = document.querySelector(\"#liste\");\n async function getJson() {\n let jsonData = await fetch(\"https://mandalskeawebspace.dk/claude_php/clean_up_spreadsheet.php?id=1zMhslY-hxnX8EoD2tUBJ1woH-8A27lzPwahnchvH2tQ\");\n alleRetter = await jsonData.json();\n\n visRetter();\n\n }\n\n function visRetter() {\n dest.innerHTML = \"\";\n alleRetter.forEach(ret => {\n if (filter == \"alle\" || filter == ret.kategori) {\n let template = `\n <article class=\"ret\">\n <img src=\"retter/${ret.billeder}.jpg\">\n <p>${ret.navn}</p>\n\n </article>\n`;\n dest.insertAdjacentHTML(\"beforeend\", template);\n\n dest.lastElementChild.addEventListener(\"click\", () => {\n console.log(ret.id);\n location.href = \"singleview_nyside.html?id=\" + ret.id;\n });\n\n }\n })\n }\n\n //funktionen visRetter slut\n document.querySelector(\"#tilbage button\").addEventListener(\"click\", () => {\n document.querySelector(\"#singleview\").style.display = \"none\";\n\n\n })\n document.querySelectorAll(\".filter\").forEach(elm => {\n elm.addEventListener(\"click\", filtrering);\n });\n\n\n function filtrering() {\n filter = this.getAttribute(\"data-hold\");\n document.querySelectorAll(\".filter\").forEach(elm => {\n elm.classList.remove(\"valgt\");\n })\n this.classList.add(\"valgt\");\n visRetter();\n }\n\n getJson();\n}", "title": "" }, { "docid": "3331a679141f68aba9ee40ba48d5b313", "score": "0.55624336", "text": "function paginaPrincipal (){\r\n document.querySelector(\"#auxLanding\").style.display = \"block\"; //Muestro nuevamente botones de registro\r\n document.querySelector(\"#bodyHome\").style.display = \"block\"; //Muestro portada de pagina\r\n document.querySelector(\"#h1TitBienvenida\").innerHTML = `Bienvenidos a Escuela De Música`; //reescribo para cuando se ejecute cierre de sesion\r\n document.querySelector(\"#registro\").style.display = \"none\"; //Oculto el formulario\r\n document.querySelector(\"#pagPrincipal\").style.display = \"none\"; //Oculto boton pagina principal\r\n document.querySelector(\"#ingreso\").style.display = \"none\"; //Oculto formulario de ingreso\r\n document.querySelector(\"#homeAlumno\").style.display = \"none\"; //Oculto interfaz alumno\r\n document.querySelector(\"#homeDocente\").style.display = \"none\"; //Oculto interfaz docente\r\n document.querySelector(\"#navAlumno\").style.display = \"none\"; //Oculto nav alumno\r\n document.querySelector(\"#navDocente\").style.display = \"none\"; //Oculto nav docente\r\n document.querySelector(\"#auxUsuario\").style.display = \"none\"; //Oculto div auxiliar de usuarios\r\n}", "title": "" }, { "docid": "cec81780dac41aa06385412b531d582c", "score": "0.5557572", "text": "function show(str){\n //se str==1 (cioè gruppo proteine allora: \n if(str==1){\n //se gli alimenti sono visibili allora metti tutti i gruppi invisibili\n if(coll_proteine.css(\"display\")==\"flex\"){\n coll_carboidrati.css(\"display\",\"none\");\n coll_proteine.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n //altrimenti (quindi nel caso in cui il gruppo di aliemnti delle proteine non era visibilie)\n //lo metti visibile e metti tutti gli altri a non visibili\n else{\n coll_proteine.css(\"display\",\"flex\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n }\n //stesso ragionamento di sopra ma riguardo agli alimenti del gruppo CARBOIDRATI\n if(str==2){\n if(coll_carboidrati.css(\"display\")==\"flex\"){\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n else{\n coll_carboidrati.css(\"display\",\"flex\");\n coll_proteine.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n }\n if(str==3){\n if(coll_grassi.css(\"display\")==\"flex\"){\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n else{\n coll_grassi.css(\"display\",\"flex\");\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n } \n if(str==4){\n if(coll_calorie.css(\"display\")==\"flex\"){\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n coll_calorie.css(\"display\",\"none\");\n }\n else{\n coll_calorie.css(\"display\",\"flex\");\n coll_proteine.css(\"display\",\"none\");\n coll_carboidrati.css(\"display\",\"none\");\n coll_grassi.css(\"display\",\"none\");\n }\n } \n}", "title": "" }, { "docid": "3c8df68fd440a9b17c55b8370ff31eaf", "score": "0.5553594", "text": "function visualizar_info_oi(id) {\n visualizar_facturacion(id);\n id_oi = id;\n $.ajax({\n url: \"consultar_orden/\",\n type: \"POST\",\n dataType: 'json',\n data: {\n 'id':id,\n 'csrfmiddlewaretoken': token\n },\n success: function (response) {\n //datos de la orden interna\n var data = JSON.parse(response.data);\n data = data.fields;\n //datos de las muestras\n var muestras = JSON.parse(response.muestras);\n //datos del usuario\n var usuario = JSON.parse(response.usuario);\n usuario = usuario.fields;\n //datos del solicitante\n if(response.solicitante != null){\n var solicitante = JSON.parse(response.solicitante);\n solicitante = solicitante.fields;\n }\n var analisis_muestras = response.dict_am;\n var facturas = response.facturas;\n var dhl = response.dict_dhl;\n var links = response.links;\n var fechas = response.fechas;\n //pestaña de información\n $('#titulov_idOI').text(\"Orden Interna #\" + id);\n $('#visualizar_idOI').val(id);\n $('#visualizar_estatus').val(data.estatus);\n $('#visualizar_localidad').val(data.localidad);\n $('#visualizar_fecha_recepcion_m').val(data.fecha_recepcion_m);\n $('#visualizar_fecha_envio').val(data.fecha_envio);\n $('#visualizar_fecha_llegada_lab').val(data.fecha_llegada_lab);\n $('#visualizar_pagado').val(data.pagado);\n $('#visualizar_link_resultados').val(data.link_resultados);\n $('#visualizar_usuario_empresa').text(response.empresa);\n var n = usuario.nombre + \" \" + usuario.apellido_paterno + \" \" + usuario.apellido_materno;\n $('#visualizar_usuario_nombre').text(n);\n $('#visualizar_usuario_email').text(response.correo);\n $('#visualizar_usuario_telefono').text(response.telefono);\n\n //pestaña de observaciones\n $('#visualizar_idioma_reporte').text(data.idioma_reporte);\n\n var html_muestras = \"\";\n if(muestras != null){\n for (let mue in muestras){\n var id_muestra = muestras[mue].pk;\n var objm = muestras[mue].fields;\n\n html_muestras+= build_muestras(id_muestra, objm,analisis_muestras[id_muestra], facturas[id_muestra], dhl, links, fechas);\n }\n }\n $('#muestras-body').html(html_muestras);\n $('#v_observaciones').val(data.observaciones);\n if(!$(\"#factura-tab\").hasClass(\"active\")){\n restaurar_editar();\n }\n else{\n doble_editar();\n }\n }\n })\n}", "title": "" }, { "docid": "f393b3797d27e42c2d826ca7c2f30ee8", "score": "0.5551499", "text": "function solucioPanell( numpagines )\r\n {\r\n \t// creem fons de motor\r\n \tthis.fons = new createjs.Shape();\r\n \tthis.fons.graphics.beginFill(\"#0D3158\").drawRect(0, 0, 950, 51);\r\n \t// creem contenidor\r\n \tthis.contenedor = new createjs.Container();\r\n \tthis.contenedor.x = 0;\r\n\tthis.contenedor.y = 558;\r\n\t// configuremm dades de paginació\r\n\tthis.currentPag= Motor.currentNumPag;\r\n\tthis.numPagines = numpagines;\r\n \t//creem botons del panell\r\n \tthis.reintentar = new Boton( 146, 29, pppPreloader.from(\"module\", 'motor/images/btnRestaurar.png'), LangRes.lang[ LangRes.REINTENTAR ],\"left\");\r\n \tthis.solucio = new Boton( 148, 29, pppPreloader.from(\"module\", 'motor/images/btnSolucio.png'), LangRes.lang[ LangRes.SOLUCION ],\"left\");\r\n \t\r\n \tthis.solucio.contenedor.x = 786;\r\n \tthis.solucio.contenedor.y = 12;\r\n \t\r\n \tthis.reintentar.contenedor.x = 15; \r\n \tthis.reintentar.contenedor.y = 12;\r\n \t// afegim components al contenidor principal\r\n \tthis.contenedor.addChild( this.fons );\r\n \tthis.contenedor.addChild( this.text );\r\n \tthis.contenedor.addChild( this.solucio.contenedor );\r\n \t\r\n \tif( Scorm.modo != Scorm.MODO_REVISAR )\r\n \t\tthis.contenedor.addChild( this.reintentar.contenedor );\r\n \t\r\n \t\r\n \tthis.pagines =\"\";\r\n\r\n\tif( this.numPagines > 1 ){ // si tenim més d'una pagina mostrem la paginacio\r\n \t\t//creem paginador\r\n \t\tthis.pagines = new Paginador(this.numPagines);\r\n \t\tthis.pagines.contenedor.x =315;\r\n \t\tthis.pagines.contenedor.y = 11;\r\n \t\t// creem boto seguent pagina\r\n \t\tthis.seguent = new Boton(144,28,pppPreloader.from(\"module\", 'motor/images/btnSeguent.png'), LangRes.lang[ LangRes.SIGUIENTE ],\"left\");\r\n \t\tthis.seguent.contenedor.x = 285 + this.numPagines*31 + 40; \r\n \t\tthis.seguent.contenedor.y = 12;\r\n \t\t// afegim components a contenidor principal\r\n \t\tthis.contenedor.addChild( this.pagines.contenedor );\r\n \t\tthis.contenedor.addChild( this.seguent.contenedor );\r\n \t\t//seleccionem pagina actual\r\n \t\tthis.pagines.pags[this.currentPag].state(\"select\"); \r\n \t\tif(this.currentPag == this.numPagines - 1) this.seguent.contenedor.visible = false;\r\n \t}\r\n \t//posem contenidor al canvas amb transició\r\n \tMain.stage.removeChild(Contenedor.missatge.contenedor);\r\n\tMain.stage.addChild( this.contenedor );\r\n\tthis.contenedor.alpha =0;\r\n\tcreatejs.Tween.get(this.contenedor).to({alpha:1}, 1250, createjs.Ease.circOut);\r\n\t\r\n\tif(this.numPagines > 1)\r\n \t{\r\n \t\t//validació de estat de pagina (correcte / incorrecte)\r\n\t\tthis.validaPags();\r\n\t\t// seleccionem pagina actual\r\n\t\tthis.selectPag(this.currentPag+1);\r\n\t}\r\n }", "title": "" }, { "docid": "df4614713883044397289e3f6e3f8051", "score": "0.5549971", "text": "function ClickVisao(modo) {\n // Loop para esconder tudo.\n for (var j = 0; j < tabelas_visoes[modo].esconder.classes.length; ++j) {\n var divs_esconder = DomsPorClasse(tabelas_visoes[modo].esconder.classes[j]);\n for (var i = 0; i < divs_esconder.length; ++i) {\n divs_esconder[i].style.display = 'none';\n }\n }\n for (var i = 0; i < tabelas_visoes[modo].esconder.elementos.length; ++i) {\n var divs_combate = Dom(tabelas_visoes[modo].esconder.elementos[i]);\n divs_combate.style.display = 'none';\n }\n // Loop para mostrar.\n for (var j = 0; j < tabelas_visoes[modo].mostrar.classes.length; ++j) {\n var divs_mostrar = DomsPorClasse(tabelas_visoes[modo].mostrar.classes[j]);\n for (var i = 0; i < divs_mostrar.length; ++i) {\n divs_mostrar[i].style.display = 'block';\n }\n }\n for (var i = 0; i < tabelas_visoes[modo].mostrar.elementos.length; ++i) {\n var divs_combate = Dom(tabelas_visoes[modo].mostrar.elementos[i]);\n divs_combate.style.display = 'block';\n }\n gEntradas.modo_visao = modo;\n AtualizaGeralSemLerEntradas();\n}", "title": "" }, { "docid": "ef096ad2d87a5ac8c65a290292eafb95", "score": "0.55490816", "text": "RenderDeviceElectrovannePage(){\n // Clear view\n this._DeviceConteneur.innerHTML = \"\"\n // Clear Menu Button\n this.ClearMenuButton()\n // Add Back button in settings menu\n NanoXAddMenuButtonSettings(\"Back\", \"Back\", IconModule.Back(), this.RenderDeviceStartPage.bind(this))\n // Conteneur\n let Conteneur = NanoXBuild.DivFlexColumn(\"Conteneur\", null, \"width: 100%;\")\n // Titre\n Conteneur.appendChild(NanoXBuild.DivText(\"Electrovannes\", null, \"Titre\", null))\n // Add all electrovanne\n if (this._DeviceConfig != null){\n // Add all electrovanne\n this._DeviceConfig.Electrovannes.forEach(Electrovanne => {\n Conteneur.appendChild(this.RenderButtonAction(Electrovanne.Name, this.ClickOnElectrovanne.bind(this, Electrovanne), this.ClickOnTreeDotsElectrovanne.bind(this, Electrovanne)))\n });\n } else {\n // Add texte Get Config\n Conteneur.appendChild(NanoXBuild.DivText(\"No configuration get from device\", null, \"Texte\", \"margin: 1rem;\"))\n }\n // Button back\n let DivButton = NanoXBuild.DivFlexRowSpaceAround(null, \"Largeur\", \"\")\n DivButton.appendChild(NanoXBuild.Button(\"Back\", this.RenderDeviceStartPage.bind(this), \"Back\", \"Button Text WidthButton1\", null))\n Conteneur.appendChild(DivButton)\n // add conteneur to divapp\n this._DeviceConteneur.appendChild(Conteneur)\n // Espace vide\n this._DeviceConteneur.appendChild(NanoXBuild.Div(null, null, \"height: 2rem;\"))\n }", "title": "" }, { "docid": "24f479dc6000892aa0359f1903aebf44", "score": "0.55475044", "text": "function mostrarPagarMulta() {\n ocultarFormularios();\n formPagarMulta.style.display = \"block\";\n}", "title": "" }, { "docid": "8a22236f28efd399214ec52a11408a0d", "score": "0.554649", "text": "function visVare(snap) {\n const key = snap.key;\n const vare = snap.val();\n\n let index = 4; // Tilfeldig farge er teit - Math.floor(Math.random() * 5);\n let rabatt = 1 - (Math.floor(Math.random() * 15) / 20);\n let orginalPris = `${vare.Pris}`\n let prisDecider = `${vare.Pris}` * rabatt;\n let pris = Math.round(prisDecider);\n\n\n if (orginalPris == pris) {\n pris *= 0.9;\n }\n\n\n display.innerHTML += `\n <section class=\"productSection\">\n <h1>${vare.Navn}</h1>\n <a href=\"produkt.html?id=${key}&pris=${pris}\"><img src=\"${vare.Bilder[index]}\"></a>\n <p class=\"strikeThrough\">Før ${orginalPris},-</p>\n <p class=\"nyPris\">${pris},-</p>\n <a href=\"produkt.html?id=${key}&pris=${pris}\" class=\"purchaseLink\">Se mer</a>\n </section>\n `;\n}", "title": "" }, { "docid": "b09b396dfb1b2b961c7b04e7e06694b5", "score": "0.5544278", "text": "function renderizarGrafico(elemento,logaritmico){\n var options = {\n chart: {type: 'line',toolbar:{show:false}},\n xaxis: {categories: [\"0\"]},\n yaxis: {labels:{style:{fontsize:'0.5 em',}},logarithmic:logaritmico,forceNiceScale: true},\n series: elemento,\n labels: [\"Argentina\", \"otro pais\",\"sdf\",\"asdas\"],\n responsive: [{breakpoint: 1025,options :{chart: {height:\"100%\"}}}],\n stroke: {width:3},\n fill: {type:'gradient'}\n }\n var chart = new ApexCharts(document.querySelector(\"#chart\"), options);\n chart.render();\n}", "title": "" }, { "docid": "f1a4ebf66a33ff7424ebdeda3edf8fdf", "score": "0.55366933", "text": "function crearEx6() {\n sliderViatge();\n filtrarViatge();\n}", "title": "" }, { "docid": "79b2fbaf3ccc042dd435925fac09c1f0", "score": "0.5536049", "text": "function showFirmantes(pagina,width,height) {\r\n return window.open(pagina, \"WebDocuments\", \"resizable=no,scrollbars=yes,statusbar=yes,width=\"+width+\",height=\"+height+\",left=115,top=50\");\r\n }", "title": "" }, { "docid": "70101d15aa751cc3eaa4a291a55b33ac", "score": "0.5535654", "text": "function mostrarFacturas() {\n console.log(\"Historial de ventas: Lista de facturas\");\n $(\"#lista-facturas\").html(\"\");\n}", "title": "" }, { "docid": "6a49c6d4409f2475bcb385e9d37fc476", "score": "0.5533862", "text": "function generaGrafica(ejercicios)\n{\n\tvar nBarras = Object.keys(ejercicios).length;\n\t//nBarras = 7;\n\tvar wPadre = nBarras*20;\n\tvar wHijo = 100/nBarras;\n\t\n\tvar resultado = \"<div style='width:80%; overflow-x:auto; overflow-y:hidden; margin-left:10%; margin-top:10%; text-align:left;'><div class='grafica' style='width:\"+wPadre+\"%'>\";\n\t\n\t$.each(ejercicios,function(i,ejercicio)\n\t{\n\t\tswitch(ejercicio['ritmo'])\n\t\t{\n\t\t\tcase '1':\n\t\t\t\tresultado += \"<div class='intensidad1' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\tresultado += \"<div class='intensidad2' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t\tresultado += \"<div class='intensidad3' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\tresultado += \"<div class='intensidad4' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\tresultado += \"<div class='intensidad5' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak; \n\t\t\tdefault:\n\t\t\t\tresultado += \"algo salio mal\";\n\t\t\tbreak\n\t\t}\n\t});\n\t\n\tresultado += \"</div></div>\";\n\t\t\n\t//resultado = \"<div style='width: 80%; overflow-x: scroll; overflow-y: hidden; margin-left:10%;'><div class='grafica' style='width:\"+wPadre+\"%'><div class='intensidad1' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad2' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad3' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad2' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad4' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad5' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad1' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div></div></div>\";\n\t\n\treturn resultado;\n}", "title": "" }, { "docid": "b0d626388b823bd83bf30cd522d353cc", "score": "0.55313104", "text": "mostrarPagina(nombrePagina, id_escuderia) {\n this.paginaVacia();\n this.barraNavegacion();\n\n if (nombrePagina == \"CLASIFICACION CONSTRUCTORES\") {\n rellenarTablaClasificacionEscuderias();\n crearTablaClasificacionEscuderias();\n\n } else if (nombrePagina == \"CLASIFICACION PILOTOS\") {\n rellenarTablaClasificacionPilotos();\n crearTablaClasificacionPiloto();\n\n } else if (nombrePagina == \"HOME\") {\n paginaHome();\n\n } else if (nombrePagina == \"ESCUDERIAS\") {\n mostrarEscuderias();\n\n } else if (nombrePagina == \"CIRCUITOS\") {\n mostrarCircuits();\n\n } else if (nombrePagina == \"LOGOUT\") { //Login\n this.logout();\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n } else if (nombrePagina == \"Login\") { //Login\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n //SUB PAGiNES\n } else if (nombrePagina == \"ESCUDERIA-2\") { //Mostrar els pilotos\n mostrarPilotosDeXEscuderia(id_escuderia);\n \n } else if (nombrePagina == \"NUEVO CIRCUITO\") { //Añadir nou circuit\n formularioCircuito();\n\n } else if (nombrePagina == \"NUEVO PILOTO\") { //Añadir nou piloto\n formularioPiloto();\n \n } else if (nombrePagina == \"SIMULAR CARRERA\") { //Simular carrera\n simularCarrera();\n crearSimulacioClasificacionPiloto();\n }\n\n\n\n this.piePagina();\n\n console.log(nombrePagina);\n }", "title": "" }, { "docid": "171502d3cb05a1de273c63a306e22429", "score": "0.5528255", "text": "function mostrar() {\n document.getElementById('oculto').style.display = 'block';\n}", "title": "" }, { "docid": "c071f51796bcd82e5f74896ef2aa9583", "score": "0.5526729", "text": "handleVisualize() {\n const { selectedBrowserAssembly } = this.getSelectedAssemblyAnnotation();\n visOpenBrowser(this.props.context, this.state.currentBrowser, selectedBrowserAssembly, this.state.selectedBrowserFiles, this.context.location_href);\n }", "title": "" }, { "docid": "4b140af59e5bba689b1cc3d417d6a062", "score": "0.5517345", "text": "constructor(){\n this.lamaService = new LamaService();\n this.createlamaview = new CreateLamaView(this);\n this.listlamaview = new ListLamaView(this);\n this.listlamaview.drawLamas(this.lamaService.getLamas());\n }", "title": "" }, { "docid": "c2ee7f8f4d78660aea6eb5652e48d8bf", "score": "0.5504715", "text": "function dibujarVacas(){\n papel.drawImage(vaca, 15, 25)\n}", "title": "" }, { "docid": "d5f38a3de0c27f44c4eb6d329f3de355", "score": "0.5482236", "text": "function filtraDias() {\n\t\t\tif($(\"#tab-seg\").find(\".Segunda-Feira\")){\n\t\t\t\t$(\"#tab-seg .Segunda-Feira\").show()\n\t\t\t}\n\t\t\tif($(\"#tab-ter\").find(\".Terca-Feira\")){\n\t\t\t\t$(\"#tab-ter .Terca-Feira\").show()\n\t\t\t}\n\t\t\tif($(\"#tab-qua\").find(\".Quarta-Feira\")){\n\t\t\t\t$(\"#tab-qua .Quarta-Feira\").show()\n\t\t\t}\n\t\t\tif($(\"#tab-qui\").find(\".Quinta-Feira\")){\n\t\t\t\t$(\"#tab-qui .Quinta-Feira\").show()\n\t\t\t}\n\t\t\tif($(\"#tab-sex\").find(\".Sexta-Feira\")){\n\t\t\t\t$(\"#tab-sex .Sexta-Feira\").show()\n\t\t\t}\n\t\t\tif($(\"#tab-sab\").find(\".Sabado\")){\n\t\t\t\t$(\"#tab-sab .Sabado\").show()\n\t\t\t}\n\t\t\tif($(\"#tab-dom\").find(\".Domingo\")){\n\t\t\t\t$(\"#tab-dom .Domingo\").show()\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "940a76312182219105606f719cd969f0", "score": "0.5482091", "text": "function inicializarResultados() {\n\t\t\n\t\t$('.jqgrow').attr('addbl','true');\n\t\t\n\t\t$('.jqgrow').click(function(){\n\t\t\tif(!$(\"#\"+sel).attr('confl')){\n\t\t\t\tagregarCursoCalendar(null, false, $(this));\n\t\t\t\tagregarCursoHorario(resultados[$(this).attr('ie')]);\n\t\t\t}\n\t\t});\n\t\t\n\t\t$('.jqgrow').hover(function() {\n\t\t\tsel = $(this).attr('id');\n\t\t\tif(verificarConflictoHorario(resultados[$(this).attr('ie')])){\n\t\t\t\tagregarCursoCalendar(null, true, $(this));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\"#\"+sel).attr('confl','true');\n\t\t\t\t$(\"#\"+sel).css({'background':'#E42217','opacity': 0.9});\n\t\t\t}\n\t\t}, function() {\n\t\t\tif(!$(this).attr('out'))\n\t\t\t{\n\t\t\t\t$(\"#\"+sel).removeAttr('confl');\n\t\t\t\t$(\"#\"+sel).css({'background':'', 'opacity':1});\n\t\t\t\tremoverCursoCalendar(true, false, $(this).attr('ie'), resultados[$(this).attr('ie')].ocurrencias.length);\n\t\t\t}\n\t\t\t\t\n\t\t});\n\n\t\t$('.jqgrow').poshytip({\n\t\t\tcontent : contenidoTTip,\n\t\t\tclassName : 'tip-twitter',\n\t\t\tshowTimeout : 500,\n\t\t\talignTo : 'cursor',\n\t\t\talignX : 'center',\n\t\t\toffsetY : 20,\n\t\t\tallowTipHover : false,\n\t\t\tfade : false,\n\t\t\tslide : true\n\t\t});\n\t}", "title": "" }, { "docid": "7d910d2e69d4afc7ecee481df4f93ceb", "score": "0.5481533", "text": "function MostrarContadores() {\n\tvar div = document.getElementById(\"mostrarcontador\");\n\tdiv.innerHTML = \"\";\n\n\tvar TitleTotalArticles = document.createElement(\"h4\");\n\tvar TitlePriceWithoutIVA = document.createElement(\"h4\");\n\tvar TitleTotalPrice = document.createElement(\"h4\");\n\n\tvar cont1 = 0;\n\tvar cont2 = 0;\n\tvar TotalArticulos = 0;\n\tvar Totalprecio = 0;\n\tvar PrecioSinIva = 0;\n\n\t//Con esto mostramos el total de articulos en nuestro carrito.\n\tfor (x of carritocompra.cantidades) {\n\t\tx = parseInt(x);\n\t\tTotalArticulos += x;\n\t}\n\n\tcarritocompra.items.forEach(element => {\n\t\telement.precio = parseInt(element.precio);\n\t\tTotalprecio += (element.precio * carritocompra.cantidades[cont2]);\n\t\tcont2++;\n\t});\n\n\t// Esta parte del codigo es para sacar los precios sin iva\n\tcarritocompra.items.forEach(element => {\n\t\telement.precio = parseInt(element.precio);\n\t\telement.iva = parseInt(element.iva);\n\t\tPrecioSinIva += (element.precio * carritocompra.cantidades[cont1]) - (((element.precio * element.iva) / 100) * carritocompra.cantidades[cont1]);\n\t\tcont1++;\n\t});\n\n\tTitleTotalArticles.appendChild(document.createTextNode(\"Artículos en tu carrito: \" + TotalArticulos));\n\tTitlePriceWithoutIVA.appendChild(document.createTextNode(\"Precio sin IVA: \" + PrecioSinIva + \"€\"));\n\tTitleTotalPrice.appendChild(document.createTextNode(\"Precio total a pagar: \" + Totalprecio + \"€\"));\n\n\tdiv.appendChild(TitleTotalArticles);\n\tdiv.appendChild(TitlePriceWithoutIVA);\n\tdiv.appendChild(TitleTotalPrice);\n}", "title": "" }, { "docid": "b3a133d4348e889e30e84cbf69fae185", "score": "0.548002", "text": "function displayCarear() {\n leftbar.empty();\n SubBtnGenerator(carearTopics);\n}", "title": "" }, { "docid": "d43aa033277155a6727e5435c6e95f3a", "score": "0.5479819", "text": "rendering(){\n let renderPlace = \"\";\n let count = 0;\n place.innerHTML = renderPlace;\n slides.forEach((slide)=>{\n count++\n if(slide.tipe == \"teks\"){\n renderPlace += textRender(slide,count);\n place.innerHTML = renderPlace;\n }\n else if(slide.tipe == \"gambar\"){\n renderPlace +=gambarRender(slide,count);\n place.innerHTML = renderPlace;\n }else{\n place.innerHTML = renderPlace;\n }\n loadFile.hapusBtn();\n });\n }", "title": "" } ]
e6eedbb2104ec1e99a492335298eb513
Converts points to inches.
[ { "docid": "032951d8b61be6f6e981c6cb61323e88", "score": "0.80317694", "text": "function pointsToInches(p)\n{\n var inches = p / 72;\n return inches;\n}", "title": "" } ]
[ { "docid": "a1e135574622a477af0be1bcfd7069b7", "score": "0.8197957", "text": "function points(inches) {\n return inches * 72;\n}", "title": "" }, { "docid": "a1e135574622a477af0be1bcfd7069b7", "score": "0.8197957", "text": "function points(inches) {\n return inches * 72;\n}", "title": "" }, { "docid": "e6d7a24ebed0dbb02995bcf9f2a8c87b", "score": "0.78001034", "text": "function in2Pts(inches)\n{\n var ppi = 72; // points per inch\n return ppi * inches;\n}", "title": "" }, { "docid": "8e86088e79af2179ab314f01e95a6bc9", "score": "0.7733808", "text": "function inchesToPoints(i)\n{\n var points = i * 72;\n return points;\n}", "title": "" }, { "docid": "ee3eb318d931d10b1495ec5aa34d0f40", "score": "0.6816029", "text": "function StepsToInches(Steps) {\n\treturn Steps * 22.5;\n}", "title": "" }, { "docid": "df17f915e8b840c160247dfb2d81d395", "score": "0.67089564", "text": "function feetToinches(feet){\n\treturn (feet*12) + \"\\u2033\";\n}", "title": "" }, { "docid": "5520e5adf795d2f66d9e730a93c665ba", "score": "0.66851383", "text": "function metersToInches(meters, inches) {\n return meters * inches;\n}", "title": "" }, { "docid": "43019c7de8f0ce901ad7dfc801997f85", "score": "0.6640857", "text": "function convertFeetToInches(feet) {\n return feet * 12;\n }", "title": "" }, { "docid": "db5ce06c33d83679b321fa79ef34d896", "score": "0.65962785", "text": "function inchesTofeet(inches){\n\treturn (inches/12) + \" ft\";\n}", "title": "" }, { "docid": "468a33df4270452e0e7cdf4998c9a64f", "score": "0.6523545", "text": "function inchToFeet(inches){\n var feet= inches/12;\n return feet;\n }", "title": "" }, { "docid": "5c45595c91587bf5fdfb8d4c10cb3644", "score": "0.6481159", "text": "function feetToInches(feet) {\n var inchesnumbers = feetnumbers * 12;\n return inchesnumbers;\n}", "title": "" }, { "docid": "276afc364ccaba082499f61c08874da7", "score": "0.6475756", "text": "function inchToCm(inches){ // regular function\n const cm = inches * 2.54;\n return cm;\n}", "title": "" }, { "docid": "e177994694dd153799a1358c29e56f6d", "score": "0.64612657", "text": "function inchesToMM(inches) {\n return inches * inchmm_conversion;\n}", "title": "" }, { "docid": "cb06b25498b79e0394ed8f7ec2976e58", "score": "0.6440919", "text": "function milesToInches(mile) {\n return 63360 * mile;\n}", "title": "" }, { "docid": "8e4a59c0ce6cbb074b0570c318356b98", "score": "0.64338064", "text": "function metersToInches(num){\n return num * 39.3701\n}", "title": "" }, { "docid": "7386e2ce8e15822f37ca3e9500dcdf4c", "score": "0.6373196", "text": "function convertToInches() {\n for (var prop in eQ) {\n\n }\n}", "title": "" }, { "docid": "ab7537490d3be2e7ced12c626c72b015", "score": "0.6325813", "text": "function feetInchToCm() {\n // Convert feet input to inches and convert to number type\n feetToInches = heightFeet.value * 12;\n\n // Combine feet input and inches input together to get total inches\n totalInches = Number(feetToInches) + Number(heightInches.value);\n inchesToCm = totalInches * 2.54;\n}", "title": "" }, { "docid": "3779ddf7cc39492bd3fddf0b51e52587", "score": "0.6268637", "text": "function convertToInch(distance) {\n return distance * 39.37;\n}", "title": "" }, { "docid": "bf3bfabfb014dc89b43bb0edc7377623", "score": "0.62628525", "text": "function CmToInch (c) {\n return c / 2.54;\n}", "title": "" }, { "docid": "0e8013c2471990e7ba0d2acd87f797cb", "score": "0.6149928", "text": "function inchToFeet(inch){\n let feet = inch/12;\n return feet;\n }", "title": "" }, { "docid": "20d7409000fefacd2daf52920f40da0e", "score": "0.6046644", "text": "function inchesToyards(inches){\n\treturn (inches/36) + \" yd\";\n}", "title": "" }, { "docid": "ae7dddcdab0ba53745634c123b7c2c40", "score": "0.6002728", "text": "function convert(feet) {\n let cm = feet * 30.48;\n return cm;\n}", "title": "" }, { "docid": "89d9fa6f100671fdd66b8ffb067e6aac", "score": "0.5986342", "text": "function cmConverter(feet) {\n return feet * 30.48; // 30.48cm in 1 feet\n}", "title": "" }, { "docid": "1164eee3da8e2dcff8072f1e73aab3e2", "score": "0.5949791", "text": "function inch () {\n let inputInch = document.getElementById(\"input-inch\").value;\n let feet = Math.floor(inputInch / 12);\n let inches = inputInch % 12;\n inches = inches.toFixed(2)\n document.getElementById(\"result-inch\").innerHTML =\n inputInch + \" is \" + feet + \" feet and \" + inches + \" inches.\";\n}", "title": "" }, { "docid": "adb10f7c02f5980a656e7b79940c2f0d", "score": "0.58866674", "text": "static get unitsPerInch() {\n var rv = {};\n\n rv['pt']=72.0;\n rv['px']=96.0;\n rv['em']=6.0;\n return rv;\n }", "title": "" }, { "docid": "5a595a573016f9eb8257c755af9c621b", "score": "0.5856949", "text": "function mbarToInches (pressure) {\n return pressure * 0.029530\n }", "title": "" }, { "docid": "e32d3aa7352e08064feefd4032aa5293", "score": "0.5850163", "text": "static feetToInches(feet){\n var footString = feet.toString();\n if(footString.includes('.')){\n console.log('Value Entered: ' + feet)\n var partialFoot = footString.slice(footString.indexOf('.')+1)\n console.log('partial foot: ' + partialFoot)\n var partialFootInches = () => {\n if(partialFoot.length == 1)\n return Math.ceil((partialFoot * 12)/10)\n else if(partialFoot.length == 2)\n return Math.ceil((partialFoot *12)/100)\n else{\n return Math.ceil((partialFoot.slice(0,2) * 12)/100)\n }\n }\n console.log('partial foot inches: ' + partialFootInches())\n var wholeFeet = feet - footString.slice(footString.indexOf('.'))\n console.log('Whole Feet: ' + wholeFeet)\n var inches = wholeFeet * 12\n console.log('inches from whole feet: ' + inches)\n\n return inches + partialFootInches()\n }\n else{\n return feet * 12\n }\n\n\n\n\n\n\n }", "title": "" }, { "docid": "67cfeb9d05ffe99276d0abf028ffae63", "score": "0.5817948", "text": "function inchestofoot(inches) {\n var foot = inches / 12;\n return foot;\n}", "title": "" }, { "docid": "bb74e0478f6ffab55bf23d4690666bb4", "score": "0.570628", "text": "function yardsToinches(yards){\n\treturn (yards * 36) + \"\\u2033\";\n}", "title": "" }, { "docid": "fec2c43c00f9ae5ac6c1ccdaf447dca3", "score": "0.56771874", "text": "function heightToMetric(feet, inches) {\n const feetInches = feet * 12;\n const totalInches = feetInches + Number(inches);\n return Math.round(totalInches * 2.54);\n}", "title": "" }, { "docid": "f375ea9a4b4d5a0ef78fbd9a60adafd9", "score": "0.5652696", "text": "integerize() {\n return new Point(\n Math.floor(this.x),\n Math.floor(this.y)\n );\n }", "title": "" }, { "docid": "8525ccb20ffb9d6e47787752d84afb2e", "score": "0.5599308", "text": "function feet_cm(feet){\n return feet * 30.48;\n}", "title": "" }, { "docid": "bac34e5cabbb5ba21858cd29e0f717d7", "score": "0.55745935", "text": "function inchToMm(value) {\n if (value === 0) {\n return 0;\n }\n\n // convert to positive values, but turn them negative again in the end\n var negative = false;\n if (value.charAt(0) === '-') {\n negative = true;\n value = value.slice(1);\n }\n\n // convert inch fraction to mm\n value = value.split(\" \");\n // first part\n value[0] = value[0].split(\"/\");\n // fractional inch\n if (value[0][1]) {\n value = parseInt(value[0][0]) / parseInt(value[0][1]);\n // second part exist\n } else {\n // fractional inch\n if (value[1]) {\n value[1] = value[1].split(\"/\");\n if (value[1]) {\n value[1] = parseInt(value[1][0]) / parseInt(value[1][1]);\n }\n value = parseInt(value[0]) + value[1];\n }\n }\n // convert to mm\n value *= 25.4;\n value = Math.round(value);\n // convert to original sign\n if (negative) {\n value = -value;\n }\n return value.toString();\n }", "title": "" }, { "docid": "8aa10be904882ae49b002b94deffc473", "score": "0.55405587", "text": "function calculateCentimetres() {\r\n var inches = document.inputForm.input1.value * 0.39\r\n document.inputForm.output.value = inches; \r\n}", "title": "" }, { "docid": "efbc8b120a8e78300c90444729171f51", "score": "0.5539691", "text": "function btn8Click() {\n var inches = document.getElementById(\"i8\").value\n var convertedFeets = inches / 12 + \" \" + \"FT\"\n\n document.getElementById(\"p8\").innerHTML = convertedFeets\n}", "title": "" }, { "docid": "4123d2079d12aa9051e24a9dc88c0d2c", "score": "0.5535191", "text": "function pxToOthers(){\r\n \tvar argLen= arguments.length,\r\n \tunit= arguments[0];\r\n for(var i=1;i<argLen;i++){\r\n var mainPixel= $(arguments[i]).text(),\r\n pixelVal= parseInt(mainPixel);\r\n if(unit==='em'){\r\n \tif(mainPixel.indexOf(unit)==-1){\r\n\t $(arguments[i]).html(pixelVal*.0625+unit+\";\"); /*px to em*/\r\n\t }\r\n }\r\n else if(unit==='pt'){\r\n \tif(mainPixel.indexOf(unit)==-1){\r\n \t\t$(arguments[i]).html(pixelVal*.75+unit+\";\"); /*px to pt*/\r\n\t }\r\n }\r\n else if(unit==='%'){\r\n \tif(mainPixel.indexOf(unit)==-1){\r\n \t\t$(arguments[i]).html(pixelVal*6.25+unit+\";\"); /*px to %*/\r\n\t }\r\n } \r\n } \r\n }", "title": "" }, { "docid": "59f60684ce0789ba6b529142e9eb23e8", "score": "0.5505145", "text": "static feetAndInches(inches) {\n //returns an array where [0] is the feet and [1] is the remaining inches\n var remainingInches = inches % 12\n var feet = (inches - remainingInches) / 12\n\n return [feet, remainingInches]\n }", "title": "" }, { "docid": "ba4e569a2330e72d8216f6c3728e424f", "score": "0.5489719", "text": "function px(cm){\n return cm/SCALE;\n}", "title": "" }, { "docid": "6ceddcafc36477afb2465aeff3908dc8", "score": "0.5468147", "text": "function btn9Click() {\n var feets = document.getElementById(\"i9\").value\n var convertedInches = feets * 12 + \" \" + \"Inches\"\n\n document.getElementById(\"p9\").innerHTML = convertedInches\n}", "title": "" }, { "docid": "e91116f569451ba208113db981529e05", "score": "0.54590964", "text": "function convertToFt(inches) {\n var feet = Math.floor(inches/12);\n var rInches = Math.floor(inches % 12);\n\n return feet + \" ft \" + rInches + \" in\";\n }", "title": "" }, { "docid": "7f6883c04bf8c16e96f9818608c839f5", "score": "0.5406317", "text": "function millimeter_to_centimeter(x) {\n var millimeter_value, centimeter_value, int_millimeter_value;\n millimeter_value = document.getElementById(x).value;\n check_error();\n int_millimeter_value = parseInt(millimeter_value);\n centimeter_value = int_millimeter_value / 10;\n return centimeter_value;\n}", "title": "" }, { "docid": "334813fcf4f20167d1a35c2ea66a71f2", "score": "0.54023284", "text": "function toXY(radians, inches) {\n\tvar adjustedRadians = Math.PI/2-declination-radians;\n\treturn [Math.round(inches*pixelsPerInch*Math.cos(adjustedRadians)+diablo[0]), Math.round(diablo[1]-inches*pixelsPerInch*Math.sin(adjustedRadians))];\n}", "title": "" }, { "docid": "f2bcb273ef30082fbdc972c9fef59616", "score": "0.53848165", "text": "function convert (celsuis){\n var fahrenheit = celsuis *9/5+32;\n return fahrenheit;\n}", "title": "" }, { "docid": "06bc85bf58227d9d5f0ec75c449ad0fa", "score": "0.5383016", "text": "function task22() {\n let inches = +prompt(\"Cколько сантиметров перевести в дюймы?\", '');\n let resultInches = inches * 2.54;\n alert(resultInches)\n let centimeters = +prompt(\"Cколько дюймов перевести в сантиметры?\", '');\n let resultCentimeters = (centimeters / 2.54).toFixed(2);\n alert(resultCentimeters)\n\n}", "title": "" }, { "docid": "1effba031380537bb1b3d36719fecdb6", "score": "0.53538865", "text": "function line_to_cents(input) {\n return decimal_to_cents(line_to_decimal(input));\n}", "title": "" }, { "docid": "ff96e0400f9de82bb7b23f34d54881b9", "score": "0.5350717", "text": "function setUnits() {\n var units = getStringAttribute(\"units\",true).toLowerCase();\n if (units == \"inches\") {\n unitsConversion = 72;\n\n } else if (units == \"cm\") {\n unitsConversion = 72 * .3937;\n\n } else if (units == \"points\") {\n unitsConversion = 1;\n\n } else {\n unitsConversion = 72;\n }\n}", "title": "" }, { "docid": "95c2506e9cc9c6915e6720e6b0326270", "score": "0.53345996", "text": "function fieldMarkMetricToImp(meters) {\n const inches = meters / CONVERT_ITOM_METER_PER_INCH;\n const fractionalInch = inches - Math.floor(inches);\n const quarterInches = Math.floor(fractionalInch * 4);\n const adjInches = inches + (quarterInches * 0.25);\n\n return adjInches;\n}", "title": "" }, { "docid": "b71dba0f1b817470a294070b56090017", "score": "0.5292969", "text": "function feet () {\n let inputInch = document.getElementById(\"input-feet-inch\").value;\n let inputFeet = document.getElementById(\"input-feet\").value;\n let inches = (+inputFeet * 12) + +inputInch;\n inches = inches.toFixed(2)\n document.getElementById(\"result-feet\").innerHTML =\n inputFeet + \" feet and \" + inputInch + \" inches is \" + inches + \" inches.\";\n}", "title": "" }, { "docid": "67e8c5d63c159f9b794fa337c43d054b", "score": "0.5218907", "text": "function calcImperialUnit(input){\n // 12 inches = 1 foot\n let feet = input / 12|0;\n let inches = input % 12;\n console.log(`${feet}'-${inches}\"`);\n}", "title": "" }, { "docid": "6c2c2b598d12820781c07fb59932c0ed", "score": "0.521868", "text": "function mm2pt(n){ return n * 2.83465; }", "title": "" }, { "docid": "9d13eb052307c991e9b24217c78955af", "score": "0.5195661", "text": "function celsius(input) {\n var conversion = (5.0 / 9.0) * (input - 32);\n return conversion;\n}", "title": "" }, { "docid": "e3b59c636ca2709da89089de6188c7c4", "score": "0.51720667", "text": "function convertft() {\n\tvar feet = document.getElementById(\"feet\").value;\n var inch=document.getElementById(\"inch\").value;\n\t//document.getElementById(\"inch\").value = (Math.abs(feet * 12)).toFixed(0);\n\tdocument.getElementById(\"cm\").value=\"\";\n\tdocument.getElementById(\"cm\").value = (Math.abs(feet * 30.48 + inch * 2.54)).toFixed(0);\n}", "title": "" }, { "docid": "2c72f83246dcfd4b3e20928f2120c9ba", "score": "0.5168934", "text": "function convertHeightHelper(){\n var inches = prompt(\"Enter height in inches\");\n document.getElementById(\"result\").innerHTML = inches + \" inches is \"+ convertHeight(inches).toFixed(2) + \" meters\";\n\n}", "title": "" }, { "docid": "5516881a8639070dc50f4bd79e17591a", "score": "0.50718", "text": "function convertToKph(mps){\r\n\t\treturn Math.round(mps * 3.6);\r\n\t}", "title": "" }, { "docid": "331e287c0e671d0bfa5c3abaab285931", "score": "0.5049358", "text": "function celsiusConvertion() {\n // Grab the value entered in the Enter temperature input\n var valueTemperature = document.getElementById(\"tbInput\").value;\n // console.log(typeof valueTemperature);\n var valueTemperature = parseInt(valueTemperature);\n\n // Converting\n var celConvertion = (valueTemperature - 32) * (5 / 9);\n // console.log(celConvertion); \n\n // Grab the output area\n var elementOutput = document.getElementById(\"pTemperature\");\n\n // Populate with the convertion \n elementOutput.innerHTML = Math.round(celConvertion) + \"°C\";\n }", "title": "" }, { "docid": "3ed5156fcaeae71046a2703326150f80", "score": "0.50459373", "text": "pxToEm( px, fontSize ) {\n\t\tvar ems = 0;\n\n\t\tfontSize = fontSize ? parseInt( fontSize ) : 0;\n\t\tpx = px ? parseInt( px ) : 0;\n\n\t\tif ( fontSize && px ) {\n\t\t\tems = ( px / fontSize ).toFixed( 1 );\n\t\t}\n\n\t\treturn ems;\n\t}", "title": "" }, { "docid": "15e1efef1d7e42f0962c3b1d75d3bd24", "score": "0.50232804", "text": "function meter_to_centimeter(x) {\n var meter_value, centimeter_value, int_meter_value;\n meter_value = document.getElementById(x).value;\n check_error();\n int_meter_value = parseInt(meter_value);\n centimeter_value = int_meter_value * 100;\n return centimeter_value;\n}", "title": "" }, { "docid": "b88826bea3aa1c6ab1858c2dcdc48f17", "score": "0.5016048", "text": "function convertToCelsius(temp, units) {\n\n}", "title": "" }, { "docid": "c45b9e49a2a6e272525cfd41a89d6029", "score": "0.4994828", "text": "function n_of_edo_to_cents(input) {\n return decimal_to_cents(n_of_edo_to_decimal(input));\n}", "title": "" }, { "docid": "ae7be706a4748de04329a4a79d0ee631", "score": "0.49857783", "text": "function convert() {\n var km = milesElement.value * 1.609344; //BUG: changed number value\n kilometersElement.innerHTML = km;\n}", "title": "" }, { "docid": "dd2345daf34e619a23d818f9d70f5cd2", "score": "0.49838486", "text": "function farenheitToCelsius(x) {\n\treturn Math.round((x -32) * 5 / 9);}", "title": "" }, { "docid": "998d9800ae04934f0a46208f4fede638", "score": "0.49741662", "text": "function converter(km) {\n let miles = km * 0.621371;\n return miles;\n}", "title": "" }, { "docid": "f5db1f67f0f147384e5663dcbed02bbe", "score": "0.49612936", "text": "function feet(num1){\n return num1 / 0.032808;\n}", "title": "" }, { "docid": "3d38c1e5515a8ec4f609196fae4c06ba", "score": "0.49583533", "text": "sizeToPx(subject) {\n if (!subject.map) {\n if (typeof subject !== 'number' && typeof subject !== 'string') {\n return subject;\n }\n return `${subject}px`;\n }\n return subject.map(size => `${size}px`);\n }", "title": "" }, { "docid": "bc3b7be3ff0344074fc1a411ca2fc766", "score": "0.49290994", "text": "function convertToC(x) {\n return Math.round((x - 32) * (5 / 9));\n }", "title": "" }, { "docid": "46251676a125b93c6f6987c794028987", "score": "0.4919972", "text": "function fahrenheitToCelsius(input) {\n return ((input - 32) * 5) / 9;\n}", "title": "" }, { "docid": "960506fbe781ddcab0fe29898b225c42", "score": "0.49163917", "text": "function convertToCelsius(temp) {\n\treturn Math.ceil(((temp - 32) * (5/9)));\n}", "title": "" }, { "docid": "3b181496a229825d83c9ecc2796147be", "score": "0.488721", "text": "function convertUserHeight(height_ft, height_in) {\n const ftToInches = height_ft * 12;\n const totalInches = ftToInches + height_in;\n const heightInCm = totalInches * 2.54;\n return heightInCm;\n}", "title": "" }, { "docid": "48c5a7c29adde93aa43b56340ed74e90", "score": "0.48846447", "text": "function normalize(){\n\tconsole.log(this.coords.map(n => n/this.length));\n}", "title": "" }, { "docid": "5d6a258270f3c8f0d8dcad8bcf2bb71a", "score": "0.48842922", "text": "function fontSizePx(times) {\n var fontSize = fontSizeNum(times);\n return fontSize.toFixed(2) + 'px';\n }", "title": "" }, { "docid": "7e3c7cf3ca816a984842cca35541e1a3", "score": "0.48825595", "text": "function normalize() {\n console.log(this.coords.map((n) => n / this.length));\n}", "title": "" }, { "docid": "739afb395e754f8caea0ef7bea7b2bc3", "score": "0.4882202", "text": "function feetToCM(f){\n let cM = f*30.48\n console.log (\"You have \" + cM + \" cm.\")\n \n \n}", "title": "" }, { "docid": "d7d1f25b4b5ee2a369d2725b38568f37", "score": "0.48615703", "text": "function coordsToPixels(xy) {\n return [\n Math.round((xy[0] - extent[0]) / (extent[2] - extent[0]) * size[0]),\n Math.round((xy[1] - extent[3]) / (extent[1] - extent[3]) * size[1]),\n ]\n }", "title": "" }, { "docid": "96a4e70662109b55bd13ad6cd4d39675", "score": "0.48517117", "text": "function centimeter_to_millimeter(x) {\n var centimeter_value, millimeter_value, int_centimeter_value;\n centimeter_value = document.getElementById(x).value;\n check_error();\n int_centimeter_value = parseInt(centimeter_value);\n millimeter_value = int_centimeter_value * 10;\n return millimeter_value;\n}", "title": "" }, { "docid": "e03698cabd18f67879cfd52099d74379", "score": "0.4837792", "text": "function convertUnits(){\n if (imperialBtn.checked){\n const inches = parseInt(heightFeetInput.value * 12) + parseInt(heightInchInput.value);\n const weight = weightInput.value\n return {\n height: inches * 2.54,\n weight: weight * 0.455\n }\n }\n else {\n return {\n height: heightCmInput.value,\n weight: weightInput.value\n }\n }\n}", "title": "" }, { "docid": "074d01148c137023d83fa504d7fbdb1a", "score": "0.4818298", "text": "function displayOutput(width, height) {\n let output1 = getPerimeter(width, height); \n let output2 = inchesToMM(output1); \n console.log(\"For an\", width, \" x\", height, \"inch sheet paper:\", \"\\nPerimeter =\", output1, \"inches or\", output2, \"millimeters\");\n}", "title": "" }, { "docid": "6d64209a3f1ba770409472e5c7ae1c43", "score": "0.4816577", "text": "function ratio_to_cents(input) {\n return decimal_to_cents(ratio_to_decimal(input));\n}", "title": "" }, { "docid": "9e65f71c6929b61dfd8021c6bf1bfe43", "score": "0.47900468", "text": "function tokmh(x) {\n return (x / 1000) * 3600;\n}", "title": "" }, { "docid": "ac4bcdf57048642d042e7f54c7f337b8", "score": "0.4784556", "text": "getCents( value ) {\n\n let scaleInterval = value % 7;\n let octave = Math.floor( value / 7 );\n let cents = 0;\n\n switch( this.scale ) {\n case \"major\":\n cents = this.majorScaleCents[ scaleInterval ];\n break;\n\n case \"minor\":\n cents = this.minorScaleCents[ scaleInterval ];\n break;\n }\n\n return cents + ( 1200 * octave );\n\n }", "title": "" }, { "docid": "b70d76754b622b1597052c9b435f2abf", "score": "0.47672963", "text": "_gridToPx(gridThing) {\n if (Array.isArray(gridThing)) {\n return gridThing.map((num) => this._gridToPx(num));\n } else {\n return gridThing * this.pxSize / (this.gridSize + 1)\n }\n }", "title": "" }, { "docid": "4f600fb0b1a446f5e7e6b9784b0b1b39", "score": "0.47565573", "text": "function convertKelvin(e) {\n farenheit = 9 / 5 * (parseInt(e) - 273) + 32 + \"F\";\n\n celsius = Math.round(e - 273);\n}", "title": "" }, { "docid": "4d0daf49dbee3125cf51a20e997fc157", "score": "0.47286835", "text": "function kmtoMiles(kilometers) {\n return kilometers / 1.609344; // 1.609344km in 1mile\n\n}", "title": "" }, { "docid": "2f8909d1b3886866b589545756e7cdd6", "score": "0.472423", "text": "function othersTopx(){\r\n \tvar argLen= arguments.length;\r\n for(var i=0;i<argLen;i++){\r\n var mainEm= $(arguments[i]).text(),\r\n emVal= parseFloat(mainEm);\r\n if(mainEm.indexOf('px')==-1){ \r\n if(mainEm.indexOf('em')!==-1){ \t\r\n $(arguments[i]).html(emVal*16+\"px;\"); /*em to px*/\r\n }\r\n else if(mainEm.indexOf('pt')!==-1){\r\n \t$(arguments[i]).html(Math.ceil(emVal*1.3333)+\"px;\"); /*pt to px*/\r\n }\r\n else if(mainEm.indexOf('%')!==-1){\r\n \t$(arguments[i]).html(Math.ceil(emVal*.16)+\"px;\"); /*% to px*/\r\n } \t\r\n }\r\n } \r\n }", "title": "" }, { "docid": "9446390dbf2013f052279d601d9dd9b7", "score": "0.47237772", "text": "function convert_dist(input)\n{\n var ret = \"\";\n\n if(input >= 100000) {\n ret += Math.round(input / 1000) + \" km\";\n return ret;\n }\n\n if(input >= 10000) {\n ret += (input / 1000).toFixed(1) + \" km\";\n return ret;\n }\n\n if(input >= 1000) {\n ret += (input / 1000).toFixed(2) + \" km\";\n return ret;\n }\n\n ret += input + \" m\";\n\n return ret;\n}", "title": "" }, { "docid": "4381705f50b27964fa5f79d5ebe10dd1", "score": "0.47053865", "text": "function kmConverter(km) {\n return km / 1.609344;\n }", "title": "" }, { "docid": "f4e5dc96dc8c309381e2d09eae7cc743", "score": "0.46993673", "text": "function ch38q8(){\n function kmInMeter(km){\n return km*1000;\n }\n function kmInFeet(km){\n var m = kmInMeter(km);\n return m*3.281;\n }\n function kmInInches(km){\n var f = kmInFeet(km);\n return f*12\n }\n function kmInCent(km){\n var i = kmInInches(km);\n return i*2.5;\n }\n var km = prompt(\"Enter distance in \");\n document.write(\"KM in Meters: \"+kmInMeter(km)+\"<br>\");\n document.write(\"KM in Feets: \"+kmInFeet(km)+\"<br>\");\n document.write(\"KM in Inches: \"+kmInInches(km)+\"<br>\");\n document.write(\"KM in Centimeters: \"+kmInCent(km)+\"<br>\");\n}", "title": "" }, { "docid": "0e641ee75045fee2150219a7428820a9", "score": "0.4698451", "text": "function convertToMph(mps){\r\n\t\treturn Math.round(mps * 2.237);\r\n\t}", "title": "" }, { "docid": "d2f6ea8e4a2b422964a12642b03fa51d", "score": "0.46962896", "text": "function toFeet(meter) {\n return meter * 3.28;\n }", "title": "" }, { "docid": "4ed2c5068d7e60c650af548cc263a029", "score": "0.4677896", "text": "function convert(readUnit, showUnit, value) {\n // unit to show\n if (((readUnit == 'mm') && (showUnit == 'mm')) || ((readUnit == 'inch') && (showUnit == 'inch'))) {\n return value;\n }\n else if ((readUnit == 'inch') && (showUnit == 'mm')) {\n return inchToMm(value);\n }\n else if ((readUnit == 'mm') && (showUnit == 'inch')) {\n // todo\n return 0;\n }\n }", "title": "" }, { "docid": "18738e18c813281ac4801377fb9daacf", "score": "0.4674568", "text": "function kmToMiles(k){\n let kM = k/1.609344\n console.log (\"You have \" + kM + \" miles.\")\n \n \n}", "title": "" }, { "docid": "f046c5d95f15507c1b082ad6fee59515", "score": "0.46636635", "text": "function cenken(celsius){ //creazione funzione\n return celsius + 273,25; //centigradi + 273,15°\n}", "title": "" }, { "docid": "d5a567b3839da9ccd37a81186474eb17", "score": "0.4651601", "text": "function miletokm(miles) {\n var km = miles * 1.69;\n return km;\n}", "title": "" }, { "docid": "138be53f4ab0344c5ab5430564ae4a3a", "score": "0.46394", "text": "function xy2i(x,y,mapWidth){\r\n\treturn y*mapWidth +x;\r\n}", "title": "" }, { "docid": "d024b5583db0b38c9206c4f28b378ef0", "score": "0.4632474", "text": "function degConvert(){\n var currentNotation = document.getElementById(\"convert\").value;\n var currentTemp = document.getElementById(\"temp\").innerHTML;\n var fahrTemp, celsTemp;\n //If currently in celsius. Convert to fahrenheit.\n if(currentNotation == (\"\\u00B0\" + \"C/\" + \"\\u00B0\" + \"F\") ){\n fahrTemp = (currentTemp * (9/5) + 32).toFixed(2);\n document.getElementById(\"temp\").innerHTML = fahrTemp;\n document.getElementById(\"convert\").value = \"\\u00B0\" + \"F/\" + \"\\u00B0\" + \"C\";\n }else{\n //Else Convert to celsius.\n celsTemp = ((currentTemp - 32)/1.8).toFixed(2);\n document.getElementById(\"temp\").innerHTML = celsTemp;\n document.getElementById(\"convert\").value = \"\\u00B0\" + \"C/\" + \"\\u00B0\" + \"F\";\n }\n}", "title": "" }, { "docid": "b328c13c196c6d9149d7c2bf4d619273", "score": "0.46240318", "text": "function degreesCelsius(input){\n var fah = input*(9/5)+32;\n var kel = input+273.15;\n display(fah,kel);\n}", "title": "" }, { "docid": "7b5ebdbf8e047b8f54df17070b883f0a", "score": "0.46209675", "text": "function convertSizeValue(){\n //if (current_size_in == 'inches') \n if (jQuery('.show_measurement').text()=='Show measurements in Centimeters') {\n \n for (var i = 0; i < array_id.length; i++) {\n jQuery(error_msg[i]).html('');\n jQuery(array_id[i]).removeAttr(\"style\");\n if (jQuery(array_id[i]).val()!='') {\n var inche_value = parseInt(jQuery(array_id[i]).val());\n var cm_value = inche_value/0.39370;\n jQuery(array_id[i]).val(Math.round(cm_value));\n jQuery('.show_measurement').html('Show measurements in inches');\n current_size_in = 'centimeter';\n if (check_value=='CUSTOM SIZE') {\n add_span(span_id,array_span_cent);\n }\n }\n }\n \n //console.log('in cm convertor');\n }else{\n\n //if (current_size_in == 'centimeter') {\n if (jQuery('.show_measurement').text()=='Show measurements in inches') {\n \n for (var i = 0; i < array_id.length; i++) {\n jQuery(error_msg[i]).html('');\n jQuery(array_id[i]).removeAttr(\"style\");\n if (jQuery(array_id[i]).val()!='') {\n var cm_value = parseInt(jQuery(array_id[i]).val());\n var inche_value = cm_value*0.39370;\n jQuery(array_id[i]).val(Math.round(inche_value));\n jQuery('.show_measurement').html('Show measurements in Centimeters');\n current_size_in = 'inches';\n if (check_value=='CUSTOM SIZE') {\n add_span(span_id,array_span);\n }\n }\n }\n \n //console.log('in inche convertor');\n }\n }\n }", "title": "" }, { "docid": "bb8db04c75405a05a5d904a7c71c73b5", "score": "0.46186417", "text": "static fahrenheitToCelsius(degrees){\n return parseFloat((degrees - 32) / 1.8).toFixed(1)\n }", "title": "" }, { "docid": "b4730045ba27bdc01843b9bfb77b0f4d", "score": "0.4601603", "text": "convertUnits(value, from, to) {\n return this.convertFromPixels(this.convertToPixels(value, from), to);\n }", "title": "" }, { "docid": "b4730045ba27bdc01843b9bfb77b0f4d", "score": "0.4601603", "text": "convertUnits(value, from, to) {\n return this.convertFromPixels(this.convertToPixels(value, from), to);\n }", "title": "" }, { "docid": "e43b13a3baac00d54f0a4ca925cce4ce", "score": "0.46011063", "text": "function converter (mpg) {\n return Number((1.609344 / 4.54609188 * mpg).toFixed(2));\n //code to convert miles per imperial gallon to kilometers per liter\n }", "title": "" } ]
ff2af2650d040ccac19b791af8bac6bd
Create a function that takes a string and returns a string in which each character is repeated once.
[ { "docid": "889c79c6fd754381c54622daad94c7ca", "score": "0.0", "text": "function doubleChar(str) {\n let doubler = \"\";\n for (let i = 0; i < str.length; i++) {\n doubler += str[i] + str[i];\n }\n return doubler;\n}", "title": "" } ]
[ { "docid": "a4ba22c2d855b9d7c17f17ebfbd2c9e7", "score": "0.7647709", "text": "function _repeat(char, times) {\n var s = '';\n for (var i = 0; i < times; i++) {\n s += char;\n }\n return s;\n}", "title": "" }, { "docid": "e4ffaa6aa02d5b41e007eb31fdad787a", "score": "0.7505185", "text": "function repeat(str, times){\n return str.repeat(times);\n}", "title": "" }, { "docid": "e714bc98c7ad55d4a706114915e11705", "score": "0.74966526", "text": "function myRepeat(string,count) {\n var strings = [];\n while(strings.length<count){\n strings.push(string);\n }\n return strings.join('');\n}", "title": "" }, { "docid": "e85a992bfa23e7e59a90b6d7a32a3767", "score": "0.7412467", "text": "function repeatString(string, times)\n{\n var result = \"\";\n\n for (var i=1; i<=times; i++)\n {\n result += string;\n }\n\n return result;\n}", "title": "" }, { "docid": "f33957bd8e0d88ee33e980c4913ca74e", "score": "0.7347036", "text": "function repeat(str, times) {\n var out='';\n for(var i=0; i<times; i++){\n out=out.concat(str);\n }\n return out;\n}", "title": "" }, { "docid": "4fb8d99fb8f98f9917b5f0d7ae2fa2f8", "score": "0.7323196", "text": "function doubleChar(str) {\n // Your code here\n let newStrig = ''\n for (var i = 0; i < str.length; i++) {\n newStrig +=str[i].repeat(2)\n\n }\n return newStrig\n\n}", "title": "" }, { "docid": "2a22f9047e63a11f389fca25213a21cf", "score": "0.73093927", "text": "function repeat(string, times) {\n var result = \"\";\n for (var i = 0; i < times; i++)\n result += string;\n return result;\n}", "title": "" }, { "docid": "e852a5777db33e21a264f98c4735127b", "score": "0.73091024", "text": "function repeat(str, times) {\n return str.repeat(times)\n}", "title": "" }, { "docid": "d1cb4060d5638deb6ec1c5512dd7f6fb", "score": "0.7286197", "text": "function repeatString(str, count) { \nvar beg =\"\";\n for (var i = 1; i <= count ; i++){\n beg=str+beg;\n }\n return beg;\n}", "title": "" }, { "docid": "9e52ac36d55139d590fe196022bf1cd7", "score": "0.72679573", "text": "function Repeatify (string, number) {\n return string.repeat (number);\n}", "title": "" }, { "docid": "12e1b558faa7dc2bc538e68edac34058", "score": "0.72538173", "text": "function repeat(string, times) {\n var result = \"\";\n for (var i = 0; i < times; i++)\n result += string;\n return result;\n}", "title": "" }, { "docid": "96d045f1eacffe717a42e81af7dc80f9", "score": "0.7247305", "text": "function stringRepeat(c, count) {\r\n\tvar s = '';\r\n\twhile (true) {\r\n\t\tif (count & 1) {\r\n\t\t\ts += c;\r\n\t\t}\r\n\t\tcount >>= 1;\r\n\t\tif (!count) {\r\n\t\t\treturn s;\r\n\t\t}\r\n\t\tc += c;\r\n\t}\r\n}", "title": "" }, { "docid": "b864159c4692a89faff32c62402f37bd", "score": "0.72217476", "text": "function repeat(str,times) {\n if (times > 0){\n return str.repeat(times);\n }\n else {\n return \"\";\n }\n}", "title": "" }, { "docid": "b1fe0dc1aa2b5125db8e6a2d0220e4af", "score": "0.7175397", "text": "function repeat(string, amount) {\r\n return new Array(amount + 1).join(string);\r\n}", "title": "" }, { "docid": "f24be81301bdd7ef940c90c3d11b39ea", "score": "0.7165385", "text": "function repeatString(inputString, repeatNr) {\n let outputString = ''; \n for (let i = 0; i < repeatNr; i++) {\n outputString = outputString + inputString; \n }\n return outputString; \n\n}", "title": "" }, { "docid": "264ca81e73e877516edd36dc424e1ba9", "score": "0.71627754", "text": "function repeatStr(n, s) {\n return s.repeat(n)\n}", "title": "" }, { "docid": "6847baf651356ae0d1ca0748b1414da9", "score": "0.71555674", "text": "function repeat(string, times) {\n\tif (times < 1) {\n\t\treturn '';\n\t}\n\n\tvar result = '';\n\n\twhile (times > 1) {\n\t\tif (times & 1) {\n\t\t\tresult += string;\n\t\t}\n\n\t\ttimes >>= 1;\n\t\tstring += string;\n\t}\n\n\treturn result + string;\n}", "title": "" }, { "docid": "6847baf651356ae0d1ca0748b1414da9", "score": "0.71555674", "text": "function repeat(string, times) {\n\tif (times < 1) {\n\t\treturn '';\n\t}\n\n\tvar result = '';\n\n\twhile (times > 1) {\n\t\tif (times & 1) {\n\t\t\tresult += string;\n\t\t}\n\n\t\ttimes >>= 1;\n\t\tstring += string;\n\t}\n\n\treturn result + string;\n}", "title": "" }, { "docid": "6847baf651356ae0d1ca0748b1414da9", "score": "0.71555674", "text": "function repeat(string, times) {\n\tif (times < 1) {\n\t\treturn '';\n\t}\n\n\tvar result = '';\n\n\twhile (times > 1) {\n\t\tif (times & 1) {\n\t\t\tresult += string;\n\t\t}\n\n\t\ttimes >>= 1;\n\t\tstring += string;\n\t}\n\n\treturn result + string;\n}", "title": "" }, { "docid": "6847baf651356ae0d1ca0748b1414da9", "score": "0.71555674", "text": "function repeat(string, times) {\n\tif (times < 1) {\n\t\treturn '';\n\t}\n\n\tvar result = '';\n\n\twhile (times > 1) {\n\t\tif (times & 1) {\n\t\t\tresult += string;\n\t\t}\n\n\t\ttimes >>= 1;\n\t\tstring += string;\n\t}\n\n\treturn result + string;\n}", "title": "" }, { "docid": "f7f8386bb6ac4578782c1a25f2a345fb", "score": "0.71535575", "text": "function repeat(string, times) {\n var repeated = '';\n\n if (times < 0 || isNaN(times)) {\n return;\n }\n\n for (var i = 0; i < times; i++) {\n repeated += string;\n }\n\n return repeated;\n}", "title": "" }, { "docid": "5cf88ae210fb035b1e73a1551c75c6b4", "score": "0.7153215", "text": "function repeat (str, times) {\n return new Array(times + 1).join(str)\n }", "title": "" }, { "docid": "68c1893f600472ee2a2739beb6ad9fc1", "score": "0.71520215", "text": "function repeatify(string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\nreturn newString;\n}", "title": "" }, { "docid": "d27ded3b3848a853a2f47b9be2a8f984", "score": "0.71347517", "text": "function repeatStringNumTimes(str, num) {\n \n}", "title": "" }, { "docid": "c0b13d22f05327c3f23a4ce591d858dc", "score": "0.7129967", "text": "function repeat(str, times) {\n let result = \"\";\n for (let i = 0; i < times; i++) {\n result += str;\n }\n return result;\n }", "title": "" }, { "docid": "c1833a7ee45555e0d58312e2ab4d0226", "score": "0.7119041", "text": "function repeatStr (n, s) {\n return s.repeat(n)\n}", "title": "" }, { "docid": "a022377b65f3b864b8198a1aae29dbb6", "score": "0.71159565", "text": "function repeatify(string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "cac78ce9d59124deae3f4ea424d5281e", "score": "0.7115202", "text": "function repeatStringNumTimes(str, num) {\n if (num < 0) return \"\";\n return Array(num).fill(str).join('');\n}", "title": "" }, { "docid": "4c27b9f2e917189cfc538504e4e9424c", "score": "0.7113965", "text": "function repeatStr(count,string) {\n let repeatedstring = \"\"\n while(count>0) {\n repeatedstring += string\n count--\n }\n return repeatedstring\n }", "title": "" }, { "docid": "11e97f99ed598d7e67efcb805692791c", "score": "0.7113399", "text": "function repeatStr (n, s) {\n let repeatedStr = '';\n for(let i = 0; i < n; i++) {\n repeatedStr = repeatedStr.concat(s);\n }\n return repeatedStr;\n }", "title": "" }, { "docid": "8e0d04fc8b72dbb14dac2802f7a27308", "score": "0.71109784", "text": "function repeatString(str, num) {\n let repeatedStr = \"\";\n for (let i = 0; i < num; i++) {\n repeatedStr += str;\n }\n return repeatedStr;\n }", "title": "" }, { "docid": "aa05cc047b837358c5d8893a88b3a07e", "score": "0.7109126", "text": "function repeater(string, n){\n let arr = new Array(n)\n return arr.fill(string).join('')\n }", "title": "" }, { "docid": "7e1267bb8cd29d49ac008ca87a18d5cd", "score": "0.7107567", "text": "function repeatify(string, number) {\n let newString = '';\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "9a83ab24ed5fc41e72353b60c5f115b8", "score": "0.71023476", "text": "function repeatify (string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "9a83ab24ed5fc41e72353b60c5f115b8", "score": "0.71023476", "text": "function repeatify (string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "9a83ab24ed5fc41e72353b60c5f115b8", "score": "0.71023476", "text": "function repeatify (string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "9a83ab24ed5fc41e72353b60c5f115b8", "score": "0.71023476", "text": "function repeatify (string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "9a83ab24ed5fc41e72353b60c5f115b8", "score": "0.71023476", "text": "function repeatify (string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "9a83ab24ed5fc41e72353b60c5f115b8", "score": "0.71023476", "text": "function repeatify (string, number) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "f4644a387386105ebd28223137732acc", "score": "0.7094885", "text": "function repeatify (string, number) {\n let newString = '';\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n return newString;\n}", "title": "" }, { "docid": "db1cb52f7be798b257e2c86da772f998", "score": "0.7094741", "text": "function timesRepetition(number, string) {\n return string.repeat(number);\n}", "title": "" }, { "docid": "95cd08b617a913ba01ec567fce7530b3", "score": "0.7085585", "text": "function repeat(string, num) {\n var otherString = '';\n for (i = 0; i < num; i++) {\n otherString += string;\n }\n return otherString;\n}", "title": "" }, { "docid": "57e4ff66944686d3a2d5da06d93e3092", "score": "0.70800406", "text": "function repeatStr(n, s) {\n return s.repeat(n);\n}", "title": "" }, { "docid": "25d8946cf44565c6f6991a735d1c37ca", "score": "0.70736504", "text": "function repeat(str, num) {\n var newStr = '';\n while (num > 0) {\n newStr += str;\n num--\n }\n return newStr;\n}", "title": "" }, { "docid": "b190fe2e80bc859646b00905c7c1f301", "score": "0.7066445", "text": "function repeatStr (n, s) {\n return s.repeat(n);\n }", "title": "" }, { "docid": "d8ed1ae64ed92a37f173d05a9a7b3321", "score": "0.7064359", "text": "function repeatStr (n, s) {\nvar str='';\nfor(var i=0; i < n; i++)\n str+=s;\n return str;\n}", "title": "" }, { "docid": "0abd61cf59129cd27054aad8ca86b124", "score": "0.70606506", "text": "function repeatStringNumTimes(string, times) {\n var repeatedString = \"\";\n while (times > 0) {\n repeatedString += string;\n times--;\n }\n return repeatedString;\n}", "title": "" }, { "docid": "75d2a3c2bb178fd9738dccdf215b1039", "score": "0.70597476", "text": "function repeatstring(str, times){\n if(times>0){\n console.log(str.repeat(times))\n }\n else{\n return ''; \n }\n}", "title": "" }, { "docid": "0c3c532d1f5485170ab53dd093fce81d", "score": "0.7059583", "text": "function repeatStringNumTimes(str, num) {\n var x=\"\";\n if (num>=1){\n for (var i=0;i<num;i++){\n x = x+str;\n }\n return x;\n }else {\n return x;\n }\n \n}", "title": "" }, { "docid": "3e242b71e86139d92e6af09ef4074396", "score": "0.70580864", "text": "function repeat( string, times ) {\n\tvar result = \"\";\n\tfor ( var i = 0; i < times; i++ ) {\n\t\tresult += string;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "b966be3b2eb72987f7c998a65993ebd7", "score": "0.70556265", "text": "function repeatStringNTimes(str,times) {\r\n console.log(str.repeat(times));\r\n}", "title": "" }, { "docid": "7321ae2b0bb8b91540016e8a795e3e89", "score": "0.7054676", "text": "function repeatStringNumTimes(str, num) {\r\n var strArr = [];\r\n for (var i = 0; i < num; i++) {\r\n strArr.push(str);\r\n }\r\n\r\n return strArr.join('');\r\n}", "title": "" }, { "docid": "c11437f11bbc0ef2c2edbf1c06ca9ece", "score": "0.7051777", "text": "function repeatString(str, num) {\n out = '';\n for (var i = 0; i < num; i++) {\n out += str; \n }\n return out;\n}", "title": "" }, { "docid": "7b07f259774aa386883f2b8838383ad4", "score": "0.7047999", "text": "function repeatStr(n, s) {\n let repeatedStr = \"\";\n for (let i = 0; i < n; i++) {\n repeatedStr = repeatedStr.concat(s);\n }\n return repeatedStr;\n}", "title": "" }, { "docid": "8b220c258d11fb2566a446fe9694febc", "score": "0.70478505", "text": "function repeatString(str, count) { \n if(count>=str.length){\n return \"\";\n }\n return str + repeatString(str,count-1)\n}", "title": "" }, { "docid": "e0e9fa8ccdfc78014d0de64dc65c80ad", "score": "0.70448697", "text": "function repeatLetter(s) {\n\tlet randIndex = randIndexIn(s);\n\trandChar = s.charAt(randIndex);\n\treturn s.substring(0, randIndex) + \n\trandChar + \n\trandChar.toLowerCase() + s.substring(randIndex + 1);\n}", "title": "" }, { "docid": "b534070aad0d3bbe5c9159a69971b516", "score": "0.70431924", "text": "function repstr (n, s) { return new Array (n + 1).join (s); } // repeat string s n times", "title": "" }, { "docid": "e619b33e03758ef5293d1ba8d8bca8bf", "score": "0.7040301", "text": "function repeat(str, times) {\n var result = '', i;\n\n for (i = 1; i <= times; i *= 2) {\n if ((times & i) === i) {\n result += str;\n }\n str = str + str;\n }\n return result;\n}", "title": "" }, { "docid": "65c9b853885052c9eb23871e8ede884a", "score": "0.7038447", "text": "function repeater(string, n){\n return string.repeat(n);\n}", "title": "" }, { "docid": "0a253a33aa4b06e08b652407b1be6f67", "score": "0.7038186", "text": "function repeat(str, num) {\n var newStr = '';\n if(num>0) {\n for(i=0; i<num;i++) {\n newStr += str;\n }\n return newStr;\n } else {\n var str = \"\";\n return str;\n }\n}", "title": "" }, { "docid": "d5b1028e7c99ffd04b357179eb2145a5", "score": "0.7025988", "text": "function repeat (str, num) {\n let newStr = '';\n for(let i=0; i<num; i++) {\n newStr += str;\n }\n return newStr;\n}", "title": "" }, { "docid": "73640c09662d9770a413361a923b9c40", "score": "0.70222133", "text": "function repeatStr (str, num) {\n let newStr = \"\";\n for ( let i = 0; i < num; i ++) {\n newStr += str;\n }\n return newStr;\n}", "title": "" }, { "docid": "df6a470f328357c7d2ec02e65a373ea6", "score": "0.70207405", "text": "function repeatString(str, count) { \n if(count === 0){\n return ''\n }\n return str + repeatString(str,count-1)\n}", "title": "" }, { "docid": "be80880c1f3e5bea72a83e17ff71df1b", "score": "0.7019852", "text": "function repeatString(str, num){\n var final = '';\n if(num<0) return '';\n\n for(var i=0; i<num; i++){\n final+=str;\n }\n return final\n}", "title": "" }, { "docid": "3d69f1d011a739390e92952deaa0d4fb", "score": "0.7012532", "text": "function repeat(str, n) {\n return Array(n + 1).join(str);\n }", "title": "" }, { "docid": "e00598b6623ee8c560a2d4568c83e6d2", "score": "0.7003356", "text": "function repeater(string, n){\n //Your code goes here.\n return string.repeat(n);\n}", "title": "" }, { "docid": "cba2d979d55ef2913d4d9a4013ef7027", "score": "0.70020705", "text": "function repeatStringNumTimes(str, num) {\r\n var temp = \"\";\r\n if(num >= 0) {\r\n for(var i=0; i<num; i++) {\r\n temp += str;\r\n }\r\n }\r\n else {\r\n temp = \"\";\r\n }\r\n return temp;\r\n}", "title": "" }, { "docid": "47e656913c8408479df7525ad99a2b68", "score": "0.70010054", "text": "function repeatStringNumTimes(str, num) {\n var newStr = \"\";\n for (var i = 0; i < num; i++) {\n newStr += str;\n }\n return newStr;\n}", "title": "" }, { "docid": "616e5d17202b90420d27d8af9611e87e", "score": "0.6998945", "text": "function repeatStr (n, s) {\n var repeatedString = \"\";\n\n while(n > 0) {\n repeatedString += s;\n n--;\n }\n return repeatedString;\n}", "title": "" }, { "docid": "895c545a24058ade26ef4b752c110f4d", "score": "0.6992824", "text": "function repeatStringNumTimes(str, num) {\n let repeatedString = \"\";\n for (let i = 0; i < num; i++) {\n repeatedString += str;\n }\n\n return repeatedString;\n}", "title": "" }, { "docid": "9e8823c6012baebea327001250c7b1eb", "score": "0.6985782", "text": "function repeat(str, num) {\n // repeat after me\n if(num<0){\n return '';\n }else{\n var word=str;\n str='';\n for(var i=0;i<num;i++){\n str+=word;\n }\n }\n return str;\n \n}", "title": "" }, { "docid": "f7b171bab43464bcbc9c336b7e417387", "score": "0.6982827", "text": "function doubleChar(str) {\n return str.Split('').map(letter => letter.repeat(2)).join('')\n}", "title": "" }, { "docid": "7c39b4ab84d5e0c022117821c494e4de", "score": "0.6970922", "text": "function repeatString(str, num) {\n let repeatedStr = \"\";\n while (num > 0) {\n repeatedStr += str;\n num--;\n }\n return repeatedStr;\n }", "title": "" }, { "docid": "00866497b7278d166625d7fa64b3aa20", "score": "0.69702476", "text": "function repeat(arr) {\n if (arr[1] > 0 && typeof arr[0] === \"string\") {\n const newStr = arr[0];\n const goodStr = newStr.repeat(arr[1]);\n return goodStr;\n } else {\n return \"\";\n }\n}", "title": "" }, { "docid": "91f920bafdb45860a409ea24587bdf4b", "score": "0.696238", "text": "function Repeat(c, n) { var l = []; for (var i = 0; i < n; i++) {\n l.push(c);\n } return l.join(''); }", "title": "" }, { "docid": "12c887fd1fb66ba376a988edfb03d3e8", "score": "0.6962131", "text": "function repeatStringNumTimes(str, num) {\n if (num <= 0) return '';\n let result = '';\n for (let i = 1; i <= num; i++) {\n result += str;\n }\n return result;\n }", "title": "" }, { "docid": "8094a45addef85a5811a8d9019966716", "score": "0.6957273", "text": "function repeatStringNumTimes(str, num) {\r\n\r\n if ( num < 0 ) {\r\n\r\n return \"\"\r\n } \r\n\r\n let repeatedStr = \"\"\r\n\r\n for (let i = 0; i < num; i++) {\r\n\r\n //repeatedStr = repeatedStr + str\r\n\r\n repeatedStr += str\r\n \r\n }\r\n\r\n return console.log(repeatedStr)\r\n \r\n }", "title": "" }, { "docid": "ca8c03b982e7d2c2a9ca22fc74e28277", "score": "0.69506884", "text": "function repeatString( string, num ) {\n var str = \"\";\n for( var i = 0; i < num; i++ ) {\n str += string;\n }\n return str;\n}", "title": "" }, { "docid": "ee8f8cee706a075662617d9ecbd4c70a", "score": "0.6945715", "text": "function repeatStr (n, s) {\n let result = ''\n for(let i =0; i<n; i++) {\n \n result += s;\n }\n return result\n \n }", "title": "" }, { "docid": "4ff374abaec3c4c83fc70384b0f57af8", "score": "0.694056", "text": "function repeat(str, num) {\n var newStr = '';\n for (var i = num; i > 0; i--) {\n newStr += str;\n }\n return newStr;\n}", "title": "" }, { "docid": "9019fac33b151aabed8e3311a15e69ee", "score": "0.69332343", "text": "function doubleChar(str) {\r\n\tlet split = str.split('')\r\n\tlet repeat = split.map(char => {\r\n\t\treturn char.repeat(2)\r\n\t})\r\n\tjoin = repeat.join(\"\")\r\n\treturn(join)\r\n}", "title": "" }, { "docid": "b7dbf2de8246fac89402ad92f1eb14d6", "score": "0.69290566", "text": "function howManyTimes(n){\n let x = \"a\";\n x = x.repeat(n);\n return \"Ed\"+x+\"bit\"\n}", "title": "" }, { "docid": "43d60b4a0b41628d348310154c7c5ab3", "score": "0.6910035", "text": "function repeatStringNumTimes(str, num) {\n \n var repeatStr='';\n \n for(var i=0;i<num;i++){\n repeatStr+=str;\n }\n \n console.log(repeatStr);\n return repeatStr;\n}", "title": "" }, { "docid": "27c07657f3ada9bf34588adeb7a4f40a", "score": "0.69027966", "text": "function repeater(str) {\n var newString = '';\n var i;\n\n for (i = 0; i < str.length; i += 1) {\n newString += str[i] + str[i];\n }\n\n return newString;\n}", "title": "" }, { "docid": "b75f8a082afc75ada9efcb3dc1163495", "score": "0.68989635", "text": "function repeatString(str, len) {\n return Array.apply(null, {length: len + 1}).join(str).slice(0, len)\n}", "title": "" }, { "docid": "cf91e1880c2f82251f36c88e04a1122e", "score": "0.6893142", "text": "function repeatStringNumTimes(str, num) {\n if (num > 0) { return str.repeat(num); }\n return '';\n}", "title": "" }, { "docid": "767b2bc42dab483627ecd4d0d15ebe97", "score": "0.68767875", "text": "function createStringCopiesXTimes(string, numberOfTimes) {\n let stringArray = [];\n \n for (let i = 0; i < numberOfTimes; i++) {\n stringArray.push(string);\n }\n \n return stringArray.join(\"\");\n }", "title": "" }, { "docid": "2611433f0eaeb9e07810e860a2fca439", "score": "0.6868546", "text": "function repeatStringNumTimes(str, num) {\n var accumulatedStr = \"\";\n \n while (num > 0) {\n accumulatedStr += str;\n num--;\n }\n \n return accumulatedStr;\n }", "title": "" }, { "docid": "c103678b884106b3e6ca76baac608454", "score": "0.68663466", "text": "function repeat(t, n) {//make a string with t repeated n times\n\t\tvar s = \"\";\n\t\tfor (var i = 0; i < n; i++) s += t;\n\t\treturn s;\n\t}", "title": "" }, { "docid": "fa96b63530f33475a50d99352c3eb915", "score": "0.68643", "text": "function repeatStringNumTimes(str, num) {\n if (num < 0) return \"\";\n return str.repeat(num);\n}", "title": "" }, { "docid": "ff43625293f27cd6156a5bee4fdfa189", "score": "0.68616533", "text": "function repeatStringNumTimes(str, num) {\n var accumulatedStr = \"\";\n\n while (num > 0) {\n accumulatedStr += str;\n num--;\n }\n return accumulatedStr;\n}", "title": "" }, { "docid": "95be5a5e03e4061fc7298bda45943171", "score": "0.68606067", "text": "function repeatStr (n, s) {\n\t\tvar result = \"\";\n\tfor (var i = 0 ; i < s ; i++) {\n\t\tresult = result + n;\n\t}\n\treturn result;\n\t}", "title": "" }, { "docid": "55188fc6016929c0daa0a464cc83881f", "score": "0.68590647", "text": "function repeatString(string,howManyTimesToRepeat) {\n var repeatedString = \"\";\n while (howManyTimesToRepeat > 0) {\n return repeatedString += string.repeat(howManyTimesToRepeat);\n }\n}", "title": "" }, { "docid": "31b0e456d7708d1ed47b647bcf3ba027", "score": "0.6857938", "text": "function repeatStringNumTimes(str, num) {\n if (num > 0) {\n return str.repeat(num);\n }\n return \"\";\n}", "title": "" }, { "docid": "d68184b2ae5eca4beca398b54d6e875b", "score": "0.6857679", "text": "function repeatStringNTimes(str, n) {\n if (n > 0) {\n return str.repeat(n);\n }\n}", "title": "" }, { "docid": "251aa6e3cce3ff945137fd08e3b7a569", "score": "0.6856944", "text": "function accum1(s) {\n return [...s]\n .map((char, index) => char.toUpperCase() + char.toLowerCase().repeat(index))\n .join('-');\n}", "title": "" }, { "docid": "4eb5c4bf1d73d66b23955ad2ba7a7ef5", "score": "0.68550515", "text": "function repeatStr (n, s) {\n var string = s;\n var updatedString= s;\n for(var i = 1; i<n; i++){\n updatedString = updatedString + s;\n }\n \n return updatedString;\n}", "title": "" }, { "docid": "b4bb649f933148d88302f0b07ef9e546", "score": "0.6854205", "text": "function repeatString(str, len) {\n return Array.apply(null, {length: len + 1}).join(str).slice(0, len)\n}", "title": "" }, { "docid": "5f999b7c0ca3aac7f7e195d9a40fe464", "score": "0.68511087", "text": "function repeatString(str, count) {\r\n if (count < 1) {\r\n return '';\r\n }\r\n let result = '';\r\n let pattern = str.valueOf();\r\n while (count > 1) {\r\n if (count & 1) {\r\n result += pattern;\r\n }\r\n count >>= 1, pattern += pattern;\r\n }\r\n return result + pattern;\r\n}", "title": "" }, { "docid": "06d83ce7c083f7b3f315c19b04cb85b4", "score": "0.68383676", "text": "function repeatStringNumTimes(str, num) {\n if (num < 1) {\n return \"\";\n } else if (num === 1) {\n return str;\n } else {\n return str + repeatStringNumTimes(str, num - 1);\n }\n}", "title": "" }, { "docid": "286f6a3a0692d1e33fa64f15552563dc", "score": "0.68347263", "text": "function repeatStringNumTimes(str, num) {\n\n return num > 0 ? str + repeatStringNumTimes(str, num - 1) : '';\n}", "title": "" } ]
3a99753533fcb4aa274c8a7dd8fc2f84
Look for a note with the date's title in the specified notebook. Returns Promise with HTML string
[ { "docid": "c9e43684799262f9b368dc33e668b547", "score": "0.6674677", "text": "function findNoteFromDate(noteStore, dateString, notebookName) {\n const data = {};\n data.attachPaths = [];\n return new Promise((resolve, reject) => {\n const getNotebookGUID = noteStore.listNotebooks().then((notebooks) => {\n for (let i = 0; i < notebooks.length; i += 1) {\n if (notebooks[i].name === notebookName) {\n return notebooks[i].guid;\n }\n }\n return reject('No notebook found');\n })\n .catch((error) => {\n reject(error);\n });\n\n const metadataSpec = new Evernote.NoteStore.NotesMetadataResultSpec({\n includeTitle: true,\n });\n const noteSpec = new Evernote.NoteStore.NoteResultSpec({\n includeContent: true,\n includeResourcesData: true,\n includeResourcesRecognition: true,\n });\n\n const strictDateString = `\"${dateString}\"`;\n getNotebookGUID.then(id => new Evernote.NoteStore.NoteFilter({\n words: strictDateString,\n notebookGuid: id,\n }))\n .then(filter => noteStore.findNotesMetadata(filter, 0, 50, metadataSpec))\n .then((notesMetadataList) => {\n if (!notesMetadataList.notes[0]) {\n resolve(`No note found with: ${dateString}`);\n }\n return notesMetadataList.notes[0].guid;\n })\n .then(noteGuid => noteStore.getNoteWithResultSpec(\n noteGuid,\n noteSpec,\n ))\n .then((note) => {\n // Save the content and then go get the attached resources\n data.content = note.content;\n if (!note.resources) {\n return Promise.resolve();\n }\n return Promise.all(\n note.resources.map(res => noteStore.getResource(res.guid, true, true, true, true)),\n );\n })\n .then((resources) => {\n if (!resources) {\n return Promise.resolve();\n }\n\n // Write resources to files\n return Promise.all(\n resources.map((res) => {\n const filename = `/home/dho/scripts/journal-digest/attachments/${res.guid}.${getMediaType(res.mime)}`;\n data.attachPaths.push(filename);\n // console.log(\"writing to:\" + filename);\n return fs.writeFile(filename, res.data.body, (err) => {\n if (err) {\n console.log(`error:${err}`);\n throw err;\n }\n });\n }),\n );\n })\n .then(() => {\n resolve([data.content, data.attachPaths]);\n })\n .catch((error) => {\n reject(error);\n });\n });\n}", "title": "" } ]
[ { "docid": "45b5ac9052a93d2cf7419cf35ab6705b", "score": "0.6522552", "text": "getNotesByTitle(noteTitle) {\n return new Promise((resolve, reject) => {\n const query = { title: { $regex: new RegExp(noteTitle, \"i\") } }; // ignore title letter sensitivity\n Note.find(query)\n .then((data) => {\n resolve(data);\n })\n .catch((err) => reject(err));\n });\n }", "title": "" }, { "docid": "47a5444ddcb6f2ed0c56afe59e67e00d", "score": "0.62353903", "text": "function checkForNote() {\n fetch(`/api/notes/${dateNow}`, {\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" },\n })\n .then((response) => response.json())\n .then((data) => {\n if (data.length != 0) {\n const replace = `<a href=\"/day/${dateNow}\"><span class=\"uk-margin-small-right uk-icon\"\n uk-icon=\"icon: plus\"></span>See Today's Page</a>`;\n const addNewNote = document.getElementsByClassName(\"newnote\");\n Array.from(addNewNote).forEach(function (element) {\n element.innerHTML = replace;\n });\n }\n });\n}", "title": "" }, { "docid": "1a7468c47d82a58cfc83ac98083e945a", "score": "0.54709035", "text": "async function getNoteData() {\n\tconst resp = await fetch('/~/hydrangeahacks/account/Notes?all=true')\n\tconst json = await resp.json();\n\tconst results = document.getElementById('results');\n\tconst str = JSON.stringify(json);\n\tconst arr = JSON.parse(str);\n\tvar buf = \"\";\n\tfor (let i = 0; i < arr.length; i++)\n\t\tbuf += \"<h3>Note \" + (i + 1) + \"</h3><strong>\" + arr[i].date + \" \" + arr[i].time + \"</strong><br>\" + arr[i].notes + \"<br>\"\n\tbuf += \"<br>\"\n\t//\tresults.innerHTML = JSON.stringify(arr[0].notes);\n\tresults.innerHTML = buf;\n\t//\tresults.innerHTML = JSON.stringify(json);\n\t//\tresults.innerHTML = JSON.parse(json);\n}", "title": "" }, { "docid": "1062b2c8a54c20f421cec7e27201a876", "score": "0.53991467", "text": "function loadNote(note) {\n if(note) {\n currentNote = note;\n var text = note.get(\"text\");\n setNoteContents(text);\n }\n $(\"#notes\").modal();\n}", "title": "" }, { "docid": "1d8cf447ddca1783aab35df1f18103e4", "score": "0.5381943", "text": "function noteHtml(regexp, note) {\n db.validate(note); // TODO(wdm) Remove after validating all IO.\n var TITLE = highlight.text(regexp, note.title);\n var SUMMARY = highlight.text(regexp, db.summary(note, 100));\n var html = '<li><b>' + TITLE + '</b><i>' + SUMMARY + '</i></li>';\n return html;\n }", "title": "" }, { "docid": "2bbd14466b4e107ef58eb45064d60e3c", "score": "0.53082526", "text": "function findNote (objArray, noteTitle) {\n return objArray.find(function(note, index) {\n return note.title.toLowerCase() === noteTitle.toLowerCase()\n })\n}", "title": "" }, { "docid": "53707138cc60761949d0b14e68b55de5", "score": "0.52637225", "text": "function readOneNote(){\t\t\t\n\trl.question('Enter the name of the title:', function(answer){\n\t\tfindElement(obj,answer);\n\t});\n\t\t\n}", "title": "" }, { "docid": "20ed5f616241ee566c9b5fe1c7186270", "score": "0.5245303", "text": "async function printNotes() {\n // const md = await get('https://vladmandic.github.io/picovid/README.md');\n // if (md) document.getElementById('div-notes').innerHTML = marked(md);\n}", "title": "" }, { "docid": "f866b92f6715a603b71a9f6f594ea021", "score": "0.51528764", "text": "async function notes_get_note(req, res) {\n var note; \n \n try { \n note = await db.Notes.findOne({ \n where: {\n id: req.params.note_id\n },\n raw: true,\n })\n } catch(err) {\n null\n }\n\n note = JSON.parse(JSON.stringify(note))\n\n res.render('singleNote', { \n title: 'GET NOTE',\n results: note,\n });\n}", "title": "" }, { "docid": "bb3ed4ad45fc64d306558fc13242f7b5", "score": "0.5119443", "text": "function renderNote(note, notesDiv) {\n const noteDiv = document.createElement(\"div\");\n noteDiv.classList.add(\"note\");\n noteDiv.setAttribute(\"data-id\", note.id)\n notesDiv.appendChild(noteDiv);\n\n // Retrieve data\n const title = note.title;\n const desc = note.desc;\n const date = note.date;\n const time = note.time;\n const priority = note.priority;\n\n // Create DOM elements for data\n\n // Title\n const noteTitle = document.createElement(\"p\");\n noteTitle.classList.add(\"note-title\");\n noteTitle.innerHTML = title;\n noteDiv.appendChild(noteTitle);\n\n if(new Date().toISOString().split(\"T\")[0] <= date) {\n // Add clock fa icon showing how much time until the note's date!\n const clockIcon = document.createElement(\"div\");\n noteTitle.appendChild(clockIcon);\n clockIcon.classList.add(\"fas\", \"fa-clock\");\n clockIcon.innerHTML = \"\"\n clockIcon.style.color = getColorByPriority(priority);\n clockIcon.style.fontSize = \"22px;\"\n }\n\n \n // Hidden div containing rest of the info about this note\n const noteInfo = document.createElement(\"div\");\n noteInfo.classList.add(\"note-info\")\n noteInfo.style.display = \"none\";\n noteDiv.appendChild(noteInfo);\n\n // Description\n const noteDescDiv = document.createElement(\"div\");\n noteDescDiv.classList.add(\"note-desc-div\");\n const noteDesc = document.createElement(\"p\");\n noteDescDiv.appendChild(noteDesc);\n noteDesc.classList.add(\"note-desc\");\n noteDesc.innerHTML = desc;\n noteInfo.appendChild(noteDescDiv);\n\n // Date\n if(date !== \"\") {\n const notedate = document.createElement(\"p\");\n notedate.classList.add(\"note-date\");\n notedate.innerHTML = date;\n noteInfo.appendChild(notedate);\n }\n\n // Time\n if(time !== \"\") {\n const noteTime = document.createElement(\"p\");\n noteTime.classList.add(\"note-time\");\n noteTime.innerHTML = time;\n noteInfo.appendChild(noteTime);\n }\n\n // Edit button at the bottom\n const editBtn = document.createElement(\"btn\")\n noteInfo.appendChild(editBtn);\n editBtn.classList.add(\"btn\", \"btn-sm\", \"btn-danger\", \"btn-outline-white\")\n editBtn.innerHTML = \"Edit Note\";\n\n // Add event listener to that button\n\n editBtn.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n\n const noteDiv = e.target.parentElement.parentElement;\n // const noteId = noteDiv.getAttribute(\"data-id\");\n\n // Remove note's child elements\n Array.from(noteDiv.children).forEach(child => {\n child.remove()\n })\n\n // And render edit form in place of it\n renderEditNote(noteDiv, title, desc, date, time, priority);\n\n })\n \n\n // Toggle between showing noteInfo when clicking on a note (WITH FADE ANIMATION)\n noteDiv.addEventListener(\"click\", () => {\n if(noteInfo.style.display !== \"block\") {\n\n noteInfo.style.opacity = 0;\n noteInfo.style.display = \"block\";\n setTimeout(() => {\n noteInfo.style.opacity = 1;\n }, 100)\n } else {\n noteInfo.style.opacity = 0;\n setTimeout(() => {\n noteInfo.style.display = \"none\"; \n }, 500)\n }\n })\n\n \n // Set note's background color according to priority!\n const divColor = getColorByPriority(priority);\n noteDiv.style.cssText = `background-color: ${divColor}`;\n\n // Add delete button for note!\n const deleteNote = document.createElement(\"div\");\n deleteNote.classList.add(\"delete-note\", \"fas\", \"fa-times\");\n noteDiv.appendChild(deleteNote);\n\n // Add event listener for the button!\n deleteNote.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n if (confirm(\"Are you sure you want to delete this note? This action cannot be undone!\")) {\n const note = e.target.parentElement;\n const notes = e.target.parentElement.parentElement;\n\n const projectId = notes.getAttribute(\"data-id\");\n const noteId = note.getAttribute(\"data-id\");\n\n\n db.collection('Users')\n .doc(auth.currentUser.uid)\n .collection(\"Projects\")\n .doc(projectId)\n .collection(\"Notes\")\n .doc(noteId)\n .delete()\n .then(() => {\n location.reload();\n });\n \n }\n });\n \n }", "title": "" }, { "docid": "48b540253c60737b2193c9376cf015b3", "score": "0.5101692", "text": "function loadNote() {\n return API.get(\"notes\", `/notes/${props.match.params.id}`);\n }", "title": "" }, { "docid": "08f12d9f27e2817adc5250bcc3649e4f", "score": "0.5040356", "text": "async function showNote (event) {\n const note = event.target.parentNode.querySelector('textarea')\n if (note.style.display === 'none') {\n const id = event.target.parentNode.parentNode.parentNode.id.slice(4)\n const response = await fetchData(\n baseUrl + 'todo/' + id,\n 'GET',\n 'application/json'\n )\n const result = await response.json()\n console.log(result)\n result.forEach(element => {\n if (element.id === parseInt(event.target.id.slice(2))) note.value = element.note\n })\n note.style.display = 'block'\n } else {\n note.style.display = 'none'\n }\n}", "title": "" }, { "docid": "ef1adfffba216993c6a27b95c1e08385", "score": "0.50056225", "text": "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n\n let title = localStorage.getItem(\"titleget\");\n\n if (title == null) {\n titlelist = [];\n } else {\n titlelist = JSON.parse(title);\n }\n\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = ``;\n console.log(notesObj);\n addTit = document.getElementById(addTit);\n\n notesObj.forEach(function (element, index) {\n html += `<div class=\"noteCard my-2 mx-3 card\" style=\"width: 18rem; id=\"bruh\">\n <div class=\"card-body \" id=\"${index}\">\n \n <h5 class=\"card-title\">${titlelist[index]} <button type=\"button\" class=\"btn btn-link right\" id=\"hehe\" onclick=\"doYellow(${index})\"><i class=\"fas fa-bookmark book\" ></i></button></h5>\n <p></p>\n <hr>\n <p></p>\n \n <p class=\"card-text\">${element}</p>\n <button id =\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n <button id =\"${index}\" class=\"btn btn-primary mx-3\" onclick=\"editNote(this.id)\">Edit</button>\n </div>\n </div>`;\n }); //<i class=\"fas fa-bookmark book\" ></i>\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `No Notes added, Use \"Add Note\" to create one`;\n }\n}", "title": "" }, { "docid": "15afcbf54b7e7f562c1c4e4ce336f71e", "score": "0.4951146", "text": "function renderNewNote (note) {\n const noteHTML = createNoteHTML(note)\n const notesList = q('#notes-list')\n notesList.insertAdjacentHTML('beforeend', noteHTML)\n}", "title": "" }, { "docid": "95db330daa4473cd75cb79b27db38e3c", "score": "0.4943971", "text": "function DataNoteTitle(noteid) {\n\tvar title;\n\tvar content = DataNotes[noteid].content;\n\tvar lineFeed = content.indexOf(\"\\n\");\n\tif( lineFeed == -1 ) {\n\t\ttitle = content;\n\t} else {\n\t\ttitle = content.substring(0, lineFeed);\n\t}\n\tif( title.substr(0,4) == \"<!--\" ) {\n\t\tvar commentEnd = title.indexOf(\"-->\");\n\t\tif( commentEnd < 0 )\n\t\t\ttitle = title.substring(4);\n\t\telse\n\t\t\ttitle = title.substring(4, commentEnd);\n\t}\n\treturn title;\n}", "title": "" }, { "docid": "4f966d77e8e6a45e0c1cd97ce10d22ed", "score": "0.4926563", "text": "function newDateDiv(newNoteDiv, notes, index) {\r\n let dateDiv = document.createElement(\"div\");\r\n dateDiv.setAttribute(\"class\", \"dateDiv\");\r\n newNoteDiv.append(dateDiv);\r\n let dateSpan = document.createElement(\"span\");\r\n dateDiv.appendChild(dateSpan).innerHTML = \"Date: \";\r\n dateDiv.append(notes[index].date);\r\n}", "title": "" }, { "docid": "07be96fb2e974e23e5e4212fa5a096d0", "score": "0.4921522", "text": "function findAndReplace(event) {\n event.preventDefault()\n\n function saveNote(body, id) {\n return API.put(\"notes\", `/notes/${id}`, {\n body: body\n });\n }\n\n // Replace the string, case insensitive\n function replaceAll(str, srch, rplc) {\n var esc = srch.replace(/[-\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n var reg = new RegExp(esc, 'ig');\n return str.replace(reg, rplc)\n }\n\n try {\n setIsSaving(true)\n return Promise.all(notes.map(async (note) => {\n await saveNote({\n content: replaceAll(note.content, search, replace)\n }, note.noteId);\n })).then(() => {\n updateSearch(\"\")\n updateReplace(\"\")\n setIsSaving(false)\n })\n\n } catch (e) {\n onError(e);\n setIsSaving(false)\n }\n\n }", "title": "" }, { "docid": "13b86f219662653f9e12b5a94f5c0351", "score": "0.49124917", "text": "function getTeportIssueTitle() {\n const uid = util.getGitHubRef();\n const template = util.loadTemplate(\"reportIssueTitle\");\n const issueTitle = mustache_1.default.render(template, { uid });\n return issueTitle;\n}", "title": "" }, { "docid": "5fcc971ce405bed0cc4b811eb8a77754", "score": "0.48966467", "text": "function highlight_note(timestamp) {\n // Make sure a current note is selected. Default to top one\n if(current_note === undefined) {\n current_note_index = 0;\n current_note = notes.children[0];\n }\n\n // We save the initial current note so that it can be checked for change at the bottom of the function\n let initial_current_note = current_note;\n\n let current_note_timestamp = current_note.getAttribute(\"data_timestamp\");\n\n // The bellow code essentially scrolls through the notes until it finds the one matching the timestamp.\n\n if(timestamp > current_note_timestamp) { // We want to highlight a note further than the current one\n let next_note = notes.children[current_note_index+1];\n\n while(next_note !== undefined && timestamp > next_note.getAttribute(\"data_timestamp\")) {\n current_note_index++;\n next_note = notes.children[current_note_index + 1];\n }\n\n current_note = notes.children[current_note_index];\n } else if(timestamp < current_note_timestamp) { // We want to highlight a note before the current one\n // If the timestamp is already smaller than the current note, we know we have to go down at least note already.\n current_note_index--;\n current_note = notes.children[current_note_index];\n\n let previous_note = notes.children[current_note_index-1];\n\n while(previous_note !== undefined && timestamp < previous_note.getAttribute(\"data_timestamp\")) {\n current_note_index--;\n previous_note = notes.children[current_note_index - 1];\n }\n\n current_note = notes.children[current_note_index];\n }\n\n if(current_note !== initial_current_note) {\n initial_current_note.classList.remove(\"highlight\");\n current_note.classList.add(\"highlight\");\n current_note.scrollIntoView();\n }\n}", "title": "" }, { "docid": "0589265225f3bcce8803b4dc7d7c52ed", "score": "0.48768413", "text": "saveNote (newContent) {\n if (!this.openedNote) { return null; }\n\n // TODO: selected notebook\n const notebookPath = path.join(this.rootPath, 'notebook');\n\n this.openedNote.content = newContent;\n\n return this.notes.save({ notebookPath, note: this.openedNote })\n .then(() => this.findNotes());\n }", "title": "" }, { "docid": "f2a43d0d1e6373f9578fc2ff33da82ee", "score": "0.4871614", "text": "function read_notes(notesID){\n\n\t$(\"#loader_spinner\").show();\n\tjso.ajax({\n\t\tdataType: 'json',\n\t\turl: NOTESROUTE+\"/\"+notesID,\n\t\tmethod: 'GET',\n\t})\n\t.done(function(object) {\n\n\t\tif(object){\n\t\t\tentityBoxModule(object);\n\t \t}else{\n\t \t\tobject=\"not found\";\n\t \t}\n\n\t})\n\t.fail(function() {\n\t\tconsole.log(\"REST error. Nothing returned for AJAX.\");\n\t})\n\n}", "title": "" }, { "docid": "638b336e94050dd0c7fb67c525dbb655", "score": "0.48681882", "text": "function displayNotes() {\n console.log(\" getting notes async\");\n noteManager.getNotes()\n .then(notes => {\n console.log(\" getting notes async completed\");\n console.log(\"notes ::\", notes);\n }, (err) => {\n console.error(\"Error reading notes\", err);\n })\n}", "title": "" }, { "docid": "5f828e11cc81c308e8a105eea58a0974", "score": "0.48523802", "text": "filterNotesByTitle({commit}, value) {\n commit('filterNotes', value)\n }", "title": "" }, { "docid": "faba7eb260036b2fb8ce9f1c0089da71", "score": "0.4845194", "text": "getData(notes){\n const{insertElm,noNoteMsgElm} = this.selectors()\n let elm = ''\n if(notes.length>0){\n notes.forEach(element => {\n elm = `<div class=\"p-2 find\" id=note-${element.id}>\n <span class=\"titleCl\" id=\"nTitle\">${element.title}</span>\n <p class=\"text-center box mb-2\" id=\"nDes\">\n ${element.description}\n </p>\n <a class=\"btn btn-primary btn-sm\" id=\"note-edit\" title=\"Edit\">Edit</a>\n <a class=\"btn btn-danger btn-sm\" id=\"note-delete\" title=\"Delete\">Delete</a>\n ${element.dateTime} ${element.timeFromNow}\n </div>`\n insertElm.insertAdjacentHTML('beforeend',elm)\n });\n }else{\n noNoteMsgElm.style.display='block'\n }\n \n \n }", "title": "" }, { "docid": "110203f1f20e1d83ace3ae3c67ef95ac", "score": "0.48370034", "text": "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n \n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n let mark=element.title\n \n \n html +=\n ` <div class=\" noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n\n <div class=\"card-body\" >\n <i class=\"fa fa-bookmark-o ${element.b}\" aria-hidden=\"true\" id=\"${mark}\" onclick=\"bookmarkNote(this.id,${index})\" ></i>\n <h5 class=\"card-title\">${element.title} </h5>\n <p class=\"card-text\" id=${index}>${element.note}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Notes</button>\n <button id=\"${index}\" onclick=\"editNote(this.id)\" class=\"btn btn-primary\">Edit Notes</button>\n\n </div>\n </div>`\n \n\n });\n \n let notesElm = document.getElementById('notes');\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n }\n else {\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes`;\n }\n}", "title": "" }, { "docid": "aac1784e45ab408ee3594ce72d883e34", "score": "0.48181668", "text": "function findLyrics(artistName, songTitle) {\n var queryURL = \"https://api.lyrics.ovh/v1/\" + artistName + \"/\" + songTitle;\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n //console.log(\"current stuff\", response.lyrics);\n var pullLyrics = response.lyrics.replace(new RegExp(\"\\n\", \"g\"), \"<br>\");\n $(\"#outputSearch\").prepend(pullLyrics);\n });\n }", "title": "" }, { "docid": "aa44c4003e497e6feae475f81e8e2041", "score": "0.48062757", "text": "function tryGetTitleMeta() {\r\n\tvar title;\r\n\tvar xPath = \"//ul[@id='watch-description-extra-info']/li[3]/span[@class='metadata-info']\";\r\n\ttry {\r\n\t\tvar songNodes = document.evaluate(xPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);\r\n\t\tvar rawTitle = songNodes.singleNodeValue.firstChild.nodeValue;\t//rawSong still contains 'buy on' text.\r\n\t\trawTitle = removeBreaks(rawTitle);\r\n\t\ttitle = stringBetweenChars(rawTitle, \"\\\"\");\r\n\t\tif(typeof(title) === \"undefined\") {\r\n\t\t\ttitle = stringBetweenChars(rawTitle, \"'\");\r\n\t\t}\r\n\t} catch (e) {\r\n\t}\r\n\treturn title;\r\n}", "title": "" }, { "docid": "8c751f5b43f1c0ae4d6230a6f34b75f1", "score": "0.48027033", "text": "function getDay(line){\n var tmp = line.split('/');\n var months =['January','February','March','April','May','June','July','August','September','October','November','December'] \n day = tmp[0];\n month = months[tmp[1]-1];\n notebook_content +='<div class=\"blog-post-item\">'+\n '<div class=\"timeline-entry rounded\">'+day+'<span>'+month.substring(0,3)+'</span><div class=\"timeline-vline\"></div></div>'+\n '<br>'+'<p>';\n}", "title": "" }, { "docid": "52be5b3ece6c15bd571fad05d0fc4f08", "score": "0.47883072", "text": "async openNotes() {\n const openNotesButton = new BasicComponent(\n this.locateStrategy,\n `${this.selector} img[alt=\"note\"]`,\n );\n await openNotesButton.click();\n }", "title": "" }, { "docid": "c2ca22bf020c0c69c9fb0e4aec10cb3c", "score": "0.47834978", "text": "function showNotes(_callback){\n // w8 for diffrent func to end (main sorting)\n _callback();\n for(let i=0; i < notesList.length; i++)\n {\n let noteDiv = document.createElement(\"div\");\n noteDiv.className = \"note\";\n let noteHeader = document.createElement(\"h1\");\n noteHeader.className = \"noteHeader\";\n let noteDate = document.createElement(\"p\");\n noteDate.className = \"noteDate\";\n let noteHighlightIcon = document.createElement(\"i\");\n noteHighlightIcon.id = \"noteHighlightIcon\";\n noteHighlightIcon.className = \"material-icons\";\n noteHighlightIcon.innerHTML = \"star\";\n\n noteHeader.innerHTML = notesList[i].header;\n noteHeader.style.color = h1Color;\n noteDate.innerHTML = notesList[i].date;\n noteDate.style.color = pColor;\n let color = notesList[i].color;\n let highlighted = notesList[i].highlighted;\n\n noteDiv.addEventListener(\"mouseover\",\n () => noteDiv.style.background = color);\n noteDiv.addEventListener(\"mouseout\",\n () => noteDiv.style.background = offColor);\n noteDiv.addEventListener(\"click\",\n () => openNote(notesList[i]));\n\n\n noteDiv.appendChild(noteHeader);\n noteDiv.appendChild(noteDate);\n noteDiv.style.borderBottom = \"1px solid \"+borderColor;\n //if note is highlited, add to right div\n if(highlighted)\n {\n noteDiv.appendChild(noteHighlightIcon)\n document.getElementById(\"highlightedNotes\").appendChild(noteDiv);\n }\n else\n document.getElementById(\"notesList\").appendChild(noteDiv);\n }\n\n \n}", "title": "" }, { "docid": "f01f7703fdf4c68e4be805a63c089705", "score": "0.47794655", "text": "function loadNotes(hash){\n\n console.log(\"Retrieving the current library...\");\n chrome.storage.local.get({'library': []}, function(lib){\n raw_notes = lib.library;\n\n /* If the user has no notes, create a default new one and open it for them */\n if (raw_notes.length == 0) {\n createNote(\"Welcome to Notility!\", HTMLDocumentation, \"\");\n openNote(-1);\n return;\n }\n\n renderNotes();\n /* If the notes are being loaded from a hash search, filter the appropriate notes */\n if (hash) {\n chooseFilter(hash);\n document.getElementById(\"searcher\").value = hash;\n }\n\n /* Open a note for editing */\n chrome.storage.local.get({'activeNote':-1},function(activeID){\n openNote(activeID.activeNote);\n changeNoteHighlight(activeID.activeNote);\n });\n\n });\n \n}", "title": "" }, { "docid": "1d011bf6650029a9f0305cee63571cfe", "score": "0.47635847", "text": "function saveTitle() {\n\n var id = $(\"#current-note-display\")[0].getAttribute(\"data-id\");\n var title = $(\"#current-note-title\").text();\n editNote(id=id, title=title);\n\n //Replace title of note block in notes display with new title\n var curNote = findNoteElement(id);\n if (curNote != null) {\n curNote.innerHTML = trimTitle(title, titleDisplayLen);\n }\n\n}", "title": "" }, { "docid": "24a3022bd207a212758a565bb5ac34d8", "score": "0.47630185", "text": "function select_notebooks(filter){\r\n\t$(\"div#listNotebooks\").html(\"<img src='/static/images/103.gif'>\");\r\n\tCreateAJAX(\"/notebooks/list/select\",\"GET\",\"html\",filter)\r\n\t.done(function(response){\r\n\t\t$(\"div#listNotebooks\").html(response);\r\n\t\tguid_exists(config.evernote.default_notebook,\"txtNotebook\");\r\n\t})\r\n\t.fail(function(xhr){\r\n\t\t$(\"div#listNotebooks\").html(ERROR_NOTEBOOKS_LOAD);\r\n\t});\r\n}", "title": "" }, { "docid": "eb1bc95b49dc248fe0081765dee33abd", "score": "0.4755206", "text": "function createNote(noteText) {\n fetch(url, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", Authorization: \"Token \" },\n body: JSON.stringify({\n title: noteText,\n body: noteText,\n created_at: moment().format(),\n }),\n })\n .then((res) => res.json())\n .then((data) => renderListOfNotes(data));\n}", "title": "" }, { "docid": "40cc5e74186e3e5c2033dff53a0421ac", "score": "0.47457743", "text": "function getNotes () {\n showLoader();\n\n $.ajax({\n url : baseUri,\n headers : jsonHeader(),\n success : function (result) {\n rawList = result.data;\n\n renderNotes(rawList);\n\n hideLoader();\n },\n error : function (error) {\n console(error);\n hideLoader();\n }\n });\n}", "title": "" }, { "docid": "44281026841419a38946442bc639c08e", "score": "0.47412902", "text": "function notesSearchChanged(){\n const query = document.querySelector(\"#notes-panel input[type=search]\").value;\n if(query || query===\"\"){\n const webview = document.querySelector(`webview[src=\"${EDITOR_URI}\"]`);\n if(webview){\n webview.find(query);\n }\n }\n }", "title": "" }, { "docid": "7b79a429fcf0db4be9046f17bbcb7992", "score": "0.47336102", "text": "function findEntry(title){\n\t\t$(window).scrollTop($(\".entry:contains(\"+title+\"):first\").offset().top);\n\t}", "title": "" }, { "docid": "7142e3634fc8220b278bb02bd8de7484", "score": "0.4732387", "text": "function showNotes() {\n\tlet notes=localStorage.getItem('notes');\n\tlet title=localStorage.getItem('title');\n\tif(notes==null && title==null)\n\t{\n\t\tnotesObj=[];\n\t\ttitleObj=[];\n\t}\n\telse\n\t{\n\t\tnotesObj=JSON.parse(notes);\n\t\ttitleObj=JSON.parse(title);\n\t}\n\tlet html='';\n\tnotesObj.forEach(function (element,index) {\n\n\t\thtml+=`\t\n\t\t<div class=\"noteCard card my-2 mx-2\" style=\"width: 18rem;\">\n\t\t\t<div class=\"card-body\">\n\t\t\t\t<h5 class=\"card-title\">${titleObj[index]}</h5>\n\t\t\t\t<p class=\"card-text\">${element}</p>\n\t\t\t\t<button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\t});\n\tlet notesElm=document.getElementById('notes');\n\tif(notesObj.length!=0)\n\t{\n\t\tnotesElm.innerHTML=html;\n\t}\n\telse{\n\t\tnotesElm.innerHTML=`Nothing to show! Use \"Add a note\" section above to add notes`;\n\t}\n}", "title": "" }, { "docid": "1715363b2dbc505016b12029f501fb5d", "score": "0.47313982", "text": "function getBieuDoAndViewTitle() {\n let {month, year} = getMonthAndYear();\n titleChart.html(`<span>Biểu đồ tổng hợp trữ lượng khái thác khoáng sản từ tháng 1 đến tháng ${month} năm ${year} </span>`);\n let ngayDau = new Date(`${year}-01-01`).toISOString();\n let ngayCuoi = new Date(`${year}-12-31`).toISOString();\n bieuDoTongHop(ngayDau, ngayCuoi).then(rs => {\n if(rs.result === \"found\") {\n viewBieuDo(rs.data)\n } else {\n alterInfo(\"Chưa có thông tin thống kê biểu đồ\", TIME_ALTER);\n }\n }).catch(err => {\n alterWarning(\"Server Error\", TIME_ALTER);\n console.log(err);\n })\n}", "title": "" }, { "docid": "1214a7433757f0896759a228f5df79d8", "score": "0.4725932", "text": "function noteContent(nota){\r\n\tread.innerHTML = \r\n\t`\r\n\t<p><b>${title[nota]}<b/></p><br>\r\n\t<textarea class=\"content\" readonly=\"readonly\">${content[nota]}</textarea>\r\n\t`;\r\n}", "title": "" }, { "docid": "d363b4d6b634923d622dc0f1005dea5f", "score": "0.47246575", "text": "async pageTitle () {\n return new Promise(resolve => {\n this.page.evaluate(() => { return document.title },\n (err, result) => {\n resolve(result)\n })\n })\n }", "title": "" }, { "docid": "3146a99712975521688571162de76f7d", "score": "0.47219032", "text": "function sortNotesByTitle() {\n document.querySelector(\"#sort-by-body\").innerHTML = \"Sort A-Z by body: Off\";\n document.querySelector(\"#sort-by-title\").innerHTML = \"Sort A-Z by title: On\";\n document.querySelector(\"#sort-by-body\").classList =\n \"btn btn-secondary\";\n document.querySelector(\"#sort-by-title\").classList =\n \"btn btn-primary\";\n http\n .get(\"http://localhost:3000/notes\")\n .then(notes => notes.sort(sortByProperty(\"title\")))\n .then(data => ui.showNotes(data))\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "e84e605d3d3dadc3fe91fadbe7d568b3", "score": "0.47151223", "text": "function findNote(id) {\n for (note of raw_notes) {\n if (note[\"id\"] == id) {\n return note;\n }\n }\n return \"No note with matching ID\";\n}", "title": "" }, { "docid": "8f011eb88096fd88add8f1c15c4b272c", "score": "0.47128686", "text": "function addNote(note) {\n markup = marked(note.note.toString(), {sanitize: true})\n var p = notes.insert('div', '.note')\n .attr('class', 'note')\n p.append('p')\n .attr('class', 'date')\n .text(note.date)\n p.append('p')\n .attr('class', 'name')\n .text(note.name)\n p.append('p')\n .attr('class', 'note-text')\n .html(markup)\n}", "title": "" }, { "docid": "e0fd296e2f9d225f5bf645a0d2c1971b", "score": "0.47097027", "text": "async function searchForNoticeText(context) {\n return await searchForContent(context, [\n searchForCachedNoticeText,\n searchForLocalNoticeText,\n searchForRemoteNoticeText,\n searchForContainerNoticeText,\n ])\n}", "title": "" }, { "docid": "cf80c2c32ca840c85ce4e33694953a07", "score": "0.47044602", "text": "renderClinicalNote(item, i) {\n\n // If the note is selected and open, we want to use the selected className\n const selectedClassName = (Lang.isEqual(this.props.selectedNote, item) && Lang.isEqual(this.props.noteClosed, false)) ? \"selected\" : \"\";\n // If the note is in our array of search suggestions, we want to use the search-result className\n const searchedForClassName = Lang.includes(this.state.highlightedNoteIds, item.entryInfo.entryId.id) ? \"search-result\" : \"\";\n // If the note is currently highlighted in our searchSuggestions, we want to use the highlighted-result className\n const highlighedSearchSuggestionClassName = (!Lang.isEmpty(this.props.highlightedSearchSuggestion)\n && this.props.highlightedSearchSuggestion.section === \"Clinical Notes\"\n && this.props.highlightedSearchSuggestion.valueTitle !== \"Section\"\n && this.props.highlightedSearchSuggestion.valueTitle !== \"Subsection\"\n && Lang.isEqual(this.props.highlightedSearchSuggestion.note.entryInfo.entryId.id, item.entryInfo.entryId.id)\n && Lang.includes(this.state.highlightedNoteIds, item.entryInfo.entryId.id)) ? \"highlighted-result\" : \"\";\n\n return (\n\n <div\n ref={item.entryInfo.entryId.id}\n className={`note existing-note ${selectedClassName} ${searchedForClassName} ${highlighedSearchSuggestionClassName}`}\n key={i}\n onClick={() => {\n this.openNote(item);\n }}\n >\n <div className=\"existing-note-date\">{item.signedOn}</div>\n <div className=\"existing-note-subject\">{item.subject}</div>\n <div className=\"existing-note-author\">{item.createdBy}</div>\n\n {this.renderMetaDataText(item)}\n\n </div>\n );\n }", "title": "" }, { "docid": "e9248ee44848541f21aeaae765eeed84", "score": "0.4702703", "text": "static findNoteInKey(notes, key) {\n\t\t// loop through the note list\n\t\tfor (let i = 0; i < notes.length; i++) {\n\t\t\tvar note = notes[i];\n\t\t\tif (DataProcess.matchNoteInKey(note, key)) {\n\t\t\t\treturn note;\n\t\t\t}\n\t\t}\n\t\treturn notes[0];\n\t}", "title": "" }, { "docid": "ca57c7c66fe6975582851e089d04421a", "score": "0.47018877", "text": "function getIndexedEventNote(event) {\n\n if (!event.indexedNote && event.note && event.note.length) {\n var note = enyo.string.escapeHtml(event.note);\t// Let's escape prior to doing anything, regardless of length.\n//\t\t\tvar note = enyo.string.removeHtml(event.note);\t// removeHTML now uses a regex and also escapes the html.\n\n event.note.length < MAX_INDEXABLE_SIZE && (note = enyo.string.runTextIndexer(note)); // If we can, index the note.\n\n note = note.replace(/\\n/g, \"<br />\");\t\t\t// Finally, do the replace for breaks.\n\n event.indexedNote = note;\t\t\t\t\t\t// Save the indexed note on the event.\n }\n\n return event.indexedNote || \"\";\t// Return the best match.\n }", "title": "" }, { "docid": "6ed91e684234736076e8e118f237e9dd", "score": "0.4696812", "text": "function detailContent(index) { \n let div = document.getElementById(\"notes\");\n //for note 1 ,note 2 ...note[index]\n let y = div.getElementsByTagName(\"b\")[index].innerText;\n let note = document.getElementById(\"note\");\n note.innerText = y;\n //this will fetch the content and put it in modal\n let x= div.getElementsByTagName(\"p\").item(index).innerText;\n let para = document.getElementById(\"modalP\");\n para.innerText = x;\n //modal\n let modal = document.getElementById(\"myModal\");\n let span = document.getElementsByClassName(\"close\")[0];\n modal.style.display = \"block\";\n span.onclick = function () {\n modal.style.display = \"none\";\n }\n window.onclick = function (event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "d0b09077a7476bfe3130bf5b2d680507", "score": "0.4692659", "text": "function titlesearch(title, titletron) {\n \n console.log(title);\n \n //Pull in data \n d3.json(\"/rmovies\").then(function(data) {\n //Filter the data w/ title inputs\n var titledata = JSON.parse(data).filter(d => d.title == title);\n \n //Create array of data to display\n var displaydata = {\n \"Title\": titledata[0].title,\n \"Genre\": titledata[0].genres,\n \"Release Year\": titledata[0].year,\n \"Bechdel Rating\": titledata[0].bechdel_rating,\n \"IMDb Rating\": titledata[0].averageRating,\n \"Budget ($)\": titledata[0].budget_2013,\n \"Domestic Gross ($)\": titledata[0].domgross_2013,\n \"International Gross($)\": titledata[0].intgross_2013,\n };\n console.log(displaydata);\n //Add html to show stats in table for each title\n //Select div for stats\n //var titletron = d3.select('#ts1');\n console.log(titletron);\n // Use `.html(\"\") to clear any existing metadata\n titletron.html(\"\");\n\n console.log( Object.entries(displaydata));\n // Use `Object.entries` to add each key and value pair to the table\n Object.entries(displaydata).forEach(([key, value]) =>\n //console.log([key, value]),\n titletron.append(\"h5\").text(`${key} : ${value}`));\n \n }).catch(error => console.log(error)); \n\n }", "title": "" }, { "docid": "9dd8e20da743b20da9d75a97184b101f", "score": "0.46818817", "text": "function getNote(id) {\n $.getJSON('/notes/' + id)\n .done((note) => {\n simplemde.value(note.content);\n });\n}", "title": "" }, { "docid": "f6ab15ab04b81446d28cdf232ab3b007", "score": "0.4668435", "text": "function getPostDate($) {\n\n // \"May\" -> \"05\" ; \"November\" -> \"11\"\n function formatMonthToNumber(monthName) {\n const monthNum = MONTH_NAMES.indexOf(monthName) + 1;\n if (monthNum === 0) return new Error('Month’s no good.');\n\n return ( (monthNum < 10) ? '0' : '' ) + monthNum;\n }\n\n return Promise.resolve(\n $('#description_photo').children('p')\n .contents().eq(-2).text()\n ).then( dateStr => {\n\n dateStr = dateStr.trim();\n // now, `dateStr` is something like \"On May 05 2005\"\n\n const [year, month, day] = [\n dateStr.substr(-4),\n formatMonthToNumber(dateStr.substring(3, dateStr.length - 8)),\n dateStr.substr(-7, 2)\n ];\n\n return [$, year, month, day];\n });\n}", "title": "" }, { "docid": "016576f4592c81101f9f8af13755e252", "score": "0.46592274", "text": "function displayNotes(node, start, end, type, annotNo, author){\n //crea un nuovo oggetto range\n var range = document.createRange();\n //setta lo start del range\n range.setStart(node, start);\n //setta la fine del range\n range.setEnd(node, end);\n //crea un elemento span\n var span = document.createElement('span');\n\n //all'elemento span gli inserisce le varie classi e attributi in base al tipo di annotazione\n switch(type) {\n case \"cites\":\n $(span).addClass(\"citazioneAnnotato\");\n $(span).addClass(\"citazione\"); // nuovo campo\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).addClass(\"annotazione\");\n $(span).attr('annotation-id',annotNo);\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n case \"hasPublicationYear\":\n $(span).addClass(\"annoPubblicazioneAnnotato\");\n $(span).addClass(\"anno\"); // nuovo campo\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).addClass(\"annotazione\");\n $(span).attr('annotation-id',annotNo);\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n case \"title\":\n $(span).addClass(\"titoloAnnotato\");\n $(span).addClass(\"titolo\"); // nuovo campo\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).addClass(\"annotazione\");\n $(span).attr('annotation-id',annotNo);\n\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n case \"creator\":\n $(span).addClass(\"autoreAnnotato\");\n $(span).addClass(\"autore\"); // nuovo campo\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).addClass(\"annotazione\");\n $(span).attr('annotation-id',annotNo);\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n case \"doi\":\n $(span).addClass(\"doiAnnotato\");\n $(span).addClass(\"doi\"); // nuovo campo\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).addClass(\"annotazione\");\n $(span).attr('annotation-id',annotNo);\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n case \"comment\":\n $(span).addClass(\"commentoAnnotato\");\n $(span).addClass(\"commento\"); // nuovo campo\n $(span).addClass(\"annotazione\");\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).attr('annotation-id',annotNo);\n\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n\n case \"semiotics.owl#denotes\":\n $(span).addClass(\"retoricaAnnotato\");\n $(span).addClass(\"retorica\"); // nuovo campo\n $(span).addClass(\"annotazione\");\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).attr('annotation-id',annotNo);\n\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n\n case \"denotesRhetoric\":\n $(span).addClass(\"retoricaAnnotato\");\n $(span).addClass(\"retorica\"); // nuovo campo\n $(span).addClass(\"annotazione\");\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).attr('annotation-id',annotNo);\n\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n\n case \"hasURL\":\n $(span).addClass(\"urlAnnotato\");\n $(span).addClass(\"url\"); // nuovo campo\n $(span).addClass(\"annotazione\");\n var authorr = author.replace(/[^\\w\\s]/gi, '');\n authorr = authorr.replace(/ /g, '');\n $(span).addClass(authorr);\n $(span).attr('annotation-id',annotNo);\n\n if(!$.isNumeric(annotNo)){\n $(span).attr('temp-annotation','tempAnnotation'+annotNo.substr(4));\n setModalTempAnnotation($(span),annotNo);\n } else {\n setModalSingleAnnotation($(span), annotNo);\n }\n break;\n default:\n $(span).contents().unwrap();\n $(span).remove();\n break;\n }\n\n visualizzaPerAutore(author);\n //inserisce lo span alla interno del nodo selezionato\n range.surroundContents(span);\n return $(span);\n}", "title": "" }, { "docid": "06061b432eac0c4c64035f888fa8b2ee", "score": "0.4657771", "text": "function getNoteTemplate(noteObj, noteTemplate) {\n noteDiv = noteMaker(noteObj, noteTemplate).firstChild;\n content.insertBefore(noteDiv, content.childNodes[0]);\n noteDiv.classList.add('show');\n noteDiv.classList.remove('hide');\n }", "title": "" }, { "docid": "009f71e372654d067c332a04970af27f", "score": "0.4655695", "text": "function getNote() {\n\t\tvar note = JSON.parse(localStorage.getItem('note'))\n\t\tif (note != null) {\n\t\t\tfor (var i = 0; i < note.length; i++) {\n\t\t\t\tnote[i].date = moment(note[i].date, 'MMMM Do YYYY, h:mm:ss a').fromNow();\n\t\t\t}\n\t\t}\n\t\treturn note;\n\t}", "title": "" }, { "docid": "4827a1de8045b42649a1b65e24192041", "score": "0.46491155", "text": "function loadNotes() {\n\t$.ajax({\n\t\turl: \"/api/event/\"+window.ename,\n\t\ttype: \"GET\",\n\t\tdata: JSON,\n\t\terror: function(resp){\n\t\t\tconsole.log(\"Error Function!\");\n\t\t\tconsole.log(resp);\n\t\t},\n\t\tsuccess: function (resp) {\n\t\t\tconsole.log(\"Success Function!\");\n\t\t\t//console.log(\"BEFORE\",datapassed);\n\t\t\tconsole.log(resp);\n\t\t\tnicedata=resp;\n\n\t\t\tconsole.log(\"AFTER\",nicedata);\n\t\t\tvar htmlString = noteTemplate(nicedata.doc);\n\t\t\t$('#stuff').append(htmlString);\n\n\t\t\tgetInstagramData(nicedata.doc.instagram);\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0697ae5ad5d1af3b26aba7bf2ae1ae3b", "score": "0.46403354", "text": "async function show_hide_notes_history() {\n\n\t// get video notes\n\tvar videoId = yt_player.getVideoData()['video_id'];\n\n\tif (areNotesAvailable(videoId)) {\n\n\t\tvar response = await getVideoNotes(videoId);\n\n\t\tresponse.json().then((data) => {\n\n\t\t\tif (!data.error && data.note != undefined) {\n\n\t\t\t\tdata.note.note_content.sort(noteCompareByTime);\n\n\t\t\t\tvar pdfDoc = new jsPDF();\n\n\t\t\t\tpdfDoc.setFontSize(12);\n\t\t\t\tvar pageHeight = pdfDoc.internal.pageSize.height;\n\t\t\t\tvar pageWidth = pdfDoc.internal.pageSize.width;\n\n\t\t\t\tvar x = 10;\n\t\t\t\tvar y = 10;\n\t\t\t\tvar lines = 0;\n\t\t\t\tvar spacing = 5;\n\n\t\t\t\tfor(var i = 0; i < data.note.note_content.length; i++) {\n\n\t\t\t\t\tvar formated_note = pdfDoc.splitTextToSize(data.note.note_content[i].note_text, pageWidth);\n\t\t\t\t\tfor (var k = 0; k < formated_note.length; k++) {\n\n\t\t\t\t\t\tvar text = formated_note[k];\n\n\t\t\t\t\t\tif (k === 0) {\n\t\t\t\t\t\t\ttext = '\\u2022 ' + formated_note[k];\n\t\t\t\t\t\t\tlines++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ty = 10 + (lines*spacing);\n\t\t\t\t\t\ty = y % pageHeight;\n\t\t\t\t\t\tpdfDoc.text(x, y, text);\n\t\t\t\t\t\tif (y >= pageHeight-spacing*2) {\n\t\t\t\t\t\t\tpdfDoc.addPage();\n\t\t\t\t\t\t\tlines+= 3;\n\t\t\t\t\t\t\ty = spacing*2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlines++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tpdfDoc.save(\"notes.pdf\");\n\n\t\t\t}\n\n\t\t});\n\n\t}\n\n}", "title": "" }, { "docid": "3ad81455ca0f18057948bf0faee88045", "score": "0.46365708", "text": "function html(note, formatter, done) {\n var formattedResources = {};\n\n if(!done) {\n done = formatter;\n formatter = null;\n }\n\n if(note.resources && formatter) {\n async.each(note.resources,\n function(resource, nextResource) {\n var resourceHash = new Buffer(resource.data.bodyHash).toString('hex');\n formatter(resource, function(err, replacement) {\n formattedResources[resourceHash] = replacement;\n nextResource(err);\n });\n },\n function(err) {\n console.log(formattedResources);\n done(note.content);\n }\n );\n } else {\n console.log('No resources');\n done(note.content);\n }\n\n}", "title": "" }, { "docid": "8cf6b06d9a110530395d72c1982bd1c7", "score": "0.46296677", "text": "function getDescription(partition, local_tag){\r\n var partelem = $(\"span.tag:contains(\" + local_tag + \")\").filter(function(){\r\n return $(this).parent().find(\"span.partition\").text() == partition;\r\n });\r\n return partelem.parents(\"li.note_header\").children(\"ul.description\").text();\r\n}", "title": "" }, { "docid": "230180471f7064a7c82d2d005d102188", "score": "0.46279907", "text": "#findMissingRnb() {\n for (let i=0; i<this.#headings.length; i++) {\n let str = this.#headings[i].headingText.toLowerCase().trim();\n if (this.#sourceRules.isResearchNoteBox(str)) {\n if (!this.#researchNoteBoxes.includes(str)) {\n this.#missingRnb.push(this.#headings[i].headingText);\n this.#style.bioMissingResearchNoteBox = true;;\n }\n }\n }\n }", "title": "" }, { "docid": "e023530d2ad63bc047bd8467338bf6ba", "score": "0.46275872", "text": "async function getAllNotesDate(date) {\n const startDate = moment(date).format(\"YYYY-MM-DD\");\n // sets startDate with date passed into function\n const endDate = moment().format(\"YYYY-MM-DD\");\n // sets endDate to now\n\n return getAllNotesDateRange(startDate, endDate);\n // returns all posts between startDate and now using the getAllNotesDateRange function\n}", "title": "" }, { "docid": "3b3248cd60439062322b21d81bdd1b20", "score": "0.46236563", "text": "async function searchByTitle (event) {\r\n try {\r\n event.preventDefault(); // prevent a new webpage being loaded\r\n\r\n const keywords = document.getElementById('titleKeywords').value;\r\n\r\n /* send get request */\r\n\r\n const response = await fetch('http://127.0.0.1:8090/titles?search=' + keywords);\r\n\r\n const body = await response.text();\r\n\r\n const results = JSON.parse(body);\r\n // call table constructing function that's shared with the searchByStatus() function\r\n buildReportsTable(results);\r\n } catch (e) {\r\n alert('The server could not by reached. Try again later. Error: ' + e); // handles server disconnection\r\n }\r\n}", "title": "" }, { "docid": "839f2f4e33c74891769f96cc697f821c", "score": "0.46138993", "text": "function getSharedNotes(username) {\n notesModel\n .find({ sharedWith: username.toString() })\n .then(response => {\n console.log(\"Getting shared notes successfull. Response -> \" + response);\n console.log(\n \"Shared return object -> \" + { success: true, message: response }\n );\n return { success: true, message: response };\n })\n .catch(err => {\n console.log(\n \"Shared notes were not retrieved successfully. Error -> \" + err\n );\n return {\n success: false,\n message:\n \"We had a problem getting all the notes for the specified user where he is the shared user.\"\n };\n });\n}", "title": "" }, { "docid": "3e745ab4e5fcd97e2c574c4d96b2aa0d", "score": "0.46090636", "text": "function renderNotes(existingNotes) {\n const notes = existingNotes;\n const notesRender = `\n <div class=\"notes-parent\">\n <p class=\"notes-added\">${notes}</p>\n `\n const notesOutputEelement = $('.notes');\n notesOutputEelement.prop('hidden', false).append(notesRender);\n}", "title": "" }, { "docid": "25eedcff5d6cb45fed9ef0d844723136", "score": "0.46033764", "text": "async waitForPageTitle (expected) {\n var waitFor = this.waitFor.bind(this)\n var pageTitle = this.pageTitle.bind(this)\n return new Promise(async resolve => {\n var result = await waitFor(async () => {\n var title = await pageTitle()\n if (expected instanceof RegExp) {\n return expected.test(title)\n } else {\n return title === expected\n }\n })\n resolve(result)\n })\n }", "title": "" }, { "docid": "ec44d4c5363791c85ce7c156594bd9e8", "score": "0.45967942", "text": "function getNotes(numNotes) {\n\tfor (var i = 0; i < numNotes; i++) {\n\t\tgetNote();\n\t}\n}", "title": "" }, { "docid": "d1340c88670ef4109720fbbfdab57f41", "score": "0.45864454", "text": "function showNotes() {\n\n}", "title": "" }, { "docid": "19c15b64999d8020286bb77045a3e10b", "score": "0.45812318", "text": "function searchElContent(title,content) {\n var match = content.match(templates[targetTemplate].regex);\n if(match) {\n templates[targetTemplate].path(match, function(targetPath){\n if(targetPath) {\n var wpSuggestion = {\n url: wikihost + '/wiki/' +\n encodeURIComponent(title.replace(/ /g,'_'))\n };\n var targetSuggestion = {\n url: templates[targetTemplate].hostname + targetPath\n };\n targetSuggestion.notes='WELP ' + title\n +'\\nCapture: ' + match[0];\n \n var parend = title.match(/^(.*) \\((.*)\\)$/);\n if(parend){\n var scope = parend[2];\n //Easy way to knock out MANY of these scope parentheticals\n if(scope.match(/film$/) || scope.match(/TV series$/)){\n wpSuggestion.scope = scope;\n wpSuggestion.topic = parend[1];\n targetSuggestion.scope = scope;\n targetSuggestion.topic = parend[1];\n } else {\n //I'll probably delete the paren in the title in revision (ie. if it's \"musical\"),\n //but it might be part of the name (ie. some title that ends with parentheses)\n //in which case I'll delete the scope\n wpSuggestion.scope = scope;\n wpSuggestion.topic = title;\n targetSuggestion.scope = scope;\n targetSuggestion.topic = title;\n }\n } else {\n wpSuggestion.topic = title;\n targetSuggestion.topic = title;\n }\n suggest(wpSuggestion);\n suggest(targetSuggestion);\n } else {\n console.log('! WELP:NOID '+title+' | '+match[0]);\n }\n });\n } else {\n console.log('! WELP:TNIEL '+title);\n }\n}", "title": "" }, { "docid": "dfd7b367bce06cbe61f0cecf7e536ae8", "score": "0.45800108", "text": "function announceShow (title, channel, age, synopsis)\n{\n var whichs = ['This is {title}', 'Your\\'e watching {title}', 'Here is {title}', 'Now tuned to {title}'];\n var wheres = ['on the {channel} channel', 'on {channel}', 'from {channel}', 'from the folks at {channel}'];\n var whens = ['It\\'s been on for {age}', 'It started {age} go', 'It kicked off {age} ago'];\n\n var which = whichs.any ().replace ('{title}' , '\"' + title + '\"');\n var where = wheres.any ().replace ('{channel}' , '\"' + channel + '\"');\n var when = whens.any ().replace ('{age}' , descTime (age));\n\n return which + ' ' + where + '. ' + when + '. ' + synopsis;\n}", "title": "" }, { "docid": "c940be99febe8b8b052f98cab4a75da6", "score": "0.45799708", "text": "function getNoteNumber(){\n var startKey = 'note_'+groupNumber;\n db.allDocs({\n include_docs: true,\n attachements: true,\n startkey: startKey,\n endkey: startKey+'\\uffff'\n }).then(function(notes){\n for(var i=0; i < notes.rows.length; i++){\n if(notes.rows[i].doc.author == playerNumber){\n allNotes++;\n }\n }\n });\n}", "title": "" }, { "docid": "1e07db71d702226c4b55dd392a306dc7", "score": "0.4579551", "text": "getNotes(callback) {\n $.ajax({\n method: 'GET',\n url: '/api/notes/',\n success: (res) => {\n if (callback) {\n callback(res);\n }\n },\n });\n }", "title": "" }, { "docid": "2910d64ffb091011d0d523da1d6aef31", "score": "0.45793098", "text": "function update_note(event, note_id, new_title, new_content) {\n\tlet entry = \"{{entry.name}}\";\n\t// Send data\n\tfetch(`/entries/${entry}`, {\n\t\tmethod: 'PUT',\n\t\tbody: JSON.stringify({\n\t\t\tnote: note_id,\n\t\t\tedit: true,\n\t\t\ttitle: new_title,\n\t\t\tcontent: new_content\n\t\t})\n\t})\n\t\t.then(response => {\n\t\t\t// Update content\n\t\t\tfetch(`/note/${note_id}`)\n\t\t\t\t.then(response => response.json())\n\t\t\t\t.then(data => {\n\t\t\t\t\tdocument.querySelector('.note_title').textContent = data.title;\n\t\t\t\t\tdocument.querySelector('.note_body').textContent = data.content;\n\t\t\t\t})\n\t\t\t\t.catch(err => console.error(err));\n\t\t})\n\t\t.catch(error => console.log('Error:', error));\n}", "title": "" }, { "docid": "278e9719121628bebaffa205ad1f9749", "score": "0.45705125", "text": "function updateNote() {\n const tx = db.transaction(\"personal_notes\", \"readwrite\");\n const pNotes = tx.objectStore(\"personal_notes\");\n\n const thisDay = new Date(calendar.currentData.viewTitle);\n const date = `${thisDay.getFullYear()}-${\n thisDay.getMonth() + 1\n }-${thisDay.getDate()}`;\n const request = pNotes.get(date);\n\n request.onerror = function err(error) {\n // Handle errors!\n console.log(error);\n };\n request.onsuccess = function success(e) {\n const data = e.target.result;\n data.text = document.getElementById(\"notelist\").innerHTML;\n\n const requestUpdate = pNotes.put(data);\n requestUpdate.onerror = function err(error) {\n console.log(error);\n };\n requestUpdate.onsuccess = function successful() {\n console.log(\"updated\");\n };\n };\n}", "title": "" }, { "docid": "b5d8ecea78484ceca769de09b52ea715", "score": "0.456734", "text": "function findTitleElement(title) {\n const firstHalf = title.substring(0, title.length / 2)\n const secondHalf = title.substring(title.length / 2)\n const body = page.querySelector('body')\n const elements = Array.from(body.querySelectorAll('*')).filter(node => {\n return node.innerText\n && (node.innerText.includes(firstHalf) || node.innerText.includes(secondHalf))\n && node.innerText.trim().length <= title.length\n })\n\n console.log('title nodes', {elements})\n}", "title": "" }, { "docid": "886034a32af954ca0ad06ce9dc6c1d74", "score": "0.45647395", "text": "function parseNotes(f) {\n // find script tag\n console.log('content is ' + f.content.substring(0, 100));\n const lines = f.content.split(\"\\n\");\n // console.log('lines are ' + lines.length + \" \" + JSON.stringify(lines));\n let s = \"\";\n let inScript = false;\n for (var k = 0; k < lines.length; k++) {\n const line = lines[k].trim();\n // console.log('line is ' + line);\n if (inScript) {\n if (line == \"</script>\") {\n break;\n } else {\n s = `${s} ${line}`;\n }\n } else if (line == \"<script>\") {\n inScript = true; \n continue;\n }\n }\n \n // console.log(\"got s \" + s.substring(0, 200));\n eval(s);\n const keys = Object.keys(SLConfig.deck.notes);\n // console.log(\"keys \" + JSON.stringify(keys));\n\n // sort keys by when they appear in string!\n keys.sort((a, b) => {\n return f.content.indexOf(a) - f.content.indexOf(b);\n });\n\n // console.log(\"sorted keys \" + JSON.stringify(keys));\n f.slideInfo = [];\n const existingIDs = {};\n let pNode = \"\";\n let prevProj = \"\";\n let prevSearchString = \"\";\n let prevUnlock = \"\";\n let prevFull = \"\";\n let prevScaleRatio = \"\";\n\n for (let j = 0; j < keys.length; j++) {\n var k = keys[j];\n const ind1 = f.content.indexOf(k);\n const ind2 = f.content.substring(ind1 + k.length).indexOf(k);\n if (ind2 < 0) continue;\n const n = SLConfig.deck.notes[keys[j]];\n const nlines = n.split(\"\\n\");\n // console.log(\"nlines \" + nlines);\n const si = {};\n\n if (nlines[0].indexOf(\"//#ID\") < 0) continue;\n\n const parts = nlines[0].replace(\"//\", \"\").split(\"||\");\n for (let x = 0; x < parts.length; x++) {\n // console.log(\"p \" + x + \" \" + parts[x].trim());\n const pp = parts[x].trim().split(\" \"); \n // console.log(\"pp[0] \" + pp[0]);\n if (pp[0].toUpperCase() == \"#ID\") {\n si.ID = pp[1].trim();\n if (existingIDs[si.ID]) {\n console.log(`found duplicate ID!! ${si.ID}`);\n process.exit();\n } else {\n existingIDs[si.ID] = 1;\n }\n }\n if (pp[0].toUpperCase() == \"#TYPE\") { \n si.TYPE = pp[1].trim().toLowerCase(); \n if (si.TYPE.includes(\"coding\") && si.TYPE != \"coding\") {\n console.log(`wrong coding ID!! ${si.TYPE}`);\n process.exit();\n }\n }\n if (pp[0].toUpperCase() == \"#WINDOWS\" || pp[0].toUpperCase() == \"#WINDOW\") { si.WINDOWS = pp[1].trim(); }\n if (pp[0].toUpperCase() == \"#CONDITION\") { si.TESTCONDITION = pp[1].trim(); }\n if (pp[0].toUpperCase() === \"#IFRAME\") { si.IFRAME = pp[1].trim(); };\n if (pp[0].toUpperCase() === \"#SCRATCHUNLOCKED\") { \n si.SCRATCHUNLOCKED = 1; \n prevUnlock = si.SCRATCHUNLOCKED;\n };\n if (pp[0].toUpperCase() === \"#SCRATCHFULL\") { \n // console.log(\"\\n\\n\\nfound scratch full\")\n si.SCRATCHFULL = 1; \n prevFull = si.SCRATCHFULL;\n };\n // console.log(\"checking pp[0].toUpperCase() \" + pp[0].toUpperCase());\n if (pp[0].toUpperCase() == \"#STARTINGBLOCKSTRING\") { \n si.STARTINGBLOCKSTRING = parts[x].trim().substring(21).trim(); \n prevSearchString = si.STARTINGBLOCKSTRING;\n console.log(\"adding STARTINGBLOCKSTRING \" + si.STARTINGBLOCKSTRING + \" \" + JSON.stringify(si));\n \n }\n if (pp[0].toUpperCase() == \"#LOCALE\") { \n si.LOCALE = pp[1].trim(); \n console.log(\"adding LOCALE \" + si.LOCALE);\n }\n if (pp[0].toUpperCase() == \"#SCALERATIO\") { \n si.SCALERATIO = parts[x].trim().substring(12).trim(); \n prevScaleRatio = si.SCALERATIO;\n console.log(\"adding scale ratio \" + si.SCALERATIO);\n }\n if (pp[0].toUpperCase() == \"#PROJECTID\") { \n si.PROJECTID = pp[1].trim(); \n prevProj = si.PROJECTID;\n }\n if (pp[0].toUpperCase() == \"#DOWNLOADLINK\") { \n si.DOWNLOADLINK = pp[1].trim(); \n }\n if (pp[0].toUpperCase() == \"#HIDEOVERLAY\") { \n si.HIDEOVERLAY = pp[1].trim(); \n }\n \n if (pp[0].toUpperCase() == \"#TITLE\") { si.TITLE = parts[x].trim().substring(6).trim(); }\n if (pp[0].toUpperCase() == \"#NODE\") {\n si.NODE = parts[x].trim().substring(6);\n pNode = si.NODE; // same for next node\n }\n }\n if (!si.NODE) {\n si.NODE = pNode;\n }\n if (!si.PROJECTID && (\"coding\" == si.TYPE || \"hint\" == si.TYPE || \"solution\" == si.TYPE ) ) {\n // console.log(\"si.TYPE \" + si.TYPE + \" pid \" + si.PROJECTID + \" prevProj \" + prevProj);\n si.PROJECTID = prevProj;\n // console.log(JSON.stringify(si));\n }\n\n if (!si.STARTINGBLOCKSTRING && (\"hint\" == si.TYPE || \"solution\" == si.TYPE ) && prevSearchString != \"\" ) {\n // console.log(\"si.TYPE \" + si.TYPE + \" pid \" + si.PROJECTID + \" prevProj \" + prevProj);\n si.STARTINGBLOCKSTRING = prevSearchString;\n // console.log(JSON.stringify(si));\n }\n if (!si.SCRATCHUNLOCKED && (\"hint\" == si.TYPE || \"solution\" == si.TYPE ) && prevUnlock != \"\" ) {\n // console.log(\"si.TYPE \" + si.TYPE + \" pid \" + si.PROJECTID + \" prevProj \" + prevProj);\n si.SCRATCHUNLOCKED = prevUnlock;\n // console.log(JSON.stringify(si));\n }\n if (!si.SCRATCHFULL && (\"hint\" == si.TYPE || \"solution\" == si.TYPE ) && prevFull != \"\" ) {\n // console.log(\"si.TYPE \" + si.TYPE + \" pid \" + si.PROJECTID + \" prevProj \" + prevProj);\n si.SCRATCHFULL = prevFull;\n // console.log(JSON.stringify(si));\n }\n if (!si.SCALERATIO && (\"hint\" == si.TYPE || \"solution\" == si.TYPE ) && prevScaleRatio != \"\" ) {\n // console.log(\"si.TYPE \" + si.TYPE + \" pid \" + si.PROJECTID + \" prevProj \" + prevProj);\n si.SCALERATIO = prevScaleRatio;\n // console.log(JSON.stringify(si));\n }\n\n // also look for robot code and test script\n\n for (var k = 0; k < nlines.length; k++) {\n const ss = nlines[k];\n // console.log(\"ss is \" + ss);\n if (ss.trim() == \"\") continue;\n if (ss.indexOf(\"////notes\") >= 0) break;\n if (ss.indexOf(\"#quickinput\") >= 0) {\n // save quick input question\n const parts = ss.split(\"||\");\n si.QUICKQUESTION = parts[1].trim();\n } else if (ss.indexOf(\"#STARTROBOTCODE\") >= 0 && ss.indexOf(\"#STARTROBOTCODEANSWER\") < 0) {\n si.ROBOTCODE = \"\";\n k++;\n var ss1 = nlines[k];\n while (ss1.indexOf(\"#ENDROBOTCODE\") < 0) {\n si.ROBOTCODE += `${ss1}\\n`;\n k++;\n ss1 = nlines[k];\n }\n continue;\n } else if (ss.indexOf(\"#STARTTESTSCRIPT\") >= 0) {\n si.TESTSCRIPT = \"\";\n k++;\n var ss1 = nlines[k];\n while (ss1.indexOf(\"#ENDTESTSCRIPT\") < 0) {\n si.TESTSCRIPT += `${ss1}\\n`;\n k++;\n ss1 = nlines[k];\n }\n continue;\n } else if (ss.indexOf(\"#STARTROBOTCODEANSWER\") >= 0) {\n si.ANSWERCODE = \"\";\n k++;\n var ss1 = nlines[k];\n while (ss1.indexOf(\"#ENDROBOTCODEANSWER\") < 0) {\n si.ANSWERCODE += `${ss1}\\n`;\n k++;\n ss1 = nlines[k];\n }\n continue;\n } else if (ss.indexOf(\"#STARTTESTSCRIPTANSWER\") >= 0) {\n si.ANSWERSCRIPT = \"\";\n k++;\n var ss1 = nlines[k];\n while (ss1.indexOf(\"#ENDTESTSCRIPTANSWER\") < 0) {\n si.ANSWERSCRIPT += `${ss1}\\n`;\n k++;\n ss1 = nlines[k];\n }\n continue;\n }\n }\n\n\n f.slideInfo.push(si);\n if (si.TYPE === \"endoflesson\") break;\n }\n}", "title": "" }, { "docid": "c3ee16a52524204e306a4c2f964de957", "score": "0.45575497", "text": "function findBook(event) {\n event.preventDefault();\n let bookTitle = search.value;\n console.log(bookTitle)\n fetch(`http://openlibrary.org/search.json?title=${bookTitle}`, requestOptions)\n .then(response => response.json())\n .then(result => {\n console.log(result.docs)\n writerText.innerHTML = result.docs[0][\"author_name\"][0];\n titleText.innerHTML = result.docs[0].title;\n imageBox.src = `http://covers.openlibrary.org/b/id/${result.docs[0].cover_i}-L.jpg`;\n writerText2.innerHTML = result.docs[1][\"author_name\"][0];\n titleText2.innerHTML = result.docs[1].title;\n imageBox2.src = `http://covers.openlibrary.org/b/id/${result.docs[1].cover_i}-L.jpg`;\n writerText3.innerHTML = result.docs[2][\"author_name\"][0];\n titleText3.innerHTML = result.docs[2].title;\n imageBox3.src = `http://covers.openlibrary.org/b/id/${result.docs[2].cover_i}-L.jpg`;\n })\n .catch(error => console.log('error', error));\n}", "title": "" }, { "docid": "9ad855de127d2b630d0f5d8327b4007a", "score": "0.45536318", "text": "function showNotes() {\n let html = \"\";\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesAr = [];\n\n }\n else {\n notesAr = JSON.parse(notes);\n }\n\n notesAr.forEach(function (element, index) {\n if (element.title != \"\" && element.text != \"\") {\n html +=\n `\n <div class=\"card\">\n <div class=\"card-header\" id=\"heading${index}\">\n <h2 class=\"mb-0\">\n <button class=\"btn btn-link collapsed\" type=\"button\" data-toggle=\"collapse\" data-target=\"#collapse${index}\" aria-expanded=\"true\" aria-controls=\"collapse${index}\">\n ${element.title}\n </button>\n </h2>\n </div>\n \n <div id=\"collapse${index}\" class=\"collapse\" aria-labelledby=\"heading${index}\" data-parent=\"#notes\">\n <div class=\"card-body\">\n ${element.text}\n </div>\n <button id=${index} onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n <button onclick=\"dictateNote('${element.text}');\" class=\"btn btn-primary\">Dictate Note</button>\n </div>\n </div>`;\n }\n });\n\n\n let notesElm = document.getElementById('notes');\n let nottTitle = document.getElementById(\"divTitle\");\n if (notesAr.length != 0) {\n\n notesElm.innerHTML = html;\n }\n else {\n notesElm.innerHTML = `Nothing to show! Please add a note`;\n }\n\n}", "title": "" }, { "docid": "0ad7cabc56e541d8ac1af4688e584f79", "score": "0.45507902", "text": "function saveNote(subject, notebook, body, tags) {\n var params = {\n subject: subject,\n notebook: notebook,\n body: body,\n tags: tags\n }\n\n chrome.storage.sync.get('currentUser', function(result) {\n var currentUser = result.currentUser;\n\n chrome.storage.sync.get('notebooks', function(result) {\n result = result.notebooks\n\n var selectedNotebookName = $('#notebook').val();\n var selectedNotebookObj;\n\n for (var i = 0; i < result.length; i++) {\n if (result[i].title === selectedNotebookName) var selectedNotebookObj = result[i];\n }\n\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", 'http://localhost:1337/api/notebooks/' + selectedNotebookObj._id + '/notes/', true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n\n xhr.onreadystatechange = function() {\n if(xhr.readyState == 4 && xhr.status == 200) {\n window.location.href = 'noteSaved.html';\n }\n }\n xhr.send(JSON.stringify(params));\n })\n })\n}", "title": "" }, { "docid": "8d401fa8284c9589a81227657074e4c9", "score": "0.4546782", "text": "getAllNotes() {\n\n return this._fetch({path: \"notes\", method: \"get\"})\n .then(this._getBodyContent)\n }", "title": "" }, { "docid": "a56d882d89b887e39214283f1973fb57", "score": "0.45425764", "text": "function addTitleToCodeTag() {\n var SPAN = document.createElement(\"SPAN\");\n SPAN.innerText = \"etc\";\n SPAN.classList.add(\"etc-span\");\n SPAN.title = '\"etc\" represents the configuration directory of Opencast.\\nThis directory is often located at \"/etc/opencast\".';\n\n let branch = 'develop';\n if (window.location.host == 'docs.opencast.org') {\n branch = window.location.pathname.substring(1).replace(/\\/admin.*/, '');\n }\n const repobase = `https://github.com/opencast/opencast/blob/${branch}/`;\n\n var codeElementList = document.getElementsByTagName(\"CODE\");\n for (var i = 0; i < codeElementList.length; i++) {\n var CODE = codeElementList[i];\n\n if (typeof CODE.innerText !== 'undefined') {\n if (CODE.innerText.startsWith('etc/')) {\n CODE.innerHTML = CODE.innerHTML.replace(/^etc/, SPAN.outerHTML);\n\n // Link repository\n let a = document.createElement('a');\n a.innerHTML = '<i style=\"color: black; vertical-align: super; margin: -5px 0 0 2px\" class=\"fa fa-github\"></i>'\n a.title = 'Find configuration file in GitHub repository';\n a.href = repobase + CODE.innerText + '#repo-content-pjax-container';\n CODE.parentNode.insertBefore(a, CODE.nextSibling);\n }\n }\n }\n}", "title": "" }, { "docid": "d9b9bd9f3388af86c8da23e7b4aed303", "score": "0.45408568", "text": "function papers_get_by_title_url(title) {\r\n return `${server_url}/[papers]?method=get&title=${title}`;\r\n}", "title": "" }, { "docid": "f4cd9b85f890f3ed4367b919e5bdf7f7", "score": "0.45394316", "text": "function sortNotesByBody() {\n document.querySelector(\"#sort-by-body\").innerHTML = \"Sort A-Z by body: On\";\n document.querySelector(\"#sort-by-title\").innerHTML = \"Sort A-Z by title: Off\";\n document.querySelector(\"#sort-by-body\").classList =\n \"btn btn-primary\";\n document.querySelector(\"#sort-by-title\").classList =\n \"btn btn-secondary\";\n http\n .get(\"http://localhost:3000/notes\")\n .then(notes => notes.sort(sortByProperty(\"body\")))\n .then(data => ui.showNotes(data))\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "ca84087be03193e055da069cddd1b2fa", "score": "0.45374846", "text": "async get_issue_titles() {\n let issues;\n let retval = [];\n let page_number = 1;\n do {\n issues = await this.repo.issues.fetch({ per_page: 100, page: page_number });\n page_number += 1;\n retval = [...retval, ...issues.items];\n } while (issues.nextPageUrl);\n return retval.map((issue) => issue.title);\n }", "title": "" }, { "docid": "5b14a418f485da61d849328683cddfee", "score": "0.45330504", "text": "render() {\n let notes = this.props.notes;\n let search = this.state.searchString;\n\n if (search.length > 0) {\n notes = notes.filter(note => note.title.toLowerCase().match(search)\n || note.content.toLowerCase().match(search)\n || note.tags.filter(tag => tag.toLowerCase().match(search)).length > 0);\n }\n\n return (\n <React.Fragment>\n\n {this.props.fetching ? <div>Fetching notes...</div> :\n\n <NotesWrapper>\n\n <MainNotesHeaderContainer>\n\n <ModalContainer modal={this.state.modal} deleteNote={this.deleteNote} toggleModal={this.toggleModal} />\n\n <MainNotesHeader main>Your Notes:</MainNotesHeader>\n <SearchForm onSubmit={event => event.preventDefault()}>\n <input onChange={this.handleInput} value={this.state.searchString} name='searchString' type='text' placeholder='Search...' />\n </SearchForm>\n <NotesTrash toggleModal={this.toggleModal} getId={this.getId} />\n\n </MainNotesHeaderContainer>\n\n <NotesCards>\n {notes.map((note, i) => <NotesCard key={note.id} note={note} index={i} moveCard={this.moveCard} />)}\n </NotesCards>\n\n </NotesWrapper>\n }\n\n </React.Fragment>\n );\n }", "title": "" }, { "docid": "cd45d30a88252ddf62e0ef9903949809", "score": "0.45327783", "text": "async chapter_sample(param, prev){\n\n await this.pull('https://news.yahoo.com/');\n\n /* Waits and finds target elements.\n */\n await FM.async.poll(async (rs) => {\n var l = await this.page.evaluate(() => {\n return $P('.js-stream-content').length > 0;\n });\n if(l) rs(true);\n });\n\n /* DOM manipulations via $P.\n */\n var headlines = await this.page.evaluate(() => {\n var titles = [];\n $P('.js-stream-content').each((i, el) => {\n var wrap = $P(el);\n titles.push(wrap.find('h3').text());\n });\n return titles;\n });\n\n return headlines;\n }", "title": "" }, { "docid": "41554535e19f46b8d13ea6ebf8eccc32", "score": "0.45313403", "text": "static sendTextNote(headlinetext, notetext) {\n return fetch(\"/notes\", {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n headlinetext,\n notetext,\n\n })\n }).then(result => {\n console.log(result);\n return result.json()\n })\n }", "title": "" }, { "docid": "ff001ddd0d52a25fea749a85dd91bd6e", "score": "0.4528576", "text": "getInfo(title){\n var self = this;\n var url =\"https://en.wikipedia.org/w/api.php?&origin=*&action=query&format=json&prop=extracts&exintro=1&titles=\"+title;\n\n fetch( url, {\n method: 'POST',\n} ).then( function ( response ) {\n if ( response.ok ) {\n return response.json();\n }\n throw new Error( 'Network response was not ok: ' + response.statusText );\n} ).then( function ( data ) {\n // do something with data\n var Data=data.query.pages;\n var string=\"<h4>\"+title+\"</h4>\";\n self.state.infoWindow.setContent(`<div id=\"info\">`+string+Data[Object.keys(Data)[0]].extract+\"</div>\");\n}).catch(function (err) {\n self.state.infoWindow.setContent(\"Network Error\");\n});\n }", "title": "" }, { "docid": "311a7a5dc95bcf0c15c0d54a8166667b", "score": "0.45249686", "text": "function showNotes() {\n let notes = localStorage.getItem('notes');\n\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n for(let title in notesObj) {\n html += `\n <div class=\"add-notes noteCard my-2 mx-2 card\" style=\"width: 18rem; box-shadow: .3rem .3rem .3rem .3rem #aaaaaa;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${title}</h5>\n <hr>\n <p class=\"card-text\"> ${notesObj[title]}</p>\n <hr>\n <button id=\"${title}\"onclick=\"deleteNote(this.id)\" class=\"btn btn-outline-danger\">Delete Note</button>\n </div>\n </div>`;\n }\n let notesElem = document.getElementById('notes');\n if (notesObj.length != 0) {\n notesElem.innerHTML = html;\n } else {\n notesElem.innerHTML = `No notes yet. Add notes from above`;\n }\n\n}", "title": "" }, { "docid": "ea2c8dfa0badae79d23318cbfdf54c77", "score": "0.45218208", "text": "function openNote(note){\n \n let noteTitle = document.getElementById(\"noteTitle\");\n noteTitle.value = note.header;\n noteTitle.style.color = note.color;\n let noteContent = document.getElementById(\"noteContent\");\n noteContent.value = note.content;\n document.getElementById(\"noteInside\").style.display = \"block\";\n let highlighted = note.highlighted;\n if(highlighted)\n {\n document.getElementById('noteHighlight').innerHTML = \"star\";\n }\n else\n document.getElementById('noteHighlight').innerHTML = \"star_border\";\n \n let noteSave = document.getElementById('noteSave');\n noteSave.remove();\n //div clone to prevent overwriting listeners\n let noteSaveClone = document.createElement('div');\n noteSaveClone.id = 'noteSave';\n noteSaveClone.innerHTML = \"SAVE\";\n noteSaveClone.style.background = note.color;\n noteSaveClone.addEventListener(\"click\",\n () => editExistingNote(note)); \n document.getElementById('noteInner').appendChild(noteSaveClone);\n}", "title": "" }, { "docid": "f694de959658d6b5061285809cc11113", "score": "0.45216507", "text": "function addtitle(notess) {\n \n //adding the notes to previous array \n editNote((prev) => {\n return [...prev, notess];\n });\n\n\n \n }", "title": "" }, { "docid": "33296b1fff4a713b71af3ea756246ecb", "score": "0.45210078", "text": "function display_title_info(titleJSON, textStatus) { // callback for get_publication_info.php\r\n\tif ((titleJSON.search(/Error/i) != -1) || (titleJSON.search(/\\<b>Notice/i) != -1 )) {\r\n\t\tdocument.writeln(titleJSON);\r\n\t} else {\r\n\t\tvar tempPubId = tempPubTitle = tempDisplayTitle = tempPubTitleAlt = tempPubCity = tempPubState = tempCountry = tempFrequencyIdCode = null;\r\n\t\tvar tempISSN = tempOCLC = null;\r\n\t\tvar tempPubBgnDate = tempPubEndDate = tempDate260C = tempDate362 = tempFrequency310 = tempFormerFrequency321 = null;\r\n\t\tvar language_information = null;\r\n\t\tvar tempNumberingNote515 = tempSummary520 = tempDescriptionNote588 = tempBibRelationships = null;\r\n\t\tvar tempRefDataBody = tempRefDataTitle = tempRefDataURI = tempRefSourceTitle = tempShowFullText = null;\r\n\t\tvar addRefString = '';\r\n\t\tvar tempTitleParts = [];\r\n\t\tvar shortenTitle = false;\r\n\t\tvar tempMoreLink = null;\r\n\t\tvar titleDisplayString = '';\r\n\t\tvar locationString = '';\r\n\r\n\t\tvar data = JSON.parse(titleJSON);\r\n\t\t/*\r\n\t\tif (data) console.log(\"have data, YAY!\\n\", data);\r\n\t\tif (!data) console.warn(\"data is null or some !not!\\nBOO\");\r\n\t\t*/\r\n\t\t//if (data.pubTitle == \"\") {\r\n\t\tif (!data) {\r\n\t\t\t$('#title_location').append('<div id=\"message\" style=\"padding: 10px;\">Sorry, this title does not appear in the ICON database.</div>');\r\n\t\t\t$('#loading-issue-info').hide();\r\n\t\t\t$('#loading-organization-info').hide();\r\n\t\t\t$('#loading-format-info').hide();\r\n\t\t\t$('#sidebar_charts').css('display', 'none');\r\n\t\t} else {\r\n\t\t\t/*\r\n\t\t\t AJE REPLACED THIS: 2013-08-14\r\n\t\t\t in June Amy wanted to skip the 'oc' prefix on OCLC numbers,\r\n\t\t\t but fact is that not displaying 'oc' will make it impossible for them to use the pub_id in any searches\r\n\t\t\t // tempPubId = data.pubId.replace(/oc./g,''); //OLD CJ\r\n\t\t\t */\r\n\t\t\ttempPubId = data.pubId; //NEW AJE\r\n\t\t\ttempOCLC = data.OCLC.replace(/oc./g,'');\r\n\t\t\t//CFJ - 05-31-13 - Delete leading zero from OCLC number at Amy's request\r\n\t\t\ttempOCLC = tempOCLC.replace(/^0/g,'');\r\n\t\t\ttempMarc001 = data.marc001.replace(/\\\\/g,'');\r\n\t\t\ttempISSN = data.ISSN;\r\n\t\t\ttempPubTitle = data.pubTitle;\r\n\t\t\tdocument.title = document.title + \" for \" + tempPubTitle;\r\n\t\t\ttempPubTitleAlt = data.pubTitleAlt;\r\n\t\t\ttempPubCity = data.pubCity;\r\n\t\t\ttempPubState = data.countryId.substr(0,2).toUpperCase();\r\n\t\t\tif (data.countryId.length == 3 && data.countryId.substr(2,1) == 'U' && data.countryId.substr(2,1) == 'C') {\r\n\t\t\t\t//Country is US or Canada\r\n\t\t\t\ttempCountry = data.countryId.substr(2,1);\r\n\t\t\t} else {\r\n\t\t\t\t//Other country\r\n\t\t\t\ttempCountry = data.countryName;\r\n\t\t\t}\r\n\r\n\t\t\ttempPubBgnDate = data.pubBgnDate;\r\n\t\t\ttempPubEndDate = data.pubEndDate;\r\n\t\t\ttempDate260C = data.date260C;\r\n\t\t\ttempDate260C = tempDate260C.replace(/</g,'&lt;');\r\n\t\t\ttempDate260C = tempDate260C.replace(/>/g,'&gt;');\r\n\r\n\t\t\ttempDate362 = data.date362;\r\n\t\t\tif (tempDate362 != null) {\r\n\t\t\t\ttempDate362 = tempDate362.replace(/</g,'&lt;');\r\n\t\t\t\ttempDate362 = tempDate362.replace(/>/g,'&gt;');\r\n\t\t\t}\r\n\r\n\t\t\ttempFrequencyIdCode = data.frequencyIdCode;\r\n\t\t\ttempFrequency310 = data.frequency310;\r\n\t\t\ttempFrequency310 = tempFrequency310.replace(/</g,'&lt;');\r\n\t\t\ttempFrequency310 = tempFrequency310.replace(/>/g,'&gt;');\r\n\t\t\ttempFormerFrequency321 = data.formerFrequency321;\r\n\t\t\ttempFormerFrequency321 = tempFormerFrequency321.replace(/</g,'&lt;');\r\n\t\t\ttempFormerFrequency321 = tempFormerFrequency321.replace(/>/g,'&gt;');\r\n\r\n language_information = '<li class=\"non-table_list_item\">Language: <a href=\"display_publications_by_language.php?language_name=';\r\n language_information += data.language_name + '\" target=\"_blank\">' +data.language_name;\r\n if((data.native_name) && (data.native_name != data.language_name)) language_information += ' ; ' + data.native_name + '</a></li>';\r\n //console.info(' HEY language_information = ', language_information);\r\n\r\n\t\t\ttempNumberingNote515 = data.numberingNote515;\r\n\t\t\tif (tempNumberingNote515 != null) {\r\n\t\t\t\ttempNumberingNote515 = data.numberingNote515;\r\n\t\t\t\ttempNumberingNote515 = tempNumberingNote515.replace(/</g,'&lt;');\r\n\t\t\t\ttempNumberingNote515 = tempNumberingNote515.replace(/>/g,'&gt;');\r\n\t\t\t}\r\n\t\t\ttempSummary520 = data.summary520;\r\n\t\t\ttempDescriptionNote588 = data.descriptionNote588;\r\n\t\t\ttempBibRelationships = data.bib_relationships;\r\n\t\t\ttempRefDataBody = data.refDataBody;\r\n\t\t\ttempRefDataTitle = data.refDataTitle;\r\n\t\t\ttempRefDataURI = data.refDataURI;\r\n\t\t\ttempRefSourceTitle = data.refSourceTitle,\r\n\t\t\ttempShowFullText = data.showFullText;\r\n\r\n\t\t\t//Build location display string\r\n\t\t\tif (tempCountry == 'u' || tempCountry == 'c') {\r\n\t\t\t\t//US or Canada, so display city and state but not country name\r\n\t\t\t\tlocationString += tempPubCity + ', ' + tempPubState;\r\n\t\t\t} else {\r\n\t\t\t\t//Other country, so display city and country name, but not state\r\n\t\t\t\tlocationString += tempPubCity + ', ' + tempCountry;\r\n\t\t\t}\r\n\t\t\t$('#location_container').append(locationString);\r\n\r\n\t\t\t//At startup, display only title proper\r\n\t\t\tif (tempPubTitle.match(/^[^=]*:/)) {\r\n\t\t\t\t//Alt title precedes subtitle\r\n\t\t\t\ttempTitleParts = tempPubTitle.split(' :');\r\n\t\t\t\ttempDisplayTitle = tempTitleParts[0];\r\n\t\t\t\tshortenTitle = true;\r\n\t\t\t} else if (tempPubTitle.match(/^[^:]*=/)) {\r\n\t\t\t\t//Subtitle precedes alt title\r\n\t\t\t\ttempTitleParts = tempPubTitle.split(' =');\r\n\t\t\t\ttempDisplayTitle = tempTitleParts[0];\r\n\t\t\t\tshortenTitle = true;\r\n\t\t\t} else {\r\n\t\t\t\t//No subtitle or alt title\r\n\t\t\t\ttempDisplayTitle = tempPubTitle;\r\n\t\t\t\tshortenTitle = false;\r\n\t\t\t}\r\n\t\t\t$('#title_span').text(tempDisplayTitle);\r\n\t\t\t//Hide or display 'show more' element as necessary\r\n\t\t\tif (shortenTitle) {\r\n\t\t\t\t$('#more_span').css('visibility','visible');\r\n\t\t\t} else {\r\n\t\t\t\t$('#more_span').css('visibility','hidden');\r\n\t\t\t}\r\n\t\t\ttempMoreLink = document.getElementById('more_link');\r\n\t\t\ttempMoreLink.onclick = function() {\r\n\t\t\t\tif(this.textContent == \"more ...\") {\r\n\t\t\t\t\tthis.textContent = \"less ...\";\r\n\t\t\t\t\t$('#title_span').text(tempPubTitle);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.textContent = \"more ...\";\r\n\t\t\t\t\t$('#title_span').text(tempDisplayTitle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n // AJE 2015-10-13 : gave generic UL an ID attribute\r\n\t\t\t//publicationInformationString += '<div class=\"title_section_first\"><div class=\"title_heading\" style=\"margin-top: 0px;\">PUBLICATION INFORMATION:</div><ul>';\r\n\t\t\tpublicationInformationString += '<div class=\"title_section_first\"><div class=\"title_heading\" style=\"margin-top: 0px;\">PUBLICATION INFORMATION:</div><ul id=\"pub_info_first_list\">';\r\n\t\t\tif (tempFrequency310 != '') {\r\n\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">Frequency: ' + tempFrequency310 + '</li>';\r\n\t\t\t}\r\n\t\t\tif (tempFormerFrequency321 != '') {\r\n\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">Former frequency: ' + tempFormerFrequency321 + '</li>';\r\n\t\t\t}\r\n\t\t\t//Publication dates\r\n\t\t\tif (tempDate362 != '' && tempDate362 != null) {\r\n\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempDate362 + '</li>';\r\n\t\t\t} else if (tempDate260C != '') {\r\n\t\t\t\tif (tempDate260C.search(/^-/) != -1) {\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempPubBgnDate + tempDate260C + '</li>';\r\n\t\t\t\t} else if (tempDate260C.search(/-$/) != -1){\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempDate260C + tempPubEndDate + '</li>';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">BEGIN: ' + tempPubBgnDate + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t\t '<li class=\"non-table_list_item\">END: ' + tempPubEndDate + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t '<li class=\"non-table_list_item\">DATE 260C: ' + tempDate260C + '</li>';\r\n\t\t\t\t}\r\n\t\t\t} else if ((tempPubBgnDate != '') || (tempPubEndDate != '')) {\r\n\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">BEGIN: ' + tempPubBgnDate + '</li>' +\r\n\t\t\t\t\t\t\t\t\t\t '<li class=\"non-table_list_item\">END: ' + tempPubEndDate + '</li>';\r\n\t\t\t}\r\n\t\t\t//publicationInformationString += '</ul></div>';\r\n\t\t\tif ( (tempNumberingNote515 != '' && tempNumberingNote515 != null ) || (tempSummary520 != '' && tempSummary520 != null)\r\n\t\t\t || (tempDescriptionNote588 != '' && tempDescriptionNote588 != null) || (tempBibRelationships != '' && tempBibRelationships != null)) {\r\n\t\t\t\t//publicationInformationString += '<div class=\"title_section\"><div class=\"title_heading\">NOTES:</div><ul>';\r\n\t\t\t\tif (tempNumberingNote515 != '' && tempNumberingNote515 != null) {\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempNumberingNote515 + '</li>';\r\n\t\t\t\t}\r\n\t\t\t\tif (tempSummary520 != '' && tempSummary520 != null) {\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempSummary520 + '</li>';\r\n\t\t\t\t}\r\n\t\t\t\tif (tempDescriptionNote588 != '' && tempDescriptionNote588 != null) {\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempDescriptionNote588 + '</li>';\r\n\t\t\t\t}\r\n\t\t\t\tif (tempBibRelationships != '' && tempBibRelationships != null) {\r\n\t\t\t\t\tpublicationInformationString += '<li class=\"non-table_list_item\">' + tempBibRelationships + '</li>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (tempRefDataURI != '' && tempRefDataURI != null) {\r\n\t\t\t\t//If available, display additional reference information for title\r\n\t\t\t\tif (tempShowFullText == \"1\") {\r\n\t\t\t\t\t//Display additional reference text as well as link\r\n\t\t\t\t\taddRefString = '<li class=\"non-table_list_item\">From <a href=\"' + tempRefDataURI + '\" id=\"add_ref_link\" target=\"_blank\">' + tempRefSourceTitle + '</a>: ' + tempRefDataBody + '</li>';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Display additional reference link only\r\n\t\t\t\t\taddRefString = '<li class=\"non-table_list_item\">Related title on ' + tempRefSourceTitle + ': <a href=\"' + tempRefDataURI + '\" id=\"add_ref_link\" target=\"_blank\">' + tempRefDataTitle + '</a></li>';\r\n\t\t\t\t}\r\n\t\t\t\tpublicationInformationString += addRefString;\r\n\t\t\t}\r\n\r\n\t\t\tif(language_information != ''){\r\n publicationInformationString += language_information;\r\n\t\t\t}\r\n\r\n\t\t\tpublicationInformationString += '</ul></div>';\r\n\r\n\t\t\t//Display IDs in a table. Foundation columns leave too much space between labels and values.\r\n\t\t\tbibIdString = '<ul><li><table id=\"id_table\"><tr><td class=\"id_label\" colspan=2>Bibliographic identifiers:</td></tr>';\r\n\t\t\tbibIdString += '<tr><td class=\"id_label\">ICON ID:</td><td class=\"id_value\">' + tempPubId + '</td></tr>';\r\n\t\t\tif (tempMarc001.search(';') != -1) {\r\n\t\t\t\t//Delete spaces before semicolons\r\n\t\t\t\ttempMarc001 = tempMarc001.replace(/\\s;/g,';');\r\n\t\t\t\t//Want to display only LCCNs in this field, so suppress values containing 'MWA', 'mwa', 'oc', or 'ISSN'\r\n\t\t\t\tvar originalMarc001Array = tempMarc001.split('; ');\r\n\t\t\t\tvar goodMarc001Array = new Array();\r\n\t\t\t\t$.each(originalMarc001Array, function(index, value) {\r\n\t\t\t\t\tif (value.search(/oc.|mwa|ISSN/ig) == -1) {\r\n\t\t\t\t\t\tgoodMarc001Array.push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbibIdString += '<tr><td class=\"id_label\">Other identifier:</td><td class=\"id_value\">' + goodMarc001Array.join('; ') + '</td></tr>';\r\n\t\t\t}\r\n\t\t\tif (tempOCLC.length > 0) {\r\n\t\t\t\tif (tempOCLC.search(';') != -1) {\r\n\t\t\t\t\t//Delete spaces before semicolons\r\n\t\t\t\t\ttempOCLC = tempOCLC.replace(/\\s;/g,';');\r\n\t\t\t\t}\r\n\t\t\t\tbibIdString += '<tr><td class=\"id_label\">OCLC:</td><td class=\"id_value\">' + tempOCLC + '</td></tr>';\r\n\t\t\t}\r\n\t\t\tif (tempISSN.length > 0) {\r\n\t\t\t\tif (tempISSN.search(';') != -1) {\r\n\t\t\t\t\t//Delete spaces before semicolons\r\n\t\t\t\t\ttempISSN = tempISSN.replace(/\\s;/g,';');\r\n\t\t\t\t}\r\n\t\t\t\tbibIdString += '<tr><td class=\"id_label\">ISSN:</td><td class=\"id_value\">' + tempISSN + '</td></tr>';\r\n\t\t\t}\r\n\t\t\tbibIdString += '</table></li></ul>';\r\n\t\t\tbibIdString += '</li></ul></div>';\r\n\r\n\t\t\t$('#title_info_container').append('<div class=\"row\" id=\"title_info_row\"><div id=\"title_info\">' + publicationInformationString + '</div></div>');\r\n\t\t\t$('#title_info_container').append('<div class=\"row\" id=\"bib_id_holdings_row\"><div id=\"bib_id_container\" class=\"six columns\">' + bibIdString + '</div></div>');\r\n\r\n\t\t\t// AJE 2015-10-13 add a space for collection_list once AJAX processing is done ;\r\n\t\t\t// LATER: fits better elsewhere, forget it\r\n\t\t\t//$('#title_info_row').append('<div class=\"row\" id=\"collections_container_row\"><div id=\"collections_container\" class=\"six columns\">&nbsp;</div></div>');\r\n\r\n\t\t\t$('#bib_id_holdings_row').append('<div id=\"holdings_info_container\" class=\"five columns\"><ul><li id=\"holdings_info_heading\">Searching for issues&nbsp;...<img src=\"images/loading-calendar.gif\" /></li></ul></div>');\r\n\r\n\t\t\tupdate_progress_message('formats');\r\n\t\t\t$.get(\"get_formats_calendar.php\", { }, populateStaticFormats);\r\n\r\n\t\t} // end else: data.pubTitle exists\r\n\t} // end else: there are no errors in the JSON\r\n} // end function display_title_info", "title": "" }, { "docid": "8a25658ff7457cf865a3a897ef9c3093", "score": "0.45197487", "text": "function displayNotes(str) {\r\n return str.replace(/&GFopen;/g,'{').replace(/&GFclose;/g,'}').replace(/&GFquote;/g,'\\\"').replace(/^<GitfaceNotes>(.*)<\\/GitfaceNotes>$/,'$1');\r\n}", "title": "" }, { "docid": "60a63ee42a4895d39b1b4e9da6141cd5", "score": "0.4517776", "text": "function showNotes(){\nlet notes = localStorage.getItem('notes');\nif (notes === null){\n\tnotesObj = []\n}\nelse{\n\tnotesObj = JSON.parse(notes);\n}\nlet html = '';\nnotesObj.forEach(function(element,index){\n\nlet title = element[0];\nlet content = element[1];\nlet important = element[2];\nlet date = new Date();\n\n// Adding content to Main Page\n\n\n\n\n\nlet notesElem = document.getElementById('notes');\n\n\n\tif (important === true){\n\n\thtml += `<div class=\"card mx-3 my-3 noteCard\" style=\"width: 15rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" id = 'title${index}'>${title}</h5>\n <p id = 'content${index}'>${content}</p>\n <button id = '${index}' class=\"my-1 rounded\" onclick = 'deleteNote(${index})'>Delete Note</button>\n <button id = 'edit${index}' class=\"my-1 rounded\" onclick = 'editNote(${index})'>Edit Note</button>\n </div> ${date.toDateString()}<i class=\"fa fa-star-o my-1 important\" id = \"star${index}\"></i>\n</div>`;\n\n}\nelse{\n\t\n\thtml += `<div class=\"card mx-3 my-3 noteCard\" style=\"width: 15rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" id = 'title${index}'>${title}</h5>\n <p id = 'content${index}'>${content}</p>\n <button id = '${index}' class=\"my-1 rounded\" onclick = 'deleteNote(${index})'>Delete Note</button>\n <button id = 'edit${index}' class=\"my-1 rounded\" onclick = 'editNote(${index})'>Edit Note</button>\n </div> ${date.toDateString()}<i class=\"fa fa-star-o my-1\" id = \"star${index}\"></i>\n</div>`\n\n\n\n};\n\n\n\n\n\n\n\n\n});\n\nlet notesElem = document.getElementById('notes');\nif (notesObj.length == 0){\n\t\n\tnotesElem.innerHTML = `<h4><b> No Notes to show </b></h4>`;\n\n}\nelse{\n\t\n\tnotesElem.innerHTML = html;\n\t// showImportant()\n}\n\n\n\n}", "title": "" }, { "docid": "615dc201fb58faa8aa7b59b1f5061f76", "score": "0.451562", "text": "function getTitle() {\n var XMLHttpRequest = require(\"xmlhttprequest\").XMLHttpRequest;\n var xhr = new XMLHttpRequest();\n var reg = /(?<=\\<h1.*\\>).*(?=\\<\\/h1\\>)/ig;\n var reg2 = /(?<=\\<a.*\\>).*(?=\\<\\/a\\>)/ig;\n var reg3 = /(?<=\\<h2.*\\>).*(?=\\<\\/h2\\>)/ig;\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var rst = this.responseText\n //console.log(this.responseText)\n if (rst.match(reg)) {\n var str = regMatch(rst,reg);\n if (str.match(reg2)) {\n var str2 = regMatch(str,reg2);\n str = str2;\n }\n } else if(rst.match(reg3)){\n var str3 = regMatch(rst,reg3);\n if (str3.match(reg2)) {\n var str4 = regMatch(str3,reg2);\n str = str4;\n }\n str = str3\n }else{\n str =\"Error\"\n }\n\n var reference = \"[\" + str + \"](\" + link + \")\";\n console.log(reference);\n }\n };\n xhr.open(\"GET\", link, true);\n xhr.send();\n}", "title": "" }, { "docid": "f732c5a46336b14c4d6cc7bdda540848", "score": "0.45100275", "text": "function Display(props) {\n\n const note = props.note\n const noteURL = \"/viewnote/\" + note.id\n let date = note.updatedAt.substr(0,10);\n return (\n <div className=\"card my-3\">\n <h4>Title: <Link to={noteURL}>{note.title}</Link></h4>\n <p>last update: {date}</p>\n </div>\n )\n}", "title": "" }, { "docid": "3c91c95f8f3a36b43a5f7a82975e5a02", "score": "0.45078644", "text": "function showmeTitl(title) {\n $(\"#wikiA\").append(\"<a target='_blank' class='wikiTitle list-group-item list-group-item-info' href='https://en.wikipedia.org/wiki/\" + goArt(title) + \"'>\" + title + \"</a>\");\n }", "title": "" }, { "docid": "bb62b8bfea6dec22eef7fea4e0a56fc8", "score": "0.4507296", "text": "function getNotes(callback) {\n var request = $http({\n method: 'GET',\n url: cfg.server_url + cfg.notes_url\n });\n request.success(function (data) {\n return callback(data);\n }).error(function () {\n //handleError();\n console.log('Notes error');\n\n });\n\n }", "title": "" }, { "docid": "c60963d7ecfb0ba30d5549417a7992fa", "score": "0.4505454", "text": "function getnotes() {\n $.getJSON(\"/getnotes/:id\", function (data) {\n // For each one\n for (var i = 0; i < data.length; i++) {\n // Display the apropos information on the page\n $(\"#notes-list\").append(\"<li class=collection-item>\" + \"<div data-id='\" + data[i]._id + \"'>\" + \"<a href='\" + data[i].link + \"'>\" + data[i].title + \"</a\" + \"</div>\" + \"<a href=# class=secondary-content>\" + \"<i id=delete-note class=material-icons right-align blue>\" + \"delete\" + \"</i>\" + \"</a>\" + \"</li>\");\n }\n });\n}", "title": "" }, { "docid": "6cc9da977e915e58317b7de42fb3e8f9", "score": "0.45052046", "text": "async function getNotesAll() {\n const result = await query(`SELECT * FROM mentor_notes ORDER BY\n meeting_date DESC\n `);\n return result.rows;\n}", "title": "" }, { "docid": "451dfa361c13c24902c3cecc9389c380", "score": "0.45031235", "text": "async function show(message) {\n const chat = (await message.getChat());\n await notesDB.findOne({ChatID: chat.id._serialized}, async(err, data) =>{\n if(err) throw err;\n if(data) {\n const allNotes = data.notes;\n if(allNotes === null || allNotes === undefined || allNotes === []) return chat.sendMessage(`No notes are available! Please try and write some up!`);\n let msg = `Here are all the notes with names and their IDs!`\n for(i in allNotes) {\n let element = allNotes[i];\n msg+= `\\n\\nName: *${element.name}* | ID: *${element.id}*`\n }\n await chat.sendMessage(msg);\n\n }\n\n else if(!data) {\n return chat.sendMessage(`Hey I am _*Rekol*_! I can help you with your daily tasks, weekly tasks, as well as remind you anything you want me to!\\n\\nFirstly! I would like to know your name! So that I can easily _rekol_ who you are! \\n_(See what I did there? haha)_\\n\\nPlease register/make an account on our website to get started!\\nhttps://rekol.herokuapp.com/users/register/`);\n }\n })\n \n}", "title": "" } ]
8dc7a5b7ff2b03af87392fc0418fc8c7
MODAL RES Funcion que busca numero de resolucion y devuelve url ubicacion
[ { "docid": "7925d32b69ca95048f47c3b84dafe01b", "score": "0.0", "text": "function buscaRes(){\n var datax = $(\"#formBusquedaRes\").serializeArray();\n $.ajax({\n data: datax, \n type: \"POST\",\n dataType: \"json\", \n url: \"http://resoluciones2.umce.cl/controllers/controllerresoluciones.php\", \n })\n .done(function( data, textStatus, jqXHR ) {\n $(\"#listaresol\").html(\"\"); \n /*if ( console && console.log ) {\n console.log( \" data success : \"+ data.success \n + \" \\n data msg buscares : \"+ data.message \n + \" \\n textStatus : \" + textStatus\n + \" \\n jqXHR.status : \" + jqXHR.status );\n }*/\n if(data.total>0){\n $(\"#listado_resol\").show();\n /*terminar aqui el listado de resoluciones \"listaresol\" */\n fila = '';\n for (var i = 0; i < data.total; i++) {\n var chek='<input class=\"chkidres\" type=\"hidden\" value=\"'\n + data.datos[i].res_id+'\" name=\"idres\">';\n fila = '<tr id=\"fila' + i + '\">';\n //fila += '<td>'+chek+'</td>';\n fila += '<td><a target=\"_blank\" href=\"'+data.datos[0].res_ruta+'\">';\n fila += data.datos[0].res_anio + \"-\" + data.datos[0].res_numero + \" : \" + data.datos[0].res_descripcion;\n fila += '</a></td>';\n fila += '<td>'+chek+'<button id=\"agregaidres\" name=\"agregaidres\" class=\"btn btn-sm btn-success borrar\" type=\"button\">Agregar</button>';\n fila += '</td>';\n fila += '</tr>';\n $(\"#listaresol\").append(fila);\n }\n $('#buscaNumRes').val(\"\");\n }else{\n $('#msgres').html('<div class=\"alert alert-warning\" id=\"msgres\" role=\"alert\">NO existe Resolución</div>')\n }\n })\n .fail(function( jqXHR, textStatus, errorThrown ) {\n if ( console && console.log ) {\n console.log( \" La solicitud ha fallado, textStatus : \" + textStatus \n + \" \\n errorThrown : \"+ errorThrown\n + \" \\n textStatus : \" + textStatus\n + \" \\n jqXHR.status : \" + jqXHR.status );\n }\n });\n }", "title": "" } ]
[ { "docid": "7076e1dedd2a03b31553fd7733148701", "score": "0.58824235", "text": "resource(fullUrl){\n //Pega o caminho da URL ou seja a string que vem após a porta e antes das querys\n //protocolo://domínio:porta/RECURSO/.../RECURSO?query_string#fragmento\n let parsedUrl = url.parse(fullUrl).pathname\n return parsedUrl\n }", "title": "" }, { "docid": "22cc8b2573538df42afeb106622dcf2f", "score": "0.58765143", "text": "function CargarParcial(url) { //RECIBE LA URL DE LA UBICACION DEL METODO\n $(\"#small-modal\").modal(\"show\"); //MUESTRA LA MODAL\n $(\"#VistaParcial\").html(\"\");//LIMPIA LA MODAL POR DATOS PRECARGADOS\n $.ajax({\n \"type\": \"GET\", //TIPO DE ACCION\n \"url\": url, //URL DEL METODO A USAR\n success: function (parcial) {\n $(\"#VistaParcial\").html(parcial);//CARGA LA PARCIAL CON ELEMENTOS QUE CONTEGA\n }//FIN SUCCESS\n });//FIN AJAX\n}//FIN FUNCTION", "title": "" }, { "docid": "cd68a1f30655c53791735d984b36527e", "score": "0.5534214", "text": "function getUrlPermiso(permiso) {\n for (var i = 0; i < $scope.generalOpc.permisos.length; i++) {\n if ($scope.generalOpc.permisos[i].isSelected && $scope.generalOpc.permisos[i].id == permiso) {\n return $scope.generalOpc.permisos[i].resource;\n }\n }\n return 'NOT_FOUND';\n }", "title": "" }, { "docid": "6a0230a909183503968f88939d987cee", "score": "0.55341625", "text": "function buscarPelicula(id){\r\n var peticion=enlace;\r\n peticion+='i='+id;\r\n peticion+=\"&\"+key;\r\n $.ajax({\r\n url: peticion,\r\n success: function(respuesta) {\r\n console.log(respuesta);\r\n maquetarModal(respuesta);\r\n },\r\n error: function() {\r\n console.log(\"No se ha podido obtener la información\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "245a10e2f69c111b9977e724ecf47e7a", "score": "0.5413332", "text": "function loadRes(){\n // var homeImg = document.getElementById('home');\n // homeImg.src = homeIcon;\n \n // var frontImg = document.getElementById('frontImg');\n // frontImg.src = natureImg;\n\n loadSources();\n}", "title": "" }, { "docid": "24efcb5980def8086763191c82ea5fd3", "score": "0.5409661", "text": "function cargarSeccion(tipo,archivo,params){\n var ruta =\"../forms/\";\n\tvar form=ruta+archivo+\"?\"+params;\n\twindow.redirect(ruta);\n /*\n\tif ($(this).attr('id')=='listado'){\n $(\"#CapaForms\").hide();\n\t}\n */\n //$(\"#Nuevo\").attr(\"link\",archivo);\n /*\n\t\t$(\"#Centro\").load( form, function(response, status, xhr) {\n \t\t if (status == \"error\") { var msg = \"Disculpe Ocurrio Un Error : \";\t $(\"#CapaForms\").html(msg + xhr.status + \" \" + xhr.statusText + \" \"+ form); }\n $(\"#CapaForms\").fadeIn();\n });\n\t*/\n}", "title": "" }, { "docid": "14806409e75175bb798367d0fb86ee5f", "score": "0.53815854", "text": "function recargarFormularioPartido()\r\n\t{\r\n\t\t$('#modalFormularioPartido').load(window.location + \" #modalFormularioPartidoContenido\", function(){\r\n\t\t\taccionesInicializar();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "986fcf03879a50250aa9e7c912141c08", "score": "0.5362367", "text": "function categoriasHandler(){\n ManagerDom.setSpinner(\"productos\");\n let urlProducto = urlProductos + this.value;\n // console.log(urlProducto);\n fetchProducto(urlProducto)\n }", "title": "" }, { "docid": "ce90e511997d95f5a839dfaa2d97ae05", "score": "0.53464955", "text": "function urlPhotoObjetModif(idObjet) {\n $pathImgsObjets = urlSite.concat(\"/Images/Objets/\")\n var fun = \"urlPhoto\";\n $.post(urlSite.concat(\"/Models/popupObjet.php\"), {idObjet: idObjet, fun: fun}, function (str) {\n $(\"#imgModif\").attr(\"src\", $pathImgsObjets.concat(str));\n });\n}", "title": "" }, { "docid": "3c467776c5f4c7ea94cae1e9010e8faa", "score": "0.53232634", "text": "function modalUniqueURL(response3){\n\n\tvar gameSearch = localStorage.getItem(\"game\");\n\n\tif (gameSearch !== null){\n\t$(\"#mlink1\").attr(\"href\", \"https://www.polygon.com/search?q=\" + gameSearch + \"&type=Article\").addClass(\"uniqueURL\").text(gameSearch.toUpperCase() + \" on Polygon\")};\n\n\tif (gameSearch !== null){\n\t$(\"#mlink2\").attr(\"href\", \"https://www.twitch.tv/search?term=\" + gameSearch).addClass(\"uniqueURL\").text(gameSearch.toUpperCase() + \" on Twitch\")};\n\n\tif (gameSearch !== null){\n\t$(\"#mlink3\").attr(\"href\", \"https://www.youtube.com/results?search_query=\" + gameSearch).addClass(\"uniqueURL\").text(gameSearch.toUpperCase() + \" on YouTube\")};\n\n\tif (gameSearch !== null){\n\t$(\"#mlink4\").attr(\"href\", \"https://www.amazon.com/s?k=\" + gameSearch).addClass(\"uniqueURL\").text(\"Buy \" + gameSearch.toUpperCase() + \" on Amazon\")};\n\n\tif (gameSearch !== null){\n\t$(\"#mlink5\").attr(\"href\", \"https://www.reddit.com/r/gaming/search?q=\" + gameSearch + \"&restrict_sr=1\").addClass(\"uniqueURL\").text(gameSearch.toUpperCase() + \" on r/gaming\")};\n\n}", "title": "" }, { "docid": "aa6fe516f1b81e35d9f4f7e5bd56878a", "score": "0.52770245", "text": "function loadModalMes(prefix){\n $('.modal-dialog').load('/'+ prefix +'/languages/AddMes');\n $('.modal').modal('show');\n\n}//loadModal Add Message", "title": "" }, { "docid": "4b8b085615c547eafcd7e60d98be0e30", "score": "0.5263878", "text": "function seleccionarImagen(numeroImagen){\n \n imagenSeleccionadaIndex = numeroImagen;\n url_imagen_elegida = diccionario_imagenes[numeroImagen];\n}", "title": "" }, { "docid": "18d6f7dd7363fda05df4bee1b3a7b0d6", "score": "0.52549684", "text": "function populateFromUrl() {\n var pageRef = location.hash.split('#').pop(); // Getting the end of the url.\n // Prepending the string with home if it has no feed name.\n var splitPageRef = pageRef.split('+modal=');\n if (splitPageRef[0] === '') {\n pageRef = 'home';\n if (splitPageRef.length === 2){\n pageRef += '+modal=' + splitPageRef[1];\n }\n }\n // Updating the panels with the feed name or search text.\n updateFeed(pageRef);\n // Launching the modal if this was opened.\n if (pageRef.indexOf('+modal=') !== -1) {\n launchModal(pageRef.split('+modal=')[1]);\n } else {\n $('#modal').modal('hide');\n }\n }", "title": "" }, { "docid": "78229d9a67a74accd11190a0214a54eb", "score": "0.5250894", "text": "function showUrlDialog() {\n\n var dialog,\n $baseUrlControl;\n\n var templateVars = {\n title: \"Enter a URL to get\",\n label: \"URL:\",\n baseUrl: \"http://\",\n Strings: Strings\n };\n \n dialog = Dialogs.showModalDialogUsingTemplate(Mustache.render(mainDialog, templateVars));\n dialog.done(function (id) {\n if (id === Dialogs.DIALOG_BTN_OK) {\n // get URL input\n var baseUrlValue = $baseUrlControl.val();\n console.log(\"Sucking \" + baseUrlValue);\n $.ajax({\n url: baseUrlValue,\n dataType: 'html',\n success: function (html) {\n // load the page\n loadPage(html);\n }\n });\n }\n });\n \n // give focus to url text\n $baseUrlControl = dialog.getElement().find(\":input\");\n $baseUrlControl.focus();\n\n return dialog;\n }", "title": "" }, { "docid": "58aaae8af1a308b54ef604e323cf2aaa", "score": "0.521483", "text": "function get_url_categoria(categoria, indice){\n var url = 'http://nossotatame.net/tecnicas/'+categoria+'/page/'+indice+'/?json=1';\n return url;\n}", "title": "" }, { "docid": "a4e7fbdfd9b4902c792f4dcec974187a", "score": "0.5197035", "text": "function getPictures () { \n let baseUrl = 'http://localhost:3000/'\n const dropDown = document.querySelector('#option-dropdown')\n dropDown.addEventListener(\"change\", (e) => {\n let value = dropDown.value\n\n fetch (baseUrl + `${value}`)\n .then (resp => resp.json())\n .then (pictures => {\n imgContainterDiv.replaceChildren()\n pictures.forEach(element => {\n renderPic(element)\n }); \n })\n }) \n }", "title": "" }, { "docid": "d1e0ed8ccb374c332f731f2db1d510e1", "score": "0.5187814", "text": "function cargarPagina(direccion){\n //Esta funcion carga la url pasada como parametro dentro del ID = \"mostrador\"\n $.ajax({ url: direccion,\n method: \"GET\",\n dataType: \"html\",\n success:function(data){\n $(\"#mostrador\").html(data);\n } ,\n error: function(){\n alert(\"ABRI EL XAMP HIJO\");\n }\n });\n\n }", "title": "" }, { "docid": "22fbf4a306cdcb275b9d7d678df8c343", "score": "0.5182633", "text": "function cargarInformacionModalPrendas (index){\r\n document.querySelector('#imagenPrenda').src=prenda[index].imagen;\r\n document.querySelector('#nombre').innerHTML=prenda[index].nombre;\r\n document.querySelector('#descripcion').innerHTML=prenda[index].descripcion;\r\n precioArticuloConDescuento=document.querySelector('#precio').innerHTML=prenda[index].precio;\r\n precioArticuloConDescuento = precioArticuloConDescuento - precioArticuloConDescuento * 20 / 100;\r\n precioArticuloConDescuento = precioArticuloConDescuento.toFixed(2);\r\n document.querySelector('#precio').innerHTML=precioArticuloConDescuento + ' €';\r\n pre = index;\r\n}", "title": "" }, { "docid": "2638fb0d7b98eede56c0a63dd0ae5c27", "score": "0.518195", "text": "function llenarModal(pid) {\r\n let listaInstituciones=obtenerListaInstituciones();\r\n for(let i=0;i<listaInstituciones.length;i++){\r\n if(pid==listaInstituciones[i][0]){\r\n document.querySelector('#idInst').value=listaInstituciones[i][0];\r\n document.querySelector('#txtNombre').value=listaInstituciones[i][1];\r\n document.querySelector('#txtDireccion').value=listaInstituciones[i][2];\r\n document.querySelector('#txtLat').value=listaInstituciones[i][3];\r\n document.querySelector('#txtLon').value=listaInstituciones[i][4];\r\n document.querySelector('#txtNombreContacto').value=listaInstituciones[i][5];\r\n document.querySelector('#nTelefonoContacto').value=listaInstituciones[i][7];\r\n document.querySelector('#nNiveles').value=listaInstituciones[i][8];\r\n document.querySelector('#nSecciones').value=listaInstituciones[i][9];\r\n document.querySelector('#txtCorreo').value=listaInstituciones[i][6];\r\n document.querySelector('#vista').src=listaInstituciones[i][10];\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7ee543910341fddae8c11069d2290820", "score": "0.51732117", "text": "CargarIMG(DIV, URL) {\n\n }", "title": "" }, { "docid": "d91d488ae77ee7ab7654a42442f51442", "score": "0.51720905", "text": "function urlFinder (id) {\n\tif (id === \"one\") {\n\t\treturn (\"http://app.bronto.com\");\n\t}\n\telse if (id === \"two\") {\n\t\treturn (\"http://bronto.com/welcomekit\");\n\t} else {\n\t\treturn (\"https://server.iad.liveperson.net/hc/77739214/?cmd=file&file=visitorWantsToChat&site=77739214&byhref=1&SESSIONVAR!skill=Lead%20Qualification&imageUrl=https://server.iad.liveperson.nethttps://hosting-source.bronto.com/7894/public/LivePerson/\");\n\t}\n}", "title": "" }, { "docid": "72e6c8adb65c0b444265c7e80b12fe81", "score": "0.5154598", "text": "function BelgaMalinois() { \n indexButton = 0\n\n var id_data = document.getElementById(\"perros\").src = \"./icons/cached_black_48dp.svg\"\n\n\n const coso = url_razas[url_perro[indexButton].id]\n\n fetch(coso)\n .then(response => response.json())\n .then(data => { \n\n var id_data = document.getElementById(\"perros\").src = data.message \n })\n\n .catch(err => console.log(err))\n\n}", "title": "" }, { "docid": "694784dfb157d44068348ac05880204e", "score": "0.5153288", "text": "function _GetDetalles(id, urlAccion) {\n mostrarIconoCargando();\n $.ajax({\n url: urlAccion,\n type: \"GET\",\n dataType: \"html\",\n data: { id: id },\n success: function (data) {\n setTimeout(function () {\n $(\"#main-Modal\").html(data);\n // Limpiando el loading\n ocultarIconoCargando();\n }, 500);\n },\n error: function (result) {\n swal(\"Error!\", result.Respuesta, \"error\").then((value) => {\n location.reload();\n });\n }\n });\n}", "title": "" }, { "docid": "2e86fb7c7afff9adb3695ddd50325f6b", "score": "0.5150977", "text": "function getUrlMap() {\n let rs = \"http://103.9.86.47:6080/arcgis/rest/services/\";\n let pathName = window.location.href;\n let params = (new URL(window.location)).searchParams;\n let arrSplit = [];\n let indexHuyen;\n if (pathName.search(\"quy-hoach\") > -1) {\n arrSplit = params.get('map');\n if (arrSplit !== \"0\") {\n checkMap = arrSplit - 0; // set truong phan biet huyen va tinh// convert ve so\n indexHuyen = checkMap - 1; // url tinh map =0, cac huyen 1-10, chuyen ve de truy cap index trong mang bat dau tu 0\n rs += `Quy_Hoach_${ARR_HUYEN[indexHuyen]}_${params.get('nam').replace(\"-\",\"_\")}`;\n //set name ban do\n $(\"#nameMap\").html(`<i class=\"fas fa-sitemap\"></i> QH-${ARR_HUYEN_TEXT[indexHuyen]} ${params.get('nam')}`);\n quyetDinhMap = QUYET_DINH_QH[indexHuyen+1];\n } else {\n rs += `Quy_Hoach_Bac_Giang_${params.get('nam').replace(\"-\",\"_\")}`;\n //set name ban do\n $(\"#nameMap\").html(`<i class=\"fas fa-sitemap\"></i> QH-Bắc Giang ${params.get('nam')}`);\n quyetDinhMap = QUYET_DINH_QH[0];\n }\n console.log(rs);\n year = params.get('nam').split(\"-\")[0];\n // change name infoKhUse\n $(\"#textInfoKhUser\").html(\"Thông tin quy hoạch sử dụng đất\");\n } else if (pathName.search(\"ke-hoach\") > -1) {\n arrSplit = params.get('map');\n if (arrSplit !== \"0\") {\n checkMap = arrSplit - 0; //convert ve so\n indexHuyen = checkMap - 1; // url tinh map =0, cac huyen 1-10\n year = params.get('nam');\n rs += `Ke_Hoach_${ARR_HUYEN[indexHuyen]}_${year}`;\n //set name ban do\n $(\"#nameMap\").html(`<i class=\"fas fa-sitemap\"></i> KH-${ARR_HUYEN_TEXT[indexHuyen]}-${year}`);\n // change name infoKhUse\n $(\"#textInfoKhUser\").html(\"Thông tin kế hoạch sử dụng đất\");\n switch (year) {\n case '2015':\n quyetDinhMap = QUYET_DINH_KH_2015[indexHuyen+1];\n break;\n case '2016':\n quyetDinhMap = QUYET_DINH_KH_2016[indexHuyen+1];\n break;\n case '2017':\n quyetDinhMap = QUYET_DINH_KH_2017[indexHuyen+1];\n break;\n case '2018':\n quyetDinhMap = QUYET_DINH_KH_2018[indexHuyen+1];\n break;\n case '2019':\n quyetDinhMap = QUYET_DINH_KH_2019[indexHuyen+1];\n break;\n }\n } else {\n rs += `Ke_Hoach_Bac_Giang_${params.get('nam').replace(\"-\",\"_\")}`;\n //set name ban do\n year = params.get('nam').split(\"-\")[0];\n $(\"#nameMap\").html(`<i class=\"fas fa-sitemap\"></i> KH-Bắc Giang ${params.get('nam')}`);\n quyetDinhMap = QUYET_DINH_KH_2019[0];\n }\n }\n console.log(rs+\"/MapServer\");\n return rs + \"/MapServer\";\n }", "title": "" }, { "docid": "b0098b0cdee8683d547bfea6d9c68b61", "score": "0.51267564", "text": "function RecuperaURL_Raiz()\r\n{\r\n\t var url = window.location.href;\r\n\t var itens = url.split(\"/\");\r\n\t var url_raiz = itens[0]+itens[1]+'//'+itens[2]+'/'+itens[3]+'/'; \r\n\t return url_raiz;\r\n}", "title": "" }, { "docid": "d0f253a91e12b0e8115c55e8dcdffea0", "score": "0.5116929", "text": "function cargarResultado(url, id)\n{\n $(\"#\" + id).load(url);\n}", "title": "" }, { "docid": "cd8402e844482ec8b525f49b9ea1b7de", "score": "0.5099789", "text": "function _MMLoadPagina(r) {\r\n IMDB_LINK = $(\".options_links:eq(0) a\",r.responseText).attr(\"href\"); \r\n ToonIMDBInfo();\r\n }", "title": "" }, { "docid": "5227a6ac38fda00df2aded03972948a3", "score": "0.50939465", "text": "function urlPhotoObjet(idObjet) {\n $pathImgsObjets = urlSite.concat(\"/Images/Objets/\")\n var fun = \"urlPhoto\";\n $.post(urlSite.concat(\"/Models/popupObjet.php\"), {idObjet: idObjet, fun: fun}, function (str) {\n $(\"#photoObjet\").attr(\"src\", $pathImgsObjets.concat(str));\n });\n}", "title": "" }, { "docid": "39ad04e919603ca727f7ab983cdc732a", "score": "0.5079799", "text": "function bg_portada(){\n\t\tsubirImagen(\"#form_portada\", \"portada\", \"#portada\", \"foto_portada\");\n\t}", "title": "" }, { "docid": "d1af8309b2250ef3b690dfc26570e800", "score": "0.50783646", "text": "function rutadeimagen(login){\n //if(tieneImagen)\n return \"../images/perfiles/\"+login+\"/icono.jpg\"\n //return \"../images/default/perfil.jpg\"\n}", "title": "" }, { "docid": "5f54aad28d49f2078b5218aad3aa9d6a", "score": "0.5037931", "text": "function x3_mudaFoto1(foto) { /* Essa função faz a mudança da imagem que aparece na pizza do lado esquerdo*/\r\n\r\n var x = \"img3x/\"+foto+\"1.png\";\r\n document.getElementById(\"direito\").src = x;\r\n}", "title": "" }, { "docid": "824c8568beea97f8bf5b8fb57032093e", "score": "0.5033246", "text": "function telaDeConfiguracaoDispositivo() {\r\n let codigoHTML = ''\r\n\r\n codigoHTML +=\r\n '<div class=\"modal fade\" id=\"modalConfigDispositivo\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"modalDispositivo\" aria-hidden=\"true\">'\r\n codigoHTML +=\r\n '<div class=\"modal-dialog modal-dialog-scrollable\" role=\"document\">'\r\n codigoHTML += '<div class=\"modal-content\">'\r\n codigoHTML += '<div class=\"modal-header\">'\r\n codigoHTML +=\r\n '<h5 class=\"modal-title\" id=\"modalDispositivo\">Configurar Dispositivo</h5>'\r\n codigoHTML +=\r\n '<button onclick=\"limparModal();\" type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">'\r\n codigoHTML += '<span aria-hidden=\"true\">&times;</span>'\r\n codigoHTML += '</button>'\r\n codigoHTML += '</div>'\r\n codigoHTML += '<div class=\"modal-body\">'\r\n codigoHTML +=\r\n '<p>Faça a leitura do código QR abaixo com seu dispositivo celular para efetuar a configuração básica!</p>'\r\n codigoHTML +=\r\n '<div class=\"qrcode rounded mx-auto d-block\" id=\"qr\" style=\"margin-top: 30px;\" align=\"middle\"></div>'\r\n codigoHTML +=\r\n '<h3 id=\"ipNumber\" class=\"text-danger text-center\" style=\"margin-top: 10px;\"></h3>'\r\n codigoHTML += '</div>'\r\n codigoHTML += '</div>'\r\n codigoHTML += '</div>'\r\n codigoHTML += '</div>'\r\n\r\n document.getElementById('modal').innerHTML = codigoHTML\r\n\r\n $('#modalConfigDispositivo').modal('show')\r\n animacaoSlideUp(['#qr'])\r\n\r\n pegarIpLocal()\r\n}", "title": "" }, { "docid": "4a5da48767f6fc7f29d3cf1768c1f1be", "score": "0.50311446", "text": "function uri_pagina(file_pagina) {\r\n\t\t\tconsole.log('en uri_pagina. PENDIENTE');\r\n\t\t}", "title": "" }, { "docid": "6c1a62ec5f4e0834a6d0acda0348811c", "score": "0.5030738", "text": "function CargarModificacionMaterial(nombre, precio, tipo){\n\t$('#contenedor').load('modificacionMaterial.html' + '?' + (new Date()).getTime(),//ESTO GENERA UN PATH UNICO (PREVINIENDO CACHEADO)\n\t\tfunction(){\n\t\t\t$('#nombre').val(nombre);\n\t\t\t$('#precio').val(precio);\n\t\t\t$('#' + tipo).prop('checked', true);\n\t\t}\n\t);\n}", "title": "" }, { "docid": "4b5634c7ccc7eceadef4e67f759969cf", "score": "0.5028507", "text": "function limpiarUrl(texto){ /* => este params recibe el texto que se esta escribiendo en el input ingresar ruta de la categoria */\n\n\tvar texto = texto.toLowerCase(); /* => capturar el texto que se esta escribiendo en este input y conviertelo en miniscula primer paso -*/\n\ttexto = texto.replace(/[á]/g, 'a'); /* la paraque se la encuentra varias veces remplaza ....etc */\n\ttexto = texto.replace(/[é]/g, 'e');\n\ttexto = texto.replace(/[í]/g, 'i');\n\ttexto = texto.replace(/[ó]/g, 'o');\n\ttexto = texto.replace(/[ú]/g, 'u');\n\ttexto = texto.replace(/[ñ]/g, 'n');\n\ttexto = texto.replace(/ /g, '-');\n\n\treturn texto; /* returnar ese parametro cuando toodo este listo */\n\n}", "title": "" }, { "docid": "40bea88f55934054baafabd22123054d", "score": "0.5028032", "text": "function setImgNxt(){\n modal.find('img.next-modal-content').attr('src', dataSourceNext); \n }", "title": "" }, { "docid": "e070ef5a17c3c1e89c4e9d80834200c3", "score": "0.5027493", "text": "function getURL(){\n\t\tvar curr = document.getElementById('jAlbum').src;\n\t\treturn curr.substring(0, curr.lastIndexOf(\"/\") + 1);\n\t}", "title": "" }, { "docid": "8593cc2845d11d38eb0aa89639c7d30c", "score": "0.5015334", "text": "function poblarMenu(jsonObj){\n var numPagina = location.pathname.substring(location.pathname.lastIndexOf('/') + 1, location.pathname.lastIndexOf('.'));\n for(var i = 0; (i < 16) && (i < jsonObj.juegos.length) ; i++){\n document.getElementById(\"juegocontenido\" + (i+1)).style.display = \"inline-block\";\n document.getElementById(\"imagenjuegocontenido\" + (i+1)).src = jsonObj.juegos[(jsonObj.juegos.length - 1) - i].imagentapa;\n document.getElementById(\"textojuegocontenido\" + (i+1)).textContent = jsonObj.juegos[(jsonObj.juegos.length - 1) - i].nombre;\n }\n \n }", "title": "" }, { "docid": "275d84442e52d94fbc1bd1d4cabc5e05", "score": "0.5012896", "text": "function obtenerResolucionPantalla() {\n var altoPantalla = window.screen.height;\n var anchoPantalla = window.screen.width;\n var arregloRes = new Array(2);\n\n arregloRes[0] = anchoPantalla;\n arregloRes[1] = altoPantalla;\n\n return arregloRes;\n}", "title": "" }, { "docid": "033796575840a34314b57d6fd62fc105", "score": "0.5007618", "text": "function SetIdPagina(Pagina) {\n $('#iPagina').attr('src', Pagina);\n $find('MPEEPagina').show();\n}", "title": "" }, { "docid": "3049bc408b625a3ca213943aefe48a18", "score": "0.50033647", "text": "function detectar(dialog) {\n var getDialog = dialog.parts.dialog;\n var url = getDialog.find('input').getItem(0).getValue();\n var id = '';\n var reproductor = '';\n var url_comprobar = '';\n\n if (url.indexOf('youtu.be') >= 0) {\n reproductor = 'youtube';\n id = url.substring(url.lastIndexOf(\"/\") + 1, url.length);\n }\n if (url.indexOf(\"youtube\") >= 0) {\n reproductor = 'youtube'\n if (url.indexOf(\"</iframe>\") >= 0) {\n var fin = url.substring(url.indexOf(\"embed/\") + 6, url.length)\n id = fin.substring(fin.indexOf('\"'), 0);\n } else {\n if (url.indexOf(\"&\") >= 0)\n id = url.substring(url.indexOf(\"?v=\") + 3, url.indexOf(\"&\"));\n else\n id = url.substring(url.indexOf(\"?v=\") + 3, url.length);\n }\n url_comprobar = \"https://gdata.youtube.com/feeds/api/videos/\" + id + \"?v=2&alt=json\";\n //\"https://gdata.youtube.com/feeds/api/videos/\" + id + \"?v=2&alt=json\"\n }\n if (url.indexOf(\"vimeo\") >= 0) {\n reproductor = 'vimeo'\n if (url.indexOf(\"</iframe>\") >= 0) {\n var fin = url.substring(url.lastIndexOf('vimeo.com/\"') + 6, url.indexOf('>'))\n id = fin.substring(fin.lastIndexOf('/') + 1, fin.indexOf('\"', fin.lastIndexOf('/') + 1))\n } else {\n id = url.substring(url.lastIndexOf(\"/\") + 1, url.length)\n }\n url_comprobar = 'http://vimeo.com/api/v2/video/' + id + '.json';\n //'http://vimeo.com/api/v2/video/' + video_id + '.json';\n }\n if (url.indexOf('dai.ly') >= 0) {\n reproductor = 'dailymotion';\n id = url.substring(url.lastIndexOf(\"/\") + 1, url.length);\n }\n if (url.indexOf(\"dailymotion\") >= 0) {\n reproductor = 'dailymotion';\n if (url.indexOf(\"</iframe>\") >= 0) {\n var fin = url.substring(url.indexOf('dailymotion.com/') + 16, url.indexOf('></iframe>'))\n id = fin.substring(fin.lastIndexOf('/') + 1, fin.lastIndexOf('\"'))\n } else {\n if (url.indexOf('_') >= 0)\n id = url.substring(url.lastIndexOf('/') + 1, url.indexOf('_'))\n else\n id = url.substring(url.lastIndexOf('/') + 1, url.length);\n }\n url_comprobar = 'https://api.dailymotion.com/video/' + id;\n // https://api.dailymotion.com/video/x26ezrb\n }\n return {'reproductor': reproductor, 'id_video': id};\n}", "title": "" }, { "docid": "689246297138c1cc722cbc0b3a5d0a6d", "score": "0.49988663", "text": "function uploader(i) {\n if( i <= npagine ) {\n var url='http://www.immobiliare.it/ricerca.php?idCategoria=1&idContratto=1&idTipologia=12&sottotipologia=&idTipologiaStanza=&idFasciaPrezzo=&idNazione=IT&idRegione=&idProvincia=&idComune=&idLocalita=&idAreaGeografica=&prezzoMinimo=&prezzoMassimo=&balcone=&balconeOterrazzo=&boxOpostoauto=&stato=&terrazzo=&bagni=&mappa=&foto=&boxAuto=&riscaldamenti=&giardino=10&superficie=&superficieMinima=&superficieMassima=&raggio=&locali=&localiMinimo=&localiMassimo=&criterio=rilevanza&ordine=desc&map=0&tipoProprieta=&arredato=&inAsta=&noAste=&aReddito=&fumatore=&animali=&franchising=&flagNc=&gayfriendly=&internet=&sessoInquilini=&vacanze=&categoriaStanza=&fkTipologiaStanza=&ascensore=&classeEnergetica=&verticaleAste=&pag='+i+'&vrt=45.444235041018,8.884506225586;45.455314263478,8.984069824219;45.482280661639,8.973083496094;45.508271755945,8.997116088867;45.54531238321,9.000549316406;45.577522694837,9.001235961914;45.599146119878,8.980293273926;45.620761214967,8.944244384766;45.608994029539,8.899269104004;45.586653601467,8.875579833984;45.60202861384,8.825454711914;45.630845408684,8.802108764648;45.64860838388,8.760223388672;45.578964515663,8.71696472168;45.524630364755,8.774642944336;45.463983441273,8.828201293945;45.444235041018,8.884506225586';\n var classe= '//*[@class=\"annuncio_title\"]';\n var richiesta= \"SELECT * FROM html WHERE url='\"+url+\"' AND xpath='\"+classe+\"'\";\n console.log(\"pagina>>> \"+i);\n \n new YQL.exec(richiesta, function(response) {\n if (response.error) {\n results = \"impossibile raccogliere i dati richiesti\";\n console.log('>>>>error: '+response.error);\n } else {\n //formattazione dati ricevuti in results, verso link pagine\n var dati = response.query.results.div;\n var numeroitems =dati.length;\n console.log(\"items>>> \"+numeroitems);\n dati.forEach (function(item){ \n if(item.strong.a){\n \t\t\t\t \n // var coso= {\"title\":item.strong.a.content,\n // \"description\": \"<![CDATA[ euro]]>\" ,\n // \"content\": \"\",\n // \"link\":item.strong.a.href ,\n // \"enclosure\":{\"url\":\"\",\n // \"length\":\"0\",\n // \"type\":\"image/jpeg\"},\n // \"pubDate\": new Date(),\n // \"author\": \"immobiliare\"\n // };\n //results.push(coso);//costruisco l'obj dei dati da render\n \n \n //recupero i dati dalla pagina dell'annuncio\n var url=item.strong.a.href;\n var classe= '//*[@id=\"sx\"]';\n var richiesta= \"SELECT * FROM html WHERE url='\"+url+\"' AND xpath='\"+classe+\"'\";\n \n //var contatore =0;\n \n new YQL.exec(richiesta, function(response) {\n if (response.error) {\n results = \"impossibile raccogliere i dati richiesti\";\n console.log('>>>>error: '+response.error);\n } else {\n //formattazione dei dati ricevuti in results\n var dati = response.query.results.div;\n //compilo l'oggetto con le proprietà immobile\n console.log(\"casa>>>__ \"+dati.div[0].div.div[1].div[0].div[1].strong.content);\n for(i=0;i<dati.div.length;i++){\n if(dati.div[i].id==\"dettagli\"){ \n var param = dati.div[i].div.table[0].tbody.tr;\n }\n \n }\n //console.log(\"casa>>> \"+JSON.stringify(param));\n var parametri={};\n console.log(\"numero righe>>> \"+param.length);\n \n for (i=0;i<param.length;i++){\n if(!param[i]){console.log(\"saltato>>> \"+i);}\n else{\n //console.log('>>>>prarametro: '+i+\" \"+param[i].td[0].content.slice(0,-2).replace(/ /g, \"_\")+\" - \"+param[i].td[1]);\n parametri[param[i].td[0].content.slice(0,-2).replace(/ /g, \"_\")] = param[i].td[1];\n \n if (!param[i].td[2].content){console.log(\"saltato>>> b\"+i);}\n else{\n //console.log('>>>>prarametro: '+i+\"b \"+param[i].td[2].content.slice(0,-2).replace(/ /g, \"_\")+\" - \"+param[i].td[3]);\n parametri[param[i].td[2].content.slice(0,-2).replace(/ /g, \"_\")] = param[i].td[3];\n }\n }\n }\n \n \n if(dati.div){\n \n var piani = \"\";\n if( parametri.Totale_Piani){piani = parametri.Totale_Piani}\n var proprieta = \"\";\n if(parametri.Terreno_proprietà){proprieta= parametri.Terreno_proprietà}\n var coso= {\"title\":dati.div[0].div.div[1].div[0].div[1].strong.content ,\n \"description\": \"<![CDATA[ \"+ dati.div[0].div.div[1].div[1].div[0].content+\" \"+dati.div[0].div.div[1].div[1].div[0].strong.content+\", estensione proprieta: \"+ proprieta +\", Piani: \"+ piani+\" ]]>\" ,\n \"content\":\"\",\n \"link\":url ,\n \"enclosure\":{\"url\":dati.div[2].div[3].div[0].div.div[1].div[2].img.src,\n \"length\":\"0\",\n \"type\":\"image/jpeg\"},\n \"pubDate\": new Date(),\n \"author\": \"immobiliare\"\n };\n results.push(coso);//costruisco l'obj dei dati da render\n if(contatore == numeroitems){\n console.log(\"items caricati>>> \"+contatore);\n contatore=1;\n uploader(i+1); \n \n }else{\n //console.log(\"contatore>>> \"+contatore);\n contatore++;}\n }\n }\n }); \n }\n });\n }\n });\n \n }else{\n //qui ho l'oggetto results con tutti i dati da usare\n res.type('xml'); // <-- Type of the file\n //renderizzo pagina per salvare file\n var xml = jade.renderFile('views/scrap01.jade', {\"RSS\": RSS, \"results\": results });\n //console.log(\"file>>> \"+xml);\n \t\t\t\tfs.writeFile('public/immobiliare.xml', xml);\n // renderizzo la pagina come risposta;\n res.render('scrap01', {\"RSS\": RSS, \"results\": results } );\n \n \n }\n }", "title": "" }, { "docid": "f64b348dbb8a678d2592486e75ba8cfc", "score": "0.4992765", "text": "function getModal(what, url,id)\n{\n\t\n\tloaded = {};\n\t$('#ajax-modal').modal(\"hide\");\n\tif(id)\n\t\turl = url+id;\n\tconsole.log(\"getModal\",what,\"url\",url,\"event\",id);\n\t//var params = $(form).serialize();\n\t//$(\"#ajax-modal-modal-body\").html(\"<i class='fa fa-cog fa-spin fa-2x icon-big'></i> Loading\");\n\t$('body').modalmanager('loading'); \n\t$.ajax({\n type: \"GET\",\n url: baseUrl+url\n //dataType : \"json\"\n //data: params\n })\n .done(function (data) \n {\n if (data) { \n \t/*if(!selectContent)\n \t\tselectContent = data.selectContent;*/\n \ttitle = (typeof what === \"object\" && what.title ) ? what.title : what;\n \ticon = (typeof what === \"object\" && what.icon ) ? what.icon : \"fa-pencil\";\n \tdesc = (typeof what === \"object\" && what.desc ) ? what.desc+'<div class=\"space20\"></div>' : \"\";\n\n \t\t$(\"#ajax-modal-modal-title\").html(\"<i class='fa \"+icon+\"'></i> \"+title);\n $(\"#ajax-modal-modal-body\").html(desc+data); \n $('#ajax-modal').modal(\"show\");\n } else {\n toastr.error(\"bug get \"+id);\n }\n });\n}", "title": "" }, { "docid": "00299be8bd01853fe0d595d8e13ba89d", "score": "0.49891064", "text": "function retrocederPista() {\n var nombreActual = info.innerHTML.split(\": \")[1];\n var actual = contenido.indexOf(nombreActual);\n tipo = nombreActual.replace(/[0-9]+/g, \"\");\n if (actual <= 0) {\n actual = contenido.length;\n }\n actual = actual - 1;\n if (tipo == \"video\") {\n reproductor.src = \"audios/\" + contenido[actual] + \".mp3\";\n info.innerHTML = \"audios: \" + contenido[actual];\n } else {\n if (contenido[actual] == \"video2\") {\n $('source').remove();\n var source = document.createElement('source');\n source.src = \"videos/\" + contenido[actual] + \".mp4\";\n source.type = \"video/mp4\";\n reproductor.appendChild(source);\n var source2 = document.createElement('source');\n source2.src = \"videos/\" + contenido[actual] + \".webm\";\n source2.type = \"video/mp4\";\n reproductor.appendChild(source2);\n var source3 = document.createElement('source');\n source3.src = \"videos/\" + contenido[actual] + \".ogg\";\n source3.type = \"video/mp4\";\n reproductor.appendChild(source3);\n reproductor.load();\n info.innerHTML = \"Video: \" + contenido[actual];\n $('#reproductor').removeAttr(\"src\");\n } else if (contenido[actual] == \"video3\") {\n $('source').remove();\n var source = document.createElement('source');\n source.src = \"videos/\" + contenido[actual] + \".mp4\";\n source.type = \"video/mp4\";\n reproductor.appendChild(source);\n var track = document.createElement('track');\n track.label = \"Español\";\n track.kind = \"subtitle\";\n track.srclang = \"es\";\n track.src = \"videos/subtitulos.vtt\";\n reproductor.appendChild(track);\n reproductor.load();\n info.innerHTML = \"Video: \" + contenido[actual];\n $('#reproductor').removeAttr(\"src\");\n } else {\n reproductor.src = \"videos/\" + contenido[actual] + \".mp4\";\n info.innerHTML = \"Video: \" + contenido[actual];\n }\n }\n\n actual = actual + 1;\n var pistaSelect = \"pista\" + actual;\n\n var arrayLi = [];\n arrayLi.push($('li'));\n $('li').removeClass('ElementoEjecutado');\n $('#equalizer').remove();\n\n for (var i = 0; i < arrayLi[0].length; i++) {\n if (pistaSelect == arrayLi[0][i].id) {\n pistaEjecutada = document.getElementById(pistaSelect);\n pistaEjecutada.setAttribute('class', 'ElementoEjecutado');\n\n if (tipo == \"video\") {\n $('.ElementoEjecutado').prepend('<img src=\"img/musica.svg\" id=\"equalizer\"/>');\n } else {\n $('.ElementoEjecutado').prepend('<img src=\"img/peliculas.svg\" id=\"equalizer\"/>');\n }\n }\n }\n reproductor.play();\n}", "title": "" }, { "docid": "c384d2439430b1c2c586f472098b021a", "score": "0.4986771", "text": "function loadMetadataPopUp(data) {\n\n //Llamada ajax que recupera y parsea a json la url pasada\n detalle = data;\n //seteo nombre del producto\n $('#title_detail').html(data.name);\n //seteo de la referencia\n $('#reference').html(Messages.reference + data.ref);\n //Seteo del precio\n $('#price_detail').html(data.curPrice);\n //Seteo del precio rebajado\n $('#price_detail_sale').html((data.oldPrice != '') ? data.oldPrice : '');\n //seteo de la descripcion\n $('#principal_desc').prepend(data.desc);\n\n //miro si el producto tiene imagen 3D.\n if(data.urlImg3D != null && data.urlImg3D != '') {\n productImg3D = true;\n urlImg3D = DUTTI_STATIC_CONTENT_PATH + data.urlImg3D;\n zoomImg3D = DUTTI_STATIC_CONTENT_PATH + data.zoomImg3D;\n } else {\n productImg3D = false;\n urlImg3D = '';\n zoomImg3D = '';\n }\n\n\n //Comprobacion de si existe descripcion secundaria\n if(data.desc2 != null && data.desc2 != '') {\n //$('#secondary_desc').prepend('<br>' + data.desc2);\n $('#insert_desc').prepend('<p>' + data.desc2 + '</p>');\n $('#secondary_desc').after('<a id=\"info_deploy\" href=\"javascript:void(0)\" onClick=\"extradata(\\'secondary_desc\\',$(this));\" style=\"color:#333\">'+Messages.moreInfo+'</a>');\n }\n\n //Composicion\n var exterior = '<li class=\"titulo\">'+Messages.exterior+'</li>';\n var mostrarExterior = false;\n var lining = '<li class=\"titulo\">'+Messages.lining+'</li>';\n var mostrarLining = false;\n var interior = '<li class=\"titulo\">'+Messages.interior+'</li>';\n var mostrarInterior = false;\n $.each(data.composition, function(i, composite) {\n switch(checkComposite(composite.identifier)) {\n case 1:\n mostrarExterior = true;\n exterior += '<li><span>' + composite.percent + '%</span> ' + composite.component + '</li>';\n break;\n case 2:\n mostrarLining = true;\n lining += '<li><span>' + composite.percent + '%</span> ' + composite.component + '</li>';\n break;\n case 3:\n mostrarInterior = true;\n interior += '<li><span>' + composite.percent + '%</span> ' + composite.component + '</li>';\n break;\n }\n });\n $('#composition_detail').append(((mostrarExterior) ? exterior : '') + ((mostrarLining) ? lining : '') + ((mostrarInterior) ? interior : ''));\n\n //Cuidado\n $.each(data.care, function(j, cuidado) {\n $('#cuidados_detail').append('<li><img src=\"' + cuidado.image + '\" /><p>' + cuidado.desc + '</p></li>');\n });\n\n //Colores\n var colores = '';\n $.each(data.colors, function(k, col) {\n colores += ('<img src = \"' + col.cutColor + '\"color=\"' + col.code + '\" id_color=\"' + col.idColor + '\" rel=\"' + col.nameColor + '\" class=\"color_detail tooltip' + ((k == 0) ? ' active' : '') + '\" />');\n });\n $('#color_list').html(colores);\n\n //Se cargan las tallas e imagenes del primer color de la lista. Si se modifica el color se actualizara con otra funcion\n var color = data.colors[0];\n if(color){\n //Tallas y botones\n $.xajax({\n url: data.linkStock,\n dataType: 'json',\n success: function(dataStock) {\n stocks = dataStock;\n\n $.each(color.sizes, function(j, s) {\n s.hasStock = getInventorySku(stocks.items, s.id);\n });\n\n var tallas = '';\n tallasSinHermanados = getQuitandoTallasHermanadas(data.colors,stocks);\n // atributo \n showProductNoStock = data.showProductNoStock;\n // a nivel de producto\n isBackSoon = data.isBackSoon;\n // a nivel de skus\n listaSkuBackSoon = data.listaSkuBackSoon;\n if (!listaSkuBackSoon) {\n listaSkuBackSoon = \"\";\n }else{\n listaSkuBackSoon = getSkus(listaSkuBackSoon);\n }\n\n isComingSoon = data.isComingSoon;\n listaSkuBackSoon = $.trim(listaSkuBackSoon);\n\n listaSkuComingSoon = data.listaSkuComingSoon;\n if (!listaSkuComingSoon) {\n listaSkuComingSoon = \"\";\n }else{\n listaSkuComingSoon = getSkus(listaSkuComingSoon);\n }\n listaSkuComingSoon = $.trim(listaSkuComingSoon);\n\n if(tallasSinHermanados[color.idColor] != null){\n $.each(tallasSinHermanados[color.idColor], function(l, talla) {\n if(tallasSinHermanados[color.idColor].length > 1) {\n tallas += printSize(talla, stocks,isBackSoon,listaSkuBackSoon,showProductNoStock,false,isComingSoon, listaSkuComingSoon);\n }else{\n tallas += printSize(talla, stocks,isBackSoon,listaSkuBackSoon,showProductNoStock,true,isComingSoon, listaSkuComingSoon);\n }\n\n\n var listaSkuBackSoonArray = listaSkuBackSoon.split(',');\n var skuBackSoon = 'false';\n for (i = 0; i < listaSkuBackSoonArray.length; i++) {\n if (( parseInt(listaSkuBackSoonArray[i]) == parseInt(talla.id)))\n skuBackSoon = 'true';\n }\n if ((isBackSoon == 'true') || (skuBackSoon == 'true')){\n hasBackSoon = 'true';\n }\n\n var listaSkuComingSoonArray = listaSkuComingSoon.split(',');\n var skuComingSoon = 'false';\n for (i = 0; i < listaSkuComingSoonArray.length; i++) {\n if (( parseInt(listaSkuComingSoonArray[i]) == parseInt(talla.id))) {\n skuComingSoon = 'true';\n }\n }\n\n if ((isComingSoon == 'true') || (skuComingSoon == 'true')) {\n hasComingSoon = 'true';\n }\n\n\n });\n }\n $('#size_list').html(tallas);\n //Efectos sobre el titulo de TALLAS\n sizeTriggerBinds();\n //Efectos sobre las tallas\n sizeBinds(color.sizes);\n //Chequeo del stock del producto\n checkOutStock(stocks);\n //A?ade tooltip a las tallas sin stock\n tooltipBinds();\n /* si tienes tallas agotadas */\n if ($('.soon').length) {\n /* si el producto tiene el atributo BACKSOON */\n if (hasBackSoon == 'true') {\n\n if (document.getElementById('textToolTip')) {\n var texto = document\n .getElementById('textToolTip').value;\n $('#tooltip_stock').html(texto);\n }\n\n $('#tooltip_stock').appendTo('body');\n setTimeout(function() {\n $('#tooltip_stock').css(\n {\n 'left' : $('.soon:eq(0)')\n .offset().left - 10,\n 'top' : $('.soon:eq(0)')\n .offset().top + 15\n }).fadeIn();\n setTimeout('$(\"#tooltip_stock\").fadeOut()',\n 3000);\n }, 1000)\n $('.soon')\n .bind(\n {\n 'mouseenter' : function() {\n $('#tooltip_stock')\n .css(\n {\n 'left' : $(\n this)\n .offset().left - 10,\n 'top' : $(\n this)\n .offset().top + 15\n })\n .show();\n },\n 'mouseleave' : function() {\n $('#tooltip_stock')\n .css(\n {\n 'left' : $(\n this)\n .offset().left - 10,\n 'top' : $(\n this)\n .offset().top + 15\n })\n .hide();\n }\n })\n } else {\n $('#tooltip_stock').empty();\n\n }\n\n } else if ($('.comingSoon').length) {\n if (hasComingSoon == 'true') {\n\n if (document\n .getElementById('textToolTipComingSoon')) {\n var texto = document\n .getElementById('textToolTipComingSoon').value;\n $('#tooltip_stock').html(texto);\n }\n\n $('#tooltip_stock').appendTo('body');\n\n setTimeout(function() {\n $('#tooltip_stock').css(\n {\n 'left' : $('.comingSoon:eq(0)')\n .offset().left - 10,\n 'top' : $('.comingSoon:eq(0)')\n .offset().top + 15\n }).fadeIn();\n setTimeout('$(\"#tooltip_stock\").fadeOut()',\n 3000);\n }, 1000)\n $('.comingSoon')\n .bind(\n {\n 'mouseenter' : function() {\n $('#tooltip_stock')\n .css(\n {\n 'left' : $(\n this)\n .offset().left - 10,\n 'top' : $(\n this)\n .offset().top + 15\n })\n .show();\n },\n 'mouseleave' : function() {\n $('#tooltip_stock')\n .css(\n {\n 'left' : $(\n this)\n .offset().left - 10,\n 'top' : $(\n this)\n .offset().top + 15\n })\n .hide();\n }\n })\n } else {\n $('#tooltip_stock').empty();\n\n }\n } else {\n $('#tooltip_stock').empty();\n\n }\n\n tooltipNoStock();\n\n\n\n }\n });\n\n\n\n //Thumbs\n //Thumbs\n var thumbs = printImageByColor(color);\n $('#p_thumbs').prepend(thumbs);\n\n //Actualizamos los eventos sobre las partes dinamicas de la pagina (colores, thumbs,...)\n updateBinds();\n\n $('#detail').fadeIn();\n colorWidth = $('#compra').width();\n colorTitleWidth = $('#color_title').innerWidth();\n $(\"#color_title\").css({'width':colorTitleWidth+'px'});\n $(\"#color_list\").css({'width':( colorWidth - 10 - colorTitleWidth)+'px'});\n $(\"#color_marker\").css({'left':(colorTitleWidth+11 )+'px'});\n\n //Posiciono correctamente el div del flash para que se vea correctamente.\n $($('#flashContainer')).prependTo('#product_detail');\n\n\n if ($.browser.msie && $.browser.version == 7) {\n $('#flashContainer').css({'margin-top': '-20px', 'position': 'absolute', 'left': '0px'});\n } else {\n $('#flashContainer').css({'margin-top': '-20px', 'position': 'absolute'});\n }\n\n }\n\n}", "title": "" }, { "docid": "24a9be657c995f7552b76d76a75b0b12", "score": "0.49860817", "text": "function constructAndOpenModalURLFromMap(url) {\r\n\r\n /*\r\n * Get a handle to the iframe that is in the content pane\r\n */\r\n var iframe = curam.tab.getContentPanelIframe();\r\n\r\n /*\r\n * Get the page targeted in the href of the iframe\r\n */\r\n var rpuValue = getLastPathSegmentWithQueryStringForURLConstruction(\r\n iframe.contentWindow.location.href);\r\n\r\n /*\r\n * Construct the target URL from the URL passed in (the\r\n * target page) with a return value of the page in the frame\r\n */\r\n var targetURL = url + \"&__o3rpu=\"\r\n + encodeURIComponent(rpuValue);\r\n\r\n /*\r\n * Open the page in the modal dialog\r\n */\r\n curam.util.UimDialog.openUrl(targetURL);\r\n }", "title": "" }, { "docid": "0a5e2bd67b7e27a8e0b284e18b4728a3", "score": "0.49825", "text": "function formatImageURL(data, modal) {\n if (!modal) {\n return `https://live.staticflickr.com/${data.server}/${data.id}_${data.secret}_${SIZES[150]}.jpg`\n }\n\n // request 800px size for modal\n return `https://live.staticflickr.com/${data.server}/${data.id}_${data.secret}_${SIZES[800]}.jpg`\n}", "title": "" }, { "docid": "602d8b2c804d9c065283b77bcbee8749", "score": "0.49797267", "text": "function cargarInterfaz(){\n\n\t//pintar titulo de la unidad\n\t$('h1').html(nombreUnidad);\n\trecogerDatos();\n\tpintarSumario();\n\tnavegarIndice();\n\tpintarIconos();\n\t//cambiarIdioma();\n}", "title": "" }, { "docid": "70ab983be4ae860a8b9d03747a351df2", "score": "0.49716583", "text": "function getIdFromURL(url){\n var regexp = vm.selectedResource.regex;\n return url.replace(regexp, '$1');\n }", "title": "" }, { "docid": "09e6bddaa4ce1caa85881d861282b881", "score": "0.49700847", "text": "function giveUrl(recipes) {\n $(\"#link1\").attr(\"href\", recipes[0].spoonacularSourceUrl)\n $(\"#link2\").attr(\"href\", recipes[1].spoonacularSourceUrl)\n $(\"#link3\").attr(\"href\", recipes[2].spoonacularSourceUrl)\n $(\"#link4\").attr(\"href\", recipes[3].spoonacularSourceUrl)\n }", "title": "" }, { "docid": "0f9deec5c6c9a145a9e9bfa8db5e5172", "score": "0.4958834", "text": "function cargaDatos(url) {\n //Hacemos fetch a la pagina que devuelve los datos de los puntos y creamos los marcadores\n fetch(url)\n .then(res => res.json())\n .then(res => {\n\n // Comprobamos si tenemos datos que mostrar\n if (res) {\n autorNuevaUbicacion = res.usuarioActual;\n //Recorremos el array de puntos y vamos insertando cada marcador con su popup\n arrayMarkers = res.puntos.map(element => {\n //Variable para almacenar comentarios\n let comentariosTXT = \"\";\n for (let i = 0; i < element.comentarios.length; i++) {\n comentariosTXT += i + 1 + \": \" + element.comentarios[i] + \", \"\n }\n //Iconos personalizados del marcador en funcion del tipo de fotografía\n let icono = \"\";\n let color = \"\";\n let iconcolor = \"\";\n switch (element.tipo_fotografia) {\n case 'ciudad':\n icono = 'building';\n color = 'purple';\n iconcolor = 'white';\n break;\n case 'macro':\n icono = 'eye';\n color = 'orange';\n iconcolor = 'white';\n break;\n case 'paisaje':\n icono = 'image';\n color = 'green';\n iconcolor = 'white';\n break;\n case 'nocturna':\n icono = 'spinner';\n color = 'black';\n iconcolor = 'white';\n break;\n case 'LP':\n icono = 'star';\n color = 'gray';\n iconcolor = 'white';\n break;\n case 'ruinas':\n icono = 'registered';\n color = 'brown';\n iconcolor = 'white';\n break;\n case 'costa':\n icono = 'flag';\n color = 'darkblue';\n iconcolor = 'white';\n break;\n\n default:\n icono = 'question-circle';\n color = 'red';\n iconcolor = 'yellow';\n break;\n }\n //Recuperamos la imagen del servidor\n let Img = '/mapas/img/' + element.imagen + \"'\";\n let photo = `<img src='${Img} class=\"mx-auto\" height=\"auto\" width=\"200px\">`;\n\n //Si la ubicación no tiene imagen cargada, utilizamos una por defecto\n if (element.imagen === undefined) photo = `<img src='../img/noimg.jpg' class=\"mx-auto\" height=\"auto\" width=\"50px\">`;\n //Dibujamos los marcadores\n let marker = L.marker(element.coordenadas, { icon: L.AwesomeMarkers.icon({ icon: icono, prefix: 'fa', markerColor: color, spin: false, iconColor: iconcolor }) })\n .addTo(marcadores);\n //Añadimos el evento click al botón del marcador\n marker.on('click', function (e) {\n markerClick(e, element, photo);\n\n })\n return marker;\n });\n if (arrayMarkers.length) {\n map.addLayer(marcadores);\n map.fitBounds(marcadores.getBounds().pad(0.1));\n arrayMarkers = [];\n }\n else {\n //Hacemos zoom a la localización del usuario\n if (miPosicion) {\n map.setView([miPosicion.latitude, miPosicion.longitude], 12);\n }\n }\n }\n })\n .catch(err => {\n let errDevueltos = \"\";\n err.forEach(element => {\n errDevueltos += element + \" \";\n });\n\n Swal.fire({\n title: \"Mensaje del servidor\",\n icon: 'info',\n text: errDevueltos,\n confirmButtonText: \"Ok\",\n })\n })\n}", "title": "" }, { "docid": "251ec9b1a3664f867e322e85cc9843b2", "score": "0.49516356", "text": "function maquetarModal(datos){\r\n $('#modalTitle').text(datos.Title);\r\n if(datos.Poster!=\"N/A\")\r\n $('#img').attr(\"src\",datos.Poster);\r\n else\r\n $('#img').attr(\"src\",'./img/notFound.jpg');\r\n $('#genre').text(datos.Genre)\r\n $('#release').text(datos.Released)\r\n $('#director').text(datos.Director)\r\n $('#writer').text(datos.Writer)\r\n $('#actors').text(datos.Actors)\r\n $('#plot').text(datos.Plot)\r\n $('#numPuntuacion').text(datos.imdbRating);\r\n ponerEstrellas(datos.imdbRating);\r\n $('#modalCenter').fadeIn();\r\n}", "title": "" }, { "docid": "cf7a294cec889cf20e7b36f9120a7389", "score": "0.49390906", "text": "function addContent() {\n\tlet id = new URL(window.location).searchParams.get(\"id\");\n\tfetch(`${\"http://localhost:3000/api/cameras\"}/${id}`)\n\t\t// Récupération de réponse au format json\n\t\t.then((response) => response.json())\n\t\t// Récupération des informations sur le produit id \n\t\t.then((data) => {\n\t\t\titem = data;\n\t\t\taddHTML();\n\t\t\taddLenses();\n\t\t});\n}", "title": "" }, { "docid": "88cc9b4c1b3bdeef69e3cc1aa7329802", "score": "0.4933997", "text": "function galeria(routeGotByTheHtml) {\n var route = routeGotByTheHtml;\n /*Aqui estoy validando lo que debemos hacer cuando \n recibamos valores acorde con los botones que presionemos*/\n if (route == 'back') {\n if (banderilla == 0) {\n document.getElementById('imagen').src = grupoDeFotosQuePodemosUsar[grupoDeFotosQuePodemosUsar.length - 1]; banderilla++;\n } else if (banderilla < grupoDeFotosQuePodemosUsar.length - 1) {\n document.getElementById('imagen').src = grupoDeFotosQuePodemosUsar[grupoDeFotosQuePodemosUsar.length - 1 - banderilla]; banderilla++;\n } else {\n document.getElementById('imagen').src = grupoDeFotosQuePodemosUsar[0]; banderilla = 0;\n }\n }\n\n if (route == 'go') {\n if (banderilla == 0) {\n document.getElementById('imagen').src = grupoDeFotosQuePodemosUsar[0]; banderilla++;\n } else if (banderilla < grupoDeFotosQuePodemosUsar.length - 1) {\n document.getElementById('imagen').src = grupoDeFotosQuePodemosUsar[banderilla]; banderilla++;\n } else {\n document.getElementById('imagen').src = grupoDeFotosQuePodemosUsar[grupoDeFotosQuePodemosUsar.length - 1]; banderilla = 0;\n }\n }\n\n}", "title": "" }, { "docid": "850bbb427326b48bae197aed7a3fee9c", "score": "0.49302664", "text": "function maximizar(url, titulo, usuario, altImagen) {\n\n let imagen = document.getElementById(\"maxGif\");\n let tituloMax = document.getElementById(\"tituloMax\");\n let user = document.getElementById(\"usuarioMax\");\n modal.style.display = \"block\";\n\n imagen.src = url;\n tituloMax.innerText = titulo;\n user.innerText = \"Usuario: \" + usuario;\n imagen.alt = altImagen;\n}", "title": "" }, { "docid": "0372f9c48cadeb8463d50d1ef8cec7a0", "score": "0.49274775", "text": "function setURL(dipartimento) {\n \tvar options;\n\n \tswitch (dipartimento) {\n \tcase \"DICAM\":\n\t\t\toptions = { urls: 'http://www.science.unitn.it/avvisiesami/dicam/avvisi.php', directory: './Avvisi/DICAM' };\n\t\t\tbreak;\n \tcase \"DII\":\n\t\t\toptions = { urls: 'http://www.science.unitn.it/avvisiesami/dii-cibio/visualizzare_avvisi.php', directory: './Avvisi/DII' };\n\t\t\tbreak;\n \tcase \"CISCA\":\n\t\t\toptions = { urls: 'http://www.science.unitn.it/cisca/avvisi/avvisi.php', directory: './Avvisi/CISCA' };\n\t\t\tbreak;\n \tdefault:\n\t\t\toptions = \"ERROR\";\n\t\t\tbreak;\n\t}\n\n \treturn options;\n}", "title": "" }, { "docid": "f3a49642bc3cbdbf94927e862b619bfc", "score": "0.4927229", "text": "function Mostrar(btn){\n //console.log(btn.value); /*IMprimo el boton pero accedo a su valor*/\n var route='/genero/'+btn.value+'/edit';\n\n $.get(route, function(res) {\n \t/*Llenado los campos del formulario*/\n \t //Sconsole.log(res);\n \t $('#genre').val(res.genre); //formiñarop\n \t $('#id').val(res.id);\n });\n\n}", "title": "" }, { "docid": "22ce85ebcd2dc4dddd8a06f223b718b8", "score": "0.49267557", "text": "async photosUnplash(item) {\n return await axios.get('https://api.unsplash.com/search/photos?client_id=a3a865051f02bb99d25614343694acd730df8bdae7be2b6834d1dac701dfcc85&page=1&query=' + item.name)\n .then(async(response) => {\n const item = response.data.results.find((item) => {\n return item.links.download_location\n })\n const { download_location } = item.links\n const url = await axios.get(`${download_location}?client_id=a3a865051f02bb99d25614343694acd730df8bdae7be2b6834d1dac701dfcc85`)\n .then(response => response.data.url)\n .catch(error => 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Imagen_no_disponible.svg/450px-Imagen_no_disponible.svg.png')\n return url\n\n })\n .catch(error => {\n console.log(error)\n })\n }", "title": "" }, { "docid": "f8418adb93b23005dd5fac97cf104a7d", "score": "0.4920818", "text": "function filemanagerBiGetUrlType() {\n /* URL TYPE */\n const currentUrlType = $(window.parent.document).find(FILEMANAGER_BI_ID).attr('src');\n const urlTypeSplit = currentUrlType.split('/');\n const urlType = urlTypeSplit.pop();\n if (urlType == 'image' || urlType == 'media') {\n return urlType;\n } else {\n return null;\n }\n\n}", "title": "" }, { "docid": "fd74022938f4c2d6970b258099821d35", "score": "0.49193805", "text": "function chooseDb(id, title, autor) {\n // prepare clean form\n $('#chooseDbModalIdBook').val(id);\n $('#chooseDbModalUrl').val(\"\");\n\n // load list of founded url\n $('#chooseDbModalList').load(\"/chooseDbModalList\", {'id': id});\n\n // prepare for edit by hand\n $('#chooseDbModalTitleUrl').attr(\"href\", \"http://www.databazeknih.cz/search?q=\" + title + \"&hledat=&stranka=search\");\n $('#chooseDbModalAuthorUrl').attr(\"href\", \"http://www.databazeknih.cz/search?q=\" + autor + \"&in=authors\");\n $('#chooseDbModal').modal('show');\n}", "title": "" }, { "docid": "c1140bdb739f192db1f485ede77cd33f", "score": "0.49153417", "text": "function convertFlickrUrl(src) {\n return ('http://flickr.com/photo.gne?id=' + src.split(\"/\")[4].split(\"_\")[0]);\n }", "title": "" }, { "docid": "b4af2927d47272f77a3157a2e17bd6f6", "score": "0.491305", "text": "function mostrarActividad(data){\n\tif(data.id_img == \"exit\"){\n\t\twindow.location = \"../menu_ninos_lenguaje.php\";\n\t}\n\t\n\t//Recivimos las respuestas del Controlador\n\tid_img = data.id_img;\n\timagen = data.direccion;\n\tlng_sena = data.lng_sena;\n\taudio = data.audio;\n\tpregunta = data.pregunta;\n\n\t//Descomponemos la palabra\n\tvar descomponer = pregunta.split(\"\");\n\n\t//Declaramos una variable palabra que servira para colocar la interrogante de la actividad\n\t//Tendra como valor principal \"_\" ya que no mostraremos la primera letra\n\tvar palabra = \"\";\n\n\t//Asignamos la palabra descompuesta a la variable palabra, sin la primera letra\n\tfor(var i = 0; i < descomponer.length; i++){\n\t\tif(descomponer[i] == \"A\" || descomponer[i] == \"E\" || descomponer[i] == \"I\" || descomponer[i] == \"O\" || descomponer[i] == \"U\"){\n\t\t\tvar signo = false;\n\n\t\t\t//Recorremos la palabra para saber si existen signos de interrogacion\n\t\t\t//De no poseer pues lo coloca\n\t\t\tfor(var j = 0; j < palabra.length; j++){\n\t\t\t\tif(palabra[j] == \"?\"){\n\t\t\t\t\tsigno = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(signo){\n\t\t\t\tpalabra += \"_\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpalabra += \"?\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tpalabra += descomponer[i];\n\t\t}\n\t}\n\n\t//Limpiamos los elementos\n\t$(\".preg-actividad-1 p\").remove();\n\n\t//Mostramos en pantalla\n\t$(\"#img-cargar\").attr(\"src\", imagen);\n\t$(\"#tocar-audio\").attr(\"src\", audio);\n\t$(\".preg-actividad-1\").append(\"<p>\"+palabra+\"</p>\");\n}", "title": "" }, { "docid": "112c8bdd2cf76757edeea6180682334a", "score": "0.4902247", "text": "function loadPhotos(base) {\n var spinner = new Spinner(opts).spin(document.getElementById('main'));\n \n \n var galleryDiv = $(\"#gallery\");\n base('Fotos').select({\n view: \"Main View\",\n filterByFormula: $('#filter').val()\n }).eachPage(function page(records, fetchNextPage) {\n // This function (`page`) will get called for each page of records.\n records.forEach(function (record) {\n var foto = record.get('Foto')[\"0\"];\n var url = foto.url;\n var id = record.get('ID');\n\n $(\"#gallery\").append(' <div class=\"col-xs-12 col-sm-6 col-md-3\"><div class=\"card\" data-order=\"' + id + '\" >'\n\n + '<a href=\"#\" data-toggle=\"modal\" data-target=\"#photoModal\" data-url=\"' + url + '\" data-id=\"' + id + '\">'\n + ' <img class=\"card-img-top img-fluid\" src=\"' + url + '\" title=\"Click to zoom\"/>'\n + '</a>'\n + '<div class=\"card-block\">'\n + '<p class=\"card-text\">#' + id\n + '<br />'\n + '<em><b>Fotograf(in):</b> ' + record.get('Fotograf: Name') + '</em>'\n + ((typeof record.get('Notiz') == 'undefined') ? '' : '<hr /><small class=\"text-muted\">' +record.get('Notiz') + '</small>')\n + ((typeof record.get('Für welche Seite(n)?') == 'undefined') ? '' : '<hr /><small class=\"text-muted\">' \n + '<span id=\"' + record.get('Für welche Seite(n)?') + '\" class=\"\">' + record.get('Für welche Seite(n)?') + '</span>'\n + '</small>')\n + '</p>'\n + '</div></div></div>');\n\n });\n // To fetch the next page of records, call `fetchNextPage`.\n // If there are more records, `page` will get called again.\n // If there are no more records, `done` will get called.\n fetchNextPage();\n }, function done(error) {\n if (error) {\n console.log(error);\n }\n else {\n $('#photoModal').on('show.bs.modal', function (event) {\n var button = $(event.relatedTarget); // Button that triggered the modal\n var url = button.data('url'); // Extract info from data-* attributes\n var id = button.data('id');\n // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).\n // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.\n var modal = $(this);\n modal.find('.modal-title').text('Foto #' + id);\n modal.find('.modal-body .img-fluid').attr(\"src\", url);\n modal.find('.modal-footer .download').attr(\"href\", url);\n modal.find('.modal-footer .download').attr(\"download\", 'Foto_' + id);\n var angle = 0;\n $('#rotate').on('click', function() {\n angle += 90;\n modal.find('.modal-body .img-fluid').css('transform','rotate(' + angle + 'deg)');\n $('#photoModal').data('bs.modal')._handleUpdate();\n });\n });\n $('#photoModal').on('hidden.bs.modal', function (e) {\n var modal = $(this);\n modal.find('.modal-body .img-fluid').css('transform','none');\n });\n \n //load pages references\n loadPages(base); \n }\n spinner.stop();\n });\n}", "title": "" }, { "docid": "53fe43d30973b6d38a75df23f44885b2", "score": "0.4901218", "text": "function FiltroListadoContactos(url) {\n $(\".listado-contactos\").load(url);\n}", "title": "" }, { "docid": "320b2de31b7fe8de595b7eeb1cbbc68d", "score": "0.4892566", "text": "function cargar(codigo,nombre, cedula, movil, fijo, email, ubicacion, observaciones){\n\n $('#nombre_solicitante').val(nombre)\n $('#cd_rif').val(cedula)\n $('#movil').val(movil)\n $('#fijo').val(fijo)\n $('#email').val(email)\n $('#ubicacion').val(ubicacion)\n $('#observaciones').val(observaciones)\n $(\"#ModalRegistro\").modal('show');\n $(\"#ModalSolicitudes\").modal('hide');\n}", "title": "" }, { "docid": "b6d3d134e0fe7bd1ec9e430ebcc47c30", "score": "0.48920745", "text": "function ShowResumenMonth(cad)\n{\n\t$(\"#myIframe\").attr('src', cad);\n}", "title": "" }, { "docid": "a11d1ca654f3ee38627b80412e6949d1", "score": "0.4887058", "text": "function getPhotos(jsonData, route, res){\n\tvar photoNum;\n\tswitch (route) {\n\t\tcase \"city\":\n\t\t\tif (typeof jsonData.result.photos !== 'undefined') {\n\t\t\t\tphotoNum = jsonData.result.photos.length;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"myLocation\":\n\t\t\tphotoNum = jsonData.results.length;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\n\t// get all the background images url\n\tfor (var i = 0; i < photoNum; i++) {\n\t\tswitch (route) {\n\t\t\tcase \"city\":\n\t\t\t\tres.locals.url.push(getPhotosByPhotoReferenceURL + jsonData.result.photos[i].photo_reference);\n\t\t\t\tbreak;\n\t\t\tcase \"myLocation\":\n\t\t\t\tif (typeof jsonData.results[i].photos !== 'undefined') {\n\t\t\t\t\tres.locals.url.push(getPhotosByPhotoReferenceURL + jsonData.results[i].photos[0].photo_reference);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f77d846976f2900968fd8ee00fdda45e", "score": "0.4885275", "text": "function others_image() {\t\n\t\n\t\n\t\t\t\t\t\t\n\t//localStorage.linkStr_combo=linkStr_combo;\t\n\t//alert (localStorage.linkStr_combo)\t\t\t\t\t\t\t\t\n\t$('#page_link_lv').empty();\n\t$('#page_link_lv').append(localStorage.linkStr_combo);\t\n\t//alert(localStorage.linkStr_combo)\n\t\n\t$.afui.loadContent(\"#page_link\",true,true,'right');\n}", "title": "" }, { "docid": "f0fdd72b258f6d53a3f62296b91a9d08", "score": "0.48842815", "text": "getItensimagens() {\n return this.http.get(this.baseUrl + '/imagens.php?operacao=C', this.httpOptions).toPromise();\n }", "title": "" }, { "docid": "c5d2cb4d919116e581a70f5c34b102f0", "score": "0.48814446", "text": "function creaAjaxSourceByUrlNodo(urlNodo){\n return (urlNodo.split('?'))[0];\n }", "title": "" }, { "docid": "1032c2b2a23c53cabab6fb40def9456a", "score": "0.48800567", "text": "function reubicaDescripcionCollection(){\n //Valida si esta en el registro completo para mover el enlace del texto completo\n if($(\".urlDocumentFull\").length>0){\n var opcionTF=$(\".urlDocumentFull\").html();\n $(\".urlDocumentFull\").remove();\n $(\"#linkFull\").append(opcionTF); \n var fileref=document.createElement('script');\n fileref.setAttribute(\"type\",\"text/javascript\");\n fileref.setAttribute(\"src\", \"http://w.sharethis.com/button/buttons.js\");\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n stLight.options({publisher: \"524c4c3c-85b3-4b75-ae39-925731226c21\", doNotHash: false, doNotCopy: false, hashAddressBar: false});\n \n }\n\n if($('#aspect_artifactbrowser_CollectionViewer_div_collection-view').length)\n $('#aspect_artifactbrowser_CollectionViewer_div_collection-view').insertBefore(\"#aspect_artifactbrowser_CollectionViewer_div_collection-search-browse\");\n if($('#aspect_discovery_CollectionSearch_div_collection-search').length)\n $('#aspect_discovery_CollectionSearch_div_collection-search').insertBefore(\"#aspect_artifactbrowser_CollectionViewer_div_collection-browse\");\n\n}", "title": "" }, { "docid": "e411965e9b8d583c217e4b2c0e65572d", "score": "0.48734355", "text": "function modCompURL()\r\n{\r\n\t/* This redirects the page to the full list of licenses\r\n\tvar compID = document.getElementById(\"cas4_ileinner\").childNodes[0].id;\r\n\tvar str = compID.substring(6,21);\r\n\t\r\n\tvar listing = \"02i?rlid=RelatedAssetList&id=\";\r\n\tvar modURL = window.location.protocol +\"//\"+window.location.host + \"/\"+ listing + \"\" + str;\r\n\treturn modURL;\r\n\t//*/\r\n\t\r\n\t//* This redirects the page to a specific page based on the Product in the case\r\n\tvar prodName = getProductName();\r\n\tvar accountNum = getAccountNumber();\r\n\t\r\n\t//var modURL = determineFilteredPage(prodName, accountNum);\r\n\t\r\n\t//return modURL;\r\n\t//*/\r\n}", "title": "" }, { "docid": "ccae3a198ad3459a1573d058c0676e52", "score": "0.48701763", "text": "presupuestoRestante(cantGasto){\n const restante = document.getElementById('restante');\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantGasto); \n restante.innerHTML= `$${presupuestoRestanteUsuario}`; \n this.cambiaColorRestante(presupuestoUsuario,presupuestoRestanteUsuario);\n }", "title": "" }, { "docid": "630fe2aafa8292acd8a8d412c3fef7ca", "score": "0.48642507", "text": "function clickBotonElegir(){\n let imagenEleguida = -1;\n query('#selectFotoDiv').forEach(elem =>{\n if(elem.lastChild.src.includes('img/iconos/e1.png')){\n imagenEleguida = elem.firstChild.src.substring(elem.firstChild.src.lastIndexOf('/')+1,elem.firstChild.src.lastIndexOf('.'));\n }\n });\n crearAjax('../Ajax_PHP/cambiarImagenUsuario.php?num='+imagenEleguida,function(e){\n ponerImagenUsuario();\n query(\"#menuImagenesDrop\")[0].remove();\n query(\"#fondoBlanco\")[0].remove();\n });\n}", "title": "" }, { "docid": "6590f4f05602f0776d21b9958ece6bfd", "score": "0.48642355", "text": "function subir1URL(value, p, record) {\n // return '<div id=\"fi-button\"></div><div id=\"fi-button-msg\" style=\"display:none;\"></div><div class=\"x-clear\"></div>';\n }", "title": "" }, { "docid": "6590f4f05602f0776d21b9958ece6bfd", "score": "0.48642355", "text": "function subir1URL(value, p, record) {\n // return '<div id=\"fi-button\"></div><div id=\"fi-button-msg\" style=\"display:none;\"></div><div class=\"x-clear\"></div>';\n }", "title": "" }, { "docid": "b60e456d316da8743b227e950deb4594", "score": "0.48597598", "text": "function repositorioPlanetas(planets){\n var data = [];\n var req = new XMLHttpRequest();\n req.onreadystatechange = function(){\n if(this.readyState==4 && this.status == 200){\n data = JSON.parse(this.responseText);\n debugger\n switch(data.name){\n case \"Hoth\":\n document.getElementById('avatar3').src= \"./assets/img/planeta1_1.png\";\n break;\n case \"Dagobah\": \n document.getElementById('avatar3').src= \"./assets/img/planeta1_2.jpg\"; \n break; \n case \"Bespin\":\n document.getElementById('avatar3').src = \"./assets/img/planeta1_3.png\";\n break; \n case \"Endor\": \n document.getElementById('avatar3').src= \"./assets/img/planeta1_4.png\"; \n break; \n case \"Naboo\": \n document.getElementById('avatar3').src= \"./assets/img/planeta1_5.jpg\"; \n break; \n case \"Coruscant\": \n document.getElementById('avatar3').src= \"./assets/img/planeta1_6.jpg\"; \n break; \n case \"Alderaan\": \n document.getElementById('avatar3').src= \"./assets/img/planeta1_7.jpg\"; \n break; \n default:\n document.getElementById('avatar3').src= \"\"; \n }\n\n document.getElementById('nombreP').innerHTML = \"Nombre: \" + data.name;\n document.getElementById('diametro').innerHTML = \"Diametro: \" + data.diameter;\n document.getElementById('clima').innerHTML = \"Clima: \" + data.climate;\n document.getElementById('terreno').innerHTML = \"Terreno: \" + data.terrain;\n }\n }\n req.open('GET',planets,true);\n req.send();\n}", "title": "" }, { "docid": "78f38a44728174716a7d526709fa320e", "score": "0.48588136", "text": "function OpenModal() {\n\n limpiar();\n cambiar_color_obtener();\n $(\".modal-title\").text(\"Registrar Categoria\");\n $('#modal-categoria').modal('show');\n}", "title": "" }, { "docid": "b8d270dde27192ac9909c924d36271af", "score": "0.48558134", "text": "function parseUrl(){var hash=window.location.hash.substr(1),rez=hash.split(\"-\"),index=rez.length>1&&/^\\+?\\d+$/.test(rez[rez.length-1])?parseInt(rez.pop(-1),10)||1:1,gallery=rez.join(\"-\");return{hash:hash,/* Index is starting from 1 */index:index<1?1:index,gallery:gallery};}// Trigger click evnt on links to open new fancyBox instance", "title": "" }, { "docid": "9b5e1750a35103c485cbf46b9ea57d2c", "score": "0.48539254", "text": "function mostrarIns(req, res) {\r\n let colorcito;\r\n let info = \"\";\r\n\r\n req.on(\"data\", (datosparciales) => {\r\n info += datosparciales;\r\n });\r\n req.on(\"end\", () => {\r\n const formulario = querystring.parse(info);\r\n\r\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\r\n\r\n let hexa = formulario[\"color\"].split(\"#\");\r\n //console.log(hexa[1]);\r\n fetch(`http://www.thecolorapi.com/id?hex=${hexa[1]}`)\r\n .then(response => response.json())\r\n .then(data => {\r\n colorcito = data.name.value;\r\n let colortra;\r\n /* const options = {\r\n method: 'POST',\r\n url: 'https://google-translate1.p.rapidapi.com/language/translate/v2',\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded',\r\n 'accept-encoding': 'application/gzip',\r\n 'x-rapidapi-key': 'edce0bedc0msh877fd14d4d69eb4p16e9b7jsn0322d1212e8d',\r\n 'x-rapidapi-host': 'google-translate1.p.rapidapi.com',\r\n useQueryString: true\r\n },\r\n form: { q: colorcito, source: 'en', target: 'es' }\r\n };\r\n\r\n request(options, function(error, response, body) {\r\n if (error) throw new Error(error);\r\n console.log(body); Se me acabaron la pruebas pero funcionaba\r\n let resp = JSON.parse(body);\r\n colortra = resp.data.translations[0].translatedText;*/\r\n colortra = colorcito;\r\n const pagina = pug.renderFile(\"vistas/mostrar.pug\", {\r\n pretty: true,\r\n patente: formulario[\"patente\"],\r\n color: colortra,\r\n nombre: formulario[\"dueño\"],\r\n marca: formulario[\"marcas\"],\r\n modelo: formulario[\"modelos\"],\r\n });\r\n guardar(formulario);\r\n res.end(pagina);\r\n });\r\n });\r\n //});\r\n\r\n}", "title": "" }, { "docid": "9c1af5b1938acb98e32c681d9d63fb09", "score": "0.48514962", "text": "function presionEnlace(e, id)\n{\n e.preventDefault();\n var url = e.target.getAttribute('href');\n\n cargarResultado(url, id);\n}", "title": "" }, { "docid": "0919e3103b8742307b616a4e23c2b427", "score": "0.48465133", "text": "function charger_id_url(myUrl, myField, jjscript, event) \n{\n\tvar Field = findObj_forcer(myField);\n\tif (!Field) return true;\n\n\tif (!myUrl) {\n\t\tjQuery(Field).empty();\n\t\tretour_id_url(Field, jjscript);\n\t\treturn true; // url vide, c'est un self complet\n\t} else return charger_node_url(myUrl, Field, jjscript, findObj_forcer('img_' + myField), event);\n}", "title": "" }, { "docid": "c3ce7d7a4d89c280c5a1b455c783dd17", "score": "0.48460817", "text": "function recupRegion(url, nomSelect){\n fetch(url, {\n method: 'get'\n }).then(function(response){\n response.json()\n .then(function(json){\n tabReg = json;\n creationOptions(nomSelect, json);\n })\n }).catch(function(err){\n\n });\n}", "title": "" }, { "docid": "e5aec616348c76b663526ec6ca9fc2b7", "score": "0.48437366", "text": "editimagens(Regimagens) {\n if (this.permissaoUpdate('imagens')) {\n this.router.navigate(['Formimagens', Regimagens.ima_codigo], { skipLocationChange: true, fragment: 'top' });\n }\n }", "title": "" }, { "docid": "aaa83b82a28de5eb32660156147b1ab8", "score": "0.48393103", "text": "function fntViewCodigo(id_codigo) { \nlet request = window.XMLHttpRequest\n ? new XMLHttpRequest()\n : new ActiveXObject(\"Microsoft.XMLHTTP\");\nlet ajaxUrl = base_url + \"/Codigos/getCodigo/\" + id_codigo;\nrequest.open(\"GET\", ajaxUrl, true);\nrequest.send();\nrequest.onreadystatechange = function () {\n if (request.readyState == 4 && request.status == 200) {\n let objData = JSON.parse(request.responseText);\n\n if (objData.status) {\n \n // d.getElementById(\"celId\").innerHTML = objData.data.id_codigo;\n d.getElementById(\"nombreProducto\").value = objData.data.nombre_producto;\n d.getElementById(\"textv\").value = objData.data.url;\n\n\n $(\"#modalVerCodigo\").modal(\"show\");\n } else {\n swal(\"Error\", objData, \"error\");\n }\n }\n};\n\n\n\n\n\n }", "title": "" }, { "docid": "9db097551ac3c1447b7658576fc6ac75", "score": "0.48380288", "text": "function supp_dossier(){\n\t\t//On supprime le dossier precedent\n\t\t$.get(\"php-pixilleur/supp_dossier.php\",{ url_dossier : url_repertoire });\n\t}", "title": "" }, { "docid": "5946d4747e3d97e4abe79d6f8058c324", "score": "0.48358792", "text": "function GetMainpagePrograms() {\n\tvar GetMainpagePrograms = \"http://ten.tv/api/GetMainpagePrograms\";\n\t$.getJSON(GetMainpagePrograms, function(result) {\n\t\tconsole.log(result.slides);\n\t\t$num_is = 0;\n\t\t$.each(result.slides, function(i, data) {\n\t\t\tif (data.image == null) {\n\t\t\t\tdata.image = \"http://via.placeholder.com/150x200\";\n\t\t\t}\n\t\t\tif ($num_is == 0) {\n\t\t\t\tif (data.id !== null) {\n\t\t\t\t\t$(\".carousel-inner\")\n\t\t\t\t\t\t.append('<div class=\"carousel-item active\"><a href=\"prog.html?name=' + data.id + '\" class=\"main_item\"><div class=\"main_item_grad\"></div><img src=\"' + data.media_url + '\" class=\"img-responsive\" /> <img class=\"ten_logo_onfly\" src=\"images/logo.jpg\" /><div class=\"ten_logo_onfly_text\"><small>بتوقيت القاهرة</small></div></a></div>');\n\t\t\t\t} else {\n\t\t\t\t\t$(\".carousel-inner\")\n\t\t\t\t\t\t.append('<div class=\"carousel-item active\"><a class=\"main_item\"><div class=\"main_item_grad\"></div><img src=\"' + data.media_url + '\" class=\"img-responsive\" /> <img class=\"ten_logo_onfly\" src=\"images/logo.jpg\" /><div class=\"ten_logo_onfly_text\"> <small>بتوقيت القاهرة</small></div></a></div>');\n\t\t\t\t}\n\t\t\t} /*else if ($num_is == 1) {\n\t\t\t\tif (data.id !== null) {\n\t\t\t\t\t$(\".carousel-inner\")\n\t\t\t\t\t\t.append('<div class=\"carousel-item\"><a href=\"prog.html?name=' + data.id + '\" class=\"main_item\"><div class=\"main_item_grad\"></div><img src=\"' + data.image + '\" class=\"img-responsive\" /> <img class=\"ten_logo_onfly\" src=\"images/logo.jpg\" /><div class=\"ten_logo_onfly_text\"> <span>التالي</span><h2>' + data.show_at + '</h2> <small>بتوقيت القاهرة</small></div></a></div>');\n\t\t\t\t} else {\n\t\t\t\t\t$(\".carousel-inner\")\n\t\t\t\t\t\t.append('<div class=\"carousel-item\"><a class=\"main_item\"><div class=\"main_item_grad\"></div><img src=\"' + data.image + '\" class=\"img-responsive\" /> <img class=\"ten_logo_onfly\" src=\"images/logo.jpg\" /><div class=\"ten_logo_onfly_text\"> <span>التالي</span><h2>' + data.show_at + '</h2> <small>بتوقيت القاهرة</small></div></a></div>');\n\t\t\t\t}\n\t\t\t} else if ($num_is == 2) {\n\t\t\t\tif (data.id !== null) {\n\t\t\t\t\t$(\".carousel-inner\")\n\t\t\t\t\t\t.append('<div class=\"carousel-item\"><a href=\"prog.html?name=' + data.id + '\" class=\"main_item\"><div class=\"main_item_grad\"></div><img src=\"' + data.image + '\" class=\"img-responsive\" /> <img class=\"ten_logo_onfly\" src=\"images/logo.jpg\" /><div class=\"ten_logo_onfly_text\"> <span>لاحقاً</span><h2>' + data.show_at + '</h2> <small>بتوقيت القاهرة</small></div></a></div>');\n\t\t\t\t}*/ else {\n\t\t\t\t\t$(\".carousel-inner\")\n\t\t\t\t\t\t.append('<div class=\"carousel-item\"><a class=\"main_item\"><div class=\"main_item_grad\"></div><img src=\"' + data.media_url + '\" class=\"img-responsive\" /> <img class=\"ten_logo_onfly\" src=\"images/logo.jpg\" /><div class=\"ten_logo_onfly_text\"><small>بتوقيت القاهرة</small></div></a></div>');\n\t\t\t\t}\n\t\t/*\t}*/\n\t\t\t$num_is++;\n\t\t});\n\t\t$(\"img.lazyload\")\n\t\t\t.on()\n\t\t\t.lazyload();\n\t\t$(\".preloader\")\n\t\t\t.fadeOut(500);\n\t});\n}", "title": "" }, { "docid": "c764656e4f80a2a37c8972f42dcb2fe5", "score": "0.48357245", "text": "function repositorioPeliculas(films){\n var data = [];\n var req = new XMLHttpRequest();\n req.onreadystatechange = function(){\n if(this.readyState==4 && this.status == 200){\n data = JSON.parse(this.responseText);\n debugger\n repositorioPlanetas(data.planets[0])\n\n switch(data.title){\n case \"A New Hope\":\n document.getElementById('avatar2').src= \"./assets/img/pelicula1_7.jpg\";\n break;\n case \"The Empire Strikes Back\":\n document.getElementById('avatar2').src= \"./assets/img/pelicula1_1.jpg\";\n break;\n case \"Return of the Jedi\":\n document.getElementById('avatar2').src= \"./assets/img/pelicula1_3.jpg\";\n break;\n case \"The phantom Menace\":\n document.getElementById('avatar2').src= \"./assets/img/pelicula1_4.jpg\";\n break;\n case \"Attack of the Clones\":\n document.getElementById('avatar2').src= \"./assets/img/pelicula1_5.jpg\";\n break;\n case \"Revenge of the Sith\": \n document.getElementById('avatar2').src= \"./assets/img/pelicula1_2.jpg\"; \n break;\n case \"The Force Awakens\": \n document.getElementById('avatar2').src= \"./assets/img/pelicula1_6.jpg\"; \n break;\n default:\n document.getElementById('avatar2').src= \"\"; \n }\n\n document.getElementById('titulo').innerHTML = \"Titulo: \" + data.title;\n document.getElementById('productor').innerHTML = \"Productor: \" + data.producer;\n document.getElementById('director').innerHTML = \"Director: \" + data.director;\n document.getElementById('fechalanza').innerHTML = \"Fecha de lazamiento: \" + data.release_date;\n }\n }\n req.open('GET',films,true);\n req.send();\n}", "title": "" }, { "docid": "ab4df8cda1d68a2935f79656aefe3fff", "score": "0.48357046", "text": "function getComoFunciona(parent_id) {\n var parent = $(\"#\"+parent_id);\n var container = parent.find(\".ui-controlgroup-controls\");\n container.find(\"a.clone\").remove();\n \n parent.find(\".ui-content\").hide();\n\t\n $.getJSON(BASE_URL_APP + 'como_funcionas/mobileGetComoFunciona', function(data) {\n if(data){\n \n //mostramos loading\n $.mobile.loading('show');\n \n \t\titems = data.items;\n \t\t$.each(items, function(index, item) {\n \t\t var imagen = item.ComoFunciona.imagen!=\"\"?item.ComoFunciona.imagen:\"default.png\";\n var clone = container.find('a:first').clone(true);\n clone.attr(\"href\", \"como_funciona_descripcion.html?id=\" + item.ComoFunciona.id);\n clone.find(\".ui-btn-text\").html(item.ComoFunciona.title);\n clone.find(\".ui-icon\").css(\"background\",\"url('\"+BASE_URL_APP+\"img/comofunciona/\"+imagen+\"') no-repeat scroll top center transparent\");\n clone.find(\".ui-icon\").css(\"background-size\",\"28px\");\n clone.find(\".ui-icon\").css(\"margin-top\",\"-13px\");\n clone.attr(\"lang\",imagen);\n clone.css(\"display\",\"block\");\n clone.addClass(\"clone\");\n \n //append container\n container.append(clone);\n \t\t});\n \n container.promise().done(function() {\n //ocultamos loading\n $.mobile.loading( 'hide' );\n parent.find(\".ui-content\").fadeIn(\"slow\");\n \n //al momento de touch cambiamos su imagen a color rosa\n container.find(\"a\").unbind(\"touchstart\").bind(\"touchstart\", function(){\n $(this).find(\".ui-icon\").css(\"background\",\"url('\"+BASE_URL_APP+\"img/comofunciona/rosa/\"+$(this).attr(\"lang\")+\"') no-repeat scroll top center transparent\");\n $(this).find(\".ui-icon\").css(\"background-size\",\"28px\");\n });\n \n });\n }\n\t});\n}", "title": "" }, { "docid": "a6d305f02cebc483adcf2678ab57d6d0", "score": "0.48288313", "text": "function openModal(e) {\n document.querySelector(\".modal-container\").style.display = \"flex\";\n\n document.getElementById(\"modal-header\").focus();\n\n /* IMG contiene la ruta de la imagen */\n let IMG = e.srcElement.currentSrc;\n /* Pongo esa ruta en el parametro src de la imagen */\n document.querySelector(\"#img-modal\").setAttribute(\"src\", IMG);\n}", "title": "" }, { "docid": "7f9b7e48b7926039e2c258f6db00ff8a", "score": "0.48269454", "text": "function obtenerImagenesInspeccion(id){\n var parametros={\n \"id\":id,\n \"_token\":$('input[name=_token]').val(),\n };\n $.ajax({\n type:'POST',\n url:'/detalle-imagenes',\n async:false,\n cache:false,\n data:parametros,\n dataType:'json',\n success:function(data){\n\n$(\"#contenedor_imagenes_inspeccion\").html(\"\");\n if(!jQuery.isEmptyObject(data)){\n\n var html=\"\";\n if(data[0]['url_imagen_inspeccion']!=\"\"){\n html+=\"<div class='item active'>\";\n html+=\"<img width='900px' height='500px' src='/storage/\"+data[0]['url_imagen_inspeccion']+\"' alt='First slide'>\";\n html+=\"<div class='carousel-caption'>Imagen Inspección 1</div>\";\n html+=\"</div>\";\n }\n if(data[1]['url_imagen_inspeccion']!=\"\"){\n html+=\"<div class='item'>\";\n html+=\"<img width='900px' height='500px' src='/storage/\"+data[1]['url_imagen_inspeccion']+\"' alt='Second slide'>\";\n html+=\"<div class='carousel-caption'>Imagen Inspección 2</div>\";\n html+=\"</div>\";\n }\n if(data[2]['url_imagen_inspeccion']!=\"\"){\n html+=\"<div class='item'>\";\n html+=\"<img width='900px' height='500px' src='/storage/\"+data[2]['url_imagen_inspeccion']+\"' alt='Third slide'>\";\n html+=\"<div class='carousel-caption'>Imagen Inspección 3</div>\";\n html+=\"</div>\";\n }\n\n\n }else{\n\n html+=\"<div class='item active'>\";\n html+=\"<img width='900px' height='500px' src='#' alt='First slide'>\";\n html+=\"<div class='carousel-caption'>Imagen Inspección 1</div>\";\n html+=\"</div>\";\n\n html+=\"<div class='item'>\";\n html+=\"<img width='900px' height='500px' src='#' alt='Second slide'>\";\n html+=\"<div class='carousel-caption'>Imagen Inspección 2</div>\";\n html+=\"</div>\";\n\n html+=\"<div class='item'>\";\n html+=\"<img width='900px' height='500px' src='#' alt='Third slide'>\";\n html+=\"<div class='carousel-caption'>Imagen Inspección 3</div>\";\n html+=\"</div>\";\n }\n $(\"#contenedor_imagenes_inspeccion\").append(html);\n }\n });\n }", "title": "" }, { "docid": "df3620dc1d4dd5af9cc17b86713eb4ed", "score": "0.48248735", "text": "function displayRes(_arrEisBase, _ausw) {\n let divAus = document.getElementById(_ausw);\n for (let i = 0; i < 4; i++) {\n let ausWahl = document.createElement(\"div\");\n if (_arrEisBase[i] != undefined) {\n divAus.replaceChild(ausWahl, document.getElementById(_ausw + _arrEisBase[i].stil));\n ausWahl.setAttribute(\"id\", _ausw + _arrEisBase[i].stil);\n }\n if (_ausw == \"ausgewahlt\") {\n if (_arrEisBase[i] != undefined) {\n ausWahl.innerHTML = \"<img src = \" + _arrEisBase[i].path + \"></img>\" + \"<h2>Extra: \" + _arrEisBase[i].name + \"</h2><h2>Preis: \" + _arrEisBase[i].preis + \"€ </h2>\";\n }\n }\n else {\n if (_arrEisBase[i] != undefined) {\n ausWahl.innerHTML = \"<img src = \" + _arrEisBase[i].path + \"></img>\";\n if (curSite != \"index\") {\n ausWahl.style.marginTop = \"-300px\";\n }\n }\n }\n }\n }", "title": "" }, { "docid": "28b63649ec549c1b423dc5de57024da4", "score": "0.48234704", "text": "function generar_url()\n {\n //Si la pagina no se ha cargado todavia, sale de la funcion:\n if (!pagina_cargada) { return; }\n\n var url = window.location.href;\n if (url.indexOf(\"?\") != -1) { url = url.substring(0, url.indexOf(\"?\")); }\n\n var mapa = document.getElementById(\"abrir_guardar_mapa\").innerHTML;\n mapa = mapa.replace(/(<([^>]+)>)/gi,\"\"); //Borra todos los tags.\n mapa = escape(mapa); //Escapa el mapa (por si hubieran signos \"peligrosos\" para pasar por URL, aunque no deberia).\n if (mapa.indexOf(\"1\") == -1) { mapa = \"0\"; } //Si el mapa esta vacio, con enviar un cero (e incluso nada) ya es suficiente.\n \n url += \"?world=\" + mapa;\n url += \"&width=\" + escape(document.getElementById(\"abrir_guardar_x\").value);\n url += \"&height=\" + escape(document.getElementById(\"abrir_guardar_y\").value);\n\n url += (document.getElementById(\"abrir_guardar_reproducir_automaticamente\").checked) ? \"&play=1\" : \"\";\n url += (document.getElementById(\"abrir_guardar_mundo_esferico\").checked) ? \"&spherical=1\" : \"\";\n url += (document.getElementById(\"abrir_guardar_multicolor\").checked) ? \"&multicolor=1\" : \"\";\n url += (document.getElementById(\"abrir_guardar_esconder_menu_superior\").checked) ? \"&hidemenu=1\" : \"\";\n url += (document.getElementById(\"abrir_guardar_esconder_menu_inferior\").checked) ? \"&hidecontrols=1\" : \"\";\n url += (document.getElementById(\"abrir_guardar_esconder_informacion\").checked) ? \"&hideinfo=1\" : \"\";\n url += (document.getElementById(\"abrir_guardar_impedir_pintar\").checked) ? \"&undrawable=1\" : \"\";\n\n url += \"&speed=\" + escape(document.getElementById(\"abrir_guardar_velocidad\").value);\n url += \"&cellwidth=\" + escape(document.getElementById(\"abrir_guardar_celda_ancho\").value);\n url += \"&cellheight=\" + escape(document.getElementById(\"abrir_guardar_celda_alto\").value);\n url += \"&cellpadding=\" + escape(document.getElementById(\"abrir_guardar_celda_espaciado\").value);\n\n document.getElementById(\"abrir_guardar_url\").value = url;\n }", "title": "" }, { "docid": "eaff711cc8d50a60c8e33db11e0888eb", "score": "0.48163682", "text": "function projectList(){\n var modalContent = $('#myModal .modal-content');\n $.getJSON(\"js/projects.json\").always(\n function(d){\n var linkAttr = ' col-xs-6 col-md-4 col-lg-3 col-xl-2 projectimage\" data-toggle=\"modal\" data-target=\"#myModal\" id=\"' ;\n var textDiv ='<div class=\"text absolute bottom left text-center\">';\n var maskDiv = '<div class=\"mask block top left absolute\"> </div>' ;\n var imageDiv = '<div class=\"image block absolute top left work-lazy\" style=\"display: block; background-image: url(images/pixel.gif);\" data-original=\"';\n for (i = 0; i < d.length; i++) {\n $(\"#work .row\").append('<a class=\"' + d[i].item.class + linkAttr + d[i].item.id + '\">' +textDiv+'<h3>'+d[i].item.name+'</h3> <p>'+d[i].item.position+'</p></div>'+maskDiv+imageDiv+d[i].item.coverimg+'\"></div></a>');\n }\n\n $('.projectimage').click(function(){\n var index = $( \"#work .projectimage\" ).index( this );\n modalContent.find('h4').removeClass(\"winner\").addClass(d[index].item.class).html(d[index].modal.text.award);\n modalContent.find('.utilities p').remove();\n modalContent.find('.list li').remove();\n modalContent.find('.images img').remove();\n modalContent.find('.content-header').css(\"background-image\", \"url(\"+d[index].item.coverimg+\")\");\n modalContent.find('h2').text(d[index].item.name);\n modalContent.find('h3').text(d[index].item.position);\n modalContent.find('.overview').text(d[index].modal.text.overview);\n modalContent.find(\".images\").append('<img src=\"'+d[index].modal.images[0]+'\" alt=\"'+d[index].modal.text.description[0]+'\"/>');\n if( d[index].modal.text.linktext == \"No Link\"){\n modalContent.find('a.button.site').hide().attr(\"href\", \"\").text(\"\");\n }else{\n modalContent.find('a.button.site').show().attr(\"href\", d[index].modal.text.link).text(d[index].modal.text.linktext);\n }\n if( d[index].modal.text.github == \"No Link\"){\n modalContent.find('a.button.github').hide().attr(\"href\", \"\").text(\"\");\n }else{\n modalContent.find('a.button.github').show().attr(\"href\", d[index].modal.text.link).text(\"Github Repo\");\n }\n for (i = 0; i < d[index].modal.text.list.length; i++) {\n modalContent.find(\".list\").append('<li>'+d[index].modal.text.list[i]+'</li>');\n }\n for (i = 1; i < d[index].modal.images.length; i++) {\n modalContent.find(\".images\").append('<img class=\"work-lazy\" data-original=\"'+d[index].modal.images[i]+'\" alt=\"'+d[index].modal.text.description[i]+'\"/>');\n }\n $(\".work-lazy\").lazyload({\n container: $(\"#myModal\"),\n effect : \"fadeIn\",\n threshold : 700\n });\n });\n workSize();\n $(\".work-lazy\").lazyload({\n effect : \"fadeIn\",\n threshold : 300\n });\n }\n );\n }", "title": "" }, { "docid": "550878849654971fb17f41a773b70d6f", "score": "0.48130655", "text": "function parseUrl() {\n var hash = window.location.hash.substr(1),\n rez = hash.split(\"-\"),\n index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n gallery = rez.join(\"-\");\n return {\n hash: hash,\n\n /* Index is starting from 1 */\n index: index < 1 ? 1 : index,\n gallery: gallery\n };\n } // Trigger click evnt on links to open new fancyBox instance", "title": "" }, { "docid": "359aa6ba57f9749da39dcea93b3d58dc", "score": "0.4809476", "text": "function contenutiAjax(urlPagina,id) {\n\n // Dichiarazione Variabili\n \n var href = \"\"; // Inizializzazione Variabile URL attuale\n var path = \"\"; // Inizializzazione Variabile URL Finale\n var pathFinale = \"\"; // \"\n \n // Controllo Contenuti\n \n $(\".popup_verticale\").empty(); // Rimuovi contenuti precedentemente caricati\n\n // Chiamata AJAX\n \n $.ajax({\n \n url: urlPagina + '?get=ajax&id=' + id +'' , // URL da invocare\n success: function(data) { // A chiamata avvenuta\n \n $(\".popup_verticale\").append($(data).addClass(\"animated fadeIn\")); // Inietta il contenuto della pagina nella scheda con transizione\n inizializza(); // Reinizializza plugins\n\t\t\tChiudiPopUp();\n \n }\n\n });\n \n \n}", "title": "" }, { "docid": "ca5f01af1fa79a3a58a6cf5fc558a33b", "score": "0.48075604", "text": "function contentloader(uri, lang) {\n $(\"#label\").load(\"details?lang=\" + lang + \"&uri=\" + uri + \" #heading\");\n $(\"#properties\").load(\"details.php?lang=\" + lang + \"&uri=\" + uri + \" #eigenschaften\");\n $(\"#contact\").load(\"details.php?lang=\" + lang + \"&uri=\" + uri + \" #address\");\n $(\"#opening\").load(\"details.php?lang=\" + lang + \"&uri=\" + uri + \" #openinghours\");\n\t$(\"#description\").load(\"details.php?lang=\" + lang + \"&uri=\" + uri + \" #description\");\n}", "title": "" }, { "docid": "f4263000f6ef06e64b4a0bd280e90b3f", "score": "0.48058274", "text": "async function getData(resul) {\n console.log(\"el valor de resul es :\" + resul);\n\n try {\n let URL = [],\n con = 0;\n\n let res = await fetch(\n \"https://api.giphy.com/v1/gifs/search?q=\" +\n resul +\n \"&api_key=\" +\n api_key +\n \"&limit=12\"\n );\n\n let dato = await res.json();\n\n console.log(dato);\n dato.data.map(function (elemento) {\n URL[con] = elemento.images.original.url;\n con++;\n });\n\n showGif(URL);\n } catch (error) {\n console.log(\"error obteniendo datos de bsuqueda\" + error);\n }\n}", "title": "" }, { "docid": "3217722029d3ec2bde858d8c77c2080e", "score": "0.48052743", "text": "function makeUnsplashSrc (id) {\n return `${id}`;\n}", "title": "" }, { "docid": "5aa77fd97d2d85a96a737eeed70e260b", "score": "0.4804306", "text": "function redimentionnementImage(){\n\n\t\t//CALCUL DES DIMENTIONS\n\t\t$.get(\"php-pixilleur/nombres_divisible_commun.php\",{ url_img_base : url_image_base },function(retour){\n\n\t\t\timg_width = retour.img_width;\n\t\t\timg_height = retour.img_height;\n\n\t\t\ttbl_diviseurs_commun = retour.tbl_diviseurs_commun;\n\n\t\t\t//REDIMENTIONNEMENT\n\t\t\t$.get(\"php-pixilleur/redimentionnement.php\",{ url_img_base : url_image_base, width : img_width, height : img_height },function(){\n\n\t\t\t\t//indication d'un chargement\n\t\t\t\t$(\".selection-niveau ul\").append(\"<div class='chargement-image'></div>\");\n\n\t\t\t\tif($(\"#image-0\").attr(\"src\") != \"\"){\n\t\t\t\t\t//Supprition des anciens boutons \n\t\t\t\t\t$('.selection-niveau ul li').each(function(){\n\t\t\t\t\t\t$(this).off().remove();\n\t\t\t\t\t});\n\n\t\t\t\t\tmodifNiveau($(\".btn-pix-desactive\"),$('#image-0'));\n\t\t\t\t}\n\n\t\t\t\t//PIXELLISATION\n\t\t\t\tpixellisation(1);\n\n\t\t\t\t//on recoche \"desactiver\"\n\t\t\t\t$(\".form_pix input:checked\").attr('checked', false);\n\t\t\t\t$('#radio_pix_desactive').attr('checked', true);\n\n\n\t\t\t\t//modification affichage image\n\t\t\t\t$('#image img').css('display','none');\n\t\t\t\timage_visible = $(\"#image-0\");\n\n\t\t\t\timage_visible\n\t\t\t\t\t.attr('src', url_image_base.substr(3))\n\t\t\t\t\t.css('display' , 'block')\n\t\t\t\t;\n\n\t\t\t\tdimention_affichage_image();\n\n\t\t\t});\t\n\t\t});\n\t}", "title": "" }, { "docid": "1d438eb7ac71def6b5b98451dc735c2e", "score": "0.48037893", "text": "function getMediaObjectUrl(handle, par, size, change, target, addAsBg) {\n UniteAdminRev.ajaxRequest('load_library_object', { 'handle': handle, 'type': \"orig\" }, function (response) {\n if (response.success) {\n var imgobj = { imgurl: response.url, imglib: \"objectlibrary\", imgproportion: true, imgwidth: parseInt(response.width, 0) * size, imgheight: parseInt(response.height, 0) * size };\n if (target === \"object\" && !addAsBg) {\n if (!change) {\n addLayerImage(imgobj, par);\n } else {\n var objData = {};\n objData.image_url = response.url;\n objData.image_librarysize = {};\n objData.image_librarysize.width = parseInt(response.width, 0) * size;\n objData.image_librarysize.height = parseInt(response.height, 0) * size;\n objData.scaleProportional = true;\n t.updateCurrentLayer(objData);\n resetCurrentElementSize();\n redrawLayerHtml(t.selectedLayerSerial);\n\n t.add_layer_change();\n\n }\n } else if (target === 'background') {\n switchMainBGObject(response.url);\n } else if (target === 'layer') {\n var objData = {};\n objData.bgimage_url = response.url;\n objData.image_librarysize = {};\n objData.image_librarysize.width = parseInt(response.width, 0) * size;\n objData.image_librarysize.height = parseInt(response.height, 0) * size;\n switchLayerBackground(objData);\n }\n }\n });\n }", "title": "" } ]
80fd7516d8493935630d35845a963d01
starts the loadEmployees function when the page loads
[ { "docid": "f23cdb6c446aad9c971f4df7a60e8d85", "score": "0.6178384", "text": "componentDidMount() {\n this.loadEmployees();\n }", "title": "" } ]
[ { "docid": "87ac0ebb6fc62fb1ecf22d50e0dcae67", "score": "0.6938192", "text": "function getEmployees() {\n $.get(\"/api/employees\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createEmployeeRow(data[i]));\n }\n renderEmployeeList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "title": "" }, { "docid": "ab9038b2afb63ca038e61837b6c8d7f5", "score": "0.69235146", "text": "function bodyLoad(){\r\n var employee = new Employee();\r\n employee.renderData();\r\n }", "title": "" }, { "docid": "ef2f05fcb3305fb2a60cb697289d1c7b", "score": "0.6683476", "text": "function init(){\n\t\temployer=JSON.parse(localStorage.getItem(\"employer\"));\n\t\tdocument.getElementById(\"employerName\").innerHTML=\"Employer Name: \"+employer;\n\n\t\t//to set the employee list in post roster view\n\t\tgetEmployeeList(\"employeeName\");\n\t\t//to set the employee list in working hours view\n\t\tgetEmployeeList(\"employee_Name\");\n\t\t//to set the employee list in payslip view\n\t\tgetEmployeeList(\"paySlipEmployeeName\");\n\t}", "title": "" }, { "docid": "5ea3dc82ae08622a3f9090de13f085aa", "score": "0.66596645", "text": "function load_admin_home()\n{\n $.ajax({\n url: \"../controller/controller.php\",\n method: \"POST\",\n data: {action: \"get_employees\"},\n dataType: \"json\",\n success: function(data){\n var html = \"\";\n $(\".container-fluid #employees_view .row\").empty();\n if(Object.entries(data).length !== 0 && data.constructor !== Object){\n $.each(data, function(key, employee){\n var html = `<div class=\"card\" id=\"employee_card\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${employee.emp_fname} ${employee.emp_lname}</h5>\n <div class=\"scrollable\">\n <p class=\"card-text\">\n <ol id=\"${employee.emp_id}\" class=\"emp-list\">\n <p hidden>${employee.emp_id}</p>\n ${load_clients_to_employee(employee.emp_id)}\n </ol>\n </p>\n </div>\n </div>\n </div>`;\n $(\".container-fluid #employees_view .row\").append(html);\n });\n }else{\n $(\".container-fluid #employees_view .row\").html(\"<h1>NO EMPLOYEES IN THE SYSTEM</h1>\");\n } \n }\n });\n\n $.ajax({\n url: '../controller/controller.php',\n method: 'POST',\n dataType: 'json',\n data: {action: 'get_tasks'},\n success: function(tasks){\n $('#add_client #check-task').empty();\n $.each(tasks, function(key, value){\n var html = `<div class=\"form-check\">\n <label class=\"form-check-label\" for=\"check\">\n <input type=\"checkbox\" class=\"form-check-input\" id=\"check\" name=\"option2\" value=\"\">\n <span>${value.task_name}</span>\n </label>\n </div>`;\n $('#add_client #check-task').append(html);\n });\n }\n });\n\n $.ajax({\n url: '../controller/controller.php',\n method: 'POST',\n dataType: 'json',\n data: {action: 'get_employees'},\n success: function(employees){\n $('.client-section #employee_list').empty();\n $('.client-section #employee_list').append('<option selected disabled id=\"default\">- Assign to -</option>');\n $.each(employees, function(key, value){\n var html = \"<option class='option-btn' id='\"+value.emp_id+\"'>\"+value.emp_fname +\" \"+value.emp_lname+\"</option>\";\n $('.client-section #employee_list').append(html);\n }); \n }\n });\n}", "title": "" }, { "docid": "f9ec4246cbdb1a8b3bf4726dc3fd3130", "score": "0.6635069", "text": "function loadEmployees(roles) {\n //url to get all employee from the api\n let url = \"http://sandbox.bittsdevelopment.com/code1/fetchemployees.php?roles=\" + roles;\n // create the request object\n let xhttp = new XMLHttpRequest();\n //return the response if the request was a success\n xhttp.onreadystatechange = function() {\n if (this.readyState == XMLHttpRequest.DONE && this.status == 200) {\n let employees = JSON.parse(this.responseText); //convert to json object\n //console.log(employees);\n //create view for the list of employees\n let employeesView = createEmployeesView(employees, roles);\n\n // add view to the page\n //add details view to the page\n document.getElementsByTagName('main')[0].appendChild(employeesView);\n\n }\n };\n //specify the response type\n// xhttp.responseType = \"json\";\n //prepare the request;\n xhttp.open(\"GET\",url,true);\n\n //send the request;\n xhttp.send();\n}", "title": "" }, { "docid": "951437a2c1a153de6ffe2585df00b482", "score": "0.6626486", "text": "function initRun() {\n createHtml();\n addEmployee();\n}", "title": "" }, { "docid": "39c05ea06b1bd93602b3ce9c7699f036", "score": "0.6521284", "text": "function load() {\n $.ajax({\n url: VIS.Application.contextUrl + \"VAT/EmployeeByView/Index\",\n type: 'Get',\n async: false,\n data: {\n windowno: $self.windowNo\n },\n success: function (data) {\n loadRoot(data);\n },\n error: function (data) {\n alert(data)\n\n }\n });\n }", "title": "" }, { "docid": "89f5f4605b36ee100ac85b05e643dde9", "score": "0.65172356", "text": "importEmployees() {\n\t\t$.getJSON(`https://randomuser.me/api/?results=${this.employeesCount}&nat=US`, (data) => {\n\t\t\tconst results = data.results;\n\t\t\t$.each(results, (index, employee) => {\n\t\t\t\temployees.push(employee);\n\t\t\t\tthis.employeeCard(employee);\n\t\t\t});\n\n\t\t\tthis.employeeModal(employees);\n\t\t});\n\t}", "title": "" }, { "docid": "f7b2799f95b8883415b2fd25eb2eb209", "score": "0.6475234", "text": "function populateEmployees(){\n employeeService.getAllEmployee().then(function(result){\n $scope.employee = result.data;\n });\n }", "title": "" }, { "docid": "cb1b642e27ac317cfbbf63993b1aaf73", "score": "0.63920933", "text": "function callEmployeesAPI() {\n $.ajax({\n url: `${URL_API}/employees`,\n contentType: 'application/json',\n type: 'GET',\n headers: {\n 'Authorization': 'Bearer ' + ACCESS_TOKEN,\n 'Access-Control-Allow-Credentials' : 'true',\n 'Access-Control-Allow-Origin': '*'\n },\n dataType: 'json',\n success: function(data){\n const dataFingerEmployees = data.employees;\n dataEmployees = dataFingerEmployees;\n // render data list Employees page\n initPaginationEmployees(dataEmployees);\n loading.hide();\n }\n });\n }", "title": "" }, { "docid": "46b14ec9da8dd92518d5583b12e1b092", "score": "0.63681453", "text": "function load() {\n var promiseget = crudService.listofEmployee();\n promiseget.then(\n function (model) {\n console.log(model);\n $scope.Employees = model.data;\n }, \n function (err) \n {console.log('Error occured',err); });\n\n }", "title": "" }, { "docid": "6cb9a1fd83e3aa4e1d486160a44dfb39", "score": "0.635267", "text": "function loadEmp() \n{\n if (onece == false)\n {\n const request = new XMLHttpRequest();\n request.overrideMimeType(\"content-type: application/json\"); \n\n request.open('get', 'Data/employee.json');\n request.onload = () => {\n const json = JSON.parse(request.responseText);\n populateEmp(json);\n \n }; \n onece = true;\n request.send();\n\n }\n \n}", "title": "" }, { "docid": "d933a20773bfc995015c82f2dc755dd0", "score": "0.6300982", "text": "function fetch_employee_list_data(){\n\t$.ajax({\n\t\turl:\"libs/php/employee_list.php\",\n\t\tmethod:\"POST\",\n\t\tsuccess:function(data){\n\t\t\tif(data.split(':')[0] == \"Error\"){\n\t\t\t\t$(\"#insert-element\").hide();\n\t\t\t\t$(\"#insert-heading\").html('<div class = \"alert alert-danger\">There was an error fetching the data!</div>');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\"#insert-heading\").html(\"<h2 align='center'>Artisans</h2>\")\n\t\t\t\t$(\"#insert-element\").hide();\n\t\t\t\t$(\"#insert-element\").html(data);\n\t\t\t\t// $(\"#task-overview\").DataTable();\n\t\t\t\t$(\"#insert-element\").fadeIn(1000);\n\t\t\t}\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "58b5b6032f94328e3ba00d8f5f461bd4", "score": "0.6278403", "text": "function GetAllEmployees() {\n\n $(\"#LoadingStatus\").html(\"Loading....\");\n var getEmployeeData = crudAJService.getEmployees();\n \n getEmployeeData.then(function (employee) {\n $(\"#LoadingStatus\").html(\" \");\n $scope.employees = employee.data;\n }, function () {\n $(\"#LoadingStatus\").html(\" \");\n alert('Error in getting employees records');\n });\n }", "title": "" }, { "docid": "71f2e6d0e35922810110175bdb8de0f1", "score": "0.6278117", "text": "function loadEmployee( itcb ) {\n if( !activity.mirrorActivityId || !setEmployeeId ){\n return itcb( null );\n }\n\n Y.doccirrus.mongodb.runDb( {\n user: user,\n model: 'employee',\n action: 'get',\n query: { _id: setEmployeeId },\n callback: onEmployeeLoaded\n } );\n\n function onEmployeeLoaded( err, result ) {\n if ( !err && !result[0] ) { err = Y.doccirrus.errors.rest( 404, `Failed to get the emploee for activity ${activityId}` ); }\n if( err ) { return itcb( err ); }\n\n employee = result[0];\n\n itcb( null );\n }\n }", "title": "" }, { "docid": "411835fb62477d8a5387f621692b66cb", "score": "0.62738436", "text": "function startatLoad(){\n\tloadNavbar(function(){\n\t\tloadData(function(){\n\t\t\tloadlast();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "e28212b20acd00048d090ed7d276ee1b", "score": "0.6272756", "text": "function load_employee_home()\n{\n showLoader();\n setTimeout(function(){\n $.ajax(\n {\n url: \"../controller/controller.php\",\n method: \"POST\",\n dataType: \"json\",\n data: {id: sessionStorage.getItem('session_id'), action: \"get_clients\"},\n success: function(data)\n {\n var count = 0;\n $('#all_views').find('ul').empty();\n if(Object.entries(data).length !== 0 && data.constructor !== Object)\n { \n $.each(data, function(key, client)\n {\n get_unattended_tasks(client.allocate_client_fname, client.allocate_client_lname);\n setTimeout(function(){\n var html = `<li class=\"list-group-item d-flex justify-content-between client-view\"><span>${client.allocate_client_fname} ${client.allocate_client_lname}</span><span>${tasks_count[count]}</span></li>`;\n \n $('#all_views').find('ul').append(html);\n count++; \n hideLoader(); \n },1000);\n \n });\n \n }else\n {\n hideLoader();\n $('#all_views').find('ul').append(\"<h3>No clients allocated for you</h3>\");\n }\n \n }\n });\n \n },1000);\n}", "title": "" }, { "docid": "5b145bce1739cac95683d82c62095a80", "score": "0.6266557", "text": "function loadEmployers() {\n var id = $('.id').data('temp')\n let answer= fetch(`/tax_years/${id}/employers.json`)\n .then(response => response.json())\n .then(json => {\n json.forEach( function(emp){\n let employer = new Employer(emp)\n employer.displayEmployer()\n })\n\n })\n}", "title": "" }, { "docid": "b4937ffd35aee969c6a476efa0d5361b", "score": "0.619345", "text": "function onReady() {\n displayEmployees();\n\n $('#empForm').submit(addEmployee);\n $(document).on('click', '.deleteButton', deleteEmployee);\n}", "title": "" }, { "docid": "0cd071876a7fbd5d3d262987fc537887", "score": "0.61583996", "text": "function viewEmployees() {\n console.log(\"retrieving employess from database\");\n var fancyQuery =\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id;\";\n connection.query(fancyQuery, function (err, answer) {\n console.log(\"\\n Employees retrieved from Database \\n\");\n console.table(answer);\n });\n init();\n}", "title": "" }, { "docid": "7c8ba14f71a6e977dda1c73ef8664064", "score": "0.6115572", "text": "function loadInitialData()\n {\n loadTaskLists();\n }", "title": "" }, { "docid": "7b3b91b9c50c86f952b9e84e0b0bcd62", "score": "0.61102444", "text": "function getEmployees() {\n // Runs function to get all the dailycostss from database\n Employee.getEmployees().then(function(data) {\n // Check if able to get data from database\n if (data.data.success) {\n // Check which permissions the logged in user has\n if (data.data.permission === 'admin' || data.data.permission === 'moderator') {\n app.employees = data.data.employees; // Assign dailycostss from database to variable\n\n for(var j=0; j < app.employees.length; j++) {\n app.employees[j].costs = 0;\n }\n\n app.loading = false; // Stop loading icon\n app.accessDenied = false; // Show table\n\n // Check if logged in user is an admin or moderator\n if (data.data.permission === 'admin') {\n app.editAccess = true; // Show edit button\n app.deleteAccess = true; // Show delete button\n } else if (data.data.permission === 'moderator') {\n app.editAccess = true; // Show edit button\n }\n } else {\n app.errorMsg = 'Insufficient Permissions'; // Reject edit and delete options\n app.loading = false; // Stop loading icon\n }\n } else {\n app.errorMsg = data.data.message; // Set error message\n app.loading = false; // Stop loading icon\n }\n });\n }", "title": "" }, { "docid": "246e398c4a83df8744c604cb35207b7c", "score": "0.6080925", "text": "function start() {\n \n addEmployee()\n}", "title": "" }, { "docid": "f056a3e052c73a917290d196e45357fa", "score": "0.60784894", "text": "function searchEmployees(){\r\n checkConnection();\r\n chkStatusAndPwd();\r\n app.preloader.show();\r\n var session_uid = window.localStorage.getItem(\"session_uid\");\r\n var session_ulevel = window.localStorage.getItem(\"session_ulevel\");\r\n var session_department = window.localStorage.getItem(\"session_department\");\r\n var search_empl = $(\"#search_empl\").val();\r\n var cs_id = $(\"#hidd_csid\").val();\r\n var comp_name = $(\"#hidd_comp\").val();\r\n var int_cnt='';\r\n var emp_dets = '';\r\n $.ajax({ \r\n type:'POST', \r\n url:base_url+'liveappcontroller/searchtotEmps',\r\n data:{'cs_id':cs_id,'search_empl':search_empl}, \r\n success:function(empslist){\r\n var json_emps = $.parseJSON(empslist);\r\n var elist = json_emps.totemps;\r\n var tot_eints = elist.length;\r\n var block = '<div class=\"block\"><div class=\"col-100\"><div class=\"grey-txt fw-600\"><h3>'+comp_name+' ('+tot_eints+')</h3></div></div></div>';\r\n $(\"#compint_details\").html(block);\r\n emp_dets+='<div class=\"list\"><ul>';\r\n if(tot_eints==0){\r\n emp_dets+='<li class=\"\"><div class=\"item-inner item-cell\"><div class=\"item-row ml-10 mt-5\"><div class=\"item-cell orange-txt font-14 fw-600\">No Employees.</div></div></li>';\r\n }else{\r\n for(var i=0;i<tot_eints;i++){\r\n var fnm = elist[i].cand_fname;\r\n var lnm = elist[i].cand_lname;\r\n if(fnm!=null){\r\n var cn_nm = fnm+\" \"+lnm;\r\n }else{\r\n var cn_nm='';\r\n } \r\n // var cn_nm = elist[i].cand_fname+\" \"+elist[i].cand_lname;\r\n var cn_dob = elist[i].cand_dob;\r\n var cn_mob = elist[i].cand_mobile;\r\n var cn_intdt_tm = elist[i].int_date_time; \r\n var cn_int_status = elist[i].i_status; \r\n var cand_cmp_id = elist[i].cand_cmp_id;\r\n var reg_num = elist[i].reg_num;\r\n var int_joineedate = elist[i].int_joineedate;\r\n var positn = elist[i].designation;\r\n if(positn!='' && positn!=null){\r\n positn='<span class=\"redtxt fw-500 font-10\">('+positn+')</span>';\r\n }else{\r\n positn='';\r\n }\r\n if(reg_num!='' && reg_num!=null){\r\n reg_num=reg_num\r\n }else{\r\n reg_num='';\r\n }\r\n //alert(cand_cmp_id);\r\n if(i%2==1){\r\n var cls = 'light-orange';\r\n }else{\r\n var cls = ''; \r\n }\r\n // emp_dets+='<tr class=\"tr-border\"><td class=\"text-capitalize font-10 fw-500\"><a class=\"\" href=\"#\">'+cn_nm+'</a><br/><span class=\"grey-txt font-10\">DOB: '+cn_dob+'</span><br/><i class=\"f7-icons font-10 text-muted\">phone_fill</i> <span class=\"grey-txt font-10\">'+cn_mob+'</span></td><td class=\"text-center grey-txt font-12 font-500\">'+int_joineedate+'</td></tr>';\r\n emp_dets+='<tr class=\"tr-border\"><td class=\"text-capitalize font-12 fw-500\"><a class=\"\" href=\"#\">'+cn_nm+ positn+'</a><br/><span class=\"grey-txt font-10\">Reg No: '+reg_num+'</span><br/></td><td class=\"text-center grey-txt font-12 font-500\">'+int_joineedate+'</td></tr>'; \r\n } \r\n } \r\n emp_dets+='</ul></div>';\r\n $(\"#emp_dets\").html(emp_dets);\r\n app.preloader.hide(); \r\n }\r\n });\r\n}", "title": "" }, { "docid": "10f426b3c371618699ec778bc46e2908", "score": "0.60719794", "text": "function appendEmployees(){\n\n // Empties out any employee fields before filling them\n $(\".employee-header\").empty();\n $(\".employee-body\").empty();\n\n // Populates the employee name and information fields\n $(\".employee-header\").append('<th>Employee Name</th>');\n $(\".employee-header\").append('<th>Skillset</th>');\n $(\".employee-header\").append('<th>Sprint Points</th>');\n\n // Fades in the populated information to the DOM\n $(\".employee-info\").fadeIn(1000);\n getEmployee();\n}", "title": "" }, { "docid": "35ddccf51c7acc2ddf5bbadd2abf6524", "score": "0.60682356", "text": "function getEmployees(callback) {\n \n /* CAN BE AN AJAX \"GET\" REQUEST -- w/ `updateState` as the event handler */\n $.getJSON(employeesUrl, function(data) {\n\tif(_.isFunction(callback))\n\t callback(data);\n });\n}", "title": "" }, { "docid": "1776e788013156fbf075181fe9ccff54", "score": "0.6060381", "text": "function DropDownLoad() {\n GetEmployeeNames();\n GetCityList();\n}", "title": "" }, { "docid": "d021896789e6ced49d93ab4050f8601c", "score": "0.60593575", "text": "function InitialLoad() {\n \n LoadCategory();\n loadManufacturer();\n getItemHead();\n}", "title": "" }, { "docid": "fc5160c8b0a5b59d0da48cb874f2db3d", "score": "0.60452455", "text": "function loadEmployeesToTable(){\n\tstoreEmployeesJsonToLocal();\n\tcleanTableForEmployees();\n\tdocument.getElementById('edit-panel').style.display = 'none';\n\tdocument.getElementById('add-btn').innerHTML = \"<button onclick='addPanelEmployees()' class='addt-btn'>Add Employee</button>\"\n\tvar displayTable = document.getElementById('display-table');\n\tfor(i = 0; i<jsonEmployeesObjArray.length; i++){\n\t\tif(i%2 == 0){\n\t\t\tdisplayTable.innerHTML += \"<tr class='odd-row'><td>\"+jsonEmployeesObjArray[i].id+\"</td><td>\"+jsonEmployeesObjArray[i].name+\"</td><td>\"+jsonEmployeesObjArray[i].dept+\"</td><td>\"+jsonEmployeesObjArray[i].mail+\"</td><td><center><button onclick='editPanelEmployees(\"+i+\")' class='act-btn'>Edit</button><button onclick='delEmployees(\"+i+\")' class='act-btn'>Delete</button></center></td></tr>\"\n\t\t}\n\t\telse{\n\t\t\tdisplayTable.innerHTML += \"<tr><td>\"+jsonEmployeesObjArray[i].id+\"</td><td>\"+jsonEmployeesObjArray[i].name+\"</td><td>\"+jsonEmployeesObjArray[i].dept+\"</td><td>\"+jsonEmployeesObjArray[i].mail+\"</td><td><center><button onclick='editPanelEmployees(\"+i+\")' class='act-btn'>Edit</button><button onclick='delEmployees(\"+i+\")' class='act-btn'>Delete</button></center></td></tr>\"\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dc847a7ca428a54ce9131c7af84ce7da", "score": "0.60254145", "text": "function runSearch() {\n allEmployeesFunction();\n allRolesList();\n allDepartmentsList();\n console.log(\"Welcome to the employee management system!\")\n startingQuestions();\n}", "title": "" }, { "docid": "516c5c3d540dac0a065ad8c2330379fb", "score": "0.6012056", "text": "function initPaginationEmployees(data, itemPerPage = ITEM_PERPAGE){\n const $paginationWrapper = $('#pagination__wrapper__employees');\n if ($paginationWrapper.data(\"twbs-pagination\")){\n $paginationWrapper.twbsPagination('destroy');\n }\n\n if (data&& data.length >= 1) {\n let numberPage = data.length / itemPerPage;\n if (data.length % itemPerPage) {\n numberPage += 1;\n }\n const firstTwentyFiveitems = data.slice(0, 26);\n renderDataListEmployees(firstTwentyFiveitems);\n\n $paginationWrapper.twbsPagination({\n nextClass: 'page-items next',\n prevClass: 'page-items prev',\n lastClass: 'page-items last',\n firstClass: 'page-items first',\n first: '&#171;',\n prev: '&#8249;',\n next: '&#8250;',\n last: '&#187;',\n currentPage: 1,\n totalPages: numberPage,\n visiblePages: 3,\n onPageClick: function(_, page) {\n const startIndex = (page - 1) * 25;\n const endIndex = page * 25;\n const listShowOnePage = data.slice(\n startIndex,\n endIndex\n );\n renderDataListEmployees(listShowOnePage, page);\n loading.hide();\n },\n });\n }else{\n renderDataListEmployees([]);\n let tmpDataListEmployeesNodata = '';\n tmpDataListEmployeesNodata += `<tr>\n <td scope=\"row\" class=\"daily daily_no\" colspan=\"4\"><div>NO DATA</div></td>\n </tr>`;\n $('.js-tbody-employees').html(tmpDataListEmployeesNodata)\n }\n }", "title": "" }, { "docid": "91d25375eacf7eb35e740302930d68f0", "score": "0.6006745", "text": "function loadEmployees() {\n // Create the object\n const xhr = new XMLHttpRequest();\n\n // Open the connection\n xhr.open('GET', 'employees.json', true);\n\n // Execute the function\n xhr.onload = function() {\n if(this.status === 200) {\n // Get the response as an Object\n const employees = JSON.parse( this.responseText );\n \n let output = '';\n employees.forEach(function(employee) {\n output += `\n <ul>\n <li>ID: ${employee.id}</li>\n <li>Name: ${employee.name}</li>\n <li>Company: ${employee.company}</li>\n <li>Job: ${employee.job}</li>\n </ul>\n `;\n });\n\n document.getElementById('employees').innerHTML = output;\n \n }\n }\n\n // Send the request\n xhr.send();\n\n}", "title": "" }, { "docid": "46b325004f24f332d881a65113c9da0f", "score": "0.59889287", "text": "static showAllEmployees(){\n if(localStorage.getItem('employees'))\n {\n JSON.parse(localStorage.getItem('employees')).forEach((item)=>{\n Employee.showHtml(item.id,item.name,item.email,item.mobile);\n \n })\n \n }\n\n }", "title": "" }, { "docid": "1964e5c3cabb9efe2554a28be9919d31", "score": "0.5979649", "text": "function makeEmployeesRequest(url) {\n\n $.getJSON(url, function(data) {\n //JQuery parses the JSON string using JSON.parse for you.\n console.log(data);\n \n displayEmployeesTable(data);\n });\n }", "title": "" }, { "docid": "93bcfce1606a29684bc44b528fe2fd22", "score": "0.5917124", "text": "function load() {\n loadData();\n kendofy();\n loadUserStoryGrid();\n loadCommentsGrid();\n registerEvents();\n}", "title": "" }, { "docid": "0f306bda5690143a13501a42baf8de75", "score": "0.5915618", "text": "function OnLoad() {\n\t// init the Google data JS client library with an error handler\n\tgoogle.gdata.client.init(calvis.handleError);\n\n\t// Google Calendar IDs to Load. Modify this list to show others\n\tvar calIds = [ 'https://www.google.com/calendar/feeds/c62g7hg0nqbbdhovjpaeihuqgs%40group.calendar.google.com/private-cfebeefd737c8879b68d65cb7203caa6/basic' ];\n\n\t// Start calvis rendering\n\tloadCalendar(calIds);\t\t\n}", "title": "" }, { "docid": "5b0dedcdddac6bbe365b467e4075a1e4", "score": "0.58945566", "text": "function displayAllEmployeesByLastName() {\n\n $.ajax({\n url: \"libs/php/sortAllEmployeesByLastName.php\",\n type: 'POST',\n dataType: 'json',\n success: function(result) {\n if (result.status.name == \"ok\") { \n\n if(currentView === 'table') {\n createTable(result); \n } else if (currentView === 'grid') {\n createCards(result);\n }\n\n selectionEmployeeTable = result;\n searchMain();\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n reject(errorThrown);\n }\n }); \n\n}", "title": "" }, { "docid": "2118f5677ce5e33d0e0444c10895a800", "score": "0.5886829", "text": "function viewAllEmployees() {\n connection.query(\n \"SELECT first_name, last_name, title, salary, name FROM employee INNER JOIN role ON employee.role_id = role.id INNER JOIN departments ON role.departments_id = departments.id;\",\n (err, data) => {\n if (err) throw err;\n console.table(data);\n startFunction();\n }\n );\n}", "title": "" }, { "docid": "1f23ab8dcf44c0ae0fe9d6692c6b82c2", "score": "0.58677465", "text": "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function (err, data) {\n if (err) throw err;\n // banner.set(\" - Employee View - \")\n console.table(banner.set(\" - Employee View - \"), data);\n runSearch();\n })\n}", "title": "" }, { "docid": "4197c473461c20b262d42540d697a29c", "score": "0.586502", "text": "function loadEventList(callback) {\n\t\tpage.showLoading();\n\t\tdojo.xhrGet({\n\t\t\turl: \"page/events.php?practices=\" + (page.isShowPractices() ? \"true\" : \"false\"),\n\t\t\tload: function(data) {\n\t\t\t\tdojo.byId(\"event-list\").innerHTML = data;\n\t\t\t\tif (eventId) {\n\t\t\t\t\thighlightEvent(eventId);\n\t\t\t\t}\n\t\t\t\tif (callback) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t\tpage.hideLoading();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "cf62c0894c43738e5b28cfed439450a4", "score": "0.58623016", "text": "async function fetchEmployeesList() {\n fetch('http://localhost:8080/getEmployees').then((response) => {\n return response.json();\n })\n .then((data) => {\n const transformedEmployees = data.map((employeeData) => {\n return {\n ...employeeData\n };\n });\n setEmployees(transformedEmployees);\n\n // set the current employee to be the first in the list\n setCurrentEmployee(transformedEmployees[0]);\n });\n }", "title": "" }, { "docid": "8fb872539b337753d1cd6b69b2da7982", "score": "0.585566", "text": "function viewEmployees() {\n var query = 'SELECT * FROM employee';\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(res.length + \" employees match criteria\");\n printTable(res);\n init();\n })\n}", "title": "" }, { "docid": "a94eb3ec33e48df9eb31bb9d2cab052e", "score": "0.5843785", "text": "function loadMyEvents(callback) {\n\t\tpage.showLoading();\n\t\tdojo.xhrGet({\n\t\t\turl: \"page/myevents.php?practices=\" + (page.isShowPractices() ? \"true\" : \"false\"),\n\t\t\tload: function(data) {\n\t\t\t\tdojo.byId(\"myevents\").innerHTML = data;\t\t\t\t\n\t\t\t\tdojo.parser.parse('myevents');\n\t\t\t\t\n\t\t\t\tif (callback) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t\tpage.hideLoading();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "40120a08d27e3ca935cd3c286701442f", "score": "0.5838083", "text": "function grid_employee() {\n $.ajax({url: \"EmployeeDetail.php\", async: false, type: 'POST', success: function(data) {\n $('#empGrid').html(data);\n }});\n}", "title": "" }, { "docid": "a7ac43d85f72ca4fbc5302aba41e42c9", "score": "0.5826338", "text": "function viewEmployees(){\n connection.query(\"SELECT e.eid, e.first_name, e.last_name, d.department, r.title, r.salary FROM employee e INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id ORDER BY e.last_name;\", function(err, data){\n if(err) throw err;\n console.table(data);\n mainMenu();\n });\n}", "title": "" }, { "docid": "a70e71ba180a42fddd918b4412243855", "score": "0.581143", "text": "function startatLoad(){\n\tloadNavbar(function(){\n\t\t});\n}", "title": "" }, { "docid": "0d01925d436d320ac93ec71fe5988f0f", "score": "0.58078384", "text": "function viewAllEmployees() {\n printDivider();\n console.log(\"Here's an overview of all employees:\");\n connection.query(\"SELECT employee.id, employee.first_name, employee.last_name, role.title, role.salary, department.name FROM department JOIN role ON department.id = role.department_id JOIN employee ON role.id = employee.role_id ORDER BY employee.id ASC;\", function(err, res) {\n if (err) throw err;\n console.table(res);\n displayOptions();\n });\n}", "title": "" }, { "docid": "174eb169cda6d22dff55bf9a30c65980", "score": "0.58064586", "text": "function loadAll() {\n\n var allEmployees = [];\n\n $rootScope.users.forEach(function(user) {\n allEmployees.push({\n value: (user.first_name + \" \" + user.last_name).toLowerCase(),\n display: (user.first_name + \" \" + user.last_name),\n id: user.$id,\n photoUrl: user.photoUrl,\n lastName: user.last_name.toLowerCase()\n })\n })\n\n allEmployees.sort(function(a, b) {\n return (a.lastName < b.lastName) ? -1 : 1;\n })\n\n return allEmployees;\n }", "title": "" }, { "docid": "b672574b0aedc7319f105556b671fe38", "score": "0.5804073", "text": "function loadData() {\n token = getToken();\n projectId = getCurProject();\n //projectId = isNull(readQueryString(\"pid\")) ? 1 : readQueryString(\"pid\");\n //projectName = isNull(readQueryString(\"pname\")) ? 'Employee Portal' : readQueryString(\"pname\");\n //loadDummyData();\n loadDataFromServices();\n}", "title": "" }, { "docid": "b44f78c5b9e9e82b670555555ede20c0", "score": "0.5797952", "text": "function mainLoadEL() {\n\tcreateUser('juandlc@example.com', 'password', 'JUAN DELA CRUZ', 0.50);\n\tcreateUser('maria.makiling@example.com', 'password', 'MARIA MAKILING', 20000);\n\tcreateUser('mang_jose10@example.com', 'password', 'MANG JOSE', 987654321);\n\n\tlistUsers();\n}", "title": "" }, { "docid": "f68d22840c3b4e0d795839e19287505d", "score": "0.57884556", "text": "function eltdfOnWindowLoad() {\n eltdfInitPortfolioMasonry();\n eltdfInitPortfolioFilter();\n initPortfolioSingleMasonry();\n eltdfInitPortfolioListAnimation();\n\t eltdfInitPortfolioPagination().init();\n eltdfPortfolioSingleFollow().init();\n }", "title": "" }, { "docid": "28676d7c0f99457166d7a710fa3bb117", "score": "0.57880497", "text": "function preload() {\n\t$.ajax({\n\t\turl: \"http://web-dev.ci-connect.net/~erikhalperin/JobAnalysis/data-list.wsgi\",\n\t \tdataType: 'jsonp',\n\t \tsuccess: fillMenu,\n\t});\n}", "title": "" }, { "docid": "dfc2537440680f7a65d9f1e4e80757ed", "score": "0.5787804", "text": "function viewEmployees() {\n db.findAllEmployees()\n .then(([rows]) => {\n let employees = rows;\n console.log(\"\\n\");\n console.table(employees);\n loadMainPrompts();\n })\n // .then(() => loadMainPrompts());\n}", "title": "" }, { "docid": "17f69ff53e9c41db0b368a91a490c7ee", "score": "0.5786573", "text": "function initialStart() {\n\tdisplayHobbies(setHobbies());\n\tgetNews(\"news/news.json\");\n\tdisplayItems();\n}", "title": "" }, { "docid": "186d64f7561b1127b40d9a5021ee8d72", "score": "0.57860833", "text": "function loadCompanies() {\n\n $(document).on('ready', function() {\n\n \tcurrent_page = $(\"#current_page\").val();\n\n $.ajax({\n url: '/companies',\n method: 'GET',\n data: {page: current_page},\n success: function(response) {\n $(\"#companies_list\").html(response);\n },\n error: function(response) {\n console.log(response);\n }\n });\n })\n }", "title": "" }, { "docid": "186d64f7561b1127b40d9a5021ee8d72", "score": "0.57860833", "text": "function loadCompanies() {\n\n $(document).on('ready', function() {\n\n \tcurrent_page = $(\"#current_page\").val();\n\n $.ajax({\n url: '/companies',\n method: 'GET',\n data: {page: current_page},\n success: function(response) {\n $(\"#companies_list\").html(response);\n },\n error: function(response) {\n console.log(response);\n }\n });\n })\n }", "title": "" }, { "docid": "088dfce3be3ae485201ae0f24d10067e", "score": "0.5779531", "text": "function getEmployees() {\n $.ajax({\n type: 'GET',\n url: '/employees',\n success: function(response) {\n console.log(\"Got from server:\", response);\n appendDom(response);\n }\n });\n}", "title": "" }, { "docid": "487ac12a36e12d0a7f642f0ae4c8ca85", "score": "0.5759839", "text": "function loadPage() {\n\tfetchMovieData();\n\ttoggleAddMovieForm();\n}", "title": "" }, { "docid": "db4d376ae87d49dd91df45f18720aeed", "score": "0.5759444", "text": "function start() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\t_require(page.name, function(controller) {\n\t\t\t\tif (controller.init) {\n\t\t\t\t\tcontroller.init(page.query);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t$(document).on('pageBeforeAnimation', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\t_require(page.name, function(controller) {\n\t\t\t\tcontroller.render(page.query);\n\t\t\t});\n\t\t});\n }", "title": "" }, { "docid": "821a883685e32bf719c644c4c4a26226", "score": "0.5749732", "text": "function cargar_empleados(){\n\t$('#inventable>tbody>tr').find(\"#select_empleado\").each(function(){\n\t\t$(this).load('editar_factura.php?'+'process=cargar_empleados');\n\t\ttotales();\n\t});\n}", "title": "" }, { "docid": "5a5f972879920725c25ac94f64b47235", "score": "0.57420486", "text": "function tycheesCommon_loadUI_preloadPage() {\n\tif (tycheesCommon_getCurrentSessionId() != '' && tycheesCommon_getCurrentPlaceId() == '') {\n\t\tlocation.href = '/pages/user/store-selector.jsp';\n\t}\n\n\t// Set Page Start's settings into browser\n\ttycheesCommon_setPageStart();\n\n\t// File: header_main.jsp\n\t$(\"#sidebar-toggler\").click();\n\n\t// Reposition when a modal is shown\n\t$('.modal').on('show.bs.modal', tycheesCommon_reposition);\n\t// Reposition when the window is resized\n\t$(window).on('resize', function() {\n\t\t$('.modal:visible').each(tycheesCommon_reposition);\n\t});\n\n\ttycheesCommon_initCheckBox();\n\ttycheesCommon_initDatePicker();\n\ttycheesCommon_initClockPicker();\n}", "title": "" }, { "docid": "551f51853e395ed578574180801729c5", "score": "0.5717965", "text": "function viewEmployees() {\n connection.query(\"SELECT * FROM employees\", function (err, data) {\n if (err) throw err;\n console.table(data);\n employeesInfo();\n });\n}", "title": "" }, { "docid": "1e9d77448fa6117ab798e02c77a47d47", "score": "0.5717727", "text": "function fetchEmployee() {\n let roleList = \"\";\n // code for filtering the fetch according to role\n if (activeRoles.length != 0) {\n roleList = activeRoles.toString();\n }\n getData(\n \"http://sandbox.bittsdevelopment.com/code1/fetchemployees.php?roles=\" +\n roleList,\n (data) => {\n console.log(data);\n for (var a in data) {\n let emp = new Employee(data[a]);\n // populate the cards into the DOM\n populateCards(emp);\n }\n }\n );\n}", "title": "" }, { "docid": "d2b9d03920afc12e67cf9ae491d9ff8b", "score": "0.57139677", "text": "function pageLoad () { \n\n\t\tvar data_retrieved = 0;\n\n\t\t$.ajax({ //grabs results\n\t\t\ttype: 'GET',\n\t\t\turl: '/backliftapp/results',\n\t\t\tsuccess: function ( resultsData ) {\n\t\t\t\tresults_array = resultsData;\n\t\t\t\tdata_retrieved++; \t\t\t //following is for functions that need both results and league arrays\n\t\t\t\tif ( data_retrieved == 2 ) { //(see above)\n\t\t\t\t\tinitializePage(); \t\t //(see above)\n\t\t\t\t};\t\t\t\t\t\t\t //(see above)\n\t\t\t}\n\t\t});\n\n\t\t$.ajax({ //grabs teams\n\t\t\ttype: 'GET', \n\t\t\turl: '/backliftapp/team', \n\t\t\tsuccess: function ( teamData ) { \n\t\t\t\tleague_array = teamData;\n\t\t\t\tprintTeam( teamData ); // populates table on load\n\t\t\t\tdata_retrieved++; \t\t\t //following is for functions that need both results and league arrays\n\t\t\t\tif ( data_retrieved == 2 ) { //(see above)\n\t\t\t\t\tinitializePage(); \t\t //(see above)\n\t\t\t\t}; \t\t\t\t\t\t\t //(see above)\n\t\t\t\tenterScoresPop(); //populates enter scores modal\n\t\t\t\tsortTable(); // loads and triggers tablesorter on an empty table\n\t\t\t}\n\t\t}); //end print standings/schedule call \n\n\t\tfunction initializePage() { //functions that require both league_array and results_array to be populated\n\t\t\tscheduleWrite(); //populates scoreboard/schedule\n\t\t\tbuttonColor(); //changes start season button color based on league size\n\t\t\tweekPop(); //populates weeks menu in enter scores modal\n\t\t\tconsole.log(league_array);\n\t\t}\n\t\tstartCheck();\n\t}", "title": "" }, { "docid": "48768371e79ed743418ecf10c1a8938e", "score": "0.57107687", "text": "function eltdfOnWindowLoad() {\n eltdfInitPortfolioListAnimation();\n eltdfInitPortfolioListHoverDirection();\n eltdfInitPortfolioInfiniteScroll();\n eltdfPortfolioSingleFollow().init();\n }", "title": "" }, { "docid": "07e90d1a41c3b2a4cbf4d2aa61529420", "score": "0.57061577", "text": "function showEmployees() {\n\n var query = \"SELECT employees.id, first_name, last_name, title, salary, department, manager FROM employees \" +\n \"LEFT JOIN roles ON employees.role_id = roles.id LEFT JOIN departments ON roles.department_id = departments.id \" +\n \"LEFT JOIN managers ON managers.department_id = departments.id;\";\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.log('\\n', '---------Employees-----------', '\\n');\n console.table(res);\n\n start();\n });\n}", "title": "" }, { "docid": "a22500beb063680f938743875c0a4ade", "score": "0.5695783", "text": "function displayEmployees() {\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title AS title FROM employee JOIN role ON employee.role_id = role.id;\",\n function(err, res) {\n if (err) throw err\n console.table(res)\n init()\n })\n}", "title": "" }, { "docid": "d4be99a27d950b7c68ed66053eb77740", "score": "0.5692761", "text": "function viewEmployee() {\n connection.query(\"SELECT * FROM employee\", function (err, results) {\n if (err) throw err;\n console.table(results);\n userSelection();\n });\n }", "title": "" }, { "docid": "be2df4a6f899295fbe6849245995f922", "score": "0.5691157", "text": "function loadAllPeopleList(){\n\t\t\t//this is to check the internet connection\n\t\t\tif (commonAPIService.checkNetworkConnection() === 'ONL'){\n\t\t\t\tvm.checkInternetConnection = false;//This flag is to check the internet connection \t\t\t\n\n\t\t\t\t/* Make first call requested flag true */\n\t\t\t\tvm.firstCallRequested = true;\n\n\t\t\t\tvar appliedFilterList = filterAPIService.getAppliedFiltersObj();\n\n\t\t\t\t//console.log(appliedFilterList);\n\n\t\t\t\tif((!$('#searchBtn .fa').hasClass('fa-eye-slash') && vm.nameFilter.length === 0) || \n\t\t\t\t\t($('#searchBtn .fa').hasClass('fa-eye-slash') && vm.nameFilter.length === 0) )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(appliedFilterList !== undefined && appliedFilterList !== null && appliedFilterList.length > 0){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(filterFlagCounter === 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar resultObj = $scope.customInfiScroll.nextPage(peopleAPIService.appliedFilterServiceURL,'POST', filterAPIService.DataToServer(),filterCounter,$scope);\n\n\t\t\t\t\t\t\tresultObj.success(function(data,status, header, config){\n\t\t\t\t\t\t\t\tvm.peopleList = $scope.customInfiScroll.items;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//vm.showFilterFooterUI = vm.peopleList !== undefined && vm.peopleList !== null ? (vm.peopleList.length<7 ? true: false) : false;\n\t\t\t\t\t\t\t\tfilterCounter += 1;\n\n\t\t\t\t\t\t\t\t//OFF Loading flag\n\t\t\t\t\t\t\t\t$scope.$parent.loadingFlag = false;\n\n\t\t\t\t\t\t\t\t/* set No records message flag */\n\t\t\t\t\t\t\t\tvm.showNoRecordsUI = true;\n\n\t\t\t\t\t\t\t\tvm.showFilterFooterUI = true;\n\t\t\t\t\t\t\t\tvm.appliedFilterActive = true;\n\n\t\t\t\t\t\t\t\tif(data.length === 0){\n\t\t\t\t\t\t\t\t\tfilterFlagCounter = 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//binding auto complete on succes of request and let the dom get ready\n\t\t\t\t\t\t\t\tbindAutoComplete();\n\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t//console.log('If condition');\n\t\t\t\t\t\t}//filterFlagCounter\n\t\t\t\t\t}//end if\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(peopleFlagCounter === 1)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//console.log('Else condition');\n\t\t\t\t\t\t\t//Off the filter icon\n\t\t\t\t\t\t\tvm.appliedFilterActive = false;\n\t\t\t\t\t\t\t//$scope.$parent.loadingFlag = true;\n\n\n\t\t\t\t\t\t\t//get the list all of the employee (filter not applied)\n\t\t\t\t\t\t\tvar userProfilesURL=baseURL.concat(\"/GetAll/\");\n\n\t\t\t\t\t\t\tvar resultObj = $scope.customInfiScroll.nextPage(userProfilesURL, \"GET\", undefined,filterCounter,$scope);\n\n\t\t\t\t\t\t\tresultObj.success(function(data,status, header, config){\n\t\t\t\t\t\t\t\t//vm.peopleList = data;\n\t\t\t\t\t\t\t\tvm.peopleList = $scope.customInfiScroll.items;\n\n\t\t\t\t\t\t\t\t//This value is value is scrolled the option for the filter footer is applied\n\t\t\t\t\t\t\t\t//vm.showFilterFooterUI = vm.peopleList !== undefined && vm.peopleList !== null ? (vm.peopleList.length<7 ? true: false) : false;\n\n\t\t\t\t\t\t\t\t//myAdditionalDetail\n\t\t\t\t\t\t\t\tmyAdditionalDetail();\n\n\t\t\t\t\t\t\t\t//OFF Loading flag\n\t\t\t\t\t\t\t\t$scope.$parent.loadingFlag = false;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvm.showFilterFooterUI = true;\n\n\t\t\t\t\t\t\t\t/* set No records message flag */\n\t\t\t\t\t\t\t\tvm.showNoRecordsUI = true;\n\n\t\t\t\t\t\t\t\tif(data.length === 0){\n\t\t\t\t\t\t\t\t\tpeopleFlagCounter = 0;\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//console.log(JSON.stringify(vm.peopleList));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//binding auto complete on succes of request and let the dom get ready\n\t\t\t\t\t\t\t\tbindAutoComplete();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}//peopleFlagcounter\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}//end else\n\n\t\t\t\t\t\n\t\t\t\t}//end nameFilter\n\n\t\t\t}//CheckInternetConnection\n\t\t\telse\n\t\t\t{\n\t\t\t\tvm.peopleList = [];\n\t\t\t\t$scope.$parent.loadingFlag = false;\n\t\t\t\tvm.checkInternetConnection = true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\t\t//vm.createAlphaScroll();\n\n\t\t}///", "title": "" }, { "docid": "e7ac5dc1eae201313622a373a79e5469", "score": "0.5680326", "text": "start(){\n\n this._performLoad();\n\n }", "title": "" }, { "docid": "9119a8b3014f25f4be6d9ae67d18eebc", "score": "0.5672333", "text": "function coursePageInit()\n{\n\t$(\"#student_list_view\").empty();\n\tif(!currentCourse)\n\t{\n\t\tconsole.log(\"course page possible problem. Course doesn't exist \" );\t\t\t\n\t}\n\telse{\n\t\t//get students\n\t\tdisplayAllStudentsForCourse(currentCourse,getStudentsCallback);\t\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "8b5b384638f9f1f72e034c6dbe39b583", "score": "0.56715286", "text": "function onPageLoad() {\n\n\t\t// load some code\n\n\t}", "title": "" }, { "docid": "808ad866db3b37cae86f468afffb9960", "score": "0.56583875", "text": "function start() {\n\n //----------\n v_global.logic.evl_seq = 0; // 자기평가\n v_global.logic.page = 1; // 현재 페이지\n v_global.logic.rowsperpage = 5; // 페이지당문항수\n //----------\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_module.startPage();\n //----------\n processRetrieve({});\n\n }", "title": "" }, { "docid": "ceb6de703aa168968bc8c0da3ab82231", "score": "0.5657329", "text": "function startup() {\n // If we are on the student search page\n if ($('#teacher-form').length) {\n // Autocomplete for Teacher text box\n $.getJSON(\"/autocomplete\", function(teachers) {\n $(\"#teacherName\").autocomplete({\n source:[teachers]\n });\n $('#teacherName').focus();\n });\n // AJAX request for Teacher's classes\n $(\"#teacher-form\" ).submit(function( event ) {\n var name = $('#teacherName').val();\n generateScores(name);\n window.history.pushState(\"\", \"\", '/check/teacher?name=' + name);\n event.preventDefault();\n });\n\n var name = getUrlParameter('name');\n\n if(name != null) {\n $('#teacherName').val(name);\n generateScores(name);\n }\n // Otherwise we are on the teacher's home page\n } else {\n // Grab name and generate scores\n var name = $('#teacherName').html();\n generateScores(name);\n }\n}", "title": "" }, { "docid": "7c67639cee530aa771123c0933cede64", "score": "0.56533563", "text": "function initOnResourcesLoaded(event){\n // which page are we on?\n\n // call the page\n\n // init the slideshows\n\n // fade the slideshows in\n }", "title": "" }, { "docid": "3da80d125946f216980c7c4a328d2835", "score": "0.5635339", "text": "async function viewAllEmployees() {\n //employees variable set to view all query function from index.js in db folder\n const employees = await db.viewAllEmployees();\n // console tables employees\n console.table(employees);\n // runs main menu prompt\n mainMenu();\n}", "title": "" }, { "docid": "10525c6f4180a45ee2a5ee5b608892a4", "score": "0.5634259", "text": "function startatLoad(){\n\tloadNavbar(function(){\n\t\tgetExtensions(function(){\n\t\t\tsethardwarehtmlinterface(function(){\n\t\t\t\tloadHardwareConfig();\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "c0ed9a762c70c0e349f1cc79267ab4e1", "score": "0.56322", "text": "function jq_init() {\n console.log('JQ');\n $('#in-btn').on('click',addEmployee);\n $('#fade-box').on('click','#alert-btn',closeAlertBox);\n $('#employee-table').on('click','.delete-btn', deleteEmployee);\n}", "title": "" }, { "docid": "991992306266b04cf0dc8c9e9350ca5d", "score": "0.56240934", "text": "function loadcompany()\n{\n\tvalidateoninputtyping('#companynametext','input');\n$.ajax(\n\t\t{\n\t\t\tcontentType:'application/json',\n\t\t\tsuccess:function(data,textStatus,jqXHR)\n\t\t\t{\n\t\t\t\tvar responseType = getResponseType(data);\n\t\t\t\tvar responseValue = getResponseValue(data);\n\n\t\t\t\tif(responseType == 'S')\n\t\t\t\t\t{\n\t\t\t\t\tvar dataTableSet = $.parseJSON(responseValue);\n\t\t\t\t\tdisplayCompanyDatalist(dataTableSet);\n\t\t\t\t\t}\n\t\t\t},\n\t\t\ttype:'GET',\n\t\t\turl : \"companylist\"\n\t\t\t}\n\t\t);\t\n}", "title": "" }, { "docid": "745a5bc10978cfb0da59385833cb55b4", "score": "0.5619988", "text": "function fnLoadJobSearch(a) {\r\n\t \r\n\t\t//check the status of the job and show button or message accordingly\r\n\t\t$(\"#sjappstatus\").show();\r\n\t\t$(\"#sjappstatus\").load(\"index.php\",\"controller=user&url=loadAppStatus&jobId=\"+a);\r\n\t\t\r\n\t\t//load the details of the job the divison\r\n\t\t$(\"#sjjob\").show();\r\n\t\t$(\"#sjjob\").load(\"index.php\",\"controller=corporatecontroller&url=showSpecficJob&jobId=\"+a+\"&request_type=user\");\r\n\t\t$(\"#sjsearchres\").hide();\r\n\t\r\n\t\t$(\"#sjbackbutton\").show();\r\n\t\t\r\n\t}", "title": "" }, { "docid": "dbeb6899da06e89a144ca794895eb278", "score": "0.56172", "text": "function formLoad() {\r\n\t$.get('listserial', function(data) {\r\n\t\tif(data!=null && data!=\"\"){\r\n\t\t\tcreateRow(data);\r\n\t\t}else{\r\n\t\t\tcreateTable(0,30);\t\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "8ce5e9930eaed5aae7ae7941d4f22ac9", "score": "0.5616186", "text": "function viewEmployees() {\n console.log(\"Viewing all employees\\n\");\n\n //Query to display a table with employee id, first and last name, title, department, salary, and manager\n var query =\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(e.first_name, ' ' ,e.last_name) AS manager FROM employee INNER JOIN role on role.id = employee.role_id INNER JOIN department on department.id = role.department_id left join employee e on employee.manager_id = e.id;\";\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n console.table(res);\n console.log(\"Employees viewed!\\n\");\n\n firstPrompt();\n });\n}", "title": "" }, { "docid": "4884fdee4265c59da1eeeefd9b4eeba7", "score": "0.5613468", "text": "function initRealEstateList() {\n\t\t\t\t\trealEstateFind = function () {\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\turl: '/real_estates/_block_item_list/' + selectedBlockId,\n\t\t\t\t\t\t\tdataType: 'JSON'\n\t\t\t\t\t\t}).done(function (data) {\n\t\t\t\t\t\t\tif (data.status == 0) {\n\t\t\t\t\t\t\t\t$realEstateList.html(data.result);\n\n\t\t\t\t\t\t\t\t_initTabContainer($realEstateList.find('.free-style-tab-container'));\n\t\t\t\t\t\t\t\tinitRealEstateItem($realEstateList);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\terrorPopup();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).fail(function () {\n\t\t\t\t\t\t\terrorPopup();\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "aac79acd846c29ce151f4ae3224acbcb", "score": "0.5612196", "text": "function Start(){\n\tcurrentEmployees = 3;\n\tpotentialEmployees = 5;\n}", "title": "" }, { "docid": "09d0cd0beb7dace90a46931a2492bf39", "score": "0.560844", "text": "function indexOnload(){\r\n basicUserInfoLoad();\r\n\r\n}", "title": "" }, { "docid": "0f78295795266192eb03ed5e0b9db41e", "score": "0.56078684", "text": "function startOnLoad() {\n\t\t\tgetNewStoryID();\n\t\t\tmakeTableRowClickable();\n\t\t\tretrieveStoryTitlebyID(count);\n\t\t\tretrieveArticleURLbyID(count);\n \t\t\tretrieveStoryTitlebyID(count-1);\n\t\t\tretrieveArticleURLbyID(count-1);\n \t\t\tretrieveStoryTitlebyID(count-2);\n\t\t\tretrieveArticleURLbyID(count-2);\n \t\t\tretrieveStoryTitlebyID(count-3);\n\t\t\tretrieveArticleURLbyID(count-3);\n\t\t\tretrieveStoryTitlebyID(count-4);\n\t\t\tretrieveArticleURLbyID(count-4);\n\n\t\t}", "title": "" }, { "docid": "e956b9afbfa5a01b21609150247a240e", "score": "0.56066054", "text": "function fnLoadJobUser2(a) {\r\n\t\t//check the status of the job and show button or message accordingly\r\n\t\t$(\"#sjappstatus\").show();\r\n\t\t//load the details of the job the divison\r\n\t\t$(\"#sjjob\").show();\r\n\t\t$(\"#sjjob\").load(\"index.php\",\"controller=corporatecontroller&url=showSpecficJob&jobId=\"+a+\"&request_type=user\");\r\n\t\t$(\"#sjsearchres\").hide();\r\n\t\t$(\"#sjbackbutton\").show();\r\n\t\t\r\n\t}", "title": "" }, { "docid": "fc6fbd6bf2521ea472a4a52276d1e5f1", "score": "0.5601889", "text": "loadFirstPageData() {\n const cityName = this.props.cityName;\n const result = getListData(cityName, this.state.page);\n this.resultHandle(result);\n }", "title": "" }, { "docid": "54850ede4244a728928fe1d7fd454f58", "score": "0.5594314", "text": "function loadGrid() {\n var data = [];\n\n var AD_Client_ID = VIS.Env.getCtx().getAD_Client_ID();\n\n $.ajax({\n url: VIS.Application.contextUrl + \"VAT/Common/LoadEmployeeData\",\n data: { AD_Client_ID: AD_Client_ID },\n async: false,\n success: function (result) {\n result = JSON.parse(result);\n if (result && result.length > 0) {\n for (var i = 0; i < result.length; i++) {\n var line = {};\n line['VAT_Employee_ID'] = result[i].EmpID;\n line['Name'] = result[i].Name;\n line['vat_departmentname'] = result[i].DepName;\n line['VAT_EmployeeGrade'] = result[i].Grade;\n line['V_Date'] = result[i].Date;\n line['VAT_Department_ID'] = result[i].DepID;\n line['recid'] = i + 1;\n data.push(line);\n }\n }\n dynInit(data);\n },\n error: function (eror) {\n console.log(eror);\n }\n });\n return data;\n }", "title": "" }, { "docid": "37596cea2b9a0cfc64df52f1d679d5b6", "score": "0.5593134", "text": "function peopleData() {\r\n\t$.ajax(\"/admintools/position\", {\r\n\t\ttype : \"GET\"\r\n\t}).done(\r\n\t\tfunction(data) {\r\n\t\t\t$(\"#filtPositionId\").append(\"<option value=''>All</option>\");\r\n\t\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\t\t// Fill both boxes all at once\r\n\t\t\t\t$(\"#empPosition\").append(\r\n\t\t\t\t\t\"<option value='\" + data[i].positionId + \"'>\"\r\n\t\t\t\t\t\t+ data[i].positionName + \"</option>\");\r\n\t\t\t\t$(\"#filtPositionId\").append(\r\n\t\t\t\t\t\"<option value='\" + data[i].positionId + \"'>\"\r\n\t\t\t\t\t\t+ data[i].positionName + \"</option>\");\r\n\t\t\t}\r\n\t\t});\r\n\t// when this is completed grab the employees\r\n\tajaxEmployee();\r\n}", "title": "" }, { "docid": "f1afeaf3dd0126951608d7227df5f6bc", "score": "0.5581055", "text": "function loadPage() {\n fs.writeFile(outputPath, render(allEmployees), (err) => {\n if (err) throw err;\n console.log(\"complete\");\n });\n}", "title": "" }, { "docid": "f8763b5b241440d2a614335fa6470179", "score": "0.55796546", "text": "componentDidMount() {\n this.getEmployees();\n }", "title": "" }, { "docid": "192b16aaf3dcc52c22df0933c819e165", "score": "0.5560404", "text": "function viewAllEmployees() {\n connection.query(\"SELECT * FROM employee\", function (err, res) {\n if (err) throw err\n console.table(res)\n inquirer.prompt(\n {\n type: \"list\",\n name: \"afterView\",\n message: \"What would you like to do?\",\n choices: [\n {\n name: \"Go Back to Employees Page\",\n value: \"backEmp\"\n },\n {\n name: \"Go Back to Main Page\",\n value: \"main\"\n },\n {\n name: \"Exit program\",\n value: \"exit\"\n }\n ]\n }\n ).then(choice => {\n switch (choice.afterView) {\n case \"backEmp\":\n employees();\n break;\n case \"main\":\n init();\n break;\n default:\n connection.end();\n return;\n }\n });\n });\n}", "title": "" }, { "docid": "1164ec583927223cba5586891ad5cf99", "score": "0.5560117", "text": "function viewEmployee() {\n const querySelect = \"SELECT employee.id, first_name, last_name, title, salary, name, manager_id FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id\";\n\n connection.query(querySelect, function(err, res) {\n if (err) throw err;\n console.table(res)\n init()\n });\n}", "title": "" }, { "docid": "4d8dcd49d5bda1020edc8dd4cbfcea52", "score": "0.55559486", "text": "function onPageLoad() {\n\tINOUTAPIGetAllUsers(buildUserList);\n}", "title": "" }, { "docid": "4f932c0bdeda0a3f7ef61dd90dddc850", "score": "0.5550261", "text": "loadEmployees(res, searchedEmployee) {\n API.getAllEmployees()\n .then(res => {\n this.setState({ employees: res.data.results })\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "84496eaf9754f189dee82ee7adedaeb7", "score": "0.5549369", "text": "function preparePage() {\t\n loadDepartmentCombo(\"\"); \n getTreeParentNodeList();\n getRoleList(); \n getRoleHierarchyLevelWiseStructure(); \n}", "title": "" }, { "docid": "11ca69140cae46a07d5a9712b69495fa", "score": "0.55486333", "text": "function readyNow(){\n console.log('jquery is running');\n\n //set up click listener\n $('#submitBtn').on('click', addEmployee);\n $('#displayEmployeeInfo').on('click', '.deleteBtn', deleteEmployee);\n}", "title": "" }, { "docid": "e0906dff8216ebe115799c3f7c72eea8", "score": "0.55454797", "text": "function _loadStart() {\n // console.log( 'Load start' );\n }", "title": "" } ]
f1be3680a84e1d23a264187d81f630e7
Join array of string filtering out falsy values
[ { "docid": "9c512fb398af45217c40fb39654062b1", "score": "0.7332226", "text": "function join(arr, sep = \", \") {\n return arr.filter(Boolean).join(sep);\n}", "title": "" } ]
[ { "docid": "717e0c34b39bda07a3a80698a4a38389", "score": "0.7838521", "text": "function joinElements(arr){\n\n var str = \"\";\n for(var i = 0; i < arr.length; i++){\n\n if(arr[i] || arr[i] === false){ \n \n str+=arr[i]\n }\n }\n\n return str;\n}", "title": "" }, { "docid": "74714af47274c816a1a4588e73301dca", "score": "0.75080985", "text": "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "title": "" }, { "docid": "74714af47274c816a1a4588e73301dca", "score": "0.75080985", "text": "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "title": "" }, { "docid": "74714af47274c816a1a4588e73301dca", "score": "0.75080985", "text": "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "title": "" }, { "docid": "74714af47274c816a1a4588e73301dca", "score": "0.75080985", "text": "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "title": "" }, { "docid": "74714af47274c816a1a4588e73301dca", "score": "0.75080985", "text": "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "title": "" }, { "docid": "343692f4ce23481f65c22332c1908b7d", "score": "0.73775715", "text": "function joinEl(array) {\n newStr = '';\n for (var i = 0; i < array.length; i++) {\n if (array[i] !== undefined && array[i] !== null && isFinite(array[i])) {\n newStr += array[i];\n }\n }\n return newStr;\n}", "title": "" }, { "docid": "b6ba9d3a8e97e5ff646da4d92341c8af", "score": "0.7303787", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function(x) {\n return x;\n }).join(separator || '') : '';\n }", "title": "" }, { "docid": "7a51e52e71fb07b62bc0356484585b80", "score": "0.7302942", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "32a5438d3e34f17a1487d74b55c5d93e", "score": "0.729968", "text": "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "title": "" }, { "docid": "7558f6c26e76fdea56f04cf0dc907182", "score": "0.71686685", "text": "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "title": "" }, { "docid": "d00a5bf132c7da345fd7b3fd04992821", "score": "0.6903353", "text": "function join(arr) {\n var res = '';\n for (var i = 0; i < arr.length; i++)\n res += arr[i];\n return res;\n}", "title": "" }, { "docid": "6187d3fd8efbaf253cde05258adaa294", "score": "0.6749963", "text": "function f(arr) {\n if(arr){\n var merged = [];\n return merged.concat.apply(merged, arr).join(\"\")\n }\n }", "title": "" }, { "docid": "351ac3c8d652fd1e2112dcb73862c595", "score": "0.673091", "text": "function myJoin(arr, sep){\n var newarr = '';\n for (var i = 0; i<arr.length; i++){\n if(sep === undefined){\n sep = ','; }\n if(arr[i]!== undefined && arr[i] !== null && arr[i] !== ' '){\n newarr+=arr[i]+',';\n// newarr+= ' ';\n }\n }\n return newarr;\n}", "title": "" }, { "docid": "adf0582fcd90b08225af00b148cf7b00", "score": "0.66795397", "text": "function join(a) {\n var result = \"\";\n for (var i = 0; i < a.length; i++) {\n var nan = parseFloat(a[i]);\n if (!(isNaN(nan) == true || nan == 0)) {\n result = result + a[i] + \",\";\n }\n }\n return result;\n}", "title": "" }, { "docid": "0d917a1a3f207af3c425d987b42455c8", "score": "0.6668057", "text": "function useJoin(array, string) {\n return array.join(string);\n}", "title": "" }, { "docid": "6518125afccea4fde875b9ec24740164", "score": "0.6647408", "text": "function stringConcat(arr) {\n return arr.reduce(function(a, b){\n return a.concat(b);\n }, \"\");\n}", "title": "" }, { "docid": "301d42af55dc326a7acae30edd4fc014", "score": "0.6596542", "text": "function join(arr, concatStr) {\n let result = '';\n for (let i in arr) {\n result += arr[i];\n i++;\n result += i < arr.length ? concatStr : '';\n }\n return result;\n}", "title": "" }, { "docid": "f824655c9f0e5198851d372cc7bb85e7", "score": "0.65177053", "text": "function join(arr, seperator) {\n let resultString = '';\n\n for (let arrIdx = 0; arrIdx < arr.length; arrIdx++) {\n let val = String(arr[arrIdx]);\n\n for (let idx = 0; idx < val.length; idx++) {\n resultString += val[idx];\n }\n\n if(arrIdx !== arr.length - 1) resultString += seperator;\n }\n\n return resultString;\n}", "title": "" }, { "docid": "ebdefed718c941931009edf624c7f362", "score": "0.64176565", "text": "function joinElementsIntoString(array) {\n\n return (\n '\"' + array.join() + '\"\\n' +\n '\"' + array.join() + '\"\\n' +\n '\"' + array.join('+') + '\"'\n )\n\n}", "title": "" }, { "docid": "07ed871e969e15c78ef2b226decbc6a2", "score": "0.6385822", "text": "function applyJoin(arrayOfStrings, string) {\n var joinedString = arrayOfStrings.join(string);\n return joinedString;\n}", "title": "" }, { "docid": "ac607bf3ae623fefd6224b4fa564381d", "score": "0.6378778", "text": "function join_arr(arr, seps) {\n var rv = \"\";\n var i, si;\n\n if (typeof seps === \"function\") {\n return seps.call(arr, seps);\n }\n for (i = 0; i < arr.length - 1; i++) {\n si = Math.min(i, seps.length - 1);\n rv += String(arr[i]) + String(seps[si]);\n }\n if (i < arr.length) {\n rv += arr[i];\n }\n return rv;\n }", "title": "" }, { "docid": "2c903de34f78a22163b31e71407167d9", "score": "0.6375861", "text": "function join(arr, seperator){\n\n}", "title": "" }, { "docid": "a479f4daa4c949e521f19cb5448a9566", "score": "0.63610387", "text": "function join_2(xs) /* (xs : list<string>) -> string */ {\n return joinsep(xs, \"\");\n}", "title": "" }, { "docid": "0f409881e5f2a60a7b61b1246049d060", "score": "0.6348053", "text": "function r(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.filter(function(e){return!!e}).join(\" \")}", "title": "" }, { "docid": "3610241f4c3b4eeafbd9e34ddefc59cb", "score": "0.6337069", "text": "function myJoin(arr, sep){\n var newarr = '';\n if(sep === undefined){\n sep = ','; }\n for (var i = 0; i<arr.length; i++){\n if(arr[i]!== undefined && arr[i] !== null){\n if (i === arr.length-1){ //what's this\n newarr+=arr[i];\n }\n //newarr+= sep + arr[i]; //why sep is first? dont we get ', arr[i], etc?\n else{ \n newarr+=arr[i]+sep;\n }\n } \n }\n return newarr;\n}", "title": "" }, { "docid": "86d7243f043bf7752ffbf35c9b3f9804", "score": "0.6322029", "text": "function joinElements(array, joinString) {\n let result = \"\";\n array.forEach((el, i) => {\n result += i === array.length - 1 ? el : `${el}${joinString}`;\n });\n return result;\n}", "title": "" }, { "docid": "8e3312d90ad1b16d79293810b5b1d5ff", "score": "0.63098496", "text": "static singleQuoteJoin(arr) {\n return arr.map((val) => `'${val.replace('\\\\', '/')}'`).join();\n }", "title": "" }, { "docid": "66d718c0ae2601a4ad1a16daf4d877ec", "score": "0.6308323", "text": "join(string) {\n let result = '';\n for (let [key, value] of Object.entries(this.array)) {\n if (key != 0) {\n result += string + value;\n } else {\n result += value;\n }\n }\n return result;\n }", "title": "" }, { "docid": "c021e95a768dd0cb5f87a6a6c4285881", "score": "0.6278131", "text": "function stringConcat(arr) {\n const string = arr.reduce((accumulator, currentValue) => {\n accumulator += currentValue.toString();\n return accumulator;\n }, \"\");\n return string;\n}", "title": "" }, { "docid": "88cce5473c003aac1a4c11129b1441a5", "score": "0.6263663", "text": "function join(array, separator) {\n let joined = '';\n\n for (let i = 0; i < array.length; i += 1) {\n joined += String(array[i]);\n\n if (i !== array.length - 1) {\n joined += separator;\n }\n }\n\n return joined;\n}", "title": "" }, { "docid": "34dc5d234458b24248f3317764da01b7", "score": "0.6261611", "text": "function join_them(arr, symb){\n\n return arr.join(symb);\n}", "title": "" }, { "docid": "c373340ec7816f04cf69eb860a8a69bd", "score": "0.6255609", "text": "concat_values(arr, separate) {\n let str = '';\n for (let i = 0; i < arr.length; ++i) {\n if (separate) {\n str += `('${arr[i]}')`;\n } else {\n str += `'${arr[i]}'`;\n }\n if ( i < arr.length - 1) {\n str += ', ';\n }\n }\n return str;\n }", "title": "" }, { "docid": "1b8e406f3990e6b1faed17e5f508fbc4", "score": "0.6220783", "text": "function joinTheArray(array) {}", "title": "" }, { "docid": "2fbb5d38fd39ec2f9cb7867e95aaee77", "score": "0.6215326", "text": "function noSpace(arr){\n // the function will join the array into a long string without any spaces\n var finalStr = arr.join(' ')\n return finalStr;\n }", "title": "" }, { "docid": "b4d98d27feb03e7101a340c88e6db296", "score": "0.6211021", "text": "function joined(stringStream) {\n return takeUntil(\n (x) => x.length === 0,\n stringStream\n )[0].reduce((x, y) => x.concat(y));\n}", "title": "" }, { "docid": "4ec92673c850837422485b85ea49feab", "score": "0.6151825", "text": "join(words) {\n return words.join(' ');\n }", "title": "" }, { "docid": "8ca72d508566d957b4679d50e3a6af80", "score": "0.6150957", "text": "function stringConcat(arr){\n const result = arr.reduce(function(prev, current, index){\n return index == 0 ? current : prev.toString() + current.toString();\n \n });\n return result;\n}", "title": "" }, { "docid": "019ee23faced8f2e07f478ed8ca1c715", "score": "0.613833", "text": "join(words) {\n return words.join(\" \");\n }", "title": "" }, { "docid": "9571df7288ccb3e204ab55d482fc1232", "score": "0.6083544", "text": "function join(list) {\n // Use filter() method to filter out falsy item.\n let result = (list || []).filter(_ => _).join(\"/\");\n if (result.endsWith(\"/\")) {\n result = result.slice(0, result.length);\n }\n return result;\n}", "title": "" }, { "docid": "363c44c422b012fd61aec719fd53ad42", "score": "0.60769033", "text": "function join(arr, separator) {\n outputStr = \"\";\n outputStr += arr[0];\n for (var i = 1; i < arr.length; i++)\n {\n outputStr += separator + arr[i];\n }\n return outputStr;\n}", "title": "" }, { "docid": "b5ed19db2f6eeae6806e331e43208963", "score": "0.60606974", "text": "function _join(separator) {\n\t\t\t\treturn function(val) {\n\t\t\t\t\tif (Array.isArray(val)) {\n\t\t\t\t\t\treturn val.join(separator);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar split = val.toString().split(separator);\n\t\t\t\t\t\tvar arr = [];\n\t\t\t\t\t\tfor (var i = 0; i < split.length; i++) {\n\t\t\t\t\t\t\tif (split[i] !== '' && split[i] != null) {\n\t\t\t\t\t\t\t\tarr.push(split[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn arr.join(separator);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "eed9cfb6015df2706657791ed62a1f68", "score": "0.60590595", "text": "function concatWithSpaces (...args) {\n return args.filter(a => !!a).join(' ')\n}", "title": "" }, { "docid": "86e082fa356843b79b7d22a74564c206", "score": "0.605849", "text": "merge(value) {\n if (Array.isArray(value)) return value.join(\", \");\n return value;\n }", "title": "" }, { "docid": "e4452ed8b0afb5195006de080ae0c16d", "score": "0.60491884", "text": "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "title": "" }, { "docid": "e4452ed8b0afb5195006de080ae0c16d", "score": "0.60491884", "text": "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "title": "" }, { "docid": "5f8e16adf32e14a48b05e11234b2f7cd", "score": "0.60490096", "text": "function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n var output = [];\n // tslint:disable-next-line:prefer-for-of\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n try {\n output.push(String(value));\n }\n catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n return output.join(delimiter);\n}", "title": "" }, { "docid": "4a887f418fdf822c155a4e85a6e76c2e", "score": "0.60391957", "text": "function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n var output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n try {\n output.push(String(value));\n }\n catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n return output.join(delimiter);\n}", "title": "" }, { "docid": "4a887f418fdf822c155a4e85a6e76c2e", "score": "0.60391957", "text": "function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n var output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n try {\n output.push(String(value));\n }\n catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n return output.join(delimiter);\n}", "title": "" }, { "docid": "4a887f418fdf822c155a4e85a6e76c2e", "score": "0.60391957", "text": "function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n var output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n try {\n output.push(String(value));\n }\n catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n return output.join(delimiter);\n}", "title": "" }, { "docid": "e382eaa06b2b43614f961f02531b057c", "score": "0.6037708", "text": "function fancyJoin(a,b) {\r\n if (a == \"\") { return b; }\r\n else if (b == \"\") { return a; }\r\n else { return a+\"+\"+b; }\r\n}", "title": "" }, { "docid": "8820fcf2f6c246d9458f68509f7948f0", "score": "0.6000723", "text": "function safeJoin(input, delimiter) {\r\n if (!Array.isArray(input)) {\r\n return '';\r\n }\r\n var output = [];\r\n // tslint:disable-next-line:prefer-for-of\r\n for (var i = 0; i < input.length; i++) {\r\n var value = input[i];\r\n try {\r\n output.push(String(value));\r\n }\r\n catch (e) {\r\n output.push('[value cannot be serialized]');\r\n }\r\n }\r\n return output.join(delimiter);\r\n}", "title": "" }, { "docid": "601eb9ea4455fce674ee7a0783f68d26", "score": "0.5974976", "text": "function strls(collection) {\n let s = '', v\n if (collection.length !== undefined) {\n v = collection\n } else {\n v = []\n for (const e of collection) {\n v.push(e)\n }\n }\n const lasti = v.length - 1\n for (let i = 0; i <= lasti; ++i) {\n if (i > 0) {\n s += i == lasti ? ' and ' : ', '\n }\n s += v[i]\n }\n return s\n}", "title": "" }, { "docid": "41320892e5a7d1911a3876bec5f10e5c", "score": "0.59742373", "text": "function joinElementsAndSkip(array) {\n var result = \"\";\n for (i = 0; i < array.length; i++) {\n var float = parseFloat(array[i]);\n var int = parseInt(array[i]);\n if (float == int && !isNaN(int)) {\n result += array[i];\n }\n } return result;\n}", "title": "" }, { "docid": "cb84393915071e66ec60005b24fb83ab", "score": "0.5952632", "text": "function joinRedefine(array, separator) {\n return array.join(separator);\n}", "title": "" }, { "docid": "260941fa2c1ea6312ef683998e8884b6", "score": "0.59482527", "text": "function joinArray(array,separator){\n return array.reduce((accumulator,currvalue)=> accumulator + separator + currvalue);\n}", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "342b3514feb2176bed6524b578e1e919", "score": "0.594812", "text": "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "title": "" }, { "docid": "c62b98895764da4f3d5113adde325b59", "score": "0.59366643", "text": "function helper(arr) { \n\treturn arr.map(i => i.map( j => j).join('=')).join('\\n');\n}", "title": "" }, { "docid": "59411ef5f3d3dfe775f87f3e834671a0", "score": "0.5911619", "text": "function join() {\n var args = [].slice.call(arguments, 0);\n return args.join('');\n}", "title": "" }, { "docid": "ca5105625e6d195c9202fc3483fa8695", "score": "0.58926547", "text": "function arrayToString(arr) {\n return arr.join('');\n}", "title": "" }, { "docid": "1cfb68e30767d705d23756a82022c095", "score": "0.58925164", "text": "function joinList(array) {\n let sentence = \"\";\n for (let i = 0; i < array.length; i++) {\n if (i < array.length - 1) {\n sentence += array[i];\n sentence += \", \";\n } else if (i === array.length - 1) {\n sentence += array[i];\n } else if (array.length === 1) {\n sentence += array[0];\n }\n } return sentence;\n}", "title": "" }, { "docid": "a076cc1599206add7e0c54eb4be48af8", "score": "0.5890627", "text": "function flattenToString(arr) {\n\t var i, iz, elem, result = '';\n\t for (i = 0, iz = arr.length; i < iz; ++i) {\n\t elem = arr[i];\n\t result += isArray(elem) ? flattenToString(elem) : elem;\n\t }\n\t return result;\n\t }", "title": "" }, { "docid": "ccdb0cb95fb5075f35bed649521b9d7c", "score": "0.5876079", "text": "function concatenate(arr) {\n var newStr = \"\";\n for(var i = 0; i < arr.length; i++){\n newStr+= arr[i];\n }\n return newStr;\n}", "title": "" }, { "docid": "0c438cb4d3a7154651871c7d1f2ec173", "score": "0.5862631", "text": "join(separator) {\n return this._array.join(separator);\n }", "title": "" }, { "docid": "b3bbc6cda51165e6b7c2fbdcaee43928", "score": "0.5862484", "text": "function listify(n) {\n return n.reduce(function (str, item, i) {\n if (!i) { str += item; }\n else if (i === n.length - 1 && i === 1) { str += \" and \" + item; }\n else if (i === n.length - 1) { str += \", and \" + item; }\n else { str += \", \" + item; }\n return str;\n }, \"\");\n }", "title": "" }, { "docid": "aa5240688e6c6dea2daeb89485e40384", "score": "0.5862005", "text": "function join(collection, separator) {\r\n let buf = \"\";\r\n let first = true;\r\n for (let current of collection) {\r\n if (first) {\r\n first = false;\r\n }\r\n else {\r\n buf += separator;\r\n }\r\n buf += current;\r\n }\r\n return buf;\r\n}", "title": "" }, { "docid": "5da59d6bdcb9a4589b126329679d8d12", "score": "0.5851579", "text": "function mapJoin(array, sep, func, self) {\n return array.map(func, self).join(isString(sep) ? sep : ' ');\n}", "title": "" }, { "docid": "5da59d6bdcb9a4589b126329679d8d12", "score": "0.5851579", "text": "function mapJoin(array, sep, func, self) {\n return array.map(func, self).join(isString(sep) ? sep : ' ');\n}", "title": "" }, { "docid": "5da59d6bdcb9a4589b126329679d8d12", "score": "0.5851579", "text": "function mapJoin(array, sep, func, self) {\n return array.map(func, self).join(isString(sep) ? sep : ' ');\n}", "title": "" }, { "docid": "23944a69785032368b9b530e321e79c3", "score": "0.5814146", "text": "function stringConcat(arr) {\n var str = arr.reduce(function (one, two) {\n return one.toString() + two.toString()\n });\n return str\n}", "title": "" }, { "docid": "8c4973e6b6474b3c91b80b48e9cb7b10", "score": "0.5804786", "text": "function join(arr, debug = false) {\n if (debug) {\n console.log(\"!!!\", arr)\n }\n if (!arr) return undefined\n if (!Array.isArray(arr)) throw(new Error(\"array expected\"))\n const str = path.join(...arr)\n if (debug) {\n console.log(\"??\", str)\n }\n if (arr[0] === '' && path.sep === '/') return `/${str}`\n return str\n}", "title": "" }, { "docid": "1a7ecf11925c5e57ce09aa47ca3bb87e", "score": "0.58031195", "text": "join(array) {\n const joinArr = array.join(\" :) \");\n let code = `The join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object),\n separated by commas or a specified separator string.\n If the array has only one item, then that item will be returned without using the separator.\n\n let array = [\"Look\", \"at\", \"all\", \"the\", \"smiles!\"];\n let joined = array.join(\" :) \");`;\n\n let link =\n \"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join\";\n return (\n this.createLiItems(joinArr),\n this.changeCardDescription(\"Join Array\", code, link)\n );\n }", "title": "" } ]
5f2c613fb39837b302799df35f9d0cef
pattern6 //////////////////// binary operation on undefined
[ { "docid": "ff4833cc1313792854e5fb975884ccc1", "score": "0.59050053", "text": "function pattern6_orig() {\n var x, y;\n for(var i=0;i<30000000;i++){\n y = x | 2;\n }\n}", "title": "" } ]
[ { "docid": "bb2a3ad1a64a16ad3a23e5b824479f18", "score": "0.6033671", "text": "function NullPattern(){}", "title": "" }, { "docid": "f88bba86fc405a28cf3affefa27d581e", "score": "0.57333237", "text": "function o2344() {\n try {\nif (this.o227 <= 0) try {\nreturn 0;\n}catch(e){}\n}catch(e){}\n try {\nreturn this.o2317 * (this.o227 - 1) + o2343(this[this.o227 - 1] ^ (this.o1102 & this.o2318));\n}catch(e){}\n }", "title": "" }, { "docid": "3d1e016db39562d32b0ff66fc579094e", "score": "0.5731601", "text": "function ruleUtil_Moore_sum9_0(state) {\n var sum8 =\n state.nw0 + state.n0 + state.ne0 +\n state.w0 + state.c0 + state.e0 +\n state.sw0 + state.s0 + state.se0;\n return sum8;\n }", "title": "" }, { "docid": "da4b1e22daad8d17a8a30d48da1418ec", "score": "0.5575722", "text": "function f(e){return m(e)||g(e)||h(e)||y(e)||b(e)||v(e)||_(e)||w(e)}", "title": "" }, { "docid": "ddc21cb7dbf30a849e33c1800ba231d3", "score": "0.55532914", "text": "function f() {\n var __v_7 = -126 - __v_3;\n var __v_17 = ((__v_15 & __v_14) != 4) | 16;\n if (__v_17) {\n var __v_11 = 1 << __v_7;\n }\n __v_12 >>= __v_3;\n}", "title": "" }, { "docid": "1879fc43b757f14113e48bb30031b3c9", "score": "0.5536234", "text": "function o2337() {\n var o259 = this.o1102 & this.o2318;\n try {\nwhile (this.o227 > 0 && this[this.o227 - 1] == o259)try {\n--this.o227;\n}catch(e){}\n}catch(e){}\n }", "title": "" }, { "docid": "243315c1971b84fe679b911385ba6232", "score": "0.5510743", "text": "function earlyPatternFunctions (a, b) {\n if (b === 0) return undefined\n return a / b\n}", "title": "" }, { "docid": "5200d54ec0a3ce82835bc9477413b7ca", "score": "0.5439904", "text": "function match(b, c) {\n b = b | 0;\n c = c | 0;\n\n var d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0;\n\n if (!(HEAP8[c >> 0] | 0)) return 1;// 1 zero-char string ~ '*' ( if rule is undefined )\n\n d = c;\n c = b;\n e = HEAP8[b >> 0] | 0;\n b = 0;\n a:while (1) {\n if (!(e << 24 >> 24)) {\n f = d;\n g = 13;\n break\n }\n b:do if (!b) {\n h = e;\n i = c;\n j = d;\n while (1) {\n k = HEAP8[j >> 0] | 0;\n switch (k << 24 >> 24) {\n case 42:\n {\n l = h;\n m = i;\n n = j;\n break b;\n break\n }\n case 63:\n break;\n default:\n if (k << 24 >> 24 != h << 24 >> 24) {\n o = 0;\n g = 15;\n break a\n }\n }\n i = i + 1 | 0;\n k = j + 1 | 0;\n h = HEAP8[i >> 0] | 0;\n if (!(h << 24 >> 24)) {\n f = k;\n g = 13;\n break a\n } else j = k\n }\n } else {\n j = c;\n h = e;\n while (1) {\n i = h;\n k = j;\n p = d;\n c:while (1) {\n q = HEAP8[p >> 0] | 0;\n switch (q << 24 >> 24) {\n case 42:\n {\n l = i;\n m = k;\n n = p;\n break b;\n break\n }\n case 63:\n break;\n default:\n if (q << 24 >> 24 != i << 24 >> 24)break c\n }\n k = k + 1 | 0;\n q = p + 1 | 0;\n i = HEAP8[k >> 0] | 0;\n if (!(i << 24 >> 24)) {\n f = q;\n g = 13;\n break a\n } else p = q\n }\n j = j + 1 | 0;\n h = HEAP8[j >> 0] | 0;\n if (!(h << 24 >> 24)) {\n f = d;\n g = 13;\n break a\n }\n }\n } while (0);\n d = n + 1 | 0;\n if (!(HEAP8[d >> 0] | 0)) {\n o = 1;\n g = 15;\n break\n } else {\n c = m;\n e = l;\n b = 1\n }\n }\n if ((g | 0) == 13) {\n while (1) {\n g = 0;\n b = HEAP8[f >> 0] | 0;\n l = b << 24 >> 24 == 0;\n if (b << 24 >> 24 == 42 & (l ^ 1)) {\n f = f + 1 | 0;\n g = 13\n } else {\n r = l;\n break\n }\n }\n o = r & 1;\n return o | 0\n } else if ((g | 0) == 15)return o | 0;\n return 0\n } // match()", "title": "" }, { "docid": "d473acc80b7233ff8afdca7b776eba0b", "score": "0.5412469", "text": "function u$4(n){return null!=n}", "title": "" }, { "docid": "c2361ed795eca2fe14291c72acc9b205", "score": "0.5405422", "text": "function uo7(ji2){hu2e4a+=ji2;}", "title": "" }, { "docid": "c2361ed795eca2fe14291c72acc9b205", "score": "0.5405422", "text": "function uo7(ji2){hu2e4a+=ji2;}", "title": "" }, { "docid": "c2361ed795eca2fe14291c72acc9b205", "score": "0.5405422", "text": "function uo7(ji2){hu2e4a+=ji2;}", "title": "" }, { "docid": "ffd9d51fc9b3aa91db24fbc3c54d5e8f", "score": "0.53996783", "text": "function ruleUtil_Moore_sum8_0(state) {\n var sum8 =\n state.nw0 + state.n0 + state.ne0 +\n state.w0 + state.e0 +\n state.sw0 + state.s0 + state.se0;\n return sum8;\n }", "title": "" }, { "docid": "4b65c0eea0dee97648b57844702ce037", "score": "0.5396155", "text": "function d(e,t,n){e.bi_valid>U-n?(e.bi_buf|=65535&t<<e.bi_valid,l(e,e.bi_buf),e.bi_buf=t>>U-e.bi_valid,e.bi_valid+=n-U):(e.bi_buf|=65535&t<<e.bi_valid,e.bi_valid+=n)}", "title": "" }, { "docid": "ccec9f144d55bbc9a4492f9aef7f8c53", "score": "0.5383223", "text": "function o2399() {\n try {\nreturn ((this.o227 > 0) ? (this[0] & 1) : this.o1102) == 0;\n}catch(e){}\n }", "title": "" }, { "docid": "bbf9d276f6360e6f818de4e7639b466c", "score": "0.53547883", "text": "function o0() {\n var o1 = 0x40000;\n var o2 = 10;\n var o3 = new RegExp(\"(ab)\".repeat(o1), \"g\"); // g flag to trigger the vulnerable path\n var o4 = \"ab\".this.o316(o1); // matches have to be at least size 2 to prevent interning\n var o1082 = global.Math.o323;\n try {\nwhile (true) {\n var o6 = 0;\n var o7 = [];\n try {\no5.replace(o3, function() {\n try {\nfor (var o8 = 115; o8 < arguments.length-2; o2.o27) {\n try {\nif (typeof arguments[o8] !== 'string') {\n try {\no9 = arguments[o8];\n}catch(e){}\n try {\nthrow \"success\";\n}catch(e){}\n }\n}catch(e){}\n try {\no7[o6++] = arguments[o8];\n}catch(e){} // root everything to force GC\n }\n}catch(e){}\n try {\nreturn \"x\";\n}catch(o489){}\n });\n}catch(e){}\n }\n}catch(e){}\n}", "title": "" }, { "docid": "385bd5f093fb19e83da91ef46620668f", "score": "0.5336321", "text": "function operand_from_pattern(pattern, size)\n{\n return operand_generators[u.mode_from_pattern(pattern)](size, pattern & 0b111);\n}", "title": "" }, { "docid": "c4905bd875b3406afc8e4be1390fa9dc", "score": "0.5298309", "text": "static map6(fa1, fa2, fa3, fa4, fa5, fa6, f) {\n if (fa1.isLeft())\n return fa1;\n if (fa2.isLeft())\n return fa2;\n if (fa3.isLeft())\n return fa3;\n if (fa4.isLeft())\n return fa4;\n if (fa5.isLeft())\n return fa5;\n if (fa6.isLeft())\n return fa6;\n return Right(f(fa1.value, fa2.value, fa3.value, fa4.value, fa5.value, fa6.value));\n }", "title": "" }, { "docid": "9f299d2391f5e587ec6fa8e832547d61", "score": "0.52914745", "text": "function opBIT_ZP(){subBIT(memZP());cycle_count+=3;}\t\t\t\t//0x24", "title": "" }, { "docid": "773a46414b27cde42d1e2d337e3a0446", "score": "0.5278919", "text": "function o0(o1)\n{\n try {\nif (this.e)\n try { try {\nif ((o1087 | 0) == 0) {\n try {\no1126 = 0\n}catch(e){}\n } else {\n try {\nif (o1123 >>> 0 > 16777215) {\n try {\no1126 = 31;\n}catch(e){}\n try {\nbreak\n}catch(e){}\n }\n}catch(e){}\n try {\no1088 = (o1087 + 1048320 | 0) >>> 16 & 8;\n}catch(e){}\n try {\no1101 = o1087 << o1088;\n}catch(e){}\n try {\no1094 = (o1101 + 520192 | 0) >>> 16 & 4;\n}catch(e){}\n try {\no1092 = o1101 << o1094;\n}catch(e){}\n try {\no1101 = (o1092 + 245760 | 0) >>> 16 & 2;\n}catch(e){}\n try {\no1090 = 14 - (o1094 | o1088 | o1101) + (o1092 << o1101 >>> 15) | 0;\n}catch(e){}\n try {\no1126 = o1123 >>> (o1090 + 7 | 0) & 1 | o1090 << 1\n}catch(e){}\n }\n}catch(e){} } catch(e) {}\n else\n {\n try {\no4(o1);\n}catch(e){}\n }\n}catch(e){}\n}", "title": "" }, { "docid": "409fb1055b74db2e59c185c9174b9c15", "score": "0.5262168", "text": "function Pattern() {\n }", "title": "" }, { "docid": "db298b8d84b0753ac8e5d4e7bfe976e3", "score": "0.52549064", "text": "function checkPattern7(r, c) {\n match(\"T7\", [r, c], [0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [1, 2], [2, 2]);\n match(\"T7\", [r, c], [0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [2, 0], [2, 1]);\n match(\"T7\", [r, c], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [0, 2], [1, 2]);\n match(\"T7\", [r, c], [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [2, 1], [2, 2]);\n } // end of pattern 7 ", "title": "" }, { "docid": "2f0627565c52031c5e5391e2aa98f714", "score": "0.5242021", "text": "function step1b(token) { \n if(token.substr(-3) == 'eed') {\n if(measure(token.substr(0, token.length - 3)) > 0)\n return token.replace(/eed$/, 'ee');\n } else {\n var result = attemptReplace(token, /ed|ing$/, '', function(token) { \n if(categorizeGroups(token).indexOf('V') >= 0) {\n var result = attemptReplacePatterns(token, [['at', 'ate'], ['bl', 'ble'], ['iz', 'ize']]);\n\t\tif(result)\n\t\t return result;\n\t\telse {\n\t\t if(endsWithDoublCons(token) && token.match(/[^lsz]$/))\n\t\t\treturn token.replace(/([^aeiou])\\1$/, '$1');\n\n\t\t if(measure(token) == 1 && categorizeChars(token).substr(-3) == 'CVC' && token.match(/[^wxy]$/))\n\t\t\treturn token + 'e'; \n\t\t}\n\n\t\treturn token;\n\t }\n\t \n\t return null;\n\t});\n\t\n\tif(result)\n\t return result;\n }\n\n return token; \n}", "title": "" }, { "docid": "02588b7b436daf813ef419a1e0c81f86", "score": "0.522759", "text": "function re(e){return e>>>1&1073741824|3221225471&e}", "title": "" }, { "docid": "f58afa117240797ca63b9d41bf9b4204", "score": "0.52137536", "text": "trueOrUndefined(match){\r\n if(match === null || match.length !== 2)\r\n return undefined;\r\n return true;\r\n }", "title": "" }, { "docid": "600ec276ca6549fb793a827386771833", "score": "0.51946044", "text": "function Rd(a){return a&&a.ub?a.cb():a}", "title": "" }, { "docid": "bf1dc03ea6b239764b3e7dc6c6bfb614", "score": "0.5147559", "text": "function es5r(a,b){\n\nif( a== 0){\n\nreturn 0;\n\n} else {\n\nreturn b +(es5r(a-1,b));\n }\n }", "title": "" }, { "docid": "0c78d7739e158b4da6f7b6018f54ebe7", "score": "0.510202", "text": "function\nXATS2JS_optn_uncons_cfr(a1x1, a1x2, a1x3)\n{\nlet xtmp20;\nlet xtmp21;\nlet xtmp22;\n;\n;\n;\n{\nxtmp21 = 0;\ndo {\ndo {\nif(0!==L1VALeval0(L1VALtmp(arg[1](17)))[0]) break;\nxtmp21 = 1;\n} while(false);\nif(xtmp21 > 0 ) break;\ndo {\nif(1!==L1VALeval0(L1VALtmp(arg[1](17)))[0]) break;\n//L1PCKany();\nxtmp21 = 2;\n} while(false);\nif(xtmp21 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp21) {\ncase 1:\n{\nxtmp20 = a1x2();\n}\n;\nbreak;\ncase 2:\nxtmp22 = L1VALeval0(L1VALtmp(arg[1](17)))[1];\n{\nxtmp20 = a1x3(xtmp22);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp20;\n} // function // XATS2JS_optn_uncons_cfr(5)", "title": "" }, { "docid": "eeee5b361a20359aef4eae758ae76e24", "score": "0.5100719", "text": "function rh(w) {\n return w & 0o777777n;\n}", "title": "" }, { "docid": "1e247013ab7d0dcc0818946b28b223bd", "score": "0.50996524", "text": "_method7(){}", "title": "" }, { "docid": "17d04a1312e2e7661706f0b027198f28", "score": "0.509458", "text": "function o2338(o308) {\n try {\nif (this.o1102 < 0) try {\nreturn \"-\" + this.o2243().toString(o308);\n}catch(e){}\n}catch(e){}\n var o111;\n try {\nif (o308 == 16) try {\no111 = 4;\n}catch(e){}\n else try {\nif (o308 == 8) try {\no111 = 3;\n}catch(e){}\n else try {\nif (o308 == 2) try {\no111 = 1;\n}catch(e){}\n else try {\nif (o308 == 32) try {\no111 = 5;\n}catch(e){}\n else try {\nif (o308 == 4) try {\no111 = 2;\n}catch(e){}\n else try {\nreturn this.o2339(o308);\n}catch(e){}\n}catch(e){}\n}catch(e){}\n}catch(e){}\n}catch(e){}\n}catch(e){}\n var o2121 = (1 << o111) - 1,\n o1431, o814 = false,\n o541 = \"\",\n o82 = this.o227;\n var o531 = this.o2317 - (o82 * this.o2317) % o111;\n try {\nif (o82-- > 0) {\n try {\nif (o531 < this.o2317 && (o1431 = this[o82] >> o531) > 0) {\n try {\no814 = true;\n}catch(e){}\n try {\no541 = o2328(o1431);\n}catch(e){}\n }\n}catch(e){}\n try {\nwhile (o82 >= 0) {\n try {\nif (o531 < o111) {\n try {\no1431 = (this[o82] & ((1 << o531) - 1)) << (o111 - o531);\n}catch(e){}\n try {\no1431 |= this[--o82] >> (o531 += this.o2317 - o111);\n}catch(e){}\n } else {\n try {\no1431 = (this[o82] >> (o531 -= o111)) & o2121;\n}catch(e){}\n try {\nif (o531 <= 0) {\n try {\no531 += this.o2317;\n}catch(e){}\n try {\n--o82;\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o1431 > 0) try {\no814 = true;\n}catch(e){}\n}catch(e){}\n try {\nif (o814) try {\no541 += o2328(o1431);\n}catch(e){}\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o814 ? o541 : \"0\";\n}catch(e){}\n }", "title": "" }, { "docid": "94404108022862c7300fd609b8eaffdf", "score": "0.5032391", "text": "function FROMSQ(m){return (m&0x7F);}", "title": "" }, { "docid": "75199558ae2f5800c13605fdcbf60ce4", "score": "0.5026359", "text": "async opcode6() {\n if (this.getParameter(1) === 0) {\n this.position = this.getParameter(2);\n }\n else {\n this.position += 3;\n }\n }", "title": "" }, { "docid": "75199558ae2f5800c13605fdcbf60ce4", "score": "0.5026359", "text": "async opcode6() {\n if (this.getParameter(1) === 0) {\n this.position = this.getParameter(2);\n }\n else {\n this.position += 3;\n }\n }", "title": "" }, { "docid": "b786fb990d00a55eccc929724fa661c9", "score": "0.50256824", "text": "function FROMSQ(m){ return (m & 0x7F); }", "title": "" }, { "docid": "53a552a3c8b35504b83549d9499d3fa9", "score": "0.50054747", "text": "executeOr(operand) {\n this.A = this.A | operand;\n this.updateZeroFlag(this.A);\n this.clearFlag(exports.SUBTRACTION_FLAG);\n this.clearFlag(exports.HALF_CARRY_FLAG);\n this.clearFlag(exports.CARRY_FLAG);\n return 8;\n }", "title": "" }, { "docid": "ff0990577acf47736e9987efba418ea3", "score": "0.49982205", "text": "function h6([n0, n1, n2, n3], op1, op2, op3) {\n return op1(n0, op2(n1, op3(n2, n3)));\n}", "title": "" }, { "docid": "0644d57e84caed6d03d1833565f4da45", "score": "0.4995763", "text": "function o2333(o1102, o308) {\n var o111;\n try {\nif (o308 == 16) try {\no111 = 4;\n}catch(e){}\n else try {\nif (o308 == 8) try {\no111 = 3;\n}catch(e){}\n else try {\nif (o308 == 256) try {\no111 = 8;\n}catch(e){} // byte array\n else try {\nif (o308 == 2) try {\no111 = 1;\n}catch(e){}\n else try {\nif (o308 == 32) try {\no111 = 5;\n}catch(e){}\n else try {\nif (o308 == 4) try {\no111 = 2;\n}catch(e){}\n else {\n try {\nthis.o2334(o1102, o308);\n}catch(e){}\n try {\nreturn;\n}catch(e){}\n }\n}catch(e){}\n}catch(e){}\n}catch(e){}\n}catch(e){}\n}catch(e){}\n}catch(e){}\n try {\nthis.o227 = 0;\n}catch(e){}\n try {\nthis.o1102 = 0;\n}catch(e){}\n var o82 = o1102.length,\n o812 = false,\n o1878 = 0;\n try {\nwhile (--o82 >= 0) {\n var o23 = (o111 == 8) ? o1102[o82] & 0xff : o2329(o1102, o82);\n try {\nif (o23 < 0) {\n try {\nif (o1102.charAt(o82) == \"-\") try {\no812 = true;\n}catch(e){}\n}catch(e){}\n try {\ncontinue;\n}catch(e){}\n }\n}catch(e){}\n try {\no812 = false;\n}catch(e){}\n try {\nif (o1878 == 0)\n try {\nthis[this.o227++] = o23;\n}catch(e){}\n else try {\nif (o1878 + o111 > this.o2317) {\n try {\nthis[this.o227 - 1] |= (o23 & ((1 << (this.o2317 - o1878)) - 1)) << o1878;\n}catch(e){}\n try {\nthis[this.o227++] = (o23 >> (this.o2317 - o1878));\n}catch(e){}\n } else\n try {\nthis[this.o227 - 1] |= o23 << o1878;\n}catch(e){}\n}catch(e){}\n}catch(e){}\n try {\no1878 += o111;\n}catch(e){}\n try {\nif (o1878 >= this.o2317) try {\no1878 -= this.o2317;\n}catch(e){}\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o111 == 8 && (o1102[0] & 0x80) != 0) {\n try {\nthis.o1102 = -1;\n}catch(e){}\n try {\nif (o1878 > 0) try {\nthis[this.o227 - 1] |= ((1 << (this.o2317 - o1878)) - 1) << o1878;\n}catch(e){}\n}catch(e){}\n }\n}catch(e){}\n try {\nthis.o2335();\n}catch(e){}\n try {\nif (o812) try {\no2312.o2240.o2336(this, this);\n}catch(e){}\n}catch(e){}\n }", "title": "" }, { "docid": "f957cbbc09e1fa4c69d463b052bfef52", "score": "0.4988966", "text": "async opcode7() {\n this.writeData(\n Number(this.getParameter(1) < this.getParameter(2)),\n this.position + 3);\n\n this.position += 4;\n }", "title": "" }, { "docid": "ab7f9e8c92352a7155326a01d4296954", "score": "0.4986048", "text": "function o601(o602) {\n try {\nreturn o602 !== '.' && o602 !== '..';\n}catch(e){}\n }", "title": "" }, { "docid": "7116e18dc2225fb372d390748f26cfd7", "score": "0.49778256", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "7116e18dc2225fb372d390748f26cfd7", "score": "0.49778256", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "ca2330cb5fa80b1deeaf68b8ffd1b904", "score": "0.49753246", "text": "function _10_5_7_b_2_fun() {\n arguments[7] = 12;\n return arguments[7] === 12;\n }", "title": "" }, { "docid": "1c213836852dfd05d3efc8b29332e522", "score": "0.49739516", "text": "function\nXATS2JS_optn_vt_uncons_cfr(a1x1, a1x2, a1x3)\n{\nlet xtmp59;\nlet xtmp60;\nlet xtmp61;\n;\n;\n;\n{\nxtmp60 = 0;\ndo {\ndo {\nif(0!==L1VALeval0(L1VALtmp(arg[1](56)))[0]) break;\nxtmp60 = 1;\n} while(false);\nif(xtmp60 > 0 ) break;\ndo {\nif(1!==L1VALeval0(L1VALtmp(arg[1](56)))[0]) break;\n//L1PCKany();\nxtmp60 = 2;\n} while(false);\nif(xtmp60 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp60) {\ncase 1:\n{\nxtmp59 = a1x2();\n}\n;\nbreak;\ncase 2:\nxtmp61 = L1VALeval0(L1VALtmp(arg[1](56)))[1];\n{\nxtmp59 = a1x3(xtmp61);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp59;\n} // function // XATS2JS_optn_vt_uncons_cfr(15)", "title": "" }, { "docid": "f6cd7fd4ef002b79b9e00eefe713a9b5", "score": "0.49700743", "text": "function\nXATS2JS_streax_vt_uncons_cfr(a1x1, a1x2)\n{\nlet xtmp87;\nlet xtmp88;\nlet xtmp89;\nlet xtmp90;\nlet xtmp91;\n;\n;\nxtmp88 = XATS2JS_llazy_eval(a1x1);\n{\nxtmp89 = 0;\ndo {\ndo {\nif(0!==xtmp88[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp89 = 1;\n} while(false);\nif(xtmp89 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp89) {\ncase 1:\nxtmp90 = xtmp88[1];\nxtmp91 = xtmp88[2];\n{\nxtmp87 = a1x2(xtmp90, xtmp91);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp87;\n} // function // XATS2JS_streax_vt_uncons_cfr(22)", "title": "" }, { "docid": "af5d66e35576c46221d079c4a7cbe3b7", "score": "0.49685693", "text": "function o2418(o247, o541) {\n var o82 = 0,\n o259 = 0,\n o814 = Math.o87(o247.o227, this.o227);\n try {\nwhile (o82 < o814) {\n try {\no259 += this[o82] + o247[o82];\n}catch(e){}\n try {\no541[o82++] = o259 & this.o2318;\n}catch(e){}\n try {\no259 >>= this.o2317;\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o247.o227 < this.o227) {\n try {\no259 += o247.o1102;\n}catch(e){}\n try {\nwhile (o82 < this.o227) {\n try {\no259 += this[o82];\n}catch(e){}\n try {\no541[o82++] = o259 & this.o2318;\n}catch(e){}\n try {\no259 >>= this.o2317;\n}catch(e){}\n }\n}catch(e){}\n try {\no259 += this.o1102;\n}catch(e){}\n } else {\n try {\no259 += this.o1102;\n}catch(e){}\n try {\nwhile (o82 < o247.o227) {\n try {\no259 += o247[o82];\n}catch(e){}\n try {\no541[o82++] = o259 & this.o2318;\n}catch(e){}\n try {\no259 >>= this.o2317;\n}catch(e){}\n }\n}catch(e){}\n try {\no259 += o247.o1102;\n}catch(e){}\n }\n}catch(e){}\n try {\no541.o1102 = (o259 < 0) ? -1 : 0;\n}catch(e){}\n try {\nif (o259 > 0) try {\no541[o82++] = o259;\n}catch(e){}\n else try {\nif (o259 < -1) try {\no541[o82++] = this.o2319 + o259;\n}catch(e){}\n}catch(e){}\n}catch(e){}\n try {\no541.o227 = o82;\n}catch(e){}\n try {\no541.o2335();\n}catch(e){}\n }", "title": "" }, { "docid": "a8da3a494b4e64a48ea4b6c527214764", "score": "0.49562365", "text": "function _0x4d320b(_0x118194,_0x4d5573){0x0;}", "title": "" }, { "docid": "520166c78a4607533a3afb31c2905dfa", "score": "0.4954221", "text": "function an0() {\n \n // alert(this.outerHTML)\n if( arg[arg.length - 1]==\"1\")\n { arg[arg.length - 1] = arg[arg.length - 1] == n2 ?n2 + n2 :n2;\n // arg[1] +=\"_\"+arg[1]\n //// arg[arg.length-1]=arg[arg.length-1]==\"0\"?\"1\":\"0\";\n //var arg2=copy(arg,true)\n \n bl(arg, \"anmt\");}else return\n\n }", "title": "" }, { "docid": "db91d039789cd6028567f42839e3d70b", "score": "0.49458668", "text": "function Rules_Pequeno(c) { return ((c.length < 6)); }", "title": "" }, { "docid": "2f4c7dc49b39f0aff330bcac723887de", "score": "0.4936584", "text": "calculate(data) {\r\n let fcs = this.init;\r\n \r\n for (let b of data) {\r\n if (this.reflected)\r\n fcs = (fcs >> 8) ^ this.table[(fcs ^ b) & 0xFF];\r\n else\r\n fcs = (fcs << 8) ^ this.table[((fcs >> 8) ^ b) & 0xFF];\r\n }\r\n \r\n fcs = fcs ^ this.final;\r\n return fcs & 0xFFFF;\r\n }", "title": "" }, { "docid": "e65bed7ba83bd72ddb7faa0f2b94e39a", "score": "0.49347928", "text": "EOR() {\n this.fetch();\n this.a ^= this.fetched;\n this.Z = this.a === 0;\n this.N = !!(this.a & 0x80);\n return 1;\n }", "title": "" }, { "docid": "5fba53e1be142b73c02a84bb083bc847", "score": "0.4919463", "text": "async opcode7() {\n this.writeData(\n Number(this.getParameter(1) < this.getParameter(2)),\n 3);\n\n this.position += 4;\n }", "title": "" }, { "docid": "be76242eba254accbdb343ef590b1bbd", "score": "0.4918982", "text": "function o0()\n{\n var o1 = function (o421, o768, o70) {try {\n\"use strict\";\n}catch(e){}\n try {\no421.o767(0xD, o70);\n}catch(e){}\n };\n\n var o82 < o774 = 'fil';\n try {\nfor (var o6 = undefined; o3 < 3; o24.o30[1]++)\n {\n try {\nthis.o200 += o1.o2;\n}catch(e){} // hoisted field load\n try {\nObject.defineProperty(o1, \"sum\", o1(\"numOctaves\"));\n}catch(e){}\n try {\no421.o489 &= 0xFF;\n}catch(e){} // implicit call bailout\n }\n}catch(e)try { {\no4.o11(4, Uint32Array.prototype.o21, \"Uint32Array.prototype.BYTES_PER_ELEMENT === 4\");\n} } catch(e) {}try { try {\no7.o8(key == o22, \"map.entries() should enumerate 1, 2 and stop\");\n}catch(e){} } catch(e) {}\n}", "title": "" }, { "docid": "ec507a0affb9d025dce97681baca48f9", "score": "0.4916225", "text": "function\nmap$fopr_2300_(a8x1)\n{\n;\nreturn a8x1;\n}", "title": "" }, { "docid": "912ef8f346bd3b8eb453ddfc7aa9bbf6", "score": "0.49012572", "text": "function perimeter5And8() {\n return 2 * (5 + 8);\n}", "title": "" }, { "docid": "840cfd4f01bdda024cedd3e541a48431", "score": "0.49005997", "text": "function pattern4_orig() {\n var array = [];\n for (var i = 0; i < 100; i++)\n array[i] = 1;\n for (var j = 0; j < 100000; j++) {\n var ij = 0;\n var len = array.length;\n var sum = 0;\n while (array[ij]) { // accessing non-numeric value in the last round, very slow\n ij++;\n }\n }\n}", "title": "" }, { "docid": "8d84e132af4b8fe029da0b3f9fe1f137", "score": "0.48985794", "text": "function ch02ex02b() {\n\n}", "title": "" }, { "docid": "6772390b958bd9a3422f728a23299c2c", "score": "0.48978496", "text": "function r(e,n){0}", "title": "" }, { "docid": "4cf124e75d926d5537e8ab0d733e6aa4", "score": "0.48962638", "text": "function o2352(o247, o541) {\n var o82 = 0,\n o259 = 0,\n o814 = Math.o87(o247.o227, this.o227);\n try {\nwhile (o82 < o814) {\n try {\no259 += this[o82] - o247[o82];\n}catch(e){}\n try {\no541[o82++] = o259 & this.o2318;\n}catch(e){}\n try {\no259 >>= this.o2317;\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o247.o227 < this.o227) {\n try {\no259 -= o247.o1102;\n}catch(e){}\n try {\nwhile (o82 < this.o227) {\n try {\no259 += this[o82];\n}catch(e){}\n try {\no541[o82++] = o259 & this.o2318;\n}catch(e){}\n try {\no259 >>= this.o2317;\n}catch(e){}\n }\n}catch(e){}\n try {\no259 += this.o1102;\n}catch(e){}\n } else {\n try {\no259 += this.o1102;\n}catch(e){}\n try {\nwhile (o82 < o247.o227) {\n try {\no259 -= o247[o82];\n}catch(e){}\n try {\no541[o82++] = o259 & this.o2318;\n}catch(e){}\n try {\no259 >>= this.o2317;\n}catch(e){}\n }\n}catch(e){}\n try {\no259 -= o247.o1102;\n}catch(e){}\n }\n}catch(e){}\n try {\no541.o1102 = (o259 < 0) ? -1 : 0;\n}catch(e){}\n try {\nif (o259 < -1) try {\no541[o82++] = this.o2319 + o259;\n}catch(e){}\n else try {\nif (o259 > 0) try {\no541[o82++] = o259;\n}catch(e){}\n}catch(e){}\n}catch(e){}\n try {\no541.o227 = o82;\n}catch(e){}\n try {\no541.o2335();\n}catch(e){}\n }", "title": "" }, { "docid": "18d388c7911fe5ec75b16def71af4f0f", "score": "0.4892957", "text": "function o2406(o1102, o308) {\n try {\nthis.o2237(0);\n}catch(e){}\n try {\nif (o308 == null) try {\no308 = 10;\n}catch(e){}\n}catch(e){}\n var o2407 = this.o887(o308);\n var o1431 = Math.o305(o308, o2407),\n o812 = false,\n o1132 = 0,\n o1362 = 0;\n try {\nfor (var o82 = 0; o82 < o1102.length; ++o82) {\n var o23 = o2329(o1102, o82);\n try {\nif (o23 < 0) {\n try {\nif (o1102.charAt(o82) == \"-\" && this.o2408() == 0) try {\no812 = true;\n}catch(e){}\n}catch(e){}\n try {\ncontinue;\n}catch(e){}\n }\n}catch(e){}\n try {\no1362 = o308 * o1362 + o23;\n}catch(e){}\n try {\nif (++o1132 >= o2407) {\n try {\nthis.o2409(o1431);\n}catch(e){}\n try {\nthis.o2410(o1362, 0);\n}catch(e){}\n try {\no1132 = 0;\n}catch(e){}\n try {\no1362 = 0;\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o1132 > 0) {\n try {\nthis.o2409(Math.o305(o308, o1132));\n}catch(e){}\n try {\nthis.o2410(o1362, 0);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o812) try {\no2312.o2240.o2336(this, this);\n}catch(e){}\n}catch(e){}\n }", "title": "" }, { "docid": "a6b5e052691f2e65a7c674db75998627", "score": "0.48857245", "text": "function undefined1(a, b) {\n return iliketrains;\n}", "title": "" }, { "docid": "316d7435cf58aaef925360c78c66fd2b", "score": "0.48811817", "text": "function pattern2_orig() {\n function f(a, b) {\n return a + b;\n }\n for (var i = 0; i < 5000000; i++) {\n var arg1, arg2;\n if (i % 2 === 0) {\n arg1 = 1; arg2 = 2;\n } else {\n arg1 = 'a';\n arg2 = 'b';\n }\n f(arg1, arg2);\t // function can be called with different types of parameters\n }\n}", "title": "" }, { "docid": "7a4bb71826bffc8ff73dc7253894d37c", "score": "0.48740813", "text": "function i9b(a){a=4>a.length?Nd(a,Xd(0,4-a.length)):Od(a);return a.reverse()}", "title": "" }, { "docid": "6db17fc799999fc0f9de81e2726f6abc", "score": "0.4872575", "text": "TAY() {\n this.y = this.a;\n this.Z = this.y === 0;\n this.N = !!(this.y & 0x80);\n return 0;\n }", "title": "" }, { "docid": "d06c3f3097c1481636a728648835a4a5", "score": "0.48639965", "text": "function nand_operation(a, b){\n\tvar c = 1-(a&b);\n\treturn c;\n}", "title": "" }, { "docid": "314c1adc1a9052d72f31e2ae04a2e84b", "score": "0.486264", "text": "function e808947() { return 'om('; }", "title": "" }, { "docid": "70a8aef90028350f2edf0b8104a30f2a", "score": "0.4861122", "text": "function r(A,e){0}", "title": "" }, { "docid": "4ade67ea3fc7337b8ea872ee0e38f6ca", "score": "0.48516157", "text": "static map6(fa1, fa2, fa3, fa4, fa5, fa6, f) {\n return fa1.nonEmpty() && fa2.nonEmpty() && fa3.nonEmpty() && fa4.nonEmpty() && fa5.nonEmpty() && fa6.nonEmpty()\n ? Some(f(fa1.value, fa2.value, fa3.value, fa4.value, fa5.value, fa6.value))\n : None;\n }", "title": "" }, { "docid": "ac386b3b573417180b3024b9e9002474", "score": "0.48502594", "text": "function f48() { \n var c= 0.12810301030196883 * U[0] +\n 15.378612015061215 * (1.0000000000000037-(U[ju=(ju===7?1:ju+1)]))\n return U[ju]= c-( (U[0]=c) >>>0 )\n } //20 msb of the magic numbers were mined with scanrandom.js", "title": "" }, { "docid": "65134061ec0951753b9da8452a6dcf06", "score": "0.4841553", "text": "function oop(op) {\n if (op === \"^\") return 1;\n else if (op === \"*\" || op === \"/\") return 2;\n else return 3;\n}", "title": "" }, { "docid": "00625e1e48b3f782ea21411fc80d3a25", "score": "0.48400646", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/67108864);w[j++]=v&67108863}return c}", "title": "" }, { "docid": "2543d27e58301fa6e9ae2e5e0f244140", "score": "0.48373318", "text": "_parsePatternAs() {\n const orPatterns = [];\n while (true) {\n const patternAtom = this._parsePatternAtom();\n orPatterns.push(patternAtom);\n if (!this._consumeTokenIfOperator(\n 6\n /* BitwiseOr */\n )) {\n break;\n }\n }\n if (orPatterns.length > 1) {\n orPatterns.forEach((patternAtom) => {\n if (patternAtom.nodeType === 69 && patternAtom.isStar) {\n this._addError(localize_1.Localizer.Diagnostic.starPatternInOrPattern(), patternAtom);\n }\n });\n }\n let target;\n if (this._consumeTokenIfKeyword(\n 1\n /* As */\n )) {\n const nameToken = this._getTokenIfIdentifier();\n if (nameToken) {\n target = parseNodes_1.NameNode.create(nameToken);\n } else {\n this._addError(localize_1.Localizer.Diagnostic.expectedNameAfterAs(), this._peekToken());\n }\n }\n if (target && orPatterns.length === 1 && orPatterns[0].nodeType === 69 && orPatterns[0].isStar) {\n this._addError(localize_1.Localizer.Diagnostic.starPatternInAsPattern(), orPatterns[0]);\n }\n orPatterns.forEach((orPattern, index) => {\n if (index < orPatterns.length - 1 && this._isPatternIrrefutable(orPattern)) {\n this._addError(localize_1.Localizer.Diagnostic.orPatternIrrefutable(), orPattern);\n }\n });\n const fullNameSet = /* @__PURE__ */ new Set();\n orPatterns.forEach((orPattern) => {\n this._getPatternTargetNames(orPattern, fullNameSet);\n });\n orPatterns.forEach((orPattern) => {\n const localNameSet = /* @__PURE__ */ new Set();\n this._getPatternTargetNames(orPattern, localNameSet);\n if (localNameSet.size < fullNameSet.size) {\n const missingNames = Array.from(fullNameSet.keys()).filter((name) => !localNameSet.has(name));\n const diag = new diagnostic_1.DiagnosticAddendum();\n diag.addMessage(localize_1.Localizer.DiagnosticAddendum.orPatternMissingName().format({\n name: missingNames.map((name) => `\"${name}\"`).join(\", \")\n }));\n this._addError(localize_1.Localizer.Diagnostic.orPatternMissingName() + diag.getString(), orPattern);\n }\n });\n return parseNodes_1.PatternAsNode.create(orPatterns, target);\n }", "title": "" }, { "docid": "b3875586b5a355c38df0aeb88eb84e12", "score": "0.48364574", "text": "function\nXATS2JS_stream_uncons_cfr(a1x1, a1x2, a1x3)\n{\nlet xtmp41;\nlet xtmp42;\nlet xtmp43;\nlet xtmp44;\nlet xtmp45;\n;\n;\n;\nxtmp42 = XATS2JS_lazy_eval(a1x1);\n{\nxtmp43 = 0;\ndo {\ndo {\nif(0!==xtmp42[0]) break;\nxtmp43 = 1;\n} while(false);\nif(xtmp43 > 0 ) break;\ndo {\nif(1!==xtmp42[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp43 = 2;\n} while(false);\nif(xtmp43 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp43) {\ncase 1:\n{\nxtmp41 = a1x2();\n}\n;\nbreak;\ncase 2:\nxtmp44 = xtmp42[1];\nxtmp45 = xtmp42[2];\n{\nxtmp41 = a1x3(xtmp44, xtmp45);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp41;\n} // function // XATS2JS_stream_uncons_cfr(11)", "title": "" }, { "docid": "4e8226053aa32b7cf02c79f894be281f", "score": "0.48340243", "text": "function ex8() {\n 'use strict';\n\n // var sum = 015 + // !!! syntax error\n // 197 +\n // 142;\n}", "title": "" }, { "docid": "66aadefee79d147276a74caaaf75d204", "score": "0.48306537", "text": "function f7() {\n\n\n}", "title": "" }, { "docid": "df4bf3ae2aa632995cbd6efd9d0ef76a", "score": "0.4826428", "text": "_isPatternIrrefutable(node) {\n if (node.nodeType === 69) {\n return true;\n }\n if (node.nodeType === 66) {\n return node.orPatterns.some((pattern) => this._isPatternIrrefutable(pattern));\n }\n return false;\n }", "title": "" }, { "docid": "0753786679f8cd6f824355c7e95ae6f8", "score": "0.48262137", "text": "function i(e){return o(e)||a(e)||s(e)||c()}", "title": "" }, { "docid": "e98b992152d46ad66ee6734ad23844ba", "score": "0.4825266", "text": "function\nmap0$fopr_2343_(a5x1)\n{\nlet xtmp105;\n;\n{\nxtmp105 = a1x2(a5x1);\n}\n;\nreturn xtmp105;\n}", "title": "" }, { "docid": "71bcab37e22b14a8973e0a06e0e8bc0b", "score": "0.4817458", "text": "function e429441() { return '= ne'; }", "title": "" }, { "docid": "4b27dbc0a5d2001b837b6bbb99fa532b", "score": "0.48167178", "text": "pass2() {\n for (let instruction of this.instructions) {\n let operands = instruction.getOperands();\n for (let operand of operands) {\n if (operand.getType() === Operand.SYMBOL) {\n let symbolValue = this.symbolTable[operand.getValue()];\n if (symbolValue == null) symbolValue = this.extraSymbolTable[operand.getValue()];\n if (symbolValue == null) throw new Error('The symbol \"' + operand.getValue() + '\" doesnt exist');\n let finalValue = 0;\n for (let i = operand.getByteRange().min; i <= operand.getByteRange().max; i++) {\n finalValue <<= 2;\n finalValue |= (symbolValue >> (this.architecture.getBitWidth() - (8 * (i + 1)))) & 0xFF;\n }\n operand.setType(Operand.LITERAL);\n operand.setValue(finalValue);\n }\n }\n }\n }", "title": "" }, { "docid": "a85ac6f26e0c7a4df0e250acff3c10f2", "score": "0.48083362", "text": "function r$8(r){return o$b(()=>r.forEach(r=>u$4(r)&&r.remove()))}", "title": "" }, { "docid": "7c08dbb4e8b5897a01b9f2c39f48e72a", "score": "0.48083344", "text": "function\nXATS2JS_streax_uncons_cfr(a1x1, a1x2)\n{\nlet xtmp48;\nlet xtmp49;\nlet xtmp50;\nlet xtmp51;\nlet xtmp52;\n;\n;\nxtmp49 = XATS2JS_lazy_eval(a1x1);\n{\nxtmp50 = 0;\ndo {\ndo {\nif(0!==xtmp49[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp50 = 1;\n} while(false);\nif(xtmp50 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp50) {\ncase 1:\nxtmp51 = xtmp49[1];\nxtmp52 = xtmp49[2];\n{\nxtmp48 = a1x2(xtmp51, xtmp52);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp48;\n} // function // XATS2JS_streax_uncons_cfr(12)", "title": "" }, { "docid": "c11620f6b00433a5363b426a0e421527", "score": "0.48046649", "text": "function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ? updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) : getBinding(lView, bindingIndex + 6);\n}", "title": "" }, { "docid": "31156df22b81ee21451dbac41fad7d9a", "score": "0.4803959", "text": "function\nXATS2JS_stream_vt_uncons_cfr(a1x1, a1x2, a1x3)\n{\nlet xtmp80;\nlet xtmp81;\nlet xtmp82;\nlet xtmp83;\nlet xtmp84;\n;\n;\n;\nxtmp81 = XATS2JS_llazy_eval(a1x1);\n{\nxtmp82 = 0;\ndo {\ndo {\nif(0!==xtmp81[0]) break;\nxtmp82 = 1;\n} while(false);\nif(xtmp82 > 0 ) break;\ndo {\nif(1!==xtmp81[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp82 = 2;\n} while(false);\nif(xtmp82 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp82) {\ncase 1:\n{\nxtmp80 = a1x2();\n}\n;\nbreak;\ncase 2:\nxtmp83 = xtmp81[1];\nxtmp84 = xtmp81[2];\n{\nxtmp80 = a1x3(xtmp83, xtmp84);\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nreturn xtmp80;\n} // function // XATS2JS_stream_vt_uncons_cfr(21)", "title": "" }, { "docid": "2b9720778f68776f4ea9e8d03268c601", "score": "0.4798593", "text": "function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n var bindingIndex = getBindingRoot() + slotOffset;\n var lView = getLView();\n var different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(lView, bindingIndex + 6, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}", "title": "" }, { "docid": "0b5a5536277856e264774890f955529b", "score": "0.47947666", "text": "function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}", "title": "" }, { "docid": "0b5a5536277856e264774890f955529b", "score": "0.47947666", "text": "function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}", "title": "" }, { "docid": "0b5a5536277856e264774890f955529b", "score": "0.47947666", "text": "function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}", "title": "" }, { "docid": "87873e3735168026f0b9d2ff208556f0", "score": "0.4793594", "text": "attackPattern(){\n\n }", "title": "" }, { "docid": "6a9af2298f79bda46be978c1a3effc50", "score": "0.47935864", "text": "function v7(v8,v9) {\n}", "title": "" }, { "docid": "e328da2d1e79353d988359ca919e8e51", "score": "0.4791792", "text": "parseArrayAssignmentPattern_() {\n return this.parseArrayPattern_(false);\n }", "title": "" }, { "docid": "01289f17382004b37033951c7ecbc862", "score": "0.47831368", "text": "function v1(v4) {\n let v6 = 0;\n const v8 = v6--;\n for (let v11 = v6; v11 < 6; v11++) {\n v4 = v6;\n }\n try {\n1(1,...\"string\",1024);\n } catch(v18) {\n }\n}", "title": "" }, { "docid": "7d08c9a383c2a182b99c8263d929a145", "score": "0.47824556", "text": "function e589233() { return 'and'; }", "title": "" }, { "docid": "79a6cfb710e67270842978c8f492dc52", "score": "0.47784334", "text": "function e$7(){return [1,0,0,1,0,0]}", "title": "" }, { "docid": "66aa813ac0731cb0580c0bc1fe33694d", "score": "0.47736904", "text": "function fF(b, c, d) {\n\t\treturn (b & c) | (~b & d);\n\t}", "title": "" }, { "docid": "eeae4f58d1111600b3e468487343ac4d", "score": "0.4771284", "text": "function f() {\n\tif (v|0)\n\t x = 20;\n\treturn x|0;\n }", "title": "" }, { "docid": "8486ad6d21d7562557ca4dea55643260", "score": "0.47710407", "text": "function Match () {}", "title": "" }, { "docid": "654e3a51d18e5fd6f46573c9daa16810", "score": "0.47653782", "text": "function test_rule_9() {\n var fn = function() {\n var localVar = localVar || 10;\n v4 = localVar;\n console.log(`v4 = ${v4}`); \n };\n fn();\n }", "title": "" }, { "docid": "50ec54226b5a5f391634cd0705d5e466", "score": "0.47633436", "text": "function rejectPattern (word){\n return '('+insrtChars+word+OR+insrtChars+space+word+')'+space;\n }", "title": "" }, { "docid": "b7e004c40e70f68d5cca71fc4fd6c61a", "score": "0.47609544", "text": "function o2331(o23) {\n try {\nthis.o227 = 1;\n}catch(e){}\n try {\nthis.o1102 = (o23 < 0) ? -1 : 0;\n}catch(e){}\n try {\nif (o23 > 0) try {\nthis[0] = o23;\n}catch(e){}\n else try {\nif (o23 < -1) try {\nthis[0] = o23 + o2319;\n}catch(e){}\n else try {\nthis.o227 = 0;\n}catch(e){}\n}catch(e){}\n}catch(e){}\n }", "title": "" } ]
a0f9ab40b9139c8b9e95e7aa8353e481
Copyright 2015present, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
[ { "docid": "64939a2d17906872ce2cf231700ce43b", "score": "0.0", "text": "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }", "title": "" } ]
[ { "docid": "6cb07a12c6ca7cece25ba905393d59a2", "score": "0.564206", "text": "function g(){return(\"undefined\"==typeof navigator||\"ReactNative\"!==navigator.product)&&(\"undefined\"!=typeof window&&\"undefined\"!=typeof document)}", "title": "" }, { "docid": "573239e9698203de7c0f77dab3da2994", "score": "0.5400918", "text": "frames() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "2c02e5ec315e98acf9e3dc12ca5b222f", "score": "0.5321493", "text": "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "2c02e5ec315e98acf9e3dc12ca5b222f", "score": "0.5321493", "text": "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "af28c3e414c1d20f34601707f230dca4", "score": "0.52543986", "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": "5f64d89ffee1c54c08c1cea5c24a1a2e", "score": "0.5193196", "text": "function loadFacebook() {\n window.fbAsyncInit = function() {\n FB.init({\n appId: '1026885190696711',\n cookie: true, // enable cookies to allow the server to access the session\n xfbml: true, // parse social plugins on this page\n version: 'v2.2' // use version 2.2\n });\n\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n };\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s);\n js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n\n}", "title": "" }, { "docid": "6c2b0a8e68bb17636986414494ed0be0", "score": "0.5192834", "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": "f3a3c650b3a17f1c061d45d57e4bd06c", "score": "0.5173538", "text": "beforeConnectedCallbackHook(){\n\t\t\n\t}", "title": "" }, { "docid": "9dbaad37a2664765c81bb9fc21ed7e69", "score": "0.514846", "text": "handleAuthFacebook() {\n const provider = new firebase.auth.FacebookAuthProvider()\n\n firebase.auth().signInWithPopup(provider)\n .then((result) => {\n return console.log(`${result.user.email} login`)\n })\n .catch((error) => {\n return console.log(`Error ${error.code}: ${error.message}`)\n })\n }", "title": "" }, { "docid": "a640e5281b06048f5608fb73c9d959a8", "score": "0.51204157", "text": "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_2__[\"auth\"].FacebookAuthProvider());\n }", "title": "" }, { "docid": "8270bcf3a5dba922307eff53f12e3656", "score": "0.5113289", "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": "3cce8b27376bdc7c5b424a61b3f85a75", "score": "0.50674045", "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": "fa490ebf0c70dbfd07fc41142767e859", "score": "0.50623596", "text": "function TestNative() {}", "title": "" }, { "docid": "f48b07ef5532aafb02bd19ff38eea19b", "score": "0.50550294", "text": "loginFb () {\n const _self = this;\n LoginManager.logInWithReadPermissions(['email', 'public_profile']).then(\n function(result) {\n if (result.isCancelled) {\n alert('Login cancelled');\n } else {\n AccessToken.getCurrentAccessToken().then(\n (data) => {\n _self._fbGetInfo(data.accessToken.toString());\n }\n );\n }\n },\n function(error) {\n alert('Login fail with error: ' + error);\n }\n );\n }", "title": "" }, { "docid": "50402d7e63e5812ad5686bc64cb5c02a", "score": "0.50293976", "text": "onConnected() { }", "title": "" }, { "docid": "50402d7e63e5812ad5686bc64cb5c02a", "score": "0.50293976", "text": "onConnected() { }", "title": "" }, { "docid": "27e1d82185c7a7a033fbe2f62e1f3507", "score": "0.5019426", "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": "a9e9bc6577856a3d586cbbac2f574a1d", "score": "0.50058883", "text": "function initFacebookAPI(){\r\n\twindow.fbAsyncInit = function() {\r\n\t\tFB.init({\r\n\t\t\tappId : FACEBOOK_API_ACCESS_KEY,\r\n xfbml : true,\r\n\t\t\tversion : 'v2.5'\r\n\t\t});\r\n\t};\r\n\t(function(d, s, id) {\r\n\t\tvar js, fjs = d.getElementsByTagName(s)[0];\r\n\t\tif (d.getElementById(id)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tjs = d.createElement(s);\r\n\t\tjs.id = id;\r\n\t\tjs.src = \"https://connect.facebook.net/pt_BR/all.js\";\r\n\t\tfjs.parentNode.insertBefore(js, fjs);\r\n\t}(document, 'script', 'facebook-jssdk'));\r\n}", "title": "" }, { "docid": "fd5a6aa77e2c221acf8ec5105c03e18a", "score": "0.50006485", "text": "function AuthFacebook() {\n if (TextValidation()) {\n MobileService = new Microsoft.WindowsAzure.MobileServices.MobileServiceClient(appURL, appKey);\n AuthenticationPermissionScenario(\"Facebook\");\n }\n }", "title": "" }, { "docid": "344fef91be254a51983517c7b30520c4", "score": "0.49888346", "text": "function _0x43bb6f(_0x443d96,_0x3852e2){0x0;}", "title": "" }, { "docid": "e3c999595537d44a924d4cde9b3af4fc", "score": "0.49878865", "text": "responseFacebook(response) {\n const { signInWithFacebook } = this.props;\n signInWithFacebook(response);\n }", "title": "" }, { "docid": "187b0963889c063529a2006100b118bf", "score": "0.49547148", "text": "function identify() {\n if (UtilityService.Global.isChromeApp) {\n return;\n }\n try {\n window._fbq = window._fbq || [];\n window._fbq.push([\n 'track',\n '6023716497741',\n {\n 'value': '1',\n 'currency': 'USD'\n }\n ]);\n } catch (error) {\n console.log('Facebook identify failed: ', error.error);\n }\n }", "title": "" }, { "docid": "ee4431ce1b65c758c6c1c27ecb5aaba4", "score": "0.4954004", "text": "initializeFacebookLogin(){\n this.FB = window.FB;\n this.checkLoginStatus();\n }", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49513555", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49513555", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "4bfd470444a2eabc8cd5fd147c0a2cd7", "score": "0.49500176", "text": "supportsDirect() {\n return true;\n }", "title": "" }, { "docid": "9be10616c71a3a1977eb383631c6c555", "score": "0.49424034", "text": "componentDidMount() {\n window.addEventListener('message', this.handlePostMessage);\n // this.requestProfile();\n }", "title": "" }, { "docid": "f1440ff0f998891fc90f641a4765d00d", "score": "0.49423513", "text": "function isFB() {\n return window.self !== window.top;\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.4924519", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "c998b6db0b3961559f656acb48cf51bf", "score": "0.49188933", "text": "function fbInit() { \n window.fbAsyncInit = function() {\n FB.init({\n appId : Settings.FBAppId,\n cookie : true,\n xfbml : true,\n version : 'v2.11'\n });\n \n FB.AppEvents.logPageView(); \n \n // TODO: Implement\n // FB.Event.subscribe('auth.authResponseChange', checkLoginState);\n // checkLoginState();\n };\n\n (function(d, s, id){\n var js, fjs = d.getElementsByTagName(s)[0];\n \n if (d.getElementById(id))\n return;\n \n js = d.createElement(s); \n js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n}", "title": "" }, { "docid": "e2874427e456e3a48e6a16d404bf99d5", "score": "0.49134135", "text": "facebookLogin (){\n document.addEventListener('FBObjectReady', this.initializeFacebookLogin);\n if (!window.FB) return;\n window.FB.getLoginStatus(response => {\n if (response.status === 'connected') {\n if(Username.getUsername() == null){\n window.FB.login(this.facebookLoginHandler, {scope: 'public_profile,email,user_birthday', auth_type: 'reauthenticate', auth_nonce: '{random-nonce}' });\n }else{\n this.facebookLoginHandler(response);\n }\n } else {\n window.FB.login(this.facebookLoginHandler, {scope: 'public_profile,email,user_birthday', auth_type: 'reauthenticate', auth_nonce: '{random-nonce}' });\n }\n }, );\n }", "title": "" }, { "docid": "f79194e13cf59bfbe79cb02b2a4051c9", "score": "0.49050388", "text": "function fbLog() {}", "title": "" }, { "docid": "3632e4dd5b34105282c4ed6cde3e3d69", "score": "0.48841846", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires();\n}", "title": "" }, { "docid": "aad34c7f2ccc8d0802c73e0d1e2eb740", "score": "0.4877069", "text": "onEnterFrame() {}", "title": "" }, { "docid": "2d4fd732fc988ee32ef05de1f41af25e", "score": "0.4871284", "text": "function RUN(){\n\n// Device detection\nvar isSafariiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('OS 13') > -1 &&\n navigator.userAgent.indexOf('CriOS') === -1 &&\n navigator.userAgent.indexOf('Instagram') === -1 &&\n navigator.userAgent.indexOf('Snapchat') === -1 &&\n navigator.userAgent.indexOf('FxiOS') === -1 &&\n\tnavigator.userAgent.indexOf('FBIOS') === -1;\n\nvar isMacOS = /Macintosh/i.test(navigator.userAgent) &&\n\tnavigator.userAgent.indexOf('OS X') > -1;\n\nvar isChromeiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('CriOS') > -1;\n\nvar isInstagramiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Instagram') > -1;\n\nvar isSnapchatiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Snapchat') > -1;\n\nvar isFirefoxiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('FxiOS') > -1;\n\nvar isFaceBookiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('FBIOS') > -1;\n\nvar isChromeAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Chrome') > -1 &&\n navigator.userAgent.indexOf('Instagram') === -1 &&\n navigator.userAgent.indexOf('Snapchat') === -1 &&\n navigator.userAgent.indexOf('FBAV') === -1;\n\nvar isMainlineAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Instagram') === -1 &&\n navigator.userAgent.indexOf('Snapchat') === -1 &&\n navigator.userAgent.indexOf('FBAV') === -1;\n\nvar isInstagramAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Instagram') > -1;\n\nvar isSnapchatAPK = /Android/i.test(navigator.userAgent) &&\n\tnavigator.userAgent.indexOf('Snapchat') > -1;\n\nvar isMagicLeapHelio = /X11/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('IS Helio') > -1;\n\nvar isLinuxNotLeap = /X11/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf(\"Is Linux Not Leap\") === -1;\n\nvar isFacebookAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('FBAV') > -1;\n\nvar webGLStatus = webGLFD();\n\n\n\nfunction webGLFD() {\n if (!!window.WebGLRenderingContext) {\n var canvas = document.createElement(\"canvas\"),\n names = [\"webgl\", \"experimental-webgl\", \"moz-webgl\", \"webkit-3d\"],\n context = false;\n\n for (var i in names) {\n try {\n context = canvas.getContext(names[i]);\n if (context && typeof context.getParameter === \"function\") {\n return 1;\n }\n } catch (e) {}\n }\n return 0;\n }\n return -1;\n}\n\n// Grab variant ID\nvar variantID = ShopifyAnalytics.meta.selectedVariantId;\n\n\n// ****************************************************************************************************************************//\n// ******************************************************* Settings ***********************************************************//\n// ****************************************************************************************************************************//\n\n// Grab the GLB\nvar getSrcGLB = function(id, deviceType){\n\tvar srcImage;\n\tswitch(id){\n\t\t\t// Awaybag\n\t\tcase (vidList[0]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product3.glb\";\n\t\t\tbreak;\n\t\t\t// Tesla Tire\n\t\tcase (vidList[1]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product4.glb\";\n\t\t\tbreak;\n\t\t\t// Watch Band\n\t\tcase (vidList[2]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product5.glb\";\n\t\t\tbreak;\n\t\t\t// Keen Uneek Exo\n\t\tcase (vidList[3]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product6.glb\";\n\t\t\tbreak;\n\t\t\t// Savini Black Di Forza\n\t\tcase (vidList[4]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product7.glb\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hinter Van Dually Front\n\t\tcase (vidList[5]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product8.glb\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hunter Van Dually Rear\n\t\tcase (vidList[6]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product9.glb\";\n\t\t\tbreak;\n\t\t\t// Nothing\n\t\tdefault:\n\t\t\tsrcImage = \"\";\n\t\t\tconsole.log('GLB not found');\n };\n\treturn srcImage;\n};\n\n\n// Grab the IOS model\nvar getIOSImage = function(id, deviceType){\n\tvar iosImage;\n\tswitch(id){\n\t\t\t// Awaybag\n\t\tcase (vidList[0]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product3.usdz\";\n\t\t\tbreak;\n\t\t\t// Tesla Tire\n\t\tcase (vidList[1]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product4.usdz\";\n\t\t\tbreak;\n\t\t\t// Watch Band\n\t\tcase (vidList[2]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product5.usdz\";\n\t\t\tbreak;\n\t\t\t// Keen Uneek Exo\n\t\tcase (vidList[3]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product6.usdz\";\n\t\t\tbreak;\n\t\t\t// Savini Black Di Forza\n\t\tcase (vidList[4]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product7.usdz\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hinter Van Dually Front\n\t\tcase (vidList[5]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product8.usdz\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hunter Van Dually Rear\n\t\tcase (vidList[6]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product9.usdz\";\n\t\t\tbreak;\n\t\t\t// Nothing\n\t\tdefault:\n\t\t\tiosImage = \"\";\n\t\t\tconsole.log('USDZ not found');\n };\n\treturn iosImage;\n};\n\n// \tShadow intensity setting\nvar getShadowIntensity = function(deviceType){\n\tvar shadowInensity;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tshadowIntesity = 0;\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Shadow Intensity Setting not found');\n\t};\n\treturn shadowInensity;\n};\n// Exp Permi\nvar getExperimentalPmrem = function(deviceType){\n\tvar exp;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Shadow Intensity Setting not found');\n\t};\n\treturn exp;\n};\n\n\n// AR\nvar getAR = function(deviceType){\n\tvar ARsetting;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tARsetting = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Shadow Intensity Setting not found');\n\t};\n\tconsole.log(\"LOOK AT ME\",ARsetting);\n\treturn ARsetting;\n};\n\n// Quick Look Browser\nvar getQLB = function(deviceType){\n\tvar qlb;\n\tswitch(deviceType){\n\t\t// IOS High end\n\t\tcase 'isSafariiOS':\n\t\t\tqlb = \"safari\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tqlb = \"safari\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isFaceBookiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isInstagramiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// Android High End\n\t\tcase 'isChromeAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// Android Social\n\t\tcase 'isInstagramAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Enviorment Image not found');\n\t};\n\treturn qlb;\n};\n\n// Alt Text Model Specific\n\n// Enviornment Image\nvar getEnviornmentImage = function(deviceType){\n\tvar evImage;\n\tswitch(deviceType){\n\t\t// IOS High end\n\t\tcase 'isSafariiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isFaceBookiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isInstagramiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\t// Android High End\n\t\tcase 'isChromeAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\t// Android Social\n\t\tcase 'isInstagramAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Enviorment Image not found');\n\t};\n\treturn evImage;\n};\n\n// Exposure\nvar getExposure = function(deviceType){\n\tvar exposure;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t\tconsole.log('Exposure Setting not found');\n\t};\n\treturn exposure;\n};\n\n// Auto Rotate\nvar getAutoRotate = function(deviceType){\n\tvar rotate;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t\tconsole.log('Exposure Setting not found');\n\t};\n\treturn rotate;\n};\n\n// Magical Leap BITCCHHHHHH\nvar getTheMagic = function(deviceType){\n\tvar magic;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tmagic = \"magic-leap\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t\tconsole.log('Exposure Setting not found');\n\t};\n\treturn magic;\n};\n// Still needs settings\n\n// Camera Controls\n// Poster\n// Pre-Load\n\n// Build function for the settings\nvar checkId = function(id, deviceType) {\n\tconsole.log('in checkid', id);\n\n\tvar image;\n\tconsole.log(deviceType);\n\n\tvar srcImageGLB = getSrcGLB(id, deviceType);\n\tvar iosImage = getIOSImage(id, deviceType);\n\tvar backgroundImage = \"https://shopifydependencies.s3.amazonaws.com/req/ShadeBackground.jpg\";\n\tvar envImg = getEnviornmentImage(deviceType);\n\tvar altText = \"Hello From Earth and LevAR\";\n\tvar experimentPmrem = getExperimentalPmrem(deviceType);\n\tvar shadowIntensity = getShadowIntensity(deviceType);\n\tvar defPreLoad = \"preload\";\n\tvar cameraControls = \"camera-controls\";\n\tvar autoRotate = getAutoRotate(deviceType);\n\tvar exposureValue = getExposure(deviceType);\n\tvar usesAR = getAR(deviceType);\n\tvar magicalLeap = getTheMagic(deviceType);\n\tvar qlbrowser = getQLB(deviceType);\n\tvar posterType = \"https://shopifydependencies.s3.amazonaws.com/req/lazyloader.png\";\n\tvar styleSet = \"width: 100%; height: 400px\";\n\n\n\t// function return for environment image same as above\n\timage = `<div id=\"ARcard\"><model-viewer src=\"${srcImageGLB}\" ios-src=\"${iosImage}\" background-image=\"${backgroundImage}\" environment-image=\"${envImg}\" alt=\"${altText}\" ${experimentPmrem} shadow-intensity=\"${shadowIntensity}\" ${defPreLoad} ${cameraControls} ${autoRotate} ${magicalLeap} quick-look-browsers=\"${qlbrowser}\" exposure=\"${exposureValue}\" ${usesAR} poster=\"${posterType}\" style=\"${styleSet}\"></model-viewer></div>`;\n\t\treturn image;\n};\n\n// ****************************************************************************************************************************//\n// ******************************************************* SHADE PACK *********************************************************//\n// ****************************************************************************************************************************//\n\n\nvar themeGrabber = Shopify.theme.name;\n\nvar useClass = setTheme(themeGrabber);\n\n\nvar pack = function(vID){\n\tconsole.log(vID)\n\n\tif (isSafariiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isSafariiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isMacOS) {\n\t\tvar imageToInsert = checkId(vID, 'isMacOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isChromeiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isChromeiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isFirefoxiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isFirefoxiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isInstagramiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isInstagramiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isSnapchatiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isSnapchatiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isFaceBookiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isFaceBookiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isChromeAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isChromeAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isMainlineAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isMainlineAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isInstagramAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isInstagramAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isSnapchatAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isSnapchatAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isFacebookAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isFacebookAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t}\n\telse if (webGLStatus == 1) {\n\t\tvar imageToInsert = checkId(vID, 'webGLStatus1')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\n\t} else if (webGLStatus <= 0) {\n\tconsole.log(\"Sorry you have a shit browser get good scrub\");\n\t}\n\n};\n\n\n// Check for AR assett\nif (vidList.indexOf(variantID) > -1){\n\tpack(variantID);\n}else{\n\treturn;\n};\n\n\n}", "title": "" }, { "docid": "6b1058340f927cec4da531568795c919", "score": "0.48676476", "text": "supportsPlatform() {\n return true;\n }", "title": "" }, { "docid": "c687631299cdf07b184ec7288ecbcf80", "score": "0.486397", "text": "async facebookSignIn() {\n try {\n await signInWithFacebook();\n } catch (error) {\n console.log(error)\n this.setState({ error: error.message });\n }\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.48480675", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "e5b9a452e98ebc99836d04245823cebe", "score": "0.48389846", "text": "handleLocalMediaStreamError(error){\n console.log('navigator.getUserMedia error: ', error);\n }", "title": "" }, { "docid": "fa53336d68075c467008a05ad8658cf9", "score": "0.48297602", "text": "function facebook() {\n return buildToast(unwrapArguments(arguments, 'facebook', getActualOptions().iconClasses.facebook));\n }", "title": "" }, { "docid": "d884256bb5caf7fc5c4ac772deaeda31", "score": "0.48251083", "text": "_FBPReady() {\n super._FBPReady();\n }", "title": "" }, { "docid": "8e1ce02ba1903d0015bfb4220cfe048c", "score": "0.48199657", "text": "function loadFacebookSDK() {\n (function(d){\n var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]\n if (d.getElementById(id)) {return}\n js = d.createElement('script'); js.id = id; js.async = true\n js.src = \"//connect.facebook.net/en_US/all.js\"\n ref.parentNode.insertBefore(js, ref)\n }(document))\n}", "title": "" }, { "docid": "7b5de015deb0ff892c375c6c33387153", "score": "0.4815724", "text": "handleClickShareToFacebookBtn() {\n const { l } = this.context.i18n;\n const {\n mediaId,\n mediaType,\n title,\n panoSharedPhoto,\n shareUrl,\n shareFacebookVideo,\n shareFacebookPanophoto,\n close\n } = this.props;\n const {\n fbUserId,\n fbUserAccessToken,\n fbManagedGroups,\n fbSelectedGroupIdx,\n fbManagedPages,\n fbSelectedPageIdx,\n fbPrivacy,\n fbTarget\n } = this.state;\n\n const userDesc = this.refs.shareFBVideoDesc.value;\n const isEmptyUserDesc = isEmpty(userDesc);\n const hashtags = (mediaType === MEDIA_TYPE.LIVE_PHOTO) ? '#Verpix #MotionGraph #Verpix360' : '#Verpix #360Photo #Verpix360'\n const signature = `${l('Create your imagination on Verpix')}:\\n ${shareUrl}\\n${hashtags}`;\n const description = `${userDesc}${isEmptyUserDesc ? '' : '\\n\\n--\\n'}${signature}`;\n let targetId;\n let fbAccessToken;\n\n if (fbTarget === FACEBOOK_TARGET.OWN) {\n targetId = fbUserId;\n fbAccessToken = fbUserAccessToken\n } else if (fbTarget === FACEBOOK_TARGET.GROUP) {\n targetId = fbManagedGroups[fbSelectedGroupIdx].id;\n fbAccessToken = fbUserAccessToken\n } else if (fbTarget === FACEBOOK_TARGET.PAGE) {\n targetId = fbManagedPages[fbSelectedPageIdx].id;\n fbAccessToken = fbManagedPages[fbSelectedPageIdx].access_token;\n } else {\n // TODO: Error handling\n }\n\n if (mediaType === MEDIA_TYPE.LIVE_PHOTO) {\n shareFacebookVideo({\n mediaId,\n targetId,\n title: title ? title : l(DEFAULT_TITLE),\n description,\n privacy: fbPrivacy,\n fbAccessToken\n });\n } else {\n shareFacebookPanophoto({\n targetId,\n title: title ? title : l(DEFAULT_TITLE),\n panoUrl: panoSharedPhoto,\n description,\n privacy: fbPrivacy,\n fbAccessToken\n });\n }\n close();\n }", "title": "" }, { "docid": "3d574630f411bef8c2e8a750f634bf39", "score": "0.48131198", "text": "function App() {\n return (\n <div className=\"App\">\n <h1 className=\"App-title\">Facebook Auth Example</h1>\n <p className=\"App-intro\"> To get started , Authenticate with facebook </p>\n <Facebook />\n <br/>\n <Google />\n <br/>\n <Instagram />\n {/* <Github /> */}\n </div>\n );\n}", "title": "" }, { "docid": "0d467f2a999c5eed7a1ad4edf1fd5821", "score": "0.48102358", "text": "function testNotLoggedInFB() {\r\n\tconsole.log(\"not logged in\");\r\n}", "title": "" }, { "docid": "9a1e34afc2b273af85facde1c8eb81dd", "score": "0.48057893", "text": "function loadFacebookSdk(){\n window.fbAsyncInit = function() {\n FB.init({\n appId : '723683944395366',\n cookie : true,\n xfbml : true,\n version : 'v2.1'\n });\n FB.Canvas.setSize({height:600});\n setTimeout(\"FB.Canvas.setAutoGrow()\",500);\n\n if(localStorage.getItem('current_view') == 'login')\n checkLoginStatus();\n };\n\n\t(function(d, s, id) {\n\t\tvar js, fjs = d.getElementsByTagName(s)[0];\n\t\tif (d.getElementById(id)) return;\n\t\tjs = d.createElement(s); js.id = id;\n\t\tjs.src = \"//connect.facebook.net/en_US/sdk.js\";\n\t\tfjs.parentNode.insertBefore(js, fjs);\n\t}(document, 'script', 'facebook-jssdk'));\n\n}", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4797261", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4797261", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4797261", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4797261", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "b834c6296b48e26a033d95a6c33fad96", "score": "0.47970915", "text": "connectedCallback() {\n }", "title": "" }, { "docid": "b834c6296b48e26a033d95a6c33fad96", "score": "0.47970915", "text": "connectedCallback() {\n }", "title": "" }, { "docid": "20f0e0c755f46f84159c4bdccc13a862", "score": "0.4793163", "text": "_handleCallBack(result) {\n let _this = this;\n if (result.isCancelled) {\n alert(\"Login cancelled\");\n this.setState({ showSpinner: false });\n } else {\n AccessToken.getCurrentAccessToken().then(data => {\n const token = data.accessToken;\n fetch(\n \"https://graph.facebook.com/v2.8/me?fields=id,first_name,last_name,gender,birthday&access_token=\" +\n token\n )\n .then(response => response.json())\n .then(json => {\n const imageSize = 120;\n const facebookID = json.id;\n const fbImage = `https://graph.facebook.com/${facebookID}/picture?height=${imageSize}`;\n this.authenticate(data.accessToken).then(function(result) {\n const { uid } = result;\n _this.createUser(uid, json, token, fbImage);\n });\n })\n .then(() => {\n _this.props.navigation.navigate(\"Onboard\");\n })\n .catch(function(err) {\n console.log(err);\n });\n });\n }\n }", "title": "" }, { "docid": "660a966fb63a6d964935708900ffa46c", "score": "0.47732103", "text": "componentDidMount() {\n this.props.facebookLogin();\n this.onAuthComplete(this.props);\n //this code below removes the token and forgets that you have ever logged in\n // TEMP CODE TEMP CODE TEMP CODE\n AsyncStorage.removeItem('fb_token');\n }", "title": "" }, { "docid": "8c55bd3e5d85e8304972b0d45c711a07", "score": "0.47724462", "text": "async function facebook() {\n const loader = document.querySelector('#login > paper-spinner');\n const text = document.querySelector('#login > div');\n\n loader.setAttribute('style', 'display: inline');\n text.setAttribute('style', 'display: none');\n /*\n * First we check if the user is not already logged in to their facebook account and act.\n * */\n return new Promise((resolve, reject) => {\n FB.getLoginStatus((result) => {\n\n if(result.status === 'connected') {\n resolve(result);\n }\n\n FB.login((result) => {\n if(result.status === 'connected') {\n resolve(result);\n }\n else {\n reject(result);\n }\n }, {\n scope: 'public_profile, email',\n });\n });\n })\n .then(response => {\n return fetch(`${root}/access`, {\n method: 'post',\n headers: {\n 'Content-type': 'application/json',\n },\n body: JSON.stringify({\n token: response.authResponse.accessToken,\n verifier: 'facebook',\n })\n })\n .then(response => {\n if(response.ok) {\n return response.json();\n }\n\n return response.json()\n .then(error => {\n throw error;\n });\n });\n })\n .then(response => {\n localStorage.setItem('user', JSON.stringify(response.payload));\n window.location = `../dashboard`;\n })\n .catch(error => {\n console.error(error);\n /*\n * So here we will need a place to display this error to the user.\n * */\n document.querySelector('#message').innerText = error.message;\n })\n .finally(() => {\n loader.setAttribute('style', '');\n text.setAttribute('style', '');\n });\n}", "title": "" }, { "docid": "f7b6467886c0b097deb027af5b073903", "score": "0.47712946", "text": "initDesktopAlerts() {\n // Google could not be bothered to mention that\n // onTokenRefresh is never called.\n this.fbPush.onTokenRefresh(() => {\n this.requestPushToken();\n });\n\n this.fbPush.onMessage((payload) => {\n // No need to do anything about it.\n // All the magic happends in the service worker.\n });\n }", "title": "" }, { "docid": "6e2ad60af41ca97e71c967ffd3c8f7c0", "score": "0.4769475", "text": "function fb_init() {\n var firebaseConfig = {\n apiKey: \"AIzaSyBUvUMLAUUGOslx5tuXRDRTZ8a0JwyakVc\",\n authDomain: \"popthatball-9e33e.firebaseapp.com\",\n projectId: \"popthatball-9e33e\",\n storageBucket: \"popthatball-9e33e.appspot.com\",\n messagingSenderId: \"746873167398\",\n appId: \"1:746873167398:web:d75a0c2e25961806ed50e7\"\n };\n // Initialize Firebase\n firebase.initializeApp(firebaseConfig);\n debug.handler(\"fb_init | Connected to \" + firebaseConfig.projectId + \"'s Firebase Project\", \"info\")\n}", "title": "" }, { "docid": "a81cf2b02b23788eceb0c3c3ab31da96", "score": "0.47690204", "text": "function componentDidMount ()\n {\n\n }", "title": "" }, { "docid": "e65c1edf9d08aabe0bd7cbd1abddda69", "score": "0.476632", "text": "mainFrame() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "dab94bafcbbfbaf25c1ffdc23aed8c0f", "score": "0.4764832", "text": "function isFacebookApp() {\n var ua = navigator.userAgent || navigator.vendor || window.opera;\n return (ua.indexOf(\"FBAN\") > -1) || (ua.indexOf(\"FBAV\") > -1);\n }", "title": "" }, { "docid": "f805fb40aaa40b74d6653b8a1c97cb5a", "score": "0.47377387", "text": "getOffset() {\n return { top: 0, left: 0 }\n }", "title": "" }, { "docid": "057871d66a68f76ae0afd1239c65a760", "score": "0.4732816", "text": "function SetFacebookProfilePhoto( a_photoUrl : String ) \n{\n // Start a download of the given URL\n var www : WWW = new WWW (a_photoUrl);\n \n // Wait for download to complete\n yield www;\n \n // Print the error to the console\n if (www.error != null)\n {\n Debug.Log(www.error); \n }\n else\n {\n \tvar newTextureFromWeb : Texture2D = www.texture; \n \t\t\n \tm_guiTexture.texture = newTextureFromWeb; \t\n \tm_guiTexture.pixelInset = Rect (0, 0, newTextureFromWeb.width, newTextureFromWeb.height);\n }\n}", "title": "" }, { "docid": "41d4a7d37e00cc6cbe5924d90036a3eb", "score": "0.4725481", "text": "UNSAFE_componentWillUnmount() {\n }", "title": "" }, { "docid": "192c7f4897393bec26d92d50a81dff31", "score": "0.47230422", "text": "componentDidMount() {\n BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);\n AppState.addEventListener('change', this.handleAppStateChangeAsync);\n }", "title": "" }, { "docid": "810d1faae2a0d67b19c736cd5b8501a6", "score": "0.47207567", "text": "function FBClass() {}", "title": "" }, { "docid": "d9b9cbd3c348df8519f94b2f3f4d014b", "score": "0.47152877", "text": "function onHostCode() {\n\n}", "title": "" }, { "docid": "adbede3f5d8b9a4e5ea2d69880cd947c", "score": "0.47114328", "text": "componentWillUnmount() {\n \n }", "title": "" }, { "docid": "9ba5d515ff58556bdc5dc6d7f6c05a5e", "score": "0.47084987", "text": "function FBJSFlowConfig()\n{\n}", "title": "" }, { "docid": "f00245647c54b16ac606bb0431d44104", "score": "0.46966588", "text": "contextLostCallback () {\n\t}", "title": "" }, { "docid": "4483f17ca48eb0497fb24a1dd6ac33d5", "score": "0.46918893", "text": "shareFacebook() {\n this._qs(\".facebook\").addEventListener(\"click\", () => {\n window.open(\n `http://www.facebook.com/sharer/sharer.php?u=${window.location.href}`\n );\n });\n }", "title": "" }, { "docid": "d934d002c943d5f917c127e59afb618f", "score": "0.46861684", "text": "componentDidMount() {\n \n }", "title": "" }, { "docid": "d934d002c943d5f917c127e59afb618f", "score": "0.46861684", "text": "componentDidMount() {\n \n }", "title": "" }, { "docid": "da8b4437f295ad271d7a92101377626f", "score": "0.46858335", "text": "connectedCallback () {\n\n }", "title": "" }, { "docid": "a6507de220f93eb9f18abbc1f353d91b", "score": "0.46808046", "text": "export () {\n\n }", "title": "" }, { "docid": "f9a1f634afc0257ba4e62a95c4b8d269", "score": "0.46753427", "text": "didMount () {}", "title": "" }, { "docid": "f9a1f634afc0257ba4e62a95c4b8d269", "score": "0.46753427", "text": "didMount () {}", "title": "" }, { "docid": "0fcaa2637ea8545d7e6116ae65d7d865", "score": "0.4674228", "text": "componentDidMount() { }", "title": "" }, { "docid": "0fcaa2637ea8545d7e6116ae65d7d865", "score": "0.4674228", "text": "componentDidMount() { }", "title": "" }, { "docid": "0fcaa2637ea8545d7e6116ae65d7d865", "score": "0.4674228", "text": "componentDidMount() { }", "title": "" }, { "docid": "263250436906782ed057c05478a8b21d", "score": "0.46659693", "text": "getSignature() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "3fed7353e5f4b4951c7896b16d13779f", "score": "0.4662041", "text": "function login_facebook() {\r\n FB.login((response) => {\r\n \"use strict\";\r\n if (response.status == 'connected'){\r\n FB.api(\"/me\",{locate : \"vn_VN\", fields : \"name,email,gender\"}, (res) => {\r\n send_data_to_server(res, base_url(\"/user/login_facebook/\"), true);\r\n localStorage.setItem(\"type_login\",\"facebook\");\r\n });\r\n }else {\r\n\r\n }\r\n });\r\n}", "title": "" }, { "docid": "43ef43c395a87212e5103b89e1c9ee65", "score": "0.46608022", "text": "static get version() { return SDK_VERSION; }", "title": "" }, { "docid": "7c78024490d9e731bf34a3288e4d7c0e", "score": "0.46597075", "text": "componentDidMount() {\r\n }", "title": "" }, { "docid": "358ce06d50f62d4f3dfe7a3e514759cc", "score": "0.46592137", "text": "function massage(warning,frames){var message=stripInlineStacktrace(warning);// Reassemble the stack with full filenames provided by React\nvar stack='';var lastFilename=void 0;var lastLineNumber=void 0;for(var index=0;index<frames.length;++index){var _frames$index=frames[index],fileName=_frames$index.fileName,lineNumber=_frames$index.lineNumber;if(fileName==null||lineNumber==null){continue;}// TODO: instead, collapse them in the UI\nif(fileName===lastFilename&&typeof lineNumber==='number'&&typeof lastLineNumber==='number'&&Math.abs(lineNumber-lastLineNumber)<3){continue;}lastFilename=fileName;lastLineNumber=lineNumber;var name=frames[index].name;name=name||'(anonymous function)';stack+='in '+name+' (at '+fileName+':'+lineNumber+')\\n';}return{message:message,stack:stack};}", "title": "" }, { "docid": "124e3c9456947f8fa80c337879be3cd1", "score": "0.4651272", "text": "componentDidMount() {\n \n }", "title": "" }, { "docid": "124e3c9456947f8fa80c337879be3cd1", "score": "0.4651272", "text": "componentDidMount() {\n \n }", "title": "" }, { "docid": "dfb7ca0e1d7e2926714cb07158174358", "score": "0.46512535", "text": "onNativeResume() {\n //TODO: Implement this if required\n }", "title": "" }, { "docid": "ece6b1f0cab46b10de214a0a99eda907", "score": "0.4646555", "text": "connectedCallback() {\n }", "title": "" }, { "docid": "01740de8128ca06c6f898bbd71fc0bef", "score": "0.46455583", "text": "connectedCallback() {\n\n }", "title": "" } ]
2030b91b989a5eb24f50bb1fdb217f0c
Pulls the current user's ID from the "Students" collection in Firestore.
[ { "docid": "4a685be39706857d10ae33a59e321bc1", "score": "0.749219", "text": "function getCurrentUser() {\n firebase.auth().onAuthStateChanged(function (somebody) {\n if (somebody) {\n db.collection(\"Students\")\n .doc(somebody.uid)\n .get()\n .then(function (doc) {\n // Extract the current user's ID\n userID = doc.id;\n pullQuests()\n });\n }\n });\n}", "title": "" } ]
[ { "docid": "78af41aef988991ef9def299004f4832", "score": "0.7350099", "text": "function getCurrentUser() {\n firebase.auth().onAuthStateChanged(function (somebody) {\n if (somebody) {\n db.collection(\"Students\")\n .doc(somebody.uid)\n .get()\n .then(function (doc) {\n // Extract the current user's ID\n userID = doc.id;\n pullPendingQuests()\n });\n }\n });\n}", "title": "" }, { "docid": "5a6689f5795b1ae5d17f70e3e188fe09", "score": "0.6899085", "text": "function getCurrentStudent() {\n firebase.auth().onAuthStateChanged(function (somebody) {\n if (somebody) {\n db.collection(\"Students\").doc(somebody.uid)\n // Read\n .get()\n .then(function (doc) {\n userID = doc.id;\n getProfileInfo();\n getRecentlyApprovedQuests();\n });\n }\n });\n}", "title": "" }, { "docid": "a956dedd52377a62cf4f5b84279b7d94", "score": "0.68655634", "text": "function getCurrentStudent() {\n firebase.auth().onAuthStateChanged(function (somebody) {\n if (somebody) {\n db.collection(\"Students\")\n .doc(somebody.uid)\n // Read\n .get()\n .then(function (doc) {\n // Extract the current student's class name\n userName = doc.data().Student_Name;\n className = doc.data().Student_Class;\n educatorID = doc.data().Student_Educator;\n userID = doc.id;\n if (className == null) {\n // Display a message on the page if the student isn't in a class\n displayMessage();\n }\n getQuestIDs();\n });\n }\n });\n}", "title": "" }, { "docid": "8c347bc3088bcdeacd5f70ede6caa9bb", "score": "0.66435117", "text": "getUser(){\n return new Promise(resolve => { \n var firestore = fire.firebase_.firestore();\n const settings = {timestampsInSnapshots: true};\n firestore.settings(settings);\n fire.firebase_.auth().onAuthStateChanged(function(user) {\n if (user) {\n firestore.collection(\"users\").doc(fire.firebase_.auth().currentUser.uid).get().then((doc) => {\n let data = doc.data()\n data.id = doc.id\n resolve(data)\n }).catch((err)=>{\n resolve({'status': 'error', 'error': err})\n })\n } else {\n // No user is signed in.\n }\n });\n })\n }", "title": "" }, { "docid": "f9e5993899d8991400b751319c5e67a5", "score": "0.64769536", "text": "function getUserID() {\n return firebase.auth().currentUser.uid;\n}", "title": "" }, { "docid": "6269d3885515ff89f89f0a75f77673c4", "score": "0.6433053", "text": "function getUserId() {\n return firebase.auth().currentUser.uid;\n }", "title": "" }, { "docid": "60c79d5a457344bc5759daecb41440df", "score": "0.64115494", "text": "function getUserId() {\n return firebase.auth().currentUser.uid;\n}", "title": "" }, { "docid": "60c79d5a457344bc5759daecb41440df", "score": "0.64115494", "text": "function getUserId() {\n return firebase.auth().currentUser.uid;\n}", "title": "" }, { "docid": "48d4301a6ea3afb46bca7e180473ddc1", "score": "0.6309353", "text": "getMyUserId() {\n if (firebase.auth() &&\n firebase.auth().currentUser &&\n firebase.auth().currentUser.uid) {\n return firebase.auth().currentUser.uid;\n }\n throw new Error(\"Unable to get current user ID\");\n }", "title": "" }, { "docid": "e6484a2821359ddb8c19e533c7bc2519", "score": "0.6159651", "text": "getAuthUserId(){\n let user = this.getAuthUser();\n\n return (Utility.isObject(user) && user.id) ? user.id : 0;\n }", "title": "" }, { "docid": "e02e6955068a8058fdc657013e732649", "score": "0.6123042", "text": "function getUserId() {\n if (!isAuthenticated()) {\n return null;\n }\n\n return $rootScope.user.idTeacher;\n }", "title": "" }, { "docid": "4b309b1d707fc97f84095f3c9856ef69", "score": "0.6112587", "text": "function getCurrentUserId() {\n var ctx = loopback.getCurrentContext();\n var currentUser = ctx && ctx.get('currentUser');\n //console.log('currentUser.id: ', currentUser.id);\n var userId = currentUser && currentUser.id;\n return userId;;\n }", "title": "" }, { "docid": "f12bd4417d4b57c1a39e4e6ab9df7379", "score": "0.6096973", "text": "function getUserId() {\n let user = firebase.auth().currentUser;\n return (user && !user.isAnonymous) ? user.uid : null;\n}", "title": "" }, { "docid": "3d84592da56c14a1cf51b3408dfba093", "score": "0.60114825", "text": "function getCurrentUserId () {\r\n return currentUserId;\r\n}", "title": "" }, { "docid": "552279bace86a1624a5638e90b44fcb1", "score": "0.5996677", "text": "getUserId() {\n\t\treturn this.auth.getTokenProp('id');\n\t}", "title": "" }, { "docid": "943e09c0d1ca3850eeee8422beb91417", "score": "0.5974668", "text": "function getUID() {\n return firebase.auth().currentUser.uid;\n}", "title": "" }, { "docid": "c672e248f68ad88ba1dee11b59b9a738", "score": "0.59292036", "text": "function getUserId (){\n let user = parseToken();\n return user._id;\n}", "title": "" }, { "docid": "bc0b68755f5956f85aa7508de13a8435", "score": "0.58719593", "text": "get uid() {\n return (firebase.auth().currentUser || {}).uid;\n }", "title": "" }, { "docid": "bda59ffbe7d9b5c5930219569c85803f", "score": "0.58648545", "text": "getClassesStudents(){\n return new Promise(resolve => { \n var firestore = fire.firebase_.firestore();\n const settings = {timestampsInSnapshots: true};\n firestore.settings(settings);\n firestore.collection(\"classes\").where('students.'+fire.firebase_.auth().currentUser.uid, '==', true).where('deleted', '==', 0).get().then((querySnapshot) => {\n // Return the array of students\n let result = querySnapshot.docs.map(function (documentSnapshot) {\n let data = documentSnapshot.data()\n data.id = documentSnapshot.id\n return data\n })\n resolve(result)\n }).catch((err)=>{\n resolve({'status': 'error', 'error': err})\n })\n })\n }", "title": "" }, { "docid": "fbee4ca4992c7e901fb699646dd008ca", "score": "0.5785817", "text": "getUserId()\n {\n\t\treturn this.getData().userId;\n\t}", "title": "" }, { "docid": "5489334f0fb8bfa00a21a8bf6df548b0", "score": "0.57734036", "text": "async getInfoUser(docrefId) {\n try {\n const docRef = await this.db\n .collection(\"userPersonalInformation\")\n .doc(docrefId);\n const data = await docRef.get();\n const response = data.data();\n return response;\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "dc7f6cc6eae53a651499c33317655a0e", "score": "0.5715291", "text": "function getUserId() {\n var person = Plus.People.get('me');\n return person.getId();\n }", "title": "" }, { "docid": "87b98005098bf9b5444b2f18ae408333", "score": "0.57037276", "text": "function getCurrentUserId() {\n return _spPageContextInfo.userId;\n}", "title": "" }, { "docid": "f71879f93dc4cdd4f8118793d556e5d4", "score": "0.5694598", "text": "function currentUser(id) {\r\n return users.find(user => user.id === id);\r\n}", "title": "" }, { "docid": "96a17b260de082331d401e8a09a72e53", "score": "0.5692246", "text": "function getUserId(){\n return _userId;\n }", "title": "" }, { "docid": "63b5ef5791b046d25a79479bd412a858", "score": "0.56543225", "text": "GetStudents() {\n return this._fire.collection('students');\n }", "title": "" }, { "docid": "fc04718535c84a76f494347a2347c385", "score": "0.5627585", "text": "function getCurrentUserId() {\r\n /* We need to fill in the currentUserID variable,\r\n otherwise on when app is launched (no ID in local or session storage),\r\n this value will be null and the database function in updateDateRangeDatesInCalendarEvents() will lack arguments and fail calendar creation.\r\n Calendar will not be able to update after login, because it hasn't been created properly.\r\n */\r\n let currentUserID = \"no ID\"; \r\n if (sessionStorage.getItem(\"userID\")) { currentUserID = sessionStorage.getItem(\"userID\"); }\r\n else if (localStorage.getItem(\"userID\")) { currentUserID = localStorage.getItem(\"userID\"); }\r\n return currentUserID;\r\n }", "title": "" }, { "docid": "860f13a792628a38fa282befbbb411cb", "score": "0.5623009", "text": "function getUserId() {\n return store.getState().user.id;\n}", "title": "" }, { "docid": "b26fa13c443788062c293fe84e3f56b0", "score": "0.5591617", "text": "function getUserId() {\n return localStorage.getItem(localStorageUserIdName);\n}", "title": "" }, { "docid": "dbf19c4fd29e3ef3099a6cc2f5174744", "score": "0.55864394", "text": "async function getUserById(id) {\n const db = getDBReference();\n const collection = db.collection('users');\n const data = await collection.find({\"_id\": new ObjectId(id)}).toArray();\n return data[0];\n}", "title": "" }, { "docid": "31b132d4f583fba81decfc2c3a7c0fe2", "score": "0.5557889", "text": "getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }", "title": "" }, { "docid": "31b132d4f583fba81decfc2c3a7c0fe2", "score": "0.5557889", "text": "getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }", "title": "" }, { "docid": "31b132d4f583fba81decfc2c3a7c0fe2", "score": "0.5557889", "text": "getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }", "title": "" }, { "docid": "897419aaca9a98ed165f1d6237f302d9", "score": "0.5543602", "text": "function getUserId(){\n\tindexRef.once('value', function(snapshot) {\n\t snapshot.forEach(function(childSnapshot) {\n\t var childKey = childSnapshot.key;\n\t var childData = childSnapshot.val();\n\t var currentUser = firebase.auth().currentUser;\n\t console.log(childSnapshot);\n\t // ...\n\n\t if(childData==currentUser.email){\n\t \tconsole.log('FOUND!: ', currentUser.email,childKey);\n\t \tconsole.log('SHOWDATA: current user: ',childKey);\n\t \tuserid = childKey;\n\t \tshowUserData(childKey);\n\t }\n\t });\n\t console.log('NOT FOUND!: ');\n\t});\n}", "title": "" }, { "docid": "db51058e70ba6916aba6389aa2dba411", "score": "0.5537439", "text": "getUserId() {\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n const uid = user.uid;\n this.setState({ uid: uid });\n this.getUserGuides();\n }\n this.getTopGuides();\n });\n }", "title": "" }, { "docid": "f85d2b5ca8876c8bfd86d404657dc29f", "score": "0.5519665", "text": "getCurrentUserId(quotaInfo) {\n return this._get('/users/__SELF__', undefined, quotaInfo)\n .then((response) => {\n if (response.type !== 'User') { throw new Error(`Unexpected response type: ${response.type}`); }\n if (response.count !== 1) { throw new Error(`Incorrect count of users returned: ${response.count}`); }\n return response.results[0].user_id; // extract user info\n });\n }", "title": "" }, { "docid": "eef8cb02d47116390e1f43304bf6885d", "score": "0.55071163", "text": "function findThisUserById(req, res, next) {\n User.findOne({_id: req.params.userId}, function(err, currentUser) {\n // if (err) throw err;\n req.currentUser = currentUser;\n next();\n });\n}", "title": "" }, { "docid": "23b3f6462be6333c7b480e2093d499d7", "score": "0.54989254", "text": "function getUser() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n //console.log(\"user is signed in\");\n db.collection(\"users\")\n .doc(user.uid)\n .get()\n .then(function (doc) {\n var n = doc.data().name;\n //console.log(n);\n $(\"#username\").text(n);\n })\n } else {\n console.log(\"no user is signed in\");\n }\n })\n}", "title": "" }, { "docid": "c90c15bed11c673804a8de02c64489f8", "score": "0.54970825", "text": "userId() {\n if (this._userIdDeps) this._userIdDeps.depend();\n return this._userId;\n }", "title": "" }, { "docid": "193d977c5f2ca497fa4dffb35736e4a5", "score": "0.54883516", "text": "function getId() {\r\n 'use strict';\r\n var idCollection = [];\r\n\r\n for (var i = 0; i < $scope.users; i++) {\r\n idCollection.push($scope.users[i].id);\r\n }\r\n\r\n return Math.max.apply(null, idCollection);\r\n }", "title": "" }, { "docid": "40d1788e3c4e6720866b2ffe1644ee91", "score": "0.5486965", "text": "function SCORM_GetStudentID(){\n WriteToDebug(\"In SCORM_GetStudentID\");\n SCORM_ClearErrorInfo();\n return SCORM_CallLMSGetValue(\"cmi.core.student_id\");\n}", "title": "" }, { "docid": "2bd0a4f4649c342a16c26258d7edfdd7", "score": "0.54839903", "text": "getUser (id) {\n return this.users.filter((user) => user.id === id)[0]\n }", "title": "" }, { "docid": "08c145704fed9d51d0f0e06d74129ae1", "score": "0.54833907", "text": "function getID() {\n const existingUsers = users.filter(user => (user.email === email && user.password === password))\n return existingUsers[0].id\n }", "title": "" }, { "docid": "b337d22322fc5708640e162049d7ad53", "score": "0.54792607", "text": "async function getDrawerID() {\n if (Meteor.userId() === null) {\n return await getAnonDrawerID();\n } else {\n return await getUserDrawerID();\n }\n}", "title": "" }, { "docid": "6def0614ce7548cd33d523fb90cf17c3", "score": "0.54741096", "text": "get userID(){\n let data=this.store.peekAll('user-detail');\n let id;\n data.forEach(element => {\n id=element.id;\n });\n console.log(id);\n return id;\n }", "title": "" }, { "docid": "cd1c2e989452e0f19ceb946e0960520b", "score": "0.54714096", "text": "getUid() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const user = yield this.auth.currentUser;\n if (user === null) {\n return null;\n }\n else {\n return user.uid;\n }\n });\n }", "title": "" }, { "docid": "c531d94ee2af324dbe40c11ad7df2378", "score": "0.546938", "text": "function getUser(id) {\n return sq.sync().then(() => users.findOne({\n where: {\n google_id: id\n }\n }));\n}", "title": "" }, { "docid": "b39d1b7c9b3788de5cef6d9af1f57370", "score": "0.54455835", "text": "async function getID() {\n \treturn new Promise(resolve => {\n \tauthDB.find( {}, function (err, docs) {\n \t\tconsole.log(docs);\n \t\tif (docs[0] == undefined) {resolve(null)} else {\n \t\t\tresolve(docs[0].clientID)\n \t\t}\n \t})\n \t})\n}", "title": "" }, { "docid": "c97f0c9ea9190e78dec411e34104c720", "score": "0.54425806", "text": "extractUserId()\n {\n\t\treturn this.getUserId() || '';\n\t}", "title": "" }, { "docid": "262b18a6f57e3d897e5f5def92c4f066", "score": "0.5434401", "text": "function getUser() {\n return currentUser;\n }", "title": "" }, { "docid": "5333ebb1def7533b4f088256b391d224", "score": "0.5412849", "text": "function loggedUserData(loggedIdofUser) {\n let userDetails = db.collection(\"usersDetails\").doc(loggedIdofUser);\n\n userDetails.get().then((doc) => {\n if (doc.exists) {\n // console.log(\"Document data:\", doc.data());\n let theId = doc.data().userId;\n let userName = doc.data().username;\n let email = doc.data().email;\n let userType = doc.data().userType;\n let saccoName = doc.data().saccoName;\n\n document.getElementById('userName').innerHTML = userName + \" (\" + userType + ')';\n\n\n\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n // ..report error\n messageDiv.classList.remove('d-none');\n theMessageContent.innerHTML = 'user does not exist';\n refreshPage(5);\n }\n }).catch((error) => {\n console.log(\"Error getting document:\", error);\n // ..report error\n messageDiv.classList.remove('d-none');\n theMessageContent.innerHTML = 'Error getting document';\n refreshPage(5);\n });\n\n\n\n}", "title": "" }, { "docid": "8158795c70bc64f4229619e0a8d50fc1", "score": "0.5408218", "text": "componentDidMount() {\n this.unsubscribeFromAuth = auth.onAuthStateChanged(async userAuth => {\n\n // checking that there is a user logged in\n if (userAuth) {\n const userRef = await createUserProfileDocument(userAuth);\n\n // here we instantiate userRef and call the method 'onSnapshot' on it.\n // what we get back is the snapshot data. \n // we then set the state to the snapshot data with the id and call .data() on\n // the snapshot in order to see the data we need therefore setting a new object of the data.\n // basically listening for any changes and updating and setting the data.\n userRef.onSnapshot(snapShot => {\n this.setState({\n currentUser: {\n id: snapShot.id,\n ...snapShot.data()\n }\n })\n })\n } else {\n this.setState({currentUser: userAuth})\n }\n // console.log(user); \n // this shows the whole Google object\n // --interesting!\n \n \n\n });\n }", "title": "" }, { "docid": "9c5c0cdd105fdb9b3f23669a7acc5e6d", "score": "0.5404968", "text": "_user(trelloUserId) {\n if (trelloUserId && this.members[trelloUserId]) {\n return this.members[trelloUserId];\n }\n return Meteor.userId();\n }", "title": "" }, { "docid": "3f63a54fa0cc6e443eef19cd55fddb72", "score": "0.54017955", "text": "function SCORM_GetStudentID(){\t\r\n\tWriteToDebug(\"In SCORM_GetStudentID\");\r\n\tSCORM_ClearErrorInfo();\r\n\treturn SCORM_CallLMSGetValue(\"cmi.core.student_id\");\r\n}", "title": "" }, { "docid": "b1e2ee526a1a90d45a666958f1bdf05e", "score": "0.53875226", "text": "function getUserId(context) {\n const Authorization = context.request.get('Authorization');\n if (Authorization) {\n const token = Authorization.replace('Bearer ', '');\n const { userId } = jwt.verify(token, APP_SECRET);\n return userId;\n }\n\n throw new UserNotAuthenticated();\n}", "title": "" }, { "docid": "f79966a2f44b761646f6365666e762ab", "score": "0.5387383", "text": "getUser(id) {\n return this.userResource.getSingle({ id: id });\n }", "title": "" }, { "docid": "948930ae35609875c34454e21630e35b", "score": "0.5386628", "text": "async function getUser() {\n const uid = user.uid;\n const db = firebase.firestore().collection(\"users\");\n const snapshot = await db.where(\"id\", \"==\", uid).get();\n if (snapshot.empty) {\n alert(\"no matching\");\n } else {\n snapshot.forEach((doc) => {\n setYou(doc.data().userName);\n });\n }\n }", "title": "" }, { "docid": "671d8772286c9281f4159db03ddecf07", "score": "0.53865635", "text": "async function getUserId() {\n\t\tlet url = `/getDetails?userName=${loggerEmail}`;\n\t\treturn await fetch(url)\n\t\t\t.then((response) => response.json())\n\t\t\t.then((data) => {\n\t\t\t\tsetUserData(data);\n\t\t\t\tsetUserId(data.id);\n\t\t\t});\n\t}", "title": "" }, { "docid": "2fd1fdb63c33edce04835eb33e7269ca", "score": "0.53737915", "text": "getUser(id) {\n\t\treturn this.users.filter((user) => user.id === id)[0];\n\t}", "title": "" }, { "docid": "cd37309bca58ed274e93b2935ff279aa", "score": "0.5369406", "text": "function _getUserId(req) {\n let userId = req.user.id\n\n if (req.user.role == 'admin') {\n userId = req.body.userId\n }\n\n return userId\n}", "title": "" }, { "docid": "c2dc397379464496659287494d4e62d4", "score": "0.5360543", "text": "function getCurrentUser () {\n return User.findUserById(1);\n}", "title": "" }, { "docid": "e4084059c7aba06b637b024cac280560", "score": "0.53554744", "text": "function getCurrentUserID(p_session) {\n\t\n\t// Load the first user by default if no user has been selected\n\tif(p_session.userData.currentUser == null) {\n\t\tp_session.userData.currentUser = customerData.customers[0].id;\n\t}\n\t\n\treturn p_session.userData.currentUser;\n}", "title": "" }, { "docid": "43a4856a767acb52de967d2c4c1a29d9", "score": "0.53418744", "text": "get firstElementId() {\n const listKeys = Object.keys(this.usersList);\n if (listKeys.length) {\n const { id } = this.usersList[listKeys[0]];\n return id;\n }\n return null;\n }", "title": "" }, { "docid": "48b80c5f5539edf8a484dd794ed31467", "score": "0.53373784", "text": "async function getUser({userId}) {\n return await users.findOne({_id: ObjectID(userId)})\n }", "title": "" }, { "docid": "5ab6e25484e22d63cf20acd872035021", "score": "0.5326396", "text": "get userId() { return this.user ? this.user.id : null }", "title": "" }, { "docid": "3e80653e9634f6d2ce384b8524978d8d", "score": "0.53251487", "text": "function getcurrentuser(id){\r\n\r\n return users.find(user=> user.id === id);\r\n}", "title": "" }, { "docid": "144ad6641391177da6049907219edcaf", "score": "0.5324298", "text": "async getUserById(id) {\n const userCollection = await users();\n const user = await userCollection.findOne({ _id: id });\n if (!user) throw \"User not found\";\n return user;\n }", "title": "" }, { "docid": "1b2fa85f109a07f27c4df424d7a59380", "score": "0.5310778", "text": "getUserInfo(uid) {\n console.log('getUserInfo');\n const path = 'Cliente';\n this.suscriberUserInfo = this.firestoreService.getDoc(path, uid).subscribe(res => {\n this.cliente = res;\n });\n }", "title": "" }, { "docid": "05a36dda2bedf0169530815048daa981", "score": "0.5303483", "text": "function getCurrentUser(id){\n return users.find(user => user.id===id)\n}", "title": "" }, { "docid": "9feacfb56e922b9f659b46323ec3f9f0", "score": "0.52959", "text": "getUser() {\n return this.auth.currentUser();\n }", "title": "" }, { "docid": "cf72fe218b80ab25d1f1066290d3be9d", "score": "0.5295634", "text": "function getUserId(context) {\r\n const Authorization = context.request.get('Authorization')\r\n if (Authorization) {\r\n const token = Authorization.replace('Bearer ', '')\r\n const { userId } = jwt.verify(token, APP_SECRET)\r\n return userId\r\n }\r\n\r\n throw new Error('Not authenticated')\r\n}", "title": "" }, { "docid": "f71421beace4dac01778856c56244679", "score": "0.5256357", "text": "getClassesTeachers(){\n return new Promise(resolve => {\n var firestore = fire.firebase_.firestore();\n const settings = {timestampsInSnapshots: true};\n firestore.settings(settings);\n // Get classes where the teachers is in the teachers list\n firestore.collection(\"classes\").where('teachers.'+fire.firebase_.auth().currentUser.uid, '==', true).where('deleted', '==', 0).get().then((querySnapshot) => {\n let result = querySnapshot.docs.map(function (documentSnapshot) {\n let data = documentSnapshot.data()\n data.id = documentSnapshot.id\n return data\n })\n resolve(result)\n }).catch((err)=>{\n resolve({'status': 'error', 'error': err})\n })\n })\n }", "title": "" }, { "docid": "353a4cfaf45dc904662ce1c27d474d5b", "score": "0.52541447", "text": "function LMSGetStudentID()\n{\n\treturn(GetValue(\"cmi.learner_id\"))\n}", "title": "" }, { "docid": "09b02bbc8d562c353564435a4c500832", "score": "0.525414", "text": "function getCurrentUser(id) {\n return users.find(user => user.id === id);\n}", "title": "" }, { "docid": "f3c78d5dcd921d54f08340cfaf9cea61", "score": "0.52504855", "text": "async getUserId(headers) {\n const response = await fetch(`${restSpotify}/me`,headers);\n\n if (response.ok) {\n const jsonResponse = await response.json();\n return jsonResponse.id;\n }\n\n throw new Error('Failed to get user id');\n }", "title": "" }, { "docid": "4714fc0774a91f9e1a793254b5fcd09f", "score": "0.52501506", "text": "function updateUsers() {\n\n firestore.collection(\"student\").get().then(function(querySnapshot) {\n querySnapshot.forEach(function(doc) {\n // doc.data() is never undefined for query doc snapshots\n console.log(doc.id, \" => \", doc.data());\n const thisUser = doc.data();\n\n if (thisUser.university == null) {\n firestore.doc(\"student/\" + thisUser.uid).update({\n name: \"Testing Account\",\n age: 21,\n averageRating: 3.5,\n bio: \"Hi I'm a testing account\",\n studentEmail: \"email@unimeet.com\",\n personalEmail: \"myEmail@gmail.com\",\n mobile: \"0400 123 456\",\n university: \"RMIT University\",\n current_degree: \"Bachelor of Information Technology\",\n course_1: \"Programming Project 1\",\n course_2: \"Networking 1\",\n course_3: \"Web Programming\",\n course_4: \"User-centred Design\",\n interest_1: \"Art\",\n interest_2: \"Movies\",\n interest_3: \"Reading\"\n }).then(function () {\n console.log(\"Successfully Updated Profile.\");\n }).catch(function (error) {\n console.log(\"Profile Update Error: \", error);\n });\n }\n });\n });\n\n\n\n}", "title": "" }, { "docid": "e80b76851069d9559ab6ebf184a8f337", "score": "0.5248901", "text": "function getCurrentUser(id){\n return users.find(user=>user.id==id);\n}", "title": "" }, { "docid": "0b466762167736158ff5ec695187a52b", "score": "0.5243327", "text": "async function getUser() {\n if (props.user === \"student\") {\n const { data: { id } } = await API.getStudentData();\n setUserState(id);\n }\n }", "title": "" }, { "docid": "f2f48c211dfcefb43faa599694ef62b1", "score": "0.5231241", "text": "function sayHello() {\n firebase.auth().onAuthStateChanged(function (somebody) {\n if (somebody) {\n db.collection(\"users\")\n .doc(somebody.uid)\n .get() //READ !!!\n .then(function (doc) {\n var n = doc.data().name;\n $(\"#name-goes-here\").text(n);\n // get other things and do other things for this person\n })\n }\n })\n}", "title": "" }, { "docid": "1d097af1b558f973b9ddf900fce56487", "score": "0.52290505", "text": "function findThisUserById(req, res, next) {\n User.findOne({_id: req.body.userToAdd}, function(err, currentUser) {\n // if (err) throw err;\n req.currentUser = currentUser;\n next();\n });\n}", "title": "" }, { "docid": "85c8c0cc977170aa23e4b714694ec88e", "score": "0.52285314", "text": "function getCurrentUserId()\r\n{\r\n (function(){ // Import GET Vars\r\n document.$_GET = [];\r\n var urlHalves = String(document.location).split('?');\r\n if(urlHalves[1]){\r\n var urlVars = urlHalves[1].split('&');\r\n for(var i=0; i<=(urlVars.length); i++){\r\n if(urlVars[i]){\r\n var urlVarPair = urlVars[i].split('=');\r\n document.$_GET[urlVarPair[0]] = urlVarPair[1];\r\n }\r\n }\r\n }\r\n })();\r\n \r\n currentUserId = parseInt(document.$_GET['userId']);\r\n}", "title": "" }, { "docid": "bf7aaf8bde2af918f78c636bcf6b2c87", "score": "0.5226864", "text": "function getStudentById(id) {\n return students.find(student => student.id == id);\n}", "title": "" }, { "docid": "1d129a339b860789f646f58de84d85bf", "score": "0.52261114", "text": "function getUserById(id, callback){\n mongoClient.connect(dbUrl, { useUnifiedTopology: true }, (err, dbHost) => {\n if (err) {\n console.error(\"Error connecting to the server\");\n }\n else {\n var db = dbHost.db(dbName);\n db.collection(collectionName, (err, coll) => {\n if (err) {\n console.error(\"Error connecting to the collection\");\n }\n else {\n coll.findOne({ id },(err, res) => {\n if (err) {\n console.error(\"Error while fetching user\");\n }\n else {\n callback(res);\n }\n });\n }\n })\n }\n })\n}", "title": "" }, { "docid": "0436fb640df6b27f73037b8140b125cd", "score": "0.5223608", "text": "async function getStudentListParentID(parentID) {\n var studentList = await studentModel.aggregate([{\n '$match': {\n 'parentID': parentID\n }\n }, {\n '$lookup': {\n 'from': 'users',\n 'localField': 'userID',\n 'foreignField': 'userID',\n 'as': 'userData'\n }\n }, {\n '$unwind': {\n 'path': '$userData',\n 'preserveNullAndEmptyArrays': true\n }\n }, {\n '$lookup': {\n 'from': 'studentMembers',\n 'localField': 'userID',\n 'foreignField': 'studentID',\n 'as': 'sectionIdentity'\n }\n }, {\n '$unwind': {\n 'path': '$sectionIdentity',\n 'preserveNullAndEmptyArrays': true\n }\n }, {\n '$lookup': {\n 'from': 'sections',\n 'localField': 'sectionIdentity.sectionID',\n 'foreignField': 'sectionID',\n 'as': 'section'\n }\n }, {\n '$unwind': {\n 'path': '$section',\n 'preserveNullAndEmptyArrays': true\n }\n }, {\n '$lookup': {\n 'from': 'ref_section',\n 'localField': 'section.sectionName',\n 'foreignField': 'sectionName',\n 'as': 'sectionName'\n }\n }, {\n '$unwind': {\n 'path': '$sectionName',\n 'preserveNullAndEmptyArrays': true\n }\n }, {\n '$project': {\n 'userID': 1,\n 'firstName': '$userData.firstName',\n 'middleName': '$userData.middleName',\n 'lastName': '$userData.lastName',\n 'gradeLvl': '$sectionName.gradeLvl',\n '_id': 0\n }\n }]);\n\n return studentList;\n}", "title": "" }, { "docid": "0458fed0fb09c0262fcff928a29fb4d6", "score": "0.52118677", "text": "getData(user, callback) { \n \n //find out the doc id of the user\n fire\n .firestore()\n .collection(\"users\")\n .where(\"userData.uid\", \"==\", user)\n .get()\n .then(function(querySnapshot) {\n querySnapshot.forEach(function(doc) {\n // doc.data() is never undefined for query doc snapshots\n console.log(doc.id, \" => \", doc.data());\n\n //get the data and watch it \n fire.firestore()\n .collection(\"users\")\n .doc(doc.id)\n .onSnapshot(function(doc) {\n // console.log(\"Current data: \", doc.data());\n let dataObj = doc.data();\n callback(dataObj);\n });\n\n });\n })\n .catch(function(error) {\n console.log(\"Error getting documents: \", error);\n });\n\n\n }", "title": "" }, { "docid": "4ce79776350fdac82014a20446b15c3d", "score": "0.52117026", "text": "async getUser(_id) {\n if(!_id) throw \"You must provide an id to search for a user\";\n \n const userCollection = await usersList();\n const listOfUsers = await userCollection.find({ _id: _id }).limit(1).toArray();\n if (listOfUsers.length === 0) throw \"Could not find user with username \" + _id;\n \n return listOfUsers[0];\n \n \n }", "title": "" }, { "docid": "2f7f43ae403f374847e067cbaf50ea73", "score": "0.52076685", "text": "function getUserID() {\n if (global_userObj) {\n return global_userObj.objectId;\n }\n return null;\n}", "title": "" }, { "docid": "e36ab1a18ee0a159e7c4241e833505ad", "score": "0.52030313", "text": "getUserId() {\n return this.getItem(defaults.user_storage_key);\n }", "title": "" }, { "docid": "aae102fe351118f3a5fc25f4e78f37ee", "score": "0.5202641", "text": "getUserFromClient(client) {\n return Users.findOne({ where: { id: client.userId } });\n }", "title": "" }, { "docid": "e3c6a56ea0d7e6f8226d6d3611af7e74", "score": "0.51939464", "text": "function selectuser(req, res, next) {\n db.collection('usersCollection').findOne({\n name: req.body.user\n }).then(data => {\n req.session.currentUser = data._id;\n console.log(req.session.currentUser)\n res.redirect('/main');\n }).catch(() => {\n res.redirect('/selectuser')\n })\n}", "title": "" }, { "docid": "8671e23ac5c6937fc0541bff2639a9b2", "score": "0.51869893", "text": "getUserID() {\n return this.userID;\n }", "title": "" }, { "docid": "bc0b9ab5812c244ae1a48c75b3e1d348", "score": "0.5186021", "text": "function get_Current_User(id) {\n return c_users.find((p_user) => p_user.id === id);\n}", "title": "" }, { "docid": "95baa2e41d0deadd3d4081fd1dda6870", "score": "0.5185622", "text": "function getUserId() {\n var result = null;\n $.ajax('./getUser', {\n method: 'get',\n async: false,\n dataType: \"json\",\n success: function (data) {\n if (data != null) {\n result = data.id;\n }\n }\n });\n return result;\n}", "title": "" }, { "docid": "dfa7a3c99845082eed2b3daff6351289", "score": "0.5184898", "text": "function getCurrentUser(callback) {\n UserApp.User.get({ user_id: \"self\" }, function(error, user) {\n if (error) {\n callback && callback(null);\n } else {\n callback && callback(user[0]);\n }\n });\n}", "title": "" }, { "docid": "c7258b3798ff09efda3cf13ae0ecad36", "score": "0.517649", "text": "GetUser(id){\n var getUser = this.users.filter((userId) => {\n return userId.id === id;\n })[0];\n return getUser;\n }", "title": "" }, { "docid": "c7258b3798ff09efda3cf13ae0ecad36", "score": "0.517649", "text": "GetUser(id){\n var getUser = this.users.filter((userId) => {\n return userId.id === id;\n })[0];\n return getUser;\n }", "title": "" }, { "docid": "9ece79b43ad4da3ccf61f21577783069", "score": "0.5173235", "text": "getUserById(id) {\n return users().then((userCollection) => {\n return userCollection.findOne({ _id: id }).then((user) => {\n if (!user) throw \"User not found\";\n return user;\n });\n });\n }", "title": "" }, { "docid": "71bde6fe1eeae778b596d61690a448de", "score": "0.51640296", "text": "get id() {\n return (this._userData.id);\n }", "title": "" }, { "docid": "941a525d4c74d613ffdef10bbc62a634", "score": "0.5162411", "text": "function getData() {\n //take a snapshot of the database\n db.collection(\"add-job-role\").onSnapshot(function(doc) {\n //set a global key variable to the id of the first element in the doc\n window.key = doc.docs[0].id;\n });\n}", "title": "" }, { "docid": "3df28bc1485f2bcddf6ef1df26c64351", "score": "0.51567674", "text": "getCurrentBusinessUserId() {\n const businessId = this.getCurrentBusinessId();\n if (IsObject(this.auth.users, true) && businessId in this.auth.users) {\n return this.auth.users[businessId].id;\n }\n return 0;\n }", "title": "" } ]
b761df1c9e572c16b3041b81d3623a07
optimized shallow clone used for static nodes and slot nodes because they may be reused across multiple renders, cloning them avoids errors when DOM manipulations rely on their elm reference.
[ { "docid": "f8d2f6036b543742b2ae6ea83402b2c0", "score": "0.0", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n}", "title": "" } ]
[ { "docid": "07fe37b3853ad347478bea8475a1d4ac", "score": "0.7176381", "text": "function cloneVNode(vnode){var cloned=new VNode(vnode.tag,vnode.data,vnode.children,vnode.text,vnode.elm,vnode.context,vnode.componentOptions,vnode.asyncFactory);cloned.ns=vnode.ns;cloned.isStatic=vnode.isStatic;cloned.key=vnode.key;cloned.isComment=vnode.isComment;cloned.fnContext=vnode.fnContext;cloned.fnOptions=vnode.fnOptions;cloned.fnScopeId=vnode.fnScopeId;cloned.isCloned=true;return cloned;}", "title": "" }, { "docid": "ca9e937dfdf1b9f1411007f2d7ae7768", "score": "0.71154225", "text": "function cloneVNode(vnode){var cloned=new VNode(vnode.tag,vnode.data,// #7975\n// clone children array to avoid mutating original in case of cloning\n// a child.\nvnode.children&&vnode.children.slice(),vnode.text,vnode.elm,vnode.context,vnode.componentOptions,vnode.asyncFactory);cloned.ns=vnode.ns;cloned.isStatic=vnode.isStatic;cloned.key=vnode.key;cloned.isComment=vnode.isComment;cloned.fnContext=vnode.fnContext;cloned.fnOptions=vnode.fnOptions;cloned.fnScopeId=vnode.fnScopeId;cloned.asyncMeta=vnode.asyncMeta;cloned.isCloned=true;return cloned;}", "title": "" }, { "docid": "0a398a058efdffcbfa454459cb025d1f", "score": "0.6959902", "text": "clone() {\n var att, attName, clonedSelf, ref;\n clonedSelf = Object.create(this);\n // remove document element\n if (clonedSelf.isRoot) {\n clonedSelf.documentObject = null;\n }\n // clone attributes\n clonedSelf.attribs = {};\n ref = this.attribs;\n for (attName in ref) {\n if (!hasProp.call(ref, attName)) continue;\n att = ref[attName];\n clonedSelf.attribs[attName] = att.clone();\n }\n // clone child nodes\n clonedSelf.children = [];\n this.children.forEach(function(child) {\n var clonedChild;\n clonedChild = child.clone();\n clonedChild.parent = clonedSelf;\n return clonedSelf.children.push(clonedChild);\n });\n return clonedSelf;\n }", "title": "" }, { "docid": "2757d974a24dbca55973aa130c5e7b64", "score": "0.68964595", "text": "clone() {\n var att, attName, clonedSelf, ref;\n clonedSelf = Object.create(this);\n // remove document element\n if (clonedSelf.isRoot) {\n clonedSelf.documentObject = null;\n }\n // clone attributes\n clonedSelf.attributes = {};\n ref = this.attributes;\n for (attName in ref) {\n if (!hasProp.call(ref, attName)) continue;\n att = ref[attName];\n clonedSelf.attributes[attName] = att.clone();\n }\n // clone child nodes\n clonedSelf.children = [];\n this.children.forEach(function(child) {\n var clonedChild;\n clonedChild = child.clone();\n clonedChild.parent = clonedSelf;\n return clonedSelf.children.push(clonedChild);\n });\n return clonedSelf;\n }", "title": "" }, { "docid": "a5c2b7e27c40b2454726cf9cca28706c", "score": "0.6882288", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if (Object(shared_esm_bundler[\"m\" /* isArray */])(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "e98c4f454e73c42a8a8a423ba7bf5502", "score": "0.6879015", "text": "clone() {\n\n // Copy tagname:\n let tagName = `${this._value}`;\n\n // Copy attributes:\n let attribs = Object.keys(this._attribs).reduce((result, id) => {\n result[id] = `${this._attribs[id]}`;\n return result;\n }, {});\n\n // Copy set:\n let text = this._text !== undefined\n ? `${this._text}`\n : undefined;\n\n // Copy listeners:\n let listeners = this._listeners.map((listener) => {\n return listener.clone();\n });\n\n // Copy children and return element:\n let elem = new YngwieElement(tagName, attribs, text, listeners);\n return this.children().reduce((elem, child) => {\n child = child.clone();\n return elem.append(child);\n }, elem);\n\n }", "title": "" }, { "docid": "485ef76d4c6d5acbc9a6cadb43f91cfb", "score": "0.686611", "text": "clone() {\n let value = `${this._value}`;\n let clone = new YngwieNode(value)\n return this.children().reduce((result, child) => {\n clone = child.clone();\n return result.append(clone);\n }, clone);\n }", "title": "" }, { "docid": "f7ac8125d8e7895e3ef03c885658ea32", "score": "0.68318355", "text": "function cloneVNode(vnode){\nvar cloned=new VNode(\nvnode.tag,\nvnode.data,\n// #7975\n// clone children array to avoid mutating original in case of cloning\n// a child.\nvnode.children&&vnode.children.slice(),\nvnode.text,\nvnode.elm,\nvnode.context,\nvnode.componentOptions,\nvnode.asyncFactory);\n\ncloned.ns=vnode.ns;\ncloned.isStatic=vnode.isStatic;\ncloned.key=vnode.key;\ncloned.isComment=vnode.isComment;\ncloned.fnContext=vnode.fnContext;\ncloned.fnOptions=vnode.fnOptions;\ncloned.fnScopeId=vnode.fnScopeId;\ncloned.asyncMeta=vnode.asyncMeta;\ncloned.isCloned=true;\nreturn cloned;\n}", "title": "" }, { "docid": "98c59bdf0802ba27d9ac2928d28164f8", "score": "0.6818182", "text": "function cloneVNode(vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(vnode.tag, vnode.data, vnode.children, vnode.text, vnode.elm, vnode.context, componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned;\n}", "title": "" }, { "docid": "cc046255f08b1c035432653149e3c6e7", "score": "0.679338", "text": "clone() {\n let clone_node = new Node();\n clone_node.name = this.name;\n clone_node.visible = this.visible;\n clone_node._renderer = this._renderer;\n\n clone_node._dirty_trs = this._dirty_trs;\n\n if (this._translation) {\n clone_node._translation = vec3.create();\n vec3.copy(clone_node._translation, this._translation);\n }\n\n if (this._rotation) {\n clone_node._rotation = quat.create();\n quat.copy(clone_node._rotation, this._rotation);\n }\n\n if (this._scale) {\n clone_node._scale = vec3.create();\n vec3.copy(clone_node._scale, this._scale);\n }\n\n // Only copy the matrices if they're not already dirty.\n if (!clone_node._dirty_trs && this._matrix) {\n clone_node._matrix = mat4.create();\n mat4.copy(clone_node._matrix, this._matrix);\n }\n\n clone_node._dirty_world_matrix = this._dirty_world_matrix;\n if (!clone_node._dirty_world_matrix && this._world_matrix) {\n clone_node._world_matrix = mat4.create();\n mat4.copy(clone_node._world_matrix, this._world_matrix);\n }\n\n if (this._render_primitives) {\n for (let primitive of this._render_primitives) {\n clone_node.addRenderPrimitive(primitive);\n }\n }\n\n for (let child of this.children) {\n clone_node.addNode(child.clone());\n }\n\n return clone_node;\n }", "title": "" }, { "docid": "a2d7770c376530aec1be4ad730aea027", "score": "0.67812544", "text": "function cloneVNode (vnode, deep) {\n\t var componentOptions = vnode.componentOptions;\n\t var cloned = new VNode(\n\t vnode.tag,\n\t vnode.data,\n\t vnode.children,\n\t vnode.text,\n\t vnode.elm,\n\t vnode.context,\n\t componentOptions,\n\t vnode.asyncFactory\n\t );\n\t cloned.ns = vnode.ns;\n\t cloned.isStatic = vnode.isStatic;\n\t cloned.key = vnode.key;\n\t cloned.isComment = vnode.isComment;\n\t cloned.fnContext = vnode.fnContext;\n\t cloned.fnOptions = vnode.fnOptions;\n\t cloned.fnScopeId = vnode.fnScopeId;\n\t cloned.isCloned = true;\n\t if (deep) {\n\t if (vnode.children) {\n\t cloned.children = cloneVNodes(vnode.children, true);\n\t }\n\t if (componentOptions && componentOptions.children) {\n\t componentOptions.children = cloneVNodes(componentOptions.children, true);\n\t }\n\t }\n\t return cloned\n\t}", "title": "" }, { "docid": "8b02ffdedd8497e71222be10c3190e1a", "score": "0.67761713", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "8b02ffdedd8497e71222be10c3190e1a", "score": "0.67761713", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "8b02ffdedd8497e71222be10c3190e1a", "score": "0.67761713", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "8b02ffdedd8497e71222be10c3190e1a", "score": "0.67761713", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "8b02ffdedd8497e71222be10c3190e1a", "score": "0.67761713", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "8b02ffdedd8497e71222be10c3190e1a", "score": "0.67761713", "text": "function deepCloneVNode(vnode) {\n const cloned = cloneVNode(vnode);\n if ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(vnode.children)) {\n cloned.children = vnode.children.map(deepCloneVNode);\n }\n return cloned;\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "3867b122b6c27189c62510717e7ba2e7", "score": "0.67237806", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "7b7c022dae55a3259ba967ddde52dd68", "score": "0.6702264", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "7b7c022dae55a3259ba967ddde52dd68", "score": "0.6702264", "text": "function cloneVNode (vnode, deep) {\n var componentOptions = vnode.componentOptions;\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep) {\n if (vnode.children) {\n cloned.children = cloneVNodes(vnode.children, true);\n }\n if (componentOptions && componentOptions.children) {\n componentOptions.children = cloneVNodes(componentOptions.children, true);\n }\n }\n return cloned\n}", "title": "" }, { "docid": "96d14d1b31b5032e539e479463f345e7", "score": "0.6692787", "text": "function cloneVNode(vnode, deep) {\n var cloned = new VNode(vnode.tag, vnode.data, vnode.children, vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned;\n}", "title": "" }, { "docid": "927a68533bf27a6fb459205e7656d077", "score": "0.66908646", "text": "function deepCloneVNode(vnode) {\r\n const cloned = cloneVNode(vnode);\r\n if (isArray(vnode.children)) {\r\n cloned.children = vnode.children.map(deepCloneVNode);\r\n }\r\n return cloned;\r\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "414eb95198579d91ac26b8a8f0ed508d", "score": "0.6672363", "text": "function cloneVNode (vnode, deep) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n if (deep && vnode.children) {\n cloned.children = cloneVNodes(vnode.children);\n }\n return cloned\n}", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "f4a3f92f15953ccd99963f7bebed8744", "score": "0.66322947", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "bb8143c944762680c557a525e5de4a6a", "score": "0.66263175", "text": "clone () {\n\t\tthrow \"DOMElement cannot be cloned.\";\n\t}", "title": "" }, { "docid": "265c320676f7bb1cc42fae2dd5429df0", "score": "0.66122216", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(vnode.tag, vnode.data, vnode.children, vnode.text, vnode.elm, vnode.ns, vnode.context, vnode.componentOptions);\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isCloned = true;\n return cloned;\n }", "title": "" }, { "docid": "22b6352028f250cd6974f2582a4e8b57", "score": "0.6589046", "text": "copy() {\n return new Node(this.id,\n this.vals.map(v => (typeof v === \"object\") ? v.copy() : v))\n }", "title": "" }, { "docid": "3fc1417f6a2ff98724980e8d5fe7497d", "score": "0.6578739", "text": "function cloneVNode (vnode) {\n\t var cloned = new VNode(\n\t vnode.tag,\n\t vnode.data,\n\t vnode.children,\n\t vnode.text,\n\t vnode.elm,\n\t vnode.context,\n\t vnode.componentOptions\n\t );\n\t cloned.ns = vnode.ns;\n\t cloned.isStatic = vnode.isStatic;\n\t cloned.key = vnode.key;\n\t cloned.isCloned = true;\n\t return cloned\n\t}", "title": "" }, { "docid": "3fc1417f6a2ff98724980e8d5fe7497d", "score": "0.6578739", "text": "function cloneVNode (vnode) {\n\t var cloned = new VNode(\n\t vnode.tag,\n\t vnode.data,\n\t vnode.children,\n\t vnode.text,\n\t vnode.elm,\n\t vnode.context,\n\t vnode.componentOptions\n\t );\n\t cloned.ns = vnode.ns;\n\t cloned.isStatic = vnode.isStatic;\n\t cloned.key = vnode.key;\n\t cloned.isCloned = true;\n\t return cloned\n\t}", "title": "" }, { "docid": "bc0d56ec4dabc555b7774c3e6b7e4169", "score": "0.6570629", "text": "clone() {\n // this class should not be cloned since it wraps\n // around a given object. The calling function should check\n // whether the wrapped object is null and supply a new object\n // (from the clone).\n return this.nodes = null;\n }", "title": "" }, { "docid": "dbbddab87cd5eec4bdf1dce675b0a840", "score": "0.6569892", "text": "function cloneVNode(vnode) {\n const cloned = new VNode(vnode.tag, vnode.data, vnode.children, vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned;\n}", "title": "" }, { "docid": "61ac6b190c60dfc6e55d9fda9faa7eb9", "score": "0.65679735", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n )\n cloned.ns = vnode.ns\n cloned.isStatic = vnode.isStatic\n cloned.key = vnode.key\n cloned.isComment = vnode.isComment\n cloned.isCloned = true\n return cloned\n }", "title": "" }, { "docid": "61ac6b190c60dfc6e55d9fda9faa7eb9", "score": "0.65679735", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n )\n cloned.ns = vnode.ns\n cloned.isStatic = vnode.isStatic\n cloned.key = vnode.key\n cloned.isComment = vnode.isComment\n cloned.isCloned = true\n return cloned\n }", "title": "" }, { "docid": "61ac6b190c60dfc6e55d9fda9faa7eb9", "score": "0.65679735", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n )\n cloned.ns = vnode.ns\n cloned.isStatic = vnode.isStatic\n cloned.key = vnode.key\n cloned.isComment = vnode.isComment\n cloned.isCloned = true\n return cloned\n }", "title": "" }, { "docid": "56e6a6eea8542e83a9204e31770db357", "score": "0.65597683", "text": "function cloneVNode(vnode) {\n const cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.isCloned = true;\n return cloned;\n }", "title": "" }, { "docid": "25b298a1b59ad73cd9b54c0e61d19255", "score": "0.65455425", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(vnode.tag, vnode.data, // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned;\n}", "title": "" }, { "docid": "25b298a1b59ad73cd9b54c0e61d19255", "score": "0.65455425", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(vnode.tag, vnode.data, // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned;\n}", "title": "" }, { "docid": "25b298a1b59ad73cd9b54c0e61d19255", "score": "0.65455425", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(vnode.tag, vnode.data, // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned;\n}", "title": "" }, { "docid": "25b298a1b59ad73cd9b54c0e61d19255", "score": "0.65455425", "text": "function cloneVNode(vnode) {\n var cloned = new VNode(vnode.tag, vnode.data, // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned;\n}", "title": "" }, { "docid": "4d09ab09b77add666559ad269a63a35c", "score": "0.65446955", "text": "function cloneVNode(vnode) {\n var cloned=new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children&&vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns=vnode.ns;\n cloned.isStatic=vnode.isStatic;\n cloned.key=vnode.key;\n cloned.isComment=vnode.isComment;\n cloned.fnContext=vnode.fnContext;\n cloned.fnOptions=vnode.fnOptions;\n cloned.fnScopeId=vnode.fnScopeId;\n cloned.asyncMeta=vnode.asyncMeta;\n cloned.isCloned=true;\n return cloned\n }", "title": "" }, { "docid": "493507f544f1ae3e285d45b682eeafd4", "score": "0.65384406", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "77d15d884c099451bb55c657f292acfc", "score": "0.6529447", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.ns,\n vnode.context,\n vnode.componentOptions\n );\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isCloned = true;\n return cloned\n }", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" }, { "docid": "2d0e1768e7618d53c58f09337d78916b", "score": "0.6528811", "text": "function cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n vnode.children,\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.isCloned = true;\n return cloned\n}", "title": "" } ]
586052232cef9af3d4787d76d7413578
AUTH FORM MODAL: Will refactor everything in regards to the auth form modal into one single component to clean up APP.js
[ { "docid": "09c88affc64f8e62e9da5b02c1cab2d7", "score": "0.0", "text": "function App() {\n // The 3 hooks below are used for showing and toggling between the login & register forms. These can most likely be refactored to use context API.\n const [showAuthForms, setShowAuthForms] = useState(false);\n const [loginFormStatus, setLoginFormStatus] = useState(true);\n const [registerFormStatus, setRegisterFormStatus] = useState(false);\n\n const global = useContext(GlobalContext);\n const { fireDataState, getAllFires, setUserLocations } = useContext(\n FireDataContext\n );\n\n useEffect(() => {\n getAllFires();\n }, []);\n\n useEffect(() => {\n if (token) {\n console.log('effect')\n setUserLocations();\n }\n }, [fireDataState.allFires,fireDataState.selectedMarker]);\n\n useEffect(() => {\n //getLogin gets login information upon page load here;\n const getLogin = async () => {\n try {\n let user = await global.state.remote.self();\n global.setUser(user.username);\n } catch (err) {\n localStorage.removeItem(\"token\");\n global.setUser(\"\");\n return <Redirect to=\"/\" />;\n }\n };\n if (token) {\n getLogin();\n }\n }, []); //[] here means this will only run once\n\n useEffect(() => {\n if (token) {\n const fetch = async () => {\n try {\n let temp = await global.state.remote.fetchLocations();\n } catch (err) {\n console.error(err);\n }\n };\n fetch();\n }\n }, [token]);\n\n return (\n <AppWrapper>\n <AddressContext>\n <AuthForms\n showAuthForms={showAuthForms}\n setShowAuthForms={setShowAuthForms}\n loginFormStatus={loginFormStatus}\n registerFormStatus={registerFormStatus}\n setLoginFormStatus={setLoginFormStatus}\n setRegisterFormStatus={setRegisterFormStatus}\n />\n\n <Navigation\n toggleAuthForms={setShowAuthForms}\n toggleLoginStatus={setLoginFormStatus}\n toggleRegisterStatus={setRegisterFormStatus}\n />\n <UserDataProvider>\n <Route path=\"/dashboard\" component={Dashboard} />\n </UserDataProvider>\n <Route\n exact\n path=\"/\"\n render={() => (\n <Home\n setShowAuth={setShowAuthForms}\n setShowRegister={setRegisterFormStatus}\n setShowLogin={setLoginFormStatus}\n />\n )}\n />\n <Route path=\"/update\" component={Update} />\n\n <Route path=\"/danger\" component={Danger} />\n\n <Route\n path=\"/home\"\n render={() => (\n <Home\n setShowAuth={setShowAuthForms}\n setShowRegister={setRegisterFormStatus}\n setShowLogin={setLoginFormStatus}\n />\n )}\n />\n\n <Route path=\"/address\" component={Address} />\n </AddressContext>\n </AppWrapper>\n );\n}", "title": "" } ]
[ { "docid": "830bc6988f3e18fd231e00c02922f847", "score": "0.7591832", "text": "function modalHandler() {\n props.isAuthOpenReducer.isAuthOpen ? props.hideAuth() : props.showAuth()\n props.closeLoginRegForm()\n }", "title": "" }, { "docid": "02716005385db0da50cf90ff96638cd5", "score": "0.63960946", "text": "function insert_auth() {\n auth_modal = document.getElementById('auth-modal')\n html = \"\"\n html += '<form action=\"\">'\n html += '<div class=\"header\">Авторизация</div>'\n html += '<span class=\"denied mb-2\"><ul id=\"auth_message\"></ul></span>'\n html += '<input id=\"auth_phone_number\" type=\"text\" placeholder=\"79999999999\">'\n html += '<input id=\"auth_password\" type=\"password\" placeholder=\"Пароль\">'\n html += '<input id=\"auth_submit\" type=\"button\" class=\"button black-button\" value=\"Войти\">'\n html += '<a href=\"\" id=\"restore_link\">Забыли пароль?</a>'\n html += '</form>'\n auth_modal.innerHTML = html\n }", "title": "" }, { "docid": "2656ffd22e28ceb2d813871aef8c70a8", "score": "0.6337285", "text": "render() {\n return (\n\t\t\t<div>\n\t\t\t\t<MainHeader />\n\t\t\t\t\t<section className=\"container\">\n\t\t\t\t\t\t<form id=\"auth-form\">\n\t\t\t\t\t\t\t<a href=\"/#\">\n\t\t\t\t\t\t\t\t<img className=\"form-logo\" src={Icon} alt=\"postit-icon\" />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<p className=\"form-brief\">Reset your password:</p>\n\t\t\t\t\t\t\t<div className=\"input-field\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tid=\"email\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Enter your postit associated email \"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<label className=\"active\" htmlFor=\"password\">Password:</label>\n\t\t\t\t\t\t\t</div>\n <div className=\"input-field\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\tid=\"email\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Enter your postit associated email \"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<label className=\"active\" htmlFor=\"confirm-password\">Confirm password:</label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<button type=\"submit\" className=\"btn btn-login\">Reset</button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</section>\n\t\t\t\t<Footer />\n\t\t\t</div>\n );\n }", "title": "" }, { "docid": "ee60bd5ee3d66713d487c5905040d8ba", "score": "0.6319563", "text": "function Modal (props) {\n const [isRegistering, changeToRegister] = useState(false);\n const [modalClose, handleClose] = useState(false);\n\n\n let renderAuthModal;\n\n if(isRegistering) {\n\n renderAuthModal = (\n <div>\n <h3 style={{paddingLeft: '2rem', fontWeight: 'bold'}} id=\"form-dialog-title\">REGISTER</h3>\n <DialogContent>\n <TextField\n autoFocus\n margin=\"dense\"\n id=\"fullname\"\n label=\"Full Name\"\n type=\"text\"\n fullWidth\n />\n <TextField\n autoFocus\n margin=\"dense\"\n id=\"email\"\n label=\"Email Address\"\n type=\"email\"\n fullWidth\n />\n <TextField\n autoFocus\n margin=\"dense\"\n id=\"password\"\n label=\"Password\"\n type=\"password\"\n fullWidth\n />\n <TextField\n autoFocus\n margin=\"dense\"\n id=\"confirmPassword\"\n label=\"Confirm Password\"\n type=\"password\"\n fullWidth\n />\n </DialogContent>\n <DialogContent>\n <Button style={{color: 'white', backgroundColor: '#ff9800', fontWeight: 'bold'}} color=\"secondary\">\n Register\n </Button>\n </DialogContent>\n <DialogContent>\n <GoogleButton />\n </DialogContent>\n <DialogContent>\n <FacebookButton />\n </DialogContent>\n\n <DialogContent>\n <h5>Already have an account? <a onClick={() => changeToRegister(false)} href='#'>Sign in here</a></h5>\n </DialogContent>\n </div>\n )\n\n } else {\n\n renderAuthModal = (\n <div>\n <h3 style={{padding: '2rem', fontWeight: 'bold'}} id=\"form-dialog-title\">LOGIN</h3>\n <DialogContent>\n <TextField\n autoFocus\n margin=\"dense\"\n id=\"email\"\n label=\"Email Address\"\n type=\"email\"\n fullWidth\n />\n <TextField\n autoFocus\n margin=\"dense\"\n id=\"password\"\n label=\"Password\"\n type=\"password\"\n fullWidth\n />\n </DialogContent>\n <DialogContent>\n <Button style={{color: 'white', backgroundColor: '#ff9800', fontWeight: 'bold'}} color=\"secondary\">\n Login\n </Button>\n </DialogContent>\n <DialogContent>\n <GoogleButton />\n </DialogContent>\n <DialogContent>\n <FacebookButton />\n </DialogContent>\n\n <DialogContent>\n <h5>Don't have an account yet? <a onClick={() => changeToRegister(true)} href='#'>Sign Up</a> with us and get started!</h5>\n </DialogContent>\n </div>\n )\n }\n\n return (\n <div>\n {renderAuthModal}\n </div>\n );\n}", "title": "" }, { "docid": "a8045ebc701f56ee36bf8ae345b1131b", "score": "0.6236652", "text": "function SignIn({ showpwView, pwView, clickTab, closeLoginModal }) {\n const history = useHistory();\n const [loginValue, setLoginValue] = useState({ email: '', password: '' });\n // useEffect(() => {\n // Kakao.init(kakaoApi);\n // }, []);\n\n const clickHandler = () => {\n Kakao.Auth.login({\n success: function (authObj) {\n fetch(`${SOCIAL_API}`, {\n method: 'POST',\n headers: {\n Authorization: authObj.access_token,\n },\n })\n .then(res => res.json())\n .then(res => {\n localStorage.setItem('kakao_token', res.token);\n });\n },\n fail: function (err) {\n alert(JSON.stringify(err));\n },\n });\n };\n\n const handleLoginInputValue = e => {\n const { id, value } = e.target;\n setLoginValue(prev => ({ ...prev, [id]: value }));\n };\n\n const checkLoginValidation = () => {\n const checkId = loginValue.email.includes('@');\n const checkPw = loginValue.password.length > 7;\n\n if (!checkId) {\n alert('아이디는 이메일형식 입니다.');\n }\n if (!checkPw) {\n alert('비밀번호는 8자 이상입니다.');\n }\n if (checkId && checkPw) {\n alert('로그인 성공');\n fetch(SIGNIN_API, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n email: loginValue.email,\n password: loginValue.password,\n }),\n })\n .then(res => res.json())\n .then(result => {\n if (result.token) {\n closeLoginModal();\n localStorage.setItem('token', result.token);\n history.push('/');\n }\n });\n }\n };\n return (\n <SignInBox>\n <SignInWrapper>\n <Form\n closeLoginModal={closeLoginModal}\n signData={signInData}\n clickTab={clickTab}\n >\n <div className=\"socialWrapper\">\n <div className=\"kakaoLogin\">\n <Button\n clickHandler={clickHandler}\n type=\"kakao\"\n content={'카카오 계정으로 로그인'}\n />\n </div>\n <Button\n signDataImg={signInData?.googleImg}\n type=\"google\"\n content={'구글 계정으로 로그인'}\n />\n </div>\n <Line />\n {signInData?.inputtype.map(el => {\n return (\n <Input\n handleInputValue={handleLoginInputValue}\n id={el.id}\n type={el.type === 'password' && pwView ? 'text' : el.type}\n placeholder={el.placeholder}\n alt={el.alt}\n src={el.src}\n />\n );\n })}\n <PwText>\n <PwBtn onClick={showpwView}>\n {pwView ? '비밀번호 숨기기' : '비밀번호 보이기'}\n </PwBtn>\n </PwText>\n <Button\n checkLoginValidation={checkLoginValidation}\n signData={signInData?.emailImg}\n type=\"signIn\"\n content={'로그인'}\n />\n </Form>\n </SignInWrapper>\n </SignInBox>\n );\n}", "title": "" }, { "docid": "47507250979c673d6c9b5d82619666b5", "score": "0.6232362", "text": "constructor(signUpFormId, logoutButtonId) {\n super();\n\n var signUpForm = document.getElementById(signUpFormId);\n var logoutButton = document.getElementById(logoutButtonId);\n var span = document.createElement(\"SPAN\");\n\n span.className = \"close\";\n span.title = \"Close Modal\";\n span.innerHTML = '&times';\n span.onclick = function () {\n signUpForm.style.display = 'none';\n localStorage.setItem(\"id\", null);\n\n };\n\n signUpForm.appendChild(span);\n\n var form = document.createElement(\"form\");\n form.className = \"modal-content\";\n\n var container = document.createElement(\"id\");\n container.className = \"container\";\n signUpForm.appendChild(form);\n\n\n var container = document.createElement(\"div\");\n container.className = \"container\";\n container.id = \"signUpContainer\";\n form.appendChild(container);\n\n signUpForm.style.display = 'block';\n\n function createCheckbox(labelContent, id, container) {\n var v = document.createElement(\"input\");\n v.type = \"checkbox\";\n v.id = id;\n \n var label = document.createElement('label');\n label.htmlFor = id;\n label.innerText =labelContent;\n container.appendChild(v);\n container.appendChild(label);\n\n }\n\n function createTextField(id, container, placeholder, labelContent) {\n var keywordsFieldLabel = document.createElement(\"label\");\n keywordsFieldLabel.innerText = \"\\n\" + labelContent;\n\n var keywordField = document.createElement(\"input\");\n keywordField.type = \"text\";\n keywordField.id = id;\n keywordField.placeholder = placeholder;\n\n container.appendChild(keywordsFieldLabel);\n container.appendChild(keywordField);\n }\n\n\n\n var h1 = document.createElement(\"h4\");\n h1.innerText = \"Login\";\n container.appendChild(h1);\n\n\n var p = document.createElement(\"P\");\n p.innerText = \"Become part of our community!\";\n container.appendChild(p);\n\n\n createTextField(\"nameField\", container, \"Name\", \"Name\");\n createTextField(\"keywordField\", container, \"Enter some Keywords\", \"Keywords\");\n createCheckbox(\"Commercial use\", \"commercialBox\", container);\n createCheckbox(\"Content Offering\", \"contentOffering\", container);\n createCheckbox(\"Model Offering\", \"modelOffering\", container);\n createCheckbox(\"Software Offering\", \"softwareOffering\", container);\n\n\n var cancelLabel = document.createElement('label');\n cancelLabel.innerText = \"Cancel\";\n var cancelButton = document.createElement(\"button\");\n cancelButton.onclick = \"document.getElementById('\" + signUpFormId + \"').style.display='none'\";\n cancelButton.type = \"button\";\n cancelButton.className = \"cancelbtn submit-button\";\n cancelButton.appendChild(cancelLabel);\n\n var submitLabel = document.createElement('label');\n submitLabel.innerText = \"Submit\";\n var submitButton = document.createElement(\"button\");\n submitButton.onclick = \"document.getElementById('\" + signUpFormId + \"').style.display='none'\";\n submitButton.id = \"submitButton\";\n submitButton.className = \"submit-button\";\n submitButton.appendChild(submitLabel);\n\n var buttonDiv = document.createElement(\"div\");\n buttonDiv.className = \"clearfix\";\n\n buttonDiv.appendChild(cancelButton);\n buttonDiv.appendChild(submitButton);\n container.appendChild(buttonDiv);\n\n\n this.localId = localStorage.getItem(\"id\");\n this.name = localStorage.getItem(\"name\");\n this.modelOffering = localStorage.getItem(\"modelOffering\");\n this.contentOffering = localStorage.getItem(\"contentOffering\");\n this.commercial = localStorage.getItem(\"commercial\");\n this.softwareOffering = localStorage.getItem(\"softwareOffering\");\n this.keywords = localStorage.getItem(\"keywords\");\n\n\n logoutButton.addEventListener(\"click\", function (e) {\n localStorage.clear();\n this.localId = null;\n localStorage.setItem(\"id\", null);\n location.reload(true);\n\n });\n\n //take a fingerprint and store it in localStorage\n Fingerprint2.get(function (components) {\n let localId = Fingerprint2.x64hash128(components.map(function (pair) { // create an ID from the hashed components\n return pair.value;\n }).join(), 31);\n\n localStorage.setItem(\"id_tmp\", localId);\n\n });\n\n\n if (localStorage.getItem(\"id\")) {\n\n console.log(\"User already logged in with id: \" + localStorage.getItem(\"id\"));\n\n document.getElementById(signUpFormId).style.display = 'none';\n\n } else {\n\n //store the given information in the localStorage when submitButton is pressed\n submitButton.addEventListener(\"click\", function (e) {\n\n this.name = document.getElementById(\"nameField\").value;\n localStorage.setItem(\"name\", this.name);\n this.keywords = document.getElementById(\"keywordField\").value;\n localStorage.setItem(\"keywords\", this.keywords);\n if (document.getElementById(\"modelOffering\").checked) {\n localStorage.setItem(\"modelOffering\", true);\n this.modelOffering = true;\n } else {\n localStorage.setItem(\"modelOffering\", false);\n this.modelOffering = false;\n }\n if (document.getElementById(\"contentOffering\").checked) {\n localStorage.setItem(\"contentOffering\", true);\n this.contentOffering = true;\n } else {\n localStorage.setItem(\"contentOffering\", false);\n this.contentOffering = false;\n }\n if (document.getElementById(\"softwareOffering\").checked) {\n localStorage.setItem(\"softwareOffering\", true);\n this.softwareOffering = true;\n } else {\n localStorage.setItem(\"softwareOffering\", false);\n this.softwareOffering = false;\n }\n if (document.getElementById(\"commercialBox\").checked) {\n localStorage.setItem(\"commercial\", true);\n this.commercial = true;\n } else {\n localStorage.setItem(\"commercial\", false);\n this.commercial = false;\n }\n this.localId = localStorage.getItem(\"id_tmp\");\n localStorage.setItem(\"id\", this.localId);\n location.reload(true);\n\n\n });\n\n /*show register form*/\n signUpForm.style.display = 'block';\n\n\n }\n this.properties = {\n localId: this.localId,\n commercial: this.commercial,\n software: this.softwareOffering,\n content: this.contentOffering,\n model: this.modelOffering,\n keywords: this.keywords,\n name: this.name\n\n }\n }", "title": "" }, { "docid": "de531f9c7351196351ec10abc80c4a89", "score": "0.6222443", "text": "function handleShowLogIn() {\n $('body').on(\"click\", \".js-show-log-in-form-btn\", () => {\n displayLogInForm($('.js-content'));\n });\n}", "title": "" }, { "docid": "3ac00c42baa6ede7d1bc7c5242c73b76", "score": "0.6222271", "text": "function ModalSignin(props) {\n const { show, handleClose } = props;\n\n return (\n <>\n <Modal show={show} onHide={handleClose}>\n\n<Modal.Header>\n<Modal.Title>Change Password</Modal.Title>\n</Modal.Header>\n<Modal.Body>\n\n{/* <Form onSubmit={handleOnSubmit}> */}\n<Form >\n\n<h2>Old Password</h2>\n \n <Form.Group className=\"mb-3\" controlId=\"formBasicName\">\n <Form.Control required name=\"oldpassword\" type=\"password\" placeholder=\"oldpassword\" />\n </Form.Group>\n<h2>Confirm Password</h2>\n \n <Form.Group className=\"mb-3\" controlId=\"formBasicDesc\">\n <Form.Control required name=\"password\" type=\"password\" placeholder=\"Password\" />\n </Form.Group>\n<h2>New Password</h2>\n\n <Form.Group className=\"mb-3\" controlId=\"formBasicDesc\">\n <Form.Control required name=\"newpassword\" type=\"newpassword\" placeholder=\"newPassword\" />\n </Form.Group>\n <Button variant=\"primary\" type=\"submit\">\n Save\n </Button>\n</Form>\n</Modal.Body>\n\n</Modal>\n </>\n );\n}", "title": "" }, { "docid": "c1682b34631be9580c96ea4aea697fb7", "score": "0.6170554", "text": "render() {\n\n return (\n\n <div>\n <Header heading=\"Image Viewer\" />\n <div className=\"card-style\">\n <Card>\n <CardContent>\n <Typography variant=\"title\">LOGIN</Typography>\n <br />\n <FormControl required>\n <InputLabel htmlFor=\"username\">Username</InputLabel>\n <Input id=\"username\" type=\"text\" username={this.state.username} \n onChange={this.usernameChangeHandler} />\n <FormHelperText className={this.state.reqUsername}>\n <span className=\"red\">required</span>\n </FormHelperText>\n </FormControl>\n <br />\n <FormControl required>\n <InputLabel htmlFor=\"password\">Password</InputLabel>\n <Input id=\"password\" type=\"password\" password={this.state.password} \n onChange={this.passwordChangeHandler} />\n <FormHelperText className={this.state.reqPass}>\n <span className=\"red\">required</span>\n </FormHelperText>\n <br />\n <FormHelperText className={this.state.incorrectCred}>\n <span className=\"red\">Incorrect username and/or password</span>\n </FormHelperText>\n </FormControl>\n <br /><br />\n <Button variant=\"contained\" color=\"primary\" onClick={this.loginClickHandler}>\n LOGIN\n </Button>\n </CardContent>\n </Card>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "f030f6ad50d4c8542f909158c0725b86", "score": "0.6132731", "text": "render() {\n // convert the form-object into an array\n // => so it is possible to loop over it\n const formElementsArray = [];\n for(let key in this.state.controls) {\n formElementsArray.push({\n id: key,\n config: this.state.controls[key],\n })\n }\n\n let form = formElementsArray.map(formElement => (\n <Input\n key={formElement.id}\n elementType={formElement.config.elementType}\n elementConfig={formElement.config.elementConfig}\n value={formElement.config.value}\n invalid={!formElement.config.valid}\n shouldValidate={formElement.config.validation}\n touched={formElement.config.touched}\n // we need to pass more data to the handler\n // => therefore we use a arrow function (it won't be executed directly\n changed={(event) => this.inputChangedHandler(event, formElement.id)}/>\n ));\n\n if(this.props.loading) {\n form = <Spinner/>;\n }\n\n let errorMessage = null;\n if(this.props.error) {\n errorMessage = (\n <p>{this.props.error.message}</p>\n );\n }\n\n // if user is authenticated we want to redirect him => and we do this declarative\n let authRedirect = null;\n if(this.props.isAuthenticated) {\n // there are multiple ways on handling the redirect\n // a) store the redirect url in the store and replace it dynamically\n // b) pass the url as a query-parameter\n // c) the most static way would be to add a condition and decide where to redirect to\n authRedirect = <Redirect to={this.props.authRedirectPath} />;\n }\n\n return(\n <div className={classes.Auth}>\n {authRedirect}\n {/* TODO: maybe translate error-message => also possible in the action AND do some styling */}\n {errorMessage}\n <form onSubmit={this.submitHandler}>\n {form}\n <Button btnType=\"Success\">SUBMIT</Button>\n </form>\n <Button\n clicked={this.switchAuthModeHandler}\n btnType=\"Danger\">SWITCH TO {this.state.isSignup ? 'SIGNIN' : 'SIGNUP'}</Button>\n </div>\n );\n }", "title": "" }, { "docid": "ffa6c7c0b7ae3ce84133b5b3dc2eee03", "score": "0.61046696", "text": "render() {\n return (\n <div className=\"app-login\">\n <Header heading=\"Image Viewer\" />\n <div className=\"login-card\">\n <Card>\n <CardContent>\n <FormControl>\n <Typography color=\"textSecondary\">\n <h1> LOGIN</h1>\n </Typography>\n </FormControl>\n <br />\n <br />\n\n <FormControl required>\n <InputLabel htmlFor=\"username\" style={{ fontSize: 20 }}>\n {\" \"}\n UserName\n </InputLabel>\n <Input\n id=\"username\"\n type=\"text\"\n style={{ width: 350 }}\n username={this.state.username}\n onChange={this.usernameChangeHandler}\n />\n <FormHelperText className={this.state.usernameRequired}>\n <span className=\"red\">required</span>\n </FormHelperText>\n </FormControl>\n <br />\n <br />\n <FormControl required>\n <InputLabel htmlFor=\"loginPassword\" style={{ fontSize: 20 }}>\n {\" \"}\n Password\n </InputLabel>\n <Input\n id=\"loginPassword\"\n type=\"password\"\n style={{ width: 350 }}\n loginPassword={this.state.loginPassword}\n onChange={this.loginPasswordChangeHandler}\n />\n <FormHelperText className={this.state.loginPasswordRequired}>\n <span className=\"red\">required</span>\n </FormHelperText>\n <FormHelperText className={this.state.incorrectCredentials}>\n <span className=\"red\">\n Incorrect username and/or password\n </span>\n </FormHelperText>\n </FormControl>\n <br />\n <br />\n <FormControl>\n <Button\n variant=\"contained\"\n color=\"primary\"\n className=\"login-button\"\n onClick={this.loginClickHandler}\n >\n LOGIN\n </Button>\n </FormControl>\n </CardContent>\n </Card>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "9d6b7de25107d54ba020289c24a6a4b5", "score": "0.6090554", "text": "showComponent (theme) {\n const { authState, hide = [], federated, onStateChange, onAuthEvent, override = [] } = this.props\n const hideForgotPassword = !override.includes('ForgotPassword') &&\n hide.some(component => component === ForgotPassword)\n\n return (\n <div className='auth-screen'>\n <SignInHeader />\n <FormSection theme={theme}>\n <SectionBody theme={theme}>\n <FederatedButtons\n federated={federated}\n theme={theme}\n authState={authState}\n onStateChange={onStateChange}\n onAuthEvent={onAuthEvent}\n />\n <FormField theme={theme}>\n <InputLabel>{I18n.get('Username')}</InputLabel>\n <Input\n data-private\n autoFocus\n theme={theme}\n key='username'\n onKeyPress={(e) => this.submitOnEnter(e)}\n name='username'\n onChange={this.handleInputChange}\n />\n </FormField>\n <FormField theme={theme}>\n <InputLabel>{I18n.get('Password')}</InputLabel>\n <Input\n data-private\n theme={theme}\n key='password'\n onKeyPress={(e) => this.submitOnEnter(e)}\n type='password'\n name='password'\n onChange={this.handleInputChange}\n />\n {\n !hideForgotPassword && <Hint theme={theme}>\n {I18n.get('Forget your password? ')}\n <Link theme={theme} onClick={() => this.changeState('forgotPassword')}>\n {I18n.get('Reset password')}\n </Link>\n </Hint>\n }\n </FormField>\n </SectionBody>\n <SectionFooter theme={theme}>\n <SectionFooterPrimaryContent theme={theme}>\n <Button theme={theme} onClick={this.signIn} disabled={this.state.loading}>\n {I18n.get('Sign In')}\n </Button>\n </SectionFooterPrimaryContent>\n {process.env.ALLOW_ANONYMOUS && <SectionFooterSecondaryContent theme={theme}>\n {message('SignIn.AnonymousExplanation') + ' '}\n <Link theme={theme} onClick={() => this.changeState('useAnonymous')}>\n {message('SignIn.Anonymous')}\n </Link>\n </SectionFooterSecondaryContent>}\n </SectionFooter>\n </FormSection>\n </div>\n )\n }", "title": "" }, { "docid": "b9b4b1b913c0a12fa5d4cd4d9d24ff96", "score": "0.60803694", "text": "function Form() {\n let { loading, errorMessage, token, user } = useAuthState();\n const username = user.username\n const email = user.email\n\n return(\n <Box\n px={{\n base: '4',\n md: '10',\n }}\n py=\"16\"\n maxWidth=\"3xl\"\n mx=\"auto\"\n >\n <form\n id=\"settings-form\"\n onSubmit={(e) => {\n e.preventDefault() // form submit logic\n }}\n >\n <Stack spacing=\"4\" divider={<StackDivider />}>\n <Heading size=\"lg\" as=\"h1\" paddingBottom=\"4\">\n Account Settings \n </Heading>\n <FieldGroup title=\"Personal Info\">\n <VStack width=\"full\" spacing=\"6\">\n <FormControl id=\"name\">\n <FormLabel>Name</FormLabel>\n <Input type=\"text\" value={username} maxLength={255} />\n </FormControl>\n\n <FormControl id=\"email\">\n <FormLabel>Email</FormLabel>\n <Input type=\"email\" value={email}/>\n </FormControl>\n\n <FormControl id=\"bio\">\n <FormLabel>Bio</FormLabel>\n <Textarea rows={5} />\n <FormHelperText>\n Brief description for your profile. URLs are hyperlinked.\n </FormHelperText>\n </FormControl>\n </VStack>\n </FieldGroup>\n <FieldGroup title=\"Profile Photo\">\n <Stack direction=\"row\" spacing=\"6\" align=\"center\" width=\"full\">\n <Avatar\n size=\"xl\"\n name=\"Alyssa Mall\"\n src=\"https://images.unsplash.com/photo-1488282396544-0212eea56a21?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80\"\n />\n <Box>\n <HStack spacing=\"5\">\n <Button leftIcon={<HiCloudUpload />}>Change photo</Button>\n <Button variant=\"ghost\" colorScheme=\"red\">\n Delete\n </Button>\n </HStack>\n <Text fontSize=\"sm\" mt=\"3\" color={useColorModeValue('gray.500', 'whiteAlpha.600')}>\n .jpg, .gif, or .png. Max file size 700K.\n </Text>\n </Box>\n </Stack>\n </FieldGroup>\n <FieldGroup title=\"Language\">\n <VStack width=\"full\" spacing=\"6\">\n <LanguageSelect />\n <CurrencySelect />\n </VStack>\n </FieldGroup>\n <FieldGroup title=\"Notifications\">\n <Stack width=\"full\" spacing=\"4\">\n <Checkbox>Get updates about the latest meetups.</Checkbox>\n <Checkbox>Get notifications about your account activities</Checkbox>\n </Stack>\n </FieldGroup>\n <FieldGroup title=\"Connect accounts\">\n <HStack width=\"full\">\n <Button variant=\"outline\" leftIcon={<FaGithub />}>\n Connect Github\n </Button>\n <Button variant=\"outline\" leftIcon={<Box as={FaGoogle} color=\"red.400\" />}>\n Connect Google\n </Button>\n </HStack>\n </FieldGroup>\n </Stack>\n <FieldGroup mt=\"8\">\n <HStack width=\"full\">\n <Button type=\"submit\" colorScheme=\"purple\">\n Save Changes\n </Button>\n <Button variant=\"outline\">Cancel</Button>\n </HStack>\n </FieldGroup>\n </form>\n </Box>\n )}", "title": "" }, { "docid": "7c7d8ded13257a46b5329e5df7965c0b", "score": "0.6069365", "text": "function LoginModal(props) {\n const dispatch = useDispatch();\n const [Email,setEmail] = useState(\"\");\n const [Password, setPassword] = useState(\"\");\n\n const onEmailHandler = (event) => {\n setEmail(event.currentTarget.value);\n }\n\n const onPasswordHandler = (event) => {\n setPassword(event.currentTarget.value);\n }\n const onSubmitHandler = (event) => {\n // page refresh를 막아준다\n event.preventDefault();\n let body = {\n username : Email,\n password : Password\n };\n \n dispatch(login(body))\n .then((res) => {\n // console.log(res);\n if (res.payload.token) {\n localStorage.setItem('token',res.payload.token);\n // axios.defaults.headers.common['Authorization'] = `Bearer ${res.payload.token}`;\n localStorage.setItem('email',Email);\n // props.setusername(Email)\n window.location.replace(\"/\")\n // props.history.push('/')\n // closeModal()\n } else {\n console.log('login fail')\n alert(res.payload.message)\n }\n })\n .catch((err) => {\n alert('로그인실패')\n console.log(err);\n });\n };\n return (\n <Form onSubmit={onSubmitHandler}>\n <Form.Group controlId=\"formBasicEmail\">\n <Form.Label>Email address</Form.Label>\n <Form.Control type=\"email\" \n placeholder=\"Enter email\" \n onChange={onEmailHandler} \n value={Email}\n />\n </Form.Group>\n\n <Form.Group controlId=\"formBasicPassword\">\n <Form.Label>Password</Form.Label>\n <Form.Control type=\"password\" \n placeholder=\"Password\"\n onChange={onPasswordHandler}\n value={Password} \n />\n </Form.Group>\n {/* <Form.Text className=\"text-muted\">\n 비밀번호가 생각이 안나시나요? 그렇다면\n </Form.Text>\n <Button variant=\"primary\" type=\"submit\">\n 비밀번호 찾기\n </Button> */}\n <Button variant=\"primary\" type=\"submit\">\n 진짜로그인\n </Button>\n </Form>\n );\n \n}", "title": "" }, { "docid": "d3c583c78cbaab1be847be0853d7f9c8", "score": "0.6065094", "text": "handleLogIn() {\n\t\t//show the loader\n\t\tthis.setState({\n\t\t\tisShowingAuthModal: true,\n\t\t\tisLoadingAuthUi: true,\n\t\t}, () => {\n\t\t\t//set up to log in with google\n\t\t\tconst uiConfig = {\n\t\t\t\tcallbacks: {\n\t\t\t\t\tsignInSuccessWithAuthResult: (ar,ru) => \n\t\t\t\t\t\t{this.handleSignIn(ar,ru)},\n\t\t\t\t\tuiShown: () => {this.setState({\n\t\t\t\t\t\tisLoadingAuthUi: false,\n\t\t\t\t\t})},\n\t\t\t\t},\n\t\t\t\tsignInFlow: 'popup',\n\t\t\t\tsignInOptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tprovider: firebase.auth.GoogleAuthProvider.PROVIDER_ID,\n\t\t\t\t\t\tauthMethod: 'https://accounts.google.com',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t//TODO\n\t\t\t\t//tosUrl: 'https://example.com',\n\t\t\t\t//privacyPolicyUrl: 'https://example.com',\n\t\t\t}\n\t\t\tthis.signInUi.start('#firebaseui-auth-container', uiConfig);\n\t\t});\n\t}", "title": "" }, { "docid": "4effddecbbc8c7e469ed0083038cbc26", "score": "0.6023751", "text": "loginModal() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n this.dismissRegister();\n const loginModal = yield this.modalController.create({\n component: _login_login_page__WEBPACK_IMPORTED_MODULE_3__[\"LoginPage\"],\n });\n return yield loginModal.present();\n });\n }", "title": "" }, { "docid": "d73a2a6d819fab45f31c48ba164953da", "score": "0.6022496", "text": "function companyLogin() {\n $('.companyLogin').on('click', function (e) {\n e.preventDefault();\n $('.forms').append(logInHtml);\n closeForm();\n modal.style.display = 'block';\n logInSubmit();\n });\n}", "title": "" }, { "docid": "3c7732bd5b94c3cf2c92731c12f535f1", "score": "0.6009206", "text": "render() {\n return (\n <Card className=\"mt-4\">\n <Card.Body className=\"mx-auto\">\n <div>\n <Form onSubmit={this.handleSubmit.bind(this)}>\n <FormGroup controlId=\"username\" bssize=\"large\">\n <Form.Label>Username</Form.Label>\n <FormControl\n autoFocus\n onChange={this.handleChange.bind(this)}\n type=\"text\"\n value={this.state.username}\n name=\"username\"\n />\n </FormGroup>\n <FormGroup controlId=\"password\" bssize=\"large\">\n <Form.Label>Password</Form.Label>\n <FormControl\n onChange={this.handleChange.bind(this)}\n value={this.state.password}\n type=\"password\"\n name=\"password\"\n />\n </FormGroup>\n\n {this.state.isIncorrect ? (<Alert variant='warning'> Username or password not recognised.</Alert>) : null}\n {this.state.errors.map(error => (\n <Alert variant='danger' key={error}>There was a problem logging you in.</Alert>\n ))} <Route render={({ history }) => (\n <Button\n type='submit'\n onClick={this.handleSubmit.bind(this)}\n >\n Login\n </Button>\n )} />\n <Link to=\"/sign-up\" className=\"btn btn-link\">\n Sign up for Academoo\n </Link>\n </Form>\n </div>\n </Card.Body>\n </Card>\n );\n }", "title": "" }, { "docid": "7ec9a0d0418ed7727f6692639b5358cf", "score": "0.6008436", "text": "render() {\n const { isModalRegistrationVisible, isModalLoginVisible } = this.state;\n\n return (\n <div className={css.heroContainer}>\n <h1 className={css.heroTitle}>Bem-vindo à Jamini</h1>\n <p className={css.heroSubtitle}>O repositório de conhecimentos da Masti Education!</p>\n\n <div className={css.heroBtnContainer}>\n {/* ======== LOGIN ======== */}\n <Button\n type=\"primary\"\n size=\"large\"\n className={css.heroBtn}\n onClick={this.handleClickLogin}\n >\n Acessar o repositório\n </Button>\n\n <Modal\n title=\"LOGIN\"\n centered\n footer={null}\n visible={isModalLoginVisible}\n onCancel={this.handleModalLoginClose}\n bodyStyle={{ fontSize: '16px' }}\n wrapClassName={css.modal}\n >\n <LoginForm />\n </Modal>\n\n {/* ======== REGISTRATION ======== */}\n <Button\n type=\"primary\"\n size=\"large\"\n className={css.heroBtn}\n onClick={this.handleClickRegistration}\n >\n Criar uma conta\n </Button>\n\n <Modal\n title=\"CADASTRO\"\n centered\n footer={null}\n visible={isModalRegistrationVisible}\n onCancel={this.handleModalRegistrationClose}\n bodyStyle={{ fontSize: '16px' }}\n wrapClassName={css.modal}\n >\n <RegistrationForm />\n </Modal>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "48205189854a6b081d4a661cf1c6082b", "score": "0.5989355", "text": "function menuLoginLogic() {\n if (document.querySelector('.form-login_btn')) {\n document.querySelector('.form-login_btn').onclick = function() {\n loginFormOpen();\n }\n }\n\n if (document.querySelector('.form-login__close')) {\n document.querySelector('.form-login__close').onclick = function() {\n loginFormClose();\n }\n }\n}", "title": "" }, { "docid": "c64e16a5b157cd4b188f6d83de886e59", "score": "0.5978313", "text": "handleSignIn(e) {\n e.preventDefault()\n let username = this.refs.username.value;\n let password = this.refs.password.value;\n this.props.onSignIn(username, password);\n }", "title": "" }, { "docid": "7ca2cf58688d52e979b643525e450f27", "score": "0.5975961", "text": "function signUpModalRedirect(){\r\n closeSigninModal()\r\n showSignUpModal();\r\n}", "title": "" }, { "docid": "861c3b760868083d3a48a1ad5ff8e3c1", "score": "0.5973756", "text": "render() {\n if (this.props.currentUser) return <Redirect to='/' />\n return (\n <div className=\"Login mt-5\">\n <ButtonGroup className=\"d-flex justify-content-end\">\n <Button\n className=\"Button\"\n color=\"primary\"\n onClick={(evt) => this.handleClick(false)}\n active={!this.state.showSignup ? true : false}>Login</Button>\n <Button\n className=\"Button btn-primary\"\n color=\"secondary\"\n onClick={(evt) => this.handleClick(true)}\n active={this.state.showSignup ? true : false}>Signup</Button>\n </ButtonGroup>\n <Form onSubmit={this.handleSubmit} className=\"LoginForm p-5 rounded\">\n <label className=\"mt-2\" htmlFor=\"username\">Username</label>\n <Input id=\"username\" name=\"username\"\n value={this.state.username}\n onChange={this.handleChange}\n type='text' />\n\n <label className=\"mt-2\" htmlFor=\"password\">Password</label>\n <Input id=\"password\" name=\"password\"\n value={this.state.password}\n type='password'\n onChange={this.handleChange} />\n {this.state.showSignup ? this.signUpFields() : ''}\n <br />\n {this.state.errors.map(error => <Alert key={error} color=\"warning\">{error}</Alert>)}\n <Button color=\"primary\">Submit</Button>\n </Form>\n </div>\n );\n }", "title": "" }, { "docid": "e5ed031404947aacb4fc08f01af2ef66", "score": "0.5972258", "text": "constructor(props) {\n super(props);\n this.handleLoginModalCloseButtonClick = this.handleLoginModalCloseButtonClick.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "title": "" }, { "docid": "c55ccb7fd80e40e0817639c63e2bcdf3", "score": "0.5950276", "text": "handleSignIn(e) {\n e.preventDefault()\n let username = this.refs.username.value\n let password = this.refs.password.value\n this.props.onSignIn(username, password)\n }", "title": "" }, { "docid": "70dbb9c1e9f0248421a8d470e0fc3b5e", "score": "0.59478134", "text": "function renderForm () {\n $el = $.helpers.insertTemplate({\n template: 'user-authentication',\n renderTo: $el,\n type: 'html',\n bind: {\n '.cbl-name': {\n 'submit': submitName\n },\n '#installExtension': {\n 'click': clickInstallExtension\n },\n }\n });\n\n function removeInstructions(){\n if (respoke.hasScreenShare()) {\n $el.find('.screen-share-instructions').remove();\n }\n }\n\n respoke.listen('extension-loaded', removeInstructions);\n\n removeInstructions();\n }", "title": "" }, { "docid": "26cfdbff6620851877f044f3dc8b3270", "score": "0.5942181", "text": "forgottenPasswordModal() {\n $('#' + this.props.modal_id).modal('hide');\n let modal_header = 'Skriv inn eposten din';\n let modal_body = (\n <ForgottenPWModal\n onSubmitted={() => {\n $('#verify-modal').modal('hide');\n }}\n />\n );\n let modal_footer = (\n <div>\n <strong>VIKTIG:</strong> Endre passordet ditt så snart du har fått logget inn igjen!\n </div>\n );\n VerificationModal.setcontent(modal_header, modal_body, modal_footer);\n $('#verify-modal').modal('show');\n }", "title": "" }, { "docid": "567de432117901ab491268619ed43629", "score": "0.59373254", "text": "function AuthForm({ onAuth }) {\n const [form, updateForm] = useImmer({});\n\n const handleSubmit = e => {\n e.preventDefault();\n onAuth(form);\n };\n\n const updateIdentity = e => updateForm(draft => void (draft.identity = e.target.value));\n const updateColor = e => updateForm(draft => void (draft.color = e.target.value));\n\n return (\n <div className='max-w-7xl mx-auto md:shadow-xl md:rounded border border-sky-500 bg-sky-600 p-3'>\n <h1 className='text-xl md:text-3xl text-sky-200 font-bold pt-2'>Authentication</h1>\n <p className='mb-3 text-sm font-light pt-1 text-sky-200'>Please enter a nickname to identify yourself a color name for visual collaboration</p>\n <form className='bg-sky-700 border border-sky-500 text-sky-200 px-3 py-5 rounded gap-5' onSubmit={handleSubmit}>\n <div className='grid grid-cols-3 mb-3 border-b border-sky-500 pb-2'>\n <label className='text-sky-50 ml-3 mt-2 font-bold'>Nickname</label>\n <div className='col-span-2 mb-1'>\n <input className='bg-sky-100 w-full p-2 text-sky-700 rounded' onChange={updateIdentity} />\n <p className='text-xs font-light mt-3 text-sky-300'>Name used to identify yourself when collaborating</p>\n </div>\n </div>\n <div className='grid grid-cols-3 border-b border-sky-500 pb-2'>\n <label className='text-sky-50 ml-3 mt-2 font-bold'>Color</label>\n <div className='col-span-2 mb-1'>\n <input className='bg-sky-100 w-full p-2 text-sky-700 rounded' onChange={updateColor} />\n <p className='text-xs font-light mt-3 text-sky-300'>\n Any of the extended{\" \"}\n <a className='underline font-semibold' target='_blank' href='https://tailwindcss.com/docs/customizing-colors#color-palette-reference'>\n TailwindCSS color palette\n </a>{\" \"}\n values can be used (ex: blue-200)\n </p>\n </div>\n </div>\n <div className='flex mt-5 justify-end'>\n <button type='submit' className='bg-sky-500 hover:bg-sky-400 font-bold py-2 px-3 rounded text-sky-50'>\n Sign-In\n </button>\n </div>\n </form>\n </div>\n );\n}", "title": "" }, { "docid": "158c0b7c84c994e7420ca412575edbc2", "score": "0.59256315", "text": "render() {\n return (\n <form onSubmit={this.handleSubmit}>\n <div class=\"form-row d-flex justify-content-center\">\n <div className=\"form-group col-md-9\">\n <label htmlFor=\"password\">Enter your new password</label>\n <input name=\"name\"\n className={`form-control ${this.state.passwordFieldError ? 'is-invalid' : ''}`}\n id=\"password\"\n placeholder=\"Enter your new password\"\n value={this.state.newpass}\n onChange={this.handlePasswordChange}\n onBlur={this.passwordValidation}\n />\n <div className='invalid-feedback'></div>\n </div>\n </div>\n <div class=\"form-row d-flex justify-content-center\">\n <div className=\"form-group col-md-9\">\n <label htmlFor=\"password2\">Confirm your new password</label>\n <input name=\"password2\"\n className={`form-control ${this.state.passwordFieldError ? 'is-invalid' : ''}`}\n id=\"password2\"\n placeholder=\"Enter your new password again\"\n value={this.state.newpassconfirm}\n onChange={this.handlePasswordChangeConfirm}\n onBlur={this.passwordValidation}\n />\n <div className='invalid-feedback'>{this.state.passwordFieldError}</div>\n </div>\n </div>\n <div class=\"form-row d-flex justify-content-center\">\n <Modal_display\n has_submit={this.state.has_submit}/>\n </div>\n </form>\n )\n }", "title": "" }, { "docid": "c6f10b7b847941ab8cd0c3f35e3fdde6", "score": "0.59144324", "text": "function Login() {\n return (\n <>\n {/* Form component from login component folder */}\n <Form/>\n </>\n );\n}", "title": "" }, { "docid": "13bdc09c726f5ba2dd57e7e151045dd7", "score": "0.5893606", "text": "function openLoginForm() {\r\n showLoginForm();\r\n setTimeout(function(){\r\n $('#modal-account').modal('show');\r\n }, 230);\r\n}", "title": "" }, { "docid": "b405fb76cfe63478621c7d27d4c3de56", "score": "0.5892849", "text": "render() {\n return (\n <div>\n <h1>Login Page</h1>\n <LoginForm onLoginSuccess={this.onLoginSuccess} />\n </div>\n );\n }", "title": "" }, { "docid": "f3194c321686ff3ac238aeb7246915ac", "score": "0.58837724", "text": "function signUpInSignInRedirectModal() {\n signInModal();\n signUpModal();\n}", "title": "" }, { "docid": "494d27615e3c6c2103710ea5d19af0cd", "score": "0.58659947", "text": "function showModal(){\n if( $('body').find('.app-loginPopUp').length > 0){\n\n $('.curtain-container').addClass('app-show-popup');\n $('.app-loginPopUp').show();\n }\n\n $('.app-loginPopUp').find('.close-modal').on('click', function(e) {\n e.preventDefault();\n $('.curtain-container').removeClass('app-show-popup');\n $('body').find('.app-loginPopUp').remove();\n });\n\n $('.app-loginPopUp').find('.mLife-signIn').on('click', function(e){\n e.preventDefault();\n window.location = $(this).find('a').attr('href');\n return false;\n });\n}", "title": "" }, { "docid": "3e634de1f6da4a329f204c20396c7192", "score": "0.5859082", "text": "function modalOpening() {\n\t\temailModal();\n\t\tpasswordModal();\n\t}", "title": "" }, { "docid": "7f36124a0480029961f91d93d46d2a0d", "score": "0.58434063", "text": "renderLogin(email) {\n this.clearScreen();\n\n const clone = this.ui.cloneTemplate('login')\n this.appContainer.appendChild(clone);\n\n if (email) { document.getElementById('userName').value = email; }\n\n let loginBt = document.querySelector(\"#loginBt\");\n loginBt.addEventListener('click', () => {\n let username = document.getElementById(\"userName\").value;\n let password = document.getElementById(\"password\").value;\n\n const data = {\n 'email': username,\n 'password': password\n };\n\n if (username.length) {\n fetch(this.apiUrl + 'login', {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n body: JSON.stringify(data),\n }).then(data => {\n if (data.status === 200) {\n return data.json()\n } else {\n alert('No user found with the credentials provided.')\n return new Error(data);\n }\n }).then(json => {\n if (json.token) {\n localStorage.setItem('auth.token', json.token)\n this.clearScreen();\n this.renderTodoApp();\n }\n }).catch(err => {\n console.log(err);\n })\n }\n })\n\n let createBt = document.querySelector(\"#createUserBt\");\n createBt.addEventListener('click', () => {\n this.renderRegistration();\n })\n }", "title": "" }, { "docid": "efd32eb4aae2bd079f94ae1ae249a71a", "score": "0.58432275", "text": "function showEventsFormIfLoggedIn() {\n fetch('/login-status')\n .then((response) => {\n return response.json();\n })\n .then((loginStatus) => {\n if (loginStatus.isLoggedIn) {\n const eventsForm = document.getElementById('events-form');\n eventsForm.classList.remove('hidden');\n document.getElementById(\"ownerId\").value = 0; //Temporary until link to this page is set to have the user parameter\n }\n });\n}", "title": "" }, { "docid": "7dfbe4dd792dfa49da3a2e687d51ad65", "score": "0.5828013", "text": "function openModal(returnArr, formModal) {\n\n // Logic - Modal - Username.\n\n if (returnArr['usernameSpecCharFound'] == 1) {\n document.getElementById('modalHeader').innerHTML = 'Double-check form';\n document.getElementById('modalText').innerHTML = 'Username contains special characters.';\n formModal.style.display = 'flex';\n }\n if (returnArr['usernameNotRegistered'] == 1) {\n document.getElementById('modalHeader').innerHTML = 'Double-check form';\n document.getElementById('modalText').innerHTML = 'Username is invalid.';\n formModal.style.display = 'flex';\n }\n\n // Logic - Modal - Passwords.\n\n if (returnArr['passwordTooShort'] == 1) {\n document.getElementById('modalHeader').innerHTML = 'Double-check form';\n document.getElementById('modalText').innerHTML = 'Password too short, minimum 7 characters.';\n formModal.style.display = 'flex';\n }\n if (returnArr['passwordNoMix'] == 1) {\n document.getElementById('modalHeader').innerHTML = 'Double-check form';\n document.getElementById('modalText').innerHTML = 'Password(s) not mixed case.';\n formModal.style.display = 'flex';\n }\n if (returnArr['passwordMatch'] == 0) {\n document.getElementById('modalHeader').innerHTML = 'Double-check form';\n document.getElementById('modalText').innerHTML = 'Passwords do not match.';\n formModal.style.display = 'flex';\n }\n\n // Logic - Modal - Token.\n\n if (returnArr['tokenInvalid'] == 1) {\n document.getElementById('modalHeader').innerHTML = 'Double-check form';\n document.getElementById('modalText').innerHTML = 'The token you entered is invalid';\n formModal.style.display = 'flex';\n }\n\n // Logic - Modal - Password reset successful.\n\n if (returnArr['passResetSuccessful'] == 1) {\n document.getElementById('modalHeader').innerHTML = 'Password reset successful';\n document.getElementById('modalText').innerHTML = 'Your password has been reset successfully. You may now sign in.';\n formModal.style.display = 'flex';\n }\n}", "title": "" }, { "docid": "0dc686862496ca0ab6e69008214c9289", "score": "0.581962", "text": "function navLoginClick(evt) {\n console.debug(\"navLoginClick\", evt);\n hidePageComponents();\n $loginForm.show();\n $signupForm.show();\n}", "title": "" }, { "docid": "0dc686862496ca0ab6e69008214c9289", "score": "0.581962", "text": "function navLoginClick(evt) {\n console.debug(\"navLoginClick\", evt);\n hidePageComponents();\n $loginForm.show();\n $signupForm.show();\n}", "title": "" }, { "docid": "0a83fcc80a06f13482e76fc741219380", "score": "0.58186996", "text": "render() {\n const formElementsArray = [];\n\n for (let key in this.state.controls) {\n formElementsArray.push({\n id: key,\n config: this.state.controls[key],\n });\n }\n\n const { classes } = this.props;\n\n let errorMessage = null;\n\n if (this.props.error) {\n errorMessage = <p>{this.props.error.message}</p>;\n }\n return (\n <Container component='main' maxWidth='xs'>\n <CssBaseline />\n\n <div className={classes.paper}>\n <Typography variant='h2' marked='center' align='center'>\n Would You Rather\n </Typography>\n <form\n className={classes.form}\n onSubmit={this.submitHandler}\n noValidate\n >\n <Grid container spacing={2}>\n <Grid item xs={12} sm={6}></Grid>\n </Grid>\n <Grid item xs={12}>\n <TextField\n variant='outlined'\n required\n fullWidth\n id='email'\n label='Email'\n value={this.state.email}\n name='email'\n autoComplete='email'\n onChange={this.handleChange}\n />\n <div style={{ fontSize: 12, color: \"red\" }}>\n {this.state.emailError}\n </div>\n </Grid>\n <Grid item xs={12}>\n <TextField\n variant='outlined'\n required\n fullWidth\n name='password'\n label='Password'\n value={this.state.password}\n type='password'\n id='password'\n autoComplete='current-password'\n onChange={this.handleChange}\n />\n <div style={{ fontSize: 12, color: \"red\" }}>\n {this.state.passwordError}\n </div>\n </Grid>\n <Button\n id='sign-up-button'\n fullWidth\n variant='contained'\n color='primary'\n className={classes.submit}\n // onClick={() =>\n // this.props.loginAction(this.state.email, this.state.password)\n // }\n\n onClick={this.submitHandler}\n >\n Sign Up\n </Button>\n </form>\n <Button onClick={this.switchAuthModeHandler}>\n SWITCH TO {this.state.isSignup ? \"SIGNIN\" : \"SIGNUP\"}\n </Button>\n </div>\n </Container>\n );\n }", "title": "" }, { "docid": "7fccb7740d8f230ff23fc80e99f88bcc", "score": "0.58138084", "text": "render() {\n const { from } = this.props.location.state || { from: { pathname: '/' } };\n // if correct authentication, redirect to page instead of login screen\n if (this.state.redirectToReferer) {\n return <Redirect to={from}/>;\n }\n // Otherwise return the Login form.\n return (\n <div>\n <Grid textAlign='center' style={{ height: '75vh' }} verticalAlign='middle'>\n <Grid.Column style={{ maxWidth: 450 }}>\n <Segment className='sign-in-up'>\n <Header as='h1' textAlign='center' className='transparent-green-box'>\n <Image src='../images/cl-uh-b-logo.png'/>Sign in to CL-UH-B</Header>\n <Form onSubmit={this.submit}>\n <Form.Input\n icon=\"user\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail address\"\n onChange={this.handleChange}\n />\n <Form.Input\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <Form.Button content=\"Sign in\"/>\n </Form>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Log in was not successful.\"\n content={this.state.error}\n />\n )}\n <Divider horizontal>OR</Divider>\n <Header textAlign='center' as='h3' className='sign-in-up-subtext'>\n Don&apos;t have an account?</Header>\n <Link to=\"/signup\">\n <Button content='Sign up' icon='signup' size='medium' />\n </Link>\n </Segment>\n </Grid.Column>\n </Grid>\n <ParticlesBg color='#024731' num={30} type='cobweb' bg={true} />\n </div>\n );\n }", "title": "" }, { "docid": "2d7f97422c830f0c7889c4b844009d7c", "score": "0.58090514", "text": "function loadSignedOut() {\n createSignInModal();\n const authorizeButton = document.getElementById(\"authorize-button\");\n authorizeButton.onclick = handleAuthClick;\n $('#signinModal').modal({\n backdrop: 'static',\n keyboard: false\n });\n}", "title": "" }, { "docid": "69ab690c661d0f0b99a3b1a923ad85ed", "score": "0.5801915", "text": "handleAccountCreationSuccess() {\n this.handleOkModalClose();\n ReactDOM.render(<Login />, document.getElementById('root'));\n }", "title": "" }, { "docid": "4aa56e0b955a6adfaf705dc9d8e2beeb", "score": "0.57994395", "text": "adjustLoginDialog() {\n\n //Remove d-none class from close button -> make it visible\n const closeModalButton = this._modalEl?.querySelector(\".btn-close\");\n closeModalButton?.classList.remove(\"d-none\");\n\n //Add d-none class to the logo-container -> hide the logo\n const logoContainer = this._modalEl?.querySelector(\"#xlogin-logo\");\n logoContainer?.classList.add(\"d-none\");\n\n //Add d-none class to the logo-container -> hide the logo\n const cancelButton = this._modalEl?.querySelector(\"input[name='cancel']\");\n cancelButton?.classList.add(\"d-none\");\n }", "title": "" }, { "docid": "b033f0e86eeff1409740a424603a7424", "score": "0.579842", "text": "render() {\n\n const { userInfo } = this.state;\n\n return (\n <Column className={css(styles.container)}>\n <div className={css(styles.title)}>\n <form className=\"modal-content\">\n\n <div className={css(styles.title)}>{\"Please fill out the form\"}</div>\n\n <div className={css(styles.padding)}>\n <div className=\"imgcontainer\">\n <img src={IconAddStaff} alt=\"Avatar\" width='100' height='100' />\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div className=\"credentials\">\n <label for=\"uname\"><b>Username</b></label>\n <input\n type=\"text\"\n placeholder=\"Enter Username\"\n value={userInfo.email}\n onChange={e => this.setState({ userInfo: { ...userInfo, email: e.target.value } })}\n name=\"uname\" required />\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div className =\"password\"> \n <label for=\"psw\"><b>Password</b></label>\n <input\n type=\"password\"\n placeholder=\"Enter Password\"\n value={userInfo.password}\n onChange={e => this.setState({ userInfo: { ...userInfo, password: e.target.value } })}\n name=\"psw\" required />\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div>\n <label for=\"psw\"><b>Gender</b></label>\n <select id=\"patients\"\n onChange={e => this.setState({ userInfo: { ...userInfo, gender: e.target.value } })}>\n <option value=\"\" selected disabled hidden>Select Gender</option>\n <option value=\"Male\">Male </option>;\n <option value=\"Female\">Female </option>;\n <option value=\"Other\">Other </option>;\n </select>\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div>\n <label for=\"address\"><b>Address</b></label>\n <input\n type=\"text\"\n placeholder=\"Enter Your Address\"\n value={userInfo.address}\n onChange={e => this.setState({ userInfo: { ...userInfo, address: e.target.value } })}\n name=\"psw\" required />\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div>\n <label for=\"address\"><b>Health Care Number</b></label>\n <input\n type=\"text\"\n placeholder=\"Enter Your Health Care Number\"\n value={userInfo.healthCareNumber}\n onChange={e => this.setState({ userInfo: { ...userInfo, healthCareNumber: e.target.value } })}\n name=\"psw\" required />\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div>\n <label for=\"address\"><b>Contact Number</b></label>\n <input\n type=\"text\"\n placeholder=\"Enter Your Contact Number\"\n value={userInfo.contactNumber}\n onChange={e => this.setState({ userInfo: { ...userInfo, contactNumber: e.target.value } })}\n name=\"psw\" required />\n </div>\n </div>\n\n <div className={css(styles.padding)}>\n <div>\n <button onClick={this.registerUser} type=\"submit\">Register User</button>\n </div>\n </div>\n\n </form>\n </div>\n </Column>\n );\n }", "title": "" }, { "docid": "01bbd52511e48f737a72aa1ab5171f21", "score": "0.5785503", "text": "function modales() {\n\t\t$loginForm = $('#login');\n\t\t$loginButton = $('.loginButton');\n\n\t\t$signupForm = $('#signup');\n\t\t$signUpButton = $('.signUpButton');\n\n\t\t$loginButton.on('click', () => {\n\t\t\t$signupForm.hide();\n\t\t\t$loginForm.toggle('collapse');\n\t\t});\n\n\t\t$('.close').on('click', () => {\n\t\t\t$loginForm.hide();\n\t\t\t$signupForm.hide();\n\t\t});\n\n\t\t$signUpButton.on('click', () => {\n\t\t\t$loginForm.hide();\n\t\t\t$signupForm.toggle('collapse');\n\t\t});\n\t}", "title": "" }, { "docid": "774a740fc7cb91f0db8dac081b53a54f", "score": "0.57845473", "text": "render() {\n return (\n <div>\n {/* Login form */}\n <form className=\"login100-form validate-form \" onSubmit={this.Authentication} name=\"loginform\" >\n\n <div className=\"wrap-input100 validate-input\" data-validate = \"Enter username\">\n <input className=\"input100\" type=\"text\" name=\"username\" placeholder=\"User name\" ref=\"username\" required/>\n <span className=\"focus-input100\"></span>\n </div>\n\n <div className=\"wrap-input100 validate-input\" data-validate=\"Enter password\">\n <input className=\"input100\" type=\"password\" name=\"password\" placeholder=\"Password\" ref=\"password\" required/>\n <span className=\"focus-input100\"></span>\n </div>\n {/* Button part */}\n <div className=\"container-login100-form-btn\">\n <button onClick={this.Authentication} className=\"login100-form-btn\" type=\"submit\" >\n Login\n </button>\n </div>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "c2e91bea8fc1846400278298822b2614", "score": "0.5782542", "text": "function App() {\n\n\n return (\n <div className = \"container\">\n \n <Auth/>\n\n </div>\n \n );\n\n }", "title": "" }, { "docid": "abeca28f5be5a7b3c0a940a13c0d2f53", "score": "0.5782353", "text": "function showModalLogin(event, path) {\n const logReg = document.getElementsByClassName(\"logRegModal-Content\")[0];\n logReg.style.display = \"block\";\n\n logReg_path_Login=path;\n formSubmitted.action=logReg_path_Login;\n \n btn_login.click();\n}", "title": "" }, { "docid": "2b56c7c27711325dea50f1bf95e8e013", "score": "0.57792586", "text": "render() {\n return (\n <div className=\"App\">\n <Navbar className=\"bp3-dark\">\n <Navbar.Group align={Alignment.LEFT}>\n <Navbar.Heading>PhotoBook Maker</Navbar.Heading>\n </Navbar.Group>\n\n <Navbar.Group align={Alignment.RIGHT}>\n <Button className='bp3-minimal' icon='home' text='Home' onClick={HomeFunc}/>\n <Button className=\"bp3-minimal\" icon=\"log-in\" text=\"Login\" />\n <Button className=\"bp3-minimal\" icon=\"document\" text=\"Register\" onClick={RegisterFunc}/>\n </Navbar.Group>\n </Navbar>\n\n <section style={ sectionStyle }>\n <br/>\n\n <section style={cardStyle}>\n\n <Card interactive={true} elevation={Elevation.FOUR}>\n <form name=\"form\" /*onSubmit={this.handleSubmit}*/>\n\n <Text>Username</Text>\n <input type=\"text\" className=\"bp3-input .bp3-round\" placeholder=\"Enter Username\" name=\"username\" uname={this.state.username} onChange={this.handleChange} required/><br/>\n\n <Text>Password</Text>\n <input type=\"password\" className=\"bp3-input .bp3-round\" placeholder=\"Enter Password\" name=\"password\" password={this.state.password} onChange={this.handleChange} required/><br/>\n\n <Button onClick={this.handleSubmit}>Login</Button>\n\n </form>\n </Card>\n\n </section>\n\n </section>\n\n\n\n\n\n </div>\n\n\n );\n }", "title": "" }, { "docid": "315122ba8f594f9d77f5f525f59d85be", "score": "0.5778668", "text": "render() {\n if (this.state.redirect) {\n return (<Redirect to='/catalog' />)\n } else if (this.state.signup) {\n return (<Redirect to='/signup' />)\n } else {\n return (\n <Grid container direction='column' alignItems='center'>\n <Typography>PADT Inventory</Typography>\n <form onSubmit={this.handleSubmit}>\n <Grid container direction='column' alignItems='center'>\n <FormControl>\n <TextField name='email' value={this.state.email} onChange={this.handleChange} />\n <FormHelperText>Email</FormHelperText>\n </FormControl>\n <FormControl>\n <TextField type='password' name='pwd' value={this.state.pwd} onChange={this.handleChange} />\n <FormHelperText>Password</FormHelperText>\n </FormControl>\n <Grid container item xs={12} justify='center'>\n <Button onClick={this.handleSubmit}>Login</Button>\n <Button onClick={this.handleSignup}>Signup</Button>\n </Grid>\n </Grid>\n </form>\n </Grid>\n );\n }\n }", "title": "" }, { "docid": "2b5637f5dcc1869ec9cd6e0549d00574", "score": "0.5770533", "text": "function LoginPage() {\n\treturn <LoginForm />\n}", "title": "" }, { "docid": "29628885323000e1c33b08c6be61f782", "score": "0.57683396", "text": "render() {\n return (\n <div>\n <Container>\n <Row className=\"mt-4\">\n <Col md={3}></Col>\n <Col xs={12} md={6} className=\"border border-muted p-5\">\n <center>\n <img\n src=\"https://cdn-images-1.medium.com/max/1000/1*ZU1eWct801yP-QpUJOaI6Q.png\"\n className=\"w-25 mt-5\"\n alt=\"\"\n />\n\n <h5 className=\"mt-3 text-dark\">Welcome Admin !</h5>\n <p className=\"text-secondary small\">\n Sign in with your email ID or phone number\n </p>\n </center>\n\n {/* Form */}\n <div className=\"mt-5 m-2 loginForm\">\n <Form.Text className=\"text-danger\">\n {this.state.emailError}\n </Form.Text>\n <Form.Control\n type=\"text\"\n onChange={this.handleChange}\n name=\"email\"\n placeholder=\"Your Email\"\n className=\"mb-3 input\"\n ></Form.Control>\n\n <Form.Text className=\"text-danger\">\n {this.state.passwordError}\n </Form.Text>\n <Form.Control\n type=\"password\"\n name=\"password\"\n placeholder=\"Your Password\"\n className=\"mb-3 input\"\n onChange={this.handleChange}\n ></Form.Control>\n\n <Button\n className={`loginButton btn-block ${\n this.state.loading ? \"disabled\" : \"\"\n }`}\n onClick={this.login}\n >\n {this.state.loading ? \"Loading\" : \"Login in to dashboard\"}\n\n <FontAwesomeIcon icon={faChevronRight} className=\"ml-2\" />\n </Button>\n </div>\n\n {/* options */}\n <div className=\"mt-3\">\n <Row>\n <Col>\n <button className=\"btn btn-link\">\n <p className=\"small\">Forgot Password ?</p>\n </button>\n </Col>\n <Col className=\"d-flex justify-content-end align-items-center\">\n <p className=\"small\">\n Dont have an account !{\" \"}\n <a\n href=\"/supplierRegister\"\n className=\"small text-primary\"\n >\n Get Started\n </a>\n </p>\n </Col>\n </Row>\n </div>\n </Col>\n <Col md={3}></Col>\n </Row>\n </Container>\n </div>\n );\n }", "title": "" }, { "docid": "fa4e579e86248199776247972d00b06c", "score": "0.57675993", "text": "render() {\n return (\n <div key=\"loginContainer\">\n <h4>Login:</h4>\n <label key=\"loginError\" className=\"errorText\" id=\"loginError\"></label>\n <label htmlFor=\"loginID\">User ID:</label>\n <label key=\"idError\" className=\"errorText\" id=\"idError\"></label>\n <input type=\"text\" id=\"loginID\" />\n\n <label htmlFor=\"password\">Password:</label>\n <label\n key=\"passwordError\"\n htmlFor=\"password\"\n className=\"errorText\"\n id=\"passwordError\"\n ></label>\n <input type={this.state.passwordShown} id=\"password\" />\n <span\n key=\"eyeIcon\"\n className={this.state.passwordIcon}\n onClick={this.togglePassword}\n data-testid=\"eyeIcon\"\n />\n\n <div key=\"loginBtnContainer\" id=\"signup-container\">\n <button\n key=\"loginBtn\"\n type=\"button\"\n value=\"Login\"\n id=\"login\"\n onClick={this.handleLogin}\n >\n Login\n </button>\n {this.loading()}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "55687c0470b31f38eed6e9358d31080b", "score": "0.5764001", "text": "render() {\n\n const InstrucAddButton = <Nav.Link onClick={this.showAddInstrucModal}>Add Instructor</Nav.Link>;\n const InstrucRemoveButton = <Nav.Link onClick={this.showRemoveInstrucModal}>Remove Instructor</Nav.Link>;\n const AdminAddButton = <Nav.Link onClick={this.showAddAdminModal}>Add Admin</Nav.Link>;\n const AdminRemoveButton = <Nav.Link onClick={this.showRemoveAdminModal}>Remove Admin</Nav.Link>;\n\n const loginButton =\n <GoogleLogin \n clientId = \"701234863585-26m47ep06fv24ebas5j934t0shn0a9ru.apps.googleusercontent.com\"\n buttonText=\"Login\"\n onSuccess={this.handleGoogleLogin}\n onFailure={console.error}\n cookiePolicy={'single_host_origin'}\n theme=\"dark\"\n />;\n\n const logoutButton = <GoogleLogout \n clientId=\"701234863585-26m47ep06fv24ebas5j934t0shn0a9ru.apps.googleusercontent.com\"\n buttonText=\"Logout\"\n onLogoutSuccess={this.handleGoogleLogout}\n theme=\"dark\"\n />;\n \n return (\n <Navbar collapseOnSelect bg=\"dark\" variant=\"dark\" expand=\"md\" sticky=\"top\">\n <Navbar.Toggle aria-controls=\"responsive-navbar-nav\" />\n <Navbar.Collapse>\n <Navbar.Brand href=\"/\"><img src=\"./logo.png\" height=\"40px\" alt=\"Classes++\" /></Navbar.Brand>\n <TextSearch setSearch={this.props.setSearch} />\n <Nav className=\"mr-auto\">\n <AddPostModal />\n {parseInt(localStorage.getItem('userPermissions')) === 2 && InstrucAddButton}\n <Modal show={this.state.showAddI} onHide={this.closeAddInstrucModal}>\n <Modal.Header closeButton>\n <Modal.Title>Add Instructor</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Form onSubmit={this.handleInstrucAddSubmit}>\n <Form.Group>\n <Form.Label>Users: </Form.Label>\n <Select\n value={this.state.selectedUser}\n options={this.state.users\n .filter(x => x.permission === 0)\n .map(x => {return {'value': x, 'label': x.name}})} \n onChange={this.onChange}\n />\n </Form.Group>\n </Form>\n </Modal.Body>\n <Modal.Footer>\n <Button type=\"submit\" variant=\"primary\" onClick={this.handleInstrucAddSubmit}>\n Confirm Change\n </Button>\n </Modal.Footer>\n </Modal> \n {parseInt(localStorage.getItem('userPermissions')) === 2 && InstrucRemoveButton}\n <Modal show={this.state.showRemoveI} onHide={this.closeRemoveInstrucModal}>\n <Modal.Header closeButton>\n <Modal.Title>Remove Instructor</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Form onSubmit={this.handleInstrucRemoveSubmit}>\n <Form.Group>\n <Form.Label>Users: </Form.Label>\n <Select\n value={this.state.selectedUser}\n options={this.state.users\n .filter(x => x.permission === 1 )\n .map(x => { return {'value': x, 'label': x.name}})}\n onChange={this.onChange}\n />\n </Form.Group>\n </Form>\n </Modal.Body>\n <Modal.Footer>\n <Button type=\"submit\" variant=\"primary\" onClick={this.handleInstrucRemoveSubmit}>\n Confirm Change\n </Button>\n </Modal.Footer>\n </Modal>\n { parseInt(localStorage.getItem('userPermissions')) === 2 && AdminAddButton }\n <Modal show={this.state.showAddA} onHide={this.closeAddAdminModal}>\n <Modal.Header closeButton>\n <Modal.Title>Add Admin</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Form onSubmit={this.handleAdminAddSubmit}>\n <Form.Group>\n <Form.Label>Users: </Form.Label>\n <Select\n value={this.state.selectedUser}\n options={this.state.users\n .filter(x => x.permission < 2)\n .map(x => { return {'value': x, 'label': x.name}})}\n onChange={this.onChange}\n />\n </Form.Group>\n </Form>\n </Modal.Body>\n <Modal.Footer>\n <Button type=\"submit\" variant=\"primary\" onClick={this.handleAdminAddSubmit}>\n Confirm Change\n </Button>\n </Modal.Footer>\n </Modal>\n {parseInt(localStorage.getItem('userPermissions')) === 2 && AdminRemoveButton}\n <Modal show={this.state.showRemoveA} onHide={this.closeRemoveAdminModal}>\n <Modal.Header closeButton>\n <Modal.Title>Remove Admin</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Form onSubmit={this.handleAdminRemoveSubmit}>\n <Form.Group>\n <Form.Label>Users: </Form.Label>\n <Select\n value={this.state.selectedUser}\n options={this.state.users\n .filter(x => x.permission === 2)\n .map(x => { return {'value': x, 'label': x.name}})}\n onChange={this.onChange}\n />\n </Form.Group>\n </Form>\n </Modal.Body>\n <Modal.Footer>\n <Button type=\"submit\" variant=\"primary\" onClick={this.handleAdminRemoveSubmit}>\n Confirm Change\n </Button>\n </Modal.Footer>\n </Modal>\n </Nav>\n {localStorage.getItem(\"user\") ? logoutButton : loginButton};\n </Navbar.Collapse>\n </Navbar>\n );\n }", "title": "" }, { "docid": "734a9e3bedc813550cc9015b51ee1e7a", "score": "0.575137", "text": "loadForm(elem) {\n this._qs(`.${elem}`).addEventListener(\"click\", () => {\n dispatchEvent(new Event(`load-${elem}-form`));\n });\n if (this.isLogin()) this._qs(`.${elem}`).style.display = \"none\";\n }", "title": "" }, { "docid": "d144bbd86a93156d6910b41843e849ac", "score": "0.57476515", "text": "function initUserForms() {\n $divForms = $('#div-login-forms');\n $formLogin = $('#login-form');\n $formLost = $('#lost-form');\n $formRegister = $('#register-form');\n $formUserPasswordChange = $('#change-user-password-form');\n $formSingleModal = $('#single-modal-form');\n\n $h3Login = $('#loginLabel');\n $h3Register = $('#registerInfoLabel');\n $h3Lost = $('#forgotPasswordLabel');\n\n $('#iconDisplayLogin').onWrap('click', function() {\n showUserInfo();\n }, 'icon user click');\n\n initLoginModal();\n initUserPasswordChangeModal();\n }", "title": "" }, { "docid": "16960f8d6036d3ccd204e275e8fdf1e9", "score": "0.5745616", "text": "function LoginForm(props) {\n return (\n <div className='loginBox'>\n <img id='scribbleLogo' src='scribble-svgrepo-com.svg' alt='' />\n <form onSubmit={props.handleLogin}>\n <div className='inputBoxOnLoginComponent'>\n <label>\n {/* Username input field */}\n <input\n placeholder='Username'\n type='text'\n value={props.name}\n onChange={props.handleChangeName}\n />\n </label>\n <label>\n {/* Password input field */}\n <input\n placeholder='Password'\n type='text'\n value={props.password}\n onChange={props.handleChangePassword}\n />\n </label>\n {/* Main submit button */}\n <input id='loginButton' type='submit' value='Login' />\n </div>\n </form>\n <a className='google' href='/google'>\n <img src='/google.png' />\n </a>\n <div className='links'>\n <a href='/forgot-password'>FORGOT PASSWORD?</a>\n <a href='/signup'>SIGNUP</a>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "8baeed8cc05f945159d3b79684994dce", "score": "0.573699", "text": "render() {\n return (\n <MDBModal\n isOpen={this.props.isOpen}\n toggle={() => this.props.toggle()}\n id=\"modalLRForm\"\n cascading\n >\n <MDBModalHeader\n toggle={() => this.props.toggle()}\n titleClass=\"d-inline title\"\n className=\"text-center light-blue darken-3 white-text\"\n >\n <MDBIcon icon=\"lock\" /> Mot de passe oublié\n </MDBModalHeader>\n <MDBModalBody>\n <p\n style={{\n fontSize: \"20px\",\n fontStyle: \"oblique\",\n fontWeight: \"400\",\n marginBottom: \"3em\"\n }}\n >\n Saississez l'adresse mail de votre compte pour qu'un mail de\n réinitialisation de votre mot de passe vous soit envoyé.\n </p>\n <MDBInput\n label=\"Adresse mail de votre compte\"\n icon=\"envelope\"\n type=\"mail\"\n name=\"mail\"\n style={{\n border: \"none\",\n borderBottom: \"1px solid #ced4da\"\n }}\n onChange={this.handleMailChange}\n value={this.state.mail}\n autoComplete=\"username\"\n required\n />\n <br />\n <br />\n </MDBModalBody>\n <MDBModalFooter className=\"ModalFooter\">\n <MDBBtn\n outline\n color=\"primary\"\n className=\"CloseButton\"\n onClick={this.handleReset}\n >\n Fermer\n </MDBBtn>\n <Tooltip\n title={this.state.validForm === true ? \"\" : \"Le mail est invalide.\"}\n placement=\"top\"\n >\n <span>\n <MDBBtn\n color=\"primary\"\n className=\"SaveButton\"\n onClick={this.forgetPassword}\n disabled={!this.state.validForm}\n >\n Envoyer\n </MDBBtn>\n </span>\n </Tooltip>\n </MDBModalFooter>\n </MDBModal>\n );\n }", "title": "" }, { "docid": "0a0b40c8e9d3ad7014faf4440ab21361", "score": "0.5735359", "text": "render() {\n const { appName } = this.props;\n const { errors, isModalShow, loading } = this.state;\n\n return (\n <section\n className={`${clsPrefix}-container full-page-container center-container`}\n >\n <h1 className=\"dapp-name\">AElf {appName} Demo</h1>\n <div style={{ display: \"block\", width: \"80%\" }}>\n <Button\n type=\"primary\"\n style={{ borderRadius: 20 }}\n onClick={this.login}\n loading={loading}\n >\n Login\n </Button>\n </div>\n <Modal\n visible={isModalShow}\n transparent\n maskClosable={false}\n onClose={this.onCloseModal}\n title=\"Failed\"\n footer={[\n {\n text: \"Ok\",\n onPress: () => {\n console.log(\"ok\");\n this.onCloseModal();\n }\n }\n ]}\n >\n <p>There are some error:</p>\n {Array.isArray(errors) &&\n errors.map(item => (\n <p key={item.errorCode}>\n {item.errorCode}: {item.errorMsg}\n </p>\n ))}\n </Modal>\n </section>\n );\n }", "title": "" }, { "docid": "e2833c76d2427ac663366e3b0956172d", "score": "0.5731966", "text": "function openLoginModalAction() {\n if (userRole === \"Admin\") {\n dropdown_content.style.visibility =\"hidden\";\n loginModal.className += \" visible\";\n userNameInput.value = \"\";\n passwordInput.value = \"\";\n }\n}", "title": "" }, { "docid": "574dbc15d9c748bec504fe3be46cbd27", "score": "0.5731392", "text": "render(){\n return (\n <div>\n <Link to=\"/\">Home </Link>\n <LoginForm submit={this.submitLoginForm}/>\n </div>\n\n )\n }", "title": "" }, { "docid": "0dc5af0620192c22ee1668d624c64376", "score": "0.57251763", "text": "render() {\n return (\n <div id=\"root\">\n {/* page title */}\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\"><h2>Account</h2></div>\n </div>\n\n {/* Settings section allows user to change image sample rate, graph update rate, and email/password */}\n <div>\n <h5 class=\"heading\">Settings</h5>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-4 text-center\">\n {/* \"Change Email\" button opens a modal to allow user to change their email */}\n <button type=\"button\" class=\"btn btn-outline-primary\" onClick={() => this.openModal(\"email\")}>Change Email</button>\n <Modal\n isOpen={this.state.emailModalIsOpen}\n onRequestClose={this.closeModal}\n style={{\n content: {\n margin: \"auto\",\n height: \"50%\",\n width: \"50%\"\n }\n }}\n contentLabel=\"Change Email Modal\"\n >\n <div class=\"page-header\">\n <h4>Change Email</h4>\n </div>\n <div>\n <form>\n <div class=\"form-group row\">\n <label for=\"newEmail\" class=\"col-sm-2 col-form-label\">New Email</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"newEmail\"></input>\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"confirmNewEmail\" class=\"col-sm-2 col-form-label\">Confirm New Email</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"confirmNewEmail\"></input>\n </div>\n </div>\n <button type=\"submit\" class=\"btn btn-primary\" onClick={() => this.closeModal(\"email\")}>Submit Changes</button>\n <button type=\"button\" class=\"btn btn-secondary\" onClick={() => this.closeModal(\"email\")}>Close</button>\n </form>\n </div>\n </Modal>\n {/* \"Change Password\" button opens a modal to allow user to change their password */}\n <button type=\"button\" class=\"btn btn-outline-primary\" onClick={() => this.openModal(\"password\")}>Change Password</button>\n <Modal\n isOpen={this.state.passwordModalIsOpen}\n onRequestClose={this.closeModal}\n style={{\n content: {\n margin: \"auto\",\n height: \"60%\",\n width: \"60%\"\n }\n }}\n contentLabel=\"Change Password Modal\"\n >\n <div class=\"page-header\">\n <h4>Change Password</h4>\n </div>\n <div>\n <form>\n <div class=\"form-group row\">\n <label for=\"oldPassword\" class=\"col-sm-2 col-form-label\">Old Password</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"oldPassword\"></input>\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"newPassword\" class=\"col-sm-2 col-form-label\">New Password</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"newPassword\"></input>\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"confirmNewPassword\" class=\"col-sm-2 col-form-label\">Confirm New Password</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"confirmNewPassword\"></input>\n </div>\n </div>\n <button type=\"submit\" class=\"btn btn-primary\" onClick={() => this.closeModal(\"password\")}>Submit Changes</button>\n <button type=\"button\" class=\"btn btn-secondary\" onClick={() => this.closeModal(\"password\")}>Close</button>\n </form>\n </div>\n </Modal>\n </div>\n </div>\n <div class=\"row\">\n {/* User Info section contains basic information about user employees, manager, hours, etc. */}\n <div class=\"info col-sm-6\">\n {/* load all UserInfo variables */}\n <UserInfo name={this.state.name} dob={this.state.dob}\n age={this.state.age} address={this.state.address} hoursOperation={this.state.hoursOperation} />\n {/* \"Edit User Info\" button opens a modal to allow user to edit the user information */}\n <button type=\"button\" class=\"btn btn-outline-primary\" onClick={() => this.openModal(\"info\")}>Edit User Info</button>\n <Modal\n isOpen={this.state.infoModalIsOpen}\n onRequestClose={this.closeModal}\n style={{\n content: {\n margin: \"auto\",\n height: \"75%\",\n width: \"70%\"\n }\n }}\n contentLabel=\"Edit Info Modal\"\n >\n <div class=\"page-header\">\n <h4>Edit User Information</h4>\n </div>\n <div>\n <form>\n <div class=\"form-group row\">\n <label for=\"name\" class=\"col-sm-2 col-form-label\">Name</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"name\" value={this.state.tempName} onChange={(e) => this.editName(e)}></input>\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"dob\" class=\"col-sm-2 col-form-label\">Date of Birth</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"dob\" value={this.state.tempDob} onChange={(e) => this.editDob(e)}></input>\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"age\" class=\"col-sm-2 col-form-label\">Age</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"age\" value={this.state.tempAge} onChange={(e) => this.editAge(e)}></input>\n </div>\n </div>\n <div class=\"form-group row\">\n <label for=\"address\" class=\"col-sm-2 col-form-label\">Address</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" class=\"form-control\" id=\"address\" value={this.state.tempAddress} onChange={(e) => this.editAddress(e)}></input>\n </div>\n </div>\n <button type=\"submit\" class=\"btn btn-primary\" onClick={() => this.saveChanges(\"info\")}>Submit Changes</button>\n <button type=\"button\" class=\"btn btn-secondary\" onClick={() => this.closeModal(\"info\")}>Close</button>\n </form>\n </div>\n </Modal>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "563d349ccdbd834415db346e9db40bbc", "score": "0.5724106", "text": "function Auth({ isLogin, tryLogIn }) {\n\n let initialErrorsState = {\n login: '',\n email: '',\n password: ''\n }\n\n const [errorMsg, setErrorMsg] = useState('');\n\n const [errors, setErrors] = useState(Object.assign({}, initialErrorsState));\n\n let email = !isLogin ?\n <Form.Group>\n <Form.Label>Enter your email:</Form.Label>\n <Form.Control type=\"email\" placeholder=\"yourEmail@.com\" id=\"email\" name=\"email\" onChange={inputChangeHandler} className={\n errors['email'] ? 'is-invalid' : ''\n } />\n <div className={\n errors['email'] ? 'error-msg' : 'hidden'\n }>{errors['email']}\n </div>\n </Form.Group>\n : null;\n\n return (\n\n <div className=\"d-flex justify-content-center\">\n {/* <Image className=\"backgroundImage\" src=\"background.png\" /> */}\n <div className=\"Auth\">\n <Container id='authContainer'>\n <Card>\n <Card.Body id=\"cardBody\">\n {errorMsg && <Alert style={{ fontSize: '1em', padding: '5px 10px' }} variant=\"danger\">{errorMsg}</Alert>}\n <Form>\n <Form.Group>\n <Form.Label>Enter your login:</Form.Label>\n <Form.Control type=\"text\" placeholder=\"login\" id=\"login\" onChange={inputChangeHandler} name=\"login\" maxLength='20' autoFocus className={\n errors['login'] ? 'is-invalid' : ''\n } />\n <div className={\n errors['login'] ? 'error-msg' : 'hidden'\n }>\n {errors['login']}\n </div>\n </Form.Group>\n\n {email}\n\n <Form.Group>\n <Form.Label>Enter your password:</Form.Label>\n <Form.Control type=\"text\" placeholder=\"password\" id=\"password\" name=\"password\" onChange={inputChangeHandler} maxLength='16' className={\n errors['password'] ? 'is-invalid' : ''\n } />\n <div className={\n errors['password'] ? 'error-msg' : 'hidden'\n }>\n {errors['password']}\n </div>\n </Form.Group>\n\n\n <Button\n variant='primary'\n size='lg'\n onClick={Authenticate}\n block>\n Submit\n </Button>\n\n {isLogin &&\n <Link to=\"register\" id='registerLink' >\n <div id=\"noAccountLabel\" >\n Don't have an account?\n </div>\n </Link>\n }\n\n </Form>\n </Card.Body>\n </Card>\n </Container>\n </div>\n </div>\n );\n\n function validateForm(name, value) {\n\n let formErrors = Object.assign({}, errors);\n\n\n switch (name) {\n case 'login':\n\n let loginExp = new RegExp('^[a-zA-Z0-9-_]+$');\n\n formErrors[name] = value.length < 4 ? 'At least 4 characters long!' : loginExp.test(value) ? '' : 'Invalid login';\n\n break;\n\n case 'email':\n\n let emailExp = new RegExp('^[a-zA-Z0-9-_]+@[a-zA-Z]+\\\\.[a-zA-Z]{2,3}$');\n\n formErrors[name] = !value.includes('@') ? 'Invalid email!' : emailExp.test(value) ? '' : 'Invalid email';\n\n break;\n\n case 'password':\n\n let passwordExp = new RegExp('^[a-zA-Z0-9-$&@_]+$');\n\n formErrors[name] = value.length < 4 ? 'At least 4 characters long' : passwordExp.test(value) ? '' : 'Invalid password';\n\n break;\n default:\n break;\n }\n\n setErrors(formErrors);\n\n }\n\n function inputChangeHandler(e) {\n const { name, value } = e.target;\n\n validateForm(name, value);\n }\n\n async function Authenticate() {\n\n let login = document.getElementById('login').value;\n let password = document.getElementById('password').value;\n\n let email = isLogin ? null : document.getElementById('email').value;\n\n //validating on submit (quite messy)===================\n if (errors.login || errors.password || errors.email) {\n return;\n }\n\n if (!login || !password) {\n return;\n }\n\n if (!isLogin) {\n if (!email)\n return;\n }\n\n //End Validation======================================\n\n let url = isLogin ? 'login' : 'register';\n\n const data = {\n login,\n password,\n email\n }\n\n console.log(data);\n\n let response = await fetch(url, {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n\n let jsonData = await response.json();\n\n console.log(`${url} response:`);\n\n console.log(jsonData);\n\n if (jsonData.msg) {\n setErrorMsg(jsonData.msg);\n }\n\n //executing callback, passed through props by App to update authState\n tryLogIn(jsonData.isAuthenticated, jsonData.expiresIn, login);\n }\n\n\n\n}", "title": "" }, { "docid": "d620251e4fc4e3ef83a2903f66c61089", "score": "0.5721302", "text": "render() {\n var navStyle = {\n backgroundColor: \"#ff0000\"\n };\n return (\n <section>\n <div\n className=\"modal fade\"\n id=\"signInModal\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"signInModal\"\n aria-hidden=\"true\"\n >\n <div className=\"modal-dialog\" role=\"document\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <h3 className=\"modal-title\" id=\"exampleModalLabel\">\n Sign in to Spoiled Tomatillos\n </h3>\n <button\n type=\"button\"\n className=\"close\"\n data-dismiss=\"modal\"\n aria-label=\"Close\"\n >\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div className=\"modal-body\">\n <div className=\"form-group\">\n <input\n type=\"email\"\n value={this.state.loginEmail}\n onChange={this.changeLoginEmail.bind(this)}\n className=\"form-control\"\n id=\"userEmail\"\n placeholder=\"Email\"\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"password\"\n value={this.state.loginPassword}\n onChange={this.changeLoginPassword.bind(this)}\n className=\"form-control\"\n id=\"userPassword\"\n placeholder=\"Password\"\n />\n </div>\n <button\n onClick={this.login.bind(this)}\n type=\"submit\"\n className=\"btn btn-secondary btn-block\"\n data-dismiss=\"modal\"\n >\n Sign In\n </button>\n </div>\n </div>\n </div>\n </div>\n <nav\n className=\"navbar navbar-primary rounded navbar-toggleable-md\"\n style={navStyle}\n >\n <button\n className=\"navbar-toggler navbar-toggler-right\"\n type=\"button\"\n data-toggle=\"collapse\"\n data-target=\"#containerNavbar\"\n aria-controls=\"containerNavbar\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n >\n <span className=\"navbar-toggler-icon\" />\n </button>\n <img\n className=\"img-fluid navbar-brand\"\n src={\"https://imgur.com/9tku7By.png\"}\n />\n\n <div\n className=\"collapse navbar-collapse justify-content-end\"\n id=\"containerNavbar\"\n >\n <ul className=\"navbar-nav\">\n <li className=\"nav-item\">\n <a\n className=\"nav-link\"\n href=\"#\"\n data-toggle=\"modal\"\n data-target=\"#signInModal\"\n >\n Sign In\n </a>\n </li>\n </ul>\n </div>\n </nav>\n\n <div className=\"container\">\n <br />\n <div className=\"row\">\n <div className=\"col-6 landing-info\">\n <h1>Spoiled Tomatillos</h1>\n <h4>Bridging the chasm between Netflix and Facebook</h4>\n <p>\n Welcome to the social media platform for movie lovers. Spoiled\n Tomatillos makes it easy to find new movies and share movies you\n love with friends.\n </p>\n </div>\n <div className=\"col-6 registration\">\n <div className=\"subsection\">\n {this.state.loginError != \"\" && (\n <div className=\"alert alert-danger\">\n {this.state.loginError}\n </div>\n )}\n <h4>Register to join Spoiled Tomatillos</h4>\n <form>\n <div className=\"form-group\">\n <input\n className=\"form-control\"\n value={this.state.firstName}\n onChange={this.changeFirstName.bind(this)}\n id=\"firstName\"\n aria-describedby=\"firstNameHelp\"\n placeholder=\"First name\"\n />\n </div>\n <div className=\"form-group\">\n <input\n className=\"form-control\"\n value={this.state.lastName}\n onChange={this.changeLastName.bind(this)}\n id=\"lastName\"\n aria-describedby=\"lastNameHelp\"\n placeholder=\"Last name\"\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"email\"\n className=\"form-control\"\n value={this.state.email}\n onChange={this.changeEmail.bind(this)}\n id=\"email\"\n aria-describedby=\"emailHelp\"\n placeholder=\"Email\"\n />\n </div>\n <div className=\"form-group\">\n <input\n type=\"password\"\n className=\"form-control\"\n value={this.state.password}\n onChange={this.changePassword.bind(this)}\n id=\"password\"\n placeholder=\"Password\"\n />\n </div>\n {this.state.registrationError != \"\" && (\n <div className=\"alert alert-danger\">\n {this.state.registrationError}\n </div>\n )}\n <button\n onClick={this.createAccount.bind(this)}\n type=\"submit\"\n className=\"btn btn-secondary btn-block\"\n >\n Register\n </button>\n </form>\n </div>\n <br />\n <p>\n Already have an account?{\" \"}\n <a href=\"#\" data-toggle=\"modal\" data-target=\"#signInModal\">\n Sign in\n </a>\n </p>\n </div>\n </div>\n </div>\n </section>\n );\n }", "title": "" }, { "docid": "0ca95cb607f295cc51db010e974629db", "score": "0.57180136", "text": "function initLoginMenu(){\n //password visibility\n document.getElementById('loginPassVisibility').onclick = () => {\n var pass = document.getElementById('login-pass-input');\n if(pass.type == 'password')\n pass.type = 'text';\n else pass.type = 'password';\n };\n\n //close menu...\n document.getElementById('signinCloseBtn').onclick = () => {\n document.getElementById('singinContainer').style.display = 'none';\n document.getElementById('dim').style.display = 'none';\n };\n\n\n //check inputs before displaying login btn\n document.getElementById('login-email-input').oninput = () => {\n validateLoginMenu();\n };\n document.getElementById('login-pass-input').oninput = () => {\n validateLoginMenu();\n };\n\n\n}", "title": "" }, { "docid": "6de9dbb478b71fc99fbf1f9cb40c2b48", "score": "0.57138926", "text": "render() {\n return (\n <div>\n <CardMedia>\n <img style={style.image} src={require('../../../static/assets/loginForm.jpg')} />\n </CardMedia>\n <CardTitle title=\"Hello Again!\" subtitle=\"Login to your account\" />\n <CardText style={style.contents}>\n <Formsy.Form ref=\"login\" onValid={this.enableButton} onInvalid={this.disableButton} onValidSubmit={this.submitForm} onInvalidSubmit={this.notifyFormError}>\n <FormsyText required={!this.state.validateEmail} onBlur={this.enableEmailValidation} onFocus={this.disableEmailValidation} name=\"email\" validations={this.state.emailInvalid ? {isUndefined:false} : this.state.validateEmail ? {isEmail:true,} : {isExisty:true}} validationError=\"Please provide a valid email address\" floatingLabelText={'Email'} disabled={this.state.hasSubmitted} />\n <FormsyText required={!this.state.validatePassword} onBlur={this.enablePasswordValidation} onFocus={this.disablePasswordValidation} type=\"password\" name=\"password\" validations={this.state.passwordInvalid ? {isUndefined:false} : {isExisty:true}} validationError=\"Password field cannot be empty\" floatingLabelText=\"Password\" disabled={this.state.hasSubmitted}/>\n <CardActions>\n <RaisedButton fullWidth={true} type=\"submit\" label=\"Login\" primary={false} secondary={true} disabled={!this.state.canSubmit||this.state.hasSubmitted}/>\n </CardActions>\n </Formsy.Form>\n </CardText>\n <FloatingDialog title={\"Login Failed!\"} modal={false} open={this.state.errorDialog} onRequestClose={this.resetLoginForm}>\n {this.state.errorText}\n </FloatingDialog>\n </div>\n );\n}", "title": "" }, { "docid": "8c3e86f6d197a7fcbcb46aa660687134", "score": "0.57065433", "text": "render() {\n\n if (this.state.toApp2 === true) {\n return <Redirect to=\"/Goals\" />\n }\n\n return (\n <div className=\"App\">\n <DotLoader color={'#2CECC6'} loading={this.state.loading} css={override} size={250} />\n <ToastContainer />\n <header className=\"App-header\">\n <img src={require('./assets/crowd.png')} alt='Crowdstepping logo' \n style={{ height : '250px', width : '250px' }} />\n <a className=\"App-title\" style={{ marginTop : '3vh' }}>\n Crowdstepping\n </a>\n <div className=\"group\" style={{ marginTop : '5vh' }}> \n <input\n className=\"Custom-input\"\n type=\"text\" required\n maxLength='50'\n onChange={this.updateUsername}\n />\n <span className=\"Custom-highlight\"></span>\n <span className=\"Custom-bar\"></span>\n <label className=\"Custom-label\">Username</label>\n </div>\n <div className=\"group\"> \n <input \n className=\"Custom-input\"\n type=\"password\" required\n maxLength='50'\n onChange={this.updatePassword}\n />\n <span className=\"Custom-highlight\"></span>\n <span className=\"Custom-bar\"></span>\n <label className=\"Custom-label\">Password</label>\n </div>\n <Ripples>\n <button className=\"Button-style\" onClick={() => { this.logIn(); this.setState({ loginDisabled: true }); setTimeout(() => this.setState({ loginDisabled: false }), 10000); }} \n disabled={this.state.loginDisabled} style={{ height : '30px', width : '100px' }}>\n Login\n </button>\n </Ripples>\n <div className=\"group\" style={{ marginTop : '5vh' }}> \n <input\n className=\"Custom-input\"\n type=\"text\" required\n maxLength='50'\n onChange={this.updateUsername2}\n />\n <span className=\"Custom-highlight\"></span>\n <span className=\"Custom-bar\"></span>\n <label className=\"Custom-label\">Username</label>\n </div>\n <div className=\"group\"> \n <input\n className=\"Custom-input\"\n type=\"text\" required\n maxLength='50'\n onChange={this.updateEmail}\n />\n <span className=\"Custom-highlight\"></span>\n <span className=\"Custom-bar\"></span>\n <label className=\"Custom-label\">Email</label>\n </div>\n <div className=\"group\"> \n <input\n className=\"Custom-input\"\n type=\"password\" required\n maxLength='50'\n onChange={this.updatePassword2}\n />\n <span className=\"Custom-highlight\"></span>\n <span className=\"Custom-bar\"></span>\n <label className=\"Custom-label\">Password</label>\n </div>\n <Ripples>\n <button className=\"Button-style\" onClick={() => { this.signUp(); this.setState({ signupDisabled: true }); setTimeout(() => this.setState({ signupDisabled: false }), 10000); }} \n disabled={this.state.signupDisabled} style={{ height : '30px', width : '100px' }}>\n Sign Up\n </button>\n </Ripples>\n <div style={{ fontSize : '5px', marginTop: '5vh' }}>Icons made by <a href=\"https://www.flaticon.com/authors/freepik\" title=\"Freepik\">Freepik</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a> </div>\n </header>\n </div>\n );\n }", "title": "" }, { "docid": "20bcb9cf92d064e1bd3c7b2ec8d11897", "score": "0.57036257", "text": "render(){\n return(\n <div className=\"container\">\n <Button className=\"btn btn-sm btn-light m-1 p-0.5\"><NavLink onClick={this.toggle} href=\"#\"><span className=\"text-dark\"><strong>Register</strong></span></NavLink></Button>\n <Modal\n isOpen={this.state.modal}\n toggle={this.toggle}\n >\n <ModalHeader className=\"bg-dark text-light\" toggle={this.toggle}>\n Register\n </ModalHeader>\n <ModalBody>\n {this.state.msg ? (<Alert color=\"danger\">{this.state.msg}</Alert>):null}\n <Form onSubmit={this.onSubmit}>\n <FormGroup>\n <Label for=\"name\">Name</Label>\n <Input\n type=\"text\"\n name=\"name\"\n id=\"name\"\n placeholder=\"Name\"\n className=\"mb-3\"\n onChange={this.onChange}\n />\n <Label for=\"email\">Email</Label>\n <Input\n type=\"email\"\n name=\"email\"\n id=\"email\"\n placeholder=\"Email\"\n className=\"mb-3\"\n onChange={this.onChange}\n />\n <Label for=\"password\">Password</Label>\n <Input\n type=\"password\"\n name=\"password\"\n id=\"password\"\n placeholder=\"Password\"\n className=\"mb-3\"\n onChange={this.onChange}\n />\n <Button\n color=\"dark\"\n style={{marginTop: '2rem'}}\n block\n >Register</Button>\n </FormGroup>\n </Form>\n </ModalBody>\n </Modal>\n </div>\n );\n }", "title": "" }, { "docid": "fc843e599e5f18f88e3e440874ae5dfb", "score": "0.56961876", "text": "render() {\n const message = this.props.message || this.state.message;\n const { email, password } = this.state;\n const { setPopup } = this.props;\n return (\n \t<Layer closer={true} onClose={() => setPopup('')}>\n \t<Box pad='medium'>\n <Heading strong={true} align='center'>Hungry Already?</Heading>\n <Form>\n <FormField label='Email'>\n <TextInput value={email} onDOMChange={(event) => this._updateValue(event, 'email')}/>\n </FormField>\n <FormField label='Password'>\n <input\n id='password'\n type='password'\n value={password}\n onChange={(event) => this._updateValue(event, 'password')}\n />\n </FormField>\n </Form>\n <Label style={{ color: 'red' }}>{message}</Label>\n <Box pad='medium' align='center' width='100%'>\n <Button label='Log In' style={{ borderColor: '#FDC92B', backgroundColor: '#FDC92B', color: 'white' }}\n primary={true} onClick={() => this._submit(email, password)}\n fill={true}\n />\n </Box>\n </Box>\n\t \t\t<Box pad={{horizontal: 'medium', vertical: 'small'}}>\n\t \t\t\t<Anchor href='#' label='Sign up' onClick={() => setPopup('signup')}/>\n\t \t\t</Box>\n \t</Layer>\n );\n }", "title": "" }, { "docid": "a8e913d9b7519e0daa9394ac389b4b9d", "score": "0.5675296", "text": "_handleButtonChangePassword()\n {\n var view = new ViewPassword();\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__MODAL_HIDE);\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__MODAL_SHOW, {title: 'Change Password', content: view});\n\n }", "title": "" }, { "docid": "19fb03c5a3523fc1c33f14aa1e876180", "score": "0.5672842", "text": "submit(event) {\n this.error = false;\n event.preventDefault();\n let data = {\n email: this.email,\n password: this.password\n };\n\n if (this.valid(data)) {\n let userService = new UserService();\n userService\n .login(this.email, this.password)\n .then((user: User) => {\n //document.getElementsByClassName(\"loading\")[0].style.display = \"none\";\n $('#' + this.props.modal_id).modal('hide');\n //this.props.history.push('/');\n this.props.onLogin();\n })\n .catch((error: Error) => {\n this.error = <Alert type=\"danger\" text=\"Brukernavn og/eller passord er feil\" />;\n });\n } else {\n this.error = <Alert type=\"danger\" text=\"Du må fylle inn begge feltene for å sende skjemaet\" />;\n }\n }", "title": "" }, { "docid": "fddd0b102f5f35d722eaa6c2cf30ef35", "score": "0.5668958", "text": "login() {\n if (this.isLoggedIn()) return;\n this.loginModal.classList.add('is-active');\n }", "title": "" }, { "docid": "8af78da70dd5049916c207056afae6a6", "score": "0.566124", "text": "function login_modal_launch () {\n $('.login-button').click(function() {\n $('#login_modal').modal('show');\n });\n}", "title": "" }, { "docid": "b97ad3faa622efc0e67cf7d9a38524e2", "score": "0.56559414", "text": "function loginModalLoader(){\n $(document).ready(function () {\n $('#login').modal('show');\n siteMode = \"login\";\n validateForm();\n });\n}", "title": "" }, { "docid": "d98633a4306cc2ef68773b76fa49e51b", "score": "0.5654358", "text": "function VLogin(params) {\n return (\n\n <Container>\n\n <div className=\"card card-login mx-auto text-center bg-dark\">\n\n <div className=\"card-header mx-auto bg-dark\">\n <span>\n <img src=\"https://amar.vote/assets/img/amarVotebd.png\" className=\"w-75\" alt=\"Logo\" />\n </span><br />\n <span className=\"logo_title mt-5\"> Login Dashboard </span>\n <br />\n <span id=\"message\">{params.message}</span>\n </div>\n\n <div className=\"card-body\">\n <Row>\n <Form>\n <Form.Group controlId=\"username\">\n <Form.Control type=\"text\" placeholder=\"Username\"></Form.Control>\n </Form.Group>\n\n <Form.Group controlId=\"password\">\n <Form.Control type=\"password\" placeholder=\"Password\"></Form.Control>\n </Form.Group>\n\n <Button variant=\"primary\" type=\"submit\" onClick={event => params.submitLogin(event)}>Login</Button>\n </Form>\n </Row>\n </div>\n </div>\n </Container>\n\n );\n}", "title": "" }, { "docid": "a84f686654683011dd138b77ad9ce53c", "score": "0.56519544", "text": "render(){\n return(\n <div className='sign-in'>\n <h1 className='title'>I already have an account</h1>\n <span>sign in using your email address and password </span>\n\n <form >\n <FormInput handleChange={this.handleChange} name='email' type='email' value={this.state.email} label='email' required />\n <FormInput handleChange={this.handleChange} name='password' type='password' value={this.state.password} label='password' required/>\n <div className='sign-in-container'>\n <CustomButton onClick={this.handleSubmit} type='submit' value='submit form'>\n Sign In\n </CustomButton>\n <CustomButton onClick={signInWithGoogle} isGoogleSignIn>Sign In using Google</CustomButton>\n </div>\n </form>\n </div>\n )\n }", "title": "" }, { "docid": "2b62aa8d4832d75bf015d36871807f63", "score": "0.5651515", "text": "async function authSubmitHandler() {\n try {\n const response = await fetch(LINK + '/login', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n phoneNo: phoneNo,\n password: password,\n userType: selectedMode.name,\n }),\n });\n const responseData = await response.json();\n if (!response.ok) {\n throw new Error(responseData.message);\n } else {\n global.user = responseData.user;\n navigation.navigate(selectedMode.tabs);\n }\n } catch (err) {\n alert('Incorrect Credentials');\n }\n }", "title": "" }, { "docid": "079f4313c8e6cced54a5857c301f4f93", "score": "0.5651344", "text": "function onLogIn() {\n $(\"#LoginDialog\").modal();\n}", "title": "" }, { "docid": "1eb12b7d7f62055804d619afa049a849", "score": "0.56494504", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n\n // get the user profile\n generateProfile();\n }", "title": "" }, { "docid": "330349840ed2e6a93ee073e040eb4a30", "score": "0.56486905", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "330349840ed2e6a93ee073e040eb4a30", "score": "0.56486905", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "5554fe997acbacfc6deb34fadfdaceba", "score": "0.564495", "text": "function loginAndSubmitForm() {\n\t\t// hide the forms for logging in and signing up\n\t\t$loginForm.hide();\n\t\t$createAccountForm.hide();\n\n\t\t// reset those forms\n\t\t$loginForm.trigger('reset');\n\t\t$createAccountForm.trigger('reset');\n\n\t\t// show the stories\n\t\t$allStoriesList.show();\n\n\t\t// update the navigation bar\n\t\tshowNavForLoggedInUser();\n\t\tgenerateProfile();\n\t}", "title": "" }, { "docid": "81136c93122af8a4ff8dac6f3c9dc2bc", "score": "0.56415534", "text": "render() {\n const { from } = this.props.location.state || { from: { pathname: '/home' } };\n // if correct authentication, redirect to page instead of login screen\n if (this.state.redirectToReferer) {\n return <Redirect to={from} />;\n }\n // Otherwise return the Login form.\n return (\n <div className=\"container-fluid pb-5\">\n <div className=\"row justify-content-center\">\n <div className=\"col-lg-3 col-10 mt-5 px-5 py-3 rounded shadow text-center\">\n <div className=\"row justify-content-center\">\n <div className=\"col-lg-5 col-5 text-center\">\n <img src=\"/images/signin-signup.png\" alt={'paw logo'}/>\n </div>\n <div className=\"col-12 text-center pt-3\">\n <h1>Sign In</h1>\n <hr />\n </div>\n <Form onSubmit={this.submit} >\n <div className=\"form\">\n <div className=\"col-12 text-left pt-3\">\n <label>Email</label>\n <Form.Input \n id=\"signin-form-email\"\n name=\"email\"\n type=\"email\"\n onChange={this.handleChange} ><input className=\"form-control mt-1 py-3 text-input\"/></Form.Input>\n </div>\n <div className=\"col-12 text-left pt-3\">\n <label>Password</label>\n <Form.Input \n id=\"signin-form-password\"\n name=\"password\"\n type=\"password\"\n onChange={this.handleChange} ><input className=\"form-control mt-1 py-3 text-input\"/></Form.Input>\n <p className=\"caption\">Need to create an account? Sign up <Link to=\"/signup\">here.</Link></p>\n </div>\n <div className=\"col-12 text-center pt-3\">\n <button className=\"btn btn-custom\">Submit</button>\n </div>\n </div>\n </Form>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Login was not successful\"\n content={this.state.error}\n />\n )}\n </div>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "36546cc43e4dbb764f634a407e9a106a", "score": "0.56411386", "text": "render() {\n return(\n <div className=\"form-container col-xs-12 col-sm-12 col-md-5 w-100 p-5\">\n <div className=\"form-controls w-75\">\n <h1 className=\"pb-2\">Login</h1>\n <p><input className=\"form-component w-100 p-2\" type=\"text\" name=\"username\" placeholder=\"Username\" onChange={this.handleChange} /></p>\n <p><input className=\"form-component w-100 p-2\" type=\"password\" name=\"password\" placeholder=\"Password\" onChange={this.handleChange} /></p>\n <p><button className=\"form-component form-btn w-100 p-2\" onClick={this.handleClick}>Login</button></p>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "70af3f11ce1b51c61a74cd93ffdbc525", "score": "0.56346464", "text": "showLoginModal() {\n this.set('loginModalOpen', true);\n }", "title": "" }, { "docid": "56d185248ba76fe7194995a18cc47caa", "score": "0.5631453", "text": "function openLoginModal() {\n\n //reset control's value for re-open the loginDial\n $(\"input[type=text] , input[type='password'] , textarea\").val(\"\");\n\n //reset error message from login modal popup\n $(\".Error\").html(\"\");\n $('#ModalSingup').modal('hide');\n $('#divloginModal').modal('show');\n}", "title": "" }, { "docid": "1ffd5d14745332efdd3fbc02e19f2fab", "score": "0.56242764", "text": "render() {\n const { isSigningUp } = this.state;\n return (\n <div className=\"login_form\">\n <div className=\"bp--login-field\">\n <TextField\n label=\"Username\"\n />\n </div>\n {userEmail(isSigningUp)}\n <div className=\"bp--login-field\">\n <TextField\n label=\"Password\"\n type=\"password\"\n />\n </div>\n {confirmPass(isSigningUp)}\n {userAge(isSigningUp)}\n <div className=\"bp--login-field\">\n <Button variant=\"raised\" disableFocusRipple={true} disableRipple={true}>{isSigningUp ? \"Join\" : \"Log in\"}</Button>\n </div>\n <div className=\"bp--login-field\">\n <a href={\"#\"} className=\"forgot_pass\">\n {\"Forgot Password?\"}\n </a>\n </div>\n {flexSetting(isSigningUp, this.toggleSignUp)}\n </div>\n );\n }", "title": "" }, { "docid": "52280f5b1d9d006234fa3c383be656a4", "score": "0.5623706", "text": "function LoginPage(navCtrl, store, data, formBuilder, loading, loadingController, fcm, utility, events, app, getSet, httpProvider) {\n this.navCtrl = navCtrl;\n this.store = store;\n this.data = data;\n this.formBuilder = formBuilder;\n this.loading = loading;\n this.loadingController = loadingController;\n this.fcm = fcm;\n this.utility = utility;\n this.events = events;\n this.app = app;\n this.getSet = getSet;\n this.httpProvider = httpProvider;\n this._loginListener = new __WEBPACK_IMPORTED_MODULE_6_rxjs_Subscription__[\"Subscription\"]();\n this.type = 'password';\n this.showPass = false;\n this.showfooter = true;\n var self = this;\n window.addEventListener('native.keyboardshow', keyboardShowHandler);\n function keyboardShowHandler(e) {\n self.showfooter = false;\n }\n window.addEventListener('native.keyboardhide', keyboardHideHandler);\n function keyboardHideHandler(e) {\n self.showfooter = true;\n }\n this.versionNo = this.getSet.getVersionNo();\n this.user = this.formBuilder.group({\n username: ['', __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"h\" /* Validators */].required],\n password: ['', __WEBPACK_IMPORTED_MODULE_1__angular_forms__[\"h\" /* Validators */].required]\n });\n }", "title": "" }, { "docid": "ffb77a7c09474dd841b3373214277505", "score": "0.5622317", "text": "function showLoginModal() {\n\t\t\tCookies.set('redirect_url', window.location.pathname);\n\t\t\t$('#_modal-login').modal('show');\n\t\t}", "title": "" }, { "docid": "fbdd9d35025a044c8ead61e4d0edcedb", "score": "0.56207544", "text": "render() {\n if (this.state.redirect) {\n return <Redirect to=\"/home\" />;\n }\n\n return (\n <div>\n <div className = \"titleName\" style={{paddingTop:\"70px\"}}>\n <img id=\"mainlogo\" src={require(\"../Images/logo.png\")}></img>\n <span>Health Tracker</span>\n \n </div>\n <div id=\"loginform\">\n <div\n className=\"container login-container\"\n style={{ marginTop: \"2%\", marginBottom: \"5%\" }}\n >\n <form onSubmit={this.onSubmit}>\n <h3\n style={{\n textAlign: \"center\",\n marginBottom: \"5%\",\n fontSize: \"50px\"\n }}\n >\n Log In\n </h3>\n <div className=\"form-group\">\n <label style={{ fontWeight: \"bold\" }} for=\"email1\">\n Email:\n </label>\n <input\n className=\"form-control\"\n type=\"text\"\n required\n id=\"email1\"\n value={this.state.email}\n onChange={this.onChangeEmail}\n />\n </div>\n <div className=\"form-group\">\n <label style={{ fontWeight: \"bold\" }} for=\"pw\">\n Password:\n </label>\n <input\n className=\"form-control\"\n type={this.state.hidden ? \"password\" : \"text\"}\n required\n id=\"pw\"\n value={this.state.password}\n onChange={this.onChangePass}\n />\n </div>\n\n <div className=\"form-group text-center\">\n <input\n className=\"btn btn-primary btn-lg #1e1e6e\"\n type=\"submit\"\n value=\"Log In\"\n style={{ backgroundColor: \"#1e1e6e\" }}\n />\n </div>\n <Link\n className=\"nav-link\"\n to={`/register`}\n style={{ textAlign: \"center\" }}\n >\n Register\n </Link>\n </form>\n </div>\n </div>\n <Footer />\n </div>\n );\n }", "title": "" }, { "docid": "80613f911b0e1ad7075b13419acc51d7", "score": "0.56197983", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // show new story form\n $submitForm.removeClass(\"hidden\");\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "c5568668994e9b38e02daf6940c1c82f", "score": "0.5618475", "text": "render() {\n let { email, password, address, phone, code, name, driverNumber } = this.state.object;\n let hide = <i className=\"fa fa-eye-slash\" />;\n let show = <i class=\"fa fa-eye\" />\n return (\n <div className=\"modal fade\" id=\"create-carrier\" tabIndex=\"-1\">\n <div className=\"modal-dialog modal-lg\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <h5 className=\"modal-title\"><Icon className=\"icon_star\" theme=\"filled\" />Tạo mới tài xế</h5>\n <button type=\"button\" className=\"close\" data-dismiss=\"modal\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n {/* <div className=\"modal-body\">\n <div className=\"container\">\n <Form\n form='form'\n onSubmit={this.handleSubmit}\n >\n <div className=\"row\">\n <div className=\"col-sm-6\">\n <Input\n type=\"file\"\n name=\"avatar\"\n data-provide=\"dropify\"\n onChange={(event) => this.fileChangedHandler(event)}\n className=\"avt_input\"\n // validations={[required]}\n />\n\n <Form.Item className=\"phone_input\">\n <label style={{ color: 'black' }}>Số điện thoại</label><label style={{ color: 'red' }}>*</label>\n {getFieldDecorator('phone', {\n rules: [{ required: true, message: \"Số điện thoại không được để trống!\" },\n { validator: this.phoneValidator }],\n })(\n <Input length=\"10\" type=\"number\" placeholder=\"Vui lòng nhập Số điện thoại\" />\n )}\n </Form.Item>\n\n <Form.Item className=\"driverNumber_input\">\n <label style={{ color: 'black' }}>Biển số xe</label>\n {getFieldDecorator('driverNumber', {\n rules: [{ validator: this.driverNumberValidator }]\n })(\n <Input placeholder=\"Vui lòng nhập Biển số xe\" type=\"text\" />\n )}\n </Form.Item>\n\n\n </div>\n <div className=\"col-sm-6\">\n <Form.Item\n className=\"code_input\"\n >\n <label style={{ color: 'black' }}>Mã tài xế</label><label style={{ color: 'red' }}>*</label>\n {getFieldDecorator('code', {\n rules: [{ required: true, message: \"Mã tài xế không được để trống!\" }],\n })(\n <Input type=\"text\" placeholder=\"Vui lòng nhập Mã tài xế\" />\n )}\n </Form.Item>\n <Form.Item className=\"name_input\">\n <label style={{ color: 'black' }}>Tên tài xế</label><label style={{ color: 'red' }}>*</label>\n {getFieldDecorator('name', {\n rules: [{ required: true, message: \"Tên tài xế không được để trống!\" }]\n })(\n <Input placeholder=\"Vui lòng nhập Tên tài xế\" type=\"text\" />\n )}\n </Form.Item>\n\n <div className=\"child_form\">\n\n <Form.Item className=\"email_input\">\n <label style={{ color: 'black' }}>Email</label><label style={{ color: 'red' }}>*</label>\n {getFieldDecorator('email', {\n rules: [{ required: true, message: \"Email không được để trống!\" },\n { validator: this.emailValidator }],\n })(\n <Input placeholder=\"Vui lòng nhập Email\"\n type=\"text\"\n />\n )}\n </Form.Item>\n\n <Form.Item className=\"password_input\">\n <label style={{ color: 'black' }}>Mật khẩu</label><label style={{ color: 'red' }}>*</label>\n {getFieldDecorator('password', {\n rules: [{ required: true, message: \"Mật khẩu không được để trống!\" },\n { validator: this.passwordValidator }],\n\n })(\n <div>\n <Input\n placeholder=\"Vui lòng nhập mật khẩu!\"\n autoComplete=\"new-password\"\n type={this.state.isShowPass ? \"text\" : \"password\"}></Input>\n <span\n className=\"eye-show\"\n onClick={() => {\n this.setState({ isShowPass: !this.state.isShowPass });\n }}>{this.state.isShowPass ? show : hide} </span>\n </div>\n )}\n </Form.Item>\n </div>\n </div>\n </div>\n <div className=\"row\">\n <div className=\"col-12\">\n <Form.Item className=\"address_input\">\n <label style={{ color: 'black' }}>Địa chỉ</label>\n {getFieldDecorator('address', {\n })(\n <Input.TextArea\n placeholder=\"Vui lòng nhập Địa chỉ\"\n />\n )}\n </Form.Item>\n </div>\n </div>\n\n <footer className=\"card-footer text-center\">\n <Button type=\"primary\" htmlType=\"submit\">\n <Icon type=\"save\" /> Lưu\n </Button>\n <Button\n type=\"danger\"\n data-dismiss=\"modal\"\n style={{ marginLeft: \"10px\" }}\n onClick={() => { this.props.form.resetFields() }}\n >Đóng\n </Button>\n </footer>\n </Form>\n </div>\n </div> */}\n <form\n onSubmit={this.handleSubmit}\n ref={(c) => {\n this.form = c;\n }}>\n <div className=\"modal-body\" id=\"form_body\">\n <div className=\"site-card-border-less-wrapper container\">\n <div className=\"row\">\n <div className=\"col-sm-6\">\n <div className=\"form-group row\">\n <div className=\"col-sm-12\">\n <Input\n type=\"file\"\n name=\"avatar\"\n data-provide=\"dropify\"\n onChange={(event) => this.fileChangedHandler(event)}\n className=\"avt_input\"\n />\n </div>\n </div>\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Số điện thoại <label style={{ color: 'red' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input\n type=\"text\"\n name=\"phone\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\" }}\n placeholder=\"Vui lòng nhập Số điện thoại\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n value={phone}\n ></Input>\n {\n this.state.errors.phone ?\n (\n <div className=\"alert alert-danger alert alert-danger--custom ant-form-explain\">\n <span>{this.state.errors.phone}</span>\n </div>\n ) : (\"\")\n }\n </div>\n </div>\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Biển số xe <label style={{ color: 'white' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input\n type=\"text\"\n name=\"driverNumber\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\" }}\n placeholder=\"Nhập vào Biển số xe\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n value={driverNumber}\n ></Input>\n </div>\n </div>\n </div>\n <div className=\"col-sm-6\" style={{ marginTop: \"auto\" }}>\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Mã tài xế <label style={{ color: 'red' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input\n type=\"text\"\n name=\"code\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\" }}\n placeholder=\"Vui lòng nhập Mã tài xế\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n value={code}\n ></Input>\n {\n this.state.errors.code ?\n (\n <div className=\"alert alert-danger alert alert-danger--custom ant-form-explain\">\n <span>{this.state.errors.code}</span>\n </div>\n ) : (\"\")\n }\n </div>\n </div>\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Tên tài xế <label style={{ color: 'red' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input\n type=\"text\"\n name=\"name\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\" }}\n placeholder=\"Vui lòng nhập Tên tài xế\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n value={name}\n ></Input>\n {\n this.state.errors.name ?\n (\n <div className=\"alert alert-danger alert alert-danger--custom ant-form-explain\">\n <span>{this.state.errors.name}</span>\n </div>\n ) : (\"\")\n }\n </div>\n </div>\n <div className=\"child_form\">\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Email <label style={{ color: 'red' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input\n type=\"text\"\n name=\"email\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\" }}\n placeholder=\"Vui lòng nhập Email\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n value={email}\n ></Input>\n {\n this.state.errors.email ?\n (\n <div className=\"alert alert-danger alert alert-danger--custom ant-form-explain\">\n <span>{this.state.errors.email}</span>\n </div>\n ) : (\"\")\n }\n </div>\n </div>\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Mật khẩu <label style={{ color: 'red' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input\n type=\"text\"\n name=\"password\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\", paddingRight: \"40px\" }}\n placeholder=\"Vui lòng nhập Mật khẩu\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n autoComplete=\"new-password\"\n value={password}\n type={this.state.isShowPass ? \"text\" : \"password\"}>\n </Input>\n {\n this.state.errors.password ?\n (\n <div className=\"alert alert-danger alert alert-danger--custom ant-form-explain\">\n <span>{this.state.errors.password}</span>\n </div>\n ) : (\"\")\n }\n <span\n className=\"eye-show-create\"\n onClick={() => {\n this.setState({ isShowPass: !this.state.isShowPass });\n }}>{this.state.isShowPass ? show : hide} </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"row\">\n <div className=\"col-sm-12\">\n <div className=\"form-group row\">\n <label id=\"input_name\" htmlFor=\"input_value\" className=\"col-sm-5 col-form-label\">Địa chỉ <label style={{ color: 'white' }}>*</label></label>\n <div className=\"col-sm-12\">\n <Input.TextArea\n type=\"text\"\n name=\"address\"\n className=\"form-control input_value\"\n\n style={{ color: \"black\" }}\n place=\"Nhập vào địa chỉ\"\n onBlur={this.handleBlur}\n onChange={this.onChange}\n value={address}\n ></Input.TextArea>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"modal-footer\">\n <div id=\"form_footer\">\n <footer className=\"card-footer text-center footer_form\">\n <Button type=\"primary\" htmlType=\"submit\">\n <Icon type=\"save\" /> Lưu\n </Button>\n <Button\n type=\"danger\"\n data-dismiss=\"modal\"\n style={{ marginLeft: \"10px\" }}\n onClick={(e) => { this.resetForm() }}\n >Đóng\n </Button>\n </footer>\n </div>\n </div>\n </form>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "7c01552f4d0f713445c26fcbeb1e8b98", "score": "0.561718", "text": "render() {\n const { username, password, errorMsg } = this.state\n const { loginCardActive } = this.props;\n const loginCardClasses = loginCardActive ? 'loginSignup active' : 'loginSignup';\n\n return (\n <div className={loginCardClasses}>\n <div className=\"loginDetails\">\n <button type=\"button\" className=\"close secondaryButton\" onClick={this.handleClose}>x</button>\n <h2 className=\"heading\">Login</h2>\n {(\n !!errorMsg.length\n && <p className=\"error\">{errorMsg}</p>\n )}\n <form>\n <label htmlFor=\"username\">Username:</label>\n <input\n type=\"text\"\n value={username}\n onChange={this.handleChange}\n id=\"username\"\n name=\"username\"\n required\n size=\"20\"\n />\n <label htmlFor=\"password\">Password:</label>\n <input\n type=\"password\"\n value={password}\n onChange={this.handleChange}\n id=\"password\"\n name=\"password\"\n required\n size=\"20\"\n />\n <button type=\"submit\" id=\"submitLogin\" onClick={this.handleLogin}>Submit</button>\n </form>\n </div>\n <a\n target=\"_self\"\n href=\"/auth/google\"\n className=\"googleLogin\"\n >\n <button type=\"button\" className=\"secondaryButton\">Continue with Google</button>\n </a>\n <button type=\"submit\" className=\"secondaryButton\" id=\"submitGuestLogin\" onClick={this.handleGuestLogin}>Log In as Guest</button>\n <p>\n Don't have an account?\n <button type=\"button\" className=\"greenLink\" onClick={this.switchToSignup}>Sign up</button>\n to save your itineraries!\n </p>\n </div>\n );\n }", "title": "" }, { "docid": "0995a373e327ee8c8c5c36afdd97f469", "score": "0.5617138", "text": "function invoke_login_modal() {\n\t$('#registration_modal').modal('hide');\n\t$('#login_modal').modal('show');\n}", "title": "" }, { "docid": "2d11a74c3aedd7d00ae6646049ff025c", "score": "0.56157416", "text": "render() {\n const { classes } = this.props;\n\n // check for redirects\n if (this.state.redirect) {\n // perform redirect\n return <Redirect to={this.state.redirect} />\n }\n /* Return code to be displayed on screen\n Login form\n */\n return (\n <Container component=\"main\" maxWidth=\"xs\">\n <CssBaseline />\n <div className={classes.paper}>\n <Avatar className={classes.avatar}>\n <LockOutlinedIcon />\n </Avatar>\n <Typography component=\"h1\" variant=\"h5\">\n Sign in\n </Typography>\n {/* Login HTML Form */}\n <form className={classes.form} noValidate>\n <TextField\n variant=\"outlined\"\n margin=\"normal\"\n required\n error={this.state.emailError}\n helperText={this.state.emailError}\n fullWidth\n id=\"email\"\n label=\"Email\"\n name=\"email\"\n autoComplete=\"email\"\n autoFocus\n />\n <TextField\n variant=\"outlined\"\n margin=\"normal\"\n required\n error={this.state.passwordError}\n helperText={this.state.passwordError}\n fullWidth\n name=\"password\"\n label=\"Password\"\n type=\"password\"\n id=\"password\"\n autoComplete=\"current-password\"\n />\n <Button\n type=\"submit\"\n fullWidth\n variant=\"contained\"\n color=\"primary\"\n className={classes.submit}\n onClick={this.handleLogin}\n >\n Sign In\n </Button>\n <Grid container justify=\"center\">\n <Grid item>\n <Link href=\"/register/student\" variant=\"body2\">\n {\"Don't have an account? Sign Up\"}\n </Link>\n </Grid>\n </Grid>\n </form>\n </div>\n </Container>\n );\n }", "title": "" }, { "docid": "6e6e6a7db2b507b07b9930e50e0b699a", "score": "0.5613917", "text": "handleLogInModal() {\n if (this.state.ifLogged) {\n this.setState({\n ifLogged:false,\n currentUser: {\n 'id': null,\n 'firstname': '',\n 'lastname': '',\n 'username': '',\n 'password': '',\n 'email': ''\n }\n });\n }else{\n this.setState((preState) => ({\n modalToggle:!preState.modalToggle\n }));\n }\n }", "title": "" }, { "docid": "fa494fd8eccffbd2b65251b7ea220e91", "score": "0.5607778", "text": "renderEditPassModal() {\n // Check to see if there even is a password set on the poll\n if (this.props.poll._id !== '123' && !this.state.validated) {\n Meteor.call('polls.checkEditPass',\n this.props.poll._id,\n '', (err) => {\n if (!err) {\n this.setState({ validated: true });\n }\n }\n );\n // Render modal for prompting for the password to edit the poll\n return (\n <Modal\n show={!this.state.validated}\n >\n <Modal.Header>\n <Modal.Title>Administration Password Needed.</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <form onSubmit={this.checkEditPass}>\n <FormGroup controlId={'handle'}>\n <ControlLabel>Please enter the administrator password to\n access this poll's edit options: </ControlLabel>\n <FormControl\n onChange={this.handleEditPassChange}\n type=\"password\"\n value={this.state.editPass}\n placeholder=\"Please enter the editing password.\"\n />\n <HelpBlock>{this.state.passValidError}</HelpBlock>\n </FormGroup>\n </form>\n </Modal.Body>\n <Modal.Footer>\n <Button\n onClick={this.checkEditPass}\n bsStyle=\"success\"\n type=\"submit\"\n >Submit</Button>\n </Modal.Footer>\n\n </Modal>\n );\n }\n return '';\n }", "title": "" }, { "docid": "02e5328959fc35ce0246c873fa11fa00", "score": "0.5589183", "text": "render() {\n return (\n \t<div className='sign-in'>\n\t\t\t\t<h2> I already have an account </h2>\n\t\t\t\t<span> Sign in with your email and password </span>\n\n\t\t\t\t<form onSubmit={this.handleSubmit}>\n\t\t\t\t\t<FormInput \n\t\t\t\t\t\tname=\"email\" \n\t\t\t\t\t\ttype=\"email\"\n\t\t\t\t\t\tlabel=\"email\" \n\t\t\t\t\t\tvalue={this.state.email} \n\t\t\t\t\t\thandleChange={this.handleChange} \n\t\t\t\t\t\trequired \n\t\t\t\t\t/>\n\t\t\t\t\t<FormInput \n\t\t\t\t\t\tname=\"password\" \n\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\tlabel=\"password\" \n\t\t\t\t\t\tvalue={this.state.password}\n\t\t\t\t\t\thandleChange={this.handleChange} \n\t\t\t\t\t\trequired \n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className='buttons'>\n\t\t\t\t\t\t<CustomButton type='submit'>\n\t\t\t\t\t\t\tSign Up\n\t\t\t\t\t\t</CustomButton>\n\t\t\t\t\t\t<CustomButton onClick={signInWithGoogle} isGoogleSignIn>\n\t\t\t\t\t\t\tSign In With Google\n\t\t\t\t\t\t</CustomButton>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t</form>\n\n\t\t\t</div>\n );\n }", "title": "" }, { "docid": "5b1e37c9c543fb45a57dbcbb98341787", "score": "0.55820924", "text": "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n\n // get a user profile\n generateUserProfile();\n }", "title": "" } ]
2ad49abfbfd258b85d25ececcd4104d5
TODO: Explore using CSS.escape when it becomes more available in evergreen browsers.
[ { "docid": "545a3e0a4e97b239c5343556fe04c4f8", "score": "0.6720579", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n} // ", "title": "" } ]
[ { "docid": "2fac5057e78574982657f1b57984f4ff", "score": "0.7277594", "text": "function escapeCSSString(cssString) {\n return cssString.replace(/(:)/g, \"\\\\$1\");\n}", "title": "" }, { "docid": "2fac5057e78574982657f1b57984f4ff", "score": "0.7277594", "text": "function escapeCSSString(cssString) {\n return cssString.replace(/(:)/g, \"\\\\$1\");\n}", "title": "" }, { "docid": "7d0cd2531d8a62cfa096e82a83319493", "score": "0.72638476", "text": "function escapeCSSString(cssString) {\n return cssString.replace(/(:)/ug, \"\\\\$1\");\n}", "title": "" }, { "docid": "c85f4b33906d799a0b25f89ea2747baa", "score": "0.6643223", "text": "function escapeCssStrChar(ch) {\n return cssStrChars[ch]\n || (cssStrChars[ch] = '\\\\' + ch.charCodeAt(0).toString(16) + ' ');\n }", "title": "" }, { "docid": "4f82fe67d4114945a12bdf94ef478577", "score": "0.659034", "text": "function decodeCssEscape(s) {\n var i = parseInt(s.substring(1), 16);\n // If parseInt didn't find a hex diigt, it returns NaN so return the\n // escaped character.\n // Otherwise, parseInt will stop at the first non-hex digit so there's no\n // need to worry about trailing whitespace.\n if (i > 0xffff) {\n // A supplemental codepoint.\n return i -= 0x10000,\n String.fromCharCode(\n 0xd800 + (i >> 10),\n 0xdc00 + (i & 0x3FF));\n } else if (i == i) {\n return String.fromCharCode(i);\n } else if (s[1] < ' ') {\n // \"a backslash followed by a newline is ignored\".\n return '';\n } else {\n return s[1];\n }\n }", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "d97c7b9f8d9bfdd0f551ae08f17f3457", "score": "0.6531447", "text": "function escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "929af8b966c1ab1f59b2385551c56a13", "score": "0.6512681", "text": "function cssRule(literals){var placeholders=[];for(var _i=1;_i<arguments.length;_i++){placeholders[_i-1]=arguments[_i];}var result='';for(var i=0;i<placeholders.length;i++){result+=literals[i];var placeholder=placeholders[i];if(placeholder===null){result+='transparent';}else{result+=placeholder.toString();}}result+=literals[literals.length-1];return result;}", "title": "" }, { "docid": "5c8756125af7511b02daa7f2fa0cabef", "score": "0.6367007", "text": "function escapeCssString(s, replacer) {\n return '\"' + s.replace(/[\\u0000-\\u001f\\\\\\\"<>]/g, replacer) + '\"';\n }", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "cd1d93f871a39b1fac2455cc823dc286", "score": "0.6340018", "text": "function escape(str) {\n return str\n // Replace all possible CSS selectors\n .replace(escapeRegex, '-')\n\n // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}", "title": "" }, { "docid": "586e7b55474e2509bfb4396bea5b8562", "score": "0.6304892", "text": "function escapeCssUrlChar(ch) {\n return cssUrlChars[ch]\n || (cssUrlChars[ch] = (ch < '\\x10' ? '%0' : '%')\n + ch.charCodeAt(0).toString(16));\n }", "title": "" }, { "docid": "ad1b958fbe75814157bb1331d3765e52", "score": "0.5999725", "text": "function wrapInlineCSS(text) {\n\t return '*{' + text + '}';\n\t}", "title": "" }, { "docid": "bf7063695e9223a01cbad0ee11e8d3aa", "score": "0.59970325", "text": "function StyleSanitizeFn(){}", "title": "" }, { "docid": "26561e7b7d027a9c2c7ff4aa5a545876", "score": "0.5966622", "text": "function css(content) {\n const element = document.createElement('style')\n element.textContent = content\n document.head.appendChild(element)\n }", "title": "" }, { "docid": "92b2106a6f35d939ba306825c23e854d", "score": "0.58532184", "text": "function StyleSanitizeFn() { }", "title": "" }, { "docid": "92b2106a6f35d939ba306825c23e854d", "score": "0.58532184", "text": "function StyleSanitizeFn() { }", "title": "" }, { "docid": "d2461fb80cab76f0dc65c7b59cdc9df3", "score": "0.58295643", "text": "function StyleSanitizeFn() {}", "title": "" }, { "docid": "e620f56b8111c4ebb177a42315b78a48", "score": "0.5810445", "text": "function escapeSelector(sel) {\n return (sel + \"\").replace(/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g, fcssescape);\n }", "title": "" }, { "docid": "2bba871714519c6f6289da8a8b1ab2fd", "score": "0.57904583", "text": "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: '\\\\.' + IDENT_RE\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/, end: /\\}/,\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n { begin: /;/ }, // empty ; rule\n RULE,\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "05cba5457b0ece768d467dc105a07d33", "score": "0.57454616", "text": "function sanitize(s){return s.replace(/[&<>'\"_]/g,'-');// used on all output token CSS classes\n}", "title": "" }, { "docid": "8e767b19d94eb323306c0d0c62731e94", "score": "0.57335895", "text": "function css(hljs) {\n\t var FUNCTION_LIKE = {\n\t begin: /[\\w-]+\\(/, returnBegin: true,\n\t contains: [\n\t {\n\t className: 'built_in',\n\t begin: /[\\w-]+/\n\t },\n\t {\n\t begin: /\\(/, end: /\\)/,\n\t contains: [\n\t hljs.APOS_STRING_MODE,\n\t hljs.QUOTE_STRING_MODE,\n\t hljs.CSS_NUMBER_MODE ]\n\t }\n\t ]\n\t };\n\t var ATTRIBUTE = {\n\t className: 'attribute',\n\t begin: /\\S/, end: ':', excludeEnd: true,\n\t starts: {\n\t endsWithParent: true, excludeEnd: true,\n\t contains: [\n\t FUNCTION_LIKE,\n\t hljs.CSS_NUMBER_MODE,\n\t hljs.QUOTE_STRING_MODE,\n\t hljs.APOS_STRING_MODE,\n\t hljs.C_BLOCK_COMMENT_MODE,\n\t {\n\t className: 'number', begin: '#[0-9A-Fa-f]+'\n\t },\n\t {\n\t className: 'meta', begin: '!important'\n\t }\n\t ]\n\t }\n\t };\n\t var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n\t var AT_MODIFIERS = \"and or not only\";\n\t var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n\t var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n\t var RULE = {\n\t begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/, returnBegin: true, end: ';', endsWithParent: true,\n\t contains: [\n\t ATTRIBUTE\n\t ]\n\t };\n\n\t return {\n\t name: 'CSS',\n\t case_insensitive: true,\n\t illegal: /[=|'\\$]/,\n\t contains: [\n\t hljs.C_BLOCK_COMMENT_MODE,\n\t {\n\t className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n\t },\n\t {\n\t className: 'selector-class', begin: '\\\\.' + IDENT_RE\n\t },\n\t {\n\t className: 'selector-attr',\n\t begin: /\\[/, end: /\\]/,\n\t illegal: '$',\n\t contains: [\n\t hljs.APOS_STRING_MODE,\n\t hljs.QUOTE_STRING_MODE ]\n\t },\n\t {\n\t className: 'selector-pseudo',\n\t begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n\t },\n\t // matching these here allows us to treat them more like regular CSS\n\t // rules so everything between the {} gets regular rule highlighting,\n\t // which is what we want for page and font-face\n\t {\n\t begin: '@(page|font-face)',\n\t lexemes: AT_IDENTIFIER,\n\t keywords: '@page @font-face'\n\t },\n\t {\n\t begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n\t // because it doesn’t let it to be parsed as\n\t // a rule set but instead drops parser into\n\t // the default mode which is how it should be.\n\t illegal: /:/, // break on Less variables @var: ...\n\t returnBegin: true,\n\t contains: [\n\t {\n\t className: 'keyword',\n\t begin: AT_PROPERTY_RE\n\t },\n\t {\n\t begin: /\\s/, endsWithParent: true, excludeEnd: true,\n\t relevance: 0,\n\t keywords: AT_MODIFIERS,\n\t contains: [\n\t {\n\t begin: /[a-z-]+:/,\n\t className:\"attribute\"\n\t },\n\t hljs.APOS_STRING_MODE,\n\t hljs.QUOTE_STRING_MODE,\n\t hljs.CSS_NUMBER_MODE\n\t ]\n\t }\n\t ]\n\t },\n\t {\n\t className: 'selector-tag', begin: IDENT_RE,\n\t relevance: 0\n\t },\n\t {\n\t begin: /\\{/, end: /\\}/,\n\t illegal: /\\S/,\n\t contains: [\n\t hljs.C_BLOCK_COMMENT_MODE,\n\t { begin: /;/ }, // empty ; rule\n\t RULE ]\n\t }\n\t ]\n\t };\n\t}", "title": "" }, { "docid": "e5350b91776e6fce43b4f368a59c0268", "score": "0.5716058", "text": "_css() {\n return [\n 'font-family: Monaco, Consolas, monospace',\n 'margin: 0 0 1rem 0',\n 'padding: 1rem 2rem',\n 'background-color: rgba(0,0,0,.05)',\n 'border-radius: 6px',\n ].join( '; ' );\n }", "title": "" }, { "docid": "e080fc5c0833545c2272a40c3b70d056", "score": "0.564066", "text": "function ExtraCSS() \n{\n var ecssar = ExCss.split(\"\\n\");\n\t\n\tfor(i=0; i < ecssar.length; i++)\n\t{\n\t emoteRules[\"exCSS\" + i] = ecssar[i];\n\t}\n\t\n\tif(chrome)\n\t{\n\t ecssar = ecssCH.split(\"\\n\");\n\t}\n\telse\n\t{\n\t ecssar = ecssFF.split(\"\\n\");\n\t}\n\t\n\tfor(i=0; i < ecssar.length; i++)\n\t{\n\t emoteRules[\"exCSSsp\" + i] = ecssar[i];\n\t}\n\n\n}", "title": "" }, { "docid": "29f4bea26b0e139c5d5262c88f97962a", "score": "0.56254905", "text": "function SafeStyle(){}", "title": "" }, { "docid": "3fa2c9432a140a1196596abda5727cdf", "score": "0.5622224", "text": "function toCss(selector,style,options){\nif(options===void 0){\noptions={};\n}\n\nvar result='';\nif(!style)return result;\nvar _options=options,\n_options$indent=_options.indent,\nindent=_options$indent===void 0?0:_options$indent;\nvar fallbacks=style.fallbacks;\nif(selector)indent++;// Apply fallbacks first.\n\nif(fallbacks){\n// Array syntax {fallbacks: [{prop: value}]}\nif(Array.isArray(fallbacks)){\nfor(var index=0;index<fallbacks.length;index++){\nvar fallback=fallbacks[index];\n\nfor(var prop in fallback){\nvar value=fallback[prop];\n\nif(value!=null){\nif(result)result+='\\n';\nresult+=\"\"+indentStr(prop+\": \"+toCssValue(value)+\";\",indent);\n}\n}\n}\n}else {\n// Object syntax {fallbacks: {prop: value}}\nfor(var _prop in fallbacks){\nvar _value=fallbacks[_prop];\n\nif(_value!=null){\nif(result)result+='\\n';\nresult+=\"\"+indentStr(_prop+\": \"+toCssValue(_value)+\";\",indent);\n}\n}\n}\n}\n\nfor(var _prop2 in style){\nvar _value2=style[_prop2];\n\nif(_value2!=null&&_prop2!=='fallbacks'){\nif(result)result+='\\n';\nresult+=\"\"+indentStr(_prop2+\": \"+toCssValue(_value2)+\";\",indent);\n}\n}// Allow empty style in this case, because properties will be added dynamically.\n\n\nif(!result&&!options.allowEmpty)return result;// When rule is being stringified before selector was defined.\n\nif(!selector)return result;\nindent--;\nif(result)result=\"\\n\"+result+\"\\n\";\nreturn indentStr(selector+\" {\"+result,indent)+indentStr('}',indent);\n}", "title": "" }, { "docid": "1ecf2571890ddf4c23d51333cf5da754", "score": "0.5585902", "text": "function css(obj)\n{\n return Object.keys(obj).reduce(function(acc, x) {\n return acc + x + \"{\" + (\n x.charAt(0) == '@' ? css(obj[x]) : Object.keys(obj[x]).reduce(function(acc, y) {\n return acc + y + \":\" + obj[x][y] + \";\";\n }, \"\")) + \"}\";\n }, \"\");\n}", "title": "" }, { "docid": "bba00139b265a6e4a9e894e63ce602fb", "score": "0.552816", "text": "function css(hljs) {\n const modes = MODES(hljs);\n const PSEUDO_ELEMENTS$1 = PSEUDO_ELEMENTS;\n const PSEUDO_CLASSES$1 = PSEUDO_CLASSES;\n const AT_IDENTIFIER = '@[a-z-.]+'; // @font-face\n const AT_MODIFIERS = 'and or not only';\n const IDENT_RE = '[a-zA-Z-.][a-zA-Z0-9_.-]*';\n const VARIABLE = {\n className: 'variable',\n begin: '(\\\\$' + IDENT_RE + ')\\\\b',\n };\n const ret = {\n name: 'CSS',\n case_insensitive: true,\n illegal: \"[=/|']\",\n contains: [\n {\n className: 'sugar-function',\n begin: 'sugar\\\\.[a-zA-Z0-9-_\\\\.]+',\n contains: [hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE],\n },\n {\n className: 'sugar-mixin',\n begin: '@sugar\\\\.[a-zA-Z0-9-_\\\\.]+',\n contains: [hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE],\n },\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id',\n begin: '#[A-Za-z0-9_-]+',\n relevance: 0,\n },\n {\n className: 'selector-class',\n begin: '\\\\.[A-Za-z0-9_-]+',\n relevance: 0,\n },\n modes.ATTRIBUTE_SELECTOR_MODE,\n {\n className: 'selector-tag',\n begin: '\\\\b(' + TAGS.join('|') + ')\\\\b',\n // was there, before, but why?\n relevance: 0,\n },\n {\n className: 'selector-pseudo',\n begin: ':(' + PSEUDO_CLASSES$1.join('|') + ')',\n },\n {\n className: 'selector-pseudo',\n begin: '::(' + PSEUDO_ELEMENTS$1.join('|') + ')',\n },\n VARIABLE,\n {\n // pseudo-selector params\n begin: /\\(/,\n end: /\\)/,\n contains: [hljs.NUMBER_MODE],\n },\n {\n className: 'attribute',\n begin: '\\\\b(' + ATTRIBUTES.join('|') + ')\\\\b',\n },\n {\n begin: '\\\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\\\b',\n },\n // {\n // begin: ':',\n // end: ';',\n // contains: [\n // VARIABLE,\n // modes.HEXCOLOR,\n // hljs.NUMBER_MODE,\n // hljs.QUOTE_STRING_MODE,\n // hljs.APOS_STRING_MODE,\n // modes.IMPORTANT\n // ]\n // },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face',\n },\n {\n begin: '@',\n end: '[{;]',\n returnBegin: true,\n keywords: {\n $pattern: /[a-zA-Z-\\.]+/,\n keyword: AT_MODIFIERS,\n attribute: MEDIA_FEATURES.join(' '),\n },\n contains: [\n {\n begin: AT_IDENTIFIER,\n className: 'keyword',\n },\n {\n begin: /[a-zA-Z\\.-]+(?=:)/,\n className: 'attribute',\n },\n VARIABLE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n modes.HEXCOLOR,\n hljs.NUMBER_MODE,\n ],\n },\n ],\n };\n return ret;\n}", "title": "" }, { "docid": "4262ee4e15083c8673e30f2eb6e67ee2", "score": "0.55146295", "text": "function sanitize(s) {\r\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\r\n}", "title": "" }, { "docid": "4262ee4e15083c8673e30f2eb6e67ee2", "score": "0.55146295", "text": "function sanitize(s) {\r\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\r\n}", "title": "" }, { "docid": "3daa2a165b285c56cee0b023173a1c80", "score": "0.5477913", "text": "function W(e){var t=Ee.cssProps[e];return t||(t=Ee.cssProps[e]=B(e)||e),t}", "title": "" }, { "docid": "ef66de1c0edf626f8d788ced185ba013", "score": "0.5473795", "text": "function textToCSS(text){\r\n //Variables\r\n ///A temporary variable to store the output - returned at the end of the function\r\n var output = text;\r\n\r\n\r\n //Replacing\r\n ///Uses regex to remove all invalid characters, excluding spaces\r\n output = output.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\");\r\n\r\n ///Replaces any spaces with dashed\r\n output = output.replaceAll(\" \", \"-\");\r\n\r\n ///Converts the string to lower case\r\n output = output.toLowerCase();\r\n\r\n return output;\r\n}", "title": "" }, { "docid": "8df80ad2a8e8a80c5a3054d2411dc139", "score": "0.54642737", "text": "enterCss_expression(ctx) {\n\t}", "title": "" }, { "docid": "4edab69d07959a4776890bd62e48e92a", "score": "0.54497236", "text": "function set_css( str ) {\n m_style.cssText = str;\n }", "title": "" }, { "docid": "4edab69d07959a4776890bd62e48e92a", "score": "0.54497236", "text": "function set_css( str ) {\n m_style.cssText = str;\n }", "title": "" }, { "docid": "5d13ffd1ba906e8f9361e90a165925eb", "score": "0.54407656", "text": "function SafeStyle() {}", "title": "" }, { "docid": "5d13ffd1ba906e8f9361e90a165925eb", "score": "0.54407656", "text": "function SafeStyle() {}", "title": "" }, { "docid": "268ac18f2e3773e953a3b1397caa1bda", "score": "0.5434264", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n}", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.5427514", "text": "function SafeStyle() { }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.5427514", "text": "function SafeStyle() { }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.5427514", "text": "function SafeStyle() { }", "title": "" }, { "docid": "418cfe1348ee6404afc7ffe69021f10b", "score": "0.54040635", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n }", "title": "" }, { "docid": "3cb97a66ad1ef51bd4053440e4e9cd4c", "score": "0.5397355", "text": "function cssToDOM( name ) {\n return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) {\n return m1 + m2.toUpperCase();\n }).replace(/^-/, '');\n }", "title": "" }, { "docid": "864431aab0460bd4a7052e4032103437", "score": "0.53952545", "text": "function getAlienHTML() \n{\n return \"&nbsp;/^\\\\<br>|^|^|<br>&nbsp;/^\\\\\"; \n}", "title": "" }, { "docid": "4f024e2cc632eee12a27762a23dd93e8", "score": "0.5381236", "text": "function escapeContent (content) {\n return ('' + content).replace(/\"/g, '\\\\\"').replace(/\\r?\\n/g, '\" +\\n \"');\n }", "title": "" }, { "docid": "089f7fe5bf96b918670bc5185a8ce224", "score": "0.53656524", "text": "function escChannel(s) {\n return encodeURI(s).replace(/[?#]/g, function(v){ return '%'+v.charCodeAt(0).toString(16) });\n }//escChannel", "title": "" }, { "docid": "1a113213132021b6eb9bd84134ae4b64", "score": "0.53483015", "text": "function esc_id_attr(str) {\n return shell.esc(str).replace(/ /g, \"&#20;\").replace(/\\x09/g, \"&#09;\").replace(/\\x0a/g, \"&#0a;\").replace(/\\x0c/g, \"&#0c;\").replace(/\\x0d/g, \"&#0d;\");\n}", "title": "" }, { "docid": "5ec14b39df728d9a48dc5fc6e434cfd2", "score": "0.53402215", "text": "function writeCss(){\n\n\t\tvar css = createCssString();\n\t\tstyle.styleSheet ? style.styleSheet = css : style.innerHTML = css;\n\t}", "title": "" }, { "docid": "c6a59e97cfffeb01be8c6e7db9ae2ff1", "score": "0.53303033", "text": "function postMessageEscape(s) {\n return s.replace(/%/g, \"%%\").replace(/!/g, \"%-\");\n }", "title": "" }, { "docid": "44cbe824530880f36ed5667e82f09230", "score": "0.53268456", "text": "function luceneEscape(value) {\n return value.replace(/([\\!\\*\\+\\-\\=<>\\s\\&\\|\\(\\)\\[\\]\\{\\}\\^\\~\\?\\:\\\\/\"])/g, \"\\\\$1\");\n}", "title": "" }, { "docid": "23b3098c6a7c8e64332eaa7378a00ceb", "score": "0.5324539", "text": "constructor(string) {\n this.display = string; // the string precisely as it appears in the expl file\n\n this.mixedCase = removeStyleCharacters(string) // the display verison sans style characters * _ ~ ` and a trailing question mark, encoding style characters\n .split(/\\\\\\\\/g).map(string => string.replace(/\\\\/g, '')).join('\\\\\\\\'); // Remove backslashes that are escaping literal characters now that removeStyleCharacters has already run\n\n this.escapedMixedCase = CSS.escape(this.mixedCase);\n\n this.slug = this.mixedCase // This string encodes characters that will cause problems in the URL, but we do not encode all characters eg quotation marks. Must be reversable.\n .replace(/%/g, '%25') // This way you can't have collisions if the user names something with a % which we're using for encodings\n .replace(/\\\\\\\\/g, '%5C%5C') // a double backslash represents a literal backslash not an escape character\n .replace(/`/g, '%60') // Chrome automatically replaces in URL and could be misinterpreted on the command line as subshell\n .replace(/_/g, '%5C_') // Literal style characters are escaped so that when we parse the URL, we don't remove them with removeStyleCharacters\n .replace(/ /g, '_') // This must be done after literal underscores have received encoded backslashes above to distinguish between them and these\n .replace(/\\//g, '%2F')\n .replace(/([.,])(?=[\"'')}\\]]+$)/g, ''); // Allow links to contain terminal periods or commas eg he went to [[\"Spain.\"]]\n\n this.url = this.slug\n .replace(/#/g, '%23')\n\n this.fileName = this.slug // This string encodes characters that will cause problems in the URL, but we do not encode all characters eg quotation marks. Must be reversable.\n .replace(/\"/g, '%22')\n .replace(/'/g, '%27')\n .replace(/,/g, '%2C')\n .replace(/:/g, '%3A')\n .replace(/</g, '%3C')\n .replace(/>/g, '%3E')\n .replace(/\\|/g, '%7C')\n .replace(/\\*/g, '%2A')\n .replace(/\\?/g, '%3F');\n\n this.caps = this.mixedCase // This is the string that is used to find matches between links and topic names.\n .toUpperCase() // We want matches to be case-insensitive\n .replace(/\\?$/, '') // It should match whether or not both have trailing question marks\n .replace(/[\"”“’‘']/g, '') // We remove quotation marks so matches ignore them\n .replace(/\\(/g, '') // we remove parentheses to allow link texts to contain optional parentheses\n .replace(/\\)/g, '')\n .replace(/ +/g, ' ') // consolidate spaces\n .trim() // remove initial and leading space, eg when using interpolation syntax: [[{|display only} actual topic name]]\n\n this.requestFileName = encodeURIComponent(this.fileName); // This is the string that will be used to _request_ the file name on disk, so it needs to be encoded\n }", "title": "" }, { "docid": "7697ff2c9ca5ad60dcdec77bd05e3bcd", "score": "0.5306308", "text": "function makeCSS(){\n\tvar css = '\\\n\tbody{\\\n\tfont-family: '+ fontFamily +' !important;\\\n\tcolor: '+ fontColor +' !important;\\\n\t\tpadding: 1em 4em 2em 4em !important;\\\n\t\tline-height: 1.6em !important;\\\n\t}\\\n\t\\\n\t.meta, time{\\\n\t\tfont-size: 0.9em !important;\\\n\t\tfont-style: italic !important;\\\n\t}\\\n\t\\\n\tarticle{\\\n\t\tborder-bottom: 1px #bbb solid !important;\\\n\t}\\\n\t\\\n\tsection, form, input, frame, audio, textarea, button, object, option{\\\n\t\tdisplay: none !important;\\\n\t}\\\n\t\\\n\tiframe[src*=\"youtube\"], iframe[src*=\"vimeo\"]{\\\n\t\tdisplay: block !important;\\\n\t}\\\n\t\\\n\tiframe{\\\n\t\tdisplay: none;\\\n\t}\\\n\t\\\n\ta{\\\n\t\ttext-decoration: none !important;\\\n\t}\\\n\t\\\n\ta:hover{\\\n\t\ttext-decoration: underline !important;\\\n\t}\\\n\t';\n\tstyle = document.createElement('style');\n\tstyle.type = 'text/css';\n\tif (style.styleSheet){\n\t style.styleSheet.cssText = css;\n\t} else {\n\t style.appendChild(document.createTextNode(css));\n\t}\n\tdocument.head.appendChild(style);\n}", "title": "" }, { "docid": "2124dcea2ed6611b031c2649020951e7", "score": "0.5302502", "text": "function q(e){var t=_e.cssProps[e];return t||(t=_e.cssProps[e]=H(e)||e),t}", "title": "" }, { "docid": "a4eb124fbfe15ffa1aa67aa60beba3c2", "score": "0.52825266", "text": "get ansiString() {\n let foreground = `\\x1b[38;2;${this.fg._r};${this.fg._g};${this.fg._b}m`;\n let background = `\\x1b[48;2;${this.bg._r};${this.bg._g};${this.bg._b}m`;\n let char = this.unicodeChar;\n\n return foreground + background + char;\n }", "title": "" }, { "docid": "72454abfaedc27e34608e10c395707e2", "score": "0.5272087", "text": "function css(id,left,top,width,height,color,vis,z,other) {\n\tif (id==\"START\") return '<STYLE TYPE=\"text/css\">\\n'\n\telse if (id==\"END\") return '</STYLE>'\n\tvar str = (left!=null && top!=null)? '#'+id+' {position:absolute; left:'+left+'px; top:'+top+'px;' : '#'+id+' {position:relative;'\n\tif (arguments.length>=4 && width!=null) str += ' width:'+width+'px;'\n\tif (arguments.length>=5 && height!=null) {\n\t\tstr += ' height:'+height+'px;'\n\t\tif (arguments.length<9 || other.indexOf('clip')==-1) str += ' clip:rect(0px '+width+'px '+height+'px 0px);'\n\t}\n\tif (arguments.length>=6 && color!=null) str += (document.layers)? ' layer-background-color:'+color+';' : ' background-color:'+color+';'\n\tif (arguments.length>=7 && vis!=null) str += ' visibility:'+vis+';'\n\tif (arguments.length>=8 && z!=null) str += ' z-index:'+z+';'\n\tif (arguments.length==9 && other!=null) str += ' '+other\n\tstr += '}\\n'\n\treturn str\n}", "title": "" }, { "docid": "59f11ab70bc3263ee33f5943e9f85db1", "score": "0.5263769", "text": "function set_style(str)\n {\n\tvar el = idoc.createElement('style');\n\tel.type = 'text/css';\n\tel.media = 'screen';\n\tel.appendChild(idoc.createTextNode(str));\n\tidoc.head.appendChild(el);\n\treturn el;\n }", "title": "" }, { "docid": "7ce7fdaca3d5362340acf73a373faa94", "score": "0.5259386", "text": "function escapeStringForHtml(string) {\n return string.replace(/[\\u00A0-\\u9999<>&]/gim, ch => `&#${ch.charCodeAt(0)};`);\n }", "title": "" }, { "docid": "520c5bc4b868287607a1de5ac92cbed1", "score": "0.52528507", "text": "function widont( string ) {\n return string.replace( Private.regexp, \"&#160;$1\" );\n }", "title": "" }, { "docid": "7b117a68486374aeab7222e2fdad9917", "score": "0.525269", "text": "static stringCompressStyleValue(styleValue){return styleValue.replace(/ *([:;]) */g,'$1').replace(/ +/g,' ').replace(/^;+/,'').replace(/;+$/,'').trim()}", "title": "" }, { "docid": "9a2dec0d2b252c5509a7767659751157", "score": "0.524893", "text": "function funescape( _, escaped, escapedWhitespace ) {\n \tvar high = \"0x\" + escaped - 0x10000;\n \t// NaN means non-codepoint\n \t// Support: Firefox\n \t// Workaround erroneous numeric interpretation of +\"0x\"\n \treturn high !== high || escapedWhitespace ?\n \t\tescaped :\n \t\t// BMP codepoint\n \t\thigh < 0 ?\n \t\t\tString.fromCharCode( high + 0x10000 ) :\n \t\t\t// Supplemental Plane codepoint (surrogate pair)\n \t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n }", "title": "" }, { "docid": "d237e46273eac3740a49bf6884689fd9", "score": "0.52450305", "text": "function injectCSSEvaluate() {\n /*eslint-disable */\n var css = '* { animation: none!important; -webkit-animation: none!important; caret-color: transparent!important; }',\n head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n /* eslint-enable */\n}", "title": "" }, { "docid": "cd721366642ff99973a33f0ad3083fda", "score": "0.52357006", "text": "function I(e){var t=ye.cssProps[e];return t||(t=ye.cssProps[e]=M(e)||e),t}", "title": "" }, { "docid": "1700d2c976acd05a04c6a2da2c2fba1d", "score": "0.5211014", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\t// BMP codepoint\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t}", "title": "" } ]
210c3d543d5cae7e34397caac10a3ad7
Adds new room by taking information from the newLocationForm and sending it to validate_building()
[ { "docid": "8c25eafbee3e923a2ac78ae0646f2ac2", "score": "0.5972291", "text": "function addRoom(building){\n let newRoomNum = document.getElementById('')\n errorMessage = document.getElementById('addingRoomError')\n type = 'room'\n\n $('#addRoom').click(function(){\n let room = document.getElementById('roomNumber').value\n\n console.log('addRoom()') //for testing delete later\n console.log(building)\n console.log(room)\n console.log(type)\n\n\n $.ajax({\n type: \"POST\",\n url: '/ajax/validate_building',\n async: false,\n data: {\n 'building': building,\n 'room': room,\n 'type': type\n },\n\n dataType: 'json',\n success: function (data){\n if(data.exist){\n errorMessage.style.display = 'block'\n errorMessage.innerHTML = `${building}[${room}] already exist.`\n console.log(\"Item Did not Delete\")\n\n }\n else if (data.isNull){\n errorMessage.style.display = 'block'\n errorMessage.innerHTML = 'Entry Cannot be null'\n }\n else{\n document.location.reload()\n errorMessage.style.display = 'none'\n }\n\n setTimeout(function wait(){\n $(errorMessage).fadeOut('slow');\n }, 3000);\n\n }\n\n\n })\n })\n}", "title": "" } ]
[ { "docid": "3225d18fb003697916ff528f612ba2b6", "score": "0.66764486", "text": "async function newRoom(){\n let room;\n try{\n room = await rest.post(`${url}/rooms`, {});\n if (room.error) throw new Error(room.message);\n } catch (error){\n showModalOnScreen(true,error.message);\n return;\n }\n setShowRoom(true);\n setRoomID(room.idRoom);\n setHash(room.hashP1);\n }", "title": "" }, { "docid": "b2a94a3a2fefb208ee6d4085108290f1", "score": "0.6582479", "text": "addRoom(){\n\n\t}", "title": "" }, { "docid": "78e97ae3fbea26bd74c66dd3aaad91fc", "score": "0.6566369", "text": "function createRoom(location) {\n socket.emit('setRoom', location);\n var loc = location.localeCompare('Outside NUS') === 0 ? 'Outside NUS' : locations[location][2];\n $(\"#chatEntries\").html(' <br><br><br><p>Welcome to <b>' + loc + '</b> <br> Click on ' +\n '<a href=\"#createRoom\", data-toggle=\"modal\"><span class=\"glyphicon' +\n ' glyphicon-globe\"></span></a>&nbsp;at the top right hand corner to ' +\n 'change room/building.</p>');\n $('#createRoom').modal('hide');\n $('#chatEntries').hide().fadeIn(3500);\n}", "title": "" }, { "docid": "ee2d7ac94255bab012a54f429aded9c6", "score": "0.6537485", "text": "function bwAddRoom() {\r\n var roomName = $(\"#bwAddRoomName\").val();\r\n var locationUid = $(\"#bwAddRoomUid\").val();\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"/caladmin/location/addsub.gdo\",\r\n data: {\r\n uid: locationUid,\r\n sub: roomName\r\n },\r\n success: function(response) {\r\n if(response.uid != undefined) {\r\n // we have a new location (room) - set the list display and the hidden field\r\n bwSetupLocations(response.uid);\r\n $(\"#bwLocation\").val(response.uid);\r\n } else {\r\n // must have been a problem; just keep the original selection in place\r\n bwSetupLocations(locationUid);\r\n }\r\n $(\"#bwAddRoomLink\").magnificPopup(\"close\");\r\n }\r\n })\r\n .fail(function(jqxhr, textStatus, error ) {\r\n alert(\"There was an error saving the room.\");\r\n if (bwJsDebug) {\r\n var err = textStatus + \", \" + error;\r\n console.log( \"Add room failed: \" + err );\r\n }\r\n });\r\n}", "title": "" }, { "docid": "8cafd90857bf5836b54c8de6a3b2c823", "score": "0.65046686", "text": "createRoom() {\n\t\tconst participantName = this.refs.txtParticipantName.value.trim(),\n\t\t\troomName = this.refs.txtRoomName.value.trim(),\n\t\t\tcardType = this.refs.ddCardType.value;\n\n\t\tif (isEmpty(participantName) || isEmpty(roomName)) return;\n\n\t\tthis.props.createRoom({\n\t\t\tparticipantName,\n\t\t\troomName,\n\t\t\tcardType\n\t\t});\n\t}", "title": "" }, { "docid": "4d947d7349dfce7846a6ec10ca1045f5", "score": "0.64659554", "text": "function validate_newRoom(form) {\n var formname = form.name;\n var room = form.elements['room'];\n //var resources = document.getElementById('resources').value;\n\n //Room name validation\n if(room.value=='')\n {\n var room_error = document.getElementById(formname+'_room_error');\n room_error.style.display = '';\n room.focus();\n return false;\n }\n else\n {\n room_error.style.display = 'none';\n }\n\n return true;\n}", "title": "" }, { "docid": "696dffd9ab897b749e857fefb8e21090", "score": "0.63704056", "text": "function addShowroom(req, res) {\n\t// Reject request from anyone who is not manager\n\tif (req.user.type != \"manager\") {\n\t\tres.status(403).send({message: \"Access denied.\"})\n\t} else {\n Showroom.findOne({\"name\": req.body.name}, function(err, showroom) {\n if (err) {\n res.json({error: err})\n } else {\n var newShowroom = new Showroom\n \n newShowroom.location.country = req.body.country\n newShowroom.location.city = req.body.city\n newShowroom.location.address = req.body.address\n \n if (showroom && showroom.location === newShowroom.location) {\n res.json({error: \"Showroom with that name and location is already registered.\"})\n } else {\n newShowroom.name = req.body.name\n newShowroom.phone = req.body.phone\n\n newShowroom.save(function(err, addedShowroom) {\n if (err) {\n res.json({error: err})\n } else {\n res.json({\n message: \"Showroom successfully added.\",\n addedShowroom: addedShowroom\n })\n }\n })\n }\n }\n })\n }\n}", "title": "" }, { "docid": "24ba88ea8bcda0734fe1972f9fa2a876", "score": "0.63654965", "text": "function addRoom(){\n document.getElementById(\"invalidNameWarning\").innerHTML = \"\";\n document.getElementById(\"availableWarning\").innerHTML = \"\";\n\n let available = extractHours(\"hourChoice\");\n if (available.length === 0){\n document.getElementById(\"availableWarning\").innerHTML = \"Choose when room is available...\";\n }else{\n for (let i = 0; i < available.length; i++){\n available[i] = parseInt(available[i]);\n }\n\n available.sort((a, b) => a - b);\n let features = extractCheckboxResult(\"feature\");\n let capacity = parseInt(document.getElementById(\"capacity\").value.toString());\n let roomName = document.getElementById(\"roomName\").value.toString();\n\n if (roomName === \"\"){\n document.getElementById(\"invalidNameWarning\").innerHTML = \"Room name cannot be empty\";\n } else if (!new RoomPresenter().addRoom(roomName, available, capacity, features)){\n document.getElementById(\"invalidNameWarning\").innerHTML = \"Room name already exist\";\n }else {\n window.open(\"RoomViewingPage.html\", \"_self\");\n }\n }\n}", "title": "" }, { "docid": "f86bcac59853e6d90f76b830e333d8a1", "score": "0.63632417", "text": "handleSubmit(e) {\n e.preventDefault();\n const room = {\n name: this.state.newRoom\n };\n if (room.name !== \"\") {\n this.roomsRef.push(room);\n this.setState({\n newRoom: \"\"\n });\n }\n }", "title": "" }, { "docid": "68718bf7feca53a995ec3adb287d929d", "score": "0.6299556", "text": "createRoom(event) {\n event.preventDefault();\n if (!this.state.newRoomName) { return }\n this.roomsRef.push({ name: this.state.newRoomName });\n this.setState({ newRoomName: '' });\n }", "title": "" }, { "docid": "1c47cdfea7e01da3c87abf87c69174ea", "score": "0.62714684", "text": "function createRoom(){\n\tvar roomName = document.getElementById(\"rN\").value;\n\tvar password = document.getElementById(\"p\").value;\n\t\n\tif(roomName.length < 4 || roomName.length > 25 || roomName.includes(\"\\\\\")){ // fail case -> name too short, too large or regex inside\n\t\talert(\"Tragen Sie einen Raumnamen mit 4-25 Zeichen in das entsprechende Feld ein. Zeichen aus der Regex-Gruppe sind nicht erlaubt.\");\n\t}else{\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"POST\", \"/rooms\", true);\n\t\txhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify({\"name\":roomName,\"password\":password,\"maxUsers\":\"6\"}));\n\t\txhr.onload = function () {\n \tif (xhr.status != 201) {\n \t\talert(xhr.responseText);\n \t}else{\n //joinRoom(roomName); // perhaps TODO later on Ticket Raum beitreten\n\t\t}};\n\t}\n}", "title": "" }, { "docid": "0ff0d682c1eae5d904340bb3cfb01946", "score": "0.6253017", "text": "function addNewRoom(itemID, itemContent, itemLocation) {\n // Creates main item section, adds id & classes\n let newRoomItem = document.createElement('section');\n newRoomItem.id = itemID;\n let roomID = newRoomItem.id;\n newRoomItem.className += 'newItem newRoomItem';\n newRoomItem.draggable = 'true';\n\n // Adds an item letter to the left border\n let roomLetter = document.createElement('span');\n roomLetter.textContent = 'R';\n roomLetter.className = 'roomLetter';\n newRoomItem.appendChild(roomLetter);\n\n // Adds a delete cross on the right side of the item\n let deleteRoom = document.createElement('span');\n deleteRoom.innerHTML = '<i class=\"fas fa-times\"></i>';\n deleteRoom.className = 'itemDelete';\n newRoomItem.appendChild(deleteRoom);\n\n // Adds a text field to the item\n let roomText = document.createElement('p');\n roomText.className = 'itemText';\n roomText.style.minHeight = '2em';\n roomText.contentEditable = 'true';\n newRoomItem.appendChild(roomText);\n\n // Imports content from db to item\n if (itemContent) {\n roomText.innerHTML = itemContent;\n }\n\n // Appends new item to location stored in db\n let location = document.getElementById(itemLocation);\n location.appendChild(newRoomItem);\n roomText.focus();\n\n // Calls the event listeners for the item\n textEventItems(newRoomItem, roomID, roomText);\n eventItems(newRoomItem, roomID, deleteRoom);\n\n // Adds new item to an array\n roomsArray.push(newRoomItem);\n}", "title": "" }, { "docid": "0f2acb84ed004ca9287c5519e21ee205", "score": "0.61941767", "text": "function createNewRoom(){\n var ROOMID = Math.floor(Math.random() * 100000000000000);\n console.log(ROOMID);\n db.add(`rooms/${ROOMID}`, {\n state: \"matching\",\n Qstate: \"unset\",\n id: ROOMID,\n playerOne: auth.user().uid\n });\n }", "title": "" }, { "docid": "08daa751bb5e4ea52a547353faf65862", "score": "0.60987705", "text": "function addRoom(name) {\n if (STATE[name]) {\n changeRoom(name);\n return false;\n }\n\n var node = roomTemplate.content.cloneNode(true);\n var room = node.querySelector(\".room\");\n room.addEventListener(\"click\", () => changeRoom(name));\n room.textContent = name;\n room.dataset.name = name;\n roomListDiv.appendChild(node);\n\n STATE[name] = [];\n changeRoom(name);\n return true;\n}", "title": "" }, { "docid": "81b0471c6f230640e972ef2287ae901b", "score": "0.6091014", "text": "'submit .create-room-form'(event) {\n event.preventDefault();\n const target = event.target;\n const where = target.where.value; // gets place ordering from\n const maxOrders = parseInt(target.maxOrders.value); // gets max # of orders\n const secretWord = target.secretHost.value;\n console.log(\"\" === target.secretHost.value);\n var startTime = new Date();\n var endTime = timestringToDate(target.when.value, new Date());\n console.log(endTime);\n var id = Orders.find().fetch().length;\n while(Orders.find({\"room\":id}).count() > 0){ // check to make sure duplicate room not created!\n id +=1;\n }\n Session.set('roomId', id);\n Session.setPersistent(\"secretWord\", secretWord);\n console.log(\"Generated room with id \" + id);\n Orders.insert({\n room:id,\n orders:new Array(),\n createdAt: startTime, // current time, needed to see room length\n endTime: endTime, // end date time!,\n place: where, // where people choose to eat,\n maxOrders:maxOrders,\n delivery:4, // needs to be an integer\n tip:.1, // \n secretWord:secretWord,\n completed:false,\n completedTime:undefined\n });\n Router.go('/host/'+id);\n }", "title": "" }, { "docid": "d1b6c6b7592635262cde04657018ebf4", "score": "0.60072595", "text": "function createNewRoom(){\n\n\n if (this.user.currentRoom === null){\n // Create a unique Socket.IO Room\n var thisRoomId = ( Math.random() * 100000 ) | 0\n\n // Create new Room\n var thisRoom = new Lobby.Room(thisRoomId)\n Lobby.Lobby.addRoom(thisRoom)\n\n // Add the creator to the Room\n thisRoom.addPlayer(this.user)\n // playerJoinRoom(thisRoomId)\n\n // use the Room ID as the socketio room, and join that room\n this.join(thisRoomId.toString())\n this.user.currentRoom = thisRoom\n\n\n\n log('newRoomCreated ' + thisRoomId.toString())\n this.emit('newRoomCreated', {roomId: thisRoomId})\n // this.broadcast.emit('newRoomCreated', {roomId: thisRoomId})\n this.broadcast.emit('lobbySync', Lobby.Lobby.getSimpleLobbyList())\n\n }\n else{\n log(\"you're already in a room...\")\n // AFTER HACKATHON EXTENSION LOGIC\n // check if a player is already in a room, if so, return fail\n\n }\n\n}", "title": "" }, { "docid": "9d09c7249f16b5e2266881c3e3a8dd29", "score": "0.59813935", "text": "function create() { // TODO: success info\n\t\tvar location = searchResults[document.getElementById('newLocationMapLocationResults').value];\n\t\t$.post(\"location?new\", {\n\t\t\tname: location.formatted_address,\n\t\t\tlongitude: location.geometry.location.lng(),\n\t\t\tlatitude: location.geometry.location.lat(),\n\t\t\tisInternational: document.getElementById('newLocationMapLocationIsInternational').checked == true ? 'true' : 'false'\n\t\t}, function (data) {\n\t\t\t/** Response function, indicates that an update is needed, and refreshes the type-ahead to include new locations. **/\n\t\t\tKPS.data.locations.setNeedsUpdate();\n\t\t\tKPS.data.locations.load(function () { // TODO: insert rather than reload\n\t\t\t\tKPS.data.locations.setupPortEntryTypeahead();\n\t\t\t\tbackStackInfo.element.value = location.formatted_address;\n\t\t\t\tKPS.event.route.validateForm(document.getElementById('newRouteForm')); // TODO:...\n\t\t\t\tdismiss();\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "250adde3f668c8dc61aeca060da7223f", "score": "0.5971649", "text": "addRoom(room){\n this.rooms.push(room);\n }", "title": "" }, { "docid": "f9c821c872d57fb5062c647a45f51e68", "score": "0.59710115", "text": "async function createNewRoom() {\n // Fetches latest itemID for the unit\n const url = '/api/latestItemID?unit=' + encodeURIComponent(retrieveUnit);\n\n const response = await fetch(url);\n if (response.ok) {\n let data = await response.json();\n var latestRoomID = data.latestRoomID;\n } else {\n console.error('Error getting the latest ItemID', response.status, response.statusText);\n }\n\n let newRoomItem = document.createElement('section');\n // Uses fetched id to determine the next itemID\n let idValue = latestRoomID.match(/\\d+/)[0];\n if (idValue == 0) {\n // Default item id\n idValue = 101;\n } else {\n // Increment to the next item id\n idValue++;\n }\n // Sets id and classes for the item\n newRoomItem.id = 'room'+idValue;\n let roomID = newRoomItem.id;\n newRoomItem.className += 'newItem newRoomItem';\n newRoomItem.draggable = 'true';\n\n // Adds an item letter to the left border\n let roomLetter = document.createElement('span');\n roomLetter.textContent = 'R';\n roomLetter.className = 'roomLetter';\n newRoomItem.appendChild(roomLetter);\n\n // Adds a delete cross on the right side of the item\n let deleteRoom = document.createElement('span');\n deleteRoom.innerHTML = '<i class=\"fas fa-times\"></i>';\n deleteRoom.className = 'itemDelete';\n newRoomItem.appendChild(deleteRoom);\n\n // Adds a text field to the item\n let roomText = document.createElement('p');\n roomText.className = 'itemText';\n roomText.style.minHeight = '2em';\n roomText.contentEditable = 'true';\n newRoomItem.appendChild(roomText);\n\n // Appends new item to default items section\n items.appendChild(newRoomItem);\n roomText.focus();\n\n // Sends the new item id, text content, and location to the db\n addNewItem(roomID, roomText.textContent, 'items');\n\n // Calls the event listeners for the item\n textEventItems(newRoomItem, roomID, roomText);\n eventItems(newRoomItem, roomID, deleteRoom);\n\n // Adds new item to an array\n roomsArray.push(newRoomItem);\n}", "title": "" }, { "docid": "0fb80497a6a99aa55e5ea118b260c9a7", "score": "0.59703773", "text": "function submitCreateRoom() {\n let nameInput = document.querySelector(\"#roomNameInput\"); \n let errLabel = document.querySelector(\"#roomNameErrorLabel\");\n\n errLabel.textContent = \"\";\n\n if (nameInput.value.length < 1) {\n errLabel.textContent += \"Room name cannot be blank\";\n }\n else {\n createNewRoom(nameInput.value);\n } \n}", "title": "" }, { "docid": "5836197a4b006b4240eff751294d3ec5", "score": "0.58971286", "text": "createNewRoom(room_id) {\n if (this.roomExists(room_id)) {\n console.log('Room Already exists !');\n return;\n }\n var room = new ROOM(room_id);\n this.room_map[room_id] = room;\n console.log('Room with id ' + room_id + ' created !');\n }", "title": "" }, { "docid": "5d6ee3be0067c029ff19613079e3522d", "score": "0.5866561", "text": "function handlenewLocSubmit(event) {\n console.log(event);\n event.preventDefault();\n\n if (!event.target.kioskName.value || !event.target.minCust.value || !event.target.maxCust.value || !event.target.avgCups.value || !event.target.avgPounds.value ) {\n return alert('Fields cannot be empty!');\n }\n\n var new_Loc = event.target.kioskName.value;\n var min_Cust = parseInt(event.target.minCust.value);\n var max_Cust = parseInt(event.target.maxCust.value);\n var avg_Cups = parseInt(event.target.avgCups.value);\n var avg_Pounds = parseInt(event.target.avgPounds.value);\n\n var newLocation = new Kiosk(new_Loc, min_Cust, max_Cust, avg_Cups, avg_Pounds);\n //clear existing tables\n //re-render both whole tables w new location\n sectEl.innerHTML = '';\n sectEl2.innerHTML = '';\n createTable();\n createTable2();\n event.target.kioskName.value = null;\n event.target.minCust.value = null;\n event.target.maxCust.value = null;\n event.target.avgCups.value = null;\n event.target.avgPounds.value = null;\n\n console.log(\"Places is now: \" + newKiosks);\n console.log(newLocation);\n}", "title": "" }, { "docid": "3510af43686c040db08e405e4a009356", "score": "0.58291435", "text": "function submitForm() {\n $('#roomname').focus();\n var txtRoomname = $('#roomname3').val();\n var txtforwhom = $('#editforwhom').val();\n var txtRoomcapa = $('#roomcapa3').val();\n var txtRoomtype = $('#roomtype3').val();\n var txtBuilding = $('#Building3').val();\n var txtfloor = $('#floor3').val();\n var roomid = $('#roomid3').val();\n var editroom = \"editroom\"\n $.ajax({\n type: 'POST',\n url: 'room_manager.php',\n data: {\n roomname: txtRoomname,\n forwhom:txtforwhom,\n roomcapa: txtRoomcapa,\n roomtype: txtRoomtype,\n Building:txtBuilding,\n floor:txtfloor,\n roomid: roomid,\n editroom: editroom\n },\n success: function(response) {\n loadroomOption();\n if (response == \"success\") {\n alert('แก้ไขห้องเรียน ' + txtRoomname + ' เรียบร้อยแล้ว');\n } else {\n alert('ชื่อห้อง ' + txtRoomname + ' มีอยู่ในระบบแล้ว');\n }\n }\n });\n return false;\n }", "title": "" }, { "docid": "8b492e0da14b41c9f4b1466eabf21a2e", "score": "0.58172554", "text": "function bwAddRoomInit() {\r\n // set up the form\r\n var currentAddrTxt = $(\"#bwLocationsPrimary option:selected\").text();\r\n var currentAddrUid = $(\"#bwLocationsPrimary option:selected\").val();\r\n $(\"#bwAddRoomAddress\").html(currentAddrTxt);\r\n $(\"#bwAddRoomUid\").val(currentAddrUid);\r\n $(\"#bwAddRoomContainer\").removeClass(\"invisible\");\r\n}", "title": "" }, { "docid": "dda3cf297670de3fafd7d96a689d4e22", "score": "0.58009255", "text": "function validate() {\n newLocation\n}", "title": "" }, { "docid": "11f4056f0f62eeadb04792cf302714a7", "score": "0.5783517", "text": "function create() {\n const id = uuid();\n props.history.push(`/room/${id}`);\n }", "title": "" }, { "docid": "5f75b6786e315e25c316620153eea557", "score": "0.57360923", "text": "function createNewRoomObject (room, done) {\n\t\treturn saveRoomObject(new Room(room), done);\n\t}", "title": "" }, { "docid": "46c5098605e13493b9362b8dd2f5e86f", "score": "0.57214177", "text": "function createRoom(roomname) {\n if (roomname === undefined) {\n systemMessage(sm.roomnameEmpty);\n }\n else if (rooms.hasOwnProperty(roomname)) {\n systemMessage(sm.roomAlreadyExists);\n }\n else {\n var validation = verifyName(roomname, true);\n if (validation.isValidName) {\n rooms[roomname] = {\n streams: [],\n usernames: [],\n };\n systemMessage(roomname + sm.roomCreated);\n }\n else {\n systemMessage(validation.message);\n }\n }\n }", "title": "" }, { "docid": "78cdd8e098df70db8bc23431792bbcc5", "score": "0.5713458", "text": "function createBooking(room, course, date, timeFrom, timeTo, type) {\n Booking.create({\n room: room._id,\n course: course,\n date: date.format('x'),\n timeFrom: timeFrom,\n timeTo: timeTo,\n bookedBy: user.username,\n type: type\n }, (booking)=> {\n \t// Add the new booking to the rooms bookings array\n \tselectedRoom.bookings.push(booking._id);\n \t// Then save\n \tRoom.update(selectedRoom._id, {\n \t\tbookings: selectedRoom.bookings\n \t});\n \t// reload the week display\n loadWeek();\n });\n }", "title": "" }, { "docid": "11616c4fb46bb0b07276f4fee4264156", "score": "0.57044363", "text": "function submitForm() {\n $('#editbuilding').focus();\n var txtbuildingname = $('#editbuilding').val();\n var txtfloor = $('#editMax_floor').val();\n var buildingid = $('#Building9').val();\n var editbuilding = \"editbuilding\"\n $.ajax({\n type: 'POST',\n url: 'room_manager.php',\n data: {\n buildingname: txtbuildingname,\n buildingfloor: txtfloor,\n buildingid: buildingid,\n editbuilding: editbuilding\n },\n success: function(response) {\n if (response == \"success\") {\n loadBuildingOption();\n alert('แก้ไข ' + txtbuildingname + ' เรียบร้อยแล้ว');\n } else {\n alert('ชื่ออาคาร ' + txtbuildingname + ' มีอยู่ในระบบแล้ว');\n }\n }\n });\n return false;\n }", "title": "" }, { "docid": "2dfd8fefa21b9cbf15668ca7e46f10a5", "score": "0.5696804", "text": "function setRoom(newRoom) {\n roomFirebaseObject = newRoom;\n }", "title": "" }, { "docid": "965c35d695515cd021af62a864fb0773", "score": "0.5626808", "text": "function moveToRoom(newRoom) {\n let validTransitions = states[currentRoom.name].canChangeTo;\n if (validTransitions.includes(newRoom.name)) {\n currentRoom = newRoom;\n } else {\n console.log('Invalid state transition attempted - from ' + currentRoom.name + ' to ' + newRoom.name + \"\\nPlease choose a valid direction.\")\n }\n}", "title": "" }, { "docid": "d742a07222a10809abde3442fca80303", "score": "0.5594393", "text": "function addLocation(lng, lat) {\n \n // Making sure the user entered a name for the location\n var locationName = document.getElementById('locationName');\n if (locationName.value === \"\") {\n alert(\"Location name must not be empty\");\n locationName.focus();\n return false;\n }\n \n console.log(\"Post a new location\");\n event.preventDefault();\n $.ajax({\n type: \"POST\",\n url: '/locations',\n data: {\n //'locationId': nextLocationId,\n 'name': $('#locationName').val(),\n 'locationLng': lng, // Location cord yet to be implemented\n 'locationLat': lat // Location cord yet to be implemented\n },\n success: function(response) {\n console.log(response);\n $.mobile.changePage('#favoriteLocation');\n $('#content').trigger('create');\n }\n });\n return false;\n\n}", "title": "" }, { "docid": "cac062c8b8de728534fccf43c215ce92", "score": "0.55687803", "text": "function addNewLocationHandler(locationToAdd) {\n fetch(\n `https://tangible-47447-default-rtdb.europe-west1.firebasedatabase.app/${authCtx.userUID}/pain-locations.json`,\n {\n method: \"POST\",\n body: JSON.stringify(locationToAdd),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n }\n ).then((response) => {\n getLocationList();\n });\n }", "title": "" }, { "docid": "ee6e2957545e95c46069f4bd00229326", "score": "0.5560692", "text": "function createRoom(player){\n\t\tvar room = new Room(player.id);\n\t\tplayer.room = room;\n\t\tgameRooms.addRoom(room);\n\t}", "title": "" }, { "docid": "3b6c2a46d3e9a6be61264c4639eefd3d", "score": "0.55538666", "text": "function newRoom(allowAudienceChoice) {\n console.log(\"New room.\");\n clientName = enterName.value;\n console.log(clientName);\n\n // send to hub\n connection.server.newRoom({\n name: clientName,\n allowAudience: allowAudienceChoice\n });\n\n}", "title": "" }, { "docid": "49b9adb851667eb098bbc4945b0ab6f5", "score": "0.55313575", "text": "function createBooking() {\n event.preventDefault();\n\n var pNumber = \"+\" + iti.selectedCountryData.dialCode + \" \" + iti.telInput.value;\n \n var guestAddress = {\n streetName : $(\"[name='streetName']\").val(),\n houseNumber : $(\"[name='houseNumber']\").val(),\n houseNumberAddition : $(\"[name='addition']\").val(),\n postalCode : $(\"[name='zipcode']\").val(),\n city : $(\"[name='city']\").val(),\n country : $(\"[name='country']\").val()\n }\n\n var guest = {\n firstName : $(\"[name='firstName']\").val(),\n lastName : $(\"[name='lastName']\").val(),\n phoneNumber : pNumber,\n birthDate : $(\"[name='birthday']\").val(),\n emailAddress : $(\"[name='email']\").val(),\n address : guestAddress\n }\n\n $.ajax({\n type: \"POST\",\n url: \"api/bookings\",\n contentType: 'application/json',\n data: JSON.stringify(new Booking(guest)),\n success: function() {\n window.selectedRooms = [];\n },\n dataType: 'json'\n });\n\n return false;\n}", "title": "" }, { "docid": "61fb840120a56f31ec7e8dbfaaae3832", "score": "0.5512737", "text": "function addLocation(event) {\n event.preventDefault();\n var url;\n var formStatus = $('#locationForm').data('status');\n var center = $('#mapImg img').data('center');\n var lat = parseFloat(center.split(',')[0]);\n var lng = parseFloat(center.split(',')[1]);\n var locationData = {\n name: $('#placeName').val(),\n description: $('#placeDescription').val(),\n category: $('#foodCategory').val(),\n price: $('#priceRange').val(),\n lat: lat,\n lng: lng\n }\n console.log(JSON.stringify(locationData));\n if (formStatus == 'adding') {\n url = '/locations/add'\n }\n else if (formStatus == 'editing') {\n url = '/locations/edit'\n var locationId = $('#locationForm').data('location-id');\n locationData['locationId'] = locationId;\n }\n $.ajax({\n type: 'POST',\n data: JSON.stringify(locationData),\n contentType: 'application/json; charset=UTF-8',\n url: url,\n success: getAllLocations\n });\n $('#formContainer').modal('toggle');\n}", "title": "" }, { "docid": "35a793441a54f00e628667e2b0626cb5", "score": "0.5492712", "text": "function populate (location, roomSelect, numberPeople) {\n var location = document.getElementById(location);\n var roomSelect = document.getElementById(roomSelect);\n var numberPeople = document.getElementById(numberPeople);\n var rooms = location.value;\n switch (rooms) {\n case \"Fleet Street\" :\n populateRoom(locations[\"Fleet Street\"], roomSelect);\n break;\n case \"Record Hall\" :\n populateRoom(locations[\"Record Hall\"], roomSelect);\n break;\n case \"Choose a location...\" :\n populateRoom(locations[\"Choose a location...\"], roomSelect);\n $('#numberPeople option').remove();\n var placementOption = document.createElement(\"option\");\n placementOption.value = \"\";\n placementOption.innerHTML = \"Choose a room first...\";\n numberPeople.options.add(placementOption);\n break;\n }\n function populateRoom(rooms, roomSelect) {\n $('#inputRoom option').remove();\n for (var room in rooms) {\n var newOption = document.createElement(\"option\");\n newOption.value = room;\n newOption.innerHTML = room;\n roomSelect.options.add(newOption);\n }\n }\n }", "title": "" }, { "docid": "fcd5dc694c0fd4350a1be8b8bba88078", "score": "0.54912835", "text": "function newRoomCreation(questionType) {\n let existingRoom = true;\n let newRoom;\n\n //Create a room code\n //Check if it is already available\n do {\n newRoom = getRandomCode(4);\n if (!roomMap.get(newRoom)) {\n roomMap.set(newRoom, []);\n roomQuestionType.set(newRoom, questionType);\n existingRoom = false;\n }\n } while (existingRoom == true);\n\n return newRoom;\n}", "title": "" }, { "docid": "02bf42800851ebdc9eac4136c84b299e", "score": "0.5471732", "text": "function add_leadform_location(data) {\n $leadForm.append('<input type=\"hidden\" readonly=\"true\" name=\"city\" value=\"' + data.city + '\">');\n $leadForm.append('<input type=\"hidden\" readonly=\"true\" name=\"county\" value=\"' + data.county_name + '\">');\n $leadForm.append('<input type=\"hidden\" readonly=\"true\" name=\"state\" value=\"' + data.state + '\">');\n $leadForm.append('<input type=\"hidden\" readonly=\"true\" name=\"country\" value=\"' + data.country + '\">');\n }", "title": "" }, { "docid": "3debb3cc26ac79c3c75accc20ecdffd5", "score": "0.5459415", "text": "function createRoomOnRequest(req,resp){\n var creatorId = req.body.userId;\n //we create a new room\n var roomId = createRoom(creatorId);\n let roomCreationDAO = new RoomCreationDAO(roomId, creatorId);\n User.users[req.body.userId].roomId = roomId;\n //We send a success response\n resp.status(201).send(roomCreationDAO);\n}", "title": "" }, { "docid": "d75431d41a0bbe4de232b2341b514b66", "score": "0.5453156", "text": "function addLocation()\n {\n $('.help-block').remove();\n $('#location_form .alert').hide();\n \n var errorFlag = false;\n \n var address1 = $('#address_line1').val();\n var address2 = $('#address_line2').val();\n var area = $('#area').val();\n var zip = $('#zip').val();\n\n if (! address1) {\n $('#address_line1').after('<span class=\"help-block\">Please enter address line 1</span>');\n errorFlag = true;\n }\n\n if (! $('#country-list').val()) {\n $('#no_country_error').empty().html('<span class=\"help-block\">Please select a country</span>');\n errorFlag = true;\n }\n\n if (! $('#state_dropdown').val()) {\n $('#no_state_error').empty().html('<span class=\"help-block\">Please select a state</span>');\n errorFlag = true;\n }\n\n if (! $('#city_dropdown').val()) {\n $('#no_city_error').empty().html('<span class=\"help-block\">Please select a city</span>');\n errorFlag = true;\n }\n\n if (! area) {\n $('#no_area_error').empty().html('<span class=\"help-block\">Please enter area</span>');\n errorFlag = true;\n }\n\n if (! zip) {\n $('#zip').after('<span class=\"help-block\">Please enter zip</span>');\n errorFlag = true;\n }\n \n if (errorFlag) {\n $('#location_form .errorHandler').show();\n $('html,body').animate({\n scrollTop: $('body').offset().top},\n 'slow');\n $(\"a[href='#location'] .fa-check\").css(\"color\", \"#e91e63\");\n } else {\n $(\"#overlay\").show();\n $.ajax({\n url: $(\"#location_form\").attr(\"action\"),\n method: \"POST\",\n data: $(\"#location_form\").serialize(),\n dataType: \"json\",\n success: function(response) {\n $(\".location_save_loader\").remove();\n\n if (\"200\" == response.status) { \n $(\"#location_form .fatalErrorHandler\").empty().hide();\n $(\"#location_form .successHandler\").show();\n\n $('html,body').animate({\n scrollTop: $('body').offset().top},\n 'slow');\n\n $(\"#location_is_submitted\").val(1); \n $(\"a[href='#location'] .fa-check\").css(\"color\", \"#55a018\");\n } else {\n $(\"#location_form .fatalErrorHandler\").empty().html('<strong>' + response.message + '</strong>');\n $(\"#location_form .fatalErrorHandler\").show();\n\n $('html,body').animate({\n scrollTop: $('body').offset().top},\n 'slow');\n\n $(\"#save_location\").prop(\"disabled\", false);\n }\n $(\"#overlay\").hide();\n }\n });\n }\n }", "title": "" }, { "docid": "79e6cd38d8e22525eb25fb719c861091", "score": "0.54520124", "text": "createRoom() {\n const roomName = `room ${Date.now()}`;\n const room = new Room(roomName);\n\n this.rooms.set(roomName, room);\n\n return this.rooms.get(roomName);\n }", "title": "" }, { "docid": "bc2a757289c0cd430f12fe99fb088169", "score": "0.5450003", "text": "function processCreate(req, res) {\n //Validate Information\n //req.body beacuse it is coming form a fourm. - checkParam is for a URL Param\n req.checkBody('name', 'Name is required.').notEmpty();\n req.checkBody('description', 'Description Is Required.').notEmpty();\n\n //Errors Redirects To Previous Page.\n const errors = req.validationErrors();\n if(errors) {\n req.flash('errors', errors.map(err => err.msg));\n return res.redirect('/locations/create');\n }\n\n // create a new lcoation\n const location = new Location({\n name: req.body.name,\n description: req.body.description\n });\n\n // Save Location\n location.save((err) => {\n if (err)\n throw err;\n\n //Create A Succesful Flash Message\n req.flash('success', 'Succesfully Created A New Location!');\n\n\n\n // Redirect To New Location Created\n res.redirect(`/locations/${location.slug}`);\n });\n }", "title": "" }, { "docid": "7311baf36968cfc7ce4cc6ac4351a553", "score": "0.5437624", "text": "function SaveRoom (room) {\n\t\n\tconsole.log(\"all_rooms length before: \", all_rooms.length);\n\n\tfor (var i = 0; i < all_rooms.length; i++) {\n\t\tif (all_rooms[i].room_name === room.room_name) {\n\t\t\tall_rooms.splice(i,1);\n\t\t}\n\t}\n\tall_rooms.push(room);\n\n\tconsole.log(\"all_rooms length after: \", all_rooms.length);\n\treturn true;\n\n}", "title": "" }, { "docid": "63272ada4a00df9e55ad08f1d5b51a6b", "score": "0.5427917", "text": "function createNewRoom(_roomKey) {\n let roomKey = _roomKey || undefined\n\n while (roomKey === undefined || rooms.has(roomKey)) {\n roomKey = generateRandStr()\n }\n\n const room = Room(roomKey)\n addRoom(room)\n\n return room\n }", "title": "" }, { "docid": "8fc22f8941f51f10a2f0733a48bdaa3c", "score": "0.5418048", "text": "function completeBookingAndAdd() {\n $(\"ul#form_errors\").empty();\n\tparams = {};\n\tif ($(\"select#event_mode\").val() != 0) {params[\"event_id\"] = $(\"select#event_mode\").val()};\n\t$.each($(\"input.field\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"input.field[type='checkbox']\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).is(\":checked\")});\n\t$.each($(\"select.field\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"textarea.field\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).val()});\n\tclient = {};\n\tif ($(\"input#client_id\").val() != 0) {client[\"client_id\"] = $(\"input#client_id\").val()};\n\t$.each($(\"input.client_field\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"input.client_field[type='checkbox']\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).is(\":checked\")});\n\t$.each($(\"select.client_field\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"textarea.client_field\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).val()});\n\tparams[\"client\"] = client;\n\t$.ajax({\n\t\turl: \"/bookings/create\",\n\t\ttype: \"POST\",\n\t\tdata: {fields: params},\n\t\tsuccess: function(json) {\n\t\t\tif (json.errors[0]) {\n\t\t\t\t$.each(json.errors, function(i,error) {\n\t\t\t\t\t$(\"ul#form_errors\").append(\"<li>\"+error+\"</li>\");\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\twindow.location.replace(\"/bookings/new/\"+json.event_id);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8fc22f8941f51f10a2f0733a48bdaa3c", "score": "0.5418048", "text": "function completeBookingAndAdd() {\n $(\"ul#form_errors\").empty();\n\tparams = {};\n\tif ($(\"select#event_mode\").val() != 0) {params[\"event_id\"] = $(\"select#event_mode\").val()};\n\t$.each($(\"input.field\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"input.field[type='checkbox']\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).is(\":checked\")});\n\t$.each($(\"select.field\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"textarea.field\"), function(i,field) {params[$(field).attr(\"id\")] = $(field).val()});\n\tclient = {};\n\tif ($(\"input#client_id\").val() != 0) {client[\"client_id\"] = $(\"input#client_id\").val()};\n\t$.each($(\"input.client_field\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"input.client_field[type='checkbox']\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).is(\":checked\")});\n\t$.each($(\"select.client_field\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).val()});\n\t$.each($(\"textarea.client_field\"), function(i,field) {client[$(field).attr(\"id\")] = $(field).val()});\n\tparams[\"client\"] = client;\n\t$.ajax({\n\t\turl: \"/bookings/create\",\n\t\ttype: \"POST\",\n\t\tdata: {fields: params},\n\t\tsuccess: function(json) {\n\t\t\tif (json.errors[0]) {\n\t\t\t\t$.each(json.errors, function(i,error) {\n\t\t\t\t\t$(\"ul#form_errors\").append(\"<li>\"+error+\"</li>\");\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\twindow.location.replace(\"/bookings/new/\"+json.event_id);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "10d12104634f0bc22c9d567bb03fcda7", "score": "0.54151714", "text": "async function locationAdd (req, res, next) {\n try {\n let townInput = req.body.location\n let locationCode = req.body.townInput2\n if (townInput === undefined || locationCode === undefined || townInput === '' || locationCode === '') {\n req.flash('error', 'Please fill in a location and a registration code')\n } else {\n let found = await RegFunc.addTown(townInput, locationCode)\n\n if (found) {\n req.flash('successfully', 'Successfully added')\n } else {\n req.flash('error', 'This registration code and location already exists')\n }\n }\n res.redirect('/')\n } catch (error) {\n next(error.stack)\n }\n }", "title": "" }, { "docid": "60bf955c86d5453e2bb84c73353fd720", "score": "0.54055715", "text": "function changeRoom(room) {\n\troom_manager.curr_room.clear();\n\troom_manager.curr_room = room;\n\troom_manager.curr_room.create();\n}", "title": "" }, { "docid": "602c4095ad1a217facd7dccbf9b95c35", "score": "0.54003555", "text": "function addroom() {\n roomname=document.getElementById(\"roominput\").value \n firebase.database().ref(\"/\").child(roomname).update({\n status:\"Roomname created\"\n })\n document.getElementById(\"roominput\").value=\"\"\n}", "title": "" }, { "docid": "d806b8e4a0b84d94670b1c28822a3141", "score": "0.5391037", "text": "function makeClassRoomOperation() {\n\n let schoolName = $('input[name=class_room_name]').val();\n let teacherRef = $('input[name=teacher_id]').val();\n let schoolRef = $('input[name=school_id]').val();\n var object = [\n schoolName,\n teacherRef,\n schoolRef,\n ];\n var invitaitonValidation = is_valid_request(object);\n\n if (invitaitonValidation) {\n\n showLoading(formRefWithoutHash);\n ajaxurl = $(formRef).attr(\"action\");\n err_msg.html('Please wait...');\n\n var formData = $(formRef).serialize();\n inputManager(true);\n $.ajax({\n url: ajaxurl,\n method: \"POST\",\n dataType: \"json\",\n data: formData,\n }).always(function (response) {\n console.log(response);\n\n if (response.status === 'ok' || response.status === 'OK' || response === 'OK') {\n err_msg.css('color', \"green\");\n err_msg.html(\"Registration completed\");\n err_msg.html(response.msg);\n $(formRef)[0].reset();\n //window.location.replace(response.url);\n err_msg.html('School has created');\n } else {\n err_msg.css('color', \"red\");\n err_msg.html(response.error);\n err_msg.html(response.responseText);\n err_msg.html(response);\n }\n\n // enable inputs\n inputManager(false);\n showLoading(formRefWithoutHash, 'MAKE CLASS ROOM');\n\n });\n } else {\n err_msg.html('Please fill out the require fields');\n err_msg.css('color', 'red');\n }\n\n\n scrollToTop();\n }", "title": "" }, { "docid": "a4178d49578676730b4a3010e5ddb513", "score": "0.5383458", "text": "function addListing() {\n event.preventDefault();\n //validates all fields filled\n if ($('#location').val() && $('#squareFeet').val() && $('#rent').val() || $('#location').val() && $('#squareFeet').val() && $('#cost').val()) {\n //creates object for ajax call\n var newListing = {\n city: $('#location').val(),\n sqft: $('#squareFeet').val(),\n };\n if ($('#rent').val()) {\n newListing.rent = $('#rent').val();\n } else if ($('#cost').val()) {\n newListing.cost = $('#cost').val();\n }\n //ajax call\n $.ajax({\n type: \"POST\",\n url: \"/listings\",\n data: newListing,\n success: function() {\n //resets form fields\n $('#rent').val('');\n $('#cost').val('');\n $('#location').val('');\n $('#squareFeet').val('');\n alertify.alert(\"Sussman Homes and Gardens says:\", \"Thanks for submitting your home!\", function() {\n alertify.success('Listing added!');\n }); //end alertify\n } //end success-function\n }); //end ajax\n } else {\n alertify.alert(\"Sussman Homes and Gardens says:\", \"Please complete all fields.\", function() {\n alertify.error('Listing not added');\n }); //end alertify\n } //end else\n} //end addListing", "title": "" }, { "docid": "0dd3f2ea38e4aea940096753a5393be5", "score": "0.5379199", "text": "function writeRoom(organisationBuilding, building, room, coreID) {\n\tvar roomRef = firebase.database().ref().child('rooms');\n\tvar roomKey = roomRef.push().key; //creates a new room entry under an autogenerated key\n\troomRef.child(roomKey).update({\n\t\torganisationBuilding: organisationBuilding, buildingName: building, roomName: room, coreID: coreID\n\t});\n}", "title": "" }, { "docid": "4e75d22da86e77625ed0ffd34e339a8b", "score": "0.53741205", "text": "createLocationObject(event) {\n event.preventDefault();\n\n const locationObject = {\n name: this.state.name,\n street: this.state.street,\n borough: this.state.borough,\n postcode: this.state.postcode,\n city: this.state.city,\n country: this.state.country,\n description: this.state.description,\n phone: this.state.phone,\n url: this.state.name.replace(/\\s+/g, '-').toLowerCase(),\n coords: {\n latitude: this.state.latitude,\n longitude: this.state.longitude\n },\n photo: this.state.photo,\n beers: this.state.createLocations.beers,\n lastEditedBy: this.state.user.uid\n };\n\n console.log(locationObject);\n // add to locations list\n CreateLocation(locationObject);\n }", "title": "" }, { "docid": "2c18cbab7916b60cec19ed92e89b54ab", "score": "0.5362631", "text": "function bookRooms(agent) {\n return firestore.collection('orders').add(agent.parameters)\n .then(() => {\n return agent.add(`${agent.parameters['Name']} your hotel booking request for ${agent.parameters[\"Type\"]} room for \n ${ agent.parameters['Person']} person(s) is forwarded to booking department, we will contact you on ${agent.parameters['Email']} soon. `)\n })\n\n .catch((e => {\n console.log(\"error is\", e)\n agent.add('Error')\n }))\n\n }", "title": "" }, { "docid": "10b26a4adcbec5a430895b054fafe4bc", "score": "0.53611994", "text": "addPlayerToRoom(room_id, name, socket_id) {\n if (!this.roomExists(room_id)) {\n console.log(\n 'Room doesnot exists with id - ' +\n room_id +\n '. Please create a room, to add player to it !'\n );\n return;\n }\n var room = this.room_map[room_id];\n\n //calling function from room to add players\n room.addNewPlayer(name, socket_id);\n }", "title": "" }, { "docid": "25bb5050bcc9793ec557bc45ce24a16a", "score": "0.5356585", "text": "function setRoom(name) {\n $('form').remove();\n $('h1').text(\"Room number: \"+name);\n $('#subTitle').text('Link to join: ' + location.href);\n $('body').addClass('active');\n }", "title": "" }, { "docid": "519c178d0c13179cd09cede18ce14c59", "score": "0.5339779", "text": "function show_new_space_form(bldg) {\n // Set the building's API uuid\n building.key = bldg.key; // key is provided from Electrick's API.\n building.title = bldg.title;\n building.address = bldg.address;\n\n var tmp = Handlebars.compile($('#new_space_form').html());\n $('#new_space_form').html(tmp(building))\n hide_all_forms();\n hide_spinner();\n show_form('new_space_form');\n }", "title": "" }, { "docid": "fbd009149e908a5c14b3b8768f5d2a39", "score": "0.533604", "text": "function _appendRoomData(roomList){\n //First, clear the old options from the select item and enable the select input field\n activeSelectField = $(\"#roomSelect\")[0];\n _resetSelectOptions(activeSelectField);\n activeSelectField.disabled = false;\n\n //Afterwards append the current data\n for(var i = 0; i < roomList.length; i++){\n newOption = document.createElement(\"option\");\n newOption.value = roomList[i];\n if (typeof newOption.textContent === \"undefined\"){\n newOption.innerText = roomList[i];\n }\n else{\n newOption.textContent = roomList[i];\n }\n activeSelectField.appendChild(newOption);\n }\n }", "title": "" }, { "docid": "8be41ec228edd300207dc8bf4048bcb7", "score": "0.5332806", "text": "function CreateRoom(roomName, jobs) {\n const gameRoom = Game.rooms[roomName];\n let level = -1;\n let sourceNumber = 0;\n if (gameRoom) {\n if (gameRoom.controller) {\n level = gameRoom.controller.level;\n }\n sourceNumber = gameRoom.find(FIND_SOURCES).length;\n }\n Memory.MemRooms[roomName] = {\n 'RoomLevel': level, // 0 to 8 or if there are NO controller then -1\n 'RoomJobs': jobs, // JobName - [JobName(x,y)] - user friendly, unique per room, name\n 'MaxCreeps': {}, // object that gives information on how many of each type of creep may be in the room and what creeps of that type is in the room\n 'SourceNumber': sourceNumber, // number of sources in room\n };\n Util.Info('CreateJobs', 'CreateRoom', 'add new room ' + roomName + ' level ' + level + ' sourceNumber ' + sourceNumber + ' jobs ' + JSON.stringify(jobs))\n }", "title": "" }, { "docid": "bd54addccabda0e7e0b22fa8e48eef4d", "score": "0.53207207", "text": "async function createRoom(req, res) {\n let nameRoom = req.body.name;\n let chatroom = await Chatroom.findOne({\n where: { name: nameRoom }\n });\n\n if (chatroom == null) {\n let addChatroom = await Chatroom.create({ name: nameRoom });\n res.status(201).json(sucRes(addChatroom, \"Create chatroom success\"));\n } else {\n res\n .status(400)\n .json(failRes(chatroom, \"Chatroom name already exist. Use another name\"));\n }\n}", "title": "" }, { "docid": "bd274d78740ef256f70798d9e91f91b2", "score": "0.53202707", "text": "function createRoom(data, callback) {\n\tmodule.exports.rooms.push({\n\t\tname: data.name,\n\t\tpublic: data.public\n\t})\n\tsaveChatRooms((err) => {\n\t\tif (err) {\n\t\t\tcallback(err);\n\t\t\treturn;\n\t\t}\n\t\tcallback(null);\n\t});\n}", "title": "" }, { "docid": "616010c4b51cb6adb568b4b84b91c555", "score": "0.5320189", "text": "newGame() {\n // Create a new room and add it to existing rooms\n const room = this.createNewRoom();\n this.gameRoomsDict[room.roomID] = room;\n return room.roomID;\n }", "title": "" }, { "docid": "c1945e524a07916112a0ffaafc6c713f", "score": "0.5317615", "text": "load(room)\n {\n this.room = room;\n\n const $room = $('.room_view');\n\n // todo - this should be in its own class\n $('.room_create, .room_view').removeClass('open');\n $room.addClass('open');\n\n // load room info\n console.log(room);\n\n $room.html(`\n <h2>(${room.number}) ${room.name}</h2>\n <hr>\n <div class=\"monster_battles\"></div>\n `);\n }", "title": "" }, { "docid": "08f7f5e7a24068b1ee8581a643b151f5", "score": "0.53168267", "text": "function createNewLoc(new_location){\n\tdb.translations.save({\n\t\t\t\t\t\"location\":new_location,\n\t\t\t\t\t\"translations\": []\n\t\t\t\t}, function(err, saved) {\n\t\t\t\t\tif( err || !saved ) console.log(\"new location is not created\");\n\t\t\t\t\telse console.log(\"new location: \"+new_location+\" is created\");\n\t\t\t\t});\n}", "title": "" }, { "docid": "e6d0b8d4744fac0e43ac14c0fb4c1733", "score": "0.53112495", "text": "function addCity(){\n\tvar sf = selectedFields[0];\n\tvar found = false;\n\tfor(var i = 0; i < buildings.length; i++){\n\t\tvar building = buildings[i]\n\t\tif(building.type < 5 && building.x == sf[0] && building.y == sf[1]){\n\t\t\tbuildings[i].type = 1;\n\t\t\tfound = true;\n\t\t}\n\t}\n\tif(found){\n\t\tchangedBuildings.push([true, {\"type\": 1, \"x\": sf[0], \"y\": sf[1], \"realm\":factionToCreateBuildingsFor}]);\n\t\tconsole.log({\"type\": 1, \"x\": sf[0], \"y\": sf[1], \"realm\":factionToCreateBuildingsFor});\n\t} else {\n\t\tchangedBuildings.push([true, {\"type\": 1, \"x\": sf[0], \"y\": sf[1], \"realm\":factionToCreateBuildingsFor}]);\n\t\tbuildings.push({\"type\": 1, \"x\": sf[0], \"y\": sf[1], \"realm\":factionToCreateBuildingsFor});\n\t\tconsole.log(\"this is a new:\");\n\t\tconsole.log(changedBuildings[changedBuildings.length-1]);\n\t}\n\tresizeCanvas()\n}", "title": "" }, { "docid": "e7f6c3b25b5a5de55a2f197da5f73a44", "score": "0.53082114", "text": "function sendNew()\n {\n \tif($rootScope.user && $rootScope.user.isAgency)\n \t{\n var city = $scope.agency.city.toUpperCase();\n city = city.replace(/ /g, '-');\n console.log(city);\n \t\tvar dataToSend = {\n \t\t\t\t\"id\":null,\n \t\t\t\t\"type\":$scope.data.availableTypes.id,\n \t\t\t\t\"address\":$scope.data.addressp1+\" \"+$scope.data.addressp2+\" \"+city,\n \t\t\t\t\"idMotherAgency\":$rootScope.user.idAgency,\n \t\t\t\t\"phoneNum\":$scope.agency.phoneNum,\n \t\t\t\t\"city\":city,\n \t\t\t\t\"name\":$scope.agency.name,\n \t\t\t\t\"bankLink\":$scope.data.selectedBank.value,\n \t\t\t\t\"bankName\":$scope.data.selectedBank.name,\n \t\t\t\t\"rib\":$scope.agency.rib,\n \t\t\t\t\"status\":null,\n \t\t\t\t\"transactionList\":null,\n \t\t};\n\n \t\t$scope.data.selectedBank = undefined;\n \t\t$scope.data.addressp1 = undefined;\n \t\t$scope.data.addressp2 = undefined;\n \t\t$scope.data.selectedType = undefined;\n\n \t\tvar config = {headers: {'Authorization': 'Bearer ' + $rootScope.user.token,}};\n\n \t\t$http.post('api/agency/create/', dataToSend, config)\n \t\t.then(function successCallback(response) {\n \t\t\t$scope.agency={};\n\t \t$scope.registerForm.$setPristine();\n\t \t$rootScope.loadOneChildAgency(response.data.id);\n\t \t$scope.reponse = response.data;\n $('#modalEndAdd').modal('show');\n\n \t\t}, function errorCallback(data, status, headers) {});\n\n \t}\n }", "title": "" }, { "docid": "74c730e5e635c446dae297a2de08399c", "score": "0.5299299", "text": "maybeCreateRoom(room) {\n console.log('The room name is', room);\n\n const index = this.rooms.findIndex(x => x.name === room);\n\n console.log('The room\\'s index is', index);\n\n if(index < 0) {\n const newRoom = new Room(room);\n\n this.rooms.push(newRoom);\n\n console.log(this.rooms);\n }\n }", "title": "" }, { "docid": "e950a58b31009f8bc67d7594db6ad7b1", "score": "0.529146", "text": "function CreateRoomPage() {\n let history = useHistory();\n let [name, setName] = useState('');\n let [password, setPassword] = useState('');\n let [capacity, setCapacity] = useState('4');\n let [error, setError] = useState('');\n\n async function handleSubmit(event) {\n event.preventDefault();\n\n let response = await apiPost('/room/create', {\n body: JSON.stringify({\n name: name,\n password: password,\n capacity: capacity\n })\n });\n if (response.ok) {\n let json = await response.json();\n history.replace('/room/' + json.id);\n } else {\n // todo: Don't just assume the name is invalid.\n setError('Invalid name');\n }\n }\n\n function handleNameChange(event) {\n setName(event.target.value);\n setError('');\n }\n\n return (\n <div className=\"create-room\">\n <h1>Create a Room</h1>\n <Error error={error} setError={setError} />\n <div className=\"create-room-form-wrapper\">\n <form autoComplete=\"off\" onSubmit={handleSubmit}>\n <label htmlFor=\"create-room-name\">Room name</label>\n <input\n id=\"create-room-name\"\n value={name}\n onChange={handleNameChange}\n autoFocus\n required\n />\n\n <label htmlFor=\"create-room-password\">Password <span className=\"lighter-text\">(optional)</span></label>\n <input\n id=\"create-room-password\"\n type=\"password\"\n value={password}\n onChange={e => setPassword(e.target.value)}\n />\n\n <label htmlFor=\"create-room-capacity\">Room capacity <span className=\"lighter-text\">(capacity is 16)</span></label>\n <input\n id=\"create-room-capacity\"\n type=\"number\"\n min=\"1\" max=\"16\"\n value={capacity}\n onChange={e => setCapacity(e.target.value)}\n required\n />\n\n <button id=\"create-room-button\">Create room</button>\n </form>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "4530858cc24aab29c87b66805da579ac", "score": "0.52914107", "text": "createRoom() {\n\n }", "title": "" }, { "docid": "b26d1182019e72c3561e64242d0d9f4f", "score": "0.5277339", "text": "function cfgRoom(room/*name*/) {\n $(\".selected-room\").removeClass(\"selected-room\");\n $.getJSON(cfgURL+'rooms&roomname='+room, function(data) {\n currentRoom = room;\n window.location.hash = '#config;rooms;'+room;\n $(\"#cfghosts\").html(\"\");\n $(\"#cfgr_\"+room).addClass(\"selected-room\");\n if (data.success) {\n if (data.data.room) {\n hostList=data.data.room.hosts;\n drawConfigHosts();\n } \n $(\"#existingRoom\").show(); \n $(\"#roomName\").val(room);\n $(\"#amtVersion\").val(data.data.roomMeta.has_amt);\n $(\"#idlePower\").val(data.data.roomMeta.avg_pwr_on);\n $(\"#roomid\").val(data.data.roomMeta.id);\n $(\"#createPc_submit\").val('Create new PC in room '+room);\n $(\"#modRoom_msg\").html(\"\");\n } else {\n $(\"#cfghosts\").html('<h2 class=\"warning\">'+data.usermsg+'</h2>');\n }\n }).error(function(e) {\n $(\"#cfghosts\").html('<h2 class=\"warning\">ERROR: '+e.statusText+'</h2>');\n });\n}", "title": "" }, { "docid": "b585c4beb0736a291ed6bf4cc2e33cc3", "score": "0.5269759", "text": "function update ()\n\t{\n\t\t\n\t\tvar new_room = JSON.parse ( sessionStorage.getItem ( 'new_room' ) );\n\t\t\n\t\t/*DATE OF UPDATE*/\n\t\tnew_room[ 'updated_at' ] = display_date;\n\t\t\n\t\t/*CHECK AUTOCOMPLETE ARRAY, ADD NEW LOCATIONS IF new_room HAS DIFFERENT LOCATIONS*/\n\t\tcheck_autocomplete ( new_room );\n\t\t\n\t\t/*SETTING update TO true, SO THE store_room FUNCTION WILL UPDATE EXISTING ROOM*/\n\t\tstore_room ( new_room, true );\n\t\t\n\t}", "title": "" }, { "docid": "cab2c694e88bd3ae7e4f1e131b553125", "score": "0.52572924", "text": "function updateRoom(newRoom) {\n if (newRoom.inaccessible == true) {\n scrollingText.append(newRoom.isInaccessibleText + \"<br />\");\n } else {\n currentRoom = newRoom;\n scrollingText.append(\"You are in: \", currentRoom.name, \". Description: \");\n scrollingText.append(currentRoom.description, \"<br />\");\n printItemsInRoom(currentRoom);\n }\n}", "title": "" }, { "docid": "e03cab7440131f1578aad6354d9a6b32", "score": "0.5248195", "text": "function changeRoom(newRoom) {\n let validTransitions = rooms[currentRoom].canChangeTo;\n // If the new room is a available movement and it is locked\n if (\n validTransitions.includes(newRoom) &&\n roomLookUp[newRoom].locked === true\n ) {\n // if it is locked, and they have a stick they can leave City Hall\n if (player.inventory.includes(\"stick\")) {\n fireescape.locked = false;\n currentRoom = newRoom;\n let roomForTable = roomLookUp[currentRoom];\n //description for the rooms\n\n console.log(roomForTable.description);\n\n //if player doesn't have a stick, door remains locked\n } else {\n console.log(\n \"The door before you is locked. Maybe you should find a stick.\"\n );\n }\n }\n //if the room exists and the door is not locked\n else if (\n validTransitions.includes(newRoom) &&\n roomLookUp[newRoom].locked === false\n ) {\n currentRoom = newRoom;\n let roomForTable = roomLookUp[currentRoom];\n //console log the room descriptions\n console.log(roomForTable.description);\n }\n //if the room change is invalid\n else {\n console.log(\n \"That doesn't seem to be a place I know about. Care to try again?\"\n );\n }\n //change player location\n player.location = roomLookUp[currentRoom];\n}", "title": "" }, { "docid": "460414ec7125279654bd26ee9ebe6289", "score": "0.52454513", "text": "function addCourse(){\n //ensure that all entered data is truthy\n if(!addCourseNumber || !addCourseTitle || !addCourseDescription || !addCourseCapacity){\n updateAddCourseErrorMessage('You must complete the form');\n return;\n }\n //ensure that capacity is a number\n if (isNaN(addCourseCapacity)) {\n updateAddCourseErrorMessage('The capacity of the course must be a number')\n return;\n }\n\n //creating info object with user-entered info about the new course\n let info = {\n number: addCourseNumber,\n name: addCourseTitle,\n description: addCourseDescription,\n professor: `${state.authUser.email}`,\n capacity: addCourseCapacity,\n students: []\n }\n\n //intializing status code to 0, will be updated with appropriate status code in fetch\n let status = 0;\n\n //POST request to /course endpoint, for persisting new course to database \n fetch(`${env.apiUrl}/course`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `${state.authUser.token}`\n },\n body: JSON.stringify(info)\n }).then(resp => {\n status = resp.status;\n return resp.json();\n }).then(payload => {\n if(status >= 400){\n updateAddCourseErrorMessage(payload.message);\n } else {\n showTaughtCourses();\n }\n }).catch(err => console.error(err));\n \n }", "title": "" }, { "docid": "fd169dfc4b4a4bce4b1c3be1f285299d", "score": "0.52359825", "text": "function setUpNewRoom(roomController, rcName)\n{\n let newMainRoomRecord = {\n TimeToCheck: CONST.VAL_MAINTAINROADSTIMER\n };\n\n let rooms = Object.keys(roomController);\n for (let i = 0; i < rooms.length; ++i)\n {\n let roomName = rooms[i];\n let absRoomName = roomController[roomName];\n let room = Game.rooms[absRoomName];\n\n let roomType = roomName.charAt(0);\n if (roomType == \"M\" || roomType == \"E\")\n {\n if ((room != undefined && room.controller.level > 4 && roomType == \"M\") || roomType == \"E\")\n {\n if (!room)\n {\n newMainRoomRecord[absRoomName] = [];\n continue;\n }\n\n let roads = cacheFind.findCached(CONST.CACHEFIND_FINDROADS, room);\n let roadPositions = [];\n for (let j = 0; j < roads.length; ++j)\n {\n roadPositions.push(\n {\n x: roads[j].pos.x,\n y: roads[j].pos.y\n });\n }\n newMainRoomRecord[absRoomName] = roadPositions;\n }\n }\n }\n return newMainRoomRecord;\n\n}", "title": "" }, { "docid": "eb0b3658469ad4493b2a6c43508a1b50", "score": "0.52301097", "text": "function writeBuilding(organisationBuilding, organisation, building, room) {\n\tvar buildingRef = firebase.database().ref().child('buildings');\n\tvar existingBuildingRef = buildingRef.orderByChild('organisationBuilding').equalTo(organisationBuilding);\n\texistingBuildingRef.once('value', function(snapshot) {\n\t\tif(snapshot.exists()) { //if a building belonging to the associated organisation already exists then the new room is appended to the room list\n\t\t\tsnapshot.forEach(function(childSnapshot) {\n\t\t\t\tvar buildingKey = childSnapshot.key;\n\t\t\t\tconsole.log(buildingKey);\n\t\t\t\tbuildingRef.child(buildingKey + '/rooms').update({[room]: true});\n\t\t\t});\n\t\t}\n\t\telse { //else a new buliding node is added with all of the information\n\t\t\tvar buildingKey = buildingRef.push().key; //creates a new building entry under an autogenerated key\n\t\t\tbuildingRef.child(buildingKey).update({\n\t\t\tbuildingName: building, organisation: organisation, organisationBuilding: organisationBuilding, rooms: true});\n\t\t\tbuildingRef.child(buildingKey + '/rooms').update({[room]: true});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e5195bf773519d2cbb2c9a009e67a657", "score": "0.522621", "text": "function _roomChanged(){\n UtilityController.measureStep(\"Room selected\", 5);\n\n activeSelectField = $(\"#buildingSelect\")[0];\n activeBuilding = activeSelectField.options[activeSelectField.selectedIndex].value;\n\n activeSelectField = $(\"#floorSelect\")[0];\n activeFloor = activeSelectField.options[activeSelectField.selectedIndex].value;\n\n activeSelectField = $(\"#roomSelect\")[0];\n activeRoom = activeSelectField.options[activeSelectField.selectedIndex].value;\n }", "title": "" }, { "docid": "cc5760efbfc3b92cd4ac7d3c4a31e308", "score": "0.5224631", "text": "function addRoom()\n{\n room_name = document.getElementById(\"room_name\").value;\n // Add the room name in database\n firebase.database().ref(\"/\").child(room_name).update({ purpose:\"adding user name\" });\n // Set the local storage with this room name\n localStorage.setItem(\"room_name\", room_name);\n // Open the page to start chat message\n window.location = \"kwitter_page.html\";\n}", "title": "" }, { "docid": "151b0e84db1df0bbfcefb51a7d1dbdaa", "score": "0.52160317", "text": "function goRoom(nomeMap){ \n\n //Redirect to Lobby\n var data = { \n accountId: accountId,\n charId: charId,\n map: nomeMap\n }\n \n console.log(data);\n // Send data via POST and redirect to select room\n var redirect = function(url, method) {\n var form = document.createElement('form');\n form.method = method;\n form.action = url;\n for (var name in data) {\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = name;\n input.value = data[name];\n form.appendChild(input);\n }\n document.body.appendChild(form);\n form.submit();\n };\n \n redirect('/mapAcess', 'post');\n \n \n }", "title": "" }, { "docid": "79276f786b654fd91170a5e54a79cc6b", "score": "0.520952", "text": "function roomAvail() {\n\n loadResidenceLists(\"reserveResidence\");\n\n $('#system_options').html('<strong style=\"color: #37BC9B;\">Special Room Reservation</strong><br><div><input type=\"text\" class=\"mbtn\" placeholder=\"First Room\" id=\"room_start\"> &nbsp;<input type=\"text\" class=\"mbtn\" placeholder=\"nth room\" id=\"room_end\"><br><br><select id=\"reserveResidence\" class=\"mbtn\" style=\"text-transform: uppercase;\"></select><br><br><button class=\"btn\" style=\"background: #37BC9B; color: white;\" id=\"specialReserve\"> Reserve Room(s)</button></div>');\n\n $(\"#specialReserve\").on('click', function () {\n\n var residence = $(\"#reserveResidence\");\n var room_start = $(\"#room_start\");\n var room_end = $(\"#room_end\");\n\n /* SIMPLE VALIDATION */\n\n if (room_start.val().length > 0) {\n\n if (parseInt(room_start.val()) > parseInt(room_end.val())) {\n room_end.val('');\n }\n\n $.post('proc_adds.php', {\n act: \"new_room_reserve\",\n residence: residence.val(),\n room_start: room_start.val(),\n room_end: room_end.val()\n },\n function (response) {\n\n sysOpt.html(response);\n\n });\n\n\n } else {\n room_start.focus();\n }\n\n });\n\n\n}", "title": "" }, { "docid": "74b348952b0fbc33f67366e3163c4d02", "score": "0.5207639", "text": "function addLocation(mapLocation)\n{\n\t/* values are\n\t * mapLocation.name,\n\t * mapLocation.desc,\n\t * mapLocation.lon,\n\t * mapLocation.lat,\n\t * mapLocation.zoom\n\t */\n\tmaps_debug(\"add Loc:\"+mapLocation.name+\"-\"+mapLocation.desc);\n\t$(\"#locationList\").append('<li class=\"ui-widget-content\"><div><h3>'+mapLocation.name+\n\t\t\t'<img src=\"img/loc_icons/sb.png\" class=\"align_right\"/>'+\n\t\t\t'</h3><div class=\"locDescribtion\">'+mapLocation.desc+'</div>'+\n\t\t\t'<div id=\"lon\" style=\"display:none;\">'+mapLocation.lon+'</div>'+\n\t\t\t'<div id=\"lat\" style=\"display:none;\">'+mapLocation.lat+'</div>'+\n\t\t\t'<div id=\"zoom\" style=\"display:none;\">'+mapLocation.zoom+'</div>'+\n\t\t\t'</div></li>');\n\t\t\t\t\n}", "title": "" }, { "docid": "c76bedf5a4313d82cc7e01830711cfe2", "score": "0.5205086", "text": "function enterCreateForm(){\n let joinForm = document.querySelector('.join-form');\n let createForm = document.querySelector('.create-form');\n\n createForm.style.visibility=\"visible\";\n \n joinForm.classList.remove('animate__animated', 'animate_fadeInLeft');\n joinForm.classList.add('animate__animated', 'animate__fadeOutRight');\n\n createForm.classList.remove('animate__animated', 'animate__fadeOutRight');\n createForm.classList.add('animate__animated', 'animate__fadeInLeft');\n \n /* Assign randomly generated string as roomId */\n roomId=uuidv4();\n\n setURL();\n}", "title": "" }, { "docid": "37cbf18ebdbc67abc5b1ece07938ab89", "score": "0.5204038", "text": "function createNewMeeting(event){\n\tevent.preventDefault();\n\tvar meetingname = $('#meetingName').val();\n\tvar accesscode = $('#accesscode').val();\n\tvar user_id = sessionStorage.userid;\n\tif(meetingname!=\"\" || accesscode!=\"\"){\n\t\tvar newMeeting = fb.push();\n\t\tvar firebase_id = newMeeting.path.m[0];\n\t\t$.post('php/addNewMeeting.php',{name:meetingname, accesscode:accesscode, user_id:user_id, firebase_id:firebase_id})\n\t\t\t.done(function(data){\n\t\t\t\tconsole.log(data);\n\t\t\t\t//generates a new child location on our firebase db.\n\t\t\t\t\n\t\t\t\tvar meeting = {\n\t\t\t\t\t\"name\":meetingname,\n\t\t\t\t\t\"meetingid\":data,\n\t\t\t\t\t\"userid\":user_id,\n\t\t\t\t\t\"accesscode\":accesscode,\n\t\t\t\t\t\"showaccesscode\":false,\n\t\t\t\t\t\"showmeeting\":false,\n\t\t\t\t\t\"questions\":[]\n\t\t\t\t};\n\t\t\t\t//set the content of our child location with meeting. Adds the meeting to firebase.\n\t\t\t\tnewMeeting.set(meeting);\n\t\t\t});\n\t}\n}", "title": "" }, { "docid": "b675470fea18c6c9348e34548c50218c", "score": "0.5202729", "text": "function addRoom(space){\n //draw space\n p5.stroke(255);\n p5.noFill();\n p5.rect(space.X, space.Y, space.Width, space.Height)\n\n let quadWidth = space.Width/4.0;\n let quadHeight = space.Height/4.0;\n\n let topX = p5.random(2, quadWidth);\n let topY = p5.random(2, quadHeight);\n topX = space.X + topX;\n topY = space.Y + topY;\n\n let bottomX = p5.random(2, quadWidth);\n let bottomY = p5.random(2, quadHeight);\n bottomX = space.X + space.Width - bottomX;\n bottomY = space.Y + space.Height - bottomY;\n\n //p5.stroke(255);\n //draw room\n p5.noStroke();\n p5.fill(170);\n p5.rect(topX, topY, bottomX - topX, bottomY - topY);\n }", "title": "" }, { "docid": "f9e54fa8bcd596171ff6351ffbbb0d10", "score": "0.5200103", "text": "function createRoom(allowEmpty) {\n // Create a random string to use as the rooms id\n let roomId = Math.random().toString(36).substring(2);\n // Ensure it isn't a duplicate id\n while (roomId in rooms) roomId = Math.random().toString(36).substring(2);\n // Create the new room object and push it and its id to the rooms array\n let newRoom = new Room(roomId, true);\n return newRoom;\n}", "title": "" }, { "docid": "0f533975e4dd03beb4eaa7b934aab1de", "score": "0.5197712", "text": "function addRoom() {\n room_name = document.getElementById(\"roomName\").value;\n\n localStorage.setItem(\"Roomname\",room_name);\n \n window.location = \"kwitter_room.html\";\n\n firebase.database().ref(\"/\").child(room_name).update({\n purpose: \"Adding Room Name\"\n });\n}", "title": "" }, { "docid": "89b17c636d0ca442af65c9c2b5f04ba9", "score": "0.5193935", "text": "function validateLocationField(element) {\n\t\tif(!KPS.data.locations.exists(element.value)) { // TODO: generate DOM?\n\t\t\tKPS.validation.validationError(element, '\"'+element.value+'\" is not a valid location.'+(element.value?' Would you like to <a class=\"inject-form-element\" onclick=\"KPS.event.route.showNewLocationScreen(\\''+element.value+'\\', this.formElement);\">create it</a>?':''));\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "9f8a21ea35eda127377b883424698e5b", "score": "0.51925313", "text": "function addLocation () {\n if (realLocation === true) {\n if (document.getElementById('nickname').value !== \"\") {\n name = document.getElementById('nickname').value;\n };\n LCI.addLocation(lat, lng, name);\n location.href = 'index.html';\n } else {\n alert('Please enter a valid address')\n }\n \n}", "title": "" }, { "docid": "4fd32d4ffcb59b5251119817e0ea7e81", "score": "0.51883787", "text": "function changeRoom() {\n\tvar elemID = null;\n\tif (this.id == '+') {\n\t\telemID = prompt(\"Enter new room name:\", \"Name...\").trim();\n\t\tif (elemID == '+') {\n\t\t\telemID = null;\n\t\t} else if (elemID.length > 8) {\n\t\t\telemID = null;\n\t\t\talert('Room name too long');\n\t\t} else if (elemID.indexOf(' ') >= 0) {\n\t\t\telemID = null;\n\t\t\talert('Room name must not contain spaces');\n\t\t}\n\t} else {\n\t\telemID = this.id;\n\t}\n\tconsole.log(this.id);\n\tif (elemID != null) {\n\t\t$('#sidebarTitle').text(elemID);\n\t\tsocket.emit('requestRoomChange', elemID);\n\t\t$(\".menu\").hide();\n\t}\n}", "title": "" }, { "docid": "678c81ca422661e2e78fbbcf75ccdcb9", "score": "0.5186018", "text": "function newHouse(house,loc){\n\t//make a new house\n\tlet mset = padMap(makeHouseMap(house),Math.floor(canvas.width/size),Math.floor(canvas.height/size));\n\tmap = map2Box(mset['map'])\n\tmap_obj = mset['objs'];\n\n\t//freeze the camera if house is small\n\tif((map[0].length-1) <= Math.floor(canvas.width/size) && (map.length-1) <= Math.floor(canvas.height/size))\n\t\tfreezeCamera = true;\n\telse\n\t\tfreezeCamera = false;\n\n\tpanCamera();\n\n\t//get kyle position\n\tlet enterPos = findDoor(map);\n\tkyle.x = enterPos[0];\n\tkyle.y = enterPos[1]-1;\t//place above the door\n\n\tworld_doors = [[enterPos,\"overworld\"]];\n\n\t//make monsters in the house (placeholder)\n\tlet nofloor = [kyle.x+\"-\"+kyle.y]\n\tcurMonsters = monsterHouse(mset, nofloor);\n\t//console.log(curMonsters)\n\n\t//make items\n\tcurItems = litterHouse(mset['map'],mset['htype']);\n\n\tcurTxt = \"Entered a \" + mset['htype'] + \"!\";\n\n\t//save data\n\tsavedHouses[loc] = {'map':copy2d(map), 'objs':map_obj.slice(), 'monsters':curMonsters.slice(), 'items': curItems.slice()};\n}", "title": "" }, { "docid": "2c8896b672f567e275bfbfb33b052ec7", "score": "0.5167337", "text": "function addPassengerToJourney(e) {\n e.preventDefault();\n var newPassenger = $('#passengerName').val();\n var driverId = $(this).attr('data-id');\n $.ajax({\n type: 'POST',\n url: '/drivers/' + driverId + '/passengers',\n data: {\n name: newPassenger,\n driver_id: driverId\n }\n });\n}", "title": "" }, { "docid": "bb4f60133d487f960c12e4317f44a78b", "score": "0.5154086", "text": "add() {\n equipmentService.newEquipmentType(this.typeName, this.brand, this.year, this.comment, this.price);\n\n this.handleClose();\n history.push('/equipmentTypes/Helmet');\n }", "title": "" }, { "docid": "55d18f4af0e4b1faa64612cb4024a8a6", "score": "0.5148831", "text": "function addLocation(result) {\n\n // Manually clear form input box\n $(\"#newLoc\").val(\"\");\n\n // Reload page because too many things to manually change\n location.reload(true);\n}", "title": "" }, { "docid": "0619fb311564762d1b057238e37217ad", "score": "0.51439077", "text": "function setRoom(name){\n\t\tconsole.log('setting up room');\n\t\t$('form').remove();\n\t\t$('h1').text(\"Welcome to room:\" + name);\n\t\t//$('#subTitle').text(\"Share this link with anyone you want to join\");\n\t\t$('#roomLink').text(location.href);\n\t\t$('body').addClass('active');\n\t}", "title": "" }, { "docid": "53aef3c23addddf984a8924f8375b2d6", "score": "0.51299524", "text": "function add_location_behavior() {\n\t(jQuery)('.add_location_button').livequery('click', function()\n\t{\n\t\t/* add location button was clicked */\n\t\t/* get item index on page */\n\t\tvar $id = (jQuery)(this).attr('id').split('-')[1];\n\t\t\n\t\t/* show new location form */\n\t\t(jQuery)('#location_notification-'+$id).html(\n\t\t\t'<br/><label for=\"newLocation-'+$id+'\">New location name:</label><br/>'\n\t\t\t+'<input type=\"text\" id=\"newLocation-'+$id+'\" name=\"newLocation-'+$id+'\" size=\"40\" />'\n\t\t\t+'<br/>'\n\t\t\t+'<label for=\"newLocationDescription-'+$id+'\">Description:</label><br/>'\n\t\t\t+'<textarea rows=\"6\" cols=\"30\" id=\"newLocationDescription-'+$id+'\" name=\"newLocationDescription-'+$id+'\" />'\n\t\t\t+'<br/>'\n\t\t\t+'<input type=\"button\" id=\"saveNewLocation-'+$id+'\" class=\"saveNewLocation\" value=\"Save Location\" />');\n\t\t\n\t});\n}", "title": "" }, { "docid": "8f18d22950e76a6543febb28e2e7d5ee", "score": "0.51242375", "text": "handleChange(e) {\n this.setState({\n newRoom: e.target.value\n });\n }", "title": "" }, { "docid": "716d938b425f371c027da662858e238a", "score": "0.5118792", "text": "function addParty(){\n\tvar formValues = getFormValues();\n\tif(validateFormValues(formValues)){\n\t\tsubmitPostRequest(\"AddRegistryParty\",formValues)\n\t}\n}", "title": "" } ]
4db14be9d7fe986e96b5110455daa183
up interval clear Snake movement for Down Direction
[ { "docid": "6e073249527fb01638285e67b142a0a1", "score": "0.64193577", "text": "function snake_Movement_Down()\r\n\t{\r\n\t\t\t\t\r\n\t\tmyVar_Down=setInterval(function()\r\n\t\t{\r\n\t\t\t//randomI--;\r\n\t\t\trandomI++;\r\n\t\t\tvar z1=randomI+'_'+randomJ;\r\n\t\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t\t{\r\n\t\t\t\tif(arr_Dir[i]==z1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(z1==f)\r\n\t\t\t{\r\n\t\t\r\n\t\t\t\tarr_Dir.push(f);\r\n\t\t\t\t$('#'+f).css(\"background\",\"black\");\r\n\t\t\t\tcount+=10;\r\n\t\t\t\t$('#Score_val').text(count);\r\n\t\t\t\tif(count==win_var)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').css(\"color\",\"green\");\r\n\t\t\t\t\t$('#Error').text(\"Congratz you won!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tgenrate_Food();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tarr_Dir.push(z1);\t\r\n\t\t\t\t$('#'+arr_Dir.shift()).css(\"background\",\"#fff\");\r\n\t\t\t\t\r\n\t\t\t\t$('#'+z1).css(\"background\",\"black\");\r\n\t\t\t}\r\n\t\t\tif(randomI==15)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t},500);\r\n\t\t\r\n\t\t\trandomI++;\r\n\t\t\tvar z1=randomI+'_'+randomJ;\r\n\t\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t\t{\r\n\t\t\t\tif(arr_Dir[i]==z1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar);\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\tif(z1==f)\r\n\t\t\t{\r\n\t\t\t\t//alert(\"hello\");\r\n\t\t\t\tarr_Dir.push(f);\r\n\t\t\t\t$('#'+f).css(\"background\",\"black\");\r\n\t\t\t\tcount+=10;\r\n\t\t\t\t$('#Score_val').text(count);\r\n\t\t\t\tif(count==win_var)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').css(\"color\",\"green\");\r\n\t\t\t\t\t$('#Error').text(\"Congratz you won!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\tgenrate_Food();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tarr_Dir.push(z1);\r\n\t\t\t\t$('#'+arr_Dir.shift()).css(\"background\",\"#fff\");\r\n\t\t\t\t$('#'+z1).css(\"background\",\"black\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(randomI==15)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t}", "title": "" } ]
[ { "docid": "f86cd9b676b7e105ebb5ca730bf40717", "score": "0.7164423", "text": "function down() {\n document.getElementById(\"leftSwatch\").classList.add(\"clear\");\n if (clickID == -1)\n //Prevent multimple loops!\n clickID = setInterval(whileDown, 60 /*execute every 60ms*/);\n }", "title": "" }, { "docid": "be279448e56f39bb55628d425d998047", "score": "0.708642", "text": "function moveUp(snake) {\n if (snake.dy === 0) {\n snake.dy = -grid;\n snake.dx = 0;\n }\n}", "title": "" }, { "docid": "3ad99d89a9895b33997c474348caae9c", "score": "0.6916116", "text": "down() {\n this.y = Math.min(this.y + this.speed, this.boardHeight - this.height);\n }", "title": "" }, { "docid": "7989b451723c58a21b7bb8d63b188e2c", "score": "0.68822974", "text": "function moveUp(){\n let oldTop = snake[0].position().top;\n let oldLeft = snake[0].position().left;\n snake.unshift(snake.pop());\n snake[0].css('top',oldTop-10);\n snake[0].css('left',oldLeft);\n}", "title": "" }, { "docid": "69ce1efab9896d40fafa8d1ceb0bea78", "score": "0.68628716", "text": "function moveDown(){\n let oldTop = snake[0].position().top;\n let oldLeft = snake[0].position().left;\n snake.unshift(snake.pop());\n snake[0].css('top',oldTop+10);\n snake[0].css('left',oldLeft);\n}", "title": "" }, { "docid": "d68661afca4d4cdeb845c56621059380", "score": "0.68458605", "text": "function snekUp() {\r\n direction -= width\r\n}", "title": "" }, { "docid": "82c4360ca76bb4722cf66c4fc3dcbc3d", "score": "0.68370426", "text": "moveUp() {\n this.speedY = -8;\n this.moving = MoveState.UP;\n }", "title": "" }, { "docid": "da55a81a77324df7eab58a31648e1308", "score": "0.6818371", "text": "function moveUp() {\n toMove.style.marginTop = yLine + 'px';\n if (yLine <= 0) {\n clearInterval(d);\n a = setInterval(moveRight, step);\n }\n yLine -= 2;\n}", "title": "" }, { "docid": "95ff2aa183c3fb1dbfe7de41c86807fd", "score": "0.68170726", "text": "up() {\n this.y = Math.max(0, this.y - this.speed);\n }", "title": "" }, { "docid": "f633c96b7424f56c4bdc33dcc2abcb81", "score": "0.66138786", "text": "function move_down(min, max, speed, w_min, w_max, h_min, h_max) {\r\n\tvar snake = $(\"#0\");\r\n\tvar food = $(\"#food\");\r\n\tif (((snake.offset().top - food.offset().top === 3) || (snake.offset().top - food.offset().top === 2) || (snake.offset().top - food.offset().top === 1) || (snake.offset().top - food.offset().top === 0)) && ((snake.offset().left - food.offset().left >= -10) && (snake.offset().left - food.offset().left <= 10))) {\r\n\t\tfood.remove();\r\n\t\tconsume(speed, w_min, w_max, h_min, h_max);\r\n\t}\r\n\tvar control_obj = {};\r\n\tcontrol_obj.flag = true;\r\n\tcollision_detection();\r\n\t$(document).on(\"keydown\", function(event) {\r\n\t\tif (event.keyCode === 68 || event.keyCode === 39) { // right\r\n\t\t\tcontrol_obj.flag = false;\r\n\t\t\tcontrol_obj.which = \"right\";\r\n\t\t} else if (event.keyCode === 65 || event.keyCode === 37) { // left\r\n\t\t\tcontrol_obj.flag = false;\r\n\t\t\tcontrol_obj.which = \"left\";\r\n\t\t} else if (event.keyCode === 87 || event.keyCode === 38) { // up\r\n\t\t\tif ($(\"#canvas\").children().length < 3) {\r\n\t\t\t\tcontrol_obj.flag = false;\r\n\t\t\t\tcontrol_obj.which = \"up\";\r\n\t\t\t}\r\n\t\t}\r\n\t})\r\n\tsetTimeout(function() {\r\n\t\tif ((min < max) && control_obj.flag && game_counter) {\r\n\t\t\t$(\"#0\").css(\"top\", \"+=3px\");\r\n\t\t\tmin += 3;\r\n\t\t\tmove_down(min, max, speed, w_min, w_max, h_min, h_max);\r\n\t\t} else {\r\n\t\t\tif (game_counter) {\r\n\t\t\t\tif (control_obj.which === \"right\") { // right\r\n\t\t\t\t\tmove_right($(\"#0\").offset().left, w_max, speed, w_min, w_max, h_min, h_max);\r\n\t\t\t\t} else if (control_obj.which === \"left\") { // left\r\n\t\t\t\t\tmove_left($(\"#0\").offset().left, w_min, speed, w_min, w_max, h_min, h_max);\r\n\t\t\t\t} else if (control_obj.which === \"up\") { // up\r\n\t\t\t\t\tmove_up($(\"#0\").offset().top, h_min, speed, w_min, w_max, h_min, h_max);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgame_counter = false;\r\n\t\t\t\t\talert(\"Game over!\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\talert(\"Game over!\");\r\n\t\t\t}\r\n\t\t}\r\n\t}, speed);\r\n}", "title": "" }, { "docid": "177d7670c5fb64a71b7e164212ee8816", "score": "0.6607112", "text": "moveUp() {\n if (this.yPos - this.stepSize < 0) {\n this.yPos = 0;\n } else {\n this.yPos -= this.stepSize;\n }\n clearScreen();\n }", "title": "" }, { "docid": "b9a59a8c447278417b32fa7c4778f19e", "score": "0.6581579", "text": "function snake_Movement_Up()\r\n\t{\r\n\t\t\t\t\r\n\t\tmyVar_Up=setInterval(function()\r\n\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\trandomI--;\r\n\t\t\tvar z1=randomI+'_'+randomJ;\r\n\t\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t\t{\r\n\t\t\t\tif(arr_Dir[i]==z1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(z1==f)\r\n\t\t\t{\r\n\t\t\t\t//alert(\"hello\");\r\n\t\t\t\tarr_Dir.push(f);\r\n\t\t\t\t$('#'+f).css(\"background\",\"black\");\r\n\t\t\t\tcount+=10;\r\n\t\t\t\t$('#Score_val').text(count);\r\n\t\t\t\tif(count==win_var)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').css(\"color\",\"green\");\r\n\t\t\t\t\t$('#Error').text(\"Congratz you won!\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tgenrate_Food();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tarr_Dir.push(z1);\r\n\t\t\t\t$('#'+arr_Dir.shift()).css(\"background\",\"#fff\");\r\n\t\t\t\t$('#'+z1).css(\"background\",\"black\");\r\n\t\t\t}\r\n\t\t\tif(randomI<0)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar_Up)\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t},500);\r\n\t\t\t\t\r\n\t\trandomI--;\r\n\t\tvar z1=randomI+'_'+randomJ;\r\n\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t{\r\n\t\t\tif(arr_Dir[i]==z1)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(z1==f)\r\n\t\t{\r\n\t\t\tarr_Dir.push(f);\r\n\t\t\t$('#'+f).css(\"background\",\"black\");\r\n\t\t\tcount+=10;\r\n\t\t\t$('#Score_val').text(count);\r\n\t\t\tif(count==win_var)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').css(\"color\",\"green\");\r\n\t\t\t\t$('#Error').text(\"Congratz you won!\");\r\n\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tgenrate_Food();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tarr_Dir.push(z1);\r\n\t\t\t$('#'+arr_Dir.shift()).css(\"background\",\"#fff\");\r\n\t\t\t\t\r\n\t\t\t$('#'+z1).css(\"background\",\"black\");\r\n\t\t}\r\n\t\tif(randomI<0)\r\n\t\t{\r\n\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\r\n\t\t\tclear_Feilds();\r\n\t\t\tclearInterval(myVar_Up);\r\n\t\t\tclearInterval(myVar);\r\n\t\t\tclearInterval(myVar_Left);\r\n\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\r\n\t\t}\r\n\t\r\n\t}", "title": "" }, { "docid": "bd2bf7a367f2ed9510c340908353337f", "score": "0.6574989", "text": "function move_up(min, max, speed, w_min, w_max, h_min, h_max) {\r\n\tvar snake = $(\"#0\");\r\n\tvar food = $(\"#food\");\r\n\tif (((snake.offset().top - food.offset().top === 3) || (snake.offset().top - food.offset().top === 2) || (snake.offset().top - food.offset().top === 1) || (snake.offset().top - food.offset().top === 0)) && ((snake.offset().left - food.offset().left >= -10) && (snake.offset().left - food.offset().left <= 10))) {\r\n\t\tfood.remove(); // removes food \r\n\t\tconsume(speed, w_min, w_max, h_min, h_max); // this function calls food generate to generate food and makes the snake grow\r\n\t}\r\n\tvar control_obj = {};\r\n\tcontrol_obj.flag = true;\r\n\tcollision_detection(); // detects collision between snakes everytime it moves\r\n\t$(document).on(\"keydown\", function(event) {\r\n\t\tif (event.keyCode === 65 || event.keyCode === 37) { // left\r\n\t\t\tcontrol_obj.flag = false;\r\n\t\t\tcontrol_obj.which = \"left\"; \r\n\t\t} else if (event.keyCode === 83 || event.keyCode === 40) { // down\r\n\t\t\tif ($(\"#canvas\").children().length < 3) { // \r\n\t\t\t\tcontrol_obj.flag = false;\r\n\t\t\t\tcontrol_obj.which = \"down\";\t\t\r\n\t\t\t}\r\n\t\t} else if (event.keyCode === 68 || event.keyCode === 39) { // right\r\n\t\t\tcontrol_obj.flag = false;\r\n\t\t\tcontrol_obj.which = \"right\";\r\n\t\t}\r\n\t})\r\n\r\n\t// upon button pressed the control_obj.which changes its properties to whatever key is pressed\r\n\t// this causes other movement functions to be called\r\n\tsetTimeout(function() {\r\n\t\tif ((min > max) && control_obj.flag && game_counter) { // stops moving upon these conditions\r\n\t\t\t$(\"#0\").css(\"top\", \"-=3px\");\r\n\t\t\tmin -= 3;\r\n\t\t\tmove_up(min, max, speed, w_min, w_max, h_min, h_max);\r\n\t\t} else {\r\n\t\t\tif (game_counter) {\r\n\t\t\t\tif (control_obj.which === \"left\") { // left\r\n\t\t\t\t\tmove_left($(\"#0\").offset().left, w_min, speed, w_min, w_max, h_min, h_max)\r\n\t\t\t\t} else if (control_obj.which === \"down\") { // down\r\n\t\t\t\t\tmove_down($(\"#0\").offset().top, h_max, speed, w_min, w_max, h_min, h_max)\r\n\t\t\t\t} else if (control_obj.which === \"right\") { // right\r\n\t\t\t\t\tmove_right($(\"#0\").offset().left, w_max, speed, w_min, w_max, h_min, h_max)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgame_counter = false;\r\n\t\t\t\t\talert(\"Game over!\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\talert(\"Game over!\");\r\n\t\t\t}\r\n\t\t}\r\n\t}, speed);\r\n}", "title": "" }, { "docid": "fcf95c31dfab99b59fedb8cfeb39d964", "score": "0.6571245", "text": "function moveDown() {\n undrawTetromino();\n currentPosition += width;\n drawTetromino();\n freeze();\n }", "title": "" }, { "docid": "99b237f1a1536dc27bc278c1cb0dad0f", "score": "0.6570902", "text": "function moveDown() {\n if (downDistance <= 55) {\n wire = mat4.translate(wire, [0.0, -.1, 0]);\n downDistance++;\n drawScene();\n } else {\n clearInterval(moveDownId);\n rotateArmsId = setInterval(rotateArms, 50);\n }\n}", "title": "" }, { "docid": "a4781cfa02954efb7718898757b1d6e2", "score": "0.6525469", "text": "function moveDown() {\n stepsDown++;\n //Set position to be erased\n setLastPos();\n\n\n //Simulate walking by changing frames\n self.frameXCounter++;\n self.frameX = (self.frameXCounter % self.numOfHFrames);\n\n //Change position\n self.yPos += self.travelDist;\n self.canvas.style.top = self.yPos + \"px\";\n\n //Update topside, bottomside, rightside, and leftside\n updateLRTBSide();\n\n //Draw new position\n if (!self.dead)\n drawIt();\n\n if (stepsDown < numOfStepsDown - 1 && !self.dead)\n {\n if (checkIfOk2(40))\n {\n setTimeout(moveDown, self.scurrySpeed);\n }\n else//Start again\n setTimeout(walk, self.scurrySpeed);\n }\n else\n //Start again\n setTimeout(walk, self.scurrySpeed);\n\n }", "title": "" }, { "docid": "7168775c073073db69107f65a5bab80b", "score": "0.65087193", "text": "function moveUp() {\n stepsUp++;\n //Set position to be erased\n setLastPos();\n\n //Simulate walking by changing frames\n self.frameXCounter++;\n self.frameX = (self.frameXCounter % self.numOfHFrames);\n\n //Change position\n self.yPos -= self.travelDist;\n self.canvas.style.top = self.yPos + \"px\";\n\n //Update topside, bottomside, rightside, and leftside\n updateLRTBSide();\n\n\n //Draw new position\n if (!self.dead)\n drawIt();\n\n if (stepsUp < numOfStepsUp - 1 && !self.dead)\n {\n if (checkIfOk2(38))\n {\n setTimeout(moveUp, self.scurrySpeed);\n }\n else//Start again\n setTimeout(walk, self.scurrySpeed);\n }\n else\n //Start again\n setTimeout(walk, self.scurrySpeed);\n }", "title": "" }, { "docid": "45ab1ad310155f9172ef48d6f208d332", "score": "0.6493988", "text": "moveDown() {\n this.speedY = 8;\n this.moving = MoveState.DOWN;\n }", "title": "" }, { "docid": "5debe38b2f3f5c4dceef8f46db511f39", "score": "0.6488325", "text": "function moveUp() {\n if (upDistance <= 100) {\n wire = mat4.translate(wire, [0.0, 0.1, 0]);\n teapot = mat4.translate(teapot, [0.0, 0.25, 0]);\n upDistance++;\n drawScene();\n } else {\n clearInterval(moveUpId);\n shakeClawId = setInterval(shakeClaw, 50);\n }\n}", "title": "" }, { "docid": "f0b0974828bbbce8c59182ee901b79b0", "score": "0.6467058", "text": "function moveUp() {\n bY -= 25;\n fly.play();\n }", "title": "" }, { "docid": "b5c64c2a6d143705c4bd9a290fe0fa40", "score": "0.64572275", "text": "moveSkierUp() {\n this.y -= Constants.SKIER_STARTING_SPEED;\n }", "title": "" }, { "docid": "b8c1efbdf1e72d5a84c90c4ba8433f03", "score": "0.6457199", "text": "function moveup() {\n firstGamePiece.speedY -= 1;\n}", "title": "" }, { "docid": "d5a5c11b31f86a7d6d88f4ce37ae420f", "score": "0.6408083", "text": "function moveDown() {\r\n undraw();\r\n currentPosition += width;\r\n draw();\r\n //zmrazi tetromino ak narazi na dolnu hranicu alebo ine tetromino\r\n freeze();\r\n }", "title": "" }, { "docid": "1c20cf5eb8d542eba5150ce1c046f5f3", "score": "0.6383937", "text": "moveDown() {\n if (this.yPos + this.size + this.stepSize > myCanvas.height) {\n this.yPos = myCanvas.height - this.size;\n } else {\n this.yPos += this.stepSize;\n }\n clearScreen();\n }", "title": "" }, { "docid": "b073c7d0abc2df4bd0615ce8a0f5626c", "score": "0.63742423", "text": "function moveDown() {\n undraw();\n currentPosition += width;\n draw();\n freeze();\n }", "title": "" }, { "docid": "db36b71f82f47befdedef4a6dde780df", "score": "0.63597107", "text": "function resetSnake() {\n snakePosition = [{\n x: 180,\n y: 100\n },\n {\n x: 160,\n y: 100\n },\n {\n x: 140,\n y: 100\n }];\n\n clearInterval(timer);\n}", "title": "" }, { "docid": "00a3138f30356dabacf721dcc7d829f8", "score": "0.63533056", "text": "function moveDown() {\n undraw();\n currentPosition = currentPosition += width;\n draw();\n freeze();\n }", "title": "" }, { "docid": "0e90901a5ed3c57b3a614e6749c0c5ec", "score": "0.63474965", "text": "function moveDown() {\n freeze();\n undraw();\n currentPosition += width;\n draw();\n }", "title": "" }, { "docid": "390b75a45938276db441a05a8a952c5a", "score": "0.6325235", "text": "up(time) {\n this._squash(time);\n this._downTime = Infinity;\n this._playSample(time, 'up');\n }", "title": "" }, { "docid": "0a28bfb92f187b0845d3b87e40d97798", "score": "0.631363", "text": "function moveDown() {\n undraw()\n currentPosition = currentPosition += width\n draw()\n freeze()\n }", "title": "" }, { "docid": "c4bb4a143cca1d607f11e518e27f18ef", "score": "0.6306841", "text": "up(time) {\n this._squash(time);\n this._downTime = Infinity;\n this._playSample(time, 'up');\n }", "title": "" }, { "docid": "986a176862f099336f76f4075f5a5d32", "score": "0.62788063", "text": "function moveDown(){\n //undraw shape from current position\n //add whole width to current position\n //draw again in new position\n undraw();\n currentPosition += width;\n draw();\n freeze(); //invoked to check every second\n }", "title": "" }, { "docid": "d3b66f1d2dd376f6c5d953261e030028", "score": "0.62550366", "text": "function snake_loop() {\n\n snake_move();\n\n setTimeout( snake_loop, 60 );\n\n }", "title": "" }, { "docid": "4034004212f8f209583f5ab10d8ef105", "score": "0.62532264", "text": "function moveDown() {\n undraw()\n currentPosition += width\n draw() \n freeze() \n }", "title": "" }, { "docid": "973b8e714e2bc5b7138c567a438b34b5", "score": "0.6237302", "text": "function stopGame (){\n clearInterval(moving);\n Snake._reset();\n}", "title": "" }, { "docid": "26284711bcd3340894d4652e4da7ad98", "score": "0.62194383", "text": "function moveDown() {\n undraw()\n currentPosition = currentPosition += width\n draw()\n freeze()\n}", "title": "" }, { "docid": "2ad6c65798aae58c5e224ab8a1ff86c9", "score": "0.6215829", "text": "clearMove() {\n this.running = false;\n // super.clearMove();\n }", "title": "" }, { "docid": "7798011e50534fccace87421c2d5cd73", "score": "0.621038", "text": "function moveDown() {\n undraw()\n currentPosition += width\n draw()\n freeze()\n}", "title": "" }, { "docid": "75980929a3fd1ae1412659af125ad341", "score": "0.61952245", "text": "pushUp(){\n this.setVelocityY(-600);\n }", "title": "" }, { "docid": "f4aa304398bf072adefa5bd301542f8b", "score": "0.61665857", "text": "function motionDown(){\n fall(10)\n }", "title": "" }, { "docid": "643722517335abaf42eb66c0d0d10094", "score": "0.61657715", "text": "function checkloop() {\r\n if(snake[0].x > 15 * board && snakeDirection == \"right\") snake[0].x = 0;\r\n if(snake[0].x < 0 && snakeDirection == \"left\") snake[0].x = 16 * board;\r\n if(snake[0].y > 15 * board && snakeDirection == \"down\") snake[0].y = 0;\r\n if(snake[0].y < 0 && snakeDirection == \"up\") snake[0].y = 16 * board;\r\n}", "title": "" }, { "docid": "a8ba0ca8cf420fd5ad2c10e34da9d5dc", "score": "0.6163935", "text": "function moveDown() {\n undraw();\n currentPos += width;\n draw();\n freeze();\n}", "title": "" }, { "docid": "71aa29b77351a82dcacc6a4e92e2b786", "score": "0.615976", "text": "goUp () {\n if (this.direction === 'down') return false;\n this.direction = 'up';\n }", "title": "" }, { "docid": "22ab4c1b3477d3135ed938fdd4557940", "score": "0.614887", "text": "keyUp () {\n clearInterval(this.afterTouchIntervalID);\n this.oscGain.gain.value = 0;\n this.previousGain = 0;\n// delete this.previousKey;\n this.__triggerStatus = false;\n }", "title": "" }, { "docid": "a7defbd8e3fe95b1f3528243721018ff", "score": "0.61325115", "text": "moveDown() {\n this.depth -= 1;\n }", "title": "" }, { "docid": "85e6f17337598dab8013b0e3fb09308e", "score": "0.61219585", "text": "function moveDown() {\n // erases previous position\n undraw()\n\n // increases base position \n currentPosition += width\n\n // draw tetromino in new position \n draw()\n\n // check if it hit the bottom and freezes it\n freeze()\n }", "title": "" }, { "docid": "75f967fdfb9b8cfb85f6e69bd1307d54", "score": "0.61136466", "text": "function down() {\n if (isPaused) {\n return;\n }\n if (!gameover) {\n if ((y < MaxY - 1) && (Mat[x][y + 1] == -1)) {\n var div0 = document.getElementById(\"c\" + x + \"r\" + y);\n var div1 = document.getElementById(\"c\" + x + \"r\" + (y + 1));\n div1.className = div0.className;\n div0.className = \"empty\";\n y++;\n\n }\n if ((y == MaxY - 1) || (Mat[x][y + 1] != -1)) {\n /*se siamo a fine matrice oppure non ci sono posizioni libere\n\t\tblocco il frutto e richiamo la checkElem per controllare \n\t\tse devo effettuare eliminazioni*/\n Mat[x][y] = type;\n checkElem(x, y);\n insertNewPiece();\n }\n }\n}", "title": "" }, { "docid": "c359db1b7758d14198a64f6392492b1f", "score": "0.6105832", "text": "moveDown() {\n const position = this.getPosition();\n\n if (position >= this.spaceHeight - this.height) return;\n\n this.ship.style.top = `${position + this.step}px`;\n }", "title": "" }, { "docid": "cdecde712e6110774c29ba252db2d26b", "score": "0.6097943", "text": "function moveDown() {\n toMove.style.marginTop = yLine + 'px';\n if (yLine > 200) {\n clearInterval(b);\n c = setInterval(moveLeft, step);\n }\n yLine += 2;\n}", "title": "" }, { "docid": "ed7020c88c6fa59c7978a04d3f18779b", "score": "0.6093805", "text": "stop(){\r\n this.left = false\r\n this.right = false\r\n this.up = false\r\n this.down = false\r\n this.acc.set(0,0)\r\n }", "title": "" }, { "docid": "96dede0f67dccd8780eb1bf02e3d74a1", "score": "0.60910505", "text": "function move_snake() {\n if (snake.direction === UP) {\n if (snake.head.y === 0) {\n snake.head.y = height - 1\n } else {\n snake.head.y -= 1\n }\n }\n if (snake.direction === RIGHT) {\n if (snake.head.x === width - 1) {\n snake.head.x = 0\n } else {\n snake.head.x += 1\n }\n }\n if (snake.direction === DOWN) {\n if (snake.head.y === height - 1) {\n snake.head.y = 0\n } else {\n snake.head.y += 1\n }\n }\n if (snake.direction === LEFT) {\n if (snake.head.x === 0) {\n snake.head.x = width - 1\n } else {\n snake.head.x -= 1\n }\n }\n}", "title": "" }, { "docid": "8d2a89754b30af8a17326243ca51b860", "score": "0.60890543", "text": "function goUp(move){\r\tif(this.y<0){\r\t\tthis.moveIt(0,this.y-move)\r\t\tif(loop) setTimeout(this.obj+\".up(\"+move+\")\",speed)\r\t}\r}", "title": "" }, { "docid": "fb6139decbf6dbe2cd618ab7f3b1c59f", "score": "0.60626125", "text": "moveUp() {\n this.y -= HEIGHT/10;\n \n }", "title": "" }, { "docid": "9138af0cd0a2cc6709ed2f9b04238ff5", "score": "0.6061964", "text": "turnUp() {\n if (\n this.direction === Constants.SKIER_DIRECTIONS.LEFT ||\n this.direction === Constants.SKIER_DIRECTIONS.RIGHT\n ) {\n this.moveSkierUp();\n } else {\n this.moveSkierJump();\n }\n }", "title": "" }, { "docid": "2b2a0541166d7ceab18a0b243dd8970d", "score": "0.6054294", "text": "function change_snake_direction() {\r\n if (next_key == 0 && snake[0][\"vely\"] == 0 && snake_can_turn(0)) { // UP\r\n snake[0][\"vely\"] = -snake_speed;\r\n snake[0][\"velx\"] = 0;\r\n } else if (next_key == 1 && snake[0][\"vely\"] == 0 && snake_can_turn(1)) { // DOWN\r\n snake[0][\"vely\"] = snake_speed;\r\n snake[0][\"velx\"] = 0;\r\n } else if (next_key == 2 && snake[0][\"velx\"] == 0 && snake_can_turn(2)) { // LEFT\r\n snake[0][\"vely\"] = 0;\r\n snake[0][\"velx\"] = -snake_speed;\r\n } else if (next_key == 3 && snake[0][\"velx\"] == 0 && snake_can_turn(3)) { // RIGHT\r\n snake[0][\"vely\"] = 0;\r\n snake[0][\"velx\"] = snake_speed;\r\n } else {\r\n last_turn++;\r\n return;\r\n }\r\n last_turn = 1;\r\n}", "title": "" }, { "docid": "73f8613ebb83d3fb4db7ed3b544e40ce", "score": "0.6051259", "text": "function snakeKeyPressed() {\n if (keyCode === UP_ARROW) {\n sec1.snake.dir(0, -1);\n sec2.snake.dir(0, -1);\n sec3.snake.dir(0, -1);\n sec4.snake.dir(0, -1);\n } else if (keyCode === DOWN_ARROW) {\n sec1.snake.dir(0, 1);\n sec2.snake.dir(0, 1);\n sec3.snake.dir(0, 1);\n sec4.snake.dir(0, 1);\n } else if (keyCode === RIGHT_ARROW) {\n sec1.snake.dir(1, 0);\n sec2.snake.dir(1, 0);\n sec3.snake.dir(1, 0);\n sec4.snake.dir(1, 0);\n } else if (keyCode === LEFT_ARROW) {\n sec1.snake.dir(-1, 0);\n sec2.snake.dir(-1, 0);\n sec3.snake.dir(-1, 0);\n sec4.snake.dir(-1, 0);\n }\n}", "title": "" }, { "docid": "bf600928a8da4055fccfcb889a1881d6", "score": "0.6046611", "text": "function place_down(){\n\t\twhile(check_under() == false){\n\t\t\tanimate(0,1);\n\t\t}\n\t}", "title": "" }, { "docid": "0ff5d19e735a623ca045a8f43a98b04d", "score": "0.60433257", "text": "function reset() {\n clearInterval(gameInterval);\n clearInterval(virusInterval);\n intervalDuration=150;\n minDuration=75;\n tail = [];\n totalTail = 0;\n directionVar = \"Right\";\n direction = \"Right\";\n previousDir = \"Right\";\n xSpeed = scale * speed;\n ySpeed = 0;\n snakeHeadX = 0;\n snakeHeadY = 0;\n playing = false; gameStarted = false;\n boundaryCollision=false;\n}", "title": "" }, { "docid": "18dd67b913eb10b005093304435907a8", "score": "0.60431707", "text": "moveDown() {\n this.yPos += this.speed;\n }", "title": "" }, { "docid": "8a5bf033c44d0173e9ce8cea9a6b1276", "score": "0.60426", "text": "function control(e){\n // squares[currentIndex].classList.remove('snake');\n \n if(e.keyCode === 39){\n direction = 1; //For right arrow key\n }\n else if(e.keyCode === 38){\n direction = -width; //For up key\n }\n else if(e.keyCode === 37){\n direction = -1; //For left arrow key\n }\n else if(e.keyCode === 40){\n direction = width; //For the down key \n }\n}", "title": "" }, { "docid": "0d332f6b1ef91cc59af0b9acbbdef1b4", "score": "0.6032541", "text": "moveUp () { this.vel.y = approach(-1 * this.max_velocity, this.vel.y, this.move_delta * gamecore.time.delta) }", "title": "" }, { "docid": "c403739b882338badac52c1fc40416b3", "score": "0.6026259", "text": "moveDown() {\n if (!this.HitWall(0, 1, this.activeTetromino)) {\n this.unDraw();\n this.y++;\n this.draw();\n } else {\n // locks the piece and generate a new one\n this.Block();\n p = randomPiece();\n }\n calculateFPSNormal();\n updateLabel(FPSNormal);\n }", "title": "" }, { "docid": "d89bbfe3dc912233abf56207b7682e4d", "score": "0.6016868", "text": "function liftUp(){\n timeCalled += 1;\n setTimeout(function() {\n penDown = false;\n }, 250 * timeCalled);\n}", "title": "" }, { "docid": "66c73b4abc8c5ebc81009957f2f8a74d", "score": "0.60153836", "text": "function startGame(){\n moving = setInterval(function(){\n Snake._move(direction);\n if(Snake._eat()){\n Snake._grow();\n Snake._spawnApple();\n Snake._updateScore();\n }\n if(Snake._dead()){\n Snake._checkHighScore();\n Snake._reset();\n Snake._updateScore();\n direction=39;\n clearInterval(moving);\n\n }\n \n},1000/15)\n}", "title": "" }, { "docid": "0c1a9ecf22e5bfea57a453db814b8d1c", "score": "0.5999005", "text": "turnUp() {\n if (this.direction === Constants.SKIER_DIRECTIONS.LEFT ||\n this.direction === Constants.SKIER_DIRECTIONS.RIGHT) {\n this.moveSkierUp();\n }\n }", "title": "" }, { "docid": "b23665726d6d66bb0a274036b868838b", "score": "0.5998694", "text": "turnUp() {\n let bottom = this.getBottom();\n\n this.top = this.front;\n this.front = bottom;\n }", "title": "" }, { "docid": "2b143bca6dd9d6d27c3dc04e46e52840", "score": "0.5984554", "text": "function moveDown(e){ //alert(\"moveDown()\");\n \n drone.up = false; //reset flag\n dContainer.speedY = dContainer.speedY*2; //falls faster to simulate gravity\n}", "title": "" }, { "docid": "1e303953479e93d50294eed5c88561ec", "score": "0.5983493", "text": "moveUp() {\n const position = this.getPosition();\n\n // If it's at the top, don't move the ship\n if (position <= 0) return;\n\n this.ship.style.top = `${position - this.step}px`;\n }", "title": "" }, { "docid": "a63515b131a391cfc7219349a8e18ce5", "score": "0.59833467", "text": "function decrease_movement_backward1(){\n if(player.state === 1)\n {\n if(movement > 0 )\n {\n count1 = 25;\n movement = movement -1;\n createjs.Ticker.addEventListener(\"tick\", movetank1backward1);\n createjs.Ticker.setFPS(30); \n } \n document.getElementById(\"move\").innerHTML = movement;\n }\n }", "title": "" }, { "docid": "7c5d11bf426bedb25b1e6c9cc08eaabd", "score": "0.59798354", "text": "function moveDown(){\n // Detect the current position of the flask.\n initial_top = Math.round($('#cuvette').position().top);\n initial_left = Math.round($('#cuvette').position().left);\n // Initialise all the values for the motion of the images.\n final_top = 292;\n step_top = 1;\n step_left = 0;\n type_of_movement = 0;\n // Move it into the spectrophotometer.\n moveImage();\n // Call extraCuvette() method which moves the reference cuvette into the spectrophotometer.\n setTimeout(\"extraCuvette()\",1500);\n}", "title": "" }, { "docid": "aff05c0ff57849cf343230902db76da5", "score": "0.59733963", "text": "moveSkierDown() {\n this.y += this.speed;\n }", "title": "" }, { "docid": "8b5ddbc1c7d7a8a1411aa28f334791a9", "score": "0.5968192", "text": "function moveDown() {\n drawCurrentPieceInsideGlass(false); // Hide a piece\n position[1]++;\n if (checkPosition(position, rotation)) {\n pieceScore++;\n drawCurrentPieceInsideGlass(true); // Draw the piece in a new position\n setTimeout();\n return;\n }\n \n position[1]--; // The piece has dived into the floor so we move it back.\n drawCurrentPieceInsideGlass(true); // Draw the piece in a previous position\n removeFullLines();\n score = score + 26 + currentLevel * 3 - pieceScore - (nextHasBeenShown ? 5 : 0);\n addNewPiece(); // Pieces are moved down by browser events, so there won't be an infinitive loop here.\n }", "title": "" }, { "docid": "d026be955060594fd52f3b7b274a83ad", "score": "0.5967543", "text": "function up() \r\n{\r\nif (roverY>=0) \r\n{\r\nroverY=roverY-10;//sets rovert to prevent goining out of the canvas\r\nconsole.log(\"When left arrow is pressed, x = \" + roverX + \" | y = \" +roverY); //sets the cordinates in the js and display in the console\r\nuploadBackground();\r\nuploadSprite();\r\n}\r\n}", "title": "" }, { "docid": "f1cf4ddf008a4a7072b8c3aed4df0feb", "score": "0.5966209", "text": "move(down)\n {\n var value = this._slider_value;\n value += down?-1:+1;\n value = helpers.clamp(value, 0, 5);\n this._slider_value = value;\n this.value = this._slider_value;\n }", "title": "" }, { "docid": "cc97237934630cf9c61fcd60552a98ed", "score": "0.5955654", "text": "function control(e) {\n moveSound.play();\n squares[currentIndex].classList.remove('snake');\n\n if(e.keyCode === 39){\n direction = 1; // if we press right arrow, then snake move one div in right\n }\n else if(e.keyCode === 38){\n direction = -width; // if we press up arrow, then snake go back to 18 divs \n }\n else if(e.keyCode === 37){\n direction = -1; // if we press left arrow, then snake move one div in left\n }\n else if(e.keyCode === 40){\n direction = width; // if we press down arrow, then snake go to 18 divs ahead. \n }\n }", "title": "" }, { "docid": "c0a8eff093d493ff7e1a20e4f90befb8", "score": "0.5946671", "text": "function control(e) {\n squares[currentIndex].classList.remove('snake')\n\n if (e.keyCode === 39) {\n direction = 1 //right arrow and keyboard, snake to right\n } else if (e.keyCode === 38) {\n direction = -width //up arrow, snake goes 1square up (meaning 10indexes in array)\n\n } else if (e.keyCode === 37) {\n direction = -1 //leftarrow on keyboard, snake to left\n\n } else if (e.keyCode === 40) {\n direction = +width //down arrow\n }\n\n }", "title": "" }, { "docid": "ba09e8c50bdb923c310aa81b9b30d188", "score": "0.59435993", "text": "down(time) {\n this._squash(time);\n this._downTime = time;\n this._playSample(time, 'down');\n }", "title": "" }, { "docid": "2fb426db20389d31e30be937f8f7fc50", "score": "0.594198", "text": "function moveUp() {\n\n for (var i = trees.length-1; i >= 0 ; i--) {\n var top = parseInt(trees[i].style.top) - vstep;\n trees[i].style.top = top + 'px';\n if (ncollid >= grace && checkOverlap(trees[i], skier, margin)) {\n collid = true;\n ncollid = 0;\n nscore -= 100;\n }\n if (top < -50) {\n body.removeChild(trees[i]); \n trees.splice(i,1);\n }\n }\n \n for (var i = flags.length-1; i >= 0 ; i--) {\n var top = parseInt(flags[i].style.top) - vstep;\n flags[i].style.top = top + 'px';\n if (checkOverlap(flags[i], skier, 0)) {\n nscore += 2;\n }\n if (top < -50) {\n body.removeChild(flags[i]); \n flags.splice(i,1);\n }\n }\n \n if (nskier > 2) moveRight(lsteps[nskier]);\n else if (nskier < 2) moveLeft(lsteps[nskier]);\n\n ndist += vstep;\n if (ncollid < grace) ncollid++;\n}", "title": "" }, { "docid": "32ae6e63bb1da088fe4148d8a1c6e706", "score": "0.5933006", "text": "stop_movement_loop() {\n this.move.stop()\n }", "title": "" }, { "docid": "21f1f2c352fefdad88cfd772f6efd30f", "score": "0.5928899", "text": "function moveSnake(event) {\n switch (event.key) {\n case \" \":\n stoppedGame = false;\n break;\n case \"ArrowUp\":\n if (lastAxis !== \"Y\" && stoppedGame === false) {\n dx = 0;\n dy = -size;\n plusMove();\n }\n break;\n case \"ArrowDown\":\n if (lastAxis !== \"Y\" && stoppedGame === false) {\n dx = 0;\n dy = +size;\n plusMove();\n }\n break;\n case \"ArrowRight\":\n if (lastAxis !== \"X\" && stoppedGame === false) {\n dx = +size;\n dy = 0;\n plusMove();\n }\n break;\n case \"ArrowLeft\":\n if (lastAxis !== \"X\" && stoppedGame === false) {\n dx = -size;\n dy = 0;\n plusMove();\n }\n break;\n default:\n }\n}", "title": "" }, { "docid": "d9702140fc97b419a0279ed58d26375d", "score": "0.5926893", "text": "goDown () {\n if (this.direction === 'up') return false;\n this.direction = 'down';\n }", "title": "" }, { "docid": "7c1ccebbbcf3fc126e97eb3c7feca665", "score": "0.5923309", "text": "down(time) {\n this._squash(time);\n this._downTime = time;\n this._playSample(time, 'down');\n }", "title": "" }, { "docid": "6b5cb3f317a5b06c741d00e17b43286f", "score": "0.5911915", "text": "move() {\n if (this.y >= Abschlussaufgabe.canvas.height - 75) {\n this.moveUp = true;\n }\n else if (this.y <= 0) {\n this.moveUp = false;\n }\n if (this.moveUp == false) {\n this.y += this.speed;\n }\n else {\n this.y -= this.speed;\n }\n }", "title": "" }, { "docid": "60266fe2eb325f9a91081640eae16ad2", "score": "0.58994925", "text": "function snake_Movement_Right()\r\n\t{\r\n\t\tmyVar=setInterval(function()//setInterval for right Direction\r\n\t\t{\r\n\t\t\t\t\r\n\t\t\trandomJ++;\r\n\t\t\tvar z1=randomI+'_'+randomJ;\r\n\t\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t\t{\r\n\t\t\t\tif(arr_Dir[i]==z1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(z1==f)\r\n\t\t\t{\r\n\t\t\t\tarr_Dir.push(f);\r\n\t\t\t\t$('#'+f).css(\"background\",\"black\");\r\n\t\t\t\tcount+=10;\r\n\r\n\t\t\t\t$('#Score_val').text(count);\r\n\t\t\t\t\r\n\t\t\t\tif(count==win_var)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').css(\"color\",\"green\");\r\n\t\t\t\t\t$('#Error').text(\"Congratz you won!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tgenrate_Food();\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\tarr_Dir.push(z1);\r\n\t\t\t\t$('#'+arr_Dir.shift()).css(\"background\",\"#fff\");\r\n\t\t\t\t$('#'+z1).css(\"background\",\"black\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(randomJ==15)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t}\r\n\t\r\n\t\t},500);\r\n\t\t\t/************this feild will get call before interval starts****************/\r\n\t\t\trandomJ++;\r\n\t\t\tvar z1=randomI+'_'+randomJ;\r\n\t\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t\t{\r\n\t\t\t\tif(arr_Dir[i]==z1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(z1==f)\r\n\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\tarr_Dir.push(f);\r\n\t\t\t\t$('#'+f).css(\"background\",\"black\");\r\n\t\t\t\tcount+=10;\r\n\t\t\t\t$('#Score_val').text(count);\r\n\t\t\t\t\r\n\t\t\t\tif(count==win_var)\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t\t$('#Error').css(\"color\",\"green\");\r\n\t\t\t\t\t$('#Error').text(\"Congratz you won!\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tclear_Feilds();\r\n\t\t\t\t\tclearInterval(myVar);\r\n\t\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\tgenrate_Food();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tarr_Dir.push(z1);\r\n\t\t\t\t$('#'+arr_Dir.shift()).css(\"background\",\"#fff\");\r\n\t\t\t\t$('#'+z1).css(\"background\",\"black\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(randomJ==15)\r\n\t\t\t{\r\n\t\t\t\t$('.overlaywindow').css(\"display\",\"block\");\r\n\t\t\t\t$('.popupbox').css(\"display\",\"block\");\r\n\t\t\t\t$('#Error').text(\"Ooops Game Over!\");\r\n\t\t\t\t\t\t\r\n\t\t\t\tclear_Feilds();\r\n\t\t\t\tclearInterval(myVar);\r\n\t\t\t\tclearInterval(myVar_Up);\r\n\t\t\t\tclearInterval(myVar_Left);\r\n\t\t\t\tclearInterval(myVar_Down);\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t}", "title": "" }, { "docid": "78c8370cd319c1deb54ee41ef47f7001", "score": "0.58964974", "text": "function moveSnakeBack()\n{\n context.clearRect(0, 0, 500, 500);\n for (let i = tail.length-1; i >= 1; i--) {\n tail[i] = tail[i - 1];\n }\n if(tail.length >= 1) {\n tail[0] = { tailX: tail0.tailX, tailY: tail0.tailY };\n }\n snakeHeadX -= xSpeed;\n snakeHeadY -= ySpeed;\n drawVirus();\n drawFruit();\n drawSnakeTail();\n}", "title": "" }, { "docid": "3a9b93b75ad8c144b29d95952c891f40", "score": "0.58902556", "text": "function MoveDown() {\n //If the player is greater than the first tile in the last row and less than the total number of tiles\n if (\n playerSpace > tiles - tilesPerRow ||\n playerSpace + tilesPerRow === randomUnwalkable\n ) {\n return;\n } else {\n playerSpace += tilesPerRow;\n MakeActive(playerSpace);\n }\n}", "title": "" }, { "docid": "753e61103662638278dc645793e33966", "score": "0.5886374", "text": "function updateSnake(){\n\tplayerX = snakeTrail[0].x + velocityX*gridSize;\n\tplayerY = snakeTrail[0].y - velocityY*gridSize;\n\tsnakeTrail.pop();\n\tsnakeTrail.unshift(new Snake(playerX, playerY));\n}", "title": "" }, { "docid": "9ccbfcf9388b1d765092481b0391762d", "score": "0.5885665", "text": "function moveDown() {\n\t\tif(gameOver || gamePaused) return;\n\t\tvar newpos = Pair(blankPosition.first + 1, blankPosition.second);\n\t\tif(isValid(newpos, size)) {\n\t\t\tmakeMove(blankPosition, newpos);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Cannot move\");\n\t\t}\n\t}", "title": "" }, { "docid": "b1335084966ae0fbcc3d8affa423352c", "score": "0.5873371", "text": "function keyup(e) {\n if (e.keyCode == 37) {\n keys.left = false;\n }\n if (e.keyCode == 38) {\n if (player.y_v < -2) {\n player.y_v = -3;\n }\n }\n if (e.keyCode == 39) {\n keys.right = false;\n }\n}", "title": "" }, { "docid": "98d349400edb6113c0ec04534b69a474", "score": "0.5872883", "text": "turnDown() {\n this.setDirection(Constants.SKIER_DIRECTIONS.DOWN);\n }", "title": "" }, { "docid": "4f224ffa41a3e5e01a99258d905a2703", "score": "0.58685666", "text": "function move_up(){\n character.y-=40;\n }", "title": "" }, { "docid": "80c57ded6b1542c4a02fb4acd4f68438", "score": "0.58658993", "text": "function moveUp(e){ //alert(\"moveUp()\");\n \n drone.up = true; //flag\n drone.landed = dContainer.landed = false; //object is no longer landed\n dContainer.speedY = UP_SPEED; //reverts vertical speed to default\n \n if(parcel.carried) {\n parcel.landed = false; //any carried object is also no longer landed\n }\n}", "title": "" }, { "docid": "9cbdcb065e1487c3d7acfe7c0176a841", "score": "0.58624154", "text": "keyPressUpHandler(event, tile) {\n\t\t//stop sound\n\t\tthis.audios.forEach(sound => {\n\t\t\tif (sound.tile === tile) {\n\t\t\t\tsound.audio.pause()\n\t\t\t\tsound.audio.currentTime = 0\n\t\t\t}\n\t\t})\n\t\t// for each timeline\n\t\tthis.activeKeyTimelines.forEach((tl, index) => {\n\t\t\t// if there's a timeline for the tile\n\t\t\tif (tl.tile === tile) {\n\t\t\t\t// reverse it\n\t\t\t\ttl.timeline.reverse()\n\t\t\t\t// and remove the timeline\n\t\t\t\tthis.activeKeyTimelines.splice(index, 1)\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "767f0e8c372c3d5def7c30d9c1dcd348", "score": "0.5852669", "text": "function up(){\n\n\t\tmouseDown=0;\n\t\t\n\t\t\n\t\t//This mini function is created so that when the mouse is release the Img gets some momentum to keep is spinning\n\t\t//To Do: make it so there is a max (if statement, if its greater set its max)\n\t\t\n\t\n\t\t//There are 3 of these now, originially created to make is so it was a bit less \"jumpy\", \n\t\t//AKA so you had to actually spin it rather then accidently let go. Can't figure out how to implement it properly though\n\t\tdAngle1ImgSpin=Math.atan(dYImgSpin/dXImgSpin);\n\t\tdAngle2ImgSpin=Math.atan(dY1ImgSpin/dX1ImgSpin);\n\t\tdAngle3ImgSpin=Math.atan(dY2ImgSpin/dX2ImgSpin);\n\t\t\n\t\t//gives us the amount that the Img will turn every call\n\t\tdAngleImgSpin=(dAngle1ImgSpin-dAngle3ImgSpin)*.5;\n\t\t\n\t\t//Friction of unhampered spinner, Right now spins extremely freely.\n\t\tangleMomentumImgSpin=.0005;\n\t\n\t\t\n\t\n\t\t\n}", "title": "" }, { "docid": "5698a09de1a2a1aa81cc0d8cbf370d81", "score": "0.5846616", "text": "update(delta){\n if(this.key_A.isDown)\n this.image.x--;\n }", "title": "" }, { "docid": "5753f19f4e233a86ef2b835423839812", "score": "0.583773", "text": "moveForward() {\n //console.log(\"move forward\");\n clear();\n this.y1 -= movement;\n }", "title": "" }, { "docid": "e26a7bcbf943e88c2e464235345b53a1", "score": "0.58284354", "text": "function clear_tail() {\t\n\trub_cell(snake.pop());\n}", "title": "" }, { "docid": "7262debd339719d2b71085e32595135a", "score": "0.5820624", "text": "function timesUp(){}", "title": "" }, { "docid": "dec7239194506e159645eb5e18e1622c", "score": "0.58171296", "text": "function movedown() {\n while (can_move_to(0, -1) && _running) {\n _shape.move(0, -1);\n animate();\n }\n}", "title": "" }, { "docid": "ff04d2518b8dffed55a05703298e3491", "score": "0.58112055", "text": "function control(e) {\n squares[currentIndex].classList.remove('snake');\n if (e.keyCode === 39) {\n direction = 1; // Ir hacia la derecha.\n } else if (e.keyCode === 38) {\n direction = -width; // Ir hacia arriba.\n } else if (e.keyCode === 37) {\n direction = -1; // Ir hacia izquierda.\n } else if (e.keyCode === 40) {\n direction = +width; //Ir hacia abajo.\n }\n }", "title": "" } ]
44ba725253986a6d6394ad37efc68a5b
compile the template with autoRender run the template function on the context argument return an HTML string
[ { "docid": "9d302a299126f496a1c8ff087cbe16a0", "score": "0.5786745", "text": "function autoRender(ctxt, directive){\n\t\tvar fn = plugins.compile( directive, ctxt, this[0] ), i, ii;\n\t\tfor(i = 0, ii = this.length; i < ii; i++){\n\t\t\tthis[i] = replaceWith( this[i], fn( ctxt, false));\n\t\t}\n\t\treturn this;\n\t}", "title": "" } ]
[ { "docid": "ba724a8d075ee0080c222073e0fd77d1", "score": "0.72296613", "text": "_renderTemplate(path, context) {\n return swig.compileFile(path)(context)\n }", "title": "" }, { "docid": "b5c1ae356522f027b4482cc54d40a3d3", "score": "0.67832404", "text": "render(ctx) {}", "title": "" }, { "docid": "111d5928c74daa5813d05f13183011b4", "score": "0.6604891", "text": "function render(templateID, context)\n{\n\tvar tpl = $('#' + templateID).text();\n\treturn $.trim(Mark.up(tpl, context));\t// trim is necessary so jQuery parses it as HTML (first char must be \"<\")\n}", "title": "" }, { "docid": "a6f80af0abe7a322b292d851743927df", "score": "0.65654737", "text": "render(templateName, context = {}, cb) {\n if (!cb) {\n return this._renderPromise(templateName, context)\n } else {\n this._renderPromise(templateName, context)\n .then(({ html, text, subject }) => cb(null, html, text, subject))\n .catch((err) => {\n cb(err)\n })\n }\n }", "title": "" }, { "docid": "8bc71ca205da14ffd0af2d5621fd7aa1", "score": "0.6519028", "text": "function compileHTML(template, options) {\n\t\toptions = options || {};\n\t\tvar val_mod = options.loose ? \"||''\" : '';\n\t\tvar VarMap = {\n\t\t\ttrue: 1, false: 1, null: 1, undefined: 1, this: 1, new: 1,\n\t\t\tdoTA: 1, $index: 1, S: 1, F: 1, $attr: 1, X: 1, K: 1, M: 1, N: 1,\n\t\t\tMath: 1, Date: 1, String: 1, Object: 1, Array: 1,\n\t\t\tlocation: 1, window: 1, _: 1\n\t\t\t// Infinity: 1, NaN: 1,\n\t\t\t// alert: 1, confirm: 1, prompt: 1,\n\t\t\t//var: 1, in: 1\n\t\t\t//void: 1,\n\t\t};\n\t\tvar level = 0, ngRepeatLevel;\n\t\tvar ngIfLevel, skipLevel, ngIfCounterTmp, ngIfLevels = [], ngIfLevelMap = {};\n\t\tvar LevelMap = {}, LevelVarMap = {};\n\t\tvar KeyMap = [], keyLevel = 0;\n\t\tvar WatchMap = {}, Watched;\n\t\tvar doTAPass, doTAContinue;\n\t\tvar compiledFn;\n\t\tvar uniqueId = doTA.getId(options.render);\n\t\tvar idHash = {};\n\t\tvar FnText = '';\n\t\t//options that need to repeatedly calling\n\t\tvar optWatchDiff = options.watchDiff;\n\t\tvar optDiffLevel = +options.diffLevel;\n\t\tvar optModel = options.model;\n\t\tvar optBind = options.bind;\n\t\tvar optEvent = options.event;\n\t\tvar optKey = options.key;\n\t\tvar optParams = options.params;\n\t\tvar optComment = +options.comment;\n\t\tvar optStrip = +options.strip;\n\n\t\tif (optKey) {\n\t\t\tFnText += indent(level) + \"var R='';\\n\";\n\t\t} else {\n\t\t\tFnText += indent(level) + \"var \" +\n\t\t\t(optWatchDiff ? 'M,N=1,' : '') +\n\t\t\t\"R='';\\n\"; //ToDO: check performance on var declaration\n\t\t}\n\n\t\t//clean up extra white spaces and line break\n\t\ttemplate = template.replace(whiteSpaceRegex, ' ');\n\n\t\tif (optStrip) {\n\t\t\tif (optStrip === 2) {\n\t\t\t\ttemplate = template.replace(/>\\s+/g, '>').replace(/\\s+</g, '<');\n\t\t\t} else {\n\t\t\t\ttemplate = template.replace(/>\\s+</g, '><');\n\t\t\t}\n\t\t}\n\n\t\t// when encode is set, find strings and encode < and >, or parser will throw error.\n\t\tif (options.encode) {\n\t\t\ttemplate = template.replace(quotedStringRegex, function($0) {\n\t\t\t\treturn $0.replace(/[<>]/g, function($00) {\n\t\t\t\t\treturn {'>': '&gt;', '<': '&lt;'}[$00];\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// attach plain variables to scope variables\n\t\tfunction attachScope(v) {\n\t\t\t//console.log(VarMap, [v]);\n\t\t\tif (v) {\n\t\t\t\t//var DEBUG = /error/.test(v);\n\t\t\t\t//DEBUG && console.log(11, [v]);\n\n\t\t\t\t//ToDo: still buggy, this need to improve\n\t\t\t\tvar vv = '';\n\t\t\t\tvar matches = v.match(varOrStringRegex);\n\t\t\t\tvar match, match0;\n\t\t\t\t//DEBUG && console.log(12, matches);\n\t\t\t\tfor(var i = 0; i < matches.length; i++) {\n\t\t\t\t\tmatch = matches[i];\n\t\t\t\t\tmatch0 = match[0];\n\t\t\t\t\tif (\n\t\t\t\t\t\t(match0 === '$' || match0 === '_' || (match0 >= 'a' && match0 <= 'z') || (match0 >= 'A' && match0 <= 'Z')) &&\n\t\t\t\t\t\t!VarMap[match] &&\n\t\t\t\t\t\t(!i || matches[i-1][matches[i-1].length-1] !== '.')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\tvv += 'S.' + match;\n\t\t\t\t\t} else if (match.indexOf('$index') >= 0) {\n\t\t\t\t\t\t//only support last level for now\n\t\t\t\t\t\tvv += match.replace($indexRegex, LevelVarMap[ngRepeatLevel]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvv += match;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//DEBUG && console.log(55, vv);\n\t\t\t\treturn vv;\n\t\t\t}\n\t\t\treturn v;\n\t\t}\n\n\t\t// escape single quotes with backslash\n\t\tfunction escapeSingleQuote(str) {\n\t\t\tvar quotePos = str.indexOf(\"'\");\n\t\t\tif (quotePos >= 0) {\n\t\t\t\tvar ret = '';\n\t\t\t\tvar prevQuotePos = 0;\n\t\t\t\tdo {\n\t\t\t\t\tret += str.substring(prevQuotePos, quotePos);\n\t\t\t\t\t//escaped quote\n\t\t\t\t\tif (str[quotePos - 1] !== '\\\\') {\n\t\t\t\t\t\tret += '\\\\';\n\t\t\t\t\t}\n\t\t\t\t\tprevQuotePos = quotePos;\n\t\t\t\t\tquotePos = str.indexOf(\"'\", prevQuotePos + 1);\n\t\t\t\t} while (quotePos > 0);\n\t\t\t\tret += str.substr(prevQuotePos);\n\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t}\n\n\t\t// interpolation\n\t\tfunction interpolate(str) {\n\t\t\tvar pos = str.indexOf('{{');\n\t\t\tif (pos >= 0) {\n\t\t\t\tvar prevPos = 0;\n\t\t\t\tvar ret = '';\n\t\t\t\tvar outsideStr, insideStr;\n\t\t\t\tdo {\n\t\t\t\t\toutsideStr = str.substring(prevPos, pos);\n\t\t\t\t\tret += escapeSingleQuote(outsideStr);\n\n\t\t\t\t\t//skip {{\n\t\t\t\t\tprevPos = pos + 2;\n\t\t\t\t\tpos = str.indexOf('}}', prevPos);\n\n\t\t\t\t\tinsideStr = str.substring(prevPos, pos);\n\t\t\t\t\tret += \"'+(\" + attachFilter(insideStr) + val_mod + \")+'\";\n\n\t\t\t\t\t//skip }} for next\n\t\t\t\t\tprevPos = pos + 2;\n\t\t\t\t\tpos = str.indexOf('{{', prevPos);\n\t\t\t\t} while (pos > 0);\n\n\t\t\t\t//remaining text outside interpolation\n\t\t\t\tret += escapeSingleQuote(str.substr(prevPos));\n\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\treturn escapeSingleQuote(str);\n\t\t\t}\n\t\t}\n\n\t\t// attach $filters\n\t\tfunction attachFilter($1) {\n\t\t\t//console.log(333,$1);\n\t\t\tvar pos = $1.indexOf('|');\n\t\t\tif (pos === -1) {\n\t\t\t\treturn attachScope($1);\n\t\t\t} else {\n\t\t\t\t//ToDo: check this line later\n\t\t\t\tvar v = splitFilters($1, pos);\n\t\t\t\tvar val = attachScope(v[0]);\n\t\t\t\tvar prevColonPos, colonPos;\n\t\t\t\tvar filter;\n\n\t\t\t\t//parse each filters\n\t\t\t\tfor(var i = 1; i < v.length; i++) {\n\t\t\t\t\tfilter = v[i];\n\t\t\t\t\tprevColonPos = 0;\n\n\t\t\t\t\tcolonPos = filter.indexOf(':');\n\t\t\t\t\t//filter with params\n\t\t\t\t\tif (colonPos > 0) {\n\t\t\t\t\t\tval = \"F('\" + filter.slice(prevColonPos, colonPos).trim() + \"')(\" + val;\n\t\t\t\t\t\tprevColonPos = ++colonPos;\n\t\t\t\t\t\tcolonPos = filter.indexOf(':', prevColonPos);\n\t\t\t\t\t\twhile (colonPos > 0) {\n\t\t\t\t\t\t\tval += ',' + attachScope(filter.slice(prevColonPos, colonPos));\n\t\t\t\t\t\t\tprevColonPos = ++colonPos;\n\t\t\t\t\t\t\tcolonPos = filter.indexOf(':', prevColonPos);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tval += ',' + attachScope(filter.substr(prevColonPos)) + ')';\n\n\t\t\t\t\t//filter without params\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = \"F('\" + filter.trim() + \"')(\" + val + ')';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\n\t\tfunction apply$index(val) {\n\t\t\tvar count, tmpRepeatLevel;\n\n\t\t\tif (val.indexOf('$parent.$index') >= 0) {\n\t\t\t\ttmpRepeatLevel = ngRepeatLevel;\n\t\t\t\tval = val.replace($parent$indexRegex, function($0) {\n\t\t\t\t\tcount = $0.match(/\\$parent/g).length; //may need to rewrite with indexOf\n\t\t\t\t\twhile (count>0) {\n\t\t\t\t\t\twhile (tmpRepeatLevel >= 0 && LevelVarMap[--tmpRepeatLevel] === void 0) {}\n\t\t\t\t\t\t--count;\n\t\t\t\t\t}\n\t\t\t\t\treturn \"'+\" + LevelVarMap[tmpRepeatLevel] + \"+'\";\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (val.indexOf('$index') >= 0) {\n\t\t\t\treturn val.replace($indexRegex, \"'+\" + LevelVarMap[ngRepeatLevel] + \"+'\");\n\t\t\t}\n\t\t\treturn val;\n\t\t}\n\n\t\t//parse the element\n\t\tparseHTML(template, {\n\t\t\t//open tag with attributes\n\t\t\topenTag: function(tagName, attr, selfClosing) {\n\t\t\t\t// debug && console.log('openTag', [tagName, attr]);\n\t\t\t\tvar parsedAttr = {}, customId, noValAttr = '', attrClass = '';\n\t\t\t\tvar doTAPassThis, x;\n\n\t\t\t\t//skip parsing if dota-pass is specified (interpolation will still be expanded)\n\t\t\t\t// https://jsperf.com/hasownproperty-vs-in-vs-undefined/12\n\t\t\t\tif (attr['dota-pass'] !== void 0) {\n\t\t\t\t\tif (attr['dota-pass'] === 'this') {\n\t\t\t\t\t\tdoTAPass = doTAPassThis = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdoTAPass = level; doTAContinue = 0;\n\t\t\t\t\t}\n\t\t\t\t//re-enable dota parsing\n\t\t\t\t} else if (attr['dota-continue'] !== void 0) {\n\t\t\t\t\tdoTAContinue = level;\n\t\t\t\t\tattr['dota-continue'] = void 0;\n\t\t\t\t}\n\n\t\t\t\t//unless dota-pass or with dota-continue\n\t\t\t\tif (doTAPass === void 0 || doTAContinue) {\n\n\t\t\t\t\tif (optDiffLevel && attr.skip) {\n\t\t\t\t\t\tskipLevel = level;\n\t\t\t\t\t\tvar attrSkip = attr.skip;\n\t\t\t\t\t\tattr.skip = void 0;\n\t\t\t\t\t\tFnText += indent(level, 1) + 'var O'+ level + '=N+' + attrSkip + '; \\n';\n\t\t\t\t\t}\n\n\t\t\t\t\t//ng-repeat to while/for loop\n\t\t\t\t\tif (attr['ng-repeat']) {\n\t\t\t\t\t\t//console.log(21,[x], [val]);\n\t\t\t\t\t\tLevelMap[level] = LevelMap[level] ? LevelMap[level] + 1 : 1;\n\t\t\t\t\t\tvar NG_REPEAT = attr['ng-repeat'];\n\t\t\t\t\t\tvar inPos = NG_REPEAT.indexOf(' in ');\n\t\t\t\t\t\tvar repeatVar = NG_REPEAT.substr(0, inPos), repeatSrc = NG_REPEAT.substr(inPos + 4);\n\t\t\t\t\t\tvar commaPos = repeatVar.indexOf(',');\n\t\t\t\t\t\tvar pipePos = repeatSrc.indexOf('|'), repeatSrcNew;\n\t\t\t\t\t\tvar colonPos;\n\n\t\t\t\t\t\t//store variable name to use for $index later\n\t\t\t\t\t\t//this is ng-repeat specific, LevelMap[level] is same for ng-if too\n\n\t\t\t\t\t\tngRepeatLevel = level;\n\n\t\t\t\t\t\tif (pipePos > 0) {\n\t\t\t\t\t\t\trepeatSrcNew = attachFilter(repeatSrc);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trepeatSrcNew = attachScope(repeatSrc);\n\t\t\t\t\t\t\tcolonPos = repeatSrcNew.indexOf(':');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Range: \"i in 1:10\" ==> (for i = 1; i < 10; i++)\n\t\t\t\t\t\tif (colonPos >= 0) {\n\t\t\t\t\t\t\tvar start = repeatSrcNew.substr(0, colonPos) || 0, end, step;\n\t\t\t\t\t\t\tvar anotherColon = repeatSrcNew.indexOf(':', ++colonPos);\n\t\t\t\t\t\t\tif (anotherColon > 0) {\n\t\t\t\t\t\t\t\tend = repeatSrcNew.substring(colonPos, anotherColon);\n\t\t\t\t\t\t\t\tstep = repeatSrcNew.substr(anotherColon + 1);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tend = repeatSrcNew.substr(colonPos);\n\t\t\t\t\t\t\t\tstep = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// console.log([start, end, step, repeatSrcNew, colonPos]);\n\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'for(var ' +\n\t\t\t\t\t\t\t\trepeatVar + '=' + start + ';' +\n\t\t\t\t\t\t\t\trepeatVar + (step > 0 ? '<' : '>') + end + ';' + repeatVar + '+=' + step + '){\\n';\n\t\t\t\t\t\t\tLevelVarMap[level] = repeatVar;\n\t\t\t\t\t\t\tVarMap[repeatVar] = 1;\n\n\t\t\t\t\t\t// Object: \"k, v in {}\" ==> (for in {})\n\t\t\t\t\t\t} else if (commaPos > 0) {\n\t\t\t\t\t\t\tvar key = repeatVar.substr(0, commaPos);\n\t\t\t\t\t\t\tvar value = repeatVar.substr(commaPos + 1);\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'var ' +\n\t\t\t\t\t\t\t\tvalue + ',D' + level + '=' + repeatSrcNew + ';\\n';\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'for(var ' + key + ' in D' + level + '){\\n';\n\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t space is needed for manual uglify\t->\tvvv\n\t\t\t\t\t\t\tFnText += indent(level) + value + ' = ' + 'D' + level + '[' + key + ']; \\n';\n\t\t\t\t\t\t\tLevelVarMap[level] = key;\n\t\t\t\t\t\t\tVarMap[key] = VarMap[value] = 1;\n\n\t\t\t\t\t\t// Array: \"k in []\" ==> while loop\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar idx = 'i' + level, l = 'l'+ level;\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'var ' +\n\t\t\t\t\t\t\t\trepeatVar + ',D' + level + '=' + repeatSrcNew + ',' +\n\t\t\t\t\t\t\t\tidx + '=-1,' + l + '=D' + level + '.length;\\n';\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'while(++' + idx + '<' + l + '){\\n';\n\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\tspace is needed for manual uglify\t->\tvvv\n\t\t\t\t\t\t\tFnText += indent(level) + repeatVar + '=D' + level + '[' + idx + ']; \\n';\n\t\t\t\t\t\t\tLevelVarMap[level] = idx;\n\t\t\t\t\t\t\tVarMap[repeatVar] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//remote attribute not to get forwarded to angular\n\t\t\t\t\t\tattr['ng-repeat'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (optDiffLevel === 3 && attr.key) {\n\t\t\t\t\t\tkeyLevel = level;\n\t\t\t\t\t\tKeyMap[level] = attr.key;\n\t\t\t\t\t\tFnText += indent(level, 1) + 'var ' + attr.key + '=N,M=1; \\n';\n\t\t\t\t\t\tattr.key = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//re-render sub template\n\t\t\t\t\tif (attr.refresh) {\n\t\t\t\t\t\tcustomId = 1;\n\t\t\t\t\t\tvar oneTimeBinding = attr.refresh.indexOf('::');\n\t\t\t\t\t\tFnText += indent(level, 2) +\n\t\t\t\t\t\t\t(!Watched ? 'var ' + (optWatchDiff ? '': 'N=1,') + 'T=doTA.W[' + uniqueId + ']=[];' : '') +\n\t\t\t\t\t\t\t'var W={N:N,I:N+\"' + '.' + uniqueId + '\",W:\"' +\n\t\t\t\t\t\t\t(oneTimeBinding >=0 ? attr.refresh.substr(oneTimeBinding + 2) + '\",O:1': attr.refresh + '\"') +\n\t\t\t\t\t\t\t(attr.compile ? ',C:1' : '') +\n\t\t\t\t\t\t\t'};T.push(W);\\n';\n\t\t\t\t\t\tWatchMap[level] = Watched = 1;\n\t\t\t\t\t\tFnText += indent(level, 2) + 'W.F=function(S,F,$attr,X,N){var R=\"\";\\n';\n\t\t\t\t\t\t//attr.refresh = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (attr['ng-init']) {\n\t\t\t\t\t\tif (attr['ng-init'].slice(0, 4) === 'var ') {\n\t\t\t\t\t\t\tvar semiColonPos = attr['ng-init'].indexOf(';', 5);\n\t\t\t\t\t\t\tif (semiColonPos >= 0) {\n\t\t\t\t\t\t\t\tvar vars = attr['ng-init'].slice(4, semiColonPos);\n\t\t\t\t\t\t\t\t//var x,y,z;\n\t\t\t\t\t\t\t\tif (vars.indexOf(',') >= 0) {\n\t\t\t\t\t\t\t\t\tvar xvars = vars.split(',');\n\t\t\t\t\t\t\t\t\tfor (var i = 0, l = xvars.length; i < l; i++) {\n\t\t\t\t\t\t\t\t\t\tVarMap[xvars[i]] = 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//var x;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tVarMap[vars] = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//var x = 1;\n\t\t\t\t\t\t\t\tvar eqPos = attr['ng-init'].indexOf('=');\n\t\t\t\t\t\t\t\tif (eqPos >= 0) {\n\t\t\t\t\t\t\t\t\tvar vars = attr['ng-init'].slice(4, eqPos);\n\t\t\t\t\t\t\t\t\tVarMap[vars] = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tFnText += indent(level) + attr['ng-init'].slice(0, semiColonPos) +\n\t\t\t\t\t\t\t\tattachScope(attr['ng-init'].slice(semiColonPos)) + '; \\n';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFnText += indent(level) + attachScope(attr['ng-init']) + '; \\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattr['ng-init'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//ng-if to javascript if\n\t\t\t\t\tif (attr['ng-if']) {\n\t\t\t\t\t\tif (optDiffLevel) {\n\t\t\t\t\t\t\tngIfLevel = level;\n\t\t\t\t\t\t\tngIfLevels.push(level);\n\t\t\t\t\t\t\tngIfLevelMap[level] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tLevelMap[level] = LevelMap[level] ? LevelMap[level] + 1 : 1;\n\t\t\t\t\t\tFnText += indent(level, 1) + 'if('+ attachScope(attr['ng-if']) +'){\\n';\n\t\t\t\t\t\t// console.log('ng-if starts here', level);\n\t\t\t\t\t\tattr['ng-if'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//only if there nothing between tags\n\t\t\t\t\tif (optStrip) {\n\t\t\t\t\t\tif (attr.elif) {\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'else if('+ attachScope(attr.elif) +'){\\n';\n\t\t\t\t\t\t\tLevelMap[level] = LevelMap[level] ? LevelMap[level] + 1 : 1;\n\t\t\t\t\t\t\tattr.elif = void 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (attr['else'] !== void 0 && !optWatchDiff) {\n\t\t\t\t\t\t\tFnText += indent(level, 1) + 'else{\\n';\n\t\t\t\t\t\t\tLevelMap[level] = LevelMap[level] ? LevelMap[level] + 1 : 1;\n\t\t\t\t\t\t\tattr['else'] = void 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//remove +''+ from class, for unnecessary string concat\n\t\t\t\t\tif (attr.class) {\n\t\t\t\t\t\tattrClass = interpolate(attr.class);\n\t\t\t\t\t\tattr.class = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (attr['ng-class']) {\n\t\t\t\t\t\tvar match;\n\t\t\t\t\t\tvar ngScopedClass = attachScope(attr['ng-class']);\n\t\t\t\t\t\twhile((match = ngClassRegex.exec(ngScopedClass)) !== null) {\n\t\t\t\t\t\t\tattrClass +=\n\t\t\t\t\t\t\t\t(\"'+(\" + match[2] + '?' +\n\t\t\t\t\t\t\t\t\t\"'\" + (attrClass ? ' ' : '') + match[1].replace(/['\"]/g, '') +\n\t\t\t\t\t\t\t\t\t\"':'')+'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattr['ng-class'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (attr['ng-show']) {\n\t\t\t\t\t\tattrClass += \"'+(\" + attachScope(attr['ng-show']) +\n\t\t\t\t\t\t\t\"?'':'\" + (attrClass ? ' ' : '') + \"ng-hide')+'\";\n\t\t\t\t\t\tattr['ng-show'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (attr['ng-style']) {\n\t\t\t\t\t\tparsedAttr.style = (attr.style ? attr.style + ';' : '') + interpolate(attr['ng-style']);\n\t\t\t\t\t\tattr['ng-style'] = void 0;\n\t\t\t\t\t\tattr.style = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (attr['ng-hide']) {\n\t\t\t\t\t\tattrClass += \"'+(\" + attachScope(attr['ng-hide']) +\n\t\t\t\t\t\t\t\"?'\" + (attrClass ? ' ' : '') + \"ng-hide':'')+'\";\n\t\t\t\t\t\tattr['ng-hide'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (optModel && attr['ng-model']) {\n\t\t\t\t\t\tif (attr['ng-model'].indexOf('$index') >= 0) {\n\t\t\t\t\t\t\tparsedAttr['dota-model'] = apply$index(interpolate(attr['ng-model']));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparsedAttr['dota-model'] = interpolate(attr['ng-model']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattrClass += (attrClass ? ' ' : '') + 'dm' + uniqueId;\n\t\t\t\t\t\tattr['ng-model'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (optBind && attr['ng-bind']) {\n\t\t\t\t\t\tif (attr['ng-bind'].indexOf('$index') >= 0) {\n\t\t\t\t\t\t\tparsedAttr['dota-bind'] = apply$index(interpolate(attr['ng-bind']));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparsedAttr['dota-bind'] = interpolate(attr['ng-bind']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tattrClass += (attrClass ? ' ' : '') + 'db' + uniqueId;\n\t\t\t\t\t\tattr['ng-bind'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (attr['ng-value']) {\n\t\t\t\t\t\tparsedAttr.value = \"'+(\" + attachFilter(attr['ng-value']) + \")+'\";\n\t\t\t\t\t\tattr['ng-value'] = void 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//some cleanup\n\t\t\t\t\tif (attrClass) {\n\t\t\t\t\t\tattrClass = attrClass.replace(/\\+''\\+/g, '+');\n\t\t\t\t\t}\n\n\t\t\t\t\t// expand interpolations on attributes, and some more\n\t\t\t\t\tfor (x in attr) {\n\t\t\t\t\t\tvar attrVal = attr[x];\n\t\t\t\t\t\tif (attrVal === void 0) { continue; }\n\n\t\t\t\t\t\t// some ng- attributes\n\t\t\t\t\t\tif (x[0] === 'n' && x[1] === 'g' && x[2] === '-') {\n\t\t\t\t\t\t\t//some ng-attr are just don't need it here.\n\t\t\t\t\t\t\tvar attrName = x.substr(3);\n\t\t\t\t\t\t\t//something like ng-src, ng-href, etc.\n\t\t\t\t\t\t\tif (attrName === 'src' || attrName === 'alt' || attrName === 'title' || attrName === 'href') {\n\t\t\t\t\t\t\t\tx = attrName;\n\n\t\t\t\t\t\t\t//convert ng-events to dota-events, to be bind later with native events\n\t\t\t\t\t\t\t} else if (optEvent && EVENTS[attrName]) {\n\t\t\t\t\t\t\t\t//add class 'de' for one time querying\n\t\t\t\t\t\t\t\tif (attrClass) {\n\t\t\t\t\t\t\t\t\tif (attrClass[0] !== 'd' || attrClass[1] !== 'e') {\n\t\t\t\t\t\t\t\t\t\tattrClass = 'de' + uniqueId + ' ' + attrClass;\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\tattrClass = 'de' + uniqueId;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tx = 'de-' + attrName;\n\n\t\t\t\t\t\t\t} else if (attrName === 'required' || attrName === 'hidden' ||\n\t\t\t\t\t\t\tattrName === 'checked' || attrName === 'selected' ||\n\t\t\t\t\t\t\tattrName === 'disabled' || attrName === 'readonly' || attrName === 'multiple') {\n\t\t\t\t\t\t\t\tnoValAttr += \"'+(\" + attachScope(attrVal) + \"?' \" + attrName + \"=\\\"\\\"':'')+'\";\n\t\t\t\t\t\t\t\t//noValAttr will attach later\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (x[0] === '-') {\n\t\t\t\t\t\t\tx = '-' + camelCase(x.substr(1));\n\t\t\t\t\t\t\tparsedAttr[x] = \"'+(\" + attachScope(attrVal) + \")+'\";\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ng-repeat loop variables are not available!\n\t\t\t\t\t\t// only way to acccess is to use $index like \"data[$index]\"\n\t\t\t\t\t\t// instead of \"item\" as in \"item in data\"\n\t\t\t\t\t\tparsedAttr[x] = apply$index(interpolate(attrVal));\n\t\t\t\t\t}\n\n\t\t\t\t// pass all attributes to angular, except interpolation and $index\n\t\t\t\t} else {\n\t\t\t\t\tif (doTAPassThis) {\n\t\t\t\t\t\tdoTAPass = void 0;\n\t\t\t\t\t}\n\t\t\t\t\t//still expand interpolation even if dota-pass is set\n\t\t\t\t\tfor (x in attr) {\n\t\t\t\t\t\tparsedAttr[x] = apply$index(interpolate(attr[x]));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//write tag back as string\n\t\t\t\tFnText += indent(level) + \"R+='<\" + tagName;\n\n\t\t\t\t//make id attr come before anything\n\t\t\t\tif (customId || optWatchDiff) {\n\t\t\t\t\tvar tagId = idHash[uniqueId + '.' + level] = parsedAttr.id || ( (\n\t\t\t\t\t\tkeyLevel < level && KeyMap[keyLevel] || optKey ?\n\t\t\t\t\t\t\"'+\" + (optKey || KeyMap[keyLevel]) + \"+'.'+M+++'.\" :\n\t\t\t\t\t\t\"'+N+++'.\"\n\t\t\t\t\t) + uniqueId);\n\t\t\t\t\tFnText += ' id=\"' + tagId + '\"';\n\t\t\t\t\tif (parsedAttr.id) {\n\t\t\t\t\t\tparsedAttr.id = void 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//write back attributes\n\t\t\t\tfor(var k in parsedAttr) {\n\t\t\t\t\tif ((x=parsedAttr[k]) && x.indexOf('\"') !== -1) {\n\t\t\t\t\t\tFnText += \" \" + k + '=\"' + x.replace(/\"/g, \"\\\\'\") + '\"';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tFnText += \" \" + k + '=\"' + x + '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (attrClass) {\n\t\t\t\t\tFnText += ' class=\"' + attrClass + '\"';\n\t\t\t\t}\n\n\t\t\t\t//attach boolean attributes at last\n\t\t\t\tFnText += noValAttr + (selfClosing ? ' /' : '') + \">';\\n\";\n\n\t\t\t\tif (optWatchDiff) {\n\t\t\t\t\t// FnText += indent(level) + \"N++; \\n\";\n\t\t\t\t\tif (ngIfLevelMap[ngIfLevel] >= 0) {\n\t\t\t\t\t\tngIfLevelMap[ngIfLevel]++;\n\t\t\t\t\t\t// console.log('isPath ngIfCounter', [tagName, ngIfCounter]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//expand doTA templates with expand=1 option\n\t\t\t\tif (attr['render'] && attr.expand) {\n\t\t\t\t\tvar attrArray = [];\n\t\t\t\t\t//attach data-X attr, and scope-X attr\n\t\t\t\t\tfor(x in attr) {\n\t\t\t\t\t\tif (!x.indexOf('data-')) {\n\t\t\t\t\t\t\tattrArray.push('\"' + x.slice(5) + '\":\"' + attr[x] + '\"');\n\t\t\t\t\t\t} else if (!x.indexOf('scope-')) {\n\t\t\t\t\t\t\tattrArray.push('\"' + x.slice(6) + '\":S[\"' + attr[x] + '\"]');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tFnText += indent(level) + 'var P={' + attrArray.join(',') + '},U=\"' + attr['render'] + '\";\\n';\n\t\t\t\t\t//only expand if renderFn is ready in cache, but not in cache-dom (which unneeded)\n\t\t\t\t\tFnText += indent(level) + 'if(doTA.C[U]&&!doTA.D[U]){' +\n\t\t\t\t\t\t'R+=doTA.C[U](S,F,P)}; \\n';\n\t\t\t\t}\n\n\t\t\t\tlevel++;\n\t\t\t},\n\n\t\t\t//void tag no need to write closing tag\n\t\t\tvoidTag: function() {\n\t\t\t\tlevel--;\n\n\t\t\t\tif (optDiffLevel === 2 && level === ngIfLevel && ngIfLevelMap[ngIfLevel] >= 0) {\n\t\t\t\t\t// console.log('ngIfLevelMap1', ngIfLevel, ngIfLevels, ngIfLevelMap);\n\t\t\t\t\tif (ngIfLevelMap[ngIfLevel]) {\n\t\t\t\t\t\tFnText += indent(level, 1) + \"}else{\" +\n\t\t\t\t\t\t\t\"R+='<span id=\\\"'+N+'.\" + uniqueId + '\" hidden=\"\"></span>\\';' +\n\t\t\t\t\t\t\t\"N+=\" + ngIfLevelMap[ngIfLevel] + \";}; \\n\";\n\t\t\t\t\t}\n\t\t\t\t\t//save counter\n\t\t\t\t\tngIfCounterTmp = ngIfLevelMap[ngIfLevel];\n\t\t\t\t\t//clear counter\n\t\t\t\t\tngIfLevelMap[ngIfLevel] = void 0;\n\t\t\t\t\t//remove last level\n\t\t\t\t\tngIfLevel = ngIfLevels[--ngIfLevels.length - 1];\n\t\t\t\t\t//add up to previous level\n\t\t\t\t\tif (ngIfLevel) {\n\t\t\t\t\t\tngIfLevelMap[ngIfLevel] += ngIfCounterTmp;\n\t\t\t\t\t}\n\t\t\t\t\t// console.log('ngIfLevelMap2', ngIfLevel, ngIfLevels, ngIfLevelMap);\n\t\t\t\t\tif (LevelMap[level] > 0) {\n\t\t\t\t\t\tLevelMap[level]--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//close \"if\", \"for\", \"while\" blocks\n\t\t\t\t//while is needed because loop and if can be in same tag\n\t\t\t\twhile (LevelMap[level] > 0) {\n\t\t\t\t\tFnText += indent(level, 1) + '}\\n';\n\t\t\t\t\tLevelMap[level]--;\n\t\t\t\t}\n\n\t\t\t\t//clear ng-repeat $index\n\t\t\t\tif (ngRepeatLevel === level) {\n\t\t\t\t\tLevelVarMap[level] = 0;\n\t\t\t\t\twhile (ngRepeatLevel >=0 && LevelVarMap[--ngRepeatLevel] === void 0) {}\n\t\t\t\t}\n\n\t\t\t\t//reset dota-pass when out of scope\n\t\t\t\tif (doTAPass >= level) {\n\t\t\t\t\tdoTAPass = void 0;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t//close tag\n\t\t\tcloseTag: function(tagName) {\n\t\t\t\tlevel--;\n\n\t\t\t\t//just write closing tag back\n\t\t\t\tFnText += indent(level) + \"R+='</\" + tagName + \">';\\n\";\n\n\t\t\t\t//ngIfCounter for most possible uniqueId generation; don't work with loop inside!\n\t\t\t\tif (optDiffLevel === 2 && level === ngIfLevel && ngIfLevelMap[ngIfLevel] >= 0) {\n\t\t\t\t\t// console.log('ngIfLevelMap1', ngIfLevel, ngIfLevels, ngIfLevelMap);\n\t\t\t\t\tif (ngIfLevelMap[ngIfLevel]) {\n\t\t\t\t\t\tFnText += indent(level, 1) + \"}else{\" +\n\t\t\t\t\t\t\t\"R+='<\" + tagName + \" id=\\\"'+N+'.\" + uniqueId + '\" hidden=\"\" ' +\n\t\t\t\t\t\t\t(tagName === 'img' || tagName === 'input' || tagName === 'br' || tagName === 'hr' ?\n\t\t\t\t\t\t\t'/>' : '></' + tagName + '>') + '\\';' +\n\t\t\t\t\t\t\t\"N+=\" + ngIfLevelMap[ngIfLevel] + \"} \\n\";\n\t\t\t\t\t}\n\t\t\t\t\t//save counter\n\t\t\t\t\tngIfCounterTmp = ngIfLevelMap[ngIfLevel];\n\t\t\t\t\t//clear counter\n\t\t\t\t\tngIfLevelMap[ngIfLevel] = void 0;\n\t\t\t\t\t//remove last level\n\t\t\t\t\tngIfLevel = ngIfLevels[--ngIfLevels.length - 1];\n\t\t\t\t\t//add up to previous level\n\t\t\t\t\tif (ngIfLevel) {\n\t\t\t\t\t\tngIfLevelMap[ngIfLevel] += ngIfCounterTmp;\n\t\t\t\t\t}\n\t\t\t\t\t// console.log('ngIfLevelMap2', ngIfLevel, ngIfLevels, ngIfLevelMap);\n\t\t\t\t\tif (LevelMap[level] > 0) {\n\t\t\t\t\t\tLevelMap[level]--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// console.log('LevelMap1', LevelMap);\n\t\t\t\t//close \"if\", \"for\", \"while\" blocks\n\t\t\t\twhile (LevelMap[level] > 0) {\n\t\t\t\t\tFnText += indent(level, 1) + '}\\n';\n\t\t\t\t\tLevelMap[level]--;\n\t\t\t\t}\n\t\t\t\t// console.log('LevelMap2', LevelMap);\n\n\t\t\t\tif (optDiffLevel) {\n\t\t\t\t\tif (level === skipLevel) {\n\t\t\t\t\t\t// console.log('ngIfLevel', [level, skipLevel, ngRepeatLevel])\n\t\t\t\t\t\tFnText += indent(level, 1) + 'N=O' + level + '; \\n';\n\t\t\t\t\t}\n\t\t\t\t\tif (level === skipLevel) {\n\t\t\t\t\t\tskipLevel = void 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//clear ng-repeat $index\n\t\t\t\tif (ngRepeatLevel === level) {\n\t\t\t\t\tLevelVarMap[level] = 0;\n\t\t\t\t\twhile (ngRepeatLevel >=0 && LevelVarMap[--ngRepeatLevel] === void 0) {}\n\t\t\t\t}\n\n\t\t\t\t//add blank node if $watch block return nothing, mostly occur with ng-if\n\t\t\t\tif (WatchMap[level]) {\n\t\t\t\t\tFnText += indent(level, 1) +\n\t\t\t\t\t\t\"R=R||('<\" + tagName + ' id=\"' + idHash[uniqueId + '.' + level] +\n\t\t\t\t\t\t'\" style=\"display:none\"></' + tagName + '>\\');\\n';\n\t\t\t\t\tWatchMap[level] = 0;\n\t\t\t\t\tFnText += indent(level, 2) + 'return R;}; \\n';\n\t\t\t\t\tFnText += indent(level, 2) + 'R+=W.F(S,F,' + (optParams ? '$attr': '0') + ',0,N++); \\n';\n\t\t\t\t}\n\n\t\t\t\t//reset dota-pass when out of scope\n\t\t\t\tif (doTAPass >= level) {\n\t\t\t\t\tdoTAPass = void 0;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t//text node\n\t\t\ttext: function(text) {\n\t\t\t\t//console.log([text]);\n\t\t\t\tFnText += indent(level) + ('R+=\\'' + interpolate(text) + '\\';\\n')\n\t\t\t\t\t.replace(/\\+''|''\\+/g,'');\n\t\t\t},\n\n\t\t\t//comment node\n\t\t\tcomment: function(data) {\n\t\t\t\tif (optComment !== 0) {\n\t\t\t\t\t//console.log(111,[data]);\n\t\t\t\t\tFnText += indent(level) + \"R+='<\" + escapeSingleQuote(data) + \">';\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (optWatchDiff && optDiffLevel !== 0) {\n\t\t\t//http://jsperf.com/hasownproperty-vs-in-vs-undefined/87\n\t\t\tFnText += indent(0) + 'if(X&&doTA.H[' + uniqueId + ']){doTA.diff' + (optDiffLevel || '') +\n\t\t\t\t'(' + uniqueId + ',R)}' +\n\t\t\t\t'doTA.H[' + uniqueId + ']=R;\\n';\n\t\t}\n\n\t\tFnText += indent(0) +'return R;\\n';\n\n\t\t//Default Optimization\n\t\t// - concat possible lines for performance\n\t\tFnText = FnText.replace(/;R\\+=/g,'+').replace(/'\\+'/g,'');\n\n\t\t//extra optimization, which might take some more CPU\n\t\tif (options.optimize && !optWatchDiff) {\n\t\t\tFnText = FnText.replace(removeUnneededQuotesRegex,'$1$2');\n\t\t}\n\n\t\t//print the whole function if debug\n\t\tif (options.debug) {\n\t\t\t/**/console.log(FnText);\n\t\t}\n\t\t// console.log(FnText);\n\n\t\t//try {\n\t\t\t/*jshint evil: true */\n\t\t\tif (optWatchDiff || optDiffLevel) {\n\t\t\t\t//$scope, $filter, $attr, isPatch, IdCounter, isKey, LoopIdCounter\n\t\t\t\tcompiledFn = new Function('S', 'F', '$attr', 'X', 'N', 'K', 'M', FnText);\n\t\t\t} else if (optParams) {\n\t\t\t\tcompiledFn = new Function('S', 'F', '$attr', FnText);\n\t\t\t} else {\n\t\t\t\tcompiledFn = new Function('S', 'F', FnText);\n\t\t\t}\n\t\t\t/*jshint evil: false */\n\n\t\t\tcompiledFn.id = uniqueId;\n\t\t\tif (Watched) {\n\t\t\t\tcompiledFn.W = 1;\n\t\t\t//\tcompiledFn = {W:[], F: compiledFn};\n\t\t\t}\n\t\t//} catch (err) {\n\t\t//\tif (typeof console !== \"undefined\") {\n\t\t//\t\t/**/console.log(\"doTA compile error:\\n\" + FnText);\n\t\t//\t}\n\t\t//\tthrow err;\n\t\t//}\n\n\t\t// just for less array usage on heap profiling\n\t\t// but this may trigger GC more\n\t\t// FnText = LevelMap = LevelVarMap = VarMap = ngIfLevels = ngIfLevelMap = WatchMap = idHash = void 0;\n\t\treturn compiledFn;\n\t}", "title": "" }, { "docid": "0258bf68ca751250de9a48159183de55", "score": "0.6488607", "text": "function render(data){\n return template(data);\n }", "title": "" }, { "docid": "f981c1578a2d5232f4875c7a8d2ce3b2", "score": "0.64586085", "text": "function renderTemplate(templateName, containerName, dataObj, callBackFunction, animateFunction) {\n\n\t\t// render the template based on Id\n\t\tvar render = (typeof dataObj === 'undefined') \n\t\t\t\t\t\t\t? $('#' + templateName).render()\n\t\t\t\t\t\t\t: $('#' + templateName).render(dataObj);\n\t\t\n\t\t(typeof (animateFunction) === 'function')\n\t\t\t\t\t\t\t? animateFunction(render)\n\t\t\t\t\t\t\t: $('#' + containerName).html(render);\n\t\t\n\t\tif (typeof (callBackFunction) === 'function') {\n\t\t\tcallBackFunction(dataObj);\n\t\t}\n\n\t}", "title": "" }, { "docid": "208574dd67f5acbca427197498b2df1a", "score": "0.64317226", "text": "toHtml() {\n return this.templEngine.renderMain(this.response);\n }", "title": "" }, { "docid": "55e85efedae013fed06e86081eb63653", "score": "0.6417529", "text": "function render_tmpl () {\n // store compiled templates for great good\n var cache = {}\n\n var compile_template = function (filename) {\n return Q\n .fcall(function () {\n // return cached immediately\n if (cache[filename]) {\n return cache[filename]\n }\n\n // (asynchronously) load and compile template\n $.util.log('loading template: ' + filename)\n return Q\n .nfcall(fs.readFile, filename)\n .then(function (tmpl_content) {\n // turn template in promise returning function and cache it\n var compiled = jade.compile(tmpl_content, {pretty: true, filename: filename})\n $.util.log('compiled template: ' + chalk.yellow(filename))\n return (cache[filename] = compiled)\n })\n })\n .fail(function (err) {\n $.util.log('failed compiling jade template', chalk.red(err))\n })\n }\n\n return $.map(function (file) {\n // select template\n var t = (file.frontMatter && file.frontMatter.layout) || 'default'\n\n // pull from cache, compile if needed\n return compile_template('templates/' + t + '.jade')\n .then(function (compiled_template) {\n $.util.log('rendering [' + chalk.yellow(t) + '] \"' +\n chalk.magenta(path.basename(file.path)) + '\"')\n\n try {\n // render it with template variable 'page'\n var html = compiled_template({page: file})\n } catch (err) {\n console.log('[' + chalk.red('ERR') +\n '] Failed rendering jade template\\n\\t' +\n chalk.red(err.message))\n }\n\n return new File({\n cwd: file.cwd,\n base: file.base,\n path: file.path.replace(/\\.md$/, '.html'),\n contents: new Buffer(html)\n })\n })\n .fail(function (err) {\n $.util.log('Failed rendering jade template', chalk.red(err))\n })\n })\n}", "title": "" }, { "docid": "f376aa71428af9ce0dbd063148b05e09", "score": "0.6409364", "text": "function compileTemplate(ctx, src) {\n var template = TrimPath.parseTemplate(src, name);\n var name = ctx.getAttribute(Packages.javax.script.ScriptEngine.FILENAME);\n if (name == null) { \n name = \"<unknown>\"; \n }\n return function(newCtx) {\n if (newCtx == null) {\n newCtx = ctx;\n }\n return callWithThreadContext(newCtx,\n function() {\n newCtx.setAttribute(\"context\", newCtx, newCtx.ENGINE_SCOPE);\n var myscope = newCtx.getBindings(newCtx.ENGINE_SCOPE);\n return template.process(scope(myscope));\n });\n }\n }", "title": "" }, { "docid": "919a1537ea8b89ca22f9449343de2be3", "score": "0.64046264", "text": "static get template() {\n return html([template]);\n }", "title": "" }, { "docid": "a8e43db21fdae61f7f12e09d37b1650d", "score": "0.63773197", "text": "function renderTemplate(templateFile, context) {\n\tvar source = fs.readFileSync(templateFile).toString();\n\tvar result = swig.render(source, { locals: context });\n\treturn result;\n}", "title": "" }, { "docid": "64066fcd26aebd6f6a59712b2ae88634", "score": "0.6333171", "text": "function subRender(template) {\n\t return writer.render(template, context);\n\t }", "title": "" }, { "docid": "6bade1012aeed9fb889485985fceb340", "score": "0.63076615", "text": "function VinylTemplate() {}", "title": "" }, { "docid": "ed791a46feaf2380cb2a92e7e03211c5", "score": "0.6280603", "text": "function _render(cxt) {\n //set browser context\n var clientNamespace = View.clientContextRootNamespace;\n (View.pushContextToClient) ? setClientContext(clientNamespace, cxt) : setClientContext(clientNamespace, '');\n var element_ = $(selector);\n view.render(template, cxt, function (err, out) {\n if (append) {\n var doc = $.parseHTML(out, document, true);\n element_.append(doc);\n if (callback && callback instanceof Function) callback(null, out);\n } else if (transition && transition !== undefined) view.transition(selector, out, params, callback);\n else {\n element_.html(out);\n if (callback && callback instanceof Function) callback.call(this);\n }\n });\n }", "title": "" }, { "docid": "950777921ac9acd64b4579fca6cc6e8a", "score": "0.6271822", "text": "function render(template) {\n\t\ttemplate = templates[template];\n\t\treturn function (context, partials, indent) {\n\t\t\treturn template.render(context, partials || templates, indent);\n\t\t};\n\t}", "title": "" }, { "docid": "07c7339994a6ca3b9b406f1c468d6303", "score": "0.62642837", "text": "function compile(str, options){\n var exports, _ref;\n if (options.jinjs_pre_compile) {\n str = options.jinjs_pre_compile(str);\n }\n (_ref = options.app.settings).jinjsenv == null && (_ref.jinjsenv = new ExpressEnvironment({\n track_changes: options.app.settings.env == 'development' || options.app.settings[\"view options\"].jinjs_track_changes,\n pre_compile_func: options.jinjs_pre_compile\n }));\n exports = options.app.settings.jinjsenv.getTemplateFromString(str, options);\n return exports.render;\n }", "title": "" }, { "docid": "0804bf08fbe2914ec7d899885d44ded5", "score": "0.6227881", "text": "function templateRender(templateID, Data) {\n var template = $.templates(templateID)\n var htmlOutput = template.render(Data);\n return htmlOutput;\n}", "title": "" }, { "docid": "ae0077d7708a77e64c21df969d986ddb", "score": "0.619769", "text": "function render()\n {\n if (content === JSON.stringify(scope.item))\n {\n return;\n }\n\n // merge element values into local scope\n angular.merge(scope, scope.item);\n\n // nothing when no template is specified\n if (!template)\n {\n element.html('');\n //element.html(scope.node.documentType.description);\n return;\n }\n\n // create html and compile\n element.html(template);\n $compile(element.contents())(scope);\n\n content = JSON.stringify(scope.item);\n }", "title": "" }, { "docid": "57f7fdf01d5b8830b4c8660ac0a74627", "score": "0.6144736", "text": "function _compile(template, options) {\n var args = \"view,partials,stack,lookup,escapeHTML,renderSection,render\";\n var body = parse(template, options);\n var fn = new Function(args, body);\n\n // This anonymous function wraps the generated function so we can do\n // argument coercion, setup some variables, and handle any errors\n // encountered while executing it.\n return function (view, partials) {\n partials = partials || {};\n\n var stack = [view]; // context stack\n\n try {\n return fn(view, partials, stack, lookup, escapeHTML, renderSection, render);\n } catch (e) {\n throw debug(e.error, template, e.line, options.file);\n }\n };\n }", "title": "" }, { "docid": "34a9c768c8255f3250e7152bccd3ba54", "score": "0.6135504", "text": "function renderTemplate() {\n let result = \"\";\n\n result += publicApi.templateStart;\n for (let i = 0; i < publicApi.pageCount; i++) {\n result += renderPageButton(i + 1, i == activePage);\n }\n\n result += publicApi.templateEnd;\n\n return result;\n }", "title": "" }, { "docid": "183eee89f379501a9acf0e9336277c5e", "score": "0.61341053", "text": "render() {\n this.template = Core.render(this.createHTML());\n return Promise.resolve(null);\n }", "title": "" }, { "docid": "20f103091f5fa78e66c750fffcf70b5c", "score": "0.61141014", "text": "function render_template()\n{\n\t txtCode = widgetCodeMirror.getValue()\n\t txtCode = txtCode.split(\"\\n\").join(\"\")\n\t renderSuccess = false;\n \n\t txtCode = txtCode.split(\" \").join(\"\")\n\t if (txtCode.substr(0,2) == \"{{\")\n\t\t {\n\t\t txtCode = txtCode.substr(2)\n\t\t }\n\t txtCode = txtCode.split(\"}}<br>{{\").join(\"<br>\")\n\t if (txtCode.substr(-3) == \")}}\")\n\t\t { txtCode = txtCode.substr(0,txtCode.length-2) }\n\t // *********\n\t [txtTest,allBracketsClosed] = removeBalancedBrackets(txtCode)\n\t if (allBracketsClosed == false)\n\t\t {\n\t\t myText \t= '<span id=\"blink\" class=\"blinkklasse\"><b style=\"color: orange;font-size:1.2em;\"> Not all brackets are closed </span><br>Rendering will cause an error<br>' \n\t myText += '<br>Rendering aborted, please check brackets for next trial'\n\t\t myText += '<br>This message will disapear in 10 sec'\n\t\t document.getElementById(\"render_frame\").contentWindow.document.body.innerHTML = myText\n\t\t clearInterval(myInterval);\n\t\t myInterval = setInterval(UpdateManual,10000);\n\t\t return\n\t\t }\n\t WidgetArray = txtCode.split(\"<br>\")\n\t txtClipboard = \"\"\n lastWidgetIsQuad = false\n\t WidgetArray.forEach(function(element){\n\t\t if (element.search('quad') >= 0 && lastWidgetIsQuad == false)\n\t\t {\n\t\t\t txtClipboard += '<ul data-role=\"listview\" data-dividertheme=\"c\" class=\"quad_list\">\\n'\n\t\t lastWidgetIsQuad = true\n\t\t }\n\t\t \n\t\t if (element.search('quad') == -1 && lastWidgetIsQuad == true)\n\t\t {\n\t\t\t txtClipboard += '</ul>\\n<br>\\n'\n\t\t\t lastWidgetIsQuad = false\n\t\t }\n\t\t txtClipboard = txtClipboard + \"{{\" + element + \"}}\\n\"\n\t\t if (lastWidgetIsQuad == false)\n\t\t {\n\t\t\t txtClipboard += '<br>\\n'\n\t\t }\n\t\t \n\t });\n\t // *********\n\t if (lastWidgetIsQuad == true)\n\t {\n\t\t txtClipboard += '</ul>\\n<br><br>'\n\t }\n\t\t \n\t // Value for rendering\n\t txtCode = txtClipboard\n\t txtClipboard = ''\n\t WidgetArray.forEach(function(element){\n\t\t txtClipboard = txtClipboard + \"{{\" + element + \"}}\\n<br>\\n\"\n\t });\n\t // delete last <br>\n\t txtClipboard = txtClipboard.substr(0,txtClipboard.lastIndexOf(\"<br>\")-1)\n\t copyToClipboard(txtClipboard)\n\t newUrl = window.location.href.substr(0,window.location.href.search(\"=\")+1) + 'assistant'\n\t if (document.getElementById(\"render_2_Window\").checked == false)\n\t\t {\n\t\t\t $.ajax({\n\t\t\t url: \"lib/widget_assistant/widget_assistant.php\",\n\t\t\t method: \"GET\",\n\t\t\t dataType: \"text\",\n\t\t\t data: {\n\t\t\t\t \t\tcommand : 'render_inline',\n\t\t\t\t \t\twidget : txtCode\n\t\t\t\t \t },\n\t\t\t success: function (result) {\n\t\t\t\t console.log(\"rendered template correct\")\n\t\t\t\t document.getElementById(\"render_frame\").src=newUrl\n\t\t\t\t },\n\t\t\t error: function (result) {\n\t\t\t\t console.log(\"Error rendering template\")\n\t\t\t }\n\t\t\t });\n\t\t }\n\t else\n\t\t {\n\t\t\t $.ajax({\n\t\t\t url: \"lib/widget_assistant/widget_assistant.php\",\n\t\t\t method: \"GET\",\n\t\t\t dataType: \"text\",\n\t\t\t data: {\n\t\t\t\t \t\tcommand : 'render_outline',\n\t\t\t\t \t\twidget : txtCode\n\t\t\t\t \t },\n\t\t\t success: function (result) {\n\t\t\t\t console.log(\"rendered template correct\");\n\t\t\t\t renderSuccess = true;\n\t\t\t\t },\n\t\t\t error: function (result) {\n\t\t\t\t console.log(\"Error rendering template\");\n\t\t\t\t renderSuccess = false;\n\t\t\t }\n\t\t\t});\t\t \n\t\t\t\n\t\t\tif (renderSuccess = true) { \n\t\t\t\tif (myChildWindows == null || myChildWindows.closed == true) \n \t\t \t\t myChildWindows = window.open(newUrl, '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');\n\t\t\t\telse {\n\t\t\t\t\tmyChildWindows.location.reload(true);\n\t\t\t\t\tmyChildWindows.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t }\n}", "title": "" }, { "docid": "6fcc51f6743a244dc733393f4ee4245a", "score": "0.61040473", "text": "_compileHtml() {\n\t\tfor (let template of this._templates) {\n\t\t\tthis._logger.debug('Start compiling ' + template.name);\n\t\t\tconst contentCompiler = new ContentCompiler(template.$, this._logger);\n\t\t\tconst componentCompiler = new ComponentCompiler(template.$, this._logger);\n\n\t\t\t// HIDE PREVIEW TEXT\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.preview();\n\n\t\t\t// WRAP BODY\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.body();\n\n\t\t\t// COMPILE SPACINGS\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.padding();\n\t\t\tcontentCompiler.margin();\n\n\t\t\t// COMPILE CONTAINERS AND GRIDS\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.container(this._vars[BootstrapEmail.STYLE_VARIABLES.CONTAINER_WIDTH]);\n\t\t\tcontentCompiler.grid(this._vars[BootstrapEmail.STYLE_VARIABLES.COLUMNS]);\n\n\t\t\t// COMPILE NECESSARY ELEMENTS\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.hr();\n\n\t\t\t// COMPILE ALIGNMENT CLASSES\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.align(ContentCompiler.ALIGNMENT.LEFT);\n\t\t\tcontentCompiler.align(ContentCompiler.ALIGNMENT.RIGHT);\n\t\t\tcontentCompiler.align(ContentCompiler.ALIGNMENT.CENTER);\n\n\t\t\t// COMPILE BOOTSTRAP COMPONENTS\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.component('.card');\n\t\t\tcontentCompiler.component('.card-body');\n\t\t\tcontentCompiler.component('.btn');\n\t\t\t// TODO: replace button replacer\n\t\t\t//componentCompiler.button();\n\t\t\tcomponentCompiler.badge();\n\t\t\tcontentCompiler.component('.alert');\n\n\t\t\t// REPLACE DIVS\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.div();\n\n\t\t\t// ADD ATTRIBUTES TO TABLES\n\t\t\t//*****************************************\n\t\t\tcontentCompiler.table();\n\t\t}\n\t}", "title": "" }, { "docid": "677354bdb8916807c8578be88525e78e", "score": "0.60919535", "text": "function renderTemplate(element, template, object){\n var renderedTemplate = Mustache.to_html(template, object);\n element.html(renderedTemplate);\n }", "title": "" }, { "docid": "b18a75086593fd8617b21648d9507f17", "score": "0.6091186", "text": "function templateFn(itemObj) {\n // Set up the defaults for the item object\n _.defaults(itemObj.options, defaults);\n \n // Render the items via the template\n var retStr = mustache.render(tmpl, itemObj);\n return retStr;\n }", "title": "" }, { "docid": "fdc601a510e19f6dde6280f5484825a0", "score": "0.6066404", "text": "function render(template, data) {\n var html = $('#' + template).html();\n for (var key in data) {\n html = html.replace(new RegExp('{{' + key + '}}', 'g'), data[key]);\n }\n return html;\n}", "title": "" }, { "docid": "50b5e2b2b44c444542b16f16eba6bce5", "score": "0.605268", "text": "function renderMainTemplate(req, res) {\n res.render('index', {\n reactHtml: '<span>Here is some span text</span>',\n });\n}", "title": "" }, { "docid": "4b8cb8f9d78b2130faf66841d6bc0d49", "score": "0.6039477", "text": "_injectTemplate() {\n if ($(this.templateSelector).length) return;\n\n $(document.body).append(pst.template(this.context));\n }", "title": "" }, { "docid": "ab30dcc4c07120a5c0de1f4fb7b2e385", "score": "0.60328853", "text": "function renderTemplate() {\n return function (data) {\n var template = components.getTemplate(data.template);\n\n if (!template) {\n throw new Error('Missing template for ' + JSON.stringify(_.omit(data, 'state')));\n }\n\n return Promise.resolve(multiplex.render(template, data))\n .then(media.append(data));\n };\n}", "title": "" }, { "docid": "6520c19919dbe59d7fc1131b3b2c2f70", "score": "0.6027859", "text": "compile( data ) {\n var source = this[0].innerHTML;\n var template = Handlebars.compile( source );\n return template( data );\n }", "title": "" }, { "docid": "d7a5932522608a3a1bd88e22122467a3", "score": "0.6021312", "text": "function _render() {\n\n list.innerHTML = pages.reduce((html, page, index) => {\n return html + template(page, index);\n }, '');\n\n }", "title": "" }, { "docid": "00afdcd16f3ac1a48c47b516c2229226", "score": "0.6008424", "text": "function evalTemplate(ctx, src) {\n ctx.setAttribute(\"context\", ctx, ctx.ENGINE_SCOPE);\n var template = TrimPath.parseTemplate(src, name);\n var name = ctx.getAttribute(Packages.javax.script.ScriptEngine.FILENAME);\n if (name == null) { \n name = \"<unknown>\"; \n }\n var myscope = ctx.getBindings(ctx.ENGINE_SCOPE);\n return template.process(scope(myscope));\n }", "title": "" }, { "docid": "5d1d7eda5982244c24857eb7cbdf8fb8", "score": "0.6002556", "text": "function render(template, sourceElement) {\n let attrpattern = /{{(\\w+)}}/gi,\n TemplateAttrArr = template.match(attrpattern),\n defaultText = 'Some Text';\n\n let AttrArr = TemplateAttrArr.map(function(el) {\n return el.replace(/[{+}+]/g, '');\n })\n TemplateAttrArr.forEach(function(el, i) {\n template = template.replace(el, sourceAttr(AttrArr[i], sourceElement, defaultText));\n });\n return template;\n }", "title": "" }, { "docid": "0c517e15c0a14494421de2e2f53d5346", "score": "0.59885746", "text": "renderTemplate(){\n\t \t this.render('libraries/form');\n\t }", "title": "" }, { "docid": "2e1decf75f17ba3d08923617fbf86f8f", "score": "0.5983941", "text": "function render(template, view, partials) {\n return compile(template)(view, partials);\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5950889", "text": "render() {}", "title": "" }, { "docid": "952a2be2bbd036a9eb4ae1783bce5e0a", "score": "0.59472716", "text": "function render_template(data, rewrite){\n if ( rewrite ) {\n $( '#wpb_visual_composer .vc_control.column_delete.vc_column-delete' ).trigger( 'click' );\n }\n\n var models;\n _.each(vc.filters.templates, function(callback) {\n html = callback(data)\n }), models = vc.storage.parseContent({}, data), _.each(models, function(model) {\n vc.shortcodes.create(model)\n }), vc.closeActivePanel();\n\n $( '.et_popup-step' ).addClass('hidden');\n $( '.et_popup-step.et_step-final' ).removeClass('hidden');\n $( '.et_popup-import-content' ).removeClass('ajax-processing');\n }", "title": "" }, { "docid": "a114852edc74ee1e0269b04b95bc3e5c", "score": "0.5926529", "text": "function render(html, data) {\n var evalHtml = Engine.run(html, data);\n return evalHtml;\n}", "title": "" }, { "docid": "6f9b592111d45df35d88e8163d749c37", "score": "0.59216934", "text": "function render$1(result, container, scopeName) {\n const templateFactory = shadyTemplateFactory(scopeName);\n const template = templateFactory(result);\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === template &&\n instance._partCallback === result.partCallback) {\n instance.update(result.values);\n return;\n }\n // First render, create a new TemplateInstance and append it\n instance =\n new TemplateInstance(template, result.partCallback, templateFactory);\n container.__templateInstance = instance;\n const fragment = instance._clone();\n instance.update(result.values);\n const host = container instanceof ShadowRoot ?\n container.host :\n undefined;\n // If there's a shadow host, do ShadyCSS scoping...\n if (host !== undefined && typeof window.ShadyCSS === 'object') {\n ensureStylesScoped(fragment, template, scopeName);\n window.ShadyCSS.styleElement(host);\n }\n removeNodes(container, container.firstChild);\n container.appendChild(fragment);\n}", "title": "" }, { "docid": "3b83ac6ecf113df7a84f0d5740d073d9", "score": "0.5904597", "text": "get template() {\n // You can use the html helper like so to render HTML:\n return html`<b>Hello, world!</b>`;\n }", "title": "" }, { "docid": "82adc8dd7d53f8039767fd2bf304f58d", "score": "0.5900596", "text": "function runTemplate( templateName ) {\n\tvar outputContainer = $( \"#template-output\" );\n\tvar data;\n\ttry {\n\t\tvar dataInput = $( \"#data\" )[ 0 ];\n\t\tdata = JSON.parse(\n\t\t\tfixupJson( dataInput.value ),\n\t\t\tfunction ( key, value ) {\n\t\t\t\t// Make sure that any sanitized content specified as\n\t\t\t\t// { content: '<b>foo</b>', contentKind: 0 }\n\t\t\t\t// has a toString() method that returns the content string.\n\t\t\t\tif ( typeof value === \"object\"\n\t\t\t\t\t\t&& \"content\" in value\n\t\t\t\t\t\t&& value[ \"contentKind\" ] === ( value[ \"contentKind\" ] | 0 ) ) {\n\t\t\t\t\tvalue.toString = SanitizedContent.prototype.toString;\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t} );\n\t} catch ( e ) {\n\t\treturn showError( e, outputContainer );\n\t}\n\n\tvar templateResult;\n\ttry {\n\t\ttemplateResult = $.template( templateName ).tmpl( data );\n\t} catch ( e ) {\n\t\treturn showError( e, outputContainer );\n\t}\n\n\tvar wrapper = $( \"<div/>\" );\n\twrapper.append( templateResult );\n\tvar resultHtml = \"\" + wrapper.html();\n\n\toutputContainer.empty();\n\t$( \"<h3/>\" ).text( \"Result for \" + templateName ).appendTo( outputContainer );\n\tvar resultContainer = $( \"<p/>\" );\n\tresultContainer.append( templateResult );\n\tresultContainer.appendTo( outputContainer );\n\t$( \"<h3/>\" ).text( \"Result source\" ).appendTo( outputContainer );\n\t$( \"<pre/>\" ).text( resultHtml ).appendTo( outputContainer );\n\n\t$( \"html, body\" ).animate( {\n\t\tscrollTop: outputContainer.offset().top,\n\t\tscrollLeft: outputContainer.offset().left\n\t}, 1000 );\n}", "title": "" }, { "docid": "75d2f9cc0b53c5fe6521012068444bd3", "score": "0.5893007", "text": "function render(response,viewContext) {\n\t\t\n\t\tif(fs.existsSync(viewFileName)) {\n\t\t\t html = ejs.render(fs.readFileSync(layoutName,'utf-8'), {yield : function() {\n\t\t\t\treturn ejs.render(fs.readFileSync(viewFileName,'utf-8'), viewContext);\n\t\t\t}, \n\t\t\tscripts: function() {\n\t\t\t\t\n\t\t\t\tvar scriptsHtml = '';\n\t\t\t\tvar fileList = fs.readdirSync(process.cwd() + '/public/js');\n\n\t\t\t\tfor(var i=0;i<fileList.length;i++) {\n\t\t\t\t\tscriptsHtml += '<script type=\"text/javascript\" src=\"/'+fileList[i]+\n\t\t\t\t\t\t\t\t'\"></script>\\n';\n\t\t\t\t}\n\t\t\t\treturn scriptsHtml;\n\t\t\t\n\t\t\t},\n\t\t\tstyles: function() {\n\t\t\t\tvar stylesHtml = '';\n\t\t\t\tvar fileList = fs.readdirSync(process.cwd() + '/public/css');\n\n\t\t\t\tfor(var i=0;i<fileList.length;i++) {\n\t\t\t\t\tstylesHtml += '<link rel=\"stylesheet\" type=\"text/css\" href=\"/'+fileList[i]+\n\t\t\t\t\t\t\t\t'\" />\\n';\n\t\t\t\t}\n\t\t\t\treturn stylesHtml;\n\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\tresponse.end(html);\n\t\t}\n\t\t// if the view file is not found return the templateMissing exception \n\t\telse {\n\t\t\tresponse.end(exceptions.templateMissing(utils.removeLeadingSlash(url)));\n\t\t}\n\t}", "title": "" }, { "docid": "b0e6596e5ab18c72a7573a0c796aee39", "score": "0.58813196", "text": "function render_with_layout (filename, template, locals, cb) {\n render_file(locals, function(err, str) {\n if (err) {\n return cb(err);\n }\n\n locals.body = str;\n\n try {\n var res = template(locals, handlebarsOpts)\n self.async.done(function (values) {\n Object.keys(values).forEach(function (id) {\n res = res.replace(id, values[id])\n })\n\n cb(null, res)\n })\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n });\n }", "title": "" }, { "docid": "b0e6596e5ab18c72a7573a0c796aee39", "score": "0.58813196", "text": "function render_with_layout (filename, template, locals, cb) {\n render_file(locals, function(err, str) {\n if (err) {\n return cb(err);\n }\n\n locals.body = str;\n\n try {\n var res = template(locals, handlebarsOpts)\n self.async.done(function (values) {\n Object.keys(values).forEach(function (id) {\n res = res.replace(id, values[id])\n })\n\n cb(null, res)\n })\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n });\n }", "title": "" }, { "docid": "956de5d0643e44beacead455b2450e09", "score": "0.5859177", "text": "function render(response, code, template, data) {\n\tvar html = template(data);\n\tif (!response.headersSent) {\n\t response.writeHead(code, {\"Content-Type\": \"text/html\"});\n\t}\n response.end(html);\n}", "title": "" }, { "docid": "c143201b747e2927f39ba9b6d6a0a6a6", "score": "0.5849945", "text": "function applyTemplate(rendered) {\n // Actually put the rendered contents into the element.\n if (rendered) {\n options.html(root.$el, rendered);\n }\n\n // Resolve only after fetch and render have succeeded.\n fetchAsync.resolveWith(root, [root]);\n }", "title": "" }, { "docid": "a2fc1887c4840594c496cc5903381f2c", "score": "0.5845964", "text": "function renderTemplate(request, response, content, statusCode) {\n var json = JSON.parse(content);\n \n // Setting default value of optional argument\n statusCode = statusCode || 200;\n \n if (json.template) {\n mu.render(json.template, json, {}, function (err, output) {\n try {\n if (err) {\n serverError(request, response, err, true);\n } else {\n console.log(\"200 \"+request.url);\n response.writeHead(statusCode, {\"Content-Type\": \"text/html\"});\n output\n .addListener(\"data\", function (c) { response.write(c); })\n .addListener(\"end\", function () { response.end(); });\n }\n } catch (err) { serverError(request, response, err, true); }\n });\n } else {\n serverError(request, response, \"Template property is missing on content.\", true);\n }\n\n}", "title": "" }, { "docid": "c973bbe6e54c3b745ba7f7347b32bc1f", "score": "0.5842336", "text": "function render_template(type, object) {\n try {\n return new EJS({text: __templates[type]}).render(object);\n } catch (e) {\n //console.error(e);\n return \"\";\n }\n}", "title": "" }, { "docid": "bb6edd71dc2ee0d07e5c711b04d5253d", "score": "0.58423084", "text": "function showTemplate(template, data){\r\n var html = template(data);\r\n $('#content').html(html);\r\n}", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.58412427", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.58412427", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.58412427", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.58412427", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.58412427", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.58412427", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "8c761c38318ddce6bb0d5d4ed2a71f38", "score": "0.5839342", "text": "function compileProjectTemplate(){\n projectSource = $(\"#projectTemplate\").html();\n if ( projectSource !== undefined ) {\n projectTemplate = Handlebars.compile(projectSource); \n }\n}", "title": "" }, { "docid": "256ddb496454826d9b8a82d5e11012f9", "score": "0.58351666", "text": "function xaraSwidgets_compileTemplate(templateCode, templateVariables)\n{\n\tvar html = '' + templateCode;\n \t\n\tfor(var prop in templateVariables)\n\t{\n\t\thtml = html.replace(RegExp('{' + prop + '}', 'g'), templateVariables[prop]);\n\t}\n\t \t\n\treturn html;\r\n}", "title": "" }, { "docid": "8d801baa7693354ded775505cc9bb6db", "score": "0.58124983", "text": "function compile (template, opts) {\n var factory, parser, fragment, serializer, src, idom, hbs;\n opts = opts || {};\n parser = new Parser();\n fragment = parser.parseFragment(template, null);\n serializer = new Serializer(fragment, opts.serializer);\n src = serializer.serialize();\n idom = opts.idom || this.idom;\n hbs = opts.hbs || this;\n\n if (opts.asString) {\n return src;\n }\n\n factory = new Function('hbs', 'idom', \n src.headers + '\\n' + \n 'function update(data) {\\n'+ \n src.main +\n '}\\n' +\n 'function render(element, data, opts) {\\n' +\n ' hbs.patch(element, update, data, opts);\\n' +\n '}\\n' +\n (src.fragments ? 'hbs.registerFragments(' + src.fragments +');\\n' : '') +\n (opts.name ? 'hbs.registerPartial(\\'' + opts.name +'\\', render);\\n' : '') +\n 'return render;'\n );\n\n return factory(hbs, incrementalDom);\n}", "title": "" }, { "docid": "1ba4ae90586ea1055881cd03dcbd1765", "score": "0.58075625", "text": "function render(){\n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "title": "" }, { "docid": "d661e222dc7a1a1de51a69dcd704dcb9", "score": "0.58063716", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "d661e222dc7a1a1de51a69dcd704dcb9", "score": "0.58063716", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "d661e222dc7a1a1de51a69dcd704dcb9", "score": "0.58063716", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "f4cf857af243b36afca89a61307d5adb", "score": "0.5803402", "text": "function renderTemplate(template_file, task, ready_cb) {\n fs.readFile(template_file, function(err, data) {\n if (err) {\n ready_cb(err);\n return;\n }\n\n data = data.toString();\n for (var k in task) {\n data = data.split('${' + k + '}').join(htmlEntities(task[k] || ''));\n }\n\n ready_cb(null, data);\n });\n}", "title": "" }, { "docid": "030f553649cf9b20a662ceb91de66199", "score": "0.57855886", "text": "function renderTemplate(name, data) {\n var $template = $('[data-template-name=' + name + ']').text();\n $.each(data, function(prop, value) {\n // for each beesting (e.g. <% itemUrl %>) in the html, replace it with the given value (e.g. item.url)\n // this is what tells the forEach function below to replace <% itemUrl %> with item.url value\n $template = $template.replace('<% ' + prop + ' %>', value);\n });\n return $template;\n }", "title": "" }, { "docid": "3194d8a1bff5399a5ea637c3d2fd7673", "score": "0.57762057", "text": "function render(tmpl_name, tmpl_data) {\n if ( !render.tmpl_cache ) {\n render.tmpl_cache = {};\n }\n var time = new Date().getTime();\n if ( ! render.tmpl_cache[tmpl_name] ) {\n var tmpl_url = '../tpl/' + tmpl_name + '.html?' + time;\n\n var tmpl_string;\n $.ajax({\n url: tmpl_url,\n method: 'GET',\n async: false,\n success: function(data) {\n tmpl_string = data;\n }\n });\n\n render.tmpl_cache[tmpl_name] = _.template(tmpl_string);\n }\n\n return render.tmpl_cache[tmpl_name](tmpl_data);\n}", "title": "" }, { "docid": "0771d163a86f348f193cfd74fdbe3bdc", "score": "0.57670486", "text": "function templateHTML(filename) {\n\t\tif(!fs.existsSync(filename)) {\n\t\t\tconsole.log(`${filename} file is not exists!`);\n\t\t\treturn false;\n\t\t}\n\t\tvar data = fs.readFileSync(filename, 'utf8');\n\t\tdata = makeHtmlContent(data);\n\t\tfs.writeFileSync(filename, data, 'utf8');\n\t\t/*\n\t\t// 读写文件,模板化\n\t\treadFile(filename)\n\t\t.then( data => {\n\t\t\treturn makeHtmlContent(data);\n\t\t})\n\t\t.then( data => {\n\t\t\treturn writeFile(`${filename}`, data);\n\t\t})\n\t\t.then( data => {\n\t\t\tconsole.log(data);\n\t\t});*/\n\t}", "title": "" }, { "docid": "09fbbe72d53f7dc7c6d4a0ebb45c3f77", "score": "0.576506", "text": "function renderTemplate(templateName, templateContext) {\n if (!renderTemplate.templateCache) {\n renderTemplate.templateCache = {};\n }\n\n if (!renderTemplate.templateCache[templateName]) {\n var templateDir = '../../templates';\n var templateUrl = templateDir + '/' + templateName + '.handlebars';\n\n var templateString;\n $.ajax({\n url: templateUrl,\n method: 'GET',\n async: false,\n success: function(data) {\n templateString = data;\n }\n });\n\n renderTemplate.templateCache[templateName] = Handlebars.compile(templateString);\n }\n return renderTemplate.templateCache[templateName](templateContext);\n }", "title": "" }, { "docid": "6caf79f2416a17b55015693b48d6f7f3", "score": "0.5760181", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, name, context, hash, helpers, partials, data) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if(data) {\n programWrapper = program(this, i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n programWithDepth: env.VM.programWithDepth,\n\n initData: function(context, data) {\n if (!data || !('root' in data)) {\n data = data ? createFrame(data) : {};\n data.root = context;\n }\n return data;\n },\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials,\n data = options.data;\n\n if (!options.partial) {\n helpers = container.helpers = container.merge(options.helpers, namespace.helpers);\n\n if (templateSpec.usePartial) {\n partials = container.partials = container.merge(options.partials, namespace.partials);\n }\n if (templateSpec.useData) {\n data = container.initData(context, data);\n }\n } else {\n helpers = container.helpers = options.helpers;\n partials = container.partials = options.partials;\n }\n return templateSpec.main.call(container, context, helpers, partials, data);\n };\n\n ret.child = function(i) {\n return container.programWithDepth(i);\n };\n return ret;\n}", "title": "" }, { "docid": "cc2df7f6b3789137f79861ef64fdde2b", "score": "0.5759162", "text": "function render(element) {\n element.html(template());\n bindEvents(element);\n }", "title": "" }, { "docid": "86061f68ea3644736bdbbe913dc54b43", "score": "0.57577574", "text": "function compile_template(str)\n {\n var replace_in = function(rep, pre, prop_name, val)\n {\n if(typeof val == \"object\")\n {\n if(rep.search(new RegExp(\"\\\\{\\\\{\" + pre + prop_name , \"g\")) >= 0)\n {\n _.each(val, function(v, k){ rep = replace_in(rep, pre + prop_name + \".\", k, v); });\n }\n return rep;\n }\n else\n {\n return rep.replace(new RegExp(\"\\\\{\\\\{\" + pre + prop_name + \"\\\\}\\\\}\", \"g\"), val);\n }\n };\n return function(obj)\n {\n var representation = str;\n _.each(obj, function(v, k)\n {\n representation = replace_in(representation, \"\", k, v);\n });\n return clean_representation(representation);\n };\n }", "title": "" }, { "docid": "9738bcd4e61bd7b6f381b161e7f71bb5", "score": "0.5756852", "text": "function templateHTML(title, list, description){\r\n var templete=`\r\n <!doctype html>\r\n <html>\r\n <head>\r\n <title>WEB1 - ${title}</title>\r\n <meta charset=\"utf-8\">\r\n </head>\r\n <body>\r\n <h1><a href=\"/\">WEB</a></h1>\r\n ${list}\r\n <a href=\"/create\">create</a>\r\n <h2>${title}</h2>\r\n ${description}\r\n </body>\r\n </html>\r\n `;\r\n return templete;\r\n }", "title": "" }, { "docid": "6132c75cb98df58210930545db685b6a", "score": "0.5755374", "text": "function preCompileTemplate() {\n\n var source = jQuery(\"#game_details_template\").html();\n gameDetailTemplate = Handlebars.compile(source);\n\n }", "title": "" }, { "docid": "3bfe2f3da3142c6bb2d87f02b2d0119f", "score": "0.5745855", "text": "function EditorComponent_ng_template_0_Template(rf, ctx) { }", "title": "" }, { "docid": "4bc5ba1e1af4b78712a8ff4319e9257b", "score": "0.5734082", "text": "function tmpl(str, data) {\n try {\n var fn = !/\\W/.test(str) ?\n tmpl_cache[str] = tmpl_cache[str] ||\n tmpl(templates[str]) :\n new Function(\"obj\",\n \"var p=[],print=function(){p.push.apply(p,arguments);};\" +\n \"with(obj){p.push('\" +\n str\n .replace(/[\\r\\t\\n]/g, \" \")\n .replace(/'(?=[^%]*%>)/g,\"\\t\")\n .split(\"'\").join(\"\\\\'\")\n .split(\"\\t\").join(\"'\")\n .replace(/<%=(.+?)%>/g, \"',$1,'\")\n .split(\"<%\").join(\"');\")\n .split(\"%>\").join(\"p.push('\")\n + \"');}return p.join('');\");\n return data ? fn( data ) : fn;\n } catch(e) { return e.message; }\n }", "title": "" }, { "docid": "d809e9695ce6a83e63ae936ad9c6a23d", "score": "0.5734021", "text": "function template(templateSpec, env) {\n\t if (!env) {\n\t throw new Exception(\"No environment passed to template\");\n\t }\n\n\t // Note: Using env.VM references rather than local var references throughout this section to allow\n\t // for external users to override these as psuedo-supported APIs.\n\t var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n\t var result = env.VM.invokePartial.apply(this, arguments);\n\t if (result != null) { return result; }\n\n\t if (env.compile) {\n\t var options = { helpers: helpers, partials: partials, data: data };\n\t partials[name] = env.compile(partial, { data: data !== undefined }, env);\n\t return partials[name](context, options);\n\t } else {\n\t throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n\t }\n\t };\n\n\t // Just add water\n\t var container = {\n\t escapeExpression: Utils.escapeExpression,\n\t invokePartial: invokePartialWrapper,\n\t programs: [],\n\t program: function(i, fn, data) {\n\t var programWrapper = this.programs[i];\n\t if(data) {\n\t programWrapper = program(i, fn, data);\n\t } else if (!programWrapper) {\n\t programWrapper = this.programs[i] = program(i, fn);\n\t }\n\t return programWrapper;\n\t },\n\t merge: function(param, common) {\n\t var ret = param || common;\n\n\t if (param && common && (param !== common)) {\n\t ret = {};\n\t Utils.extend(ret, common);\n\t Utils.extend(ret, param);\n\t }\n\t return ret;\n\t },\n\t programWithDepth: env.VM.programWithDepth,\n\t noop: env.VM.noop,\n\t compilerInfo: null\n\t };\n\n\t return function(context, options) {\n\t options = options || {};\n\t var namespace = options.partial ? options : env,\n\t helpers,\n\t partials;\n\n\t if (!options.partial) {\n\t helpers = options.helpers;\n\t partials = options.partials;\n\t }\n\t var result = templateSpec.call(\n\t container,\n\t namespace, context,\n\t helpers,\n\t partials,\n\t options.data);\n\n\t if (!options.partial) {\n\t env.VM.checkRevision(container.compilerInfo);\n\t }\n\n\t return result;\n\t };\n\t}", "title": "" }, { "docid": "9bed5505b6aed1b4d96f2c3576291017", "score": "0.5725534", "text": "function conTem(template,data)\n{\n\tvar html=template(data);\n\t$(\"section\").html(html);\n}", "title": "" }, { "docid": "9224c0da4825bf04e49dae54f56c788f", "score": "0.57243454", "text": "function generateHTML(template, page)\n{\n site = settings; // alias global settings.\n\n let html = template.html;\n let output = '';\n\n //@@TODO: throw proper error.\n if (html.length == 0) throw \"Template \" + template.name + \" has no content.\";\n\n // include a page\n function include(name)\n {\n return getPage(name).content;\n }\n\n output = eval('`' + html + '`');\n\n return output;\n}", "title": "" }, { "docid": "eeebf6b5d00a6714257c494b9b0473f2", "score": "0.5715989", "text": "function c(e,i,s,a){// This function is used to render an artbitrary template\n// in the current context by higher-order functions.\nfunction o(t){return i.render(t,s)}for(var r,l,d,u=\"\",h=0,f=e.length;f>h;++h)switch(r=e[h],l=r[1],r[0]){case\"#\":if(d=s.lookup(l),\"object\"==typeof d||\"string\"==typeof d)if(_(d))for(var p=0,g=d.length;g>p;++p)u+=c(r[4],i,s.push(d[p]),a);else d&&(u+=c(r[4],i,s.push(d),a));else if(n(d)){var m=null==a?null:a.slice(r[3],r[5]);d=d.call(s.view,m,o),null!=d&&(u+=d)}else d&&(u+=c(r[4],i,s,a));break;case\"^\":d=s.lookup(l),// Use JavaScript's definition of falsy. Include empty arrays.\n// See https://github.com/janl/mustache.js/issues/186\n(!d||_(d)&&0===d.length)&&(u+=c(r[4],i,s,a));break;case\">\":d=i.getPartial(l),n(d)&&(u+=d(s));break;case\"&\":d=s.lookup(l),null!=d&&(u+=d);break;case\"name\":d=s.lookup(l),null!=d&&(u+=t.escape(d));break;case\"text\":u+=l}return u}", "title": "" }, { "docid": "3f0ec7dfbbc348001a773f48aa99bdd5", "score": "0.5713917", "text": "function loadTemplate(name, data){\n var template = require('../views/'+ name +'.ejs');\n var rendered = template(data);\n document.getElementById('bm-view').innerHTML = rendered;\n return rendered;\n}", "title": "" }, { "docid": "4f3d7c6078a65f772a295f49c744b6f7", "score": "0.5713434", "text": "Render( ctx, connection ) {}", "title": "" }, { "docid": "eb33000c5c083963f606b8b4c9c494a7", "score": "0.5706875", "text": "async _generateText(templatePath, context, html) {\n if ('text' in this.options && !this.options.text) {\n return null\n }\n\n const textFilename =\n path.basename(templatePath, path.extname(templatePath)) + '.txt'\n const textPath = path.resolve(path.dirname(templatePath), textFilename)\n\n try {\n await access(textPath, constants.R_OK)\n return this._renderTemplate(textPath, context)\n } catch (err) {\n return htmlToText.fromString(html)\n }\n }", "title": "" }, { "docid": "935aac92c77728015d7c37ef68683933", "score": "0.5695337", "text": "function render(tmpl_name, tmpl_data) {\n\tif ( !render.tmpl_cache ) { \n\t\trender.tmpl_cache = {};\n\t}\n\n\tif ( ! render.tmpl_cache[tmpl_name] ) {\n\t\tvar tmpl_dir = './template';\n\t\tvar tmpl_url = tmpl_dir + '/' + tmpl_name + '.html';\n\n\t\tvar tmpl_string;\n\t\t$.ajax({\n\t\t\turl: tmpl_url,\n\t\t\tmethod: 'GET',\n\t\t\tasync: false,\n\t\t\tsuccess: function(data) {\n\t\t\t\ttmpl_string = data;\n\t\t\t}\n\t\t});\n\n\t\trender.tmpl_cache[tmpl_name] = _.template(tmpl_string);\n\t}\n\n\treturn render.tmpl_cache[tmpl_name](tmpl_data);\n}", "title": "" }, { "docid": "596fcf5734c36cc5d203c70ab9fb6363", "score": "0.5693636", "text": "function render_file(locals, cb) {\n // cached?\n var template = cache[filename];\n if (template) {\n try {\n var res = template(locals, handlebarsOpts)\n self.async.done(function (values) {\n Object.keys(values).forEach(function (id) {\n res = res.replace(id, values[id])\n })\n\n cb(null, res)\n })\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n\n return\n }\n\n fs.readFile(filename, 'utf8', function(err, str){\n if (err) {\n return cb(err);\n }\n\n var template = handlebars.compile(str);\n if (locals.cache) {\n cache[filename] = template;\n }\n\n try {\n var res = template(locals, handlebarsOpts);\n self.async.done(function(values) {\n Object.keys(values).forEach(function(id) {\n res = res.replace(id, values[id]);\n });\n\n cb(null, res);\n });\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n });\n }", "title": "" }, { "docid": "596fcf5734c36cc5d203c70ab9fb6363", "score": "0.5693636", "text": "function render_file(locals, cb) {\n // cached?\n var template = cache[filename];\n if (template) {\n try {\n var res = template(locals, handlebarsOpts)\n self.async.done(function (values) {\n Object.keys(values).forEach(function (id) {\n res = res.replace(id, values[id])\n })\n\n cb(null, res)\n })\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n\n return\n }\n\n fs.readFile(filename, 'utf8', function(err, str){\n if (err) {\n return cb(err);\n }\n\n var template = handlebars.compile(str);\n if (locals.cache) {\n cache[filename] = template;\n }\n\n try {\n var res = template(locals, handlebarsOpts);\n self.async.done(function(values) {\n Object.keys(values).forEach(function(id) {\n res = res.replace(id, values[id]);\n });\n\n cb(null, res);\n });\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n });\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.56881106", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.56881106", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.56881106", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.56881106", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.56881106", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "28548b1fe69482503ef4920dfcfb19f9", "score": "0.5675315", "text": "dorender(ctx) {}", "title": "" }, { "docid": "f199b884799d78c3914ab03d75f5e4d3", "score": "0.56689495", "text": "function subRender(template) {\n\t return self.render(template, context, partials);\n\t }", "title": "" }, { "docid": "30a0f44aa53b6241188c18d3047ed7d2", "score": "0.5667588", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Error(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" } ]
ec1d4a432a2fab84858634ed201d942f
AuthActions.login( React.findDOMNode(this.refs.email).value, React.findDOMNode(this.refs.password).value );
[ { "docid": "b45da42891247f39c87a121ade862609", "score": "0.0", "text": "render() {\n return (\n <div className=\"login-button\">\n <a class=\"btn btn-large btn-info\" href=\"/auth/google\">\n <i class=\"fa fa-google-plus\"></i> Login with Google\n </a>\n </div>\n )\n }", "title": "" } ]
[ { "docid": "1e73a97b5382bd2c369e659dedb30cf8", "score": "0.74668175", "text": "login() {\n this.props.auth.login();\n }", "title": "" }, { "docid": "6b3c8705d1ffbf839951451dd5598ecd", "score": "0.7332176", "text": "render(){\n return(\n <div>\n <form onSubmit={this.login} id=\"login\">\n <label>Email: </label>\n <input type=\"email\" autoFocus placeholder={\"exemplo@gamil.com\"}\n onChange={ event => {this.setState({email: event.target.value})}} />\n \n <label>Senha: </label>\n <input type=\"password\" autoComplete=\"off\" placeholder={\"Sua senha\"} \n onChange={ event => {this.setState({password: event.target.value})}} />\n\n <button type=\"submit\">Entrar</button>\n <Link to=\"/register\">Ainda não possui uma conta?</Link>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "c55ccb7fd80e40e0817639c63e2bcdf3", "score": "0.72926766", "text": "handleSignIn(e) {\n e.preventDefault()\n let username = this.refs.username.value\n let password = this.refs.password.value\n this.props.onSignIn(username, password)\n }", "title": "" }, { "docid": "8b260244aa3373fbc76bead387c15ba8", "score": "0.72430325", "text": "handleSignIn(e) {\n e.preventDefault();\n let username = this.refs.username.value;\n let password = this.refs.password.value;\n this.props.onSignIn(username, password);\n }", "title": "" }, { "docid": "78d9fee5f9ffec2a9d1f8a85fd8114d6", "score": "0.7219176", "text": "onLogin(e, email, password) {\n e.preventDefault();\n this.props.login({ email, password });\n }", "title": "" }, { "docid": "d5bb901711c8d4ac3f6c54a6bbfc0273", "score": "0.71973985", "text": "renderSignIn(){return(\n <div id=\"signIn\">\n <form onSubmit={(e)=>{\n e.preventDefault(); \n this.props.changeUserName(document.getElementById(\"nameInput\").value);\n }}>\n <input id=\"nameInput\" type=\"text\" placeholder=\"Enter a username\" autoFocus/>\n </form>\n </div>)\n }", "title": "" }, { "docid": "4df160e736fdab2aa230367fbade38b9", "score": "0.71020263", "text": "handleLogin(e) {\n //Bind this to _this\n const _this = this;\n\n //Prevent default behaviour of submit button\n e.preventDefault();\n \n //Get form information\n const usernameInput = document.querySelector('#usernameInput');\n const passwordInput = document.querySelector('#passwordInput');\n\n //Get account information\n const username = usernameInput.value;\n const password = passwordInput.value;\n\n const auth = new Authenticator();\n\n auth.authenticate(username, password, function(didSucceed){\n if(didSucceed) {\n _this.props.handleAuth();\n console.log(`${username} logged in`);\n } else {\n //Display error message\n _this.setState({\n error: true\n });\n\n passwordInput.value = '';\n }\n }); \n }", "title": "" }, { "docid": "1ae8aa2352c86d65e0c5105365b837f2", "score": "0.7006805", "text": "goLogIn(e) {\n this.props.logIn(e.target.value);\n }", "title": "" }, { "docid": "5a7f45a3eff77976caa2b237fbbe487e", "score": "0.69983816", "text": "render() {\n return (\n <MDBContainer>\n <MDBRow>\n <MDBCol md=\"6\">\n <form onSubmit={this.handleSubmitForm}>\n <p className=\"h4 text-center mb-4\">Sign in</p>\n <label htmlFor=\"defaultFormLoginEmailEx\" className=\"grey-text\">\n Your email\n </label>\n <input name=\"username\" id=\"defaultFormLoginEmailEx\" className=\"form-control\" type=\"text\" value={this.state.username} onChange={this.handleChangeInForm} />\n <br />\n <label htmlFor=\"defaultFormLoginPasswordEx\" className=\"grey-text\">\n Your password\n </label>\n <input name=\"password\" className=\"form-control\" type=\"password\" id=\"defaultFormLoginPasswordEx\" value={this.state.password} onChange={this.handleChangeInForm} />\n <div className=\"text-center mt-4\">\n <MDBBtn color=\"indigo\" type=\"submit\">Login</MDBBtn>\n </div>\n </form>\n </MDBCol>\n </MDBRow>\n </MDBContainer>\n );\n }", "title": "" }, { "docid": "437e7a3dc9d2688a95d12b57d83ff52a", "score": "0.6967295", "text": "onLoginPressed(e) {\n e.preventDefault()\n this.props.loginSubmitted({\n username:this.state.usernameField.value, password:this.state.passwordField.value\n });\n\n }", "title": "" }, { "docid": "b8e6fadc4423d3f50a43e6034ad4b7e0", "score": "0.6879618", "text": "componentDidMount() {\n // render Blaze accounts form\n // find the <div> in `render()` method and place the Blaze form in that <div>\n this.view = Blaze.render(Template.loginButtons,\n ReactDOM.findDOMNode(this.refs.container));\n }", "title": "" }, { "docid": "fe8ac560544c3762d1551b3b222e79bf", "score": "0.6870789", "text": "render() {\n let fRef = null;\n const { from } = this.props.location.state || { from: { pathname: '/' } };\n // if correct authentication, redirect to page instead of login screen\n if (this.state.redirectToReferer) {\n return <Redirect to={from}/>;\n }\n // Otherwise return the Login form.\n return (\n <Container style={{ marginTop: '2em' }}>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\" inverted>Login to your account</Header>\n <AutoForm ref={ref => { fRef = ref; }} schema={formSchema} onSubmit={data => this.submit(data, fRef)} >\n <Segment>\n <TextField name='email' placeholder='E-mail address' iconLeft='user'/>\n <TextField name='password' type='password' placeholder='Password' iconLeft='lock'/>\n <SubmitField value='Login'/>\n <Button as={NavLink} floated='right' color='teal' exact to='/'>Back to Home Page</Button>\n <ErrorsField/>\n </Segment>\n </AutoForm>\n <Message>\n <Link to=\"/signup\">Click here to Register</Link>\n </Message>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Login was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "title": "" }, { "docid": "8e1858929ff8767680e75703992b9265", "score": "0.68523866", "text": "render() {\n const loginHeader = { paddingTop: '15px', color: 'white', fontSize: '30px', fontFamily: 'Pacifico' };\n const register = { paddingTop: '15px', color: 'white', fontSize: '20px' };\n const { from } = this.props.location.state || { from: { pathname: '/' } };\n // if correct authentication, redirect to page instead of login screen\n if (this.state.redirectToReferer) {\n return <Redirect to={from}/>;\n }\n // Otherwise return the Login form.\n return (\n <Container>\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header textAlign=\"center\" inverted>\n <font style={loginHeader}>Login to Your Account</font>\n </Header>\n <Form onSubmit={this.submit}>\n <Form.Input focus\n // label=\"Email\"\n icon=\"at\"\n iconPosition=\"left\"\n name=\"email\"\n type=\"email\"\n placeholder=\"E-mail\"\n onChange={this.handleChange}\n />\n <Form.Input focus\n // label=\"Password\"\n icon=\"lock\"\n iconPosition=\"left\"\n name=\"password\"\n placeholder=\"Password\"\n type=\"password\"\n onChange={this.handleChange}\n />\n <center><Form.Button basic inverted content=\"Go\"/></center>\n </Form>\n <br/>\n <Divider inverted></Divider>\n <center>\n <font style={register}>Don&#39;t have an Account?</font>\n <br/>\n <div className=\"registerNow\">\n <Button basic inverted icon={'user plus'} content=\"Register Now\" as={NavLink} exact to=\"/signup\">\n </Button>\n </div>\n </center>\n {this.state.error === '' ? (\n ''\n ) : (\n <Message\n error\n header=\"Login was not successful\"\n content={this.state.error}\n />\n )}\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "title": "" }, { "docid": "abee35422f2ef32ec7e22f3f65962df0", "score": "0.6850908", "text": "loginEmail(e) {\n this.setState({\n loginEmail: e.target.value,\n })\n }", "title": "" }, { "docid": "804e8ebbf3d8be5df8d2159d0e122669", "score": "0.6824492", "text": "componentDidMount() {\n // this.inputElement.focus(); //OLD STYLE\n this.inputElementRef.current.focus();\n //current - gives access to current ref\n //current el. stored in this reference\n console.log(this.context.authenticated)\n }", "title": "" }, { "docid": "504c1eb3d91b457a0007777974c6438b", "score": "0.67974067", "text": "handleFormSubmit({ email, password }) {\n // Log user in\n this.props.signinUser({ email, password });\n }", "title": "" }, { "docid": "92936457483d5acd41e1d7ab08f4eba6", "score": "0.6796403", "text": "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h2 className=\"center-align\">Login</h2>\n\t\t\t\t<div className=\"row\" style={{marginTop: \"2.5em\"}}>\n\t\t\t\t\t<div className=\"col s12 m6 offset-m3\">\n\t\t\t\t\t\t<div className=\"card blue-grey lighten-5\">\n\t\t\t\t\t\t\t<div className=\"card-content\">\n\t\t\t\t\t\t\t\t<form onSubmit={this.login}>\n\t\t\t\t\t\t\t\t\t<div className=\"row\" style={{marginBottom: \"0px\"}}>\n\t\t\t\t\t\t\t\t\t\t<div className=\"input-field col s12\" style={{ marginTop: \"0px\" }}>\n\t\t\t\t\t\t\t\t\t\t\t<input \n\t\t\t\t\t\t\t\t\t\t\t\tid=\"username\" \n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\" \n\t\t\t\t\t\t\t\t\t\t\t\tautoCapitalize='false'\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<label htmlFor=\"username\">Username</label>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"input-field col s12\" style={{ marginTop: \"0px\" }}>\n\t\t\t\t\t\t\t\t\t\t\t<input \n\t\t\t\t\t\t\t\t\t\t\t\tid=\"password\" \n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"password\" \n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<label htmlFor=\"password\">Password</label>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div className=\"col s4\">\n\t\t\t\t\t\t\t\t\t\t\t<button className=\"btn waves-effect waves-light\" type=\"submit\" name=\"action\">Log In\n\t\t\t\t\t\t\t\t\t\t\t\t<i className=\"material-icons right\">send</i>\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "0e53bd90746564a0b053831cf825bc45", "score": "0.67377275", "text": "handleSubmit(e) {\n e.preventDefault(); // yay uncontrolled forms!\n\n auth.login(this.refs.email.value, this.refs.password.value).then(res => {\n console.log('login function');\n console.log(res); // console.log(Promise.resolve(res))\n // console.log(res, 'res')\n // console.log('end login')\n // this.props.url.replaceTo('/auth/dashboard')\n }); // .catch(e => console.log(e)) // you would show/hide error messages with component state here\n }", "title": "" }, { "docid": "3f327b74c03550d1a39d83f482b99155", "score": "0.6723968", "text": "handleLogin(event) {\n event.preventDefault();\n this.props.loginCallback(this.state.email, this.state.password);\n }", "title": "" }, { "docid": "38eb3d58681f97caa5dd42ac7c601ca9", "score": "0.6719046", "text": "hSignIn(e) {\n const { signIn } = this.props;\n e.preventDefault();\n const username = this.refs.username.value;\n const password = this.refs.password.value;\n signIn(username, password, this.props);\n }", "title": "" }, { "docid": "3dac3011e5c5b0625905b3ce7dc48cbb", "score": "0.67174643", "text": "handleLogin(event) {\n event.preventDefault();\n this.props.loginCallback(\n this.state.email, this.state.password\n )\n }", "title": "" }, { "docid": "34a7d0626d7cf5e7f35242263592522e", "score": "0.6696304", "text": "render() {\n return (\n <Form onSubmit={this.handleLogin}>\n <fieldset>\n <h3>Please Login</h3>\n <div className=\"formgrid\">\n\n <FormGroup>\n <Input onChange={this.handleFieldChange} type=\"email\"\n id=\"email\"\n placeholder=\"Email address\"\n required=\"\" autoFocus=\"\" />\n </FormGroup>\n\n <FormGroup>\n <Input onChange={this.handleFieldChange} type=\"password\"\n id=\"password\"\n placeholder=\"Password\"\n required=\"\" />\n </FormGroup>\n </div>\n <Button type=\"submit\">\n Sign in\n </Button>\n <p>Not a member yet? <Button type=\"button\" onClick={() => { this.props.history.push(\"/register\") }}>Register New Account</Button></p>\n </fieldset>\n </Form>\n )\n }", "title": "" }, { "docid": "8cc629b8009cd2c416310d44bca238e7", "score": "0.665966", "text": "onLogIn(){\n const{email,password}=this.state;\n LoginUser(email,password);\n }", "title": "" }, { "docid": "23de467df126706e87a14fd32ffa267f", "score": "0.6657377", "text": "render () {\n if (this.state.redirect) {\n return (<Redirect to=\"/\"/>)\n }\n\n return (\n <div className=\"login-container\">\n <form className=\"login-form\" onSubmit={this.handleSubmit}>\n <div className=\"login-title\">Log In\n </div>\n <div className=\"login-credentials\">\n <label className=\"standard-login-label\" htmlFor=\"userName\">User Name</label>\n <input className=\"standard-login-input\" type=\"text\" name=\"userName\" onChange={this.handleChange} value={this.state.user.userName} />\n \n <label className=\"standard-login-label\" htmlFor=\"password\">Password</label>\n <input className=\"standard-login-input\" type=\"password\" name=\"password\" />\n\n <input className=\"login-button\" type=\"submit\" value=\"Log In\"/>\n </div>\n </form>\n </div>\n )\n }", "title": "" }, { "docid": "4dfaeff2c3931b6016c2a63fbbe41b02", "score": "0.66493917", "text": "login(e){\n\t\te.preventDefault();\n\t\tlet vm = this;\n\t\tlet error = false;\n\t\tlet username = ReactDOM.findDOMNode(this.refs.username).value.trim();\n\t\tlet password = ReactDOM.findDOMNode(this.refs.password).value.trim();\n\t\tif (username == \"\" || password == \"\") {\n\t\t\terror = \"Username/Password Missing\"\n\t\t}else{\n\n Meteor.loginWithPassword(username, password, function (err) {\n if (err) {\n vm.setState({\n errors: err.reason\n });\n }\n });\n }\n\t\tif (error) {\n\t\t\tthis.setState({\n\t\t\t\terrors: error\n\t\t\t});\n\t\t} else {\n\t\t\t// reset to nothing if there are no errors\n\t\t\tthis.setState({\n\t\t\t\terrors: \"\"\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "dc7c63861aa5df6c83ac465cbb90cba4", "score": "0.6643753", "text": "login(e) {\n e.preventDefault();\n const {email, password} = this.props;\n let checkLogin = (userCredentials.emailAddress == email && userCredentials.password == password);\n\n if (checkLogin) {\n this.props.dispatch(userLogin(checkLogin));\n } else {\n this.props.dispatch(errorMessage());\n }\n\n }", "title": "" }, { "docid": "d60ca2e245045843a0b3cb85623e3575", "score": "0.6624223", "text": "login() {\n const that = this;\n this.setState({loading: true})\n setTimeout(() => {\n const pw = this.refs.password.value.slice(0,1)[0];\n if (pw === \"s\" || pw === \"S\") {\n that.context.updateUserID(\"Sa871ME92peR91C6X\")\n that.props.history.push(\"/dashboard/student/\")\n } else if (pw === \"c\" || pw === \"C\") {\n that.context.updateUserID(\"Ca871ME92peR91C6X\")\n that.props.history.push(\"/dashboard/organization/\")\n } else {\n that.setState({error: \"Your username or password is incorrect.\", loading: false})\n }\n }, 750)\n }", "title": "" }, { "docid": "8249f153749478472f8d8248eea76061", "score": "0.66206914", "text": "render() {\n \n\n return (\n <div className=\"login-form-container\">\n <form className=\"login-form\">\n <UsernameField \n onChange={this.handleUsernameChange}\n usernameFromLocal={this.usernameFromLocal}\n />\n <PasswordField onChange={this.handlePassswordChange} />\n \n\n <StoreUserCheckbox\n isChecked={this.props.storeUser}\n onChecked={this.props.storeUserToggled}\n />\n <FieldError\n viewError={this.state.viewError}\n serverError={this.props.serverError}\n />\n <div className=\"login-register-buttons\">\n <Button\n action={this.onLoginPressed}\n title=\"Sign In\"\n disabled={this.props.loginDisabled}\n />\n\n <Link to=\"register\">Create Account</Link>\n </div>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "54754284be81bb96bcf5fc4c42916101", "score": "0.6618355", "text": "componentDidMount() {\n // Render thethe b blaze accounts for then find the div we just rendered in the\n // render method and place the blaze accounts form in that div\n\n // this.view is a reference to hold the render return.it makes it easier cleaning up\n // Template.loginButtons - just taking forms that exist and rendering the template to\n // the reactdom node\n this.view = Blaze.render(Template.loginButtons,\n ReactDOM.findDOMNode(this.refs.container));\n }", "title": "" }, { "docid": "90e0f15492ef6f8c46911852a00d1ad3", "score": "0.6617051", "text": "loginToApp(values) {\n const { dispatch } = this.props;\n\n if (values) {\n if (values.email && values.password) {\n dispatch(authActions.login(values));\n }\n }\n }", "title": "" }, { "docid": "4e6689ec7f49dcc2c31890fe462dd56c", "score": "0.65829146", "text": "render(){\n return(\n <Provider store = { store}>\n \n <div className='contain'>\n \n {/*} <Input\n placeholder=\"Enter your username\"\n prefix={<Icon type=\"user\" style={{ color: 'rgba(0,0,0,.25)' }} />}\n \n value={this.state.userName}\n onChange={this.onChangeUserName.bind(this)}\n ref={node => this.userNameInput = node}\n />\n <br/>\n\n \n <Input\n placeholder=\"Enter your password\"\n prefix={<Icon type=\"user\" style={{ color: 'rgba(0,0,0,.25)' }} />}\n \n value={this.state.password}\n onChange={this.onChangePassword.bind(this)}\n \n />\n\n <br/>*/}\n\n <Button onClick={this.login.bind(this)}>登陆</Button>\n\n\n <Test />\n\n </div>\n </Provider>\n )\n }", "title": "" }, { "docid": "fd5b628e5fa7501f58bfa37b43f27e98", "score": "0.6568855", "text": "render() {\n var alert;\n // If login failed\n if (this.state.error){\n alert = (\n <Alert bsStyle='danger'>\n <strong>Error: </strong> Wrong email or password\n </Alert>\n );\n }\n else{\n alert = <span></span>\n }\n\n return (\n <Col md={4} mdOffset={4}>\n <h3>Login</h3>\n {alert}\n <form id=\"loginForm\" onSubmit={this.handleSubmit}>\n <div class=\"form-group\">\n <input class=\"form-control\" type=\"text\" placeholder=\"Email\" onChange={evt => this.email = evt.target.value} />\n </div>\n <div class=\"form-group\">\n <input class=\"form-control\" type=\"password\" placeholder=\"password\" onChange={evt => this.password = evt.target.value}/>\n </div>\n <div class=\"form-group\">\n <input class=\"btn btn-primary\" id=\"loginBtn\" type=\"submit\" value=\"Login\" />\n </div>\n </form>\n </Col>\n );\n }", "title": "" }, { "docid": "a1accc5de800070aff4893e82fdc9758", "score": "0.65687746", "text": "render() {\n const { cookies } = this.props;\n // if user is already logged in, disable access to login page\n if (cookies.get('user') && cookies.get('key')) {\n return <Redirect to=\"/\" />;\n }\n // our form\n return (\n <div style={{ paddingLeft: '5px' }}>\n <form onSubmit={this.hSignIn.bind(this)}>\n <h3>Sign in</h3>\n <input type=\"text\" ref=\"username\" placeholder=\"Username\" />\n <br />\n <input type=\"password\" ref=\"password\" placeholder=\"Password\" />\n <br />\n <input type=\"submit\" value=\"Login\" className=\"link-button\" />\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "1ec102a57763facbd52729ab977bdab8", "score": "0.6554664", "text": "onLoginClick(){\n this.props.onLoginClick();\n }", "title": "" }, { "docid": "1d214ca6dfc5c4b2868cbf03b7ffc62c", "score": "0.6553441", "text": "function Login() {\n return (\n <Container>\n <div id=\"loginContainer\">\n <div className=\"outside cell medium-3 medium-cell-block center\">\n </div>\n <div id=\"login-center\" className=\"cell medium-6 medium-cell-block center\">\n <form>\n <div className=\"sign-in-form\">\n <h4 className=\"text-center\">Login</h4>\n <label for=\"sign-in-form-username\">Username</label>\n <input type=\"text\" className=\"sign-in-form-username\" id=\"sign-in-form-username\"></input>\n <label for=\"sign-in-form-password\">Password</label>\n <input type=\"text\" className=\"sign-in-form-password\" id=\"sign-in-form-password\"></input>\n <button type=\"submit\" className=\"sign-in-form-button\">Sign In</button>\n <br/>\n <br/>\n <p><a href=\"/signup\">No Account? Click Here To Sign Up!</a></p>\n </div>\n </form>\n </div>\n <div className=\"cell medium-3 medium-cell-block center\">\n </div>\n </div>\n </Container>\n )\n}", "title": "" }, { "docid": "4a0ad57f53d7e0d08edd57d7e4932607", "score": "0.6546058", "text": "render() {\n return (\n <div className = \"login\"> \n <h1>Login</h1>\n <div className = \"container\">\n {/*<ShowInvalidCredentials hasLoginFailed = {this.state.hasLoginFailed}/> */}\n {/*<ShowLoginSuccessMessage showSuccessMessage = {this.state.showSuccessMessage}/> */}\n {this.state.hasLoginFailed && <div className = \"alert alert-warning\">Invalid Credentials!</div>}\n {this.state.showSuccessMessage && <div>Login Success!</div>}\n User Name<input type =\"text\" name = \"username\" value = {this.state.username} \n onChange = {this.handleChange}/>\n Password<input type =\"password\" name = \"password\" value = {this.state.password}\n onChange = {this.handleChange}/>\n <button className = \"btn btn-success\" onClick = {this.loginClicked} >Login</button>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "e48c011ebc840852f97f559d445b446c", "score": "0.6544384", "text": "componentDidMount() {\n this.emailInputRef.current.focus();\n }", "title": "" }, { "docid": "a68ea86833f83000a42cbfda59749f62", "score": "0.65314174", "text": "componentDidMount() {\n AuthService.tryLogin();\n }", "title": "" }, { "docid": "36a4855b6d53626a2cbd3f882bdddc7e", "score": "0.65252143", "text": "logInSubmit(username, password, loggedIn) {\n this.props.dispatch(login(username, password, loggedIn));\n this.setState({username: username});\n console.log(\"this is the logged username \" + username);\n }", "title": "" }, { "docid": "9bd0169d67431f5fd784b233d9cc3c74", "score": "0.6521955", "text": "@autobind\n _onFormSubmit() {\n const { loginUser } = this.props;\n const { username, password } = this.state;\n if (loginUser) loginUser(username, password);\n }", "title": "" }, { "docid": "18fc7acb7cc2106c7dc99be8e2170cba", "score": "0.65188545", "text": "componentDidMount() {\n this.props.getUser();\n }", "title": "" }, { "docid": "1357916da2a8a494b26f8f03df56f73a", "score": "0.6506989", "text": "render(){\r\n\r\n return(\r\n this.props.currentUser ? (\r\n <div className=\"bigDiv\">\r\n <p>Logged In!</p>\r\n <p>Username: {this.props.currentUser}</p>\r\n <input type=\"submit\" name=\"logout\" placeholder=\"logout\" value=\"Logout\"\r\n onClick={this.props.logoutUser}></input>\r\n </div>) : ( <div className=\"bigDiv\"><div className=\"stack\"><input\r\n type=\"text\"\r\n name=\"userName\"\r\n placeholder=\"userName\"\r\n onChange={(event) => this.props.updateNameInput(event.target.value)}>\r\n </input>\r\n <input\r\n type=\"password\"\r\n name=\"password\"\r\n placeholder=\"password\"\r\n onChange={(event) => this.props.updatePassInput(event.target.value)}>\r\n </input>\r\n <input type=\"submit\"\r\n name=\"submit\"\r\n placeholder=\"submit\" \r\n onClick={this.props.loginUser}></input>\r\n </div>\r\n <p>{this.props.nameInput}</p>\r\n <p>{this.props.passInput}</p>\r\n <p>{this.props.tryAgain ? \"Try again\" : \"\"}</p>\r\n <p>{this.props.users}</p>\r\n </div>)\r\n );\r\n }", "title": "" }, { "docid": "1c957e8d27e60158be0f27e934b988ab", "score": "0.6501206", "text": "componentDidMount() {\n // this.inputElementRef.focus();\n this.inputElementRef.current.focus();\n console.log(this.context.authenticated);// to get context into componentDidMount hook then use like this \n }", "title": "" }, { "docid": "861502fd7638145187482a4d180b461d", "score": "0.6500347", "text": "render() {\n /* Get the previous page that was loaded so we can redirect to it once logged in */\n const { from } = this.props.location.state || { from: { pathname: '/' }};\n const { loggingIn, authenticated, error } = this.state;\n\n /* Redirect the user to either their previous location (if from a private route), or to home. */\n if ( authenticated ) {\n return <Redirect to={from} />;\n }\n\n /* Render the login form and any errors that may have occured */\n return (\n <Container className=\"login\">\n {( error ) && <Error>{error}</Error>}\n <Form onSubmit={this.handleSubmit}>\n <Input\n type=\"text\"\n placeholder=\"Email\"\n name=\"username\"\n required\n />\n <Input\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n required\n />\n <Button type=\"default\" submit disabled={loggingIn} loading={loggingIn}>\n {( loggingIn ) ? 'Logging in...' : 'Login'}\n </Button>\n </Form>\n </Container>\n );\n }", "title": "" }, { "docid": "96c4117c543ee05ee12029e67f8728c3", "score": "0.6479118", "text": "render() {\n return (\n <div>\n <h1>Login Page</h1>\n \n <LoginForm submit={this.submit}/> \n </div>\n\n );\n }", "title": "" }, { "docid": "0ea8c5327d5601ee7a5557aac7e5465f", "score": "0.6477253", "text": "login(e){\r\n e.preventDefault()\r\n this.setState({ login: true });\r\n }", "title": "" }, { "docid": "0b74faf46282d1e31939a349dff19e0f", "score": "0.64711875", "text": "render() {\n if (!this.isLogedIn) {\n return (\n <div>\n <form className=\"Login\">\n <div className=\"LoginInputArea\">\n <div>\n <h2>Loggin in</h2>\n </div>\n <div id=\"usernameInput\">\n <label id=\"UILable\" htmlFor=\"username\">\n Username:{\" \"}\n </label>\n <input\n name=\"username\"\n id=\"UIinput\"\n type=\"text\"\n value={this.state.UserUserName}\n onChange={this.handleUsernameChange}\n />\n </div>\n <div id=\"passwordInput\">\n <label id=\"UPLable\" htmlFor=\"password\">\n Password:{\" \"}\n </label>\n <input\n id=\"UPinput\"\n name=\"password\"\n type=\"password\"\n value={this.state.UserPassword}\n onChange={this.handlePasswordChange}\n />\n </div>\n </div>\n <div id=\"SubmitArea\">\n <button id=\"SubBtn\" type=\"button\" onClick={this.authenticate}>\n Login\n </button>\n </div>\n </form>\n </div>\n );\n } else {\n return <App />;\n }\n }", "title": "" }, { "docid": "187274d3c4aded3fcbd6e6fa7a79e22e", "score": "0.64657795", "text": "loginInputHandler(event) {\n this.setState({login: event.target.value})\n }", "title": "" }, { "docid": "0d984a8e87412f325072a375c9f11a6b", "score": "0.6448691", "text": "render () {\n return (\n <Form horizontal onSubmit={this.submitLoginForm} className=\"container login\">\n <h3 className=\"login_title\">Enter Your Username and Password:</h3>\n <FormGroup>\n <Col componentClass={ControlLabel} sm={2}>\n Username\n </Col>\n <Col sm={10}>\n <FormControl id=\"username\" type=\"email\" placeholder=\"Username\" value={this.state.username} onChange={this.changeHandler} />\n </Col>\n </FormGroup>\n\n <FormGroup controlId=\"password\">\n <Col componentClass={ControlLabel} sm={2}>\n Password\n </Col>\n <Col sm={10}>\n <FormControl type=\"password\" placeholder=\"Password\" value={this.state.password} onChange={this.changeHandler} />\n </Col>\n </FormGroup>\n\n <FormGroup>\n <Col smOffset={2} sm={10}>\n <Button bsStyle=\"primary\" type=\"submit\">\n Login\n </Button>\n </Col>\n </FormGroup>\n </Form>\n );\n }", "title": "" }, { "docid": "6b921e4725ba70a2d43eaa95ff21255b", "score": "0.6425539", "text": "render() {\r\n return (\r\n <Container className=\"login\">\r\n <Helmet>\r\n <title>Login</title>\r\n <meta name=\"login\" content=\"Login Page\" />\r\n </Helmet> \r\n <Row className=\"show-grid\">\r\n <Col xs={12} md={12}>\r\n <a href=\"/\"><img src={logo} className=\"logo align-top\"/></a>\r\n <h2>Sign In</h2>\r\n </Col>\r\n </Row>\r\n <Row className=\"justify-content-md-center\">\r\n <Col xs={12} md={6}>\r\n <Form id=\"form\" onSubmit={this.onSubmit} >\r\n <FormGroup>\r\n <Label className=\"email\" id=\"email\" >Email</Label>\r\n <Input type=\"email\" placeholder=\"Email\" value={this.state.email} onChange={this.onChangeEmail}></Input>\r\n </FormGroup>\r\n <FormGroup>\r\n <Label className=\"password\" id=\"password\">Password</Label>\r\n <Input type=\"password\" placeholder=\"Password\" value={this.state.password} onChange={this.onChangePassword}></Input>\r\n </FormGroup>\r\n <Button className=\"btn-light btn-block\" onSubmit={this.onSubmit} >Log in</Button>\r\n <div>\r\n <a href=\"/register\" className=\"link\"> Sign up</a>\r\n <span className=\"p-2\">|</span>\r\n <a href=\"/forgot-password\" className=\"link\">Forgot Password</a>\r\n </div>\r\n </Form>\r\n </Col>\r\n </Row>\r\n </Container>\r\n )\r\n }", "title": "" }, { "docid": "7c761962a6a3bc88a755cc2b4599f40d", "score": "0.6421291", "text": "render() {\n const {submitHandler, changeHandler} = this;\n const {userId, password} = this.state;\n return (\n // The loginForm div\n <div className=\"Login\"> \n <form onSubmit={submitHandler}>\n <fieldset>\n {/* Form legend */}\n <legend>\n Sign in\n </legend>\n\n {/* Form input for user name */}\n <div className=\"Login-input\">\n <label htmlFor=\"formLoginUserName\">\n User Id\n </label>\n <input type=\"text\" name=\"userId\" id=\"formLoginUserName\" \n value={userId} onChange={changeHandler} required></input>\n </div>\n \n {/* Form input for password */}\n <div className=\"Login-input\">\n <label htmlFor=\"formLoginPassword\">\n Password\n </label>\n <input type=\"password\" name=\"password\" id=\"formLoginPassword\" \n value={password} onChange={changeHandler} required></input>\n </div>\n \n {/* This button will submit the form */}\n <Button type=\"submit\" variant=\"contained\" aria-label=\"Sign in\">\n Sign in\n </Button>\n\n <NavLink to='/createAccount' style={{textDecoration: 'none'}}>\n <Button variant=\"contained\" className=\"LoginNewAccount\" \n aria-label=\"Create account\">\n Create Account\n </Button>\n </NavLink>\n\n </fieldset>\n </form>\n\n \n </div>\n );\n }", "title": "" }, { "docid": "61f2905e0838b3ed2a51fba656f6cf28", "score": "0.6419939", "text": "render() {\n return (\n <div className=\"login\">\n <Navbar login={false}/>\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-sm-12\">\n\n <Headline>Login</Headline>\n Don't have an account? <a href=\"/register\">Click here to register</a>.\n <div class=\"container\" style={{ 'width': '40%'}}>\n <form action=\"\" method=\"POST\">\n <div class=\"row\">\n <div class=\"col-sm-4\">Username</div>\n <div class=\"col-sm-8\"><input type=\"text\" name=\"email\" /></div>\n <div class=\"col-sm-4\">Password</div>\n <div class=\"col-sm-8\"><input type=\"password\" name=\"password\" /></div>\n <div class=\"col-sm-6\"><button class=\"btn btn-secondary\" type=\"reset\">Reset</button></div>\n <div class=\"col-sm-6\"><button class=\"btn btn-primary\" type=\"submit\">Login</button></div>\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "cd3230c9d270b9f0930d215054df68fc", "score": "0.6416967", "text": "login(){\n const value = this._form.getValue();\n if(value != null){\n this.setState({\n username: value.username,\n password: value.password\n })\n const requestOptions = {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ username : value.username , password : value.password })\n };\n fetch('http://' + IP + '/gogoapp/login_mobile', requestOptions)\n .then(response => response.json())\n .then(data => this.isAuthenticated(data))\n .catch((error) =>{\n this.setState({connectionState: true});\n });\n }\n }", "title": "" }, { "docid": "4cf8a98111aa02c09ea38b301a3aac38", "score": "0.6413566", "text": "render() {\n return (\n <React.Fragment>\n <div className=\"div\">\n <h2 className=\"content welcome\">Welcome to GrassApp</h2>\n <form onSubmit={this.handleLogin} className=\"content\">\n <h1 className=\"h3 mb-3 font-weight-normal\">Please sign in</h1>\n <div className=\"form-group\">\n <label htmlFor=\"userName\">\n User Name\n </label>\n <input onChange={this.handleFieldChange} type=\"userName\"\n id=\"userName\"\n placeholder=\"user Name\"\n required=\"\" autoFocus=\"\" />\n </div>\n <div className=\"form-group\">\n <label htmlFor=\"password\">\n Password\n </label>\n <input onChange={this.handleFieldChange} type=\"password\"\n id=\"password\"\n placeholder=\"password\"\n required=\"\" />\n </div>\n <button type=\"submit\" className=\"btn btn-primary\"\n onClick={() => this.handleLogin}>\n Sign in\n </button>\n </form>\n </div>\n </React.Fragment>\n )\n }", "title": "" }, { "docid": "61be8ce1599504ae8cf70d3f7bcdff07", "score": "0.6407297", "text": "render() {\n // if (localStorage.getItem('email')!= null) {return <Redirect to=\"/my-account\" push={true} />}\n if (this.props.loginSuccess) {return <Redirect to=\"/my-account\" push={true} />}\n if (this.props.user) {return <Redirect to=\"/\" push={true} />}\n\n return (\n\n <div className=\"LoginPage\">\n <div className=\"container\">\n <div className=\"col-md-6 col-md-offset-3 col-xs-12\">\n <div className=\"panel panel-default login-container\">\n <div className=\"panel-body\">\n <h3 className=\"text-center\">Login</h3>\n <form>\n <label>Login</label>\n <input required onChange={this.handleChangeLogin} className=\"form-control\" type=\"email\" placeholder=\"your email here...\" />\n <br />\n <label>Password</label>\n <input required onChange={this.handleChangePassword} className=\"form-control\" type=\"password\" placeholder=\"your password here...\" />\n <br />\n <button onClick={this.submitLoginForm} className=\"btn btn-primary form-control\">LOGIN</button>\n {this.state.errorMessage && <h6 className=\"text-danger text-center\">Error - wrong mail or password</h6>}\n\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "6cd0060b62ab04b305898ec882c1f5c1", "score": "0.6407247", "text": "render() {\n return (\n <div className=\"p-5\">\n <Form>\n <Form.Group controlId=\"formUsername\">\n <Form.Label>Username</Form.Label>\n <Form.Control type=\"username\" name=\"username\" placeholder=\"Introduz username\"\n onChange={this.onChange} value={this.state.username} required />\n </Form.Group>\n\n <Form.Group controlId=\"formPassword\">\n <Form.Label>Password</Form.Label>\n <Form.Control type=\"password\" name=\"password\" placeholder=\"Introduz password\"\n onChange={this.onChange} value={this.state.password} required />\n </Form.Group>\n \n <Button variant=\"primary\" className=\"mt-2\" onClick={this.handleLogin}>\n Login\n </Button>\n\n </Form>\n\n <Link to=\"/register\">Não estás registado? Carrega aqui.</Link>\n\n </div>\n\n );\n }", "title": "" }, { "docid": "eb441d2f44bc972b18796790636b2883", "score": "0.63961107", "text": "render() {\n return (\n <form onSubmit={this.handleSubmit}>\n <Title title=\"Login\"/>\n <TextField onChange={this.handleChange} name=\"name\" placeholder=\"Username\"/>\n <TextField onChange={this.handleChange} type=\"password\" name=\"password\" placeholder=\"Password\"/>\n <Button type=\"submit\" text=\"Let me in.\"/>\n {this.props.isWaitingForServer&&<p style={{color:'white'}}>Loading...</p>}\n {this.props.error&&<h5 style={{color:'red'}}>You have entered an invalid username or password...</h5>}\n\n </form>\n );\n }", "title": "" }, { "docid": "2310a8b9ffbb6e4bfdf419e36baf311a", "score": "0.6390991", "text": "componentDidMount() {\n this.authenticateUser();\n }", "title": "" }, { "docid": "014ea134e8bed80c1e19f460fe7b3626", "score": "0.63755137", "text": "submitDemoUser(e) {\n e.preventDefault();\n const { login } = this.props;\n this.setState({\n email: 'DemoUser@DemoUser.com',\n password: '123456',\n // dispatches a thunk action with the state in it\n }, () => login(this.state));\n }", "title": "" }, { "docid": "927fc8588a0eb9b320093a2f41c3ca0a", "score": "0.6373854", "text": "render() {\n if (this.state.authenticated===1 && this.state.redirect) {\n return <Redirect to='/home'/>;\n }\n return (\n <Row className=\"login-content\">\n <Col className=\"login-content-col\" xs={10} xsOffset={1}>\n <Row className=\"login-form\">\n <Col xs={10} xsOffset={1}>\n <Form horizontal>\n <FormGroup controlId=\"formHorizontalEmail\">\n <Col componentClass={ControlLabel} sm={4}>\n Sähköpostiosoite\n </Col>\n <Col sm={8}>\n <FormControl name=\"email\"\n type=\"email\"\n placeholder=\"buns@neighborfood.fi\"\n value={this.state.email}\n onChange={e => this.change(e)}/>\n </Col>\n </FormGroup>\n\n <FormGroup controlId=\"formHorizontalPassword\">\n <Col componentClass={ControlLabel} sm={4}>\n Salasana\n </Col>\n <Col sm={8}>\n <FormControl name=\"password\"\n type=\"password\"\n placeholder=\"********\"\n value={this.state.password}\n onChange={e => this.change(e)}/>\n </Col>\n </FormGroup>\n\n <FormGroup>\n <Col componentClass={ControlLabel} sm={12}>\n <Button type=\"submit\" onClick={this.verify}>\n Kirjaudu\n </Button>\n </Col>\n </FormGroup>\n </Form>\n {this.state.authenticated===2 ? <p>Käyttäjätunnus tai salasana väärin, yritä uudestaan!</p> : null}\n </Col>\n </Row>\n </Col>\n </Row>\n )\n\n }", "title": "" }, { "docid": "130775bcf0f0b21fde9cac8ab3e6736f", "score": "0.6372932", "text": "render() {\n return (\n <div className=\"row\">\n <div className=\"col s12\">\n <div className=\"row\"> \n <div className=\"input-field col s6\">\n <input id=\"login_password\" type=\"password\" className=\"validate\"/>\n <label for=\"login_password\">رمز عبور</label>\n </div>\n <div className=\"input-field col s6\">\n <input id=\"login_userName\" type=\"text\" className=\"validate\"/>\n <label for=\"login_userName\">نام کاربری</label>\n </div> \n </div>\n <div className=\"row\">\n <button onClick={this.login} className=\"btn waves-effect waves-light\" type=\"button\" >ورود\n </button>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "23d6a44daa37c33086153c7eec2188dc", "score": "0.6365511", "text": "render() {\n return(\n <div>\n <h2>Login</h2>\n <form onSubmit={this.handleEvent}>\n <label>Email\n <input type='text' name='email' required/>\n </label>\n <label>Password\n <input type='text' name='password'required/>\n </label>\n <input type='submit' value='Sign In'/> \n </form>\n <button onClick={ () => this.nextPath(Routes.register)}>Sign Up</button>\n </div>\n )\n }", "title": "" }, { "docid": "581bf62d6a31cb9b90379e5c60e08587", "score": "0.63628685", "text": "render() {\n return (\n <div className=\"vertical-container-centered full-center\">\n <UserForm\n setCredentials={this.props.setCredentials}\n toggleRegister={this.props.toggleRegister}\n />\n </div>\n );\n }", "title": "" }, { "docid": "8b948a8bf2e480a375200d5d48a304dd", "score": "0.6362566", "text": "render() {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{/* Display Login fields */}\n\t\t\t\t<div className='flex-container'>\n\t\t\t\t\t<div className='login-container container'>\n\t\t\t\t\t\t<h1>Login to QKart</h1>\n\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tclassName='input-field'\n\t\t\t\t\t\t\tprefix={<UserOutlined className='site-form-item-icon' />}\n\t\t\t\t\t\t\tplaceholder='Username'\n\t\t\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\t\tusername: e.target.value,\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<Input.Password\n\t\t\t\t\t\t\tclassName='input-field'\n\t\t\t\t\t\t\tprefix={<LockOutlined className='site-form-item-icon' />}\n\t\t\t\t\t\t\tplaceholder='Password'\n\t\t\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\t\tpassword: e.target.value,\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<Button\n\t\t\t\t\t\t\tloading={this.state.loading}\n\t\t\t\t\t\t\ttype='primary'\n\t\t\t\t\t\t\tonClick={this.login}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tLogin\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</React.Fragment>\n\t\t)\n\t}", "title": "" }, { "docid": "56f92bf7daf596194ab1c5c6919c19c6", "score": "0.6360569", "text": "temporaryFacebookLogin() {\n fbAuth(result => {\n Actions.registerPassword({email: this.state.email});\n }, error => console.log(error));\n }", "title": "" }, { "docid": "42022c497b4326f31da01b719635211b", "score": "0.63421774", "text": "render(){\n <div>\n <form>\n <input type=\"text\" placeholder=\"Email\" />\n </form>\n </div>\n }", "title": "" }, { "docid": "96843c07906a71c067add78329ff3bcf", "score": "0.63409483", "text": "render() {\n return (\n <div className=\"App\">\n <div className=\"App-header\">\n <input type=\"text\" placeholder=\"UserName\" onChange={e => this.handleNameChange(e.target.value)} />\n <input type=\"password\" placeholder=\"User Password\" onChange={e => this.handlePasswordChange(e.target.value)} />\n <button onClick={this.handleClick}>Login</button>\n </div>\n\n </div>\n );\n }", "title": "" }, { "docid": "1dab2631ca676c5f1088808a2f01a04e", "score": "0.6339093", "text": "function LoginForm(props) {\n // Updates the state with the inputted values from the log-in form\n function update(ev) {\n let tgt = $(ev.target);\n let data = {};\n data[tgt.attr('name')] = tgt.val();\n props.dispatch({\n type: 'UPDATE_LOGIN_FORM',\n data: data,\n });\n }\n\n // Sends a request with the values from the log-in form to create a token\n function create_token(ev) {\n api.submit_login(props.login);\n }\n\n // Toggles the registration form\n function toggle() {\n $(\"#registration\").show();\n $(\"#login\").hide();\n }\n\n return (\n <React.Fragment>\n <div className=\"header\">\n {/* Image source: https://www.shareicon.net/transport-flight-aeroplane-airplane-airport-transportation-travel-plane-824400 */}\n <img src=\"/images/airplane-icon.png\" alt=\"logo\" />\n <h1>TRAVELPAL</h1>\n </div>\n <AlertMessage />\n <RegistrationForm />\n <div className=\"container\" id=\"login\">\n <FormGroup>\n <Input type=\"text\" className=\"form-control\" name=\"username\"\n placeholder=\"username\" required=\"\" autoFocus=\"\"\n value={props.login.username} onChange={update} />\n <Input type=\"password\" className=\"form-control\" name=\"password\"\n placeholder=\"password\" required=\"\"\n value={props.login.password} onChange={update} />\n <Button className=\"btn btn-lg btn-primary btn-block\"\n onClick={create_token}>\n LOG IN\n </Button>\n <br />\n <p>Don't have an account? Register <a href=\"javascript:void(0)\"\n onClick={toggle}>here</a>.</p>\n </FormGroup>\n </div>\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "1b06cae37b44127aae238d7aef11dcfe", "score": "0.63386786", "text": "componentDidMount() {\n this.auth();\n }", "title": "" }, { "docid": "ed6a703997928bbfef2668e0ed03ed37", "score": "0.6337245", "text": "async login() {\n if (this.props.dumb) {\n throw new Error('You cannot call `login` on a dumb component');\n }\n const user = await this.oidc.signinPopup();\n if (user) {\n this.setState({\n profile: user.profile,\n });\n }\n }", "title": "" }, { "docid": "9abd1c05fba1f91e6d9885da6c76d3a4", "score": "0.6336333", "text": "render() {\n let { loggedInUser, email, password } = this.state;\n return (\n <div className=\"form-container done\">\n <div className=\"login-form\">\n <h3>Auth w/ Bcrypt</h3>\n <div>\n <input\n value={email}\n onChange={e => this.setState({ email: e.target.value })}\n type=\"text\"\n placeholder=\"Email\"\n />\n </div>\n <div>\n <input\n value={password}\n type=\"password\"\n onChange={e => this.setState({ password: e.target.value })}\n placeholder=\"password\"\n />\n </div>\n {loggedInUser.email ? (\n <button onClick={() => this.logout()}>Logout</button>\n ) : (\n <button onClick={() => this.login()}>Login</button>\n )}\n <button onClick={() => this.signup()}>Sign up</button>\n </div>\n\n <hr />\n\n <h4>Status: {loggedInUser.email ? 'Logged In' : 'Logged Out'}</h4>\n <h4>User Data:</h4>\n <p> {loggedInUser.email ? JSON.stringify(loggedInUser) : 'No User'} </p>\n <br />\n </div>\n );\n }", "title": "" }, { "docid": "ab42995818a7a1b171898460e9c8a62b", "score": "0.6334655", "text": "render() {\n return (\n <div className=\"container\">\n <div className=\"left\">\n <div className=\"inner\">\n <div className=\"logo\">Login</div>\n\n <Form className=\"form-elem\">\n <Alert variant={this.state.variant} show={this.state.showSuccess}>\n {this.state.text}\n </Alert>\n\n <Form.Group controlId=\"formBasicUsername\">\n <Form.Label>Username</Form.Label>\n <Form.Control type=\"username\" placeholder=\"\"\n value={this.state.username} onChange={this.inputUserName} />\n </Form.Group>\n\n <Form.Group controlId=\"formBasicPassword\">\n <Form.Label>Password</Form.Label>\n <Form.Control type=\"password\" placeholder=\"\"\n value={this.state.password} onChange={this.inputPassword} />\n </Form.Group>\n\n <Form.Group controlId=\"formBasicCheckbox\">\n <Form.Check type=\"checkbox\" label=\"save password\" />\n </Form.Group>\n\n <Button className=\"btn\" variant=\"primary\" onClick={this.authentication}>\n Login\n </Button>\n <div className=\"registerLink\">\n <a href=\"/\">do not have an account yet? Register</a>\n </div>\n </Form>\n </div>\n </div>\n <div className=\"right\">\n <img src={imge} className=\"imge\" alt=\"\" />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "ba58b3349ebe8ecd79106d4bf7063259", "score": "0.63343257", "text": "function Login() {\n return (\n <div className=\"login-background\">\n <Nav />\n <div className=\"login-wrapper\">\n <form action=\"\" className=\"form\" >\n <img src=\"images/avatar.png\" alt=\"Logo\" />\n <h2>Login</h2>\n <div className=\"input-group\">\n <input type=\"text\" name=\"loginUser\" id=\"loginUser\" required />\n <label for=\"loginUser\">User Name</label>\n </div>\n <div className=\"input-group\">\n <input type=\"password\" name=\"loginPassword\" id=\"loginPassword\" required />\n <label for=\"loginPassword\">Password</label>\n </div>\n <input type=\"submit\" value=\"Login\" className=\"submit-btn\" />\n <a href=\"#forgot-pw\" className=\"forgot-pw\">Forgot Password?</a>\n </form>\n\n <div id=\"forgot-pw\">\n <form action=\"\" className=\"form\" >\n <a href=\"./login\" className=\"close\">&times;</a> \n <h2>Reset Password</h2>\n <div className=\"input-group\">\n <input type=\"email\" name=\"email\" id=\"email\" required />\n <label for=\"email\">Email</label>\n </div>\n <input type=\"submit\" value=\"Submit\" class=\"submit-btn\" /> \n </form> \n </div>\n </div> \n </div>\n);\n\n}", "title": "" }, { "docid": "153f7d936b1c01a2bc95798818ace279", "score": "0.6324776", "text": "demoLogin(e) {\n e.preventDefault();\n\n const { login } = this.props;\n\n const handleInput = document.getElementById('login-handle');\n const passwordInput = document.getElementById('login-password');\n\n const demoHandle = \"HarmonyDemoUser\";\n const demoPassword = \"12345678\";\n\n let handleIndex = 0;\n let passwordIndex = 0;\n\n const typePassword = () => {\n if (passwordIndex <= demoPassword.length) {\n passwordInput.value = demoPassword.substr(0, passwordIndex ++);\n setTimeout(() => typePassword(), 50);\n } else {\n setTimeout(() => login({\n handle: 'HarmonyDemoUser',\n password: '12345678'\n }), 1)\n }\n }\n\n const typeHandle = () => {\n if (handleIndex <= demoHandle.length) {\n handleInput.value = demoHandle.substr(0, handleIndex++);\n setTimeout(() => typeHandle(), 75);\n } else {\n typePassword()\n }\n }\n\n typeHandle();\n \n }", "title": "" }, { "docid": "310d094f7af61e35693ce1661c9c87f3", "score": "0.6323915", "text": "componentDidMount() {\n document.addEventListener('keyup', this.loginOnEnterKey);\n if (navigator.credentials && navigator.credentials.preventSilentAccess) {\n //this.loginUsingStoredCred();\n }\n }", "title": "" }, { "docid": "8fd6380ff026816d83fc6fab44d15dbd", "score": "0.6306887", "text": "renderCurrentState() {\n return (\n <View style={styles.form}>\n <Input\n placeholder='Enter your username...'\n label='Username'\n onChangeText={email => this.setState({ email })}\n value={this.state.email}\n />\n <Input\n placeholder='Enter your password...'\n label='Password'\n secureTextEntry\n onChangeText={password => this.setState({ password })}\n value={this.state.password}\n />\n\n <Button onPress={this.loginPressed}>Login</Button>\n <Button onPress={() => this.props.navigation.navigate('Home')}>Home</Button>\n <Text>{this.state.error}</Text>\n </View>\n )\n }", "title": "" }, { "docid": "4214193f6d5a257a1770b1cc8ce2b0ae", "score": "0.6303824", "text": "onLogin() {\n if (this.state.userName === 'Admin' && this.state.Password === 'Admin') {\n this.setState({ userName: '', Password: '' });\n this.PushToHome();\n }\n }", "title": "" }, { "docid": "526731f22c465a87ebc86fcb6e6dc2a3", "score": "0.630143", "text": "render() {\n const { redirect } = this.state;\n if (redirect) {\n return <Redirect to='/assessment' userName={this.state.userName}/>;\n }\n return (\n <div>\n <MuiThemeProvider>\n <div>\n <AppBar\n title=\"Login\"\n />\n <TextField\n hintText=\"Enter your Username\"\n floatingLabelText=\"Username\"\n onChange = {(event,newValue) => this.setState({userName:newValue})}\n />\n <br/>\n <TextField\n type=\"password\"\n hintText=\"Enter your Password\"\n floatingLabelText=\"Password\"\n onChange = {(event,newValue) => this.setState({password:newValue})}\n />\n <br/>\n <RaisedButton label=\"Submit\" primary={true} style={style} onClick={this.handleSubmit}/>\n </div>\n </MuiThemeProvider>\n </div>\n );\n\n const style = {\n margin: 15,\n };\n }", "title": "" }, { "docid": "25f24ad0ab18df481e38555a83e1c433", "score": "0.62992895", "text": "render(){\n return(\n\n <div>\n <h3>Login</h3>\n <div >\n <LoginForm submit={this.submit}/>\n <Link to=\"/registration\" className=\"button\">Registration</Link>\n </div>\n </div>\n\n );\n }", "title": "" }, { "docid": "a8a950d89710fe88c21a257921e0e6c8", "score": "0.6299123", "text": "componentDidMount() {\n this.getUser();\n }", "title": "" }, { "docid": "a8a950d89710fe88c21a257921e0e6c8", "score": "0.6299123", "text": "componentDidMount() {\n this.getUser();\n }", "title": "" }, { "docid": "5c328a645a04ee50f97939feae6b14a9", "score": "0.62924457", "text": "requestLogin(){\n this.setState({\n newUser: false,\n showLoginForm: true,\n });\n }", "title": "" }, { "docid": "4012eb254931ff8f5f6a4662aa53a9f9", "score": "0.62906396", "text": "async componentDidMount() {\n let email, password, mnemonic = null;\n\n if(this.props.user.mnemonic) {\n email = this.props.user.email;\n password = this.props.user.password;\n mnemonic = this.props.user.mnemonic;\n } \n\n this.setState({\n stateModel: new LoginStateModel(email, password, mnemonic)\n });\n }", "title": "" }, { "docid": "0ac0fb6e007905ad9f6caeb27078ae07", "score": "0.628756", "text": "render() {\n console.log(this.findEmail())\n return (\n <form>\n <div className=\"form-group col-4\">\n <input type=\"email\" className=\"form-control\" id=\"exampleInputEmail1\" aria-describedby=\"emailHelp\" placeholder=\"Enter email\" name= \"email\" onChange={(e) => this.handleChange(e)} />\n <button type=\"submit\" className=\"btn btn-outline-primary btn-sm\" onClick={(e) => this.findUser(e)}>Submit</button>\n </div>\n <small id=\"emailHelp\" className=\"form-text\">We'll never share your email with anyone else.</small>\n </form>\n );\n }", "title": "" }, { "docid": "d8eeb71e98f0de3bfba5432fe36fe2e8", "score": "0.6279602", "text": "render() {\n\n // Destructuring to check is there an error at login andd to display it inside return statement bellow and auth\n const { authError, auth } = this.props;\n\n // If user is loged in redirect to 'home page' and if it's not return code bellow\n if (auth.uid) return <Redirect to='/'/>\n\n return (\n\n <div className=\"container\">\n\n <form onSubmit={this.handleSumbit} className=\"white\">\n <h5 className=\"grey-text text-darken-3\">SIGN IN</h5>\n\n <div className=\"input-field\">\n <label htmlFor=\"email\">Email</label>\n <input type=\"email\" id=\"email\" onChange={this.handleChange}/>\n </div>\n\n <div className=\"input-field\">\n <label htmlFor=\"password\">Password</label>\n <input type=\"password\" id=\"password\" onChange={this.handleChange}/>\n </div>\n\n <div className=\"input-field\">\n <button className=\"btn red lighten-1 z-depth-0\">SIGN IN</button>\n <div className=\"red-text center\">\n {/* If there is error return it if not return null */}\n { authError ? <p>{authError}</p> : null }\n </div>\n </div>\n\n </form>\n\n </div>\n\n )\n }", "title": "" }, { "docid": "996e7935f250c032ec9ff20ba81340e4", "score": "0.627452", "text": "handleDemoUser(e) {\n e.preventDefault();\n this.setState({\n email: \"\",\n password: \"\"\n })\n let email = \"patrick@email.com\";\n let password = \"123456\";\n\n // setTimeout(() => this.inputEmail, 1000);\n // setTimeout(() => this.inputPassword, 1000);\n\n this.props.demoLogin(this.state);\n }", "title": "" }, { "docid": "2b88142f4ab8d15f19a03ebc75bdd4ea", "score": "0.62701666", "text": "render() {\n return (\n <div>\n <SignInForm onSubmit={this.submit} />\n </div>\n );\n }", "title": "" }, { "docid": "060475b18b0ee80b96d70b7b9280fc80", "score": "0.62638974", "text": "_handleLogin() {\r\n if (this.$.login.validate()) {\r\n let password = this.$.password.value;\r\n let sapId = this.$.sapId.value;\r\n this._makeAjaxCall(`${window.BaseUrl}/users?sapId=${sapId}&&password=${password}`, 'get', null);\r\n\r\n }\r\n }", "title": "" }, { "docid": "44b3409666500a085a923439495f29d6", "score": "0.62603956", "text": "render() {\n return (\n <div>\n <MuiThemeProvider>\n <div>\n <div className=\"title-background\">\n <h2 className=\"title\">LOGIN / REGISTER</h2>\n </div>\n <div className=\"backGroundLogin\">\n <p className=\"loginRegisterAccessPar\">Login/Register to gain access to Registration Page.</p>\n <div className=\"loginIndent\">\n <TextField\n hintText=\"Enter your Username\"\n floatingLabelText=\"Email\"\n onChange={(event, newValue) => this.setState({ email: newValue })}\n />\n <br />\n <TextField\n type=\"password\"\n hintText=\"Enter your Password\"\n floatingLabelText=\"Password\"\n onChange={(event, newValue) => this.setState({ passWord: newValue })}\n />\n <div className=\"loginButton\">\n <RaisedButton label=\"Login\" primary={true} style={style} onClick={(event) => this.handleClick(event)} />\n </div>\n </div>\n </div>\n </div>\n </MuiThemeProvider>\n </div>\n );\n }", "title": "" }, { "docid": "e3fee2ce493d8fbb474a51f4837cfcca", "score": "0.6257109", "text": "render() {\n\t\tconst { username, password } = this.state;\n\t\treturn (\n\t\t\t<div className=\"Login-Container\">\n\n\t\t\t\t<div className=\"LoginWrapper\">\n\t\t\t\t\t<div className=\"Login\">\n\t\t\t\t\t\t<div className=\"Login-content-wrapper\">\n\t\t\t\t\t\t\t<h1> Login </h1>\n\t\t\t\t\t\t\t<h3>Please fill in your basic info</h3>\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t{/*\n\t\t\t\t\t\t\tRight below here is USERNAME field. On change, the value stored in the field at \n\t\t\t\t\t\t\tthe moment gets transfered to the variable 'username' by function handleChange, and then onSubmit, \n\t\t\t\t\t\t\ta post request is sent to the server. \n\t\t\t\t\t\t\t*/}\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\ticon=\"user\"\n\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\tplaceholder=\"username\"\n\t\t\t\t\t\t\t\tvalue={username}\n\t\t\t\t\t\t\t\tname=\"username\"\n\t\t\t\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t{/*\n\t\t\t\t\t\t\tRight below here is PASSWORD field. On change, the value stored in the field at \n\t\t\t\t\t\t\tthe moment gets transfered to the variable 'password' by the function handleChange, and then onSubmit, \n\t\t\t\t\t\t\ta post request is sent to the server, containing both username and password in JSON.\n\t\t\t\t\t\t\t*/}\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\ticon=\"lock\"\n\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\tplaceholder=\"password\"\n\t\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\t\tvalue={password}\n\t\t\t\t\t\t\t\tname=\"password\"\n\t\t\t\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{/*\n\t\t\t\t\t\t\tSubmit button on click will fire a function called handleSubmit, which will of course, \n\t\t\t\t\t\t\tas I said earlier, will post a request to the server. Server will then send a token, which is to be used for any\n\t\t\t\t\t\t\tfurther requests in a session.\n\t\t\t\t\t\t\t*/}\n\t\t\t\t\t\t\t<button onClick={this.handleSubmit} className=\"ui button\">\n\t\t\t\t\t\t\t\tLOGIN\n\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"Right-half\">\n\t\t\t\t\t\t<div className=\"Right-half-text\">\n\t\t\t\t\t\t\t<h1> New User? </h1>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tAIIMS being a govt. organization requires you to contact the\n\t\t\t\t\t\t\t\tadministrator for a new account.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t\t<div className=\"Response-Box\">\n\t\t\t\t\t\t\t\t<div className=\"Response-text\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "ef5a340bed60e8e8016aa4bc2a710656", "score": "0.6250366", "text": "loginOnChange(e) {\n this.setState({\n [e.target.name]: e.target.value\n }, () => {\n // console.log(\"USERNAME\", this.state.username);\n // console.log(\"PASSWORD\", this.state.password);\n })\n }", "title": "" }, { "docid": "cebae14d6257e494a7f24be024f6964f", "score": "0.6249674", "text": "handleLoginClick(id){\n fakeAuth.authenticate(()=>{\n this.setState({\n redirectToReferrer: true\n })\n })\n this.props.dispatch(setAuthedUser(id))\n }", "title": "" }, { "docid": "9235918380ca1f45bd78b542e1cd92af", "score": "0.6247244", "text": "displayLoginBox() {\n this.setState({displayLoginBox: true});\n }", "title": "" }, { "docid": "c1f6ffb1e1a15dfbb4faa952add0d91e", "score": "0.62460303", "text": "componentDidMount() {\n findDOMNode(this.refs.searchInput).focus();\n }", "title": "" }, { "docid": "b1230bd24d4ceb3033159a3a01b5151e", "score": "0.6241157", "text": "loginRequest (username, password) {\n this.props.logIn(username, password);\n }", "title": "" }, { "docid": "8866bbeebc939db532ee5d6e52cbec1f", "score": "0.62400866", "text": "render() {\n return (\n <form className=\"sign-page form\" onSubmit={this.submitHandler}>\n <h1>{this.getPageTitle()}</h1>\n <div className=\"form-control\">\n <label htmlFor=\"email\">E-mail</label>\n <input type=\"text\" required id=\"email\" ref={this.emailElment} />\n </div>\n <div className=\"form-control\">\n <label htmlFor=\"password\">Password</label>\n <input type=\"password\" required id=\"password\" ref={this.passwordElment} />\n </div>\n <div className=\"form-actions\">\n <button type=\"submit\" className=\"btn\">Submit</button>\n </div>\n </form>\n );\n }", "title": "" }, { "docid": "206f228c59dec89164f61a7cd498495d", "score": "0.6233033", "text": "render(){\n return (\n <div className=\"LoginComponent\"> \n <h1>Login</h1>\n <div className=\"container\">\n {/*this.state.loginSuccess && <div>Login successful!</div>*/}\n {this.state.loginFail && <div className=\"alert alert-warning\">Invalid credentials</div>}\n \n <div className=\"container\">\n <div className=\"row row justify-content-md-center\" style={{marginTop:\"20px\"}}> \n <div className=\"col-2\">User name</div>\n <div className=\"col-2\"><input type=\"text\" name=\"username\" value={this.state.username} onChange={this.onChangeHandler} onKeyPress={this.onKeyPressHandler}/></div>\n </div>\n <div className=\"row justify-content-md-center\" style={{marginTop:\"10px\"}}> \n <div className=\"col-2\">Password</div>\n <div className=\"col-2\"><input type=\"password\" name=\"password\" value={this.state.password} onChange={this.onChangeHandler} onKeyPress={this.onKeyPressHandler}/></div>\n </div>\n <div className=\"row justify-content-md-center\" style={{marginTop:\"20px\"}}> \n <div className=\"col\"><button className=\"btn btn-success\" onClick={this.onClickLoginHandler}>Login</button></div>\n </div>\n </div>\n\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "ac360b286ff2a84788cd4f5e21767e6f", "score": "0.62329525", "text": "render() {\n if(this.state.login) {\n return (\n \t<div className='Login'>\n \t \t<SignInForm AppLogin={this.props.AppLogin} />\n \t \t<div className='Sign'>\n \t Don't have an account? <span className='Link' onClick={this.toSignup}>Sign Up</span> \n \t </div>\n </div>\n );\n } else {\n return (\n <div className='Login'>\n <SignUpForm AppSignup={this.props.AppSignup} />\n <div className='Sign'>\n Already have an account? <span className='Link' onClick={this.toLogin}>Sign In</span> \n </div>\n </div>\n );\n }\n }", "title": "" }, { "docid": "423decf422685a4baabe07d08f4c217d", "score": "0.62289697", "text": "render() {\n return (\n <div className=\"bg-login\">\n <div className=\"box-for-login\">\n <div className=\"input-style\">\n <input type=\"email\" className=\"email\" placeholder=\"Email\" required />\n <br />\n <input\n type=\"password\"\n className=\"passwords\"\n placeholder=\"Password\"\n required\n />\n <br />\n <button type=\"submit\">Login</button> \n <p> HEAD\n <Link to=\"/ForgotPasswordPage\">Forgot Password?</Link> <br />\n New User? <Link to=\"/SignUpPage\">Create an Account!</Link> <br />\n <Link to=\"/ProfilePage\">Profile</Link><br/>\n\n <Link to=\"/ForgotPasswordPage\">Forgot Password?</Link> <br />\n New User? \n\n or continue as <Link type=\"#\">guest!</Link>\n </p>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "15f911b3a79006806156bc382e9102f3", "score": "0.62154084", "text": "render() {\n return (\n <div className=\"mycontainer\">\n\n <div className=\"col-sm-6 col-sm-offset-3\">\n\n <h1><span className=\"fa fa-sign-in\"></span> Login</h1>\n\n {/* <!-- show any messages that come back with authentication -->\n <% if (message.length > 0) { %>\n <div className=\"alert alert-danger\"><%= message %></div>\n <% } %>\n\n <!-- LOGIN FORM --> */}\n <form action=\"/login\" method=\"post\">\n <div className=\"form-group\">\n <label>Email</label>\n <input type=\"text\" className=\"form-control\" name=\"email\"/>\n </div>\n <div className=\"form-group\">\n <label>Password</label>\n <input type=\"password\" className=\"form-control\" name=\"password\"/>\n </div>\n\n <button type=\"submit\" className=\"btn btn-warning btn-lg\">Login</button>\n </form>\n\n <hr/>\n\n <p>Need an account? <Link to={{pathname: '/signup'}} id=\"signup\" className=\"login-local login-btn btn btn-default\"><span className=\"fa fa-user\"></span>Signup</Link>{' '}</p>\n <p>Or go <a href=\"/\">home</a>.</p>\n\n </div>\n\n </div>\n\n );\n }", "title": "" }, { "docid": "233a9048167d05a6bddb901f884b0598", "score": "0.62082326", "text": "onLogin() {\r\n if ((this.state.username=='') || (this.state.password==''))\r\n {\r\n this.setState({errorMessage: \"Empty field error!\"});\r\n this.setState({showError: true});\r\n }\r\n else { \r\n Auth.signIn(this.state.username,this.state.password).then(user => {this.setState({user})\r\n this.props.navigation.navigate('TodoPage')})\r\n .catch(err => this.setState({errorMessage: \"Email and password don't match\"}),this.setState({showError: true}))\r\n }\r\n \r\n }", "title": "" } ]
f7e4c05c4906a5db395ae95df9d0f9e3
Clear all values in the store.
[ { "docid": "d4115d2bdc61ce0d322b6eb603da5b2d", "score": "0.0", "text": "function clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}", "title": "" } ]
[ { "docid": "ba83a55b129fa20bfc0233c598961ee2", "score": "0.78869605", "text": "clear() {\n this.store = createPlainObject();\n for (const key of Object.keys(__classPrivateFieldGet(this, _defaultValues))) {\n this.reset(key);\n }\n }", "title": "" }, { "docid": "8602250dcd9c94c3da338736d6d85b5f", "score": "0.77834004", "text": "clear() {\n for (let key of Object.keys(this.dataStore)) {\n delete this.dataStore[key];\n }\n }", "title": "" }, { "docid": "c168a06ca69024a75bea9875b8c8a439", "score": "0.7749015", "text": "clear() {\n this._store = {};\n }", "title": "" }, { "docid": "f6eef18d283d3c8a421975b3f2f530aa", "score": "0.7648161", "text": "clearAll() {\n this.old.clear();\n this.young.clear();\n }", "title": "" }, { "docid": "2d6b009008b52cb92395968171a3026e", "score": "0.76274806", "text": "clear() {\n\t\t\tthis.data = {};\n\t\t\tthis.store();\n\t\t}", "title": "" }, { "docid": "6f74376693eb4652f6d34872c050d23d", "score": "0.76103324", "text": "clearStore(){\n\t\t this.store = [];\n\t }", "title": "" }, { "docid": "1a722abdc75a70ea2408dd51f57bffcd", "score": "0.7538401", "text": "clear() {\n this.dataStore = [];\n }", "title": "" }, { "docid": "bb8f15ed5bd83099568d74a7a05cfde8", "score": "0.743977", "text": "function clear() {\n\tdelete this.dataStore;\n\tthis.dataStore = 0;\n\tthis.listSize = this.pos = 0;\n}", "title": "" }, { "docid": "b0f64db19c58dbfcb864b4358eb7d4ec", "score": "0.737175", "text": "clearAll() {\n this._operation = [];\n this._lastOperator = \"\";\n this._lastNumber = \"\";\n this.setLastNumberToDisplay();\n }", "title": "" }, { "docid": "dfb5d08acce25ab6df93a9e42e48ca94", "score": "0.73559105", "text": "function clearAllValues() {\n clearValues(1);\n clearValues(2);\n}", "title": "" }, { "docid": "dfb5d08acce25ab6df93a9e42e48ca94", "score": "0.73559105", "text": "function clearAllValues() {\n clearValues(1);\n clearValues(2);\n}", "title": "" }, { "docid": "137b0fe62d93d886800156da8663f523", "score": "0.7302229", "text": "clear() {\n this.dataStore = {};\n }", "title": "" }, { "docid": "e66e1923868362587726ab607e43792b", "score": "0.7252841", "text": "function clearObjectStore() {\n //start the transaction and get the object store\n return runTransaction()\n //resolve the value at namepace in the object store\n .then(function thenGetValue(objectStore) {\n return objectStore.clear();\n });\n }", "title": "" }, { "docid": "fa71fcfc4c8e4140f7561e45002ecd76", "score": "0.7193893", "text": "ClearAll() {\r\n this._data = [];\r\n return true;\r\n }", "title": "" }, { "docid": "fa71fcfc4c8e4140f7561e45002ecd76", "score": "0.7193893", "text": "ClearAll() {\r\n this._data = [];\r\n return true;\r\n }", "title": "" }, { "docid": "f65d6deccb3ab7a5af584f040b04448a", "score": "0.7191203", "text": "clear() {\n this._data = {};\n this._priorValues = {};\n }", "title": "" }, { "docid": "4b68173ff908fee7a2a25f2ee8017824", "score": "0.71812737", "text": "clear() {\n // Delete one by one to emit the correct signals.\n const keyList = this.keys();\n for (let i = 0; i < keyList.length; i++) {\n this.delete(keyList[i]);\n }\n }", "title": "" }, { "docid": "1382a5f8c48a338e9cc175de8c636b08", "score": "0.71747714", "text": "clear() {\n // Delete one by one to emit the correct signals.\n let keyList = this.keys();\n for (let i = 0; i < keyList.length; i++) {\n this.delete(keyList[i]);\n }\n }", "title": "" }, { "docid": "89b6085bc7ccbb21dae252b6e084edbf", "score": "0.7173959", "text": "clear() {\n // Delete one by one so that we send\n // the appropriate signals.\n const keyList = this.keys();\n for (let i = 0; i < keyList.length; i++) {\n this.delete(keyList[i]);\n }\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.7155035", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.7155035", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "6edefe71346eeb137fed962579832a1d", "score": "0.7155035", "text": "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "1efc08b9ff6dbc1dad08dae4829d3125", "score": "0.71326077", "text": "function _clear() {\n\t\t\t_indexForNaNValue = -1;\n\t\t\t_values = [];\n\t\t\t_setSize();\n\t\t}", "title": "" }, { "docid": "f3e96cb056e67fa798eccb6f838c6fe2", "score": "0.7118747", "text": "clear() {\n this.dataStore.forEach(model => model.destroy());\n localStorage.clear();\n }", "title": "" }, { "docid": "5692f1665fcc7212b8e1f1a5cb0d082b", "score": "0.71184206", "text": "clear () {\n this.display = null\n this.value = null\n this.results = null\n this.error = null\n this.$emit('input', null)\n this.$emit('clear')\n }", "title": "" }, { "docid": "5ec5afdb24fb0f7a67e2cc6f8d67deaa", "score": "0.7102813", "text": "function resetValue() {\r\n store.set(0);\r\n}", "title": "" }, { "docid": "4f4725c7fa4ecb066ed06f33df6b540b", "score": "0.70958513", "text": "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "title": "" }, { "docid": "aa196adb94f34e1f673e6d8a958b4722", "score": "0.7081991", "text": "clearAll() {\n this.setState(\n { current: [], storedNums: [], action: \"\", result: null });\n }", "title": "" }, { "docid": "850d4f62141733e1a65279eeac1dd8d6", "score": "0.70268726", "text": "reset() {\n\t\tthis.clear();\n\t}", "title": "" }, { "docid": "171ab494325b90815ccbc57832da012a", "score": "0.7015748", "text": "function clearAll() {\n calculator.displayValue = '0';\n calculator.first = null;\n calculator.waiting = false;\n calculator.operator = null;\n}", "title": "" }, { "docid": "91731f4848fc1ca8f27fd4786895944d", "score": "0.69953805", "text": "clear() {\n this.emit('clear');\n this.initialize();\n }", "title": "" }, { "docid": "15d559310e626db5876dac7b505d805c", "score": "0.69899184", "text": "clear() {\n this._data = {};\n this._dirty = true;\n }", "title": "" }, { "docid": "e3ba5a7a791c4d79fb322d6a8e088e30", "score": "0.69809896", "text": "clear() {\n this.data.clear();\n }", "title": "" }, { "docid": "e3ba5a7a791c4d79fb322d6a8e088e30", "score": "0.69809896", "text": "clear() {\n this.data.clear();\n }", "title": "" }, { "docid": "539bdd4fdd610e1bee167d8b7bb14a1a", "score": "0.69715184", "text": "clear () {\n let items = {};\n this.forEach ((value, key) => {items[key] = null; });\n\n this.setProperties (items);\n this.notifyPropertyChange ('length');\n }", "title": "" }, { "docid": "6c7259bfd333401f637e79fedbf82c63", "score": "0.69680226", "text": "deleteAll() {\n this._data = [];\n }", "title": "" }, { "docid": "b88785c44a5f5457bee9f6ea0745b5da", "score": "0.6914874", "text": "clear() {\n\t\tthis.list = [];\n\t\tthis._table = [];\n\t}", "title": "" }, { "docid": "d309c9a798d865e7e2d2264d300a26fc", "score": "0.6871562", "text": "function clear() {\n removeAll();\n }", "title": "" }, { "docid": "858e12c3ebc27c0a7b232c5505357c4a", "score": "0.68679863", "text": "clear() {\n this.state.clear();\n }", "title": "" }, { "docid": "4676f7203f249a8715f0c261d57b4c42", "score": "0.6865683", "text": "reset() {\n this.#values = {};\n this.#counts = {};\n }", "title": "" }, { "docid": "21d14844b312a1628a4c7252ccd31815", "score": "0.68408096", "text": "clearAllControls() {\n\t\tthis.forEachControl(function(control) {\n\t\t\tcontrol.clearValue();\n\t\t});\n\t}", "title": "" }, { "docid": "e09bc93934928147f43bc9ba07f29815", "score": "0.682045", "text": "clearValue() {\n this.value = [];\n this.change.emit(this.value);\n }", "title": "" }, { "docid": "51f3a27dcd8549d4946dae488c509726", "score": "0.6819986", "text": "clear() {\n store.dispatch(actions.change(this.props.formModelName, [this.props.emptyRowModel]));\n }", "title": "" }, { "docid": "e00a841ae1c83418e283b2cee7091455", "score": "0.68194664", "text": "clear() {\n const\n me = this,\n { stores } = me,\n children = me.children && me.children.slice();\n\n // Only allow for root node and if data is present\n if (!me.isRoot || !children) {\n return;\n }\n\n for (const store of stores) {\n if (!store.isChained) {\n if (store.trigger('beforeRemove', { parent : me, records : children, isMove : false, removingAll : true }) === false) {\n return false;\n }\n }\n }\n\n me.children.length = 0;\n\n stores.forEach(store => {\n children.forEach(child => {\n if (child.stores.includes(store)) {\n // this will drill down the child, unregistering whole branch\n child.unJoinStore(store);\n }\n\n child.parent = child.parentIndex = child.nextSibling = child.previousSibling = null;\n });\n\n store.storage.suspendEvents();\n store.storage.clear();\n store.storage.resumeEvents();\n\n store.added.clear();\n store.modified.clear();\n\n store.trigger('removeAll');\n store.trigger('change', { action : 'removeall' });\n });\n }", "title": "" }, { "docid": "707ec70c46cf1048a750d2114e131c71", "score": "0.6809729", "text": "function clearValues() {\n dispatch(updateTitle(null));\n dispatch(updateHead(null));\n dispatch(updateTeam(1));\n dispatch(updateDescription(null));\n dispatch(updateDate(null));\n dispatch(noturgent());\n }", "title": "" }, { "docid": "cb5174c77fb9f63ae1157a9fbde5d68f", "score": "0.67797846", "text": "function clearAll(){\n tempValue.value = \"\";\n displayValue.value = \"\";\n}", "title": "" }, { "docid": "3f1a505ae980c17c296ad977d85dcd10", "score": "0.67633265", "text": "function clearAll(){\n localStorage.clear();\n init();\n }", "title": "" }, { "docid": "40f63d4b182d966f26f9e06ba49ef408", "score": "0.6748019", "text": "clear()\n\t{\n\t\tif(this.length === 1)\n\t\t\tthis.data = 0\n\t\telse {\n\t\t\tfor(let i = 0; i < this.length; i++) {\n\t\t\t\tthis.data[i] = 0\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a511cfe7d76df453705ff2b8284021d9", "score": "0.6738014", "text": "clearAll() {\n this.filters = {};\n this.filterSummary = [];\n this.activeQuery = null;\n this.trackUi('Clear all filters and queries');\n }", "title": "" }, { "docid": "11a030701d14505f7a32c4d1f246a784", "score": "0.673292", "text": "clear() {\r\n this._registry.length = 0;\r\n }", "title": "" }, { "docid": "812a89507865eccf0dcab4dff70b8689", "score": "0.673011", "text": "clearAll () {\n return this._transact(async db => db.clear())\n }", "title": "" }, { "docid": "4a9abbe38935e0026889a70adac18d84", "score": "0.6716709", "text": "clear() {\n if (!this.isEmpty()) {\n this.items = [];\n this.total = 0;\n this.count = 0; // reset counter\n }\n }", "title": "" }, { "docid": "3a71f357c0f68fcffce99cf784680065", "score": "0.67070115", "text": "function ResetAll() {\n _field.value = 0;\n _preValue = 0;\n _action.value = \"\";\n }", "title": "" }, { "docid": "1c3fa4ea761dc04c07d63a8505ccb972", "score": "0.67030895", "text": "clear() {\n // reset input and formula, call update\n this.model.input = [];\n this.model.formula = [];\n this.view.update(\"0\");\n }", "title": "" }, { "docid": "b450b946fe3bd0ef8f9d9503d56a2969", "score": "0.6702738", "text": "reset() {\n this.items.clear();\n }", "title": "" }, { "docid": "527b6c7ea09541172b38c353ada8eb69", "score": "0.6691948", "text": "clear() {\n // Call onRemove on all components of all entities\n for (const { data } of this.entities.values()) {\n for (const componentName in data) {\n invoke(data[componentName], 'onRemove')\n }\n }\n\n // Clear entities\n this.entities.clear()\n this.index.clear()\n }", "title": "" }, { "docid": "f765e22ec70d59e771541b6fc1854b89", "score": "0.66778165", "text": "clear() {\n this.splice(0, this.length)\n }", "title": "" }, { "docid": "83304f588558a5cd08085c3a37934229", "score": "0.667485", "text": "function clear() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}", "title": "" }, { "docid": "45df8cc5edf704a8bf6d89db8b458d19", "score": "0.6671319", "text": "async clear() {\n this.keys = {};\n }", "title": "" }, { "docid": "52574fe6a152202f0aedd2405f1e7cf0", "score": "0.66651833", "text": "clearAllNumbers() {\n this.currentValue = \"\";\n this.previousValue = \"\";\n this.operator = \"\";\n this.calculation = \"\";\n this.isFinished = false;\n this.updateCalculatorOutput();\n }", "title": "" }, { "docid": "b31f004214a49401a509d6dd01d78a4c", "score": "0.6662715", "text": "function clear() {\n records = {};\n }", "title": "" }, { "docid": "c7e02fa87845481854abbbd1bb41bf2a", "score": "0.66598904", "text": "clear() {\n this.storage.clear();\n }", "title": "" }, { "docid": "b272711e07a9deb09840626125bc71b7", "score": "0.66539633", "text": "clear() {\n googObject.clear(this.types);\n this.save();\n }", "title": "" }, { "docid": "aedb275a055f0a2aa1eafda027da5fd9", "score": "0.6651426", "text": "function clear() {\n\t\tZotero.DB.beginTransaction();\n\t\tZotero.DB.query(\"DELETE FROM transactionSets\");\n\t\tZotero.DB.query(\"DELETE FROM transactions\");\n\t\tZotero.DB.query(\"DELETE FROM transactionLog\");\n\t\t_currentID = null;\n\t\t_activeID = null;\n\t\t_activeEvent = null;\n\t\t_maxID = null;\n\t\tZotero.DB.commitTransaction();\n\t}", "title": "" }, { "docid": "3e4d4e5106c758fd67e818085f256eee", "score": "0.66441077", "text": "static clearAllData() {\n let i, keys;\n if (confirm( \"Do you want to clear all person data?\" )) {\n keys = Object.keys( Person.instances );\n for (i = 0; i < keys.length; i += 1) {\n // use destroy method to properly handle all references\n Person.instances[keys[i]].destroy();\n }\n\n // hard reset instances\n Person.instances = {};\n localStorage.setItem( \"persons\", \"{}\" );\n console.log( \"Database cleared.\" );\n }\n }", "title": "" }, { "docid": "730f99caf2683771c53e62cb9ae94b8d", "score": "0.6641257", "text": "clear() {\n\t\tthis.cache = {};\n\t\tthis.save();\n\t}", "title": "" }, { "docid": "bf14a10db6a6845280c2370f54f54833", "score": "0.6623765", "text": "function clear() {\n items = [];\n }", "title": "" }, { "docid": "09a8f70e64d66abf5f1ddce1ae16ed0f", "score": "0.66131425", "text": "clear() {\n this.data.length = 0;\n this.rear = 0;\n }", "title": "" }, { "docid": "a8e1d6451e7970b76977d440feae993c", "score": "0.6608089", "text": "reset() {\n storeData.employees.length = 0;\n storeData.messages.length = 0;\n\n saveData();\n\n return store;\n }", "title": "" }, { "docid": "c959fcafd02fbafa13595e5d8e1e1cb1", "score": "0.66011375", "text": "clear() {\n\t\tthis.items = [];\n\t}", "title": "" }, { "docid": "801af77785d8aac1db1b25770cd8ba6f", "score": "0.65972525", "text": "function clearAll() {\r\n this.__size = 0;\r\n this.__hits = 0;\r\n this.__misses = 0;\r\n this.__newest = this.__oldest = null;\r\n this.__keys = {};\r\n }", "title": "" }, { "docid": "4df8fd287c4851e361f30f1a03e716b6", "score": "0.6584832", "text": "function clearAllData(st) {\n\treturn dbPromise.then(function(db) {\n\t\tvar tx = db.transaction(st, 'readwrite');\n\t\tvar store = tx.objectStore(st);\n\t\tstore.clear();\n\t\treturn tx.complete;\n\t});\n}", "title": "" }, { "docid": "0263ff7c043b12df7b3b90b0c2586beb", "score": "0.65756166", "text": "function clear() {\n calc.calculation = []\n calc.screens.value = ''\n calc.screens.placeholder = '01134'\n}", "title": "" }, { "docid": "f3c0a2f412d10a69061671b377b6c4dd", "score": "0.6573491", "text": "clear() {\n this.value = 0;\n this.chain = [];\n }", "title": "" }, { "docid": "48e5a8cb77ffd47b387d9c0a379d8617", "score": "0.65722054", "text": "clearValue() {\n this._value = null;\n }", "title": "" }, { "docid": "d10b06c05170bd5106461b87ccee01b7", "score": "0.6570524", "text": "clear() {\n this._map.values().forEach((item) => {\n item.dispose();\n });\n this._map.clear();\n }", "title": "" }, { "docid": "80def3fbcc8db11420b05477a9cdf8aa", "score": "0.65676713", "text": "function clearValues(){\n if(myWindow)\n myWindow.close();\n \n //interpreter and state diagram values\n tape1 = [];\n tape2 = [];\n tape3 = [];\n tape1edit = [];\n tape2edit = [];\n tape3edit = [];\n tapeindex = 0;\n tape2index = 0;\n tape3index = 0;\n programRunning = false;\n name = \"\";\n machine = [];\n liststates = [];\n nodes = [];\n links = [];\n loops = [];\n initialstate = \"\";\n acceptstate = \"\";\n circles = [];\n softreset();\n \n //parser values\n hVal = [];\n machineCode = [];\n}", "title": "" }, { "docid": "76066db2162fc838a1aad1086814a2b9", "score": "0.65618163", "text": "function clearAll(){\n clearFluid();\n clearBlocks();\n clearSources();\n}", "title": "" }, { "docid": "8b9d8e3232c9e7a6ca79cb8fbd6f2f68", "score": "0.65590954", "text": "clearSilent() {\n let me = this;\n\n me._items.splice(0, me.getCount());\n me.map.clear();\n }", "title": "" }, { "docid": "d878a378c31ca40b37b5da8495fbe1b2", "score": "0.6552949", "text": "function clearAllData() {\n ProductNameInp.value = \"\";\n ProductPriceInp.value = \"\";\n ProductCategoryInp.value = \"\";\n ProductDescInp.value = \"\";\n}", "title": "" }, { "docid": "ec5ee67eb891ece7d541829b07b07e48", "score": "0.65517783", "text": "clear() {\n this.value('');\n\n m.redraw();\n }", "title": "" }, { "docid": "e56b2963a8bbdd0ee50b262bd0b72f22", "score": "0.6551345", "text": "clearAll () {\n eachStorageType((storageType, isSupported) => {\n if (isSupported) {\n window[storageType].clear()\n }\n })\n }", "title": "" }, { "docid": "33b26cf7bfe4d5f4333696553bd6f277", "score": "0.6549498", "text": "clear() {\n this.persistObjs = [];\n }", "title": "" }, { "docid": "d922bdd6fd18747b51b079d654c65d3c", "score": "0.6547805", "text": "function clear( ) {\n\n // https://stackoverflow.com/a/1232046/1943591\n cache.both.length = 0;\n cache.clean.length = 0;\n cache.dirty.length = 0;\n\n }", "title": "" }, { "docid": "0fcd6283777579bff8f3a3dbd17f546d", "score": "0.6542963", "text": "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t}", "title": "" }, { "docid": "f05bb285f9271d1b4773b0759a56ecdf", "score": "0.6539047", "text": "resetAll() {\n this.objects.forEach(object => object._reset());\n }", "title": "" }, { "docid": "c432c5d76e9640842d197d1a9b813ba1", "score": "0.65387845", "text": "clear() {\n\t\tthis.model.destroy();\n\t}", "title": "" }, { "docid": "14a4767f77586381a9016e4d22da5eec", "score": "0.65387166", "text": "function clearData() {\n /*Recuperando el conector de la base de datos*/\n\tvar active = dataBase.result;\n /*Iniciar una transacción -almacen -modo*/\n\tvar data = active.transaction([\"claves\"], \"readwrite\");\n /*Indicar sobre qué almacén vamos a trabajar*/\n\tvar object = data.objectStore(\"claves\");\n\n\t/*Vaciar el almacen de objetos*/\n\tvar objectStoreRequest = object.clear();\n\t\n\t/*control de requerimiento*/\n\tobjectStoreRequest.onsuccess = function(event) {\n\t\tconsole.warn('Delete');\n\t};\n\t\n\t/*Transacción satisfactoria, refresca la lista*/\n\tdata.oncomplete = function(event) {\n\t\tconsole.warn('Complete');\n\t\tloadAll();\n\t};\n\t\n\t/*Control de errores para el metodo clear*/\n\tdata.onerror = function(event) {\n\t\tconsole.warn(error);\n\t};\n\n}", "title": "" }, { "docid": "35de9c78e2da33c9125e1b4e751bf930", "score": "0.6526342", "text": "DoClear() {\n this.length = 0;\n }", "title": "" }, { "docid": "c85ac8263639b529ebd4d1e50e161ec3", "score": "0.6524936", "text": "clearAllTodos() {\n appStore.allTodoKeys.forEach(key => {\n db.ref(`todos/${key}`).remove();\n });\n\n appStore.toggleConfirmModalStatus();\n }", "title": "" }, { "docid": "2fae83af1351f2a22a159b8573a6fa5a", "score": "0.6520728", "text": "clear() {\n this.m_optionsMap.forEach(option => {\n option.set(undefined, \"\");\n });\n }", "title": "" }, { "docid": "03252f10f955690c8fcfaf0c58b4bfdf", "score": "0.65205264", "text": "clearAllStateCaches() {\n const localStorageManager = LocalStorageManager.getInstance();\n localStorageManager.clearAllStateCaches(this.cacheNs);\n }", "title": "" }, { "docid": "74ac52fd57de640c827ea50d632c6808", "score": "0.65057045", "text": "function clearAll() {\n clearEnemyPlanes();\n clearTanks();\n clearBombs();\n clearMachinegun();\n clearCoins();\n}", "title": "" }, { "docid": "9de3a3dce80a73a685ec54083aa19217", "score": "0.650317", "text": "@action clearItems() {\n this.items = [];\n this.item = {};\n }", "title": "" }, { "docid": "ffe4035440fc5468f1edef0d52e1a59e", "score": "0.6497854", "text": "clearValue() {\n this.dispatchOnChange(null);\n }", "title": "" }, { "docid": "79f024c391ef7935faad8011134044a5", "score": "0.64933133", "text": "function clearStore() {\n\t roleStore = {};\n\t }", "title": "" }, { "docid": "379d3e5b88bcf84d15516ba754deb941", "score": "0.64916945", "text": "function clearAll(){\n values = \"\"\n recordedEntries = [];\n document.getElementById('tracker').innerHTML = \"\";\n document.getElementById('answer').innerHTML = \"0\";\n}", "title": "" }, { "docid": "0189844f4b12a39ba6748bf565b0aac9", "score": "0.64912796", "text": "clear() {\n this.m_referenceMap.clear();\n this.m_sortedGroupStates = undefined;\n this.m_textMap.clear();\n }", "title": "" }, { "docid": "eb438f147876d876eaf5103d7081f16f", "score": "0.64910626", "text": "clear() {\n var models = this._models;\n this._models = [];\n\n for (var i = 0; i < models.length; i++) {\n var model = models[i];\n model.unloadRecord();\n }\n\n this._metadata = null;\n }", "title": "" }, { "docid": "1bc062d4a48bcf8c584e4a779f1e1bd1", "score": "0.64908177", "text": "function clear() {\t\t\n console.log(\"clear()\");\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n console.log(\"done clear()\");\n\t\t}", "title": "" }, { "docid": "0f4948942f5f1cb213da81708c27ddec", "score": "0.6490273", "text": "clear() {\n for (const column of columns) {\n column.clear();\n }\n }", "title": "" } ]
f18f0e9b3b2056f3ec58c3491faa0dd5
averagePair([1,2,3],2.5) // true averagePair([1,3,3,5,6,7,10,12,19],8) // true averagePair([1,0,3,4,5,6], 4.1) // false averagePair([],4) // false Time Complexity O(N) Space Complexity O(1) averagePair Solution
[ { "docid": "8e69363496517b83cefe6f8d01c45884", "score": "0.8310338", "text": "function averagePair(arr, num){\n let start = 0\n let end = arr.length-1;\n while(start < end){\n let avg = (arr[start]+arr[end]) / 2 \n if(avg === num) return true;\n else if(avg < num) start++\n else end--\n }\n return false;\n}", "title": "" } ]
[ { "docid": "88d7787739ab4f6755f457eae3dc588d", "score": "0.83330894", "text": "function averagePair(arr, num){\n let start = 0\n let end = arr.length-1;\n while(start < end){\n let avg = (arr[start]+arr[end]) / 2 \n if(avg === num) return true;\n else if(avg < num) start++\n else end--\n }\n return false;\n }", "title": "" }, { "docid": "93afba54a382389eb4bb89e18a7260cd", "score": "0.81696147", "text": "function averagePair(arr, num) {\n let start = 0\n let end = arr.length - 1\n while (start < end) {\n let avg = (arr[start] + arr[end]) / 2\n if (avg === num) return true\n else if (avg < num) start++\n else end--\n }\n return false\n}", "title": "" }, { "docid": "28dfe9eb0bed894146c4a900eef5d7c3", "score": "0.8168109", "text": "function averagePair(arr, num) {\n let start = 0;\n let end = arr.length - 1;\n while (start < end) {\n let avg = (arr[start] + arr[end]) / 2\n if (avg === num) return true;\n else if (avg < num) start++\n else end--\n }\n return false;\n}", "title": "" }, { "docid": "1391d7360eea8f9b96c878def2326f54", "score": "0.8096627", "text": "function averagePair(arr, avg){\n let sum = avg * 2\n let left = 0\n let right = arr.length - 1\n while(right > left){\n let total = arr[left] + arr[right]\n if(total === sum) return true\n else if(arr[left]+arr[right] > sum){\n right--\n } else left++\n }\n return false\n}", "title": "" }, { "docid": "2ad6e513cda9745abfe6e51010b1fa42", "score": "0.80641896", "text": "function averagePair(arr, avg) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n tempAvg = (arr[left] + arr[right]) / 2;\n if (tempAvg === avg) return true;\n if (tempAvg > avg) right--;\n else left++;\n }\n\n return false;\n}", "title": "" }, { "docid": "a36a55aa37acea3fe2b8d4001c8ade87", "score": "0.80308986", "text": "function averagePair (arr, val) {\n arr.sort((a, b) => a - b)\n let start = 0\n let end = arr.length - 1\n while (start < end) {\n let avg = (arr[start] + arr[end]) / 2\n if (avg === val) return true\n else if (avg < val) start++\n else end--\n }\n return false\n}", "title": "" }, { "docid": "08c532a26356051da842c1d91017f6a3", "score": "0.8013605", "text": "function averagePair(arr, num) {\n const computeAvg = (i, j) => (arr[i] + arr[j]) / 2;\n let i = 0;\n let j = arr.length - 1;\n while (i < j) {\n let avg = computeAvg(i, j);\n if (avg === num) return true;\n avg > num && j--;\n avg < num && i++;\n }\n return false;\n}", "title": "" }, { "docid": "15814fe761f0e5b343d48c3a60357325", "score": "0.7988933", "text": "function averagePair(arr, num) {\n const total = num * 2;\n let front = 0;\n let back = arr.length - 1;\n\n while (front < back) {\n if (arr[front] + arr[back] === total) {\n return true;\n }\n if (arr[front] + arr[back] > total) {\n back--;\n }\n if (arr[front] + arr[back] < total) {\n front++;\n }\n }\n return false;\n}", "title": "" }, { "docid": "a3a3b37ada78d37a7c8959705f839468", "score": "0.778696", "text": "function averagePair(array, target){\n if(array.length === 0) return false;\n let i = 0;\n let j = array.length - 1;\n \n while(i < j){\n let average = (array[i] + array[j])/2;\n if(average === target){ \n return true;\n }else if(average > target){\n j--;\n }else{\n i++; \n }\n } \n \n return false;\n}", "title": "" }, { "docid": "524584bbd0a66538b99055b531a8fb38", "score": "0.7702398", "text": "function averagePair(array, target) {\r\n // return false if array length less than 1\r\n if (!array.length) {\r\n return false;\r\n }\r\n let i = 0;\r\n let j = array.length - 1;\r\n while(i < j) {\r\n let avg = (array[i] + array[j]) / 2;\r\n if (avg === target) {\r\n return true;\r\n } else if (avg > target) {\r\n j--;\r\n } else {\r\n i++;\r\n }\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "10bcdf536ec6f1eae9877fe907f010bd", "score": "0.76242185", "text": "function averagePair(arr, target) {\n let start = 0;\n let end = arr.length - 1;\n while (start < end) {\n let avg = (arr[start] + arr[end]) / 2;\n if (avg === target) return true;\n else if (avg < target) start++;\n else end--;\n }\n return false;\n}", "title": "" }, { "docid": "aca96a7de99859a12eb0ee2f2a1c26f2", "score": "0.7607003", "text": "function averagePair(arr, targetAvg) {\n if(arr.length === 0) return false;\n\n let left = 0;\n let right = arr.length-1;\n\n while(left < right){\n let currentAvg = average(arr[left], arr[right])\n\n if(currentAvg === targetAvg) return true;\n\n if(currentAvg < targetAvg){\n left++\n } else {\n right--\n }\n }\n\n return false\n}", "title": "" }, { "docid": "53eb4cd38e37f921ed09eb99af93dff8", "score": "0.7596639", "text": "function averagePair(arr, target) {\n if (arr.length === 0) return false;\n let p2 = arr.length - 1;\n for (let p1 = 0; p1 < arr.length; p1++) {\n let avg = (arr[p1] + arr[p2]) / 2;\n if (avg === target) {\n return true;\n } else if (avg > target) {\n p2--;\n p1--;\n } else {\n // avg < target\n continue;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "1b232554ad3aa12e9619f5936e768fcc", "score": "0.7491315", "text": "function averagePair(integers, target){\n let i = 0;\n let j = integers.length - 1;\n \n while (i < j) {\n let average = (integers[i] + integers[j]) / 2;\n if (average === target) {\n return true;\n } else if (average > target) {\n j--;\n } else {\n i++;\n }\n }\n return false;\n}", "title": "" }, { "docid": "7f93a5f00cb7d63638733c9025b3bb12", "score": "0.73728514", "text": "function averagePair(array, target) {\n // create pointer1 set to 0 and pointer2 to 1\n let pointer1 = 0;\n let pointer2 = 1;\n // while pointer1 is less than array.length\n while (pointer1 < array.length) {\n // if array at pointer1 + array at pointer2 / 2 is target\n if ((array[pointer1] + array[pointer2])/2 === target) {\n // return true\n return true;\n }\n // increase pointer1\n pointer1++;\n // increase pointer2\n pointer2++;\n }\n // return false\n return false\n }", "title": "" }, { "docid": "36cfd3e0770e961d73f0059b868353ac", "score": "0.72879773", "text": "function averagePair() {\n\n}", "title": "" }, { "docid": "a9295e3c6eb9d8d1eef1835636742791", "score": "0.712841", "text": "function containsAverage(arr){\n // return true if the array contains its own average \n let sum = arrSum(arr) // Linear Time: O(n)\n let average = sum / arr.length // Constant Time: O(1)\n return arr.indexOf(average) != -1 // Linear Time: O(n)\n}", "title": "" }, { "docid": "edf6bae872344f24366ed426335bfd4a", "score": "0.6816296", "text": "function findAVG(arr){\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n avg += arr[i];\n }\n return avg/arr.length;\n}", "title": "" }, { "docid": "8d37f31bc26c3673e1cdce013b5be37c", "score": "0.6767221", "text": "function average(array) {\n var sum = 0;\n var output = [];\n \n for (var i = 0; i < array.length; i++) {\n sum += array[i];\n }\n \n for (var j = 0; j < array.length; j++) {\n \n if (array[j] > sum / array.length) {\n output[output.length] = array[j];\n }\n }\n \n return output;\n}", "title": "" }, { "docid": "00e6f11bea8e0eeb024daf88346a5e66", "score": "0.6740467", "text": "function averageFinder2(arr) {\n var average = 0;\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum+= arr[i]\n } \n return Math.ceil(sum / arr.length); \n }", "title": "" }, { "docid": "57b8e7100494f901820c75bb7d8b28ce", "score": "0.6738531", "text": "function find_average(array) {\n var average = 0\n array.forEach(x => average += x)\n return average/array.length\n}", "title": "" }, { "docid": "41a9d2b26119f7c36de3b855539f2989", "score": "0.67256427", "text": "function find_average(array) {\n // your code here\n var sum = 0;\n array.forEach( element => sum += element); \n return sum / array.length;\n}", "title": "" }, { "docid": "57d6b2aabaefb3f14c00afc982c80841", "score": "0.6722084", "text": "function find_average(array) {\n var sum = array.reduce((a, b) => a + b, 0);\n return sum/array.length;\n}", "title": "" }, { "docid": "cf1c28e95af4e961281b38b074077a12", "score": "0.67202044", "text": "function balancePoint(arr){\n let sum = 0;\n for(let i = 0; i<arr.length; i++){\n sum += arr[i];\n }\n let checkSum = 0;\n for(let i=0; i<arr.length; i++){\n checkSum += arr[i];\n if(checkSum == sum/2){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "284497afce33769b118290957c6b72d3", "score": "0.6685403", "text": "function findAvg(arr) {\n var sum = 0;\n var avg = 0;\n for(var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n avg = sum / arr.length;\n return avg; \n}", "title": "" }, { "docid": "1010b63786cefbe8462937db891af143", "score": "0.666214", "text": "function find_average(array) {\n\tlet sum = array.reduce((prev, next) => prev + next, 0);\n\treturn Math.floor(sum / array.length);\n}", "title": "" }, { "docid": "3912c7f78456435d4ec43f7cd7730a0b", "score": "0.6630368", "text": "function average(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum += arr[i];\n }\n return sum / arr.length;\n}", "title": "" }, { "docid": "0899ee89b597f597c672a1ec11477397", "score": "0.6623089", "text": "function average(arr){\n return sum(arr) / arr.length;\n }", "title": "" }, { "docid": "1de4e33635c7c01c70e1bf43fc5d8b20", "score": "0.66173154", "text": "function find_average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "title": "" }, { "docid": "9d7300c0f7eac4938b1cb812a08eafeb", "score": "0.6598037", "text": "function avg( arr ){\n\treturn sum( arr ) / arr.length\n}", "title": "" }, { "docid": "229e49bba13bc1e86792f23cef24b389", "score": "0.65826285", "text": "function averageFinder(arr) {\n var average = 0;\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum+= arr[i]\n } \n average = (sum / arr.length);\n return average; \n }", "title": "" }, { "docid": "6e41a3dd968011e0fc7a573289cd365f", "score": "0.65729964", "text": "function find_avg(arr) {\n\t\tvar sum = 0, avg;\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tsum += arr[i];\n\t\t}\n\t\tavg = sum / arr.length;\n\t\treturn avg;\n\t}", "title": "" }, { "docid": "9326672203f656f26a3ef57f262413df", "score": "0.65516096", "text": "function avg(arr){\n var sum =0;\n \n for(var i=0; i<arr.length; i++){\n sum+=arr[i]\n \n }\n return sum/arr.length;\n}", "title": "" }, { "docid": "59cdac73e31c190df349c55f8f3f704a", "score": "0.6550556", "text": "function average(a){\n\tvar store=0;\n\tif (a.length === 0){\n\t\treturn 0;\n\t};\n\n\tfor (var i=0; i < a.length; i++){\n\t\tstore+= a[i];\n\t\t\n\t}return store/a.length;\n\n}", "title": "" }, { "docid": "8851dd00113beed9db299431e2022e00", "score": "0.65325636", "text": "function calcuateAverage(arr) {\n let n = arr.length\n let sum = 0\n for (const element of arr) {\n sum = sum + element\n }\n return sum / n\n}", "title": "" }, { "docid": "c265cedd7508ecb22c174d9bf7380af2", "score": "0.65165246", "text": "function average (arr){\n var sum = 0;\n for (var i= 0;i<arr.length;i++){\n\n sum = sum + arr[i];\n\n }\n\n return sum/arr.length\n}", "title": "" }, { "docid": "d61fa57f96bc20e453e7eccfe20acfb1", "score": "0.6515616", "text": "function avg(array) {\r\n\tvar sum = array.reduce(function(prev,current){\r\n\t\treturn prev + current;\r\n\t});\r\n\treturn sum/array.length;\r\n}", "title": "" }, { "docid": "f0c5f0ea48f6bfbd40089ef6d9a7575d", "score": "0.6511659", "text": "function avg(arr) {\n\tvar sum = 0;\n\tfor (var i = arr.length - 1; i >= 0; i--) {\n\t\tsum += arr[i]\n\t}\n\treturn sum / arr.length\n}", "title": "" }, { "docid": "7b4c1432510be80206fa876902cf7f9e", "score": "0.6498482", "text": "function Average(arr){\n var av = 0;\n for(var i = 0 ; i < arr.length ;i++){\n av += arr[i]\n }\n av = av/arr.length\n return(av)\n}", "title": "" }, { "docid": "240bf55244250f1ca86a7a2639a390c7", "score": "0.6495204", "text": "function findAverage(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum = sum + arr[i]; //or: sum += arr[i]\n }\n var avg = sum / arr.length;\n console.log(avg); //or: return avg;\n}", "title": "" }, { "docid": "41de0e0f7dff381147e896fdc639fa21", "score": "0.64934087", "text": "function avg_array(arr) {\n var sum = 0\n for( var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum / arr.length;\n}", "title": "" }, { "docid": "0ebb20d5befff33850cab21cb6029389", "score": "0.6490816", "text": "function average(array){\n function plus(a,b){return a+b}\n return array.reduce(plus)/array.length;\n}", "title": "" }, { "docid": "53ee05f3af1240a7b1853e161a0d9ac3", "score": "0.6490731", "text": "function average(array) {\n var sum = 0;\n var i;\n\n for (i = -2; i < array.length; i += 1) {\n sum += array[i];\n }\n\n return sum / array.length;\n}", "title": "" }, { "docid": "d94895218ec46f0da3e063c449e490b0", "score": "0.6488022", "text": "function returnAverageofUnsortedArray(inputArray) {\n\tlet sum = 0;\n\tlet len = inputArray.length;\n\tfor (let i = 0; i < len; i++) {\n\t\tsum += inputArray[i];\n\t}\n\tconsole.log((sum / len).toPrecision(2));\n}", "title": "" }, { "docid": "ad4abe83bb0ec665fbe5f5ff381e47fd", "score": "0.6480159", "text": "function findAvg(numArr){\n var sum = 0;\n var avg = 0;\n for (var i = 0; i < numArr.length; i++){\n sum = sum + numArr[i];\n }\n avg = sum / numArr.length;\n return avg;\n}", "title": "" }, { "docid": "36821a2f52c9cea7eceed1cc5d965656", "score": "0.64785045", "text": "function avg(arr) {\n\tlet total = 0;\n\t//loop over each num\n\tfor (let num of arr) {\n\t\t//add them together\n\t\ttotal += num;\n\t}\n\t//divide by number of nums\n\treturn total / arr.length;\n}", "title": "" }, { "docid": "e836c63cd4615d2afc3bb2fe17fdc83f", "score": "0.6472579", "text": "function average(array) {\n var sum = 0;\n var i;\n\n for (i = -2; i < array.length; i += 1) {\n sum += array[i];\n }\n\n return sum / Object.keys(array).length;\n}", "title": "" }, { "docid": "14269fc3d9a7a2fc47f77836f4491454", "score": "0.6471799", "text": "function average(array){\n //함수를 완성하세요\n var result = 0;\n for (var i = 0; i < array.length; i++) {\n result = result + array[i]\n }\n return result/array.length ;\n}", "title": "" }, { "docid": "26619f5da2e738a9a8c7d533b4347de4", "score": "0.64685935", "text": "function findAvg(numArr) {\n var sum = 0;\n for (var i = 0; i < numArr.length; i++) {\n sum = sum + numArr[i];\n }\n avg = sum / numArr.length;\n return avg;\n}", "title": "" }, { "docid": "26a0f2f2cee89068be805aeed7a8919b", "score": "0.6464439", "text": "function average(array){\n function plus(a, b){return a + b;}\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "4117f904d7bc35d70c725c4fc1c0283c", "score": "0.6451462", "text": "function avg(arr) {\n const total = arr.reduce((sum, b) => (sum + b));\n return (total / arr.length);\n}", "title": "" }, { "docid": "9b467abb6fdb016dc02fe5123dce40b7", "score": "0.64493686", "text": "function avg(arr){\n return arr.reduce((a,b) => a + b, 0) / arr.length\n }", "title": "" }, { "docid": "9f474ed5609177df2be72d05452256b0", "score": "0.6437878", "text": "function averageNumber(arr){\n let total= arr.reduce((item,acc)=>acc + item,0);\n return total/arr.length;\n}", "title": "" }, { "docid": "3d35873a6c43829b3196616f7374e412", "score": "0.6428753", "text": "function average(arr){\n let total = 0;\n\n //for the length of the given array, we will count up the given amount and devide it by the length.\n for(var i = 0; i < arr.length; i++){\n total += arr[i];\n }\n\n return total/arr.length;\n}", "title": "" }, { "docid": "128171f640478d3e34472b2960c65ab8", "score": "0.6406067", "text": "function getAverage(arr){\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n avg += arr[i];\n }\n avg = avg/arr.length;\n return avg;\n}", "title": "" }, { "docid": "cf46de763e210f23f0b599020ecf07ab", "score": "0.64052737", "text": "function avg(arr) {\n return arr.reduce((a,b) => +a + +b) / arr.length;\n }", "title": "" }, { "docid": "9da9f99167258d6e8680d1da913a8226", "score": "0.64037275", "text": "function averageValue(arr) {\n var arrSum = arr[0];\n for (var i = 0; i <= arr.length - 1; i++) {\n\n arrSum += arr[i];\n };\n var arrAverage = arrSum / arr.length;\n return arrAverage;\n}", "title": "" }, { "docid": "c37f021e072f1a192657e11df33ac551", "score": "0.64017034", "text": "function betterThanAverage(arr) {\n var sum = 0;\n for(i=0;i<arr.length;i++){\n sum+=arr[i];\n }\n var average=sum/arr.length\n // calculate the average\n var count = 0\n for(i=0;i<arr.length;i++){\n if(average<arr[i]){\n count++;\n }\n }\n // count how many values are greated than the average\n return count;\n}", "title": "" }, { "docid": "a05281d65a49f3eb46c04309185995d8", "score": "0.6385262", "text": "function avg(arr) {\n if (arr.length == 0) return null;\n console.log(arr);\n let count = 0;\n let total_sum = 0;\n arr.forEach(i => {\n if (typeof (i) === \"boolean\")\n return;\n else {\n i = parseInt(i);\n\n if (Number.isNaN(i)) {\n count++;\n } else {\n total_sum += i;\n }\n }\n });\n return ((total_sum + count) / arr.length);\n}", "title": "" }, { "docid": "b0d8fb1993e222ba982b93b1e0567410", "score": "0.63807935", "text": "function average (array) {\n\tvar n = array.length ;\n\tvar a = 0 ;\n\tfor (var i=0 ; i<n ; i++) {\n\t\ta+= array[i]\n\t}\n\treturn a/n ;\n}", "title": "" }, { "docid": "6a6a8f860c70072692665614b0867ff0", "score": "0.6375429", "text": "function avg(arr){\n let denom = arr.length;\n let numerator = sum(arr);\n \n return numerator / denom;\n}", "title": "" }, { "docid": "ac34280280cae0427fcf2acccaff7102", "score": "0.63748896", "text": "function arrayAverage(arr) {\n var sum = 0;\n\n arr.forEach(function(x){\n sum += x;\n });\n\n return Math.round(sum / arr.length);\n }", "title": "" }, { "docid": "a79574f781c77c9d670f14f8c6f86279", "score": "0.63586515", "text": "function betterThanAverage(arr) {\n var sum = 0;\n var count = 0\n var average = 0;\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i]; \n }\n average = sum/arr.length;\n for (var i = 0; i < arr.length; i++) {\n if (average < arr[i]) {\n count++;\n } \n }\n // count how many values are greated than the average\n return count;\n}", "title": "" }, { "docid": "a8ff368650b1ac50d58a923b071cd2db", "score": "0.635844", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "863a4c06c1a4017bb872278f8fc1cd34", "score": "0.6349864", "text": "function betterThanAverage(classPoints, yourPoints) {\n // Your code here\n let avg = classPoints.filter(e => e > 0).reduce((acc, curr) => acc + curr);\n if (yourPoints > avg / classPoints.length) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "547377f740293c8d8e4de82d9a703e0d", "score": "0.63475895", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "547377f740293c8d8e4de82d9a703e0d", "score": "0.63475895", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "547377f740293c8d8e4de82d9a703e0d", "score": "0.63475895", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "547377f740293c8d8e4de82d9a703e0d", "score": "0.63475895", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "547377f740293c8d8e4de82d9a703e0d", "score": "0.63475895", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "547377f740293c8d8e4de82d9a703e0d", "score": "0.63475895", "text": "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "e04e1f5a38e615b40297e316c48bfba7", "score": "0.6345597", "text": "function find_average(array) {\n // your code here\n if (array.length === 0) {\n return 0;\n }\n const average =\n array.reduce(function (acc, cur, i, arr) {\n return acc + cur;\n }, 0) / array.length;\n return average;\n}", "title": "" }, { "docid": "a3ed0a58b15ec8b9d148ce291d87b2ba", "score": "0.63392407", "text": "function calcAverage (arr){\n // needs to initialize\n var sum = 0;\n for ( var i = 0 ; i < arr .length; i ++ ){\n sum += arr [ i ];\n }\n // must divide by the length\n return sum/arr.length;\n}", "title": "" }, { "docid": "39c9b372ec4416cbdde3190e1589563e", "score": "0.6315611", "text": "function average(array) {\n\tvar sum = _.reduce(array, function(a, b, seq) { \n\t\tconsole.log(\"a : \" + a + \" , b : \" + b + \" , seq : \" + seq);\n\t\treturn a + b; \n\t});\n\treturn sum / _.size(array);\n}", "title": "" }, { "docid": "0a6ca4b8e38b8c44621aa278c81f233a", "score": "0.6313684", "text": "function average (arr) {\n let total = 0\n for (num of arr) {\n total += num\n }\n return total / arr.length\n}", "title": "" }, { "docid": "94d69fe6eb782606a2e663036a83ad6a", "score": "0.6311773", "text": "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "44fe3fc65dd0eb43a4b2df956764c94a", "score": "0.6307629", "text": "function average(numbers) {\n // process array of numbers\n return sum(numbers) / numbers.length;\n}", "title": "" }, { "docid": "1a8873f508bfdebe95eff98c650f73f5", "score": "0.6306409", "text": "function six(arr){\n var sum = 0;\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n sum += arr[i];\n }\n avg = sum / arr.length; \n return avg; \n}", "title": "" }, { "docid": "07ccf119858163dbf1c57b9e4d47f017", "score": "0.6305017", "text": "function findMean(nums) {\n if(nums.length === 0) return 0;\n return nums.reduce(function(acc, cur) {\n return acc + cur;\n }) / nums.length\n }", "title": "" }, { "docid": "4a21d97688e58acfa13a48cc1d8e11a8", "score": "0.63003063", "text": "avg(arr) {\r\n let sum = 0;\r\n for(let i = 0; i < arr.length; i++){\r\n sum += parseFloat(arr[i]);\r\n }\r\n return sum / arr.length;\r\n }", "title": "" }, { "docid": "7fe8207a29c5c33f09fd43b44831c0e9", "score": "0.62963486", "text": "function findMean(numsArr){\n if(numsArr.length === 0) return 0;\n return numsArr.reduce((acc, next) => {\n return acc + next;\n }) / numsArr.length;\n}", "title": "" }, { "docid": "901656c9c10bead0594963ed19f9f463", "score": "0.6295125", "text": "function average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "title": "" }, { "docid": "d3c43f0b10a03bc145fb26cb94802a26", "score": "0.6291026", "text": "function calcAverage(array){\n let reducer = (prevValue, currentValue) => prevValue + currentValue;\n return array.reduce(reducer)/array.length;\n \n}", "title": "" }, { "docid": "323f236c6b09c222a38ea8b04562d683", "score": "0.6286597", "text": "function averageNumbers(array) {\n var average = 0;\n for (var i = 0; i < array.length; i++) {\n average += array[i];\n }\n return average / array.length;\n}", "title": "" }, { "docid": "360ed0b8388b7bfd7a976aeb334744ef", "score": "0.6277681", "text": "function average(array){\n\tvar result= 0;\n\tvar total= 0;\n\tfor (var i= 0; i<array.length; i++){\n\t\tresult+= array[i];\n\t\ttotal= result / array.length;\n\t} \n\treturn total; \t\n}", "title": "" }, { "docid": "701a7fa23801cb8c854c77f1a3e7fc77", "score": "0.6274801", "text": "function average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "title": "" }, { "docid": "c9c39460b2f39b18c4a8dc57d3d6b04d", "score": "0.6270544", "text": "function average(nums){\n var sum = 0\n for (var i = 0; i < nums.length; i++) {\n sum += nums[i];\n };\n average = sum/nums.length;\n return average; \n}", "title": "" }, { "docid": "b114ebfc5a51c1f7b250f07f0ac04fa2", "score": "0.6267916", "text": "function avg_array(arr) {\n\n var sum = 0;\n for (var i = 0; i < arr.length; i++) {\n sum = arr[i] + sum;\n\n }\n console.log(sum / arr.length);\n}", "title": "" }, { "docid": "bba7b1d2c4cdf5843dcda004e6f7d542", "score": "0.6264891", "text": "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n\n return array.reduce(plus) / array.length;\n}", "title": "" }, { "docid": "103cd4ec57da681c8ccfe0fde9a5e6d7", "score": "0.6256019", "text": "function calcAVG(array) {\n var total = 0;\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n var avg = total / array.length;\n return (avg);\n}", "title": "" }, { "docid": "ec0fcf56b6f0df1db5bc98443502c59f", "score": "0.6254949", "text": "function average(numbers) {\n let sum = 0;\n numbers.forEach(function(arrNum) {\n sum = arrNum += sum;\n }); \n let arrAvg = sum/numbers.length;\n return arrAvg; \n}", "title": "" }, { "docid": "fba1c286bf0087cadc107ef02ed9ba71", "score": "0.62471855", "text": "function avgValue(array) {\n let total = 0;\n\n for (let i = 0; i < array.length; i += 1) {\n let num = array[i];\n total += num;\n }\n let avg = total / array.length;\n return avg;\n}", "title": "" }, { "docid": "5ca7275ec91bd35ea2848b8558455a55", "score": "0.6247176", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n\n let startingIndex = 0;\n\n let prevMinAvg;\n let nextMinAvg;\n for (var i = 1; i < A.length; i++) {\n // number of..\n n = i - startingIndex + 1;\n\n if (i === 1) {\n prevMinAvg = (A[i - 1] + A[i]) / 2;\n } else {\n nextMinAvg = ((n - 1) * prevMinAvg + A[i]) / n;\n newMinAvg = (A[i - 1] + A[i]) / 2;\n\n if (prevMinAvg < nextMinAvg && prevMinAvg < newMinAvg) {\n }\n }\n }\n return startingIndex;\n}", "title": "" }, { "docid": "32db3b50ca82086f24076cea891f887b", "score": "0.6231494", "text": "function aveArray(arr){\n\tvar sum1=0;\n\tvar avg=0;\n for(i=0 ; i<arr.length ; i++){\n sum1 += arr[i];\n avg= sum1/arr.length;\n }return avg;\n}", "title": "" }, { "docid": "f659ec9f5cec1dc02f0b2f9748527855", "score": "0.6231355", "text": "function betterThanAverage(arr) {\n var sum = 0;\n // calculate the average\n for(var i=0; i<arr.length;i++){\n sum+=arr[i];\n }\n var average=sum/arr.length;\n var count = 0;\n // count how many values are greated than the average\n for(var j=0; j<arr.length;j++){\n if(arr[j]>average){\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "524d2c83b407f02b3b980ff5287dd3e7", "score": "0.6231033", "text": "function avgNumber(array) {\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n sum += parseInt(array[i]);\n }\n return Math.round(sum / array.length);\n}", "title": "" }, { "docid": "7c5de6909845128e801d5e8fbb33b543", "score": "0.62284374", "text": "function average(nums) {\n var sum = 0;\n\n for (i = 0; i < nums.length; i++) {\n sum += nums[i];\n }\n var avg = sum / nums.length;\n return avg;\n}", "title": "" }, { "docid": "92cc029bf128c12b697743f64bcbdc9e", "score": "0.6227827", "text": "function average (array) {\n\tif (sum(array) === 0) {\n\treturn 0;\n\t}\n\telse {\n\ta = (sum(array)) / (array.length);\n\treturn a;\n\t}\n}", "title": "" }, { "docid": "060d0cd6c896b4438ffd77dc9063060d", "score": "0.6223127", "text": "function avgarray(arr)\r\n{\r\n\tvar avg=0;\r\n\tvar sum=0;\r\n\tfor(var i=0;i<arr.length;i++)\t\r\n{\r\n\tsum =sum+arr[i];\r\n}\r\navg=sum/arr.length;\r\nconsole.log(\"Averageg of the array:\",avg);\r\n}", "title": "" }, { "docid": "c65be3057c245551370efcf85fe3f0dc", "score": "0.6221083", "text": "function avgOf(numbersArray) {\nlet sum2 = 0\n// create loop that mutates the sum as it loops through each number in array\nfor (let i = 0; i < numbersArray.length; i++) {\n//sum = sum + a numer in the numbers array \n sum2 += Number(numbersArray[i]);\n\n}\n// after all the loops end, return the sum\n return sum2 / numbersArray.length;\n\n}", "title": "" } ]
0462c34dfd3807fc178c7c2f3f9bdaf9
called only from the deleteButton .on('click')
[ { "docid": "607680fd256113b56ca7efd93f005b1f", "score": "0.0", "text": "function confirmChoice(clickedButton){\n var taskId = $(clickedButton).data('id');\n if (verbose) {console.log( 'in confirmChoice with: ' + taskId );}\n clearMessage();\n // Change background-color\n $('#taskRow'+taskId).addClass('confirm');\n // Display message and remove line-through\n $('#taskName'+taskId).prepend('Are you sure you want to delete this task?: ').removeClass('completedName');\n // Disply choice buttons\n $('#delete'+taskId).html(\n '<button class=\"deleteButton yesButton\" data-id=\"'+taskId+'\">YES</button>'+\n '<button class=\"noButton\" data-id=\"'+taskId+'\">NO</button>');\n}", "title": "" } ]
[ { "docid": "c075f697347decb153fe899d040cc485", "score": "0.80230343", "text": "onDeleteClick() { }", "title": "" }, { "docid": "e4ed02321569481ed03306a260d61a50", "score": "0.7755832", "text": "function clickedDelete()\n{\n\t//we don't have anything to delete since these \n\t//are connections on the server.\n}", "title": "" }, { "docid": "63c96e79b43f398e2d8aa9525da1de98", "score": "0.7568742", "text": "function handleDeleteButtons()\n{\n $('button[data-action=\"delete\"]').click(function(){\n target = this.dataset.target;\n $(target).remove();\n });\n}", "title": "" }, { "docid": "4e162ba5981bbb1fdef3e33feaa0facf", "score": "0.7518104", "text": "function handleDeleteButton() {\n var idToDelete = $(this).parent().attr(\"data\");\n\n API.deleteVolunteers(idToDelete)\n .then(function () {\n refreshVolunteers();\n });\n }", "title": "" }, { "docid": "687541e08275c474bf5c9e935e2f0fcf", "score": "0.7485935", "text": "_handleDelete () {\n // Make necessary calls to delete this view item/details.\n alert(\"deleting\");\n }", "title": "" }, { "docid": "b0fe0673b5164d750a4a56ae18604ad3", "score": "0.74800336", "text": "onDelete() {\n if (confirm(\"Confirm deletion?\")) {\n $.post(\"/haskell/delete/item/\" + this.item.uid)\n .done(() => { fadeOutAndRemove('#' + this.itemNode); });\n }\n }", "title": "" }, { "docid": "3a0f481acf2e84a22a86e1d38ce98ad0", "score": "0.7421266", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"author\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/index/\" + id\n })\n .done(getExercisess);\n }", "title": "" }, { "docid": "7874ab58e42350f1e3ae058f97a12e47", "score": "0.74089414", "text": "function addDeleteButtonEventListener($entry, activeEntryData){\n $(\".red.delete\").click(function(event){\n event.preventDefault();\n EntryModel.remove(activeEntryData.id, function(error){\n EntryModel.loadAll(function(error, newEntries){ //note: re-loading as a strategy against multiple users able to add/delete to the server. Data may have changed since I first loaded it. I know this shouldn't be in an actual app as it would slow down performance considerably but I'm not sure how to work around the server thing without this.\n if (!error && newEntries.length === 0){\n CreatingEntryView.render($entry);\n } else if (!error && newEntries.length > 0) {\n EntryView.render($entry, newEntries[0])\n } else if (error){\n $(\".error\").text(error);\n }\n });\n });\n }); \n }", "title": "" }, { "docid": "8d7769ed1281c5a4810c0564dfce3fab", "score": "0.7393597", "text": "function successfulDeleteHandler(data, status, req){\n \t\t// This is the callback that gets called\n \t\t/* To Do\n \t\t- [x] send the delete w AJAX\n \t\t- [x] update the UI !!\n \t\t*/\n \t\tconsole.log(data);\n \t\tvar selector = `button[name='${data.Name}']`;\n \t\tvar button = $(selector);\n \t\tvar parent = button.parent();\n \t\tparent.remove()\n\n \t}", "title": "" }, { "docid": "c953bcc010a63a9527db6cb5447c0820", "score": "0.7388145", "text": "onDeleted() {\n this.dialog.delete = false;\n this.idsToDelete = [];\n this.doSearch();\n }", "title": "" }, { "docid": "3fe6a04e5ed686af08e5d0dec6ff9427", "score": "0.7332135", "text": "function _event_for_delete_btn() {\n\t\t\ttry {\n\t\t\t\tvar optionDialog = Ti.UI.createOptionDialog({\n\t\t\t\t\toptions : (self.is_ipad()) ? [ 'YES', 'NO', '' ] : [ 'YES', 'NO' ],\n\t\t\t\t\tbuttonNames : [ 'Cancel' ],\n\t\t\t\t\tdestructive : 0,\n\t\t\t\t\tcancel : 1,\n\t\t\t\t\ttitle : L('message_delete_note_in_job_note')\n\t\t\t\t});\n\t\t\t\toptionDialog.show();\n\t\t\t\toptionDialog.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.index === 0) {\n\t\t\t\t\t\tvar db = Titanium.Database.open(self.get_db_name());\n\t\t\t\t\t\tif (_selected_job_note_id > 1000000000) {\n\t\t\t\t\t\t\tdb.execute('DELETE FROM my_' + _type + '_note WHERE id=?', _selected_job_note_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdb.execute('UPDATE my_' + _type + '_note SET changed=?,status_code=? WHERE id=' + _selected_job_note_id, 1, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdb.close();\n\t\t\t\t\t\twin.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _event_for_delete_btn');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "46c7d89c70792a058360fcef02c6d736", "score": "0.72920966", "text": "function handleDelete() {\n $('.card-container').on('click', '.btn-delete', e => {\n const foundId = $(e.currentTarget).attr('data-id')\n api.deleteItem(foundId, ()=> {\n store.deleteItem(foundId)\n store.setCurrentItem(null)\n renderSideBar()\n renderDetail()\n })\n })\n }", "title": "" }, { "docid": "8b405f276e551d276b0185588b2dfa27", "score": "0.72840613", "text": "function clicked_del(e)\n {\n if (rows > 1) del_row(); \n return nothing(e);\n }", "title": "" }, { "docid": "cb10bad3884cb5e8aaf45d000c542d17", "score": "0.7270436", "text": "onDeleteBtnClick(e) {\n e.preventDefault();\n generateGeneralConfirmDialog().then(this.handleConfirmDeleteDialog)\n }", "title": "" }, { "docid": "e31fd18f13663f60c3b172e8e62d6d20", "score": "0.72506166", "text": "function processDelete(event,target){\r\n\t\r\n}", "title": "" }, { "docid": "be9be85c6c573ad40cefce3b72c6a920", "score": "0.7211582", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"band\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/bands/\" + id\n })\n .then(getBands);\n }", "title": "" }, { "docid": "334c7f9f15db098f6aa80974db33c5ab", "score": "0.7196155", "text": "onClickDelete(props) {\n this.dialog.delete = true;\n this.idsToDelete = [props.item.id];\n }", "title": "" }, { "docid": "6f1d95a0d6311b4a965efe6c5be51504", "score": "0.7184965", "text": "function clickDelete(){\n $(document).on('click', '#trashIcon', function () {\n var ans = confirm('您確定要刪除此筆文章。');\n userInfo['DeleteID'] = $(this).attr('data-id');\n userInfo['DeleteFrom'] = '3';\n if (ans == true) {\n $(this).parents('div#contentDiv').empty();\n //send data to delete function\n function sendMsgDatBack(userInfo) {\n $.ajax({\n type: 'POST',\n dataType: 'json',\n headers: {\n \"Token\": userInfo['Token'],\n },\n data: userInfo,\n url: '/api/DreamPlan/DeleteData',\n success: function (response) {\n if (response.ReturnCode == '00') {\n alert('您已成功刪除。');\n } else {\n alert('錯誤訊息' + response.ReturnCode + ',' + response.Message);\n }\n }\n });\n }\n //function send id back server and delete\n // sendMsgDatBack(userInfo);\n } else {\n return false;\n }\n });\n }", "title": "" }, { "docid": "eb99f5706e89faf91cba7e771538e4ac", "score": "0.7181835", "text": "function onDeletePressed() {\n\t\tdeleteEvent(props.event.key);\n\t\tsetShowRemoveModal(false);\n\t}", "title": "" }, { "docid": "87492ebbd8107bec80d323bc2cd77886", "score": "0.7162554", "text": "function onDeleteClick(){\r\n\t\tvar objButton = jQuery(this);\r\n\t\tvar objLoader = objButton.siblings(\".uc-loader-delete\");\r\n\t\t\r\n\t\tvar textDelete = g_tableLayouts.data(\"text-delete\");\r\n\t\t\t\t\r\n\t\tif(confirm(textDelete) == false)\r\n\t\t\treturn(false);\r\n\t\t\t\r\n\t\tobjButton.hide();\r\n\t\tobjLoader.show();\r\n\t\t\r\n\t\tvar layoutID = objButton.data(\"layoutid\");\r\n\t\t\r\n\t\tvar data = {\r\n\t\t\t\tlayout_id: layoutID\r\n\t\t};\r\n\t\t\r\n\t\tg_ucAdmin.ajaxRequest(\"delete_layout\", data);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "af1edbbd9bfba316a8e5079e30e73866", "score": "0.7144666", "text": "_handleDeleteRow(e){this.deleteRow(e.detail)}", "title": "" }, { "docid": "b8e6c530c1644818ae7c958b9f99ea79", "score": "0.7143898", "text": "function bindButtonDelete() {\n $(\".buttonDelete\").click(function(e) {\n e.preventDefault();\n var idStuff = $(this).data(\"categorie\");\n\n $.ajax({\n url: \"administration/detailsData\",\n type: 'POST',\n dataType: \"json\",\n data: \"idStuff=\" + idStuff,\n success: function(data) {\n var stuff = {stuff: data};\n $('#bodyDeleteModal').html(\"\");\n $('#row_delete_tmpl').tmpl(stuff).appendTo('#bodyDeleteModal');\n bindConfirmDeleteButton(idStuff);\n }\n });\n });\n }", "title": "" }, { "docid": "1bc419ed373bda7105bbb625bc5feb84", "score": "0.7129964", "text": "btnDeleteOnClick() {\n // lay thong tin ban ghi da chon trong danh sach\n //$('#dialog-validate').show();\n var self = this;\n var recordSelected = $('#table tbody tr.row-selected');\n console.log(recordSelected);\n // lay du lieu thong tin cua danh sachs\n\n self.selectId = recordSelected.data('key');\n \n self.getDetailDataId(self.selectId);\n var objectDetail = self.object;\n self.showDelete(\"Bạn có chắc chắn muốn xóa nhân viên\" + \" \" + objectDetail.employeeCode + \" \" + \"không?\");\n $('#btnOke1').click(function () {\n self.DeleteId(self.selectId);\n self.showMsg(\"Xóa thành công thông tin nhân viên \");\n $(\"#btnOkemsg\").click(function () {\n $(\"#dialog-msg\").hide();\n\n })\n $(\"#dialogDelete\").hide();\n })\n $('#btnHuy').click(function () {\n $(\"#dialogDelete\").hide();\n \n })\n\n }", "title": "" }, { "docid": "481618b678df29fe27c5ad2417af1a5f", "score": "0.71217203", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this)\n .parent(\"td\")\n .parent(\"tr\")\n .data(\"artist\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/artists/\" + id\n }).then(getArtists);\n }", "title": "" }, { "docid": "cd1043b408d872ce8b80894cbcaf2735", "score": "0.711987", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"restaurant\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/restaurants/\" + id\n })\n .then(getrestaurants);\n }", "title": "" }, { "docid": "90827cbe969cf916ecd589b2ded76dfd", "score": "0.71070236", "text": "function handleDeleteButtonPress() {\n let listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"name\");\n let id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/names/\" + id\n })\n .then(getNames);\n }", "title": "" }, { "docid": "b88f129d45d738c5270a9805a5d09273", "score": "0.7101689", "text": "function DeletePressed(){\n\t\t$('.ui-selected').remove();\n\t}", "title": "" }, { "docid": "89ef69f628312a2bffac30a4a29740f0", "score": "0.7092142", "text": "function deleteItem(e){\n\n}", "title": "" }, { "docid": "2017e267e9fbf17a6468710f3a73eed3", "score": "0.70802504", "text": "function deleteEmp() {\n $( '#employeeDataTable' ).on( 'click', '.deleteButton', function() {\n console.log( 'delete button clicked' );\n $(this).parent('tr').remove();\n } // end click button to run fxn\n )} // end function deleteEmp", "title": "" }, { "docid": "042526e9bfbb655e93b00d1e00c5554a", "score": "0.70691514", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"product\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/products/\" + id\n })\n .done(getproducts);\n }", "title": "" }, { "docid": "fda9c979b16e91067bb921a650feab26", "score": "0.70689565", "text": "_onDeleteClicked(e) {\n e.stopPropagation();\n e.preventDefault();\n\n this.model.destroy();\n }", "title": "" }, { "docid": "84f1faa79c0efd380ce6778361a4e1ed", "score": "0.7047732", "text": "function _init_delete_btn(){\n try{\n var delete_button = Ti.UI.createButton({\n top:self.default_table_view_row_height*2+100,\n left:0,\n right:0,\n width:self.screen_width,\n title:'Delete',\n backgroundImage:self.get_file_path('image','BUTT_red_off.png'),\n textAlign:'center',\n height:self.default_table_view_row_height\n });\n win.add(delete_button);\n \n delete_button.addEventListener('click',function(){\n var optionDialog = Ti.UI.createOptionDialog({\n options:(self.is_ipad())?['YES','NO','']:['YES','NO'],\n buttonNames:['Cancel'],\n destructive:0,\n cancel:1,\n title:L('message_delete_signature_in_job_signature')\n });\n optionDialog.show();\n optionDialog.addEventListener('click',function(e){\n if(e.index === 0){\n var db = Titanium.Database.open(self.get_db_name());\n if(_selected_job_signature_id > 1000000000){\n db.execute('DELETE FROM my_'+_type+'_signature WHERE id=?',_selected_job_signature_id);\n }else{\n db.execute('UPDATE my_'+_type+'_signature SET changed=?,status_code=? WHERE id='+_selected_job_signature_id,\n 1,2\n );\n }\n db.close();\n win.close();\n }\n }); \n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_delete_btn');\n return;\n } \n }", "title": "" }, { "docid": "81665c9b2cd30c6acbaca5085358e719", "score": "0.70422745", "text": "function deleteItemButton() {\n $('body').on('click', '.delButton', function(event) {\n //event.stopImmediatePropagation(); \n let id = $(event.target).closest(\".scanning\").attr(\"id\");\n deleteBookmark(id)\n .then(function() {\n showLists()\n .then(response => response.json())\n .then(responsejson => {\n store.store.bookmarks = responsejson;\n });\n })\n \n });\n\n}", "title": "" }, { "docid": "d3d38107ed32cc77f637b3e9c5c3754a", "score": "0.70375437", "text": "function onItemDeleteButtonClick(event) {\n removeItem(getChildIndex(event.target.parentNode));\n }", "title": "" }, { "docid": "5180db4e72fde64031eeb05b16613b76", "score": "0.7034902", "text": "function deleteHandler() {\n setModalIsOpen(true);\n }", "title": "" }, { "docid": "88386da5536d9f5441f6eaf8179970d7", "score": "0.7011565", "text": "function itemDeleted() {\n $('.js-shopping-list').on('click', '.js-item-delete', function(event) {\n const itemIndex = getItemIndexFromElement(event.currentTarget);\n console.log('delete button clicked', itemIndex);\n store.splice(itemIndex, 1);\n renderShoppingList(store);\n });\n}", "title": "" }, { "docid": "9a10eca6faa3851a0740bf592d3123c1", "score": "0.7004891", "text": "function _deleteButtonEventHandler(book){\n //console.log('Delete button received this book:',book);\n deleteBook(book);\n updateTableUI();\n}", "title": "" }, { "docid": "1abce46b2e5f52ddbc2f73257eb6f52b", "score": "0.7001003", "text": "function clickonDelete(){\r\n $(\".delete\").click(function(){\r\n var deleteButton = $(this);\r\n //send ajax call\r\n $.ajax({\r\n url:\"deletenotes.php\",\r\n type:\"POST\",\r\n //we need to send curent notes content with its id to the php file\r\n data:{id:deleteButton.next().attr(\"id\")},\r\n \r\n success:function(data){\r\n if(data== 'error'){\r\n $('#alertContent').text(\"There was an issue deleting the notes from the database!\"); \r\n $(\"#alert\").fadeIn();\r\n }else{\r\n //remove containing div\r\n deleteButton.parent().remove();\r\n }\r\n \r\n },\r\n error:function(){\r\n $('#alertContent').text(\"There was an error with the ajax call please try again!\");\r\n $(\"#alert\").fadeIn();\r\n \r\n }\r\n });\r\n \r\n });\r\n }", "title": "" }, { "docid": "e9b91f5faa2aabc5729f6a750f2b5986", "score": "0.6998963", "text": "function showDelete(event) {\n //Find the ID \n var deleteToExpose = event.target.getAttribute(\"id\");\n var gotChya = document.getElementById(\"deleteBtn\" + deleteToExpose)\n gotChya.setAttribute(\"class\", \"fa fa-times fa-lg\");\n\n //Delete Entry $_POST['review_id']\n var mc = new Hammer(event.target);\n var parentLi = document.getElementById(deleteToExpose);\n mc.on(\"tap\", function(ev) {\n parentLi.parentNode.removeChild(parentLi);\n app.review_id = datData.reviews[deleteToExpose].id;\n //delete from database\n var paramsDelete = new FormData();\n\n paramsDelete.append(\"uuid\", app.uuid);\n paramsDelete.append(\"action\", \"delete\");\n paramsDelete.append(\"review_id\", app.review_id);\n\n app.ajaxCall(app.urlSetNewReview, paramsDelete, app.deleteSuccess, app.ajaxErr);\n });\n }", "title": "" }, { "docid": "2741d88aa387d77c4564842490dec32d", "score": "0.69944537", "text": "function continue_callback (event) {\n $.post(\n delete_url,\n {\n pks: selected\n }\n )\n .done(function (data, textStatus, jqXHR) {\n data_table.fnReloadAjax();\n // would be nicer if we can retain the selected page here\n // $.each(data.deleted, function (idx) {\n // var pk = this.pk;\n // alert(pk);\n // //data_table.fnDeleteRow();\n // });\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n alert('Fout bij het verwijderen van item(s): ' + jqXHR.status + ' ' + jqXHR.statusText);\n });\n }", "title": "" }, { "docid": "e9f8c4ee725d66cdafc2b4d830a6c2e2", "score": "0.69844973", "text": "function clickondelete(){\n \n $(\".delete\").click(function(){\n \n var deletebutton = $(this);\n \n $.ajax({\n \n url:\"deletenote.php\",\n type:\"POST\",\n //we need to send the id to the deletenote.php file\n data: { id:deletebutton.next().attr(\"id\")}, \n success: function(data){\n \n if(data == 'error'){\n \n $(\"#alertcontent\").text(\"There was an issue deleting the note from the database\");\n $(\"#alert\").fadeIn(); \n \n \n } \n else{\n \n //remove containing div\n \n \n deletebutton.parent().remove();\n \n \n \n } \n \n \n },\n error:function(){\n \n $(\"#alertcontent\").text(\"There was an error with the Ajax call. Please try again!\");\n $(\"#alert\").fadeIn();\n \n \n \n },\n \n \n });\n \n \n \n \n \n \n });\n \n \n \n \n \n \n }", "title": "" }, { "docid": "46c4dfa4819d86bb96c23f948fb39bfe", "score": "0.69842255", "text": "function deleteData() {\n\t\n}", "title": "" }, { "docid": "2ae0fa9fd5c3cdc6e794f0f90e6505f0", "score": "0.6971037", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"author\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/authors/\" + id\n })\n .done(getAuthors);\n }", "title": "" }, { "docid": "f697d9d513fee48fb7570fce40b077cb", "score": "0.6968311", "text": "function addDeleteButton(deleteButton){\n $(deleteButton).on('click',function(e){\n e.preventDefault();\n\n let commentID = $(deleteButton).attr('id');\n\n $('#comment-'+commentID).remove();\n\n new Noty({\n theme : 'sunset',\n timeout :1000,\n progressBar : true,\n layout : 'topRight',\n text : 'Comment Deleted'\n }).show();\n\n\n })\n }", "title": "" }, { "docid": "16e696a86d6198bc174528daf14dfbf7", "score": "0.69649714", "text": "deleteFile(ev) { // REMOVE BUTTON DATA-ACTION\n if (ev.type == \"click\") {\n var index = ev.target.parentElement.parentElement.id\n } else {\n var index = ev\n }\n if (index > -1) {\n this.files.splice(index, 1)\n this.filesNames.splice(index, 1)\n this.canUpload.splice(index, 1)\n this.alreadyUploaded.splice(index, 1)\n }\n \n this.indexFetch--\n this.doBodyTableHtml()\n }", "title": "" }, { "docid": "b545a48196eb6d5d55444783dbc10d41", "score": "0.6957491", "text": "function del(){\n $(\".bow.delete\").click(function() {\n var bowId = $(this).data('id');\n var section = $(this).data('section');\n var collectionId = $(this).data('collectionid');\n\n if(confirm(BowsManager.copies.deleteBow)){\n $.ajax({\n url: \"/bow-delete\",\n method: \"POST\",\n data: {id: bowId},\n success: function(data) {\n if(data.success){\n // on bow list page so hide row\n if(typeof section == \"undefined\") {\n $(\"#bow-\"+bowId).fadeOut(\"slow\");\n }\n else {\n //on bow details page so return on collection details page\n window.location.href = '/collection-details/'+collectionId+'/'+section;\n }\n }\n else {\n $('.error-message.bow').html(data.error);\n }\n }\n });\n }\n });\n }", "title": "" }, { "docid": "555f292644e70c2ff9211ebcb825d3ff", "score": "0.69526017", "text": "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "title": "" }, { "docid": "f14eff20f50a1c726f0d478d670443fc", "score": "0.69504964", "text": "function delEventHandler(item){\r\n\tconst btns = item.querySelector('.buttons');\r\n btns.lastElementChild.addEventListener('click', (e)=>{\r\n e.preventDefault();\r\n\t\titem.remove();\r\n\t\tnotify('deleted');\r\n });\r\n\t\r\n}", "title": "" }, { "docid": "b407c977a4065f400f40271109f685e3", "score": "0.69462484", "text": "onDelete ($event) {\n this.listView.delete(this);\n }", "title": "" }, { "docid": "70cbca498245231ecc22837bee7d9cec", "score": "0.6940643", "text": "function del(){\n $(\".bill.delete\").click(function(e) {\n e.preventDefault();\n e.stopPropagation();\n var billId = $(this).data('id');\n var section = $(this).data('section');\n\n if(confirm(BowsManager.copies.deleteBill)){\n $.ajax({\n url: \"/bill-delete\",\n method: \"POST\",\n data: {id: billId},\n success: function(data) {\n if(data.success){\n // on bill list page so hide row\n if(typeof section == \"undefined\") {\n $(\"#bill-\"+billId).fadeOut(\"slow\");\n }\n else {\n //on bill details page so return on collection details page\n window.location.href = '/bill/'+section;\n }\n }\n else {\n $('.error-message.bill').html(data.error);\n }\n }\n });\n }\n });\n }", "title": "" }, { "docid": "6fc50ead91e7ff990d23c6807bef3d45", "score": "0.6904005", "text": "function addDeleteButton(deleteButton){\n console.log(deleteButton);\n $(deleteButton).on('click',function(){\n let id= deleteButton.getAttribute('id');\n $(`#post-container-${id}`).remove();\n new Noty({\n theme : 'sunset',\n text : 'Post Deleted',\n timeout:1000,\n progressBar:true,\n layout : 'topRight'\n }).show();\n });\n }", "title": "" }, { "docid": "ee584111a3dd0b977ad837067a28348a", "score": "0.6903628", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"trainer\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/trainers/\" + id\n })\n .then(getTrainers);\n }", "title": "" }, { "docid": "899e382ed78e00c20612ab3367781d53", "score": "0.6894334", "text": "function delClick() {\n props.onDelete(props.timerID);\n }", "title": "" }, { "docid": "faef53942205b0f625aa89917e0ef914", "score": "0.6894255", "text": "function deleteBTN(id) {\n $(\"#modelBTN\").click();\n $(document).on(\"click\", \".modal-delete\", function (e) {\n e.preventDefault();\n $.magnificPopup.close();\n $.ajax({\n type: \"GET\",\n dataType: \"json\",\n url: \"/deleteJobPost/\" + id,\n success: function (data) {\n $('#jobPostListDataTable').DataTable().ajax.reload();\n if (data) {\n new PNotify({\n title: \"Success!\",\n text: \"Job Find Deleted Successfully.\",\n type: \"success\",\n });\n }\n },\n });\n });\n}", "title": "" }, { "docid": "f02082155e931ba671b7462f7887cc96", "score": "0.68891263", "text": "function deleteSelectedRow(deleteButton) \n{ \n let p = deleteButton.parentNode.parentNode; \n p.parentNode.removeChild(p); \n saveShoppingList(); \n}", "title": "" }, { "docid": "9a66fd3a8e6f587e98f154deaaf4c35f", "score": "0.6881492", "text": "function deleteButtonPressed () {\n \n // Ensure that a specific entry is selected\n if (selected != 0) {\n \n // Ask confirmation from the user to avoid accidental deletion\n var answer = confirm(\"This entry will be permanently deleted! Proceed with the action?\");\n \n if (answer) {\n\n // 1. Remove the application object from the array\n obj[\"Applications\"].splice(selected - 1, 1);\n \n // 2. Update the IDs of the remaining applications\n for (var i = 0, len = obj[\"Applications\"].length; i < len; i++) {\n obj[\"Applications\"][i][\"ApplicationID\"] = i + 1;\n }\n \n // 3. Diselect the applications\n selected = 0;\n \n // 4. Update the tables\n updateApplicationTable();\n updatePropertiesTable();\n addTableRowHandler();\n cancelButtonPressed();\n }\n \n } else {\n alert(\"Please select an application entry to delete!\");\n }\n }", "title": "" }, { "docid": "dcb5fafaeab0f78efaaac89569f0fa09", "score": "0.68811005", "text": "function deleteButtonClick() {\n \tvar element = event.target;\n \tif (element.classList.contains('delete')) {\n \t\tvar confirmation = confirm('Are you sure you\\'d like to delete this account?');\n\n \t\tif (confirmation) {\n \t\t\tloadingElement.style.display = '';\n \t\t\tvar id = element.parentElement.parentElement.idName;\n\n \t\t\t// delete account and refresh accounts\n \t\t\tdeleteAccount({'id': id});\n\n \t\t\tvar saveEditButton = document.querySelector('.save-edit');\n \t\t\tsaveEditButton.remove();\n\n\t \t\taccountButtonsElement.style.display = '';\n \t\t}\n \t}\n }", "title": "" }, { "docid": "60283b342a186d8df7a94283de28d2d7", "score": "0.6876771", "text": "deleteRow(index){if(confirm(\"Delete entire row?\")){this.splice(\"data\",index,1)}}", "title": "" }, { "docid": "74f6e24c65ed048297ba331959fa80f2", "score": "0.68733644", "text": "function del(){\n $(\".client.delete\").click(function() {\n var clientId = $(this).data('id');\n var section = $(this).data('section');\n if(confirm(BowsManager.copies.deleteClient)){\n $.ajax({\n url: \"/client-delete\",\n method: \"POST\",\n data: {id: clientId},\n success: function(data) {\n if(data.success){\n // if on list client page hide the row\n if(section == \"client-index\") {\n $(\"#client-\"+clientId).fadeOut(\"slow\");\n }\n else {\n // we're on client details page so forward on list client page\n window.location.href = '/client';\n }\n }\n else {\n $('.error-message.client').html(data.error);\n }\n }\n });\n }\n });\n }", "title": "" }, { "docid": "9dd85f0e34f2c91648730800162453b4", "score": "0.686622", "text": "function deleteDataTodos(){\r\n $(document).on('click','.delete',\r\n function (){\r\n\r\n var thistodoItem = $(this).parent().attr('data_id');\r\n\r\n\r\n $.ajax({\r\n url: 'http://157.230.17.132:3024/todos/' + thistodoItem,\r\n method: 'DELETE',\r\n success: function(data){\r\n getDataTodos();\r\n },\r\n error: function(){\r\n console.log('si è verificato un errore, impossibile completare l operazione.');\r\n },\r\n });\r\n\r\n }\r\n );\r\n\r\n }", "title": "" }, { "docid": "4a46bb6411f72ad8047b4105c31dd57b", "score": "0.6865304", "text": "_handleDelete(){\n\t\t\t\tthis.dispatchEvent(new CustomEvent('card-deleted', {\n bubbles: true,\n composed: true,\n detail: {\n model: this.model,\n\n }\n\t\t\t\t}));\n }", "title": "" }, { "docid": "fe536f58802132693d7ff09e95e9236b", "score": "0.68604434", "text": "onDelete() {\n\n\t\t$(\".aimeos .basket-mini-product\").on(\"click\", \".delete\", async ev => {\n\n\t\t\tawait fetch($(ev.currentTarget).closest(\".product-item\").data(\"url\"), {\n\t\t\t\tmethod: \"DELETE\",\n\t\t\t\theaders: {'Content-Type': 'application/json'}\n\t\t\t}).then(response => {\n\t\t\t\treturn response.json();\n\t\t\t}).then(basket => {\n\t\t\t\tAimeosBasketMini.updateBasket(basket);\n\t\t\t});\n\n\t\t\treturn false;\n\t\t});\n\t}", "title": "" }, { "docid": "4de5211a4c597eae3123cc1c8106176c", "score": "0.68461883", "text": "function deleteDataFromDatabase(){\n\t\t$('#blogPostEditSection').on('click', '.delete', function(){\n\t\t\tlet postID = this.id;\n\t\t\tlet parentDiv = $(this).parent().parent().parent()\n\t\t\tlet selectedTitle = $(parentDiv).children('.postTitle').text()\n\n\t\t\tif (confirm(`Are you sure you want to delete post ${selectedTitle}?`) == true){\n\t\t\t\tlet deleteURL = DATABASE_URL + '/' + postID\n\t\t\t\t$.ajax({\n\t\t\t\t type: \"DELETE\",\n\t\t\t\t url: deleteURL,\n\t\t\t\t success: function(msg){\n\t\t\t\t alert(`Deleted post ${selectedTitle}`);\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t\tlocation.reload()\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert(`Did not delete post ${selectedTitle}`)\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "ac4b5637ae360befd3f3dbf8c8b02ca1", "score": "0.68391687", "text": "function handleDeleteItemClicked() {\n console.log('handlde Delete Function ran')\n $('.js-shopping-list').on('click', `.js-item-delete`, function(event) {\n const itemIndex = getItemIndexFromElement(event.currentTarget);\n STORE.splice(itemIndex, 1);\n renderShoppingList();\n});\n}", "title": "" }, { "docid": "ce32105dba0061adf93c23aa781ccbfe", "score": "0.6823028", "text": "function confirmDelete(){\n for(var i=0;i<listObjects.length;i++){\n if(listObjects[i].name === currentDeleteName){\n listObjects.splice(i, 1);\n }\n }\n closeDeletePopup();\n updateSavedList();\n reloadList();\n updatePieChart();\n}", "title": "" }, { "docid": "650e3747eb1bf5dab673e59f8a28e7bc", "score": "0.6813613", "text": "function toggleDelete(btnid, onsuccess, onerror) {\n $('body').on('click', btnid, function(e) {\n e.preventDefault();\n var me = $(this);\n //BootstrapDialog.confirm(\"<p>re you sure you want delete this data permanently?</p>\", function(result) {\n BootstrapDialog.confirm({\n title: \"Warning !\",\n type: BootstrapDialog.TYPE_WARNING,\n size: BootstrapDialog.SIZE_SMALL,\n message: \"Are you sure you want delete this data?\",\n callback: function(result) {\n if(result) {\n $.ajax({\n url: $(me).attr('href'),\n method: 'post',\n data: { data: $(me).data('id') },\n dataType: 'json',\n success: function(dt) {\n if(isFunction(onsuccess)) {\n onsuccess.call(this, dt);\n } else {\n showAlert(\"Data has been deleted\", \"success\", \"Success:\");\n }\n },\n error: function(xHr) {\n if(isFunction(onerror)) {\n onsuccess.call(this, xHr);\n } else {\n showAlert(\"Oooops.. something when wrong..\", \"danger\", \"Error:\");\n }\n }\n });\n }\n }\n });\n\n });\n}", "title": "" }, { "docid": "c107f1615c455100c877f6a708dfeaf4", "score": "0.68039227", "text": "function handleQuestionDelete() {\n var currentQuestion = $(this)\n .parent()\n .parent()\n .data(\"question\");\n deleteQuestion(currentQuestion.id);\n }", "title": "" }, { "docid": "14ab1227cb061d9b8e34dff7140f3bee", "score": "0.6803784", "text": "function deleteSuccess(boxdata) {\n tbl.clear();\n redrawTable(tbl, boxdata);\n buttonEvents(); // after redrawing the table, we must wire the new buttons\n //$(\"#editDiv\").hide();\n swal(\"הפריט הוסר בהצלחה\", \"נשמר בהצלחה\", \"הפעולה בוצעה\");\n}", "title": "" }, { "docid": "a1871f38e6ba2bf66880c1677a770813", "score": "0.6794538", "text": "function loadButtons() {\n //delete\n $(\".delete\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n //get id\n var $id = Number($(this).parent().parent().attr('data-id'));\n //get kind\n var $kind = $(this).parent().parent().attr('data-kind');\n\n //what?\n //location\n if ($kind === 'location') {\n //modal\n $(\"#delete-submit\").unbind();\n $(\"#modal-text\").empty();\n $(\"#modal-text\").append('Wanneer je een locatie verwijderd, worden alle items daarin ook verwijderd.');\n $(\"#delete-modal\").modal('show');\n\n //confirm\n $(\"#delete-submit\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n //database\n $db.locations_out.where('prim_key').equals($id).first(function ($location) {\n //delete items in location\n $db.items_out.where('location').equals($location['name']).delete();\n //delete location\n $db.locations_out.where('prim_key').equals($id).delete();\n }).then(function () {\n //reload\n $(\"#overview\").addClass('hidden');\n getItems();\n });\n\n //unbind\n $(\"#delete-submit\").unbind();\n //close\n $(\"#delete-modal\").modal('hide');\n });\n\n //category\n } else if ($kind === 'category') {\n //modal\n $(\"#delete-submit\").unbind();\n $(\"#modal-text\").empty();\n $(\"#modal-text\").append('Wanneer je een categorie verwijderd, worden alle items daarin ook verwijderd.');\n $(\"#delete-modal\").modal('show');\n\n //confirm\n $(\"#delete-submit\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n //database\n $db.categories_out.where('prim_key').equals($id).first(function ($category) {\n //delete items in category\n $db.items_out.where('category').equals($category['name']).delete();\n //delete category\n $db.categories_out.where('prim_key').equals($id).delete();\n }).then(function () {\n //reload\n $(\"#overview\").addClass('hidden');\n getItems();\n });\n\n //unbind\n $(\"#delete-submit\").unbind();\n //close\n $(\"#delete-modal\").modal('hide');\n });\n //item\n } else if ($kind === 'item') {\n //modal\n $(\"#delete-submit\").unbind();\n $(\"#modal-text\").empty();\n $(\"#modal-text\").append('Wilt u dit item verwijderen?');\n $(\"#delete-modal\").modal('show');\n\n //confirm\n $(\"#delete-submit\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n //database\n $db.items_out.where('prim_key').equals($id).delete();\n\n //reload\n $(\"#overview\").addClass('hidden');\n getItems();\n\n //unbind\n $(\"#delete-submit\").unbind();\n //close\n $(\"#delete-modal\").modal('hide');\n });\n\n //usernote\n } else if ($kind === 'usernote') {\n //modal\n $(\"#delete-submit\").unbind();\n $(\"#modal-text\").empty();\n $(\"#modal-text\").append('Wilt u deze reactie verwijderen?');\n $(\"#delete-modal\").modal('show');\n\n //confirm\n $(\"#delete-submit\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n //database\n $db.usernotes_out.where('prim_key').equals($id).delete();\n\n //reload\n $(\"#overview\").addClass('hidden');\n getItems();\n\n //unbind\n $(\"#delete-submit\").unbind();\n //close\n $(\"#delete-modal\").modal('hide');\n });\n }\n\n //empty selected\n localStorage.removeItem('current_item');\n\n showDetails(null);\n });\n\n //edit\n $(\".edit\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n //get id\n var $id = Number($(this).parent().parent().attr('data-id'));\n\n //load in localstorage\n $db.items_out.where('prim_key').equals($id).first(function ($item) {\n localStorage.setItem('current_item', JSON.stringify($item));\n window.location = \"edit.html\";\n });\n\n });\n\n //click link in table\n $(\".table-link\").click(function ($event) {\n //prevent default\n $event.preventDefault();\n\n $db.items_out.where('id').equals($(this).text()).first(function ($item) {\n localStorage.setItem('current_item', JSON.stringify($item));\n window.location = \"details.html\";\n });\n });\n}", "title": "" }, { "docid": "b32971b7441977941148b8de9e5201ce", "score": "0.6790167", "text": "function handleRecipeDelete() {\r\n var currentRecipe = $(this)\r\n .parent()\r\n .parent()\r\n .data(\"recipe\");\r\n deleteRecipe(currentRecipe.id);\r\n }", "title": "" }, { "docid": "debfbb59bbfe6aacd3a8a15c6ba4bb2b", "score": "0.6784768", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"merchant\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/merchants/\" + id\n })\n .then(getMerchants);\n }", "title": "" }, { "docid": "b0304f7dc756ef1f66b2b26831759a54", "score": "0.67828894", "text": "function deleteListener() {\n var deleteButton = document.getElementById('delete-button');\n deleteButton.addEventListener('click', function (e) {\n loadNotes()\n //currentElementId is previously set by our context listener when we right click the note element\n myData.deleteData(currentElementId);\n clearNotes();\n renderNotes();\n dragAndDropListener();\n });\n }", "title": "" }, { "docid": "e6d8615e7f0e134cc338365314921631", "score": "0.6774346", "text": "function handleDeleteBtn(evt) {\n\t\tprops.handleDelete(evt.target.value);\n\t}", "title": "" }, { "docid": "bc19d2e56887b42b6d5fe3ec63b034c1", "score": "0.6771715", "text": "function bindConfirmDeleteButton(idStuffToDelete) {\n $(\".confirmDeleteButton\").click(function(e) {\n e.preventDefault();\n\n $.ajax({\n url: \"administration/deleteStuff\",\n type: \"POST\",\n dataType: \"json\",\n data: \"idStuff=\" + idStuffToDelete\n });\n });\n }", "title": "" }, { "docid": "c3eefeefe91b6b430266ab01d24786d8", "score": "0.67673624", "text": "function handleBrewDelete() {\n var currentBrew = $(this).parents(\".brew-panel\").data(\"id\");\n deleteBrew(currentBrew);\n }", "title": "" }, { "docid": "ffda0a5bd148e3311930b74f7c456797", "score": "0.6767101", "text": "function del(){\n $(\".supplier.delete\").click(function() {\n var supplierId = $(this).data('id');\n var section = $(this).data('section');\n\n if(confirm(BowsManager.copies.deleteSupplier)){\n $.ajax({\n url: \"/supplier-delete\",\n method: \"POST\",\n data: {id: supplierId},\n success: function(data) {\n if(data.success){\n // on bill list page so hide row\n if(typeof section == \"undefined\") {\n $(\"#supplier-\"+supplierId).fadeOut(\"slow\");\n }\n else {\n //on bill details page so return on collection details page\n window.location.href = '/supplier-list/'+section;\n }\n }\n else {\n $('.error-message.supplier').html(data.error);\n }\n }\n });\n }\n });\n }", "title": "" }, { "docid": "b9aefd8ecde3e7f7d5cfd245d3eb26cc", "score": "0.67588526", "text": "function onBtnDeleteOrder() {\n // console.log(\"click\");\n // chuyển đổi trạng thái form về update\n gFormMode = gFORM_MODE_DELETE;\n $(\"#div-form-mod\").html(gFormMode);\n // console.log(\"Đây là nút Delete\");\n var vRowSelected = $(this).parents(\"tr\");\n // Lấy data of row\n var vDataRow = gOderTable.row(vRowSelected);\n var vRowOrderData = vDataRow.data();\n // console.log(vRowOrderData);\n var { id, orderId } = vRowOrderData;\n gOrderIdObjectForEdit = { id, orderId };\n $(\"#delete-confirm-modal\").modal(\"show\");\n}", "title": "" }, { "docid": "22cc297694686b90cd044be1bf460586", "score": "0.6752062", "text": "function activateDelete() {\n $('.delete-link').click(function() {\n var name = $(\"#ajaxDataTable\").jqGrid('getRowData', this.id).Name;\n $(\"#ajaxDataTable\").jqGrid('delGridRow', this.id, {\n caption: \"Eliminar registro\",\n reloadAfterSubmit: true,\n bSubmit: \"Eliminar\",\n bCancel: \"Cancelar\",\n url: ControllerActions.Delete,\n mtype: \"POST\",\n width: 300,\n // Workaround for bug: msg is not correctly updated after first rendering.\n beforeShowForm: function(formid) {\n $(\".delmsg\", formid).html(\"Desea eliminar este deporte:<br/> \" + name + \" ?\");\n }\n });\n });\n }", "title": "" }, { "docid": "3e26091f6996ef7cfa1dc9e530250881", "score": "0.6746091", "text": "function handleDelete(){\n props.onDelete(props.id);\n }", "title": "" }, { "docid": "5b61c5dc928387dd70676459a8c14198", "score": "0.67456055", "text": "function deleteClicked(){\n var deleteChlid1 = document.getElementById(this.id);\n var parent = document.getElementById(\"list_img\");\n parent.removeChild(deleteChlid1);\n var deleteChlid2 = document.getElementById(this.id);\n parent.removeChild(deleteChlid2);\n var deleteChlid3 = document.getElementById(this.id);\n parent.removeChild(deleteChlid3);\n}", "title": "" }, { "docid": "6d770f771767faf976e5ed066e94db77", "score": "0.67292535", "text": "deleteEvent() {\n\n const deleteButtons = document.querySelector(\".contentContainer\")\n\n deleteButtons.addEventListener(\"click\", event => {\n if (event.target.id.startsWith(\"deleteButton--\")) {\n const entryToDelete = event.target.id.split(\"--\")[1]\n API.deleteEntry(entryToDelete)\n .then(API.getEvents)\n .then(this.putEventsOnDOM)\n }\n })\n\n }", "title": "" }, { "docid": "c50878b5966907a23ec536256d342731", "score": "0.67269915", "text": "function deleteButton() {\r\n $(\".deleteTrack\").click(function() {\r\n $(this).closest(\"li\").remove(); \r\n });\r\n }", "title": "" }, { "docid": "e1a59a51c521dddd6d6557346c4d1a10", "score": "0.6724568", "text": "function handleDeleteItemClicked() {\n console.log('`handleDeleteItemClicked` ran');\n $('.js-shopping-list').on('click', '.js-item-delete', event => {\n const index = getItemIndexFromElement(event.currentTarget);\n STORE.splice(index, 1);\n renderShoppingList();\n });\n}", "title": "" }, { "docid": "6bb8331c3a54b50c1b3ce4f23aec2e07", "score": "0.6717744", "text": "handleDeleteConfirm() {\n this.removeFromGrid(this.state.deleteWordId, this.state.deleteColId);\n this.callDeleteApi(this.state.deleteWordId, this.state.deleteColId);\n this.closeDeleteModal();\n }", "title": "" }, { "docid": "6376b1e072f1b09c8b3138285d9c2e4f", "score": "0.67139316", "text": "function listenDeleteClick(){\r\n\tlet cardContainerElementsCount = document.querySelector(\".cardsContainer\").children.length;\r\n\t\tif(cardContainerElementsCount !== 0){\r\n\t\t\tlet deleteBtns = document.querySelectorAll(\".delete\");\r\n\t\t\tfor(let i = 0;i<deleteBtns.length;i++){\r\n\t\t\t\tdeleteBtns[i].addEventListener(\"click\",e=>{\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\tlet id = e.target.parentElement.parentElement.children[0].children[0].textContent;\r\n\t\t\t\t\tdeleteRecord(id);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "4345bedbbeb7c3aaab826982a88ff4ee", "score": "0.6712532", "text": "onClickDeleteAll() {\n this.dialog.delete = true;\n this.idsToDelete = this.pickedItems.map(i => i.id);\n }", "title": "" }, { "docid": "020971f078c4c61313491b9adae9c6cc", "score": "0.67104274", "text": "deletePlace () {\n this.placeInputFloatingMenu = false // When a place is removed we have to make sure that the floating menu is hidden\n this.$emit('delete', this.index)\n }", "title": "" }, { "docid": "22ab4dbc64894f9e4eadf7eb352e4afe", "score": "0.6707621", "text": "function btnDelete(e) {\n \n e.preventDefault();\n if(!isReady.current) {\n setData('null');\n setMsg('Erro.');\n return;\n }\n\n var strCel2purge = e.target.id;\n deleteUser(strCel2purge).then(() => {\n getFireBaseData().then((fireBaseData) => { setData(fireBaseData) })\n }).catch(err => {\n isReady.current = false;\n setData('null');\n setMsg(err);\n })\n\n }", "title": "" }, { "docid": "2724758851ac4134f731fdfeb61b1685", "score": "0.6705443", "text": "function del(){\n $(\".collection.delete\").click(function() {\n var collectionId = $(this).data('id');\n var clientId = $(this).data('clientid');\n var section = $(this).data('section');\n if(confirm(BowsManager.copies.deleteCollection)){\n $.ajax({\n url: \"/collection-delete\",\n method: \"POST\",\n data: {id: collectionId},\n success: function(data) {\n if(data.success){\n if(typeof clientId == \"undefined\") {\n // on collection list page so hide row\n $(\"#collection-\"+collectionId).fadeOut(\"slow\");\n }\n else {\n //on collection details page so return on client details page\n var url = \"/collection\";\n if(section.indexOf(\"client\") !== false){\n url = '/client-details/'+ clientId;\n }\n window.location.href = url;\n }\n }\n else {\n $('.error-message.collection').html(data.error);\n }\n }\n });\n }\n });\n return;\n }", "title": "" }, { "docid": "d75d23ae00fdc5403b2cbc8a738d86b7", "score": "0.66983193", "text": "function eventDelete(){\n\t\tpartnerId = $('.btnAcceptE').val();\n\t\tnumPag = $('ul .current').val();\n\t\t$.ajax({\n type: \"POST\",\n url: \"../admin/asignarComercio/deleteXref\",\n dataType:'json',\n data: { \n\t\t\t\tidPlace:$('#idPlace').val(),\n\t\t\t\tidPartner:partnerId,\n\t\t\t},\n success: function(data){\n\t\t\t\t\tvar aux = 0;\n\t\t\t\t\t$('#tableAsigComer tbody tr').each(function(index) {\n aux++;\n });\n\t\t\t\t\t//si es uno regarga la tabla con un indice menos\n\t\t\t\t\tif(aux == 1){\n\t\t\t\t\t\tnumPag = numPag-1;\n\t\t\t\t\t}\n\t\t\t\t\tajaxMostrarTabla(\"../admin/asignarComercio/getallSearch\",(numPag-1));\n\t\t\t\t\t$('#divMenssagewarning').hide(1000);\n\t\t\t\t\t$('#alertMessage').html(data);\n\t\t\t\t\t$('#divMenssage').show(1000).delay(1500);\n\t\t\t\t\t$('#divMenssage').hide(1000);\n \t}\n\t\t});\n\t}", "title": "" }, { "docid": "3454f4ebe3aad74314213071f13272d7", "score": "0.6697241", "text": "processDeleteList(){\n window.todo.model.view.showDialog();\n\n let yesButton = document.getElementById(TodoGUIId.YES_BUTTON);\n let noButton = document.getElementById(TodoGUIId.NO_BUTTON);\n yesButton.onclick= function(){\n let listBeingDeleted = window.todo.model.listToEdit;\n window.todo.model.removeList(listBeingDeleted);\n window.todo.model.goHome();\n window.todo.model.view.hideDialog();\n }\n noButton.addEventListener('click',function() {\n var dialog = document.getElementById(TodoGUIId.MODAL_YES_NO_DIALOG);\n dialog.classList.add('remove');\n \n setTimeout(function(){ \n window.todo.model.view.hideDialog();\n dialog.classList.remove('remove');\n }, 550);\n })\n}", "title": "" }, { "docid": "4704ac36b23b24181686db1d4be04a15", "score": "0.6690088", "text": "function deleteRowClick(button) {\n deleteRowSwipe(button.parentNode.parentNode);\n}", "title": "" }, { "docid": "7f3c52f26f9ec14014a70c8ba52173d8", "score": "0.6686924", "text": "delete() {\n deleteListItemFromDB(this.id);\n document.getElementById(this.id).remove();\n }", "title": "" }, { "docid": "6696c4a8604fb24d49e804951ef3584f", "score": "0.66715723", "text": "function deleteClicked(event){\n\tif (confirm('Are you sure you want to delete this record?')) {\n\n\t\tvar user_id = event.target.id.split(\"_\")[1];\n\t\t$.ajax({\n\t\t\ttype: 'put',\n\t\t\turl: '/user',\n\t\t\tdata: {\n\t\t\t\tid : user_id,\n\t\t\t\temail : \"\",\n\t\t\t\tpassword : \"\",\n\t\t\t\tfirst_name : \"\",\n\t\t\t\tlast_name : \"\",\n\t\t\t\trole : \"\",\n\t\t\t\tphone_number : \"\",\n\t\t\t\thost_site : \"\"\n\t\t\t},\n\t\t\tcomplete: function(response) {\n\t\t\t\tif (response.success == \"false\"){\n\t\t\t\t\talert(response.message);\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Record deleted successfully\");\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} \n\n}", "title": "" }, { "docid": "8ffa127a16833e84e3b065bb7759f7e2", "score": "0.66709614", "text": "function _delete(e){\n const item = e.target;\n if(item.classList[0] == \"deleteButton\"){\n item.parentElement.remove();\n }\n}", "title": "" }, { "docid": "5a30a5e77465d8075a0ecf9b9e0cb8c3", "score": "0.6668633", "text": "function onDeleteClick() {\n\n\t// assume user id attribute exists on button\n\tvar uid = $(this).attr(\"uid\");\n\t\n\t// ...get the value of name cell in row\n\tvar row_name = $(\"#row-\" + uid + \" td[name = 'bm_fullName']\").html();\n\t\n\t// ...and get the value of username cell in row\n\tvar row_username = $(\"#row-\" + uid + \" td[name = 'bm_username\").html();\n\t\n\t// fill in the dialog with data from the current row board member\n\t$(\"#delBmId\").html(uid);\n\t$(\"#delBmName\").html(row_name);\n\t$(\"#delBmUserName\").html(row_username);\n\t\n\t// open the dialog...let it take over\n\t$(\"#dlgDelete\").dialog(\"open\");\n}", "title": "" }, { "docid": "78cc43dd7fdf4c80ba4ef92dee00549d", "score": "0.6667106", "text": "function handleBookDelete() {\n var currentBook = $(this)\n .parent()\n .parent()\n .data(\"books\");\n deleteBook(currentBook.id);\n }", "title": "" }, { "docid": "ed9137af642d1e04042513f5d6bd0416", "score": "0.66595274", "text": "function del_row()\n {\n var $row = jQuery(obj).find(options.subSelect);\n if ((typeof(options.onDel) != \"function\") || options.onDel($row))\n {\n $row.remove();\n update_buttons(-1);\n }\n }", "title": "" }, { "docid": "7a720ee1c4b5fa5c514306dbd4d6644b", "score": "0.6654877", "text": "function deleteData(e) {\n const clickedNumber = e.target.id;\n booksData.splice(clickedNumber, 1);\n showAllCards();\n \n}", "title": "" }, { "docid": "670f657870f9b96b0245fa2d6d06bb6b", "score": "0.66548145", "text": "function delete_items(q_id)\n\n{\n\n\n\n if(confirm(\"Do You Wants to Delete Record ?\")){\n\n \t$(\".box\").append('<div class=\"overlay\"><i class=\"fa fa-refresh fa-spin\"></i></div>');\n\n $.post($(\"#base_url\").val()+\"items/delete_items\",{q_id:q_id},function(result){\n\n //alert(result);return;\n\n\t if(result==\"success\")\n\n\t\t\t\t{\n\n\t\t\t\t toastr[\"success\"](\"Record Deleted Successfully!\");\n\n\t\t\t\t $('#example2').DataTable().ajax.reload();\n\n\t\t\t\t}\n\n\t\t\t\telse if(result==\"failed\"){\n\n\t\t\t\t toastr[\"error\"](\"Failed to Delete .Try again!\");\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t toastr[\"error\"](result);\n\n\t\t\t\t}\n\n\t\t\t\t$(\".overlay\").remove();\n\n\t\t\t\treturn false;\n\n });\n\n }//end confirmation\n\n}", "title": "" }, { "docid": "854dc30a56082243c3b1761917a410af", "score": "0.665422", "text": "function deleteDoc (obj, evt) {\n var tr = $(obj).parent().parent();\n var id = $(tr).attr('id');\n var con = confirm('You want to delete?');\n if(con)\n {\n $.ajax({\n type: \"GET\",\n url: burl + \"/indicator/document/delete/\" + id,\n success: function (response) {\n $(tr).remove();\n }\n });\n }\n\n}", "title": "" } ]
b1802e251df483b8dcefdb0b8e1e7a30
returns an informational notification in Gmail
[ { "docid": "78963d96d9dfb4e09f68ad8114720667", "score": "0.6134148", "text": "function notifyInfo(message) {\r\n return CardService.newActionResponseBuilder()\r\n .setNotification(CardService.newNotification()\r\n .setType(CardService.NotificationType.INFO)\r\n .setText(message))\r\n .build();\r\n}", "title": "" } ]
[ { "docid": "e66ea259f78ef062107ff229ffff2ca6", "score": "0.6325645", "text": "function sendNotification_(message) {\n var props = PropertiesService.getDocumentProperties();\n var emailNotif = props.getProperty(\"emailNotif\");\n if (emailNotif) {\n MailApp.sendEmail(props.getProperty(\"user\"), \"Scheduled Google Form Action Alert\", message);\n }\n}", "title": "" }, { "docid": "9ae60727e6bbe9fa27ea80b0835f9807", "score": "0.62692666", "text": "function sendReminder() {\r\n//create the HTML file and send the email\r\nvar email = retrieveAnnouncement(reminder_doc_id);\r\n//send email\r\nGmailApp.sendEmail(labEmail, \"Newsletter Submission Reminder\", \"Error Sending Email\", {htmlBody: email});\r\n}", "title": "" }, { "docid": "ab9b300bfebde2a4a995f72502cd0d5f", "score": "0.62374383", "text": "function show_notification() {\n chrome.storage.sync.get(\"notifications\", function(data) {\n if (data.notifications && data.notifications === \"on\") {\n var notification = webkitNotifications.createNotification(\n \"icon_128.png\",\n \"WaniKani\",\n \"You have new reviews on WaniKani!\"\n );\n notification.show();\n }\n });\n}", "title": "" }, { "docid": "9ac3ffcc26c00c3dd7d8f343aa2e8653", "score": "0.61899716", "text": "function getNotificationMessage(code){\n\tvar currentLanguage = LANGUAGE_ENGLISH;\n\tvar msg = 'default notification';\n\t\n\tif(code == NOTIFICATION_NEW_FOLLOWER){\n\t\tmsg = \"is now following you.\";\n\t} else if(code == NOTIFICATION_WALK_REQUEST){\n\t\tmsg = \"requested a dog walk.\";\n\t} else if(code == NOTIFICATION_COMMENT_ACTIVITY){\n\t\tmsg = \"commented on your activity.\";\n\t} else if(code == NOTIFICATION_LIKE_ACTIVITY){\n\t\tmsg = \"liked your activity.\";\t\n\t} else if(code == NOTIFICATION_AWARD_BADGE){\n\t\tmsg = \"You earned a new badge!\";\n\t}\n\t\n\treturn msg;\n}", "title": "" }, { "docid": "d32809d3ddec6550c02ab82d6e91bc5a", "score": "0.61819595", "text": "function newTeamNotify(com_id, comName){\n //com_id = '22';\n //comName = 'aaa';\n MailApp.sendEmail({to:\"iboostzone@gmail.com,tngrant@ryerson.ca, jpsilva@ryerson.ca\" , subject: \"New Team Registered\", htmlBody: \"The Following Team has Registered: <br><br><br> Company Name: \" + comName + \"<br><br> iBoost Team ID : \" + com_id+\"<br><br><br><br> Best, <br><br> <img src='cid:logo' height='50' width='150'>\", inlineImages:{logo: imageLogo}});\n}", "title": "" }, { "docid": "830a5bf1848a5955059e0db658677194", "score": "0.6161583", "text": "showNotification(data) {\n var opt = {\n type: \"basic\",\n title: \"TeamPlay\",\n message: \"Your final score was \" + data.score + \".\",\n iconUrl: \"./images/icon-32.png\"\n }\n chrome.notifications.create(this.uuidv4(), opt, null);\n }", "title": "" }, { "docid": "5404ea1b2cfd248c34506063bf5a15bf", "score": "0.6133334", "text": "function notify(messsages){\n const totalMessages=messsages.length;\n if(totalMessages!=0){\n const notifyString=`You have ${totalMessages} new ${totalMessages==1?\"message\":\"messages\"}`;\n notifier.notify({\n title:\"GmailFilteredNotify\",\n message:notifyString\n });\n console.log(\"**************************************\");\n console.log(notifyString);\n const currentTime=new Date().toString();\n console.log(currentTime);\n console.log(\"**************************************\");\n messsages.forEach(message=>{\n console.log(message.from);\n console.log(message.snippet);\n console.log(\"-------------------\");\n })\n }\n else{\n console.log(\"**************************************\");\n console.log(\"No New Message\");\n const currentTime=new Date().toString();\n console.log(currentTime);\n console.log(\"**************************************\");\n }\n}", "title": "" }, { "docid": "bf7c6488c83e501c019e152a0a4adf2c", "score": "0.60601974", "text": "function showAuthNotification() {\n console.log('showAuthNotification');\n var options = {\n 'id': 'start-auth',\n 'iconUrl': 'img/developers-logo.png',\n 'title': 'GDE Sample: Chrome extension Google APIs',\n 'message': 'Click here to authorize access to Gmail',\n };\n createBasicNotification(options);\n}", "title": "" }, { "docid": "38b3c0c52b402e254c5a6d6f5485ca77", "score": "0.6007817", "text": "function notifyMe(notificationMessage) {\n if (!(\"Notification\" in window)) {\n alert(\"This browser does not support desktop notification\");\n }\n else if (Notification.permission === \"granted\") {\n var notification = new Notification(\"Attention!\", {\n tag : \"ache-mail\",\n body: notificationMessage,\n });\n }\n else if (Notification.permission !== 'denied') {\n Notification.requestPermission(function (permission) {\n if (permission === \"granted\") {\n var notification = new Notification(notificationMessage);\n }\n });\n }\n }", "title": "" }, { "docid": "9d716b4eca1ebc9d03884f4792d76f70", "score": "0.6000714", "text": "function notify(string) {\n // Construct email template for notifications\n // Must have to, subject, htmlBody\n var emailTemplate = {\n to: emailForNotify,\n subject: accountName,\n htmlBody: \"<h1>Comporium Media Services Automation Scripts</h1>\" + \"<br>\" + \"<p>This account has encountered an issue</p>\" + accountName +\n \"<br>\" + \"<p>The issue is with this campaign: </p>\" + campaignName + \"<br>\" + \"<p>This is what is wrong - </p>\" + \"<br>\"\n + string + \"<p>Total Impressions Currently: \" + avgImpressions + \"<br>\" +\"<p>If something is incorrect with this notification please reply to this email. Thanks!</p>\"\n }\n MailApp.sendEmail(emailTemplate);\n }", "title": "" }, { "docid": "752b7b960aaa6021d86291613e91f7ed", "score": "0.5995623", "text": "function acceptNotification(email, name, appId) {\n //email = 'writetoraminderpal@gmail.com';\n //name = 'name';\n //appId = '222';\n \n var html = \"<p>Dear \"+name+\",\"+\"</p><p>We are happy to inform you that your iBoost application has been accepted.\"+\n \"</p><p> Please follow these next steps to officially register your team. Ensure you read through the information carefully, ALSO PLEASE SECURELY SAVE YOUR iBoost Team ID. You will need this throughout your time at iBoost\"+\n \n \"</p><p>Your iBoost Team ID: \"+appId+\"</p><p>Please click <a href='www.iboostzone.com/onboarding/registration'>here</a> to register your team at iBoost.<br><br><br><br><p>Best,</p><br><img src='cid:logo' height='50' width='150'>\";\n var template = HtmlService.createHtmlOutput(html).getContent();\n //Logger.log(template)\n MailApp.sendEmail(email, \"iBoost Application Review\",\"\", {htmlBody: template, inlineImages:{logo: imageLogo}});\n \n}", "title": "" }, { "docid": "37ffe4a5f962ec7265b2d46e1fdd1b71", "score": "0.5959456", "text": "function notify(string) {\n // Construct email template for notifications\n // Must have to, subject, htmlBody\n var emailTemplate = {\n to: emailForNotify,\n subject: accountName,\n htmlBody: \"<h1>Comporium Media Services Automation Scripts</h1>\" + \"<br>\" + \"<p>This account has encountered an issue</p>\" + accountName +\n \"<br>\" + \"<p>The issue is with this campaign: </p>\" + campaignName + \"<br>\" + \"<p>This is what is wrong - </p>\" + \"<br>\"\n + string + \"<br>\" + \"Ads Disapproved = \" + adDisapproval +\"<p>If something is incorrect with this notification please forward this email to eric.king@comporium.com. Thanks!</p>\"\n }\n MailApp.sendEmail(emailTemplate);\n }", "title": "" }, { "docid": "8cbfedee6fa0e1985b7ff1b573515a03", "score": "0.59550303", "text": "function sendNewMessage() {\n var myText = document.getElementById(\"myText\").value;\n var mySubject = document.getElementById(\"mySubject\").value;\n dynamicSeperation();\n gapi.client.load('gmail', 'v1', function () {\n var receiver;\n var carriers = ['@mmode.com', '@tmomail.net', '@@vtext.com', '@messaging.sprintpcs.com'];\n for (var i = 0; i < phoneNumber.length; i++) {\n for (var b = 0; b < carriers.length; b++) {\n console.log(phoneNumber[i].replace(/[/-]/g, '').replace(/[' )(']/g, '') + carriers[b]);\n email.push(phoneNumber[i].replace(/[/-]/g, '').replace(/[' )(']/g, '') + carriers[b]);\n }\n }\n for (var i = 0; i < email.length; i++) {\n receiver = email[i];\n\n // Encrypt in Base64\n var encryptedEmail = btoa(\"Content-Type: text/plain; charset=\\\"UTF-8\\\"\\n\" + \"Content-length: 5000\\n\" + \"Content-Transfer-Encoding: message/rfc2822\\n\" + \"to: \" + receiver + \"\\n\" + \"from: \\\"Talako\\\" me\\n\" + \"subject: \" + mySubject + \"\\n\\n\" + myText).replace(/\\+/g, '-').replace(/\\//g, '_');\n var mailToBeSent = encryptedEmail;\n console.log(mailToBeSent);\n var inquiry = gapi.client.gmail.users.messages.send({\n 'userId': \"me\"\n , 'resource': {\n 'raw': mailToBeSent\n }\n });\n inquiry.execute(function (result) {\n console.log(result);\n });\n }\n });\n}", "title": "" }, { "docid": "21e7cca1489690c08ecc64a04a06b9aa", "score": "0.59359413", "text": "function newMemNotify(com_id, comName, memName ){\n \n //com_id = \"df25656\";\n //comName = \"abc\";\n //memName = \"mnk\";\n var url = SpreadsheetApp.getActiveSpreadsheet().getUrl();\n //Logger.log(url);\n\n var h = \"<p> A new member has registered under the following company:\"+\n \"</p><p>Company Name: \" + comName + \"</p><p> iBoost Team ID: \" + com_id + \"</p><p> Member Name: \" + memName +\n \"</p><p> Please click <a href=\"+url+\"> Here </a> to accept them into iBoost.<br><br><br><br><p>Best,</p><br><img src='cid:logo' height='50' width='150'>\";\n var temp = HtmlService.createHtmlOutput(h).getContent();\n MailApp.sendEmail(\"iboostzone@gmail.com, tngrant@ryerson.ca, jpsilva@ryerson.ca\", \"A New Member Has Registered\",\"\", {htmlBody: temp, inlineImages:{logo: imageLogo}});\n}", "title": "" }, { "docid": "11da885b7debe0c37a5f908f7cbb2da1", "score": "0.59337884", "text": "function notify(message) {\n console.log(\"Creating a notification....\");\n chrome.notifications.create({\n \"type\": \"basic\",\n \"iconUrl\": \"http://www.google.com/favicon.ico\",\n \"title\": \"Notification\",\n \"priority\": 1,\n \"message\": message.url\n });\n}", "title": "" }, { "docid": "1e271468cc15882b021fa75192f3b951", "score": "0.5917422", "text": "sendSampleMail(auth, toEmail, cb) {\r\n var gmailClass = google.gmail('v1');\r\n\r\n var email_lines = [];\r\n\r\n email_lines.push('From: <thedonutbaron3@gmail.com>');\r\n email_lines.push('To: ' + toEmail);\r\n email_lines.push('Content-type: text/html;charset=iso-8859-1');\r\n email_lines.push('MIME-Version: 1.0');\r\n email_lines.push('Subject: Your Donut Day');\r\n email_lines.push('');\r\n email_lines.push('Just a reminder that tomorrow is your donut day!<br/>');\r\n email_lines.push('<b>-The Donut Baron</b>');\r\n\r\n var email = email_lines.join('\\r\\n').trim();\r\n\r\n var base64EncodedEmail = new Buffer(email).toString('base64');\r\n base64EncodedEmail = base64EncodedEmail.replace(/\\+/g, '-').replace(/\\//g, '_');\r\n\r\n gmailClass.users.messages.send({\r\n auth: auth,\r\n userId: 'me',\r\n resource: {\r\n raw: base64EncodedEmail\r\n }\r\n }, cb);\r\n }", "title": "" }, { "docid": "7d73c405c7cca5a78f0ac6be69574599", "score": "0.5915688", "text": "function showNotifikasiBadge() {\n const title = 'Notifikasi dengan Badge';\n const options = {\n 'body': 'Ini adalah konten notifikasi dengan gambar badge.',\n 'badge': './icon.png'\n };\n if (Notification.permission === 'granted') {\n navigator.serviceWorker.ready.then(function(registration) {\n registration.showNotification(title, options);\n });\n } else {\n console.error('Fitur notifikasi tidak diijinkan.');\n }\n}", "title": "" }, { "docid": "b2cfd6e5ec9512ce202745c064d1e184", "score": "0.5908956", "text": "get notification() {\n return NotificationMessage.exist[this.type];\n }", "title": "" }, { "docid": "6efcd472013a7d7b52f2f8b42245ec9d", "score": "0.5903839", "text": "function show(body,id) {\n\n var time = /(..)(:..)/.exec(new Date()); // The prettyprinted time.\n var hour = time[1] % 12 || 12; // The prettyprinted hour.\n var period = time[1] < 12 ? 'a.m.' : 'p.m.'; // The period of the day.\n // new Notification(hour + time[2] + ' ' + period, {\n // icon: '48.png',\n // body: body\n // });\n var opt = {\n type: \"list\",\n title: hour + time[2] + ' ' + period,\n message: \"Primary message to display\",\n iconUrl: \"48.png\",\n items: body,\n buttons: [{title:'去看看'}]\n };\n chrome.notifications.create((new Date()).valueOf()+':'+id, opt, function(notificationId){\n console.log('show notification');\n });\n}", "title": "" }, { "docid": "774106241c9c5449d731aa2e5f4cf1bc", "score": "0.5882596", "text": "function notifyMe(data) {\n const textsPerType = {\n idle: {\n title: \"Don't stay idle!!!\",\n body: data => {\n return \"Hey there! You've been idle for \" + data.idleTime + ' minute(s)';\n }\n },\n done: {\n title: 'Timer complete',\n body: data => {\n return \"Feel free to take a break! Do it!\";\n }\n }\n };\n const texts = textsPerType[data.type];\n // Request permission if not yet granted\n if (Notification.permission !== \"granted\") {\n Notification.requestPermission();\n }\n else {\n var notification = new Notification(texts.title, {\n icon: 'https://ares.gods.ovh/img/Tomato_icon-icons.com_68675.png',\n body: texts.body(data),\n });\n\n notification.onclick = function () {\n window.open(\"http://stackoverflow.com/a/13328397/1269037\"); \n };\n }\n }", "title": "" }, { "docid": "69f19d89891dc96020be5d83b2e45eca", "score": "0.5862402", "text": "generateMetadataString(notification) {\n const { regions } = this.props;\n const regionNames = notification.regionIds.map(regionID =>\n regions[regionID] ? regions[regionID].name : `Region ${regionID}`\n );\n const formattedRegionNames = regionNames.join(\", \");\n const timestamp = notification.occurredAt;\n const timeString = timestampToTimeString(timestamp);\n const dateString = timestampToShortDateString(timestamp);\n return `Sent to ${formattedRegionNames} @ ${timeString} on ${dateString}`;\n }", "title": "" }, { "docid": "b83fff5e876df6d13c70214b5fcf1136", "score": "0.58263844", "text": "function getEmail(){\n// Load the oauth2 libraries to enable the userinfo methods.\n gapi.client.load('oauth2', 'v2', function() {\n var request = gapi.client.oauth2.userinfo.get();\n request.execute(getEmailCallback);\n });\n}", "title": "" }, { "docid": "9dde59ea5a55891367b93ad4004d531d", "score": "0.58227587", "text": "function ListMessages(auth) {\n var gmail = google.gmail('v1');\n var query= \"from: notifications@github.com view pull request\";\n nock('https://www.googleapis.com/gmail/v1/users')\n\t.get('/jaga4494/messages').reply(200, {\n\t\tusername: 'davidwalshblog',\n\t\tfirstname: 'David'\n\t});\n return new Promise(function (resolve, reject) \n\t{\n\n gmail.users.messages.list({\n auth: auth,\n userId: 'me',\n q: query,\n }, \n \n function(err, response,body) {\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n var obj = JSON.parse(body);\n resolve(obj);\n\n /*\n var msgs = response.messages;\n console.log('- %s', msgs);\n if (msgs.length == 0) {\n console.log('No message found.');\n } else {\n console.log('Message:');\n \n \n //console.log('- %s', msgs.messages[1].id);\n \n for (var i = 0; i < msgs.length; i++) {\n var msg = msgs[i];\n console.log('- %s', msg.id);\n }\n \n }*/\n });\n});\n}", "title": "" }, { "docid": "9dde59ea5a55891367b93ad4004d531d", "score": "0.58227587", "text": "function ListMessages(auth) {\n var gmail = google.gmail('v1');\n var query= \"from: notifications@github.com view pull request\";\n nock('https://www.googleapis.com/gmail/v1/users')\n\t.get('/jaga4494/messages').reply(200, {\n\t\tusername: 'davidwalshblog',\n\t\tfirstname: 'David'\n\t});\n return new Promise(function (resolve, reject) \n\t{\n\n gmail.users.messages.list({\n auth: auth,\n userId: 'me',\n q: query,\n }, \n \n function(err, response,body) {\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n var obj = JSON.parse(body);\n resolve(obj);\n\n /*\n var msgs = response.messages;\n console.log('- %s', msgs);\n if (msgs.length == 0) {\n console.log('No message found.');\n } else {\n console.log('Message:');\n \n \n //console.log('- %s', msgs.messages[1].id);\n \n for (var i = 0; i < msgs.length; i++) {\n var msg = msgs[i];\n console.log('- %s', msg.id);\n }\n \n }*/\n });\n});\n}", "title": "" }, { "docid": "e87b49fafd8107c14566f6eb4664e4e0", "score": "0.5810141", "text": "sendMail(encodedMessage){\n\t\tthis.gmail.users.messages.send({\n\t\t\tuserId: \"me\",\n\t\t\tresource: {\n\t\t\t\traw: encodedMessage,\n\t\t\t}\n\t\t}, (err, result) => {\n\t\t\tif(err){\n\t\t\t\treturn console.log('NODEMAILER - The API returned an error: ' + err);\n\t\t\t}\n\t\t\t\t\n\t\t\tconsole.log(\"NODEMAILER - Sending email reply from server:\", result.data);\n\t\t});\n\t}", "title": "" }, { "docid": "cdcffd26f053d958e67e28a5cdac55f6", "score": "0.5807011", "text": "function getEmail(responseBody) {\n var doc = getDocumentFromResponseBody(responseBody);\n var text = doc.querySelector('div.notification').innerText;\n var splits = text.split(\" \");\n return splits[splits.length - 1].trim();\n}", "title": "" }, { "docid": "d39743c750a3953a80837599e702325a", "score": "0.5791931", "text": "get notificationText() {\n return `Notification from ${this.#appName}`;\n }", "title": "" }, { "docid": "f847d54a7f9daf300d51977ae6df4ffb", "score": "0.5791291", "text": "function sendMessage(payload) {\n console.log(\"Sending email notification...\");\n var smtpTransport = mailer.createTransport(\"SMTP\",{\n service: \"Gmail\",\n auth: {\n user: \"<Google username>\",\n pass: \"<your Google application-specific password>\"\n }\n });\n\n var mailOptions = {\n from: \"<email>\", // sender address\n to: \"<email>\", // list of receivers\n subject: \"Notification from Node.js\", // Subject line\n text: \"You are hereby notified!\", // plaintext body\n html: \"<b>You are hereby notified!</b>\" // html body\n };\n\n smtpTransport.sendMail(mailOptions, function(error, response){\n if(error) console.log(\"Error sending mail: \" + error);\n else console.log(\"Message sent: \" + response.message);\n\n smtpTransport.close(); // shut down the connection pool, no more messages\n });\n}", "title": "" }, { "docid": "1aba4ed7d4f3a6fc8e94838e4cd46f0e", "score": "0.5772568", "text": "function displayItemDetails(){\r\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\r\n jQuery('#subject').text(item.subject);\r\n\r\n var from;\r\n if (item.itemType === Office.MailboxEnums.ItemType.Message) {\r\n from = Office.cast.item.toMessageRead(item).from;\r\n } else if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {\r\n from = Office.cast.item.toAppointmentRead(item).organizer;\r\n }\r\n\r\n if (from) {\r\n jQuery('#from').text(from.displayName);\r\n jQuery('#from').click(function(){\r\n app.showNotification(from.displayName, from.emailAddress);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "89cba1dff9d35211c70549c8a26c8b85", "score": "0.5759557", "text": "function notify(from, align, icon, type, title, message) {\n $.growl({\n icon: icon,\n title: title,\n message: message,\n url: ''\n },{\n element: 'body',\n type: type,\n allow_dismiss: true,\n placement: {\n from: from,\n align: align\n },\n offset: {\n x: 30,\n y: 30\n },\n spacing: 10,\n z_index: 1031,\n delay: 2500,\n timer: 1000,\n url_target: '_blank',\n mouse_over: false,\n icon_type: 'class',\n template: '<div data-growl=\"container\" class=\"alert\" role=\"alert\">' +\n '<button type=\"button\" class=\"close\" data-growl=\"dismiss\">' +\n '<span aria-hidden=\"true\">&times;</span>' +\n '<span class=\"sr-only\">Close</span>' +\n '</button>' +\n '<span data-growl=\"icon\"></span>' +\n '<span data-growl=\"title\"></span>' +\n '<span data-growl=\"message\"></span>' +\n '<a href=\"#\" data-growl=\"url\"></a>' +\n '</div>'\n });\n}", "title": "" }, { "docid": "135e45858d9f78d66bffe534f488a2c3", "score": "0.5753281", "text": "function notificate(title, message) {\n\twebkitNotifications.createNotification(\"icon.png\", title, message).show();\n}", "title": "" }, { "docid": "3ea1f50bd0a1cea4ec48ad0c403f6ccf", "score": "0.57531834", "text": "function buildNotification(notifInfos, body) {\n let notification = {\n \"id\" : \"urn:ngsi-ld:Notification:\"+getRandomIntInclusive(1, 100000),\n \"type\" : \"Notification\",\n \"subscriptionId\" : notifInfos.subscriptionId,\n \"context\" : \"http://uri.etsi.org/ngsi-ld/notification\",\n \"notifiedAt\": Date(),\n \"data\": body\n };\n return notification;\n}", "title": "" }, { "docid": "eb86114f2545c9830262b0808936a158", "score": "0.5748112", "text": "function showNotification(msg, type) {\n if (!(new RegExp(/^(success|normal|error|warning)$/).test(type))) {\n type = \"normal\";\n }\n msg = ScapString(msg);\n\n if (type === \"success\") {\n $.growl.notice({ message: msg });\n } else if (type === \"error\") {\n $.growl.error({ message: msg });\n } else if (type === \"warning\") {\n $.growl.warning({ message: msg });\n } else {\n $.growl({ title: \"Information\", message: msg });\n }\n}", "title": "" }, { "docid": "db8bf4208d66c3194d54825ac0ae293e", "score": "0.5744306", "text": "sendEmail(to, subject, message) {\n // TODO: get \"from\" email from logged-in user's profile\n // actually somehow it does send it from the correct person (instead of mlumtest) when you log in as that person?\n let from = \"mlumtest@gmail.com\";\n\n let raw = Google.makeBody(from, to, subject, message);\n\n gapi.client.gmail.users.messages\n .send({\n userId: \"me\",\n resource: {\n raw: raw,\n },\n })\n .then((res) => {\n console.log(res);\n })\n .catch((err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "37c90da9bccc6bea0446b1ab98a577aa", "score": "0.5738528", "text": "function getEmail(auth){\n console.log(auth)\n let messageList = [];\n const gmail = google.gmail({version: 'v1' , auth});\n gmail.users.messages.list({auth: auth , userId: 'me' , maxResults: 3} , function(err , response){\n if(err){\n console.log('An error occured..' + err);\n return;\n }\n response.data.messages.forEach((ob) => {\n \n gmail.users.messages.get({auth: auth , userId: 'me' , 'id': ob.id} , function(err , response){\n if(err){\n console.log|('An error occured 2 + ' + err);\n return;\n }\n message_raw = response.data.payload.body.data\n // console.log(message_raw)\n const buff = new Buffer.from(message_raw , 'base64')\n text = buff.toString()\n console.log(text)\n messageList.push(text)\n })\n })\n \n })\n return messageList\n}", "title": "" }, { "docid": "aa247c1b0e9bc6e9377fd695323cf327", "score": "0.5737984", "text": "function showNotifikasiGambar() {\n const title = 'Notifikasi dengan Gambar';\n const options = {\n 'body': 'Ini adalah konten notifikasi dengan gambar latar.',\n 'image': './icon.png'\n };\n if (Notification.permission === 'granted') {\n navigator.serviceWorker.ready.then(function(registration) {\n registration.showNotification(title, options);\n });\n } else {\n console.error('Fitur notifikasi tidak diijinkan.');\n }\n}", "title": "" }, { "docid": "4f9bca0c1c039d3ec9e9cd27e7d705b7", "score": "0.5701397", "text": "function displayNotification() {\n if (Notification.permission == 'granted') {\n navigator.serviceWorker.getRegistration().then(function (reg) {\n var options = {\n body: 'Check out the latest News',\n icon: 'img/sk-badge-pink.png',\n vibrate: [100, 50, 100],\n data: {\n dateOfArrival: Date.now(),\n primaryKey: 1\n },\n actions: [{\n action: 'explore',\n title: 'go directly to the website',\n icon: 'img/sk-badge-pink.png'\n },\n {\n action: 'close',\n title: 'Close notification',\n icon: 'img/sk-badge-pink.png'\n },\n ]\n };\n reg.showNotification('Dont miss it!', options);\n });\n }\n}", "title": "" }, { "docid": "769d0926992470a6e75b30a7e0396304", "score": "0.5697648", "text": "function displayNotification() {\n if (Notification.permission === 'granted') {\n navigator.serviceWorker.getRegistration().then(function(reg) {\n var options = {\n body: 'Here is a notification body!',\n icon: 'images/example.png',\n vibrate: [100, 50, 100],\n data: {\n dateOfArrival: Date.now(),\n primaryKey: 1\n },\n actions: [\n {\n action: 'explore', title: 'Explore this new world'\n },\n {\n action: 'close', title: 'Close notification'\n }\n ]\n };\n reg.showNotification('Hello world!', options);\n });\n }\n}", "title": "" }, { "docid": "bbf8c50b167aae1d3bb391a18eaa3691", "score": "0.56953704", "text": "function sendNotification(){\n var msg = \"Edited at: \" + new Date().toTimeString(); \n SharedDb.sendGCM(msg);\n}", "title": "" }, { "docid": "3294acf3973ae131da0b1a996c502207", "score": "0.5683315", "text": "function showNotification(title , content){\t\n\tvar notification = webkitNotifications.createNotification(\n\t\t'icon48.png', // The image.\n\t\t title,\n\t\t content\n\t);\n\tnotification.show();\n}", "title": "" }, { "docid": "f07fbb83130dab5fc6480058a2ee07c7", "score": "0.56749314", "text": "function Html5notification() {\n\tvar h5n = new Object();\n\n\th5n.issupport = function() {\n\t\treturn 'Notification' in window;\n\t};\n\n\th5n.shownotification = function(replaceid, url, imgurl, subject, message) {\n\t\tif (Notification.permission === 'granted') {\n\t\t\tsendit();\n\t\t} else if (Notification.permission !== 'denied') {\n\t\t\tNotification.requestPermission().then(function (perm) {\n\t\t\t\tif (perm === 'granted') {\n\t\t\t\t\tsendit();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfunction sendit() {\n\t\t\tvar n = new Notification(subject, {\n\t\t\t\ttag: replaceid,\n\t\t\t\ticon: imgurl,\n\t\t\t\tbody: message\n\t\t\t});\n\t\t\tn.onclick = function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t};\n\t\t}\n\t};\n\n\treturn h5n;\n}", "title": "" }, { "docid": "598f036cf485e0cc8c3a8d2b252ed154", "score": "0.5670188", "text": "function notify(message){\n chrome.notifications.create(null, message, null)\n\n}", "title": "" }, { "docid": "e7ed2b8af8bfc113f19c2c5e099b15b3", "score": "0.5668732", "text": "function notify() {\n var msg = \"It's Business Time!\"\n // check if the browser supports notifications\n if ((\"Notification\" in window) && (Notification.permission === \"granted\")) {\n var image = 'img/commode.png';\n var options = {\n icon: image\n }\n var notification = new Notification(msg, options);\n } else {\n // fall back to a standard alert, which is still going to be pretty visible\n window.alert(msg);\n }\n}", "title": "" }, { "docid": "d7a12ae01fa36ead31fa80c0e021f75e", "score": "0.56671864", "text": "function syncID(gmailMessageID) {\n\n let newLabelsToAdd;\n let newLabelsToRemove = [];\n\n var whoAmI;\n\n gapi.client.gmail.users.getProfile({\n userId: \"me\"\n })\n .then(function(response){\n\n // console.log('from get profile', response)\n whoAmI = response.result.emailAddress; \n\n gapi.client.gmail.users.messages.get({\n 'id': gmailMessageID,\n 'userId': 'me',\n 'format': 'metadata'\n })\n .then(function(jsonresp, rawresp) {\n // console.log('HERE IS THE WHOLE JSONRESP', jsonresp);\n\n for (var i = 0; i < jsonresp.result.payload.headers.length; i++) {\n\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"DELIVERED-TO\") {\n memberEmailAddress = jsonresp.result.payload.headers[i].value;\n }\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"MESSAGE-ID\") {\n messageID = jsonresp.result.payload.headers[i].value;\n }\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"DATE\") {\n var date = jsonresp.result.payload.headers[i].value;\n }\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"TO\") {\n var emailTo = jsonresp.result.payload.headers[i].value;\n }\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"FROM\") {\n var emailFrom = jsonresp.result.payload.headers[i].value;\n }\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"SUBJECT\") {\n var subject = jsonresp.result.payload.headers[i].value;\n }\n if (jsonresp.result.payload.headers[i].name.toUpperCase() === \"X-FORWARDED-TO\") {\n forwardedTo = jsonresp.result.payload.headers[i].value;\n }\n } // closes for loop\n\n gmailMessageID = jsonresp.result.id;\n gmailThreadID = jsonresp.result.threadId;\n messageHash = hashCode(messageID);\n\n if (!messagesDatabase) messagesDatabase = {};\n if (!messagesDatabase[messageHash]) messagesDatabase[messageHash] = {};\n if (!messagesDatabase[messageHash].gmailThreadIDs) messagesDatabase[messageHash].gmailThreadIDs = {};\n\n // BELINDA AND KATHY ADDING STUFF AT 9:20 ON MONDAY NIGHT SO SAD\n\n\n messagesDatabase[messageHash][\"gmailThreadIDs\"][gmailThreadID] = whoAmI;\n\n if (!messagesDatabase[messageHash].appliedSharedLabels) messagesDatabase[messageHash].appliedSharedLabels = {};\n // messagesDatabase[messageHash].appliedSharedLabels[\"boogie\"] = \"woogie\";\n\n\n\n // // Saves updates.\n messages.update(messagesDatabase);\n\n messages.child(messageHash).child(\"appliedSharedLabels\").on(\"child_added\", \n function(snapshot) {\n\n newAssignee = snapshot.val();\n\n console.log(\"newAssignee: \", newAssignee);\n\n if (newAssignee) {\n\n console.log(messageHash + \" has a new value for appliedSharedLabels: \", newAssignee);\n\n }\n\n gapi.client.gmail.users.labels.list({\n 'userId': 'me'\n })\n .then(function(response) {\n\n let newArrayOfLabelObjects = response.result.labels;\n // let newLabelDictionary = {};\n\n // for (let obj of newArrayOfLabelObjects) {\n // newLabelDictionary[obj.name] = obj.id;\n // }\n\n // let newLabelID = newLabelDictionary[newAssignee];\n\n newArrayOfLabelObjects.forEach(function(labelObject) {\n if (labelObject.name === newAssignee) {\n newLabelID = labelObject.id;\n }\n })\n\n newLabelsToAdd = [newLabelID];\n\n console.log(\"hopefully labelID: \", newLabelID);\n console.log(\"newLabelsToAdd: \", newLabelsToAdd);\n console.log(\"newAssignee: \", newAssignee);\n\n return gapi.client.gmail.users.threads.modify({\n 'userId': 'me',\n 'id': gmailThreadID,\n 'addLabelIds': newLabelsToAdd,\n 'removeLabelIds': newLabelsToRemove\n });\n })\n\n }) // closes callback\n\n return {\n memberEmailAddress: memberEmailAddress,\n messageHash: messageHash,\n gmailThreadID: gmailThreadID,\n date: date,\n to: emailTo,\n from: emailFrom,\n subject: subject\n };\n })\n .then(function(response) {\n\n // console.log(\"email to sync: \", response);\n\n })\n })\n\n // .catch(function(error) {\n // console.log(\"add label error: \", error);\n // })\n} // closes syncID", "title": "" }, { "docid": "bd51c97fe0a1d429781b9e2d0b921332", "score": "0.56615293", "text": "function notify(message) {\r\n browser.notifications.create({\r\n \"type\": \"basic\",\r\n \"iconUrl\": browser.runtime.getURL(\"icons/ham.svg\"),\r\n \"title\": \"Thunderham\",\r\n \"message\": message\r\n });\r\n}", "title": "" }, { "docid": "6d4f92f47a3fab96561f4b92395319da", "score": "0.5659658", "text": "function notify(message, title, type) {\n return addNotification({\n title : title || '',\n type : type || _notificationView.type().DEFAULT,\n message: message\n });\n }", "title": "" }, { "docid": "04e61bcd34ca39adcaa9f3eb7c2d7116", "score": "0.56517667", "text": "function addNotification(message,type){\n var notify = $.notify(message, {\n type: type,\n placement: {\n from: \"top\",\n align: \"center\"\n },\n offset: {\n y: 100\n },\n animate: {\n enter: 'animations scaleIn',\n exit: 'animations scaleOut'\n }\n });\n}", "title": "" }, { "docid": "a0ebe2631b4a53ca681771c32d377afc", "score": "0.5643909", "text": "function showNotifikasiTag() {\n const title1 = 'Notifikasi dengan Tag - 1';\n const options1 = {\n body: 'Anggota tag 1',\n tag: 'message-group-1'\n };\n // notifikasi kedua\n const title2 = 'Notifikasi dengan Tag - 2';\n const options2 = {\n body: 'Anggota tag 2',\n tag: 'message-group-2'\n };\n // notifikasi ketiga\n const title3 = 'Notifikasi dengan Tag - 3';\n const options3 = {\n body: 'Anggota tag 1',\n tag: 'message-group-1'\n };\n if (Notification.permission === 'granted') {\n navigator.serviceWorker.ready.then(function(registration) {\n registration.showNotification(title1, options1);\n registration.showNotification(title2, options2);\n registration.showNotification(title3, options3);\n });\n } else {\n console.error('Fitur notifikasi tidak diijinkan.');\n }\n}", "title": "" }, { "docid": "31daaba38e1aaba264461ce6acc364e1", "score": "0.56425494", "text": "function sendNotificationEmail(){\n \n var htmlBody = '<html><body>Your AdWords URL Checker Summary for ' + ACCOUNT_NAME + ' is available at ' + SPREADSHEET_URL + '.</body></html>';\n var date = new Date();\n var subject = 'AdWords URL Checker Summary Results for ' + ACCOUNT_NAME + ' ' + date;\n var body = subject;\n var options = { htmlBody : htmlBody };\n \n for(var i in NOTIFY) {\n MailApp.sendEmail(NOTIFY[i], subject, body, options);\n Logger.log(\"An Email has been sent.\");\n }\n}", "title": "" }, { "docid": "b6cee430d146628c0ee1578b8e78fc1c", "score": "0.56425333", "text": "function info(message) {\r\n\tnotify(\"Information\", message);\r\n}", "title": "" }, { "docid": "007f382b63df8a37d218646a0dbd10da", "score": "0.5637594", "text": "function getnotifications() {\n\t\n\t// get notifications for the user\n\tajax(\"getnotifications\",{},function(d) {\n\t\tvar o = JSON.parse(d.substring(1,d.length-1));\n\t\thtml(\"menu2\",notifications(o));\n\t});\n\t\n}", "title": "" }, { "docid": "ec08f54e32bafbc3cc2b946fd316ba07", "score": "0.56092834", "text": "static info(message, duration = 3000) {\n this.sendNotification(message, 'info', duration);\n }", "title": "" }, { "docid": "3571877b225828a519d54b67cc2f892f", "score": "0.56086814", "text": "function sendMessage(auth) {\n // Makebody function is called to send the raw information.\n // Change to:sheikmagdhoom1500@gmail.com to TO mail Address\n // Change From:testmagdhoom@gmail.com to the FROM mail Address\n var raw = makeBody('sheikmagdhoom1500@gmail.com', 'testmagdhoom@gmail.com', 'Assessment', 'I am very happy to be a part of this assessment!!!');\n const gmail = google.gmail({ version: 'v1', auth });\n gmail.users.messages.send({\n auth: auth,\n userId: 'me',\n resource: {\n raw: raw\n }\n\n }, function (err, response) {\n return (err || response)\n });\n}", "title": "" }, { "docid": "d08dc2ecafed9968ef7bfa8562644139", "score": "0.5589424", "text": "function testAnnouncement(){\r\n //open announcement doc\r\n var docID = '12b9LNsjeh6ac3qlhRHTjvDQeNBgbsBVlhkbHlIk5NCU'; \r\n var announcement = [];\r\n announcement = convertToHTML(docID);\r\n\r\n //create email\r\n var email = [\r\n '<!DOCTYPE html>',\r\n '<html>',\r\n '<head>',\r\n '<style>',\r\n 'table {width: 800px;margin: 20px;}',\r\n 'table, th, td {border-collapse: collapse;}',\r\n 'th, td {padding: 12px; text-align: left;}',\r\n 'table#t01 tr:nth-child(even) {background-color: ' + accentColor1 + ';}',\r\n 'table#t01 tr:nth-child(odd) {background-color: ' + accentColor2 + ';}',\r\n 'table#t01 th {background-color: #00A6D6; color: white;}',\r\n '</style>',\r\n '</head>',\r\n '<body>',\r\n '<table style=\"font-family:arial;\" id=\"t01\">',\r\n '<tr>',\r\n '<th style=\"text-align:center\">Announcements</th>',\r\n '</tr>',\r\n '<tr style = \"background-color: ' + accentColor1 + ';\">',\r\n '<td>' + announcement + '</td>',\r\n '</tr>',\r\n '</table>',\r\n '</body>',\r\n '</html>'\r\n ].join('\\n') \r\n //send email\r\n GmailApp.sendEmail(userEmail, \"Announcement Test\", \"error\", {htmlBody: email});\r\n}", "title": "" }, { "docid": "6f23149db363cbdee8270482ae9d1b93", "score": "0.5589343", "text": "function createInfoNotification(message, seconds){\n\tcreateNotification(message, \"info\", seconds);\n}", "title": "" }, { "docid": "c53504591d0337b043011e80413615d4", "score": "0.5588759", "text": "function onNotificationGCM(e)\n{\n switch (e.event)\n\t{\n case \"registered\":\n if (e.regid.length > 0)\n\t\t\t{\n localStorage.registrationId = e.regid;\n var jqxhr = $.ajax(\n\t\t\t\t{\n url: localStorage.registerPushnotificationRegIDURL + e.regid,\n type: \"GET\",\n dataType: \"json\"\n });\n\n }\n break;\n\n case \"message\":\n // if this flag is set, this notification happened while we were in the foreground.\n // you might want to play a sound to get the user's attention, throw up a dialog, etc.\n if (e.foreground)\n\t\t\t{\n // if the notification contains a soundname, play it.\n var my_media = new Media(\"/android_asset/www/\" + e.soundname);\n my_media.play();\n }\n break;\n }\n}", "title": "" }, { "docid": "3d93a6a7a50dbc94f8c2b152c5a6db13", "score": "0.5576156", "text": "info(message, title, options) {\n return this.notify(\"info\", message, title, \"icon-info-sign\", options);\n }", "title": "" }, { "docid": "3443a0e665eca3ac8c4d91488ac2a862", "score": "0.5569038", "text": "function getEmail(auth,messageId){\n const gmail = google.gmail({version:'v1',auth});\n gmail.users.messages.get({\n userId:'me',\n id:messageId\n }, (err,res)=>{\n if(err) return console.log(`the api returned an error ${err}`);\n const message = res.data;\n if(message){\n let sender = message.payload.headers.find((header)=>{\n return header.name === 'From'\n })\n sender = sender.value.substring(sender.value.indexOf('<'));\n sender = sender.replace('<','').replace('>','');\n user = verifyUser(sender);\n if(user){\n var fileName = message.payload.parts[1].filename;\n attachmentId = message.payload.parts[1].body.attachmentId\n let attachment = getAttachment(auth,messageId,attachmentId,sender);\n console.log(message);\n console.log(sender);\n }\n }else{\n console.log(`no message found`);\n }\n });\n}", "title": "" }, { "docid": "41933cc5d531f7cfe41a18d955b72493", "score": "0.5559753", "text": "getNotificationSubject (options) {\n\t\tconst { codemark, review, codeError, isReply, isReminder, creator, sender, user, isReplyToCodeAuthor } = options;\n\t\tconst thing = codeError || review || codemark;\n\t\tlet subject;\n\t\tif (isReminder) {\n\t\t\tconst fromName = creator ? sender.getUserDisplayName(creator, true) : 'The author of this feedback request'; // total fallback here\n\t\t\tsubject = `${fromName} is waiting for your feedback`;\n\t\t} else if (!user.isRegistered && review && !isReply) {\n\t\t\tconst fromName = creator ? sender.getUserDisplayName(creator, true) : 'The author of this feedback request'; // total fallback here\n\t\t\tsubject = `${fromName} is requesting a code review`;\n\t\t} else if (!user.isRegistered && isReplyToCodeAuthor) {\n\t\t\tconst fromName = creator ? sender.getUserDisplayName(creator, true) : 'The author of this feedback request'; // total fallback here\n\t\t\tsubject = `${fromName} commented on your changes`;\n\t\t} else {\t\n\t\t\tsubject = thing.title || thing.text || '';\n\t\t\tif (subject.length >= 80) {\n\t\t\t\tsubject = subject.substring(0, 80) + '...';\n\t\t\t}\n\t\t}\n\t\tif (isReply && !isReplyToCodeAuthor) {\n\t\t\tsubject = 're: ' + subject;\n\t\t}\n\t\treturn subject;\n\t}", "title": "" }, { "docid": "23730546d823de4f50b1e6bc11ba07fa", "score": "0.5553731", "text": "function generateNotification(title, content){\n if(Notification.permission !== 'granted'){\n Notification.requestPermission();\n }\n\n n = new Notification( title, {\n body: content,\n icon : \"/img/generation-finished.png\"\n });\n}", "title": "" }, { "docid": "01ff5d772aded929f78010c93d3ba219", "score": "0.5550808", "text": "function notify(data) {\n var mailOptions = {\n from: config.from,\n to: config.to, // comma separated list of receivers\n subject: config.subject, // Subject line\n html: '<b>' + data + '</b>' // html body};\n }\n smtpTransport.sendMail(mailOptions, function(err) {\n if (err)\n console.log(\"ohhh\", err);\n else\n \tconsole.log('Message sent.');\n\t});\n}", "title": "" }, { "docid": "3b37c62de7ad46d0ff3ab06ec0dd9d21", "score": "0.55406994", "text": "function notify(string) {\n MailApp.sendEmail(emailForNotify, accountName, string);\n }", "title": "" }, { "docid": "318040c0d09165a6afd0712fd858189a", "score": "0.55364746", "text": "function getMessage(userId, gmailId, gmailToken, id)\n{\n\tconsole.log(\"----------------Message Id: \" + id + \" Content-------------------\");\n var sync = true;\n var data = null;\n \n \n var options = {\n url: urlRoot + \"/\" + gmailId + '/messages/' + id,\n method: 'GET',\n headers: {\n \"content-type\": \"application/json\",\n\t\t\t\"Authorization\": \"Bearer \"+ gmailToken\n\t\t}\n };\n request(options, function (error, response, body)\n {\n //console.log(\"HTTP response headers are the following:\\n\" + \"Response: \" + JSON.stringify(response) + \"\\nError:\" + error + \"\\nBody\" + JSON.stringify(body) + \"\\n\");\n if (error)\n data = error;\n else{\n\t\t\tdata = JSON.parse(body);\n\t\t\t\n\t\t \n\t\t}\n sync = false;\n });\n while(sync) {require('deasync').sleep(100);}\n return data;\n\n}", "title": "" }, { "docid": "6c38e8d6251b0baacdd16ec92fcb67e1", "score": "0.5533901", "text": "function getCustomNotification(customMsg) {\n\t\t\tvar resultMsg = customMsg,\n\t\t\t\tcustomMsgT = '<ul class=\"ASWidget-customMsg-Ul\"><li class=\"normalPostEntryItem\">' +\n\t\t\t\t\t$('<div/>').addClass('container-ASWidgetAlert').append(createAlert(resultMsg, 'danger'))[0].outerHTML + '</li></ul>';\n\t\t\treturn customMsgT;\n\t\t}", "title": "" }, { "docid": "53d593f030624a2e7fd1e46faf75f54e", "score": "0.5522326", "text": "function bindEventToGmail() {\n // Check if there is opening email then hide ad right panel.\n var currentRightPanel = $('.Bu.y3')[0];\n if (!currentRightPanel) {\n return;\n }\n\n // Show unl customized right panel\n if (!document.getElementById('rightPanel')) {\n var rightPanel = createRightPanel();\n $(currentRightPanel).parent().children().last().after(rightPanel);\n }\n\n /** Show unl information when hover over unl email (eg: franck@unleashedsoftware) **/\n chrome.storage.local.get(function(fetchedData) { // Get key config\n var keyValue = fetchedData.key_value;\n var idValue = fetchedData.id_value;\n // console.log(\"Key:\" + keyValue);\n // console.log(\"Id:\" + idValue);\n\n bindEmailMouseOverEvent(keyValue, idValue);\n // bindPostActivity(keyValue);\n });\n}", "title": "" }, { "docid": "38c8678d380999d8aed172d77b02417f", "score": "0.5504898", "text": "function sendOhioNotification() {\n gso.getCrudService()\n .execute(constants.post,manageEmpUrlConfig.manageEmpApi + manageEmpUrlConfig.manageBaseUrl + manageEmpUrlConfig.resources.managegroup + \"/\" + gso.getAppConfig().companyId + \"/\" + gso.getAppConfig().userId+ \"/ohioemail\", null, function (response) {\n },\n function (data) {\n }\n );\n\n }", "title": "" }, { "docid": "da2720753dbb18e3c02dc04254f2c701", "score": "0.5492064", "text": "notify(message, options) {\n let timer;\n\n if (options.type === 'message') {\n timer = 3000;\n }\n\n Joomla.renderMessages({\n [options.type]: [Joomla.JText._(message)]\n }, undefined, true, timer);\n }", "title": "" }, { "docid": "a7e0861ae19328771efe8f636c6a253a", "score": "0.5489351", "text": "function notify(json){\r\n\t//console.log(json);\r\n\tnotification = json2message(json); //Convert error message into readable message\r\n\tnotification.message = prettyPiget(notification.message); //Prettify piget\r\n\tdisplay_alert(notification.message, notification.type); //Display notifications\r\n}", "title": "" }, { "docid": "0f63a5dc52124fbefbf8edaa7389dae2", "score": "0.54875976", "text": "function displayGmailContent() {\n show('gmail-content');\n hide('gmail-settings');\n}", "title": "" }, { "docid": "bfe821ab2dd2fd830a057197b78f9860", "score": "0.5486114", "text": "function sendEmail(from, to, subject, body){\n\n var email_lines = [];\n email_lines.push('From: \"' + from + '\" <support@etdrisk.com>');\n email_lines.push('To: ' + to);\n email_lines.push('Content-type: text/html;charset=iso-8859-1');\n email_lines.push('MIME-Version: 1.0');\n email_lines.push('Subject: ' + subject);\n email_lines.push('');\n email_lines.push(body);\n\n var email = email_lines.join('\\r\\n').trim();\n\n var base64EncodedEmail = new Buffer(email).toString('base64');\n base64EncodedEmail = base64EncodedEmail.replace(/\\+/g, '-').replace(/\\//g, '_');\n\n let auth = oAuth2Client\n const gmail = google.gmail({\n version: 'v1',\n auth\n });\n\n gmail.users.messages.send({\n userId: 'me',\n resource: {raw: base64EncodedEmail}\n }, (err,res) => {\n if(err){\n console.log(err);\n }\n else{\n console.log(res);\n }\n });\n}", "title": "" }, { "docid": "59f04d39f5e09df6ad1bb6312095a5c5", "score": "0.5482711", "text": "function showNotification(title, body) {\n if (nova.inDevMode()) {\n let request = new NotificationRequest(\"python-nova-message\");\n \n request.title = nova.localize(title);\n request.body = nova.localize(body);\n nova.notifications.add(request);\n }\n}", "title": "" }, { "docid": "57bdfd686b1087a4a6bf9fa59152069e", "score": "0.54823136", "text": "getNotification() {\n if (this.displayModel) {\n return super.getNotification();\n } else {\n return {};\n }\n }", "title": "" }, { "docid": "c48006a69de03216259e5b69f26aa0f3", "score": "0.5480819", "text": "function display_notification(response) {\n $.notify({\n message: response[\"message\"]\n }, {\n type: (response[\"status\"] ? 'success' : 'danger'), \n placement: {\n from: \"bottom\",\n align: \"center\"\n }\n })\n}", "title": "" }, { "docid": "fffe79a96e4582781f85ad656204028d", "score": "0.547769", "text": "ensureSignupNotification() {\n if (!this.state.isLoginPath && !this.signupNotificationSent) {\n this.props.notificationCenter.pushNotification({\n type: 'info',\n duration: 10000,\n heading: 'About that email field',\n message: (\n <>\n <p>\n This is merely a demo, so don't worry about entering your{' '}\n <b>email</b>.\n </p>\n <p>\n - it is only used as a login credential (no account confirmation\n email will be sent, etc.).\n </p>\n </>\n ),\n });\n\n this.signupNotificationSent = true;\n }\n }", "title": "" }, { "docid": "aa2bba79b03eeba939ee7badc15b4deb", "score": "0.547596", "text": "function message(msg, timeout=1000){\n var notification = new Notification(\"Message\", {body: msg});\nsetTimeout(function() {notification.close()}, timeout);\n}", "title": "" }, { "docid": "96994f13bf05782133fc943e57908fcf", "score": "0.5472591", "text": "function gritter_custom(gfor,title,text) {\n if(gfor == 'image upload')\n {\n $.gritter.add({\n // (string | mandatory) the heading of the notification\n title: title,\n // (string | mandatory) the text inside the notification\n text: text,\n image: 'assets/vendor/images/icon/bell.gif',\n });\n }\n return false;\n}", "title": "" }, { "docid": "13979dcc6b10e4f1a06bf157cdfe5669", "score": "0.5471676", "text": "function getNotificationIcon(statusValue)\n{\n\tif(statusValue)\n\t{\n\t\treturn \"/themes/zuznow/MWSAdmin/images/core/message-\" + statusValue + \".png\";\n\t}\n\treturn \"\";\n}", "title": "" }, { "docid": "c67369c0dafe1a6bb74444f448c22aa1", "score": "0.5471598", "text": "function show_notif(typ,pos,msg,tim_out)\n {\n new Noty({\n type: typ, //alert (default), success, error, warning\n layout: pos, //top, topLeft, topCenter, topRight (default), center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, bottomRight\n theme: 'bootstrap-v4', //relax, mint (default), metroui \n text: msg, //This string can contain HTML too. But be careful and don't pass user inputs to this parameter.\n timeout: tim_out, // false (default)\n progressBar: true, //Default, progress before fade out is displayed\n }).show();\n }", "title": "" }, { "docid": "89e239e122858edcbdd12895f6cf1b32", "score": "0.5471413", "text": "static async notifications(token) {\n return await sendRequest(\"GET\", \"/users/self/notifications\", token);\n }", "title": "" }, { "docid": "9b8e0be7ddae1d6fa3115ea7ad41c565", "score": "0.54661024", "text": "function popupNotification (title, content) {\n if (showPopupNotification) {\n chrome.notifications.create({\n 'type': 'basic',\n 'iconUrl': chrome.extension.getURL('icons/icone_n_20.png'),\n 'title': title,\n 'message': content\n })\n }\n}", "title": "" }, { "docid": "1918897dc3659d924d0394cba20b15cf", "score": "0.54641265", "text": "function displayNotification() {\n var notification = new Notification('RichChat', {\n body: bubbleText(message.message),\n icon: 'images/favicon.ico',\n timestamp: true,\n data: message.chat.chatId\n });\n setTimeout(notification.close.bind(notification), 5000);\n notification.addEventListener('click', function (event) {\n if (window) {\n window.focus();\n }\n notification.close();\n onChatSelected(event.target.data);\n });\n }", "title": "" }, { "docid": "c5ecb196748080d90296d86f0c4c0431", "score": "0.5460705", "text": "function getDefaultNotification() {\n return {\n data: {\n title: '',\n message: '',\n navigate: {},\n audience: '',\n _metadata: {\n filters: [],\n subscriptions: [],\n schedule: 'now',\n notes: ''\n }\n }\n };\n}", "title": "" }, { "docid": "7859560583121681321ff2fd111f284a", "score": "0.5457764", "text": "function createNotification (type, message) {\n\treturn {\n\t\ttype,\n\t\tmessage,\n\t\ttime: Date.now(),\n\t}\n}", "title": "" }, { "docid": "85696d8dec704e147544522e876e174c", "score": "0.54576993", "text": "function onMessageArrived(message) {\n //console.log(\"New Message has Arrived: \"+message.destinationName + \" \" + message.payloadString);\n var msg = message.payloadString;\n var thumbnail;\n var url;\n //console.log(msg.sub);\n //console.log(msg.txt);\n //console.log(msg.img);\n //console.log(msg.url);\n\n\n if (msg == 'green') {\n chrome.browserAction.setIcon({path: \"icon_green128.png\"});\n } else if (msg == 'red') {\n chrome.browserAction.setIcon({path: \"icon_red128.png\"});\n } else {\n chrome.browserAction.setIcon({path: \"icon_blue128.png\"});\n }\n popupNotification(message.destinationName, message.payloadString, \"icon.png\");\n}", "title": "" }, { "docid": "576620e919add5d262f28d8682c837e9", "score": "0.54496604", "text": "function onNotificationGCM(e) {\n $(\"#app-status-ul\").append('<li>EVENT -> RECEIVED:' + e.event + '</li>');\n \n switch( e.event )\n {\n case 'registered':\n\t\t\t\t\tif ( e.regid.length > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>REGISTERED -> REGID:' + e.regid + \"</li>\");\n\t\t\t\t\t\t// Your GCM push server needs to know the regID before it can push to this device\n\t\t\t\t\t\t// here is where you might want to send it the regID for later use.\n\t\t\t\t\t\tconsole.log(\"regID = \" + e.regID);\n\t\t\t\t\t}\n break;\n \n case 'message':\n \t// if this flag is set, this notification happened while we were in the foreground.\n \t// you might want to play a sound to get the user's attention, throw up a dialog, etc.\n \tif (e.foreground)\n \t{\n\t\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>--INLINE NOTIFICATION--' + '</li>');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if the notification contains a soundname, play it.\n\t\t\t\t\t\t\tvar my_media = new Media(\"/android_asset/www/\"+e.soundname);\n\t\t\t\t\t\t\tmy_media.play();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\t// otherwise we were launched because the user touched a notification in the notification tray.\n\t\t\t\t\t\t\tif (e.coldstart)\n\t\t\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>--COLDSTART NOTIFICATION--' + '</li>');\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>--BACKGROUND NOTIFICATION--' + '</li>');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>MESSAGE -> MSG: ' + e.payload.message + '</li>');\n\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>MESSAGE -> MSGCNT: ' + e.payload.msgcnt + '</li>');\n break;\n \n case 'error':\n\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>ERROR -> MSG:' + e.msg + '</li>');\n break;\n \n default:\n\t\t\t\t\t\t$(\"#app-status-ul\").append('<li>EVENT -> Unknown, an event was received and we do not know what it is</li>');\n break;\n }\n }", "title": "" }, { "docid": "b6f98560259cd23e4b0bff9197a801d7", "score": "0.54346126", "text": "info(message) {\n return this.sendMessage(MessageType.Info, message);\n }", "title": "" }, { "docid": "1dc17a206932c232046b3fd369def59e", "score": "0.5428906", "text": "function email_sent_notify(data)\n{\n\tvar message = new Array();\n\n\tmessage.push(\"<label class=\\\"l1\\\">&nbsp;</label>\");\n\tmessage.push(\"<div class=\\\"err_msg\\\" style=\\\"width:280px;\\\">\");\n\tmessage.push(data);\n\tmessage.push('</div></div>');\n\n\t$(\"#email_err\").html(message.join(''));\n\n}", "title": "" }, { "docid": "e9e46cd768a48944a8591c39038d0e67", "score": "0.5428054", "text": "function onNotificationAPN(e) {\n if (e.alert) {\n //navigator.notification.alert(e.alert);\n showMessage(e.alert, aMsg.newMsg);\n }\n\n if (e.sound) {\n var snd = new Media(e.sound);\n snd.play();\n }\n\n if (e.badge) {\n pushNotification.setApplicationIconBadgeNumber(successHandler, e.badge);\n }\n}", "title": "" }, { "docid": "121cd7611592d6dd43a84e1d91d33856", "score": "0.54263407", "text": "function onNotification(e) {\n\n\tswitch( e.event )\n\t{\n\t\tcase 'registered':\n\t\t\t\t\tif (e.regid.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//$(\"body\").append('<br>Registrado REGID:' + e.regid);\n\t\t\t\t\t\tregisterOnServer(e.regid);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\n\t\tcase 'message':\n\t\t\n\t\t\t\t\tvar notif=e.payload;\n\t\t\n\t\t\t\t\t// Foreground: Notificación en línea, mientras estamos en la aplicación\n\t\t\t\t\tif (e.foreground)\n\t\t\t\t\t{\n \n\t\t\t\t\t\t// on Android soundname is outside the payload. \n\t\t\t\t\t\t// On Amazon FireOS all custom attributes are contained within payload\n\t\t\t\t\t\t// var soundfile = e.soundname || e.payload.sound;\n\t\t\t\t\t\t// if the notification contains a soundname, play it.\n\t\t\t\t\t\t// playing a sound also requires the org.apache.cordova.media plugin\n\t\t\t\t\t\t// var my_media = new Media(\"/android_asset/www/\"+ soundfile);\n\t\t\t\t\t\t// my_media.play();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//OPCION 1: Mostramos un cuadro de diálogo\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$(\"#cortina\").show(100, function() {\n\t\t\t\t\t\t\t$(\"#cortina\").prepend('<div id=\"dialog-confirm\" title=\"Nueva notificaci&oacute;n\"><p>'+notif.tipo+\" <br> \"+notif.data.id+'</p></div>');\n\t\t\t\t\t\t\t$(\"#dialog-confirm\").dialog({\n\t\t\t\t\t\t\t\t resizable: false,\n\t\t\t\t\t\t\t\t modal: true,\n\t\t\t\t\t\t\t\t buttons: {\n\t\t\t\t\t\t\t\t\t\t\"Ver\": function() {\n\t\t\t\t\t\t\t\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#cortina\").hide();\n\t\t\t\t\t\t\t\t\t\t\t\t switch(notif.tipo)\n\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase \"circular\":window.location.href=\"circular.html?id=\"+notif.data.id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\tcase \"evento\": if(notif.data.premiumplus==true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.location.href=\"lecturas.html?id=\"+notif.data.id+\"&fecha=\"+notif.data.fecha+\"&tipo=dia\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.location.href=\"lecturas.html?id=\"+notif.data.id+\"&fecha=\"+notif.data.fecha+\"&tipo=mes\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"Ignorar\": function() {\n\t\t\t\t\t\t\t\t\t\t\t $(this).dialog(\"close\");\n\t\t\t\t\t\t\t\t\t\t\t $(\"#cortina\").hide();\n\t\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});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//OPCIÓN 2: Generamos una notificación en la barra\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*var date_notif=notif.date;\n\t\t\t\t\t\tif(date_notif!=\"\" && date_notif!=null)\n\t\t\t\t\t\t\tdate_notif=new Date();*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t//if(notif.notId!=\"\")\n\t\t\t\t\t\t//\tid_notificacion=notif.notId;\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\twindow.plugin.notification.local.add({\n\t\t\t\t\t\t\tid: id_notificacion,\n\t\t\t\t\t\t\t//date: date_notif, \n\t\t\t\t\t\t\ttitle: \"[\"+notif.tipo+\"] \"+notif.title,\n\t\t\t\t\t\t\tmessage: notif.message,\n\t\t\t\t\t\t\tdata:\t notif.data,\n\t\t\t\t\t\t\tongoing: true,\n\t\t\t\t\t\t\tautoCancel: true\n\t\t\t\t\t\t});\t\t\n\n\t\t\t\t\t\tid_notificacion++;\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\t// e.coldstart: Usuario toca notificación en la barra de notificaciones\n\t\t\t\t\t\t// Coldstart y background: Enviamos a la página requerida\n\t\t\t\t\t\tswitch(notif.tipo)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase \"circular\":window.location.href=\"circular.html?id=\"+notif.data.id;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"evento\": window.location.href=\"lecturas.html?id=\"+notif.data.id+\"&fecha=\"+notif.data.fecha+\"&tipo=dia\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\n\t\tcase 'error':\n\t\t\t\t\t$(\"body\").append('<br>Error:'+ e.msg);\n\t\t\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t\t\t$(\"body\").append('<br>Evento desconocido');\n\t\t\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "1025dca19bc6dd945f069e03694c4215", "score": "0.5423936", "text": "function emailMessage(){\n if (req.body.frequency == 'Hourly'){\n return 'Hello ' + req.body.firstName.charAt(0).toUpperCase() + req.body.firstName.slice(1) + '!\\n\\n' + \n 'You will be reminded every ' + req.body.timeLine + ' hours via email to take your ' + req.body.medicineName + '.'; \n }else{\n return 'Hello ' + req.body.firstName.charAt(0).toUpperCase() + req.body.firstName.slice(1) + '!\\n\\n' +\n 'You will be reminded every ' + req.body.timeLine + ' minutes via email to take your ' + req.body.medicineName + '.'; \n }\n }", "title": "" }, { "docid": "b4fd304e771dc3f80b209eac57b77b22", "score": "0.5420985", "text": "function onNotification(e) {\n console.log('<li>EVENT -> RECEIVED:' + e.event + '</li>');\n\n switch( e.event )\n {\n case 'registered':\n if ( e.regid.length > 0 )\n {\n console.log('<li>REGISTERED -> REGID:' + e.regid + \"</li>\");\n // Your GCM push server needs to know the regID before it can push to this device\n // here is where you might want to send it the regID for later use.\n console.log(\"regID = \" + e.regid);\n\t\t\tPN = e.regid; \n }\n break;\n\n case 'message':\n\t\t//cordova.plugins.notification.badge.set(200);\n // if this flag is set, this notification happened while we were in the foreground.\n // you might want to play a sound to get the user's attention, throw up a dialog, etc.\n console.log(e)\n\t\tpushDriver(e)\n\t\t\n\t\tif ( e.foreground )\n {\n console.log('<li>--INLINE NOTIFICATION--' + '</li>');\n\t\t\tconsole.log(e)\n\t\t\twindow.plugins.toast.showLongBottom(e.payload.message, function(a){console.log('toast success: ' + a)}, function(b){console.log('toast error: ' + b)});\n\t\t\t\n // on Android soundname is outside the payload.\n // On Amazon FireOS all custom attributes are contained within payload\n // var soundfile = e.soundname || e.payload.sound;\n // if the notification contains a soundname, play it.\n // var my_media = new Media(\"/android_asset/www/\"+ soundfile);\n // my_media.play();\n }\n else\n { // otherwise we were launched because the user touched a notification in the notification tray.\n if ( e.coldstart )\n {\n console.log('<li>--COLDSTART NOTIFICATION--' + '</li>');\n }\n else\n {\n console.log('<li>--BACKGROUND NOTIFICATION--' + '</li>');\n }\n }\n\n console.log('<li>MESSAGE -> MSG: ' + e.payload.message + '</li>');\n //Only works for GCM\n console.log('<li>MESSAGE -> MSGCNT: ' + e.payload.msgcnt + '</li>');\n //Only works on Amazon Fire OS\n break;\n\n case 'error':\n console.log('<li>ERROR -> MSG:' + e.msg + '</li>');\n break;\n\n default:\n console.log('<li>EVENT -> Unknown, an event was received and we do not know what it is</li>');\n break;\n }\n}", "title": "" }, { "docid": "130494bea8e0ee9b86b56445a1747c7f", "score": "0.5418876", "text": "function onNotificationGCM(e) {\n\n switch( e.event )\n {\n case 'registered':\n if ( e.regid.length > 0 )\n {\n $.get(server_url + \"/register_phone?access_token=\"+access_token+\"&token=\"+e.regid+\"&platform=\"+device.platform).done(function(res) {\n return true;\n }).fail(function(res) {\n alert('error when registering phone');\n return false;\n });\n }\n break;\n\n case 'message':\n\n notification = {};\n notification.foreground = e.foreground;\n notification.type = e.payload.custom.t;\n\n if(notification.type == 'message') {\n notification.title = e.payload.title;\n notification.sender_id = e.payload.custom.s;\n }\n\n if(notification.type == 'match') {\n notification.name = e.payload.custom.n;\n notification.picture_url = e.payload.custom.p;\n notification.user_id = e.payload.custom.u;\n }\n\n doNotification(notification);\n\n break;\n\n case 'error':\n alert('error = ' + e.msg);\n break;\n }\n}", "title": "" }, { "docid": "de6c2febb65b7c6d681ae443de3338e4", "score": "0.54144925", "text": "function formatSendMsg(labels, title, notes, url) {\r\n\t\tvar msg = \"\";\r\n\t\tif (notes.length > 0) {\r\n\t\t\tmsg = notes + \" \";\r\n\t\t}\r\n\t\tif (labels.length > 0) {\r\n\t\t\tmsg = msg + \"#\" + labels + \" \";\r\n\t\t}\r\n\t\tmsg = msg + \"reading:\" + title + ' ' + url;\r\n\t\treturn msg;\r\n\t\t// return notes + \" reading \" + title + ' ' + url;\r\n\t}", "title": "" }, { "docid": "195f335456be2ca91b96141635800427", "score": "0.5408129", "text": "function msg(title, msg, timeout) {\n var notification = webkitNotifications.createNotification('img/icon.png', title, msg);\n notification.show();\n setTimeout(function() { notification.cancel(); }, timeout || 1500);\n}", "title": "" }, { "docid": "d5f4122bdecdc2d4b39afbd2f5724cf6", "score": "0.5403748", "text": "function getHotmailUser() {\r\n\t\t//\t\tvar strGreeting = \"\";\r\n\t\tWL.api(\r\n\t\t{\r\n\t\t\tpath: \"me\",\r\n\t\t\tmethod: \"GET\"\r\n\t\t},\r\n\t\tfunction (resp) {\r\n\t\t\tif (!resp.error) {\r\n\r\n\t\t\t\tWL.logout();\r\n\r\n\t\t\t\t$(document.body).data('oauth_login',{\r\n\t\t\t\t\t'id' : resp.id,\r\n\t\t\t\t\t'email' : resp.emails.preferred,\r\n\t\t\t\t\t'link' : resp.link,\r\n\t\t\t\t\t'type' : 'hotmail'\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcheckOauthAccount($(document.body).data('oauth_login'));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "ffc2579220c5ac8aa9ef70d2bacddfb0", "score": "0.54019785", "text": "function onNotificationGCM(e) {\n console.log('onNotificationGCM.');\n switch( e.event ){\n case 'registered':\n if ( e.regid.length > 0 )\n {\n var regId = e.regid;\n console.log('<li>REGISTERED -> REGID:' + regId + \"</li>\");\n console.log(\"PushManager. regID = \" + regId);\n console.log('onNotificationGCM event: ');\n console.log(e);\n ClientManager.updateRegistrationId(regId);\n }\n break;\n\n case 'message':\n\n if (e.foreground) {\n } else {\n // otherwise we were launched because the user touched a notification\n if (e.coldstart){\n //console.log('<li>--COLDSTART NOTIFICATION--' + '</li>');\n }else{\n //console.log('<li>--BACKGROUND NOTIFICATION--' + '</li>');\n }\n }\n\n if (e.payload[\"extra_params\"].is_news) {\n $state.go('news',{newsId:e.payload[\"extra_params\"].id_news});\n } else if (e.payload[\"extra_params\"].id_game_match) {\n $state.go('mtm',{matchId:e.payload[\"extra_params\"].id_game_match});\n }\n\n break;\n\n case 'error':\n console.log('<li>ERROR -> MSG:' + e.msg + '</li>');\n break;\n\n default:\n console.log(\n '<li>EVENT -> Unknown, ' +\n 'an event was received and we do not know what it is</li>'\n );\n break;\n }\n }", "title": "" }, { "docid": "7397328a1384c53921e4b7ec9ae6e52a", "score": "0.5398429", "text": "async function sendMail(auth , to , subject , text){\n const gmail = google.gmail({version: 'v1' , auth});\n // the current user's email address is extracted my the getUser method\n let userInfo = await getUser(auth)\n // the message body is created using createMessage method\n let raw = createMessage(to , userInfo.data.emailAddress , subject , text)\n gmail.users.messages.send({auth: auth , userId: 'me' , resource: {raw: raw} , function(err , response){\n return response\n }})\n}", "title": "" }, { "docid": "f4d917e0feff325883e897ce178bbfde", "score": "0.53923106", "text": "function getStatusMessage() {\n\t\tvar statusMessage;\n\n\t\tswitch(myMessengerDetails.status) {\n\t\t\tcase \"Online\":\n\t\t\t\tstatusMessage = settings.statusMessages[0];\n\t\t\t\tbreak;\n\t\t\tcase \"Offline\":\n\t\t\t\tstatusMessage = settings.statusMessages[1];\n\t\t\t\tbreak;\n\t\t\tcase \"Away\":\n\t\t\t\tstatusMessage = settings.statusMessages[2];\n\t\t\t\tbreak;\n\t\t\tcase \"Busy\":\n\t\t\t\tstatusMessage = settings.statusMessages[3];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstatusMessage = \"$ is not signed into Windows Live Messenger\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//and replace the dollar signs with the user's display name\n\t\tstatusMessage = statusMessage.replace(\"$\", myMessengerDetails.displayName);\n\n\t\treturn statusMessage;\n\t}", "title": "" }, { "docid": "0a4ab285b146972d89260cb45edf10ad", "score": "0.5392054", "text": "function sendAlert(reason, data) {\n \n var to = 'reece@g.harvard.edu'\n \n var from = 'Psych2500 Daemon'\n \n var subject\n var body\n \n if (reason == 'NOCLASS') {\n \n subject = 'No 2500 class this week'\n body = 'That is all there is to discuss. Thanks!'\n \n } else if (reason == 'ERRORS') {\n \n subject = 'Errors in returnComments() found'\n body = 'Hi, I just ran returnComments() for Psych2500. Errors occurred. This is what happened:\\n\\n'+data\n }\n \n \n MailApp.sendEmail({\n to: to,\n from: from,\n subject: subject,\n htmlBody: body, \n }); \n \n}", "title": "" }, { "docid": "759b0b828d88e42ca20e7f3d61e6f873", "score": "0.5390343", "text": "function errorEmail(error_message){\r\nGmailApp.sendEmail(devEmail, \"Newsletter Generator Error!\", \"Error Message: \" + error_message);\r\n}", "title": "" } ]
9307a88d75ada33d4d0f6d502682c6a2
Update the global stats with a newly loaded project
[ { "docid": "496f919a435b1905ddd4642e9f608793", "score": "0.7396993", "text": "function updateGlobalStats(project)\r\n{\r\n globalStats.numDataSets++;\r\n globalStats.numLinks += project.metadata.current;\r\n\r\n if(globalStats.largestSetSize < project.metadata.current)\r\n {\r\n globalStats.largestSetSize = project.metadata.current;\r\n }\r\n}", "title": "" } ]
[ { "docid": "06278373b7c2b29effa1bfa0e36eea78", "score": "0.6625562", "text": "function refreshProject() {\n IDE.project.refresh();\n }", "title": "" }, { "docid": "bc2e46db3591cc5b5ee0f99be29ca003", "score": "0.63211966", "text": "static updatePages() {\n this.getPage('projects').update();\n }", "title": "" }, { "docid": "4cf0dc79c798321655f3fedb0d2b5ed5", "score": "0.6310022", "text": "function loadProjects() {\n setProjects(projectArray);\n }", "title": "" }, { "docid": "60db1b1188d7c3205cfc02f3ff640e93", "score": "0.62919337", "text": "function refreshProjectAttrList() {\n if (vmSettings.projectsTab === 'status') {\n getStatus();\n } else if (vmSettings.projectsTab === 'process') {\n getProcess();\n } else if (vmSettings.projectsTab === 'geo') {\n getGeo();\n } else if (vmSettings.projectsTab === 'role') {\n getRole();\n } else {\n $log.warn('Project Tab ' + vmSettings.projectsTab + ' not found');\n }\n }", "title": "" }, { "docid": "a0d2be2afd325000a7f19dd18f60c36f", "score": "0.61332536", "text": "function updateTotal() {\n var totalProject = TotalOfStages(screen.ProjectStages);\n if (screen.Total != totalProject) {\n screen.Total = totalProject;\n screen.ProjectStages.refresh();\n } \n }", "title": "" }, { "docid": "337a99edb19981b190f8e6dcb2409147", "score": "0.595707", "text": "function setProjectInfo() {\n for (let i = 0; i < 12; i++) {\n let info = projects[i],\n descRepo,\n firstProject;\n\n firstProject = (i == 0) ? \"active-project\" : \"\";\n\n descRepo = (info.repo == \"\") ? \"\" :\n '<div class=\"project-repo\"><a href=\"' + info.repo + '\" target=\"_blank\"></a></div>';\n\n $(\"#project-display\").append(\n '<div class=\"project-information ' + firstProject +'\" data-index=\"' + i + '\">' +\n '<div class=\"project-header-container\">' +\n '<div class=\"project-header\">' + info.type +'</div>' +\n '</div>' +\n\n '<div class=\"project-image-container\">' +\n '<a href=\"' + info.website + '\" target=\"_blank\">' +\n '<img class=\"project-image\" src=\"' + info.img + '\" />' +\n '</a>' +\n '</div>' +\n\n '<div class=\"project-description-container\">' +\n '<div class=\"project-description\">' +\n '<div class=\"project-name\">' + info.name +'</div>' +\n\n '<div class=\"project-tools\">' + info.tools +'</div>' +\n\n '<div class=\"project-site\">' +\n '<a href=\"' + info.website + '\" target=\"_blank\"></a>' +\n '</div>' +\n\n descRepo +\n '<br>' +\n\n '<div class=\"project-desc\">' + info.desc + '</div>' +\n '</div>' +\n '</div>' +\n '</div>'\n );\n }\n }", "title": "" }, { "docid": "97035b5f5fff9ed0adbfd66fcdb7d32e", "score": "0.5946316", "text": "async function loadGlobalVariables () {\n\tconst progress = [];\n\tlet count = 0;\n\tconst control = await Team.find({ code: 'TCN' });\n\tfor await (const team of await Team.find({ type: 'National' })) {\n\t\tconst el = { team: { _id: team._id, name: team.name }, progress: 0 };\n\t\tprogress.push(el);\n\t\tcount++;\n\t}\n\tknowledgeDebugger(`Loaded ${count} teams into progress...`);\n\tteamProgress = progress;\n\tcontrolTeam = control;\n}", "title": "" }, { "docid": "6127fb7478b2b73356518d2761922928", "score": "0.59439373", "text": "function loadGeneralStatisticsForSelectedProject(projectName){\t\t\t\n\t$.post(\"statistics/get-general-statistics-for-selected-project\",{projectName: projectName, _csrf: csrf_token}, function(data){\n\t\t$('#projectToday').fadeOut('1000', function() {\t\t\t\t\n\t\t\t$('#projectToday').text(data[0]);\n\t\t}).fadeIn('1000');\t\n\t\t$('#projectYesterday').fadeOut('1000', function() {\t\t\t\t\n\t\t\t$('#projectYesterday').text(data[1]);\n\t\t}).fadeIn('1000');\t\n\t\t$('#project7Days').fadeOut('1000', function() {\t\t\t\t\n\t\t\t$('#project7Days').text(data[2]);\n\t\t}).fadeIn('1000');\t\n\t\t$('#project30Days').fadeOut('1000', function() {\t\t\t\t\n\t\t\t$('#project30Days').text(data[3]);\n\t\t}).fadeIn('1000');\t\n\t\t$('#projectEver').fadeOut('1000', function() {\t\t\t\t\n\t\t\t$('#projectEver').text(data[4]);\n\t\t}).fadeIn('1000');\t\t\t\t\n\t});\n}", "title": "" }, { "docid": "7aa141245ec37040fa1f23d8b326e504", "score": "0.5900842", "text": "function loadProjects() {\r\n //ProjectService.GetAll()\r\n // .then(function (projects) {\r\n // //vm.AllProjects = projects;\r\n vm.AllProjects = [{\"Nombre\": \"Casa Arturo\"},{\"Nombre\": \"Cochera Arturo\"}];\r\n //loadStages();\r\n // })\r\n }", "title": "" }, { "docid": "a515a4ddc01fe671dd523316c5553df4", "score": "0.58539116", "text": "projectChange(morningNew, afternoonNew) {\n this.projects.morning = morningNew;\n this.projects.afternoon = afternoonNew;\n }", "title": "" }, { "docid": "3c8b0f5b5de4d95d7d24961dd03aa9f0", "score": "0.5844646", "text": "function refreshData() {\n $scope.projects = [];\n $scope.loading = true;\n\n var base = '/api/projects';\n var query = [];\n\n if ($scope.viewing === 'Archived') {\n query.push('archive');\n }\n\n if ($scope.mine === 'My Projects') {\n query.push('mine=' + Auth.getCurrentUser().name);\n }\n\n if (query) {\n query = query.join('&');\n query = base + '?' + query;\n } else {\n query = base;\n }\n\n $http.get(query)\n .then(function(result) {\n $scope.projects = result.data;\n })\n // .then(function() {\n // // for each client in project, fetch by objectId\n // })\n .finally(function() {\n console.log('Projects', $scope.projects);\n $scope.loading = false;\n });\n\n }", "title": "" }, { "docid": "2b9a22baba178522ec1a7861ac0684de", "score": "0.5769333", "text": "function projectData () {\n $.get('/api/Project', function(data) {\n projects = data;\n \n fillProjectDropdown();\n });\n }", "title": "" }, { "docid": "5caa2f71df847c71221befef92644fbc", "score": "0.5761278", "text": "function reloadSolution() {\n // load solution info\n index_1.printf(\"Loading solution info...\");\n solutionData = vs.getSolution();\n // warning if solutionInfo.json not parsed correctly\n if (solutionData === null) {\n if (!errorFlag) {\n errorFlag = true;\n index_1.printf();\n index_1.printf(\"Unable to monitor file changes for un-built solution (./buildtools/solutionInfo.json is missing)!\");\n index_1.printf(\"Build the solution first in order to be possible to collect the solution and projects information!\");\n index_1.printf();\n }\n }\n else {\n errorFlag = false;\n // get AjsWebApp project\n ajsWebAppProj = getProject(solutionData.solutionInfo.ajsWebAppProject, solutionData);\n // get AjsWebApp project configuration (merge the main with Debug or Release)\n ajsWebAppCfg = getProjectConfig(solutionData.solutionInfo.ajsWebAppProject, cfg.defaultConfig(vs.getSolutionConfiguration(solutionData)), solutionData);\n // prepare project directories object\n /** @type { Object.<string, { jsSrc: string, wwwSrc: string }> } */\n projectDirs = {};\n // load directories of all projects\n for (var i = 0; i < solutionData.projects.length; i++) {\n var p = solutionData.projects[i];\n var pname = solutionData.projects[i].projectName;\n var pcfg = getProjectConfig(pname, ajsWebAppCfg, solutionData);\n // if project is not ignored\n if (!pcfg.projectIgnore && ajsWebAppCfg.ignoredProjects.indexOf(solutionData.projects[i].projectName) === -1) {\n // get project / dirs info\n projectDirs[pname] = {};\n projectDirs[pname].project = p;\n projectDirs[pname].projectConfig = pcfg;\n projectDirs[pname].jsSrc = path.normalize(p.projectDir + pcfg.jsSourceFolder);\n projectDirs[pname].wwwSrc = path.normalize(p.projectDir + pcfg.wwwRootSourceFolder);\n }\n }\n }\n }", "title": "" }, { "docid": "c2927f631789ee313674b66a40fbaf31", "score": "0.57538766", "text": "function update() {\n var myStats = new GenerateStats(config);\n\n myStats.then(stats => {\n console.log(stats.report);\n data = { message: 'ok', nextUpdate: j.nextInvocation(), lastUpdate: new Date(), stats: stats};\n });\n}", "title": "" }, { "docid": "3c424f87c158982e9e7a777c759abdc6", "score": "0.5731829", "text": "async function populate_projects() {\n generateViewportBounds();\n updateLocalStorage();\n\n neighborhood = await Project.searchForNearbyMarkers(viewport)\n console.log(viewport)\n generate_markersNearby(neighborhood);\n generate_projectListing(neighborhood);\n }", "title": "" }, { "docid": "95322eb1a8a0c39a032271ea49ba0ba1", "score": "0.5665223", "text": "function changeProject() {\n $.ajax({\n type: \"GET\",\n url: \"/immersion/new_project_data\",\n success: function(json) {\n var projectData = json[0];\n photoData = json[1];\n updateProjectLocationPin([projectData.lon, projectData.lat]);\n updateProjectInfo(projectData.name, projectData.description);\n\n animateCard();\n\n d3.selectAll(\".project-background-img\")\n .classed(\"visible-img\", false)\n .classed(\"hidden-img\", true);\n d3.select(\".img-\" + Math.floor(Math.random() * 15))\n .style(\"top\", function() {\n console.log();\n return -parseInt(d3.select(this).style(\"height\")) / 2 +\n window.innerHeight / 2 + \"px\";\n })\n .classed(\"visible-img\", true)\n .classed(\"hidden-img\", false);\n }\n });\n }", "title": "" }, { "docid": "f25a066d464b16b417f4d34580a31390", "score": "0.5646883", "text": "function newProject() {\n $app.addSprite(new ISKSpriteNodeController(\"Hintergrund\"));\n syncObjectList();\n }", "title": "" }, { "docid": "dd8ae5cefe18f4b8b66a7689f818a346", "score": "0.5637957", "text": "function getAllProjects() {\n\n projects.getProjects().then(function (results) {\n vm.projects = results;\n angular.forEach(vm.projects, function(value, key){\n\n time.getTime(value._id, vm.user._id, vm.user.job).then(function (results) {\n vm.projects[key].timeentries = results;\n vm.projects[key].totalTime = time.getTotalTime(results);\n if (typeof results[0] !== 'undefined')\n vm.projects[key].lastUpdate = results[0].end_time;\n else\n vm.projects[key].lastUpdate = '-';\n }, function (error) {\n console.log(error);\n });\n\n });\n console.log(vm.projects);\n }, function (error) { // Check for errors\n console.log(error);\n });\n }", "title": "" }, { "docid": "62b1c75cda02a3eb67ea0fe9e9c43655", "score": "0.5625297", "text": "function update (){\n proj = fs.stat(path.join(__dirname, '../vcount.csv'), (err, stats) => {\n if (err){ // Create file\n exec.exec(\"curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f\", { cwd: path.join(__dirname, '..') });\n exec.exec(\"python3 data.py\", { cwd: path.join(__dirname, '..') });\n }\n if ((new Date()).getHours() != stats.mtime.getHours()){\n console.log(\"updated\");\n exec.exec(\"curl https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv -o vcount.csv -f\", { cwd: path.join(__dirname, '..') });\n exec.exec(\"python3 data.py\", { cwd: path.join(__dirname, '..') });\n }\n });\n}", "title": "" }, { "docid": "44f95b0ad56d1050cee7e8081ecd1e87", "score": "0.5611881", "text": "updateWorkspaceData() {\n this.workspaceDetails = this.codenvyAPI.getWorkspace().getWorkspacesById().get(this.workspaceId);\n this.loading = false;\n this.newName = angular.copy(this.workspaceDetails.name);\n }", "title": "" }, { "docid": "8355b45f7fdd6928da50c6e4952fb19c", "score": "0.55772805", "text": "function loadUserProjectData() {\r\n loadSavedShapes();\r\n loadUserLiveObjects();\r\n loadSvgCodeScene();\r\n loadMovementConfig();\r\n loadProjectLightningSetup();\r\n}", "title": "" }, { "docid": "1ad08a56f3917c7be3f0c5f4c928bba8", "score": "0.5575212", "text": "function setProject() {\n $(\".project-bound .page-container\").css({\n paddingRight: pgUnit * 10,\n });\n\n $(\".project-section.left\").css({\n paddingTop: pgUnit * 10,\n paddingBottom: pgUnit * 10,\n paddingLeft: pgUnit * 10\n });\n\n $(\".project-thumbnail-container\").css({\n margin: pgUnit * 10,\n width: \"calc(\" + 100 / 3 + \"% - \" + pgUnit * 20 + \"px)\",\n height: \"calc(25% - \" + pgUnit * 20 + \"px)\"\n });\n\n $(\".project-thumbnail\").css({\n height: \"100%\"\n });\n\n $(\".project-section.right\").css({\n padding: pgUnit * 20 + \"px \" + pgUnit * 10 + \"px\"\n });\n\n $(\".project-information\").css({\n padding: pgUnit * 20,\n width: \"calc(100% - \" + pgUnit * 20 + \"px)\",\n height: \"calc(100% - \" + pgUnit * 40 + \"px)\"\n });\n\n $(\".project-header-container\").css({\n fontSize: pgUnit * 21\n });\n\n $(\".project-image\").css({\n height: \"100%\"\n });\n\n $(\".project-description-container\").css({\n marginTop: pgUnit * 20,\n fontSize: pgUnit * 12\n });\n }", "title": "" }, { "docid": "3667c45374e1d6d66adfb5919d9a09a5", "score": "0.55596596", "text": "function onComplete() {\n if (global.userData && global.projectData)\n {\n createHtml();\n }\n }", "title": "" }, { "docid": "acf79fad471a9856fc183308fb034f0b", "score": "0.54830927", "text": "function getProjectCount() {\n projectFactory.getProjects().then (\n function(data) {\n vm.projectCount = data.length;\n },\n function(error) {\n toastr.error(error.status, error.statusText);\n console.log(error);\n }\n );\n }", "title": "" }, { "docid": "2081987416a3fbfaa63b41d1c3172363", "score": "0.5478405", "text": "_handleProjectResponse(event) {\n this.$.loading.hidden = true;\n this.set(\"projects\", this._projectData.data.projects);\n }", "title": "" }, { "docid": "7c21c87f38343328bf20d161a7ee8a2c", "score": "0.54768777", "text": "function populate_projects() {\n d3.json(\"/arborapi/projmgr/project\", function (error, projects) {\n d3.select(\"#project\").selectAll(\"option\").remove();\n d3.select(\"#project\").selectAll(\"option\")\n .data(projects.sort())\n .enter().append(\"option\")\n .text(function (d) { return d; });\n\n project = $(\"#project\").val();\n populate_selects();\n });\n}", "title": "" }, { "docid": "fdc973d8b1238ad348ae30255935f9e5", "score": "0.5474048", "text": "async update() {\r\n try {\r\n await this.addDependencies(this.dependencies);\r\n this.getPaths();\r\n await this.addOrUpdateProjectFiles();\r\n return await this.runTemplateScript();\r\n } catch (error) {\r\n throw error;\r\n }\r\n }", "title": "" }, { "docid": "f3081f078b3273a4b9b4a87986ef71c0", "score": "0.54723334", "text": "updateProjects(projects) {\n\t\tthis.projects = projects;\n\t\tthis._updateProjects();\n\t}", "title": "" }, { "docid": "06574cb0c531c84a65ebb4b2f5d95e21", "score": "0.544184", "text": "reload() {\n\t\t\tPlayerManager.loadConsumables();\n\t\t\tKC3ShipManager.load();\n\t\t\tKC3GearManager.load();\n\t\t}", "title": "" }, { "docid": "361377d613f356ec3d63c06b8e04bcc0", "score": "0.5438934", "text": "function projectManager(){\r\n}", "title": "" }, { "docid": "10e47696c49cca488545835b31abe3d6", "score": "0.5430698", "text": "function periodicUpdate() {\r\n $scope.elapsedSeconds += updateSeconds;\r\n storyStats = {};\r\n sampleDevices();\r\n sampleDirectories();\r\n sampleStats();\r\n sampleRssi();\r\n updateLineChart();\r\n updateBarChart();\r\n updateDoughnutChart();\r\n }", "title": "" }, { "docid": "7f794d9db2eec958cd1915ad0491a60f", "score": "0.5390694", "text": "function update() {\n updateLiveSamplingPortals();\n updateGc1Portals();\n}", "title": "" }, { "docid": "44c6991f5858f1d1e86387347455bab9", "score": "0.5366786", "text": "async function handleUpdateSingleProject(ctx, next) {\n next();\n }", "title": "" }, { "docid": "4e1ccad924cd24c261947a8083bea255", "score": "0.53654116", "text": "function portfolio_project_ajax_load() {\n // get the project info\n var project = $(this).attr('data-project');\n project = 'assets/projects/' + project;\n \n $('#ajaxLoader').load( project, function() {\n // remove the current `current project`\n $(\"#section02\").find('.currentProject').remove();\n // move the new project to its place and fade it in.\n $(this).find('.currentProject').insertAfter($(\"#section02\").find('.heading'));\n $(\"#section02\").find('.currentProject').fadeIn(500);\n // we empty the contents of the ajaxDiv, just in case.\n $(this).html('');\n // call the neccesary functions once more\n portfolio_resize_project_info_box();\n $('#section02').find('.featurepicwrapper').on('click', portfolio_project_popup_box);\n });\n \n }", "title": "" }, { "docid": "adaff6d92b9a3df9457558afca123d9d", "score": "0.5357639", "text": "function refresh() {\n\t\t\tvar query = (getQuery(true).length > 1) ? getQuery(true) + \"&\" : getQuery(true);\n\t\t\t$http\n\t\t\t\t.get(\"/api/v1/academic-rankings-stats\" + getFilters() + query + \"apikey=\" + $scope.apikey)\n\t\t\t\t.then(function(response) {\n\t\t\t\t\tif (Array.isArray(response.data)) {\n\t\t\t\t\t\t$scope.stats = response.data;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$scope.stats = [response.data];\n\t\t\t\t\t}\n\t\t\t\t}, function(response) {\n\t\t\t\t\tvar settings = {};\n\t\t\t\t\tswitch (response.status) {\n\t\t\t\t\t\tcase 403:\n\t\t\t\t\t\t\tsettings.title = \"Error! Forbiden apikey.\";\n\t\t\t\t\t\t\tsettings.text = \"Can't get resources because an incorrect apikey was introduced.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\t\tsettings.title = \"Unauthorized! No apikey provided.\";\n\t\t\t\t\t\t\tsettings.text = \"Can't get resources because no apikey was introduced.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tsettings.title = \"Error! Unknown\";\n\t\t\t\t\t\t\tsettings.text = \"Could not get resource for an unknomn error.\";\n\t\t\t\t\t}\n\t\t\t\t\t$scope.stats = [];\n\t\t\t\t\terrorModalShow(settings);\n\t\t\t\t});\n\t\t\t//\t\t\t$(\"#navPag\" + $scope.page).addClass(\"active\");\n\t\t}", "title": "" }, { "docid": "79fe5eed88eacdd5aeb211aa076c2bdd", "score": "0.53522605", "text": "function initProject() {\n let title = titleInput.value;\n let newProject = (0,_createProject_js__WEBPACK_IMPORTED_MODULE_1__.default)(title);\n projectHolder.addProject(newProject);\n createProjectDOM();\n toggleCreateForm();\n localStorage.setItem(\"projectArray\", JSON.stringify(projectHolder.projectArray));\n}", "title": "" }, { "docid": "678eac3daf09df3c2a0090ce2a6ba678", "score": "0.5323627", "text": "update () {\n\n // calculate the country data\n // .updateSummary()\n if (this.isPlayer) {\n\n this.updateVictoryProgress();\n this.updateSummary();\n\n }\n\n this.updateProduction();\n\n // .updateResearch();\n // .updateAI();\n // .updateIntelligence(); // optional\n\n }", "title": "" }, { "docid": "fafcc6afcbdcbaf08f893e9ceaf072b2", "score": "0.53217906", "text": "addProjectData( projectData ) {\n let format = 'project';\n if ( projectData.format ) {\n format = projectData.format;\n }\n\n let project = null;\n let sounds = null;\n let tilesets = null;\n let tilemaps = null;\n let palette = null;\n\n if ( format === 'transfer' ) {\n project = projectData.project;\n sounds = projectData.sounds;\n tilesets = projectData.tilesets;\n tilemaps = projectData.tilemaps;\n palette = projectData.palette;\n }\n else {\n project = projectData.project;\n sounds = projectData.sound.sounds;\n tilesets = projectData.tileset.tilesets;\n tilemaps = projectData.tilemap.tilemaps;\n palette = projectData.palette;\n }\n\n // engine settings\n this.clickToBegin = project.misc.clickToBegin;\n this.startTransitionFrames = project.misc.startTransitionFrames;\n\n // screen settings\n this.screen.width = project.screen.width;\n this.screen.height = project.screen.height;\n this.screen.scaleMode = project.screen.scaleMode;\n this.screen.scale = project.screen.scale;\n this.screen.minScale = project.screen.minScale;\n this.screen.maxScale = project.screen.maxScale;\n this.screen.horizontalScaleCushion = project.screen.horizontalScaleCushion;\n this.screen.verticalScaleCushion = project.screen.verticalScaleCushion;\n this.screen.rescaleOnWindowResize = project.screen.rescaleOnWindowResize;\n this.screen.hideCursor = project.misc.hideCursor;\n this.screen.setPalette( palette.colors );\n\n // tilesets\n this.tileData.tileSize = project.tileSize;\n const convertedTilesets = ConvertProject.convertProjectTilesets( tilesets, project.tileSize );\n for ( let i = 0; i < convertedTilesets.length; i += 1 ) {\n this.tileData.addTileset( convertedTilesets[i] );\n }\n\n // tilemaps\n const convertedTilemaps = ConvertProject.convertProjectTilemaps( tilemaps );\n for ( let i = 0; i < convertedTilemaps.length; i += 1 ) {\n this.mapData.addTileMap( convertedTilemaps[i] );\n }\n\n // sounds\n for ( let i = 0; i < sounds.length; i += 1 ) {\n this.audio.addSound( sounds[i] );\n }\n }", "title": "" }, { "docid": "d29eae9efcf4b82b42f698bae159bcbf", "score": "0.5321109", "text": "function refreshBuild() {\n require.refresh('tribe/build');\n require.refresh('tribe/build/activities');\n build = require('tribe/build');\n activities = require('tribe/build/activities');\n spy1 = sinon.spy();\n spy2 = sinon.spy();\n }", "title": "" }, { "docid": "46b4e62300c3f67025f5c80c52ac1c8b", "score": "0.52922064", "text": "emitProjectChanged () {\n if (!this.forceNoGlow) {\n this.runtime.emitProjectChanged();\n }\n }", "title": "" }, { "docid": "6d674e293d1914f9f202fd6d2ea583de", "score": "0.52814895", "text": "async function updateProjectData(updates, projectID) {\n await updateDoc(doc(db, \"Projects\", projectID), {\n Name: updates.Name,\n Status: updates.Status,\n Description: updates.Description,\n Priority: updates.Priority,\n ProjectID: updates.ProjectID,\n // TaskID: updates.TaskID\n });\n}", "title": "" }, { "docid": "bc80bc008279d04bd7dca56a43082e3b", "score": "0.528096", "text": "function updateGlobal()\r\n{\r\n\t//document.getElementById(\"title-message\").innerHTML = DEFAULT_HEAD_TEXT = \"TeamSolve - Puzzle \" + globalPuzzleId + \" / \" + MAX_PUZZLES;\r\n\tfor(var i = 0; i < MAX_BOARD_PIECES; i++)\r\n\t{\r\n\t\tglobalBoard[i].style.backgroundColor = getBGPieceColor(globalPuzzle[i]);\r\n\t\tglobalBoard[i].style.borderColor = getBDPieceColor(globalPuzzleC[i]);\r\n\t}\r\n}", "title": "" }, { "docid": "75b4bc97b11fd7663be14911e8082728", "score": "0.52805626", "text": "function init () {\n _self.loaders.init = true;\n return OvhApiCloudProject.v6().get({\n serviceName: _self.projectId\n }).$promise.then(function (project) {\n return handleProjectDetails(project);\n }, function () {\n // Error: goTo project creation\n return $state.go(\"iaas.pci-project-new\");\n })[\"finally\"](function () {\n _self.loaders.init = false;\n });\n }", "title": "" }, { "docid": "c9167943bdcdfd6a5e50f9d7b981c19f", "score": "0.52790964", "text": "fetch() {\n this.project =\n JSON.parse(localStorage.getItem(this.localStorage_key)) || [];\n this.bus.trigger(\"collectionUpdated\");\n }", "title": "" }, { "docid": "203264d84247ee5a5994abdb2c6d9957", "score": "0.527178", "text": "function populateProjectInfo(selectedProject) {\n var jqxhr3 = $.getJSON(\"json/commercial.json\", function (data) {\n $.each(data.projects, function (index, project) {\n if (project.uniqueID == selectedProject) {\n\n var idArray = [\"project_row_project\",\n \"project_row_location\",\n \"project_row_fixture\",\n \"project_row_code\",\n \"project_row_credit\"];\n\n var i = 0;\n for (; i < 5; i++)\n document.getElementById(idArray[i]).innerHTML = prepareHtml(i, project);\n }\n });\n })\n .done(function () { console.log(\"second success\"); })\n .fail(function () { console.log(\"error\"); })\n }", "title": "" }, { "docid": "47c08bf5b7967e7196b8bdbed1c4983a", "score": "0.5268887", "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": "e915abb90098655635d9961c21967765", "score": "0.52616066", "text": "getProject(projectId, done, error) {\n const url = this._dataDir + \"/projects/\" + projectId + \"/index.json\";\n console.log(\"Loading project manifest: \" + url);\n utils.loadJSON(url, done, error);\n }", "title": "" }, { "docid": "3ea00252cf81d67dff415833fbd5b541", "score": "0.52596426", "text": "function SimpleProject(){\n\t//allowedProject = constant.SIMPLE;\n\tauxD1 = Random.Range (28, 84); //Deadline\n\tauxD2 = Random.Range (28, 84); //Deadline\n\tauxCL = Random.Range (30, 150); //Code Lines : Tamanho do programa\n\tauxPG = Random.Range (1.5, 2.0); //Modificador de Pagamento\n\tauxBV = Random.Range (10, 100); //BugValue\n\tauxV = Random.Range (0.3, 0.8); //Volacity\n\t\n\tprojeto.SetVolatility(auxV);\n\tprojeto.SetProjectSizeString(\"Simple\");\n}", "title": "" }, { "docid": "81745cbf3028ac1eee9d75dc30cca947", "score": "0.52553445", "text": "function refreshStats () {\n switch ($routeParams.type) {\n case 'all':\n break;\n case 'general':\n statsService.fetchGeneral();\n break;\n }\n }", "title": "" }, { "docid": "188d841899e6021a00d725517c88d9cd", "score": "0.52461886", "text": "update () {\n\t\tif (! this.isActive) {\n\t\t\treturn;\n\t\t}\n\t\tthis.doUpdate ();\n\t\tif ((this.stage != \"\") && (this.stagePromise == null)) {\n\t\t\tthis[this.stage] ();\n\t\t}\n\t}", "title": "" }, { "docid": "94cbe08a444745af739baef6a41c8095", "score": "0.52454734", "text": "function fill_global_information(data) {\n global_data = new country(\"\", data.Global.TotalConfirmed, data.Global.TotalDeaths, data.Global.TotalRecovered, \"\", 0, 0, 0);\n pi_chart_protocol(global_data);\n \n var new_conf = numberWithCommas(data.Global.NewConfirmed);\n var new_deaths = numberWithCommas(data.Global.NewDeaths);\n var new_rec = numberWithCommas(data.Global.NewRecovered);\n var total_cases = numberWithCommas(data.Global.TotalConfirmed);\n var total_rec = numberWithCommas(data.Global.TotalRecovered);\n var total_death = numberWithCommas(data.Global.TotalDeaths);\n var total_active = numberWithCommas(data.Global.TotalConfirmed - data.Global.TotalRecovered - data.Global.TotalDeaths);\n $(\"#new-cases\").html(new_conf);\n $(\"#new-death\").html(new_deaths);\n $(\"#new-recovered\").html(new_rec);\n $(\"#total-cases\").html(total_cases);\n $(\"#total-recovered\").html(total_rec);\n $(\"#total-deaths\").html( total_death);\n $(\"#active-cases\").html(total_active);\n $(\"#active-cases-2\").html(total_active);\n $(\"#total-deaths-frac\").html(((data.Global.TotalDeaths/data.Global.TotalConfirmed) * 100).toFixed(2) + \"%\");\n $(\"#total-recovered-frac\").html(((data.Global.TotalRecovered/data.Global.TotalConfirmed) * 100).toFixed(2) + \"%\");\n $(\"#active-cases-frac\").html((((data.Global.TotalConfirmed - data.Global.TotalRecovered - data.Global.TotalDeaths)/data.Global.TotalConfirmed) * 100).toFixed(2) + \"%\");\n $(\"#active-cases-frac-2\").html((((data.Global.TotalConfirmed - data.Global.TotalRecovered - data.Global.TotalDeaths)/data.Global.TotalConfirmed) * 100).toFixed(2) + \"%\");\n $(\"#new-death-frac\").html((data.Global.NewDeaths/data.Global.NewConfirmed * 100).toFixed(2) + \"%\");\n $(\"#new-recovered-frac\").html((data.Global.NewRecovered/data.Global.NewConfirmed * 100).toFixed(2) + \"%\");\n}", "title": "" }, { "docid": "ce8bd223038742a5addb11b20705b1f0", "score": "0.524205", "text": "function project(p){\n\n\tdocument.addEventListener('keyup', function(e) {\n\n\t\t/*var ratio = (click_counter/selected_project.click)*1;\n\t\tbar.style.transform = 'scaleX(' + ratio + ')';\n\t\tconsole.log((click_counter/selected_project.click)*1);*/\n\n\n\t\t// if hrml not done yet\n\t\tif(!html_done){\n\n\t\t\t// launch html task\n\t\t\thtml_code(selected_project);\n\t\t\treturn;\n\n\t\t}\n\n\t\t// if css not done yet & html done\n\t\tif(!css_done && html_done){\n\n\t\t\t// launch css task\n\t\t\tcss_code(selected_project);\n\t\t\treturn;\n\n\t\t}\n\n\t\t// if css done & have js but NOT done\n\t\tif(css_done && have_js && !js_done){\n\n\t\t\t// launch js task\n\t\t\tjs_code(selected_project);\n\n\t\t} else {\n\n\t\t\tselected_project.done = true;\n\n\t\t}\n\n\t\tif(selected_project.done == true){ \n\n\t\t\t// increment money\n\t\t\tmoney += selected_project.money;\n\t\t\tmoney_div.innerHTML = 'budget : ' + money + '$';\n\n\t\t\trenown += selected_project.renown;\n\t\t\trenown_div.innerHTML = 'renown : ' + renown + '<img src=\"img/star.png\" alt=\"\">';\n\n\t\t\t// reset the project environment\n\t\t\tclick_counter = 0;\n\t\t\ttask_counter = 0;\n\t\t\tselected_project.done = false;\n\t\t\tcss_done = js_done = html_done = false; \n\n\t\t\tdone_project = true; // set project on done\n\t\t\t\n\t\t\tselected_project = next_projects[project_counter]; // set next project\n\n\t\t\tproject_counter++;\n\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "4d820b9a6ab99a1b3a03a51b3901be25", "score": "0.5242034", "text": "function updateSidebarHTML() {\n // Update all of the project info.\n var divElement = document.getElementById('sidebar-contents');\n while (divElement.firstChild) {\n divElement.removeChild(divElement.firstChild);\n }\n\n for (var i = 0; i < gStatusData.length; ++i) {\n divElement.appendChild(gStatusData[i].createHtml());\n }\n\n // Debugging stats.\n document.getElementById('num-ticks-until-refresh').innerHTML =\n gTicksUntilRefresh;\n document.getElementById('num-requests-in-flight').innerHTML =\n gNumRequestsInFlight;\n document.getElementById('num-requests-ignored').innerHTML =\n gNumRequestsIgnored;\n document.getElementById('num-requests-retried').innerHTML =\n gNumRequestsRetried;\n}", "title": "" }, { "docid": "fad5a3c496cb88694f02588de451e9ac", "score": "0.52340466", "text": "function updateMainScreen() {\n var projectTypeInfo = document.createElement(\"p\");\n projectTypeInfo.innerText = \"Project Type: \" + currentProject.type;\n\n var projectLinesInfo = document.createElement(\"p\");\n projectLinesInfo.innerText = \"Lines Needed: \" + currentProject.lines;\n\n var projectNameInfo = document.createElement(\"p\");\n projectNameInfo.innerText = \"Project Name: \" + currentProject.name;\n\n mainGameLProjectData.innerText = \"\";\n\n mainGameLProjectData.appendChild(projectTypeInfo);\n mainGameLProjectData.appendChild(projectLinesInfo);\n mainGameLProjectData.appendChild(projectNameInfo);\n\n projectLinesTbdInfo = document.createElement(\"p\");\n projectLinesTbdInfo.innerText =\n \"Lines to be done: \" + currentProject.linesTbd;\n\n mainGameRProjectData.innerText = \"\";\n\n mainGameRProjectData.appendChild(projectLinesTbdInfo);\n\n document.addEventListener(\"keydown\", keystrokeCounter);\n document.addEventListener(\"keydown\", loadAce);\n document.addEventListener(\"keydown\", cArk);\n }", "title": "" }, { "docid": "24dd917441c02aca3596db2747b5750b", "score": "0.5218819", "text": "function load_project(proj_id){\n offset=0;\n media_count=0;\n $(window).scrollTop(400);\n $('.pH_row-edit').addClass('hide').removeClass('show');\n project_view.addClass('show').removeClass('hide');\n var url=proj_id+'/display/';\n ajaxHandle.ajax_req(url,'GET',proj_id,function(res){\n res=JSON.parse(res);\n project_view.attr('data-proj-id', res.id);\n project_view.find('.p_mt').text(res.serial.title);\n project_view.find('.p_st').text(res.serial.type);\n project_view.find('p').text(res.serial.description);\n media_count=res.media_count;\n $('.project_lists').removeClass('hide').addClass('show');\n $('.gallery-header').find('h4').text(res.serial.title);\n var classname = $('.tabs.active').attr('class').split(' ')[0];\n var media_type=get_media_type(classname);\n load_media(media_type,proj_id,'click',offset,6);\n });\n }", "title": "" }, { "docid": "e9b0ff704749bef3f8903f02686723ec", "score": "0.5210665", "text": "function fetchProjectInfo() {\n // Request URL for project\n var projectAPI = testRailURL + \"/index.php?/api/v2/get_project/\" + projectID;\n var params = setTestRailHeaders();\n\n // Don't make the API call if no test plans/runs were in the XML\n if (projectID == \"0\") {\n document.getElementById('activityCaption').innerHTML = \"Test plan not found\";\n msg.dismissMessage(loadMessage);\n gadgets.window.adjustHeight();\n } else {\n // Proxy the request through the container server\n gadgets.io.makeRequest(projectAPI, handleProjectResponse, params);\n }\n}", "title": "" }, { "docid": "20971e5b908c92c649d82801b2925f01", "score": "0.5201638", "text": "function loadProjectToDom(ID) {\n // templates.clearGearDiv();\n db.getItem(ID)\n .then((result) => {\n templates.projectBuilder(result);\n });\n}", "title": "" }, { "docid": "963cfe6a6074bded165012419c1f1d35", "score": "0.51975596", "text": "function updateProjects() {\n var oReq = new XMLHttpRequest();\n oReq.addEventListener(\"load\", function(res){\n let splits = res.currentTarget.responseText.split(\"\\n\");\n document.getElementById(\"projects\").innerHTML = null;\n for (let i=0; i<splits.length; i++) {\n let node = document.createElement(\"button\");\n node.innerText = splits[i];\n document.getElementById(\"projects\").appendChild(node);\n node.setAttribute(\"onclick\", \"loadProject(this.innerText);\");\n\n if ($(node).text() == loadedProject) {\n $(node).attr(\"selected\", true);\n }\n\n $(node).contextmenu(function() {\n $(\"#contextModal\").attr(\"attr-active\", true);\n $(\"#contextTitle\").text(\"Manage Project: \" + $(node).text())\n $(\"#contextOptions\").html(null);\n\n let load = document.createElement(\"button\");\n $(load).text(\"Load Project\");\n $(load).click(function() {\n loadProject($(node).text());\n });\n\n let del = document.createElement(\"button\");\n $(del).text(\"Delete Project\");\n $(del).click(function() {\n var oReq = new XMLHttpRequest();\n oReq.open(\"GET\", \"/api/LoadProject/DeleteProject/_/_/\" + $(node).text());\n oReq.send();\n $(node).attr(\"selected\", true);\n });\n\n $(\"#contextOptions\").append(load);\n $(\"#contextOptions\").append(del);\n\n return false;\n });\n }\n });\n oReq.open(\"GET\", \"/api/GetProjects\");\n oReq.send();\n}", "title": "" }, { "docid": "87d5d8a1883b27e01fa561d25db55fa1", "score": "0.51935637", "text": "function _refreshprojectdetailsData() {\n\t\t\t\t\t\t\t$http(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tmethod : 'GET',\n\t\t\t\t\t\t\t\t\t\turl : 'http://localhost:8080/visog-job-portal-api/transaction/projectdetails/'\n\t\t\t\t\t\t\t\t\t}).then(function successCallback(response) {\n\t\t\t\t\t\t\t\t// alert(response.data.data)\n\t\t\t\t\t\t\t\t$scope.projectdetails = response.data.data;\n\t\t\t\t\t\t\t}, function errorCallback(response) {\n\t\t\t\t\t\t\t\tconsole.log(response.statusText);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}", "title": "" }, { "docid": "8fccf3b33e62a9d0bfc42ec9311564ca", "score": "0.5190022", "text": "static refresh() { }", "title": "" }, { "docid": "1970a1e95abab2fa6beda4c3f02bb968", "score": "0.51882076", "text": "function updateView() {\n function updateRobotView(robot) {\n for (var path in paths[robot]) {\n if (paths[robot].hasOwnProperty(path)) {\n window.globals.setPath(\n robot+'.'+path+'.green',\n paths[robot][path].green[tableConfig].points,\n paths[robot][path].green[tableConfig].initAngle\n );\n window.globals.getPaths()[robot+'.'+path+'.green'].setRobot(robot);\n window.globals.getPaths()[robot+'.'+path+'.green'].visible(visibilities[robot][path]);\n window.globals.setPath(\n robot+'.'+path+'.purple',\n paths[robot][path].purple[tableConfig].points,\n paths[robot][path].purple[tableConfig].initAngle\n );\n window.globals.getPaths()[robot+'.'+path+'.purple'].setRobot(robot);\n window.globals.getPaths()[robot+'.'+path+'.purple'].visible(visibilities[robot][path]);\n }\n }\n }\n updateRobotView('small');\n updateRobotView('big');\n // delete removed paths\n for (var viewPath in window.globals.getPaths()) {\n var p = decomposeViewPath(viewPath);\n if (window.globals.getPaths().hasOwnProperty(viewPath) && !paths[p.robot].hasOwnProperty(p.name)) {\n window.globals.getPaths()[viewPath].remove();\n }\n }\n // refresh view\n paper.project._needsUpdate = true;\n paper.project.view.update();\n}", "title": "" }, { "docid": "8d1322a2a5c3debae9ffb655e4b6dee9", "score": "0.51880205", "text": "function updateJSON(key, value) {\n var projectFile = 'app/build-information.json';\n if (!grunt.file.exists(projectFile)) { // create the file\n grunt.file.write(projectFile, '{}');\n }\n var project = grunt.file.readJSON(projectFile); // get file as JSON object\n project[key] = value; //edit the value of JSON object\n grunt.file.write(projectFile, JSON.stringify(project, null, 2)); //serialize it back to file\n }", "title": "" }, { "docid": "8c6480e6f89e263f786ad2ce1860e12a", "score": "0.5177092", "text": "function resetVariables() {\r\n AWProjectTitle = $(\".AW__project__title\");\r\n AWProjectMainImg = $(\".AW__project__main-img\");\r\n AWProjectReadMore = $(\".AW__project__read-more\");\r\n AWProjectQuote = $(\".AW__project__quote\");\r\n AWProjectQuoteblockquote = $(\".AW__project__quote blockquote\");\r\n AWProjectImagesMash = $(\".AW__project__images--mash\");\r\n AWProjectImagesMase = $(\".AW__project__images--mase\");\r\n AWProjectImagesExpand = $(\".AW__project__images--expand\");\r\n AWProject = $(\".AW__project\");\r\n AWProjects = $(\".AW__projects\");\r\n }", "title": "" }, { "docid": "5eb9cb6d93b16239262847702026078c", "score": "0.5175675", "text": "'projects-tree-rebuild'( ev, instance ){\n Template.projects_tree.fn.inst_rebuildTree( instance );\n }", "title": "" }, { "docid": "96498c7c4accc2abe014033b1eaee6f9", "score": "0.51726896", "text": "function populateProjects() {\n\t\t$('#projectsTable > tbody').empty();\n\t\t// load in the fs module\n\t\tvar fs = require('fs');\n\t\t function doesDirectoryExist (tempfileLoc) {\n try { fs.statSync(tempfileLoc); return true; }\n catch (er) { return false; }\n }\n\n // check if there are projets\n\t\tif(Projects.length > 0) {\n \t\t// get the active project index\n\t\t\tvar activeProjectIndex = Projects.at(0).attributes.active;\n\n\t\t\t// Render Projects into page\n\t\t\tfor(var i = 1; i < Projects.length; i++) {\n \t\t\t// if the project dir does not exist, delete the project\n if(!doesDirectoryExist (Projects.at(i).attributes.project.root + \"/\")) {\n \t\t\t Projects.remove(Projects.at(i));\n \t\t\t saveProjectsJSON();\n \t\t\t}\n \t\t\telse {\n \t\t\t// append projects to tables\n \t\t\t\t$('#projectsTable > tbody:last').append('<tr class=\"project\" data-name=\"' + Projects.at(i).attributes.project.name +\n \t\t\t\t\t'\" data-projectindex=\"' + i + '\">' +\n \t\t\t\t\t'<td>' + Projects.at(i).attributes.project.name + '</td>' +\n \t\t\t\t\t'<td>' + Projects.at(i).attributes.project.root + '</td>' +\n \t\t\t\t\t'<td>' + '' + '</td>' +\n \t\t\t\t\t'</tr>');\n \t\t\t}\n\t\t\t}\n\n // populate the rest of the page with tables\n\t\t\tfor(var k = 0; k < 40-Projects.length; k++) {\n\t\t\t\t$('#projectsTable > tbody:last').append('<tr class=\"project-empty\">' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<td>&nbsp;</td>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<td></td>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<td></td>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'</tr>');\n\t\t\t}\n\n\n // append the add project box\n $('#addprojectcard').remove();\n\t\t\t$('.projects').append(jambifs.readHTML('public/views/addProjectTemplate.html'));\n\n\n\n // sort event listeners\n $('.project').off('dblclick');\n $('.project').off('click');\n $('.project-empty').off('click');\n $('#addProject').off('click');\n $('#closeAddProject').off('click');\n $('#addProject_selectLocation').off('change');\n\n // open project click\n\t\t\t$('.project').on('dblclick', function() {\n\t\t\t\tvar projectIndex = $(this).data(\"projectindex\");\n\t\t\t\tactiveProject = Projects.at(projectIndex).attributes.project;\n\t\t\t\topenProject($(this).data(\"name\"), activeProject, $(this).data(\"projectindex\"));\n\t\t\t});\n\n // select project click\n\t\t\t$('.project').on('click', function() {\n\t\t\t\t$('.project').removeClass('active');\n\t\t\t\t$(this).addClass('active');\n\t\t\t});\n\n // off active project\n\t\t\t$('.project-empty').on('click', function() {\n\t\t\t\t$('.project').removeClass('active');\n\t\t\t});\n\n // fade out project card\n\t\t\t$(document).on('click', function(event){\n\t\t\t\tif(!$(event.target).closest('#addprojectcard').length) {\n\t\t\t\t\t$('#addprojectcard').fadeOut();\n\t\t\t\t}\n\t\t\t});\n\n // add a project click\n\t\t\t$('#addProject').on('click', function() {\n \t\t\t// if a name and location has been specified\n\t\t\t\tif($('#addProjectName').val() && $('#addProjectLocation').val()) {\n \t\t\t\tvar options = {\n \t\t\t\tgrunt: false,\n \t\t\t\tbootstrap: false,\n \t\t\t\tjquery: false,\n \t\t\t\tbackbone: false,\n \t\t\t\tangular: false,\n \t\t\t\tjambitemplate: false\n \t\t\t\t};\n\n \t\t\t\tvar sshOptions = {\n \t\t \"enabled\" :\tfalse,\n \t\t \"server\": \"\",\n \t\t \"port\": 22,\n \t\t \"username\": \"\",\n \t\t \"password\": \"\"\n \t\t\t\t}\n // check for checkboxes\n \t\t\t\tif($('#newproject_jquery').prop('checked')) options.jquery = true;\n \t\t\t\tif($('#newproject_backbone').prop('checked')) options.backbone = true;\n \t\t\t\tif($('#newproject_angular').prop('checked')) options.angular = true;\n \t\t\t\tif($('#newproject_jambitemplate').prop('checked')) options.jambitemplate = true;\n \t\t\t\tif($('#newproject_grunt').prop('checked')) options.grunt = true;\n \t\t\t\tif($('#newproject_bootstrap').prop('checked')) options.bootstrap = true;\n\n\n \t\t\t\t// SSH OPTIONS\n \t\t\t\tif($('#addProject_ssh_host').val()) sshOptions.server = $('#addProject_ssh_host').val();\n \t\t\t\tif($('#addProject_ssh_port').val()) sshOptions.port = $('#addProject_ssh_port').val();\n \t\t\t\tif($('#addProject_ssh_user').val()) sshOptions.username = $('#addProject_ssh_user').val();\n \t\t\t\tif($('#addProject_ssh_pass').val()) sshOptions.password = $('#addProject_ssh_pass').val();\n\n // add a project\n\t\t\t\t\taddProject($('#addProjectName').val(), $('#addProjectLocation').val(), options, sshOptions);\n\t\t\t\t\t$('#addprojectcard').fadeOut();\n\t\t\t\t\tpopulateProjects();\n\t\t\t\t}\n\t\t\t});\n\n // fade out add project box\n\t\t\t$('#closeAddProject').on('click', function() {\n\t\t\t\t$('#addprojectcard').fadeOut();\n\t\t\t});\n\n // initally hide the box\n\t\t\t$('#addprojectcard').hide();\n\n // update the file location\n\t\t\t$('#addProject_selectLocation').on('change', function (event) {\n\t\t\t\tvar fileLocation = $(this).val();\n\t\t\t\t$('#addProjectLocation').val(fileLocation);\n\t\t\t});\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "0f072dd07a16cadbff5f844b98b30b3d", "score": "0.5169868", "text": "_updateVariables(){\n\t\tlet promises = [];\n\t\t\n\t\tfor(let module of this.modules){\n\t\t\tif(module.cssProps && module.cssProps.length != 0){\n\t\t\t\tfor(let prop of module.cssProps){\n\t\t\t\t\tpromises.push(this._getCssProp(prop).then(value => module.update(prop, value)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tPromise.all(promises).then(res => {\n\t\t\tthis._log(\"Updated!\", 'log');\n\t\t});\n\t}", "title": "" }, { "docid": "e88f91b023344493fd27f394d9566c60", "score": "0.5157585", "text": "function updateStats(){\n\tdocument.getElementById('currentHealth').innerHTML = makePretty(curPlayer.life.current);\n\tdocument.getElementById('currentStamina').innerHTML = makePretty(curPlayer.stamina.current);\n\tdocument.getElementById('maxStamina').innerHTML = makePretty(curPlayer.stamina.max);\n\tdocument.getElementById('currentRun').innerHTML = makePretty(curPlayer.distance.current);\n\t\n\tdocument.getElementById('totalGameTime').innerHTML = makeTime(curGame.totalGameTime);\n\tdocument.getElementById('totalPersonalMoney').innerHTML = makePretty(curPlayer.money.total);\n\tdocument.getElementById('totalCharityMoney').innerHTML = makePretty(curCharity.money.total);\n\tdocument.getElementById('totalResearchMoney').innerHTML = makePretty(curGame.totalResearchMoney);\n\t\n}", "title": "" }, { "docid": "a176473a3eae5ea463c429c014e8c3c8", "score": "0.5152007", "text": "function saveAllGlobals(){\n set_data(\"isInitialized\", isInitialized);\n set_data(\"currentLevel\", currentLevel);\n set_data(\"currentFight\", currentFight);\n set_data(\"playerGold\", playerGold);\n set_data(\"playerHealth\", playerHealth);\n set_object(\"playerProgress\", playerProgress);\n}", "title": "" }, { "docid": "d9eb318ee83f2707d07f09ab4348a7b1", "score": "0.51514703", "text": "function check () {\n fs.stat(path.join('projects', pid), function (err, stats) {\n if (err && err.code === 'ENOENT') {\n done(null, renderNewProject(pid))\n } else if (err) {\n done(err)\n } else {\n var core = utils.getOrCreateProject(pid)\n renderProject(core, done)\n }\n })\n }", "title": "" }, { "docid": "ef0cc95d2f74633202ad77be72d09204", "score": "0.51483476", "text": "function dynamicLoad(setProjects) {\n //\n}", "title": "" }, { "docid": "516d42c459398bbef5af8a11bbd95575", "score": "0.5142796", "text": "function updatePathFromBuild(_pathProject,_pathSrcBuild){\n pathProject = _pathProject;\n pathSrcBuild = _pathSrcBuild;\n Editor.log(\"----updatePathFromBuild----\");\n Editor.log(\"pathProject:\" + pathProject);\n Editor.log(\"pathSrcBuild:\" + pathSrcBuild);\n}", "title": "" }, { "docid": "bf73d576af903dd724b10e82b2900b26", "score": "0.51423186", "text": "function loadProjects() { \r\n projects = projContext.get_projects();\r\n projContext.load(projects, 'Include(Name, StartDate, Id)');\r\n projContext.executeQueryAsync(displayProjects, onRequestFailed);\r\n}", "title": "" }, { "docid": "98ef3015e6a3831c17208aa9d65595e1", "score": "0.51404434", "text": "async reload() {\n this._progressButton = null;\n return Game.getSetupData(game.socket).then(setupData => {\n mergeObject(game.data, setupData);\n mergeObject(this, setupData);\n this.render();\n Object.values(ui.windows).forEach(app => {\n if ( app instanceof InstallPackage ) app.render();\n });\n });\n }", "title": "" }, { "docid": "4acd12f84f9e55c8857bfc1f12c672c5", "score": "0.51391965", "text": "function updateBuild () {\n let obj = readJson(JSON_FILE)\n // The date is a string representing the Date object\n obj.build.date = (new Date()).toString()\n obj.build.number++\n obj.build.total++\n writeJson(obj, chalk.green(`\\n${chalk.bold('AppVersion:')} Build updated to ${obj.build.number}/${obj.build.total}\\n`))\n}", "title": "" }, { "docid": "a05a32cd34bbd9262923491abd4c16aa", "score": "0.51361376", "text": "function initializeNewProject(id) {\n\t \t\tproject_id = id;\n\t \t\tproject_name = \"\";\n\t\t\tfiles = [];\n\n\t\t\tcurrentFile = \"\";\n\n\t\t\tcurrentData = editor.getValue();\n\n\t\t\tcurrentUploadedFileData = \"\";\n\n\t\t\t$(\"#fileMenu\").html(\"\");\n\n\n\t\t\tloadFiles(); // load the file menu with the new updated data\n\t \t}", "title": "" }, { "docid": "8f9f833ead9f2f9ba7bf37074c333997", "score": "0.51302403", "text": "function autoLoadProjects() {\r\n\r\n var footerHeight = $('footer').height() + 25,\r\n winHeight = $(window).height();\r\n\r\n $(window).scroll(function () {\r\n debounce(function () {\r\n \r\n if ($(window).scrollTop() + winHeight >= getDocHeight() - footerHeight) {\r\n \r\n //checking if there's more projects to load.\r\n if (projectListCounter < Statkraft.mapProjects.length) {\r\n\r\n if ((projectListCounter + 8) > Statkraft.mapProjects.length) {\r\n projectListCounter = projectListCounter - (projectListCounter - Statkraft.mapProjects.length);\r\n renderMapProjects(projectListCounter, 'scroll');\r\n } else {\r\n projectListCounter = projectListCounter + 8;\r\n //shows the loading animation.\r\n $('.load-more-projects-container').removeClass('hidden');\r\n $('.load-more-projects').removeClass('hidden');\r\n\r\n //load more projects\r\n renderMapProjects(projectListCounter, 'scroll');\r\n\r\n //removes the loading animation\r\n $('.load-more-projects-container').addClass('hidden');\r\n $('.load-more-projects').addClass('hidden');;\r\n }\r\n\r\n } else {\r\n //show the no more loading dialog.\r\n $('.load-more-projects-container').removeClass('hidden');\r\n $('.no-more-loading').removeClass('hidden');\r\n }\r\n }\r\n }, 200, 'map');\r\n });\r\n }", "title": "" }, { "docid": "10d3ca0f9920103ff627ca872b1ab5bc", "score": "0.5127428", "text": "function refresh() {\n br_init.run_all_plugin_tests();\n }", "title": "" }, { "docid": "885f9f67c90a5f172a1b2b1e7b8c2da3", "score": "0.5116722", "text": "function setProjectData(projectResult){\t\n\tfor(var i=0, length = projectResult.length; i< length; i++){\t\t\n\t\tif(i > 0){\n\t\t\t$.project.text = \", \" + projectResult[i].projectName;\n\t\t}else{\n\t\t\t$.project.text = projectResult[i].projectName;\n\t\t}\n\t}\n\t\n\tif ($.project.text == '') {\n\t\t$.name.top = 30;\n\t}\n\t\n\t// set project data\n\t$.project.rowData = projectResult;\n}", "title": "" }, { "docid": "f01e68e77c1ae8ae0abb1ec5c066b227", "score": "0.51163596", "text": "function load_project(){\n\t\t\n\t\t\t\n\t\t\t$(\".project_entry\").live({\n\t\t\t click: function() {\n\t\t\t // project is not open, so lets open it the project\n\t\t\t if($(this).hasClass('open')==false){\n \n projectOpen = true;\n\t\t\t\t\t //get all open projects and destroy\n\t\t\t\t\t $('.project_content').remove();\n\n\t\t\t \t//lets also close everything else while were at it\n\t\t\t \t $('.open').each(function(){\n\t\t\t \t\t\n\t\t\t \t\t\t$(this).removeClass('open');\n\t\t\t \t\t\t$('<div class=\"project_placeholder\"></div>').insertAfter($(this));\n\t\t\t \t\t\t$(this).next('.project_placeholder').slideUp('slow',function() { \n\t\t\t\t\t\t\t\t $(this).remove();\n\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\t\t\n\t\t\t \t $('<div id=\"'+$(this).attr('id')+'_content\" class=\"project_content\"></div>').insertAfter($(this)).hide().load_project('settings',{ 'id':$(this).attr('id')});\n\t\t\t \t$(this).addClass('open');\n\t\t\t\t\t//ANALYTICS\n\t\t\t\t\t_gaq.push(['_trackPageview','/project/'+$(this).find(\"#project_title\").text()]);\n\t\t\t\t\t \n\t\t\t \tvar prevProejctID = curProjectID\n\t\t\t \tvar offset\n\t\t\t \tcurProjectID = $(this).attr('id');\n\t\t\t \tif(parseFloat(prevProejctID)<parseFloat(curProjectID)){\n\t\t\t \t\toffset = 495;\n\t\t\t \t}else{\n\t\t\t \t\toffset = 50;\n\t\t\t \t}\n\n\t\t\t\t\t$('html,body').delay(100).animate({ scrollTop: $('#'+curProjectID).offset().top-offset }, { duration: 'slow', easing: 'swing'});\n\t\t\t //\tproject is open - we should close it \n\t\t\t }else{\n\t\t\t \tprojectOpen = false;\n\t\t\t \t$('.jquery_slideshow').remove();\n\t\t\t \t$(this).next('.project_content').remove();\n\t\t\t\t\t $('<div class=\"project_placeholder\"></div>').insertAfter($(this));\n\t\t\t \t\t\t$(this).next().slideUp('slow',function() { \n\t\t\t\t\t\t\t\t\t $(this).remove();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t$(this).removeClass('open');\n\t\t\t\t\tcurProjectID = 100;\n\t\t\t }\n\t\t\t \n\t\t\t },\n\t\t\t mouseenter: function() {\n\t\t\t // do something on mouseover\n\t\t\t $(this).addClass('entry_hover')\n\t\t\t $(this).find(\"img\").fadeTo(\"fast\", 1);;\n\t\t\t\n\t\t\t },\n\t\t\t mouseleave: function() {\n\n\t\t\t \tif($(this).hasClass('cycling')==false){\n\t\t\t \t\t$(this).addClass('cycling');\n\t\t\t \t\t$(this).charcycle();\n\t\t\t \t}\n\t\t\t \t\n\t\t\t \t $(this).removeClass('entry_hover')\n\t\t\t \t $(this).find(\"img\").fadeTo(\"fast\", 0.5);;\n\t\t\t \t\n\t\t\t }\n\t\t\t});\t\t\t\t\n \n $('#proj_close').live('click',function(){\n\n projectOpen = false;\n \n $('.project_content').remove();\n $('<div class=\"project_placeholder\"></div>').insertAfter($('#'+curProjectID));\n $('#'+curProjectID).next().slideUp('slow',function() { \n $(this).remove();\n });\n \n $('#'+curProjectID).removeClass('open');\n curProjectID = 100;\n\n });\n \n \n\t}", "title": "" }, { "docid": "7f4391434dd41d749e7d7d924799592a", "score": "0.5112151", "text": "function loadProject(data) {\n var children;\n var stage;\n return loadFonts()\n .then(() => Promise.all([\n loadWavs(),\n loadArray(data.children, loadObject).then((c) => children = c),\n loadBase(data, true).then((s) => stage = s),\n ]))\n .then(() => {\n children = children.filter((i) => i);\n children.forEach((c) => c.stage = stage);\n var sprites = children.filter((i) => i instanceof Scratch2Sprite);\n var watchers = children.filter((i) => i instanceof Scratch2VariableWatcher);\n stage.children = sprites;\n stage.allWatchers = watchers;\n stage.allWatchers.forEach((w) => w.init());\n stage.updateBackdrop();\n P.sb2.compiler.compile(stage);\n return stage;\n });\n }", "title": "" }, { "docid": "d18e0a5052e4ceee91e8794170383cdd", "score": "0.5110562", "text": "function getProject() {\n\t\t\tconsole.log('toDoController.getProject');\n\t\t\tconsole.log(Projects.getLastActiveIndex());\n\t\t\tconsole.log($scope.projects);\n\t\t\t$scope.activeProject = $scope.projects[Projects.getLastActiveIndex()];\t\t\t\n\t\t}", "title": "" }, { "docid": "34598356297602234d6fab95f2dcce25", "score": "0.51070803", "text": "function reloadVariables() {\n data.reload(parseInt($(\"#seed\").val()))\n phtml.updateValues()\n }", "title": "" }, { "docid": "f5b90763febd3b98bd026e495a36a209", "score": "0.5103229", "text": "function display(array){\n resetDisplay();\n\n array.forEach(input =>{\n $.getJSON(\"https://d6wn6bmjj722w.population.io/1.0/population/\" + input + \"/today-and-tomorrow/\").done(function(data){\n // Data from the API is set to some values.\n let todayD = data.total_population[0].population;\n let tomorrowD = data.total_population[1].population;\n\n setLiHTML(countryList, todayD, input); \n /*\n Okey, so my idea was to update the innerHTML based on and updated population each time display() is called.\n\n if(population == undefined){\n setLiHTML(countryList, todayD, input); \n }else{\n setLiHTML(countryList, population, input);\n }\n // Here I tried to set the API-data to global variables.\n today = todayD;\n tomorrow = tomorrowD; */\n })\n })\n}", "title": "" }, { "docid": "16584599e1b17c5a1778e31914ccab5f", "score": "0.51017517", "text": "function get_projects() {\n document.body.className = 'vbox viewport waiting';\n\t var data = {};\n\t data[\"token\"] = localStorage.token;\n\t appserver_send(APP_PLISTPROJECTS, data, projects_callback);\n }", "title": "" }, { "docid": "0c95250461d5774ef35b97fabb52e1e9", "score": "0.50998247", "text": "function updateStats() { updatePrimaryStats(); updateOther(); updateSecondaryStats(); updateTertiaryStats(); }", "title": "" }, { "docid": "5564f8c270f4996fa7ac0000747a40bc", "score": "0.50951654", "text": "function getProjectData () {\n queryJira(setProjectData, that.jira, 'GET', 'api/2/project/' + that.project)\n\n function setProjectData (response) {\n if (response.status === 'success') {\n that.issuetypes = response.data.issueTypes\n that.components = response.data.components\n that.versions = response.data.versions\n showForm(that) // next\n } else {\n console.error('Internal Ajax Error:', response)\n throw new Error('CIC failed to load issuetypes, components, and versions')\n }\n }\n }", "title": "" }, { "docid": "0d5f9f68f5267631b654698a29c43e1e", "score": "0.5094317", "text": "function resetProject() {\n project.delete()\n project = new Project({\n target: project.target,\n });\n document.querySelector('#input').value = examples[project.board.config.example];\n update();\n}", "title": "" }, { "docid": "8a9f2ad3257c2d4d87d73df8850b84da", "score": "0.50919884", "text": "function update() {\n getCurrentWeather();\n getForecast();\n saveSearchHistory();\n displayHistory();\n}", "title": "" }, { "docid": "e2578a71e6ff019f7d2f757debdf5d1d", "score": "0.50873977", "text": "function getGlobal () {\r\n\tvar xhttp = new XMLHttpRequest();\r\n\txhttp.onreadystatechange = function() {\r\n\t\tif (xhttp.readyState == 4 && xhttp.status == 200) {\r\n\t\t\tglobal = JSON.parse(xhttp.responseText).points;\r\n\t\t\tglobal += points % 3;\r\n\t\t\tupdateGlobal();\r\n\t\t}\r\n\t};\r\n\txhttp.open(\"GET\", \"php/getPoints.php\", true);\r\n\txhttp.send();\r\n}", "title": "" }, { "docid": "94a9d55dea7f528b2e93e76cddbad062", "score": "0.5086395", "text": "fetchProjects() {\n actions.fetchProjects();\n }", "title": "" }, { "docid": "d7dee3f191b9e08568f7d2b97ae3f110", "score": "0.5085284", "text": "refresh() {\n this.refreshing = true;\n this.moduleLoader.clean();\n this.destroy();\n this.clearChanges();\n this.localObserver = new Observer(this);\n this.preRender();\n this.injectModules();\n this.render();\n this.refreshing = false;\n }", "title": "" }, { "docid": "48fb6330b145ce27231ad87716709faa", "score": "0.50827616", "text": "function add() {\n var root = FileUtils.stripTrailingSlash(ProjectManager.getProjectRoot().fullPath),\n recentProjects = getRecentProjects(),\n index = recentProjects.indexOf(root);\n\n if (index !== -1) {\n recentProjects.splice(index, 1);\n }\n recentProjects.unshift(root);\n if (recentProjects.length > MAX_PROJECTS) {\n recentProjects = recentProjects.slice(0, MAX_PROJECTS);\n }\n PreferencesManager.setViewState(\"recentProjects\", recentProjects);\n }", "title": "" }, { "docid": "f23fe8924e4a99f6c44790c31b202363", "score": "0.5078131", "text": "function updateUI() {\n if(modules.length==0)\n return;\n console.log(\"UPDATING MODULES\");\n updateModules();\n for(var i = 0 ; i < modules.length ; ++i) {\n var moisture_i = document.getElementById(\"moisture_\"+modules[i].channel);\n moisture_i.innerHTML = 'Moisture: ' + modules[i].moisture + '% <br />';\n\n var lastUpdated_i = document.getElementById(\"lastUpdated_\"+modules[i].channel);\n lastUpdated_i.innerHTML = 'Updated: ' + modules[i].lastUpdated + '<br /><br />'\n }\n writeStorage();\n}", "title": "" }, { "docid": "1767c326a3312a824110fdcb7140d120", "score": "0.50770026", "text": "function syncCore(projectConfig) {\n var activeProjectName = (exports.activeProjectConfigDetails && exports.activeProjectConfigDetails.name);\n configFile = ConfigFile.getConfigFileFromDiskOrInMemory(projectConfig);\n // In case of error we exit as `ConfigFile.getConfigFileFromDiskOrInMemory` already does the error reporting\n if (!configFile)\n return;\n exports.configFileUpdated.emit(configFile);\n exports.projectFilePathsUpdated.emit({ filePaths: configFile.project.files });\n // Set the active project (the project we get returned might not be the active project name)\n exports.activeProjectConfigDetails = projectConfig;\n exports.activeProjectConfigDetailsUpdated.emit(exports.activeProjectConfigDetails);\n}", "title": "" }, { "docid": "f475455342ebe490a50bf4f4243da711", "score": "0.5074933", "text": "function updateStats() {\n $('.current_number').text(current_number);\n $('.stat-incorrect').text(\"Incorrect: \" + incorrect);\n $('.stat-count').text(\"Turns left: \" + count);\n }", "title": "" }, { "docid": "2d2a232f2ea568f8a298ebe7a20c2f5b", "score": "0.50676095", "text": "function updatePlot() {\n $.get('/ajax/get-plot-data.php',\n { projectid: getProjectId() },\n updatePlotCallback);\n}", "title": "" }, { "docid": "2bb7726b41744f979243aab053efc575", "score": "0.5065699", "text": "function updateStats() {\n $('#wins').text(wins);\n $('#losses').text(losses);\n }", "title": "" }, { "docid": "08ffda9154138795902d64053a324bb5", "score": "0.5060986", "text": "function reloadIdeology()\n{\n\tcongressNum = $(\"#congSelector\").val();\n\tqueue().defer(d3.json, \"/api/getmembersbycongress?congress=\"+congressNum+\"&api=Web_PI\").await(updateCongress);\n}", "title": "" }, { "docid": "34b87655cc09080417c03a07cb131e3a", "score": "0.5060476", "text": "function reload(){\n var team = $('#team').val();\n var sliderVals = $('.year-slider').slider(\"values\");\n var startYear = sliderVals[0];\n var endYear = sliderVals[1];\n var format = $('#format').val();\n\n console.log(\"setting title\");\n $('#team-title').text(team + ', years ' + startYear + \" to \"+sliderVals[1]);\n console.log(\"loading charts with ...\",team,startYear,sliderVals[1]);\n\n RivalComparison.loadRivalComparisonRow(team,startYear,endYear,format);\n VenueComparison.loadVenueComparisonRow(team,startYear,endYear,format);\n TeamPerformance.loadData(team,startYear,endYear,format);\n}", "title": "" }, { "docid": "9a4723bbcd617159270e8dec24a4f518", "score": "0.5054164", "text": "function updateStatsArray () {\n seasonStats = [stats.count.seasons, stats.season.games, stats.season.goals,\n stats.season.assists, stats.season.points, stats.season.hits,\n stats.season.shots];\n playoffStats = [stats.count.playoffs, stats.playoffs.games, stats.playoffs.goals,\n stats.playoffs.assists, stats.playoffs.points, stats.playoffs.hits,\n stats.playoffs.shots]; \n}", "title": "" } ]
f5c6d7cb2cc0d80709aa5bef46896950
+ increment the move counter and display it on the page (put this //functionality in another function that you call from this one
[ { "docid": "1bcc3b2d98acdad8478f48992ad52cc0", "score": "0.0", "text": "function scoreKeeper(){\n //keep track of how many moves\n moves++;\n boardScore.innerHTML = moves;\n //console.log(moves);\n \n //keep track of the stars\n if(moves >=12){\n //remove star\n stars[2].style.visibility = \"hidden\";\n }\n if(moves >= 18){\n //remove another star\n stars[1].style.visibility = \"hidden\";\n }\n \n}", "title": "" } ]
[ { "docid": "76ac6fe07a12ac810891d9b7944fd552", "score": "0.85300404", "text": "function increaseMoveCounter() {\n moveCounter++;\n moves.textContent = moveCounter;\n }", "title": "" }, { "docid": "da436fad374378a22eac29ed2e99ad89", "score": "0.84055567", "text": "function updateMoveCounter() {\n if (moveCounter === 1) {\n moveSpan.innerHTML = moveCounter + ' Move';\n } else {\n moveSpan.innerHTML = moveCounter + ' Moves';\n }\n}", "title": "" }, { "docid": "fc2791415211cad1b0fcbb27cbb3c020", "score": "0.82820225", "text": "function moveCounter(){\n moves++;\n counter.innerHTML = moves;\n}", "title": "" }, { "docid": "9c82afe0e73e950ee3d3c65dff328dbf", "score": "0.8226249", "text": "function addMoveCounter() {\n movesCounter++;\n if (movesCounter === 1) {\n movesNum.innerHTML = `${movesCounter} Move`;\n } else {\n movesNum.innerHTML = `${movesCounter} Moves`;\n }\n}", "title": "" }, { "docid": "93316727dac6da03aaa43f90ffb727af", "score": "0.8137799", "text": "function moveCounter(){\n $(\"span.moves\").text(moves);\n starRating();\n if (openCards.length === totalCards) {\n winner();\n return;\n }\n else{\n moves ++;\n }\n }", "title": "" }, { "docid": "602cc04643a31d91e97f9043890d4bfc", "score": "0.8092441", "text": "function moveCounter() {\n moveCount += 1;\n $('.moves').text(moveCount);\n starRating();\n}", "title": "" }, { "docid": "8cc7269dbe6b7ad59c52480423bf9b96", "score": "0.8087591", "text": "function incrementMoves() {\n\tmoves++;\n\t$('.move-counter').text(moves);\n\tupdateScore();\n}", "title": "" }, { "docid": "9132f97cf74be6aa09bee266149f9cd8", "score": "0.8080669", "text": "function increaseMoveCounter( )\n {\n moves.textContent = ++moveCounter;\n starRating( );\n }", "title": "" }, { "docid": "9964cde7b4f01b7fb8f9ec306eae0c82", "score": "0.80447876", "text": "function addMove(){\n moveCounter++;\n $(\".moves\").html(moveCounter);\n}", "title": "" }, { "docid": "2a40fb3b4b9da17967bccd1af498c719", "score": "0.8032079", "text": "updateMoveCount(){\n\t\tthis.moveCount+=1;\n\t\tlet counter = document.getElementById('counter');\n\t\tcounter.innerHTML = `<strong>Moves Made: </strong> ${this.moveCount}`;\n\t\tif(this.moveCount > 18 &&this.moveCount < 20){\n\t\t\tlet stars = document.getElementById('starContainer');\n\t\t\tstars.innerHTML = `<p class=\"fa fa-star\"></p><p class=\"fa fa-star\"></p>`\n\t\t\tthis.starCount -=1;\n\t\t}\n\t\tif(this.moveCount > 27 &&this.moveCount < 29){\n\t\t\tlet stars = document.getElementById('starContainer');\n\t\t\tstars.innerHTML = `<p class=\"fa fa-star\"></p>`\n\t\t\tthis.starCount -=1;\n\t\t}\n\t}", "title": "" }, { "docid": "bb18932702a17132d6a1989d49e423c2", "score": "0.7972721", "text": "function updateCounter() {\n\t const moves = document.querySelector('.moves');\n\t moves.innerText = moveCounter;\n\t checkStars();\n}", "title": "" }, { "docid": "b5faf8d039d1eee31a9d50894e9b10f0", "score": "0.79669803", "text": "function moveCounter() {\n count += 1;\n $('.moves').text(count);\n starRating();\n}", "title": "" }, { "docid": "9dbbce7981a9fe920a535dd6992814c1", "score": "0.796616", "text": "function addMoves () {\n moves++\n movesCounter.innerHTML = moves + \" Moves\";\n}", "title": "" }, { "docid": "3007084176ee8a94127621bc345a274b", "score": "0.7963813", "text": "function setMoveCount() {\n moveCount += 1;\n $('.moves').text(moveCount);\n}", "title": "" }, { "docid": "a2fa5b608f0b3d1146a7bdc57f662a44", "score": "0.7955567", "text": "function moveCounter() {\n $(\".moves\").text(counter.toString());\n}", "title": "" }, { "docid": "c3b0aad9cb80f694004ab3389b770adf", "score": "0.7937174", "text": "function movesCounter() {\n\tmoves++;\n\tcountedMoves.innerHTML = moves;\n}", "title": "" }, { "docid": "886ec2ea8f8fc7e638326deb3dcbc2c6", "score": "0.79298496", "text": "function incrementMoveCounter() {\n moveCount++;\n updateMoves();\n updateStars();\n}", "title": "" }, { "docid": "8fcd207317357ff3737baeec5ab083fa", "score": "0.7848646", "text": "function incrementMoves(){\n moveCount=++moveCount;\n document.getElementById(\"totalMoves\").innerHTML = moveCount;\n}", "title": "" }, { "docid": "e5d23f3992baf22f3091e2ad638cd62a", "score": "0.78305423", "text": "function incrementMovesAndDisplay() {\n moves++;\n movesClass.innerHTML = moves;\n}", "title": "" }, { "docid": "68d5863d42bae51869821f14657755f6", "score": "0.78121865", "text": "function moveCounter (){ // function adding a move everytime two cards have been checked\n\n moveNumber++;\n movesDisplay.textContent = moveNumber;\n}", "title": "" }, { "docid": "8ea9b2b5f8b75197eadbaf3514731d68", "score": "0.7800281", "text": "function CountMoves(){\n moveCounter++;\n $('.moves').text(moveCounter);\n}", "title": "" }, { "docid": "3859e17d54d10cf4bb1a9e7e8fc9b1fb", "score": "0.77871037", "text": "function countMoves () {\n moves++;\n counter.innerHTML = moves;\n setStars();\n}", "title": "" }, { "docid": "eb40a1ccf9a7dd7804866aa0428e5e4e", "score": "0.77831036", "text": "function displayMoves(counter) {\n numberOfMoves.textContent = counter;\n}", "title": "" }, { "docid": "a42fe4e328b3f87cb7ef1c665d51ec38", "score": "0.7761722", "text": "function incrementMoves(){\n\tmoves += 1;\n\t$('.moves').text(moves);\n}", "title": "" }, { "docid": "d9d477aa976ee7a4ae9c8df6d187ecd2", "score": "0.7748872", "text": "function movesCounter() {\n\tmoves++;\n\tif (moves === 1) {\n spanMoves.innerHTML = `1 Move`;\n } else {\n spanMoves.innerHTML = `${moves} Moves`;\n }\n starRating();\n}", "title": "" }, { "docid": "3bf8671ecf5abdd916814ff4bfa5f247", "score": "0.7737734", "text": "function incrementMoves() {\n\tmoves += 1;\n\t$('#moves').html(`${moves} Moves`);\n\tstarRating();\n}", "title": "" }, { "docid": "3aa33636ece0f51fe17a4a29926795ee", "score": "0.77307767", "text": "function countMove(move) {\n if(move === 1) {\n $('.moves').html(`1 move`)\n } else {\n $('.moves').html(`${move} moves`)\n }\n}", "title": "" }, { "docid": "956e19c43840f41c8c2c02bad975d3fd", "score": "0.7704507", "text": "function updateMoves() {\n var counter = $('.moves');\n counter.text(moveCount);\n}", "title": "" }, { "docid": "5ed9bdd0e6e7e485e4ee0d044157b242", "score": "0.76921356", "text": "function movesCount(moveCounter) {\n document.querySelector('.moves').innerHTML = moveCounter;\n}//end movesCount", "title": "" }, { "docid": "e400e9719e904ac677712c016c33fd61", "score": "0.7691898", "text": "function countMoves() {\n moves++;\n counterEl.innerHTML = moves + 'moves';\n // Start timer when player makes first move\n if(moves == 1) {\n startTimer();\n }\n}", "title": "" }, { "docid": "60d99db211de9f812b5823087bc24a91", "score": "0.7690104", "text": "function moveCounter(curCard) {\n if (curCard.hasClass('match') || curCard.hasClass('open')) return;\n else {\n moves++\n movesDiv.html(moves);\n\n moves > 18 ? stars.html(TwoStars) : stars\n moves > 30 ? stars.html(star) : stars\n }\n }", "title": "" }, { "docid": "72a9eb6673ec7344707b1a68f70afa2e", "score": "0.76534", "text": "function displayMoves() {\n document.getElementsByClassName('moves')[0].innerHTML = moveCounter;\n }", "title": "" }, { "docid": "624ea25c481fe25bbbdd66e8413358d4", "score": "0.76418895", "text": "function moveCount() {\n moves++;\n movesCount.innerHTML=moves;\n\n startRate();\n}", "title": "" }, { "docid": "a9179d8aefa49a41d3aa5af20541a912", "score": "0.7633031", "text": "function countMoves() {\r\n moves += 1;\r\n $moves.html(moves);\r\n changeStars();\r\n}", "title": "" }, { "docid": "2f22a7a6acb518a54728483d2cd25eba", "score": "0.7626829", "text": "function moveCounter() {\n\tmoveCount++;\n\tcounter[0].innerHTML = moveCount; //grabs the element from the node and resets it to moveCount\n\tstarRating(moveCount);\n}", "title": "" }, { "docid": "b6b44ea8442e918d40e9d0f025c79c08", "score": "0.7608676", "text": "function moveCounter(event) {\n\tif (event.target !== event.currentTarget) {\n\t\tevent.preventDefault();\n\t\tif (count < 2) {\n\t\t\ttextDisplay.innerText = \" Move\";\n\t\t} else {\n\t\t\ttextDisplay.innerText = \" Moves\";\n\t\t}\n\t\tcountDisplay.innerText = count;\n\t\tcount += 1;\n\t}\n}", "title": "" }, { "docid": "639ea565722f95e755452f7e4b01e2c8", "score": "0.76083124", "text": "function trackMoveCount() {\n\t\tnumMoves++;\n\t\tmoves.innerHTML = numMoves;\n\t\tif (numMoves === 15) {\n\t\t\tstarOne.style.display = \"none\";\n\t\t\tstarsNum--;\n\t\t} else if (numMoves === 30) {\n\t\t\tstarTwo.style.display = \"none\";\n\t\t\tstarsNum--;\n\t\t}\n\t}", "title": "" }, { "docid": "828ff2839b52c17a287359d8f389d041", "score": "0.7600696", "text": "function increaseNumberOfMoves() {\n moves++;\n $(\".moves\").text(moves);\n}", "title": "" }, { "docid": "70339fe7b30857a8916b5d95fd66e217", "score": "0.75960803", "text": "function incrementMoves() {\n\tmovesCounter++;\n\tmoves.textContent = movesCounter;\n\trateStars(movesCounter);\n}", "title": "" }, { "docid": "e9b6f50f66eb201e00c8612f724b6f3d", "score": "0.7594701", "text": "function moveCount(){\n\tvar mCount = parseInt($(\"#movimientos-text\").text());\n\tmCount = mCount + 1;\n\t$(\"#movimientos-text\").text(mCount);\n}", "title": "" }, { "docid": "09bc905eb0ff6c3a9397aaac321f740f", "score": "0.7572738", "text": "function increaseMoves() {\n moves++;\n if (moves === 1) {\n movesText.textContent = moves + \" Move\";\n } else {\n movesText.textContent = moves + \" Moves\";\n }\n}", "title": "" }, { "docid": "53e0e2c87833c012c12adae2ab255860", "score": "0.75642735", "text": "function countMoves() {\n if (cardHasFlipped == true) {\n count++;\n moves.innerHTML = `MOVES: ${count}`;\n }\n}", "title": "" }, { "docid": "339cf0f03b5e74177145e7e6bedaaf87", "score": "0.7559657", "text": "function addMove() {\n moves++;\n movesContainer.innerHTML = moves;\n rating();\n }", "title": "" }, { "docid": "57cd019f9c2e4129ff69c928ad64a280", "score": "0.752229", "text": "function addMove() {\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "57cd019f9c2e4129ff69c928ad64a280", "score": "0.752229", "text": "function addMove() {\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "57cd019f9c2e4129ff69c928ad64a280", "score": "0.752229", "text": "function addMove() {\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "57cd019f9c2e4129ff69c928ad64a280", "score": "0.752229", "text": "function addMove() {\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "b7fd65e3b85a983b796f5710f6a0ce66", "score": "0.7513935", "text": "function movesCounter() {\n move++;\n if (move == 18) {\n starsHandler(1);\n } else if (move == 24) {\n starsHandler(2);\n }\n htmlMove.innerText = move;\n}", "title": "" }, { "docid": "806eef2ed05330d2c3828b8ce7718ef6", "score": "0.750074", "text": "function countMoves() {\n nbMoves++;\n $('.moves').text(nbMoves);\n updateStars();\n}", "title": "" }, { "docid": "23617ac8ec0386406dd7d42dc3fa0d13", "score": "0.7500724", "text": "function incrementMoves() {\n moves++;\n let moveNum = document.querySelector('.moves');\n moveNum.textContent = moves;\n}", "title": "" }, { "docid": "021d24872e4853fb73800f3cfbbc2371", "score": "0.7496728", "text": "function countMoves() {\n move[0].innerHTML = step\n\n}", "title": "" }, { "docid": "42a93a7c793a9514354cf192bdfcb21e", "score": "0.74572355", "text": "function countMoves() {\n count++;\n document.querySelector(\".moves\").innerHTML = count;\n}", "title": "" }, { "docid": "d682fe2460f884eb1ad6c3ac525d48be", "score": "0.7456119", "text": "function movesCounter() {\n\n moves++;\n if (moves === 1) {\n countMoves.innerHTML = `1 Move`;\n } else {\n countMoves.innerHTML = `${moves} Moves`;\n }\n\n // Set the rating\n ratingPlayerMoves();\n}", "title": "" }, { "docid": "285a1497012dc3939573bf226d364cde", "score": "0.74538946", "text": "function incrementNumberOfMoves() {\n numberOfMoves++;\n document.querySelector('.moves').textContent = numberOfMoves;\n}", "title": "" }, { "docid": "b09a18e59377ea3ffa3e97d36eba53c3", "score": "0.74504685", "text": "function moveCountReset() {\n moveCount = 0;\n $('.moves').text(moveCount);\n}", "title": "" }, { "docid": "f95a0f702ff9c25f248a0d9e60bea70f", "score": "0.74480677", "text": "function updateMove(){\n movesCounter++;\n moveManager();\n}", "title": "" }, { "docid": "f8419b43cd5e8914d1e6f5638baa4e27", "score": "0.74466753", "text": "function movesCounter() {\n movesNum++;\n moves.innerHTML = movesNum;\n if (movesNum == 1) {\n timingCount();\n }\n if ((movesNum === 10) || (movesNum === 20)) {\n starsCounter(true);\n }\n}", "title": "" }, { "docid": "e95532eccad8f4ad0b013abe1f1f98a4", "score": "0.7430727", "text": "function pushCounter(){\n $('#move-count').text(\"Total moves \" + counter);\n} // <--- last } in pushCounter", "title": "" }, { "docid": "6d338a66de12b0f9fb26bbd2cf003e97", "score": "0.7408174", "text": "function updateCounter(counter){\n $(counter).text(\"Move Count: \" + (parseFloat($(counter).text().replace(/^\\D+/g, '')) + 1));\n}", "title": "" }, { "docid": "7a68e646f2aa0ecca58dc5acb1ea6fdc", "score": "0.739837", "text": "function moveCounter() {\n count += 1;\n moveCount.empty();\n moveCount.text(count);\n if (count >= 14) {\n $(stars[2]).css('color', 'white');\n $(stars[2]).css('text-shadow', '-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000');\n numStars = 2;\n }\n if (count >= 20) {\n $(stars[1]).css('color', 'white');\n $(stars[1]).css('text-shadow', '-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000');\n numStars = 1;\n }\n if (count >= 30) {\n $(stars[0]).css('color', 'white');\n $(stars[0]).css('text-shadow', '-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000');\n numStars = 0;\n }\n}", "title": "" }, { "docid": "15720a5c72c95795801fc34fa063d22a", "score": "0.7386405", "text": "function addMove(){\n moves++;\n const movesText = document.querySelector('.moves');\n if(moves === 1){\n movesText.innerHTML = moves + ' Move';\n } else {\n movesText.innerHTML = moves + ' Moves';\n }\n}", "title": "" }, { "docid": "3b4fe4a92f680a0c3597991468ada528", "score": "0.73778915", "text": "function updateMoves(){\n\tmoves++;\n\tupdateStars();\n\tif(moves==1)\n\t\t$('.moves').html(moves+' Move');\n\telse\n\t\t$('.moves').html(moves+' Moves');\n\n}", "title": "" }, { "docid": "fc12aff7e6d7bf6d717ca7c90a813bc3", "score": "0.73717254", "text": "function addMove(){\n\tmoves++;\n\tconst moveText = document.querySelector('.moves');\n\tmoveText.innerHTML = moves;\n}", "title": "" }, { "docid": "0cdcf8257d798ea9493bec209f32fe81", "score": "0.7334321", "text": "function setMoves() {\n const me = document.querySelector(\".moves\");\n let move = parseInt(me.textContent);\n move++;\n me.innerHTML = move;\n me.insertAdjacentText(\"beforeend\", move == 1 ? \" Move\" : \" Moves\")\n }", "title": "" }, { "docid": "47f4d22c3adf77b755f4e3373f53e7db", "score": "0.73317444", "text": "function incMoves() {\n mvs = mvs + 1;\n counter.textContent = 'moves ' + mvs;\n starRating();\n}", "title": "" }, { "docid": "adf0ef7dc82758949875e4a3bf3b763f", "score": "0.73136806", "text": "function incrementCounter() {\n\tmoves++;\n\tdocument.getElementById(\"moves\").innerHTML = moves;\n\tconsole.log(\"Current move \" + moves);\n\nif (moves == maximumMoves) \n{ \n\tconsole.log(\"too many moves, you lost!\"); //for debugging\n\tendGameSelection = \"youLost\";\n\tendGameModal(endGameSelection);\n\t}\n}", "title": "" }, { "docid": "5679d1b99c2269cdbc39871da7701411", "score": "0.73103607", "text": "function clickCounter(){\r\n clicks++\r\n document.querySelector('.click-counter').innerHTML=\"no.of moves: \"+clicks \r\n}", "title": "" }, { "docid": "f32b8190035a60eaa90336e8f7d8f61f", "score": "0.7302892", "text": "function counterZero() {\n movesCounter = 0;\n movesNum.innerHTML = `${movesCounter} Moves`;\n}", "title": "" }, { "docid": "34435ed1451e3c2f67fecc49b1c54f8a", "score": "0.7300487", "text": "function moveCounter(){\n\tcount++;\n\tdocument.querySelector('.moves').textContent=count;\n\t// decrement star rating after 12 moves\n\tif(count==12){\n\t\tdocument.querySelector('.stars').lastElementChild.remove();\t\t\t\n\t}\n\t//decrement star rating after 16 moves\n\tif(count==16){\n\t\tdocument.querySelector('.stars').lastElementChild.remove();\n\t}\n}", "title": "" }, { "docid": "2a55f75eb775c6bf4e6bc7a3c98c9447", "score": "0.728325", "text": "function addMoves(){\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "7ce263accb66812287ab93fa9db29f84", "score": "0.72800994", "text": "function moveCounter() {\n//for (let i = 0; i < cardSetTwo.length; i++) {\n//\tcardSetTwo[i].onclick = function () {\n\t\tmoves ++;\n\t\tmovesDisplay()\n\t}", "title": "" }, { "docid": "a26e14d9244b91ab23835c7b5147908a", "score": "0.7277993", "text": "function countMoves(){\n count++; //increment no. of moves\n moves.innerHTML = count + \" Moves\"; //display no. of moves\n progress(count);\n\n if(count == 1){\n hr = 0;\n min = 0;\n sec = 0;\n timed(); //start timer\n }\n}", "title": "" }, { "docid": "e532f8ede5e67e5f1d4cef326a358ca9", "score": "0.7258412", "text": "function moveCounter() {\n let movesNumber = panel.querySelector('.moves');\n let movesText = panel.querySelector('.moves-text');\n let stars = panel.querySelector('.stars');\n\n countMoves += 1;\n movesNumber.textContent = countMoves;\n\n if (countMoves === 1)\n movesText.textContent = 'Move';\n else\n movesText.textContent = 'Moves';\n\n if (countMoves % 12 === 0 && stars.children.length > 0) // For every twelve moves delete a star from the score panel\n stars.children[0].remove();\n}", "title": "" }, { "docid": "cbcfdb3796d360f8d686ee1ef3181242", "score": "0.72181386", "text": "function countMoves (){\n moves++;\n const plural = document.querySelector('.moves');\n plural.innerHTML = moves;\n}", "title": "" }, { "docid": "d0904acfc46905e334051274fe59358b", "score": "0.7199707", "text": "function increment(){\n moves++;\n if(moves==1){\n timeVar = setInterval(Timer, 1000);}\n\n var x = document.querySelector('.moves');\n x.innerText = moves;\n score();\n\n}", "title": "" }, { "docid": "f5ccf03e4e664580f222d8194d58c0ed", "score": "0.71767604", "text": "function incrementMoveCounter() {\n score++;\n}", "title": "" }, { "docid": "7fcf0ede068cd96ea55234c40b0094ae", "score": "0.71603525", "text": "function turn() {\n moves++;\n const movesText = document.querySelector('.moves');\n movesText.innerHTML = moves;\n}", "title": "" }, { "docid": "04609e8e5b8e2b4ce18269a64331ca0b", "score": "0.7152251", "text": "function moveCounter() {\n moves++;\n countMoves.textContent = moves;\n //start timer on first click\n if (moves == 1) {\n second = 1;\n startTimer();\n }\n // setting rates based on moves\n if (moves > 16 && moves < 28) {\n for (i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = 'collapse';\n }\n }\n } else if (moves > 24) {\n for (i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = 'collapse';\n }\n }\n }\n // starRating.innerHTML = stars.length;\n}", "title": "" }, { "docid": "b415af6960a2413ce9c59ceec7af2b92", "score": "0.7151698", "text": "function moves_counter(){\n let moves = document.querySelector('.moves');\n moves.textContent = counter;\n\n if(counter>11){\n stars[2].style.visibility='hidden';\n star_num = 1;\n }\n if(counter>15){\n stars[1].style.visibility='hidden';\n star_num = 2;\n }\n}", "title": "" }, { "docid": "b2bac59bba77f7b32b7736a73364be89", "score": "0.7138942", "text": "function updateMoveCounter() {\n $(\".moves\").text(moveCounter);\n\n if (moveCounter === hard || moveCounter === medium) {\n removeStar();\n }\n}", "title": "" }, { "docid": "fe31b4247cc996a2d8595717e81439a9", "score": "0.7137718", "text": "function countReset() {\n count = 0;\n $('.moves').text(count);\n}", "title": "" }, { "docid": "f7ea52ae861c0120f7d12bdf2b960295", "score": "0.712088", "text": "function matchMove(){\n matched ++;\n let didMatch = document.getElementById('points');\n didMatch.textContent = `Matched: ${matched}`;\n moves --;\n let displayMoves = document.getElementById('moves');\n displayMoves.textContent = `Move(s): ${moves}`;\n}", "title": "" }, { "docid": "4a143ca4b9d2638efc1e737e21b138b8", "score": "0.7093037", "text": "function addCounter() {\n moves++;\n counter.innerHTML = `${moves} move${(moves >= 2 ? 's' : '')}`;\n \n\n // starting the timer counter\n if (moves == 1) {\n second = 0;\n minute = 0;\n hour = 0;\n\n startClock();\n }\n\n // starting the rating logic\n if (moves > 8 && moves < 12) {\n for (let i = 0; i < 3; i++) {\n if (i > 1) {\n stars[i].style.visibility = 'collapse';\n }\n }\n } else if (moves > 13) {\n for (let i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = 'collapse';\n }\n }\n }\n}", "title": "" }, { "docid": "f77826264b92a56c3512775dc69e570b", "score": "0.70681715", "text": "moveCounter() {\n //we increment the move state by 1\n this.state.moves++;\n //show the total moves on the html document\n this.state.counter[0].innerHTML = this.state.moves;\n\n //if the first move is made start the timer\n if (this.state.moves == 1) {\n this.second = 0;\n this.minute = 0;\n this.hour = 0;\n this.startTimer();\n }\n\n}", "title": "" }, { "docid": "2cc7a9430ec3607af159eac4bea6a5db", "score": "0.70552576", "text": "function clickCounter() {\n clicks++;\n moveSpan.innerHTML = clicks;\n}", "title": "" }, { "docid": "a5629b30f45a68bfdadce3f94a295fcd", "score": "0.7043225", "text": "function incrementMoveCount(color) {\n //gets the html of the span with id lightMoveCount or darkMoveCount\n //turns it into a number increments it by one\n //sets the html of the span with id lightMoveCount or darkMoveCount to the new move count\n let whichCounter = '';\n color === 'light' ? whichCounter = '#lightMoveCount' : whichCounter = '#darkMoveCount';\n let $moves = parseInt($(whichCounter).html());\n $moves++;\n\n $(whichCounter).html($moves);\n console.log($moves);\n //if the number is even then it's light's move and odd it's dark's move.\n if ($moves % 2 === 1) {\n console.log(`Hello odd number`);\n console.log($darkPieces);\n } else if ($moves % 2 === 0) {\n console.log(`Hello even number`);\n console.log($lightPieces);\n }\n }//end of incrementMoveCount()", "title": "" }, { "docid": "92600a691cf8622e36c5b5ecea7f0637", "score": "0.70414877", "text": "function countMoves() {\n movesCounter.innerText = Number(movesCounter.innerText) + 1;\n // console.log(Number(movesCounter.innerText));\n if (movesCounter.innerText == 1) {\n startTimer('start');\n }\n\n if ((Number(movesCounter.innerText) === 10) || (Number(movesCounter.innerText) === 16) || (Number(movesCounter.innerText) === 25)) {\n removeStars(movesCounter.innerText);\n }\n}", "title": "" }, { "docid": "4396935ebfea1008a3d2b33e22f03ae7", "score": "0.7011889", "text": "function initMoves() {\n nbMoves = 0;\n $('.moves').text(nbMoves);\n}", "title": "" }, { "docid": "aca14caff44760998902b86da6d2fb4d", "score": "0.6987335", "text": "function moves() {\n movesCounter++;\n //check for plurization\n let moveText = document.querySelector('.moveText');\n moveText.textContent = movesCounter === 1 ? 'Move' : 'Moves';\n\n // set the moves \n counter.textContent = movesCounter;\n\n // remove stars as moves increase.\n if (movesCounter % 8 == 0 && rating.length > 1) {\n rating[rating.length - 1].remove();\n }\n}", "title": "" }, { "docid": "7741ad89e736f889d0cfc03eb3a43325", "score": "0.6913963", "text": "function moveIncrease(){\n movesindicator.innerHTML=`${moves}`;\n if(moves>=14*movesCount) //to decrease the number of stars after every 28 moves,\n starDecrease();\n}", "title": "" }, { "docid": "9e42047bd6a6c7e62ba976891ed1b9c0", "score": "0.69104177", "text": "function moveCounter(){\n moves++;\n counter.innerHTML = moves;\n //start timer on first click\n if(moves == 1){\n second = 0;\n startTimer();\n }\n}", "title": "" }, { "docid": "e80e1c587bfb4d9adac01edb0b5d4f3f", "score": "0.6900782", "text": "function moveCounter () {\r\n moves++;\r\n moveCount.innerHTML = `${moves} moves`;\r\n if (moves === 1) {\r\n startTime()\r\n };\r\n if (moves >= 25 && winCount <= 2) {\r\n firstStar.classList.add ('bad');\r\n firstStar.classList.remove ('good');\r\n };\r\n if (moves >= 40 && winCount <= 5) {\r\n secondStar.classList.add ('bad');\r\n secondStar.classList.remove ('good');\r\n };\r\n if (moves >= 52 && winCount <= 7) {\r\n thirdStar.classList.add ('bad');\r\n thirdStar.classList.remove ('good');\r\n };\r\n}", "title": "" }, { "docid": "7e35bb6a38e2f7d482c386f3034150c0", "score": "0.6900536", "text": "function addMove() {\n move++;\n document.querySelector('.moves').textContent = move;\n if (move == 15 || move == 20) {\n setScore();\n }\n}", "title": "" }, { "docid": "e37c4678bc828eef2a1c1bd3e539ba38", "score": "0.6891882", "text": "function moveCount() {\r\n for (var i = 0; i < batSymbol.length; i++) {\r\n if (move === 16) {\r\n //display 3 bat symbols\r\n batSymbol[0].setAttribute(\"src\", \"batmanCharacters/batSymbol.png\");\r\n bats = 3;\r\n } else if (move > 16 && move <= 24) {\r\n bats = 2\r\n //display 2 bat symbols\r\n } else if (move > 24) {\r\n //display 1 bat symbols\r\n batSymbol[1].setAttribute(\"src\", \"batmanCharacters/batSymbol.png\");\r\n bats = 1;\r\n }\r\n }\r\n if (move == 1) {\r\n time = 0;\r\n count();\r\n }\r\n moveNumber.textContent = 1 + move++;\r\n}", "title": "" }, { "docid": "dc3e408eca75b27b3ec16999d1270097", "score": "0.68856144", "text": "function moveCounter(){\n moves++;\n counter.innerHTML = moves;\n\n //start timer on first move\n if(moves === 1){\n second = 0;\n minute = 0;\n hour = 0;\n startTimer();\n }\n // setting rates based on moves\n if (moves > 20 && moves < 35){\n for(let i= 0; i < 3; i++){\n if(i > 1){\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n else if (moves > 36){\n for(let i= 0; i < 3; i++){\n if(i > 0){\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n}", "title": "" }, { "docid": "840feca39190068b6f948862049c43c2", "score": "0.68832654", "text": "function resetMoveCount() {\n moveCount = 0;\n $('.moves').text('');\n}", "title": "" }, { "docid": "e4ed07546d17381233d53acb495e289f", "score": "0.6874905", "text": "function moveManager(){\n var moves=document.getElementsByClassName(\"moves\")[0];\n moves.innerHTML=String(movesCounter);\n if(movesCounter<12){\n starCount=3;\n }\n else if(movesCounter<18){\n starCount=2;\n }\n else {\n starCount=1;\n }\n updateStars();\n}", "title": "" }, { "docid": "e88ce1f11698f39a3a52bbf478e4dad7", "score": "0.68553543", "text": "function NumberOfMoves()\n{ moves = moves + 1;\n}", "title": "" }, { "docid": "5b84856c2df4d8d0be462d19a9aaf7d7", "score": "0.68434674", "text": "function countMoves() {\n if (openCards.length === 1) {\n moves += 2;\n movesCounter.innerHTML = `${moves}`; \n if (moves === 20 || moves === 40) { \n removeStars();\n }\n }\n}", "title": "" }, { "docid": "df9bdca181cdf748403a3ff3e7fa8b4b", "score": "0.6841492", "text": "function move(){\n if(instruction_position == 1){\n current_instruction[index] += \"/move\"\n instruction_position++\n\n //show instruction on the screen\n total_instructions += \"/move\"\n document.getElementById(\"currentInstructions\").innerHTML = total_instructions;\n }\n}", "title": "" }, { "docid": "98d1713eaf503f8777625f73c4047615", "score": "0.68311864", "text": "function moveformula() {\r\n moves++;\r\n moveCounter.innerHTML = moves;\r\n starRating();\r\n\r\n}", "title": "" } ]
6db1111227c4dc3a99f7e8bab2b1d50d
Opera <= 12 includes TextEvent in window, but does not fire text input events. Rely on keypress instead.
[ { "docid": "ecfbe06feb483f00e15b767be4a809e3", "score": "0.0", "text": "function isPresto() {\n\t var opera = window.opera;\n\t return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;\n\t}", "title": "" } ]
[ { "docid": "06925db2e4f3e8893de1bbe8671a4471", "score": "0.66218543", "text": "_dispatchInputChangeEvent(text) {\n this.dispatchEvent(new CustomEvent('textinput', {\n detail: {\n value: text\n }\n }));\n }", "title": "" }, { "docid": "d8cfcec318ee34414f1826d9164d9f4d", "score": "0.6545845", "text": "function dispatch(target, eventType, char) {\nvar evt = document.createEvent(\"TextEvent\"); \nevt.initTextEvent (eventType, true, true, window, char, 0, \"en-US\");\ntarget.focus();\ntarget.dispatchEvent(evt);\n}", "title": "" }, { "docid": "700fb751a110a941e57dee1728383967", "score": "0.6349423", "text": "function type(text) {\n for (var i = 0; i < text.length; i++) {\n document.dispatchEvent(makeKeyPressEvent(text[i]));\n }\n}", "title": "" }, { "docid": "559bf32056ea92afd4d5de9b137ea2db", "score": "0.6342255", "text": "_textDidChange() {\n const delegate = this._delegate;\n this.textDidChange();\n if (delegate && typeof delegate.textDidChange === 'function') {\n delegate.textDidChange(this);\n }\n\n // manually fire the HTML5 input event\n this._fireEvent('input');\n }", "title": "" }, { "docid": "9781270ffab054187962522b6e1aeaac", "score": "0.63022494", "text": "function i(){var c=this,d=window||a;g(this,{isNativeEvent:function(a){return a.originalEvent&&a.originalEvent.isTrusted!==!1},fakeInputEvent:function(a){c.isNativeEvent(a)&&b(a.target).trigger(\"input\")},misbehaves:function(a){c.isNativeEvent(a)&&(c.behavesOk(a),b(document).on(\"change.inputevent\",a.data.selector,c.fakeInputEvent),c.fakeInputEvent(a))},behavesOk:function(a){c.isNativeEvent(a)&&b(document).off(\"input.inputevent\",a.data.selector,c.behavesOk).off(\"change.inputevent\",a.data.selector,c.misbehaves)},install:function(){if(!d.inputEventPatched){d.inputEventPatched=\"0.0.3\";for(var a=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],e=0;e<a.length;e++){var f=a[e];b(document).on(\"input.inputevent\",f,{selector:f},c.behavesOk).on(\"change.inputevent\",f,{selector:f},c.misbehaves)}}},uninstall:function(){delete d.inputEventPatched,b(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "7a23bdf8d59bc8955988af178379c354", "score": "0.62327516", "text": "function l(){var n=this,r=window||e;a(this,{isNativeEvent:function(t){return t.originalEvent&&!1!==t.originalEvent.isTrusted},fakeInputEvent:function(e){n.isNativeEvent(e)&&t(e.target).trigger(\"input\")},misbehaves:function(e){n.isNativeEvent(e)&&(n.behavesOk(e),t(document).on(\"change.inputevent\",e.data.selector,n.fakeInputEvent),n.fakeInputEvent(e))},behavesOk:function(e){n.isNativeEvent(e)&&t(document).off(\"input.inputevent\",e.data.selector,n.behavesOk).off(\"change.inputevent\",e.data.selector,n.misbehaves)},install:function(){if(!r.inputEventPatched){r.inputEventPatched=\"0.0.3\";for(var e=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],i=0;i<e.length;i++){var o=e[i];t(document).on(\"input.inputevent\",o,{selector:o},n.behavesOk).on(\"change.inputevent\",o,{selector:o},n.misbehaves)}}},uninstall:function(){delete r.inputEventPatched,t(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892605", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892605", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "bd4057c590d2df31e89b6f20f72cabf5", "score": "0.61892605", "text": "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "1b9e23de333cbea7eb86fae819961006", "score": "0.6185525", "text": "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "title": "" }, { "docid": "ff2b0527556156f12f93d0e37bfdf4a8", "score": "0.61428314", "text": "allowKeyEventPropagation() {}", "title": "" }, { "docid": "c25ac7b68d2cf52bbba5f5f7206cc792", "score": "0.61359686", "text": "function textInputKeyDown(e) {\n\t\te = e||window.event;\n\t\tvar isTabKey = e.keyCode == 9;\n\t\tvar isEnterKey = e.keyCode == 13;\n\t\tif(isTabKey || isEnterKey) {\n\t\t\tHsvPicker.getById(this.id.split(\"-\")[0]).trySetValue(this.value, e||event);\n\t\t}\n\t\tif(isEnterKey)\n\t\t\tthis.focus();\n\t}", "title": "" }, { "docid": "7f62f9346c800a296104d33e6652d111", "score": "0.6125419", "text": "function extractTextFromEvent(event) {\n var text;\n var code;\n // Controllo il testo\n if (event.type === \"textinput\" || event.type === \"textInput\") {\n text = (event.originalEvent) ? event.originalEvent.data : event.data;\n } else {\n code = event.charCode || event.keyCode;\n if (code < 32 || event.charCode === 0 || event.ctrlKey || event.altKey) {\n return;\n }\n text = String.fromCharCode(code);\n }\n return text;\n }", "title": "" }, { "docid": "fc5f5d9ae9510cc301ca88afd87f96a2", "score": "0.6111775", "text": "function bindTextchange(element){\n if (lteIE9) {\n var elementValue = element.value;\n element.attachEvent(\"onpropertychange\", function(ev){\n if (ev.propertyName !== \"value\") return;\n var value = ev.srcElement.value;\n if (value === elementValue) return;\n elementValue = value;\n $(element).trigger(\"textchange\");\n });\n $(element).on(\"selectionchange keyup keydown\", function() {\n if (element.value !== elementValue) {\n elementValue = element.value;\n $(element).trigger(\"textchange\");\n }\n });\n } else {\n $(element).on(\"input\", function(e) {\n // if (element.nodeName !== \"TEXTAREA\") {\n $(element).trigger(\"textchange\");\n // }\n });\n }\n }", "title": "" }, { "docid": "34e8b7ec9dc81b686037c694a3f63679", "score": "0.6111336", "text": "function dispatch(target, eventType, char) {\n var evt = document.createEvent(\"TextEvent\"); \n evt.initTextEvent (eventType, true, true, window, char, 0, \"en-US\");\n target.focus();\n target.dispatchEvent(evt);\n }", "title": "" }, { "docid": "c126ae0853ce4065b256ae450b95f130", "score": "0.6067194", "text": "function keypressHandler(e) {\r\n // By pressing alt+q to control the state of translator.\r\n // If this setting bothers you, you can change the charCode to others, see http://www.asciitable.com/.\r\n if (e.charCode == 113 && e.altKey) {\r\n // Turn ON/OFF translator\r\n if (STATE) {\r\n STATE = OFF;\r\n document.removeEventListener('mouseup', lookupWordBySelecton, false);\r\n // If you need this notification, please comment out this line to enable it.\r\n // alert(\"Translator is OFF!\");\r\n } else {\r\n STATE = ON;\r\n registerEventListener('mouseup', lookupWordBySelecton);\r\n // If you need this notification, please comment out this line to enable it.\r\n // alert('Translator is ON!');\r\n }\r\n } else if (e.charCode == 105 && e.altKey) { // By pressing alt+i to control whether to input word.\r\n initDisplayAreaForUserInput();\r\n }\r\n}", "title": "" }, { "docid": "d5f93a0e61031d4e1481a7b0de803d8d", "score": "0.60483307", "text": "getInputOnTextTyped(event, newValue) {\n const { key, type } = event;\n if (\n key !== \"ArrowUp\" &&\n key !== \"ArrowDown\" &&\n key !== \"Enter\" &&\n type !== \"click\"\n ) {\n return newValue;\n }\n return null;\n }", "title": "" }, { "docid": "7b825cff323963cc3d6bbba43ad38f72", "score": "0.6003289", "text": "function TextoSimples ( e )\n{\n if ( window.event ) keyPressed = window.event.keyCode; // IE hack\n else keyPressed = e.which; // <B>standard method</B>\n\n if ( keyPressed == 8 || keyPressed == 95 || keyPressed == 13 || keyPressed == 0 ) return true;\n else if ( ( keyPressed >= 48 && keyPressed <= 57 ) || (keyPressed > 96 && keyPressed < 123) || keyPressed == 95 ) return true;\n else if ( ( keyPressed > 191 && keyPressed < 221 ) || ( keyPressed > 223 && keyPressed < 253 ) ) return true;\n \n return false;\n}", "title": "" }, { "docid": "cf2db97243bdc22b54fe66c5c27e88cf", "score": "0.5949867", "text": "handleTextChange(e) {}", "title": "" }, { "docid": "b9c38aee98345d3a9b83ef635cc78327", "score": "0.5932019", "text": "function handleKeyPress(e)\n{\n var keyCode = 0;\n \n // IE\n if (document.all)\n keyCode = event.keyCode;\n\n // Opera, FF\n else\n {\n keyCode = e.keyCode;\n\n // FF Space Key\n if (e.charCode == 32)\n keyCode = 32;\n\n // FF keyCode unset\n if (e.keyCode == 0)\n keyCode = e.charCode; \n }\n \n realHandleKeyPress(keyCode);\n}", "title": "" }, { "docid": "3ef69f3b2981cb65c6adb4839683904f", "score": "0.591998", "text": "function isTextInput(event) {\n if (event.keyCode >= 48 && event.keyCode <= 57) {\n return true;\n }\n if (event.keyCode >= 65 && event.keyCode <= 90) {\n return true;\n }\n if (event.keyCode === 32) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "7bb605c5b9f31c4bcc1ac97a3e4b01c2", "score": "0.5913411", "text": "function keyPress (event){\n var code = event.which || event.keyCode;\nif (code == 13){\n inputText();\n};\n}", "title": "" }, { "docid": "c55524ed164754cfe458cad43d57cdc4", "score": "0.5890702", "text": "function onkeydown(event) {\n if (event.metaKey && K_KEY_CODE === event.keyCode) {\n // CMD+K will clear the console\n runClearThenInput();\n } else if (RETURN_KEY_CODE === event.keyCode) {\n // otherwise, if the return key is pressed, cancel inputing return\n event.preventDefault();\n\n // disable the plain text element as an input\n plaintextEl.removeAttribute('contenteditable');\n plaintextEl.removeEventListener('keydown', onkeydown);\n\n // command parts from input inner text\n var cmd = getCommand(plaintextEl.innerText);\n\n switch (cmd.name) {\n case 'clear':\n runClearThenInput();\n break;\n case 'pwd':\n runPwdThenInput();\n break;\n case 'ls':\n runLsThenInput();\n break;\n case 'we':\n runWeThenInput(cmd.args);\n break;\n case 'cat':\n runCatThenInput();\n break;\n case 'echo':\n runEchoThenInput(cmd.args);\n break;\n case 'man':\n runOpenThenInput('/docs/');\n break;\n case 'open':\n runOpenThenInput(cmd.args);\n break;\n case 'cd':\n case 'cp':\n case 'find':\n case 'grep':\n case 'mkdir':\n case 'mv':\n case 'rm':\n case 'touch':\n runHtmlThenInput('\\n');\n break;\n default:\n runHtmlThenInput('\\n command not found: ' + encodeHTML(cmd.name) + '\\n');\n }\n }\n }", "title": "" }, { "docid": "cd6163e6aad3154c1fbaa90db72e269c", "score": "0.5882335", "text": "function handleKeyPress(event) {\r\n\r\n if (document.addEventListener) {\r\n\r\n document.addEventListener(\"keydown\", handleKeyDown, false);\r\n document.addEventListener(\"keyup\", doCompletion, false);\r\n document.addEventListener(\"mouseup\", handleClick, false);\r\n document.addEventListener(\"mouseover\", handleMouseOver, false);\r\n\r\n } else {\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = doCompletion;\r\n document.onmouseup = handleClick;\r\n document.onmouseover = handleMouseOver;\r\n }\r\n\r\n e = getEvent(event);\r\n eL =document.getElementById(autoAssignTextBox);\r\n for (x=0;x<autoSuggestList.length;x++) {\r\n autoSuggestList[x] = autoSuggestList[x].replace(/\\,/gi,'');\r\n }\r\n\r\n upEl = isWithinNode(eL,null,\"wickEnabled\",null,null);\r\n kc = e.keyCode;\r\n\r\n if (siw && ((kc == 13) || (kc == 9))) {\r\n siw.selectingSomething = true;\r\n if (siw.isSafari) siw.inputBox.blur(); //hack to \"wake up\" safari\r\n siw.inputBox.focus();\r\n siw.inputBox.value = siw.inputBox.value.replace(/[ \\r\\n\\t\\f\\s]+$/gi,' ');\r\n hideSmartInputFloater();\r\n } else if (upEl && (kc != 38) && (kc != 40) && (kc != 37) && (kc != 39) && (kc != 13) && (kc != 27)) {\r\n if (!siw || (siw && !siw.selectingSomething)) {\r\n\r\n processSmartInput(upEl);\r\n\r\n }\r\n } else if (siw && siw.inputBox) {\r\n siw.inputBox.focus(); //kinda part of the hack.\r\n }\r\n //autoSuggestList = new Array();\r\n\r\n}//handleKeyPress()", "title": "" }, { "docid": "75ddc3b1decadae86fe6d13a6b5ef4d1", "score": "0.5878172", "text": "function isTextKey(evt){\n\t\t \n var charCode = (evt.which) ? evt.which : event.keyCode;\n\t\n\t\n\t\n //if (charCode > 31 && (charCode > 48 || charCode < 57 ) && charCode != 32)\n if ((charCode > 47 && charCode <= 64) || (charCode > 0 && charCode <= 31) || (charCode > 90 && charCode <= 96) || (charCode > 122 && charCode <= 126) )\n\t{\n\t\t\n return false\n\t}\n\t\n return evt;\n}", "title": "" }, { "docid": "2cfa869081369414d6f3777346eead80", "score": "0.58667123", "text": "function Input_OnKeyUp()\n {\n // alert (\"Input_OnKeyUp\");\n ProcessAll ();\n }", "title": "" }, { "docid": "5b60a84b6f1e97a2bb4d7c79bbc917a7", "score": "0.58610517", "text": "function accentsKeyPressHandler(event) {\r\n\t//If not a text input, ignore\r\n\t//alert(document.activeElement.nodeName);\r\n\tif (!document.activeElement || !isTextInput(document.activeElement))\r\n\t\treturn true;\r\n\t\r\n\tif (!event)\r\n\t\tevent = window.event;\r\n\t//Opera uses keyCode, but Firefox uses charCode\r\n\tvar code = event.keyCode == 0 ? event.charCode : event.keyCode;\r\n\tif (event.shiftKey && shiftFix[code])\r\n\t\t\tcode = shiftFix[code];\r\n\r\n\tif (event.ctrlKey) {\r\n\t\t//Get the \"Ctrl+symbol\" key\r\n\t\tif (lookup[code] != null) {\r\n\t\t\tshortcutKey = code;\r\n\t\t\tdbg(\"key = \" + shortcutKey);\r\n\t\t\t//Automatically add an event handler to fix stuff if you unfocus\r\n\t\t\t//the control before finishing the shortcut\r\n\t\t\tdocument.activeElement.addEventListener(\"blur\", blurHandler, false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tshortcutKey = null;\r\n\t\t}\r\n\t}\r\n\telse if (shortcutKey != null && lookup[shortcutKey][code] != null) {\r\n\t\t//Write the accented character if a replacement exists\r\n\t\taddAccent(document.activeElement, lookup[shortcutKey][code]);\r\n\t\tevent.preventDefault();\r\n\t}\r\n\telse\r\n\t\tshortcutKey = null;\r\n\treturn true;\r\n}", "title": "" }, { "docid": "f2024ae728236f379336c71df8997f96", "score": "0.58524317", "text": "function onKeyPress( aEvt )\n{\n document.onkeypress = null;\n\n if ( !aEvt )\n aEvt = window.event;\n\n var str = String.fromCharCode( aEvt.keyCode || aEvt.charCode );\n\n if ( !processingEffect && charCodeDictionary[currentMode] && charCodeDictionary[currentMode][str] )\n return charCodeDictionary[currentMode][str]();\n\n return null;\n}", "title": "" }, { "docid": "c8e267426aeb6ad4f993d3c253f96986", "score": "0.58295214", "text": "keydown(ev) {}", "title": "" }, { "docid": "4f0007618487bcfb3e858bb1777ccb5b", "score": "0.582228", "text": "function onkeyup (event) {\n\tif (document.getElementById(\"shell\") && !document.getElementById(\"clipboard\")) {\n\t\tif (!isElementOutViewport (shell) && event.target.tagName.toLowerCase() !== 'input' && event.target.tagName.toLowerCase() !== 'textarea') {\n\t\t\tshell.focus ();\n\t\t}\n\t}\n\tif (document.getElementById(\"content\") && event.keyCode != 9) {\n\t\tif (!isElementOutViewport (form.content)) {\n\t\t\tform.content.focus ();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fb3581d3d1a1aacb417697e7167856fe", "score": "0.58088154", "text": "function inputInputEvent(e)\n {\n var __element = this,\n __extensions = __element.__pikantnyExtensions__,\n __set = _setStandard,\n __update = _updateStandard,\n __value = __element.value,\n __oldValue = __extensions.__prevalue__,\n __isTextArea = (__element.nodeName === 'TEXTAREA');\n \n if(__extensions.isIME) return true;\n \n /* if we are pasting/cutting using ctrl + v/x keys or from context, run set/update\n - some browsers throw input event before keyup event\n */\n if(__extensions.isAltered || (!__extensions.isKeyDownUpdate && !__extensions.isPressed))\n {\n /* fallback to change event if this property is not set */\n __extensions.isInputUpdate = true;\n \n if(__set(__element,'value',__value,__oldValue,__extensions,__extensions.stop))\n {\n if(!__extensions.stop) __update(__element,'value',__value,__oldValue,__extensions);\n }\n else\n {\n (__isTextArea ? __valueTextAreaDescriptor : __valueInputDescriptor).set.call(__element,__oldValue);\n __extensions.stop = undefined;\n __extensions.latestValue = __element.value;\n return !!e.preventDefault();\n }\n __extensions.latestValue = __element.value;\n __extensions.stop = undefined;\n }\n return true;\n }", "title": "" }, { "docid": "d47c41c532f372d559540c0f0d0a0203", "score": "0.5794987", "text": "function onKeypressCantProductos(pEvent) {\n\n pEvent = pEvent || window.event;\n var code = pEvent.charCode || pEvent.keyCode;\n // alert(code);\n // code == 8 borrar <---\n // code == 9 tab\n // code == 46 Supr\n // code == 37 <-\n // code == 39 ->\n if (code == 8 || code == 9 || code == 46 || code == 37 || code == 39) {\n return true;\n }\n if (code < 48 || code > 57) {\n return false; // pEvent.returnValue\n }\n return true;\n}", "title": "" }, { "docid": "eac0899df3ebdf3d106c3e2603484650", "score": "0.57792926", "text": "function onKeyUp(evt)\n\t{\n\t}", "title": "" }, { "docid": "63cea1e170ef37e90eeb2607a9867d82", "score": "0.577055", "text": "function n() {\n var t = this,\n i = window || global;\n _extends(this, {\n isNativeEvent: function(e) { return e.originalEvent && e.originalEvent.isTrusted !== !1 },\n fakeInputEvent: function(i) { t.isNativeEvent(i) && e(i.target).trigger(\"input\") },\n misbehaves: function(i) { t.isNativeEvent(i) && (t.behavesOk(i), e(document).on(\"change.inputevent\", i.data.selector, t.fakeInputEvent), t.fakeInputEvent(i)) },\n behavesOk: function(i) { t.isNativeEvent(i) && e(document).off(\"input.inputevent\", i.data.selector, t.behavesOk).off(\"change.inputevent\", i.data.selector, t.misbehaves) },\n install: function() {\n if (!i.inputEventPatched) {\n i.inputEventPatched = \"0.0.3\";\n for (var n = [\"select\", 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'], r = 0; r < n.length; r++) {\n var s = n[r];\n e(document).on(\"input.inputevent\", s, { selector: s }, t.behavesOk).on(\"change.inputevent\", s, { selector: s }, t.misbehaves)\n }\n }\n },\n uninstall: function() { delete i.inputEventPatched, e(document).off(\".inputevent\") }\n })\n }", "title": "" }, { "docid": "cf95ca72120f12aa2da5220011f4a49a", "score": "0.5759486", "text": "function checkEvent(el) {\r\n // First check, for if Firefox fixes its issue with el.oninput = function\r\n el.setAttribute(\"oninput\", \"return\");\r\n if (typeof el.oninput == \"function\") {\r\n return true;\r\n }\r\n // Second check, because Firefox doesn't map oninput attribute to oninput property\r\n try {\r\n\r\n // \"* Note * : Disabled focus and dispatch of keypress event due to conflict with DOMready, which resulted in scrolling down to the bottom of the page, possibly because layout wasn't finished rendering.\r\n var e = document.createEvent(\"KeyboardEvent\"),\r\n ok = false,\r\n tester = function(e) {\r\n ok = true;\r\n e.preventDefault();\r\n e.stopPropagation();\r\n };\r\n\r\n // e.initKeyEvent(\"keypress\", true, true, window, false, false, false, false, 0, \"e\".charCodeAt(0));\r\n\r\n document.body.appendChild(el);\r\n el.addEventListener(\"input\", tester, false);\r\n // el.focus();\r\n // el.dispatchEvent(e);\r\n el.removeEventListener(\"input\", tester, false);\r\n document.body.removeChild(el);\r\n return ok;\r\n\r\n } catch(error) {\r\n\r\n }\r\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5730392", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5730392", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5730392", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5730392", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "737de504a35fc0dec348049a320b8c81", "score": "0.5730392", "text": "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "title": "" }, { "docid": "11bd9e7ca7cbba0c892efe0e9d0d799b", "score": "0.57184273", "text": "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "title": "" }, { "docid": "11bd9e7ca7cbba0c892efe0e9d0d799b", "score": "0.57184273", "text": "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "title": "" }, { "docid": "11bd9e7ca7cbba0c892efe0e9d0d799b", "score": "0.57184273", "text": "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "title": "" }, { "docid": "3210cd10823fc0d945c2cdbac7558828", "score": "0.5688764", "text": "function initEvents() {\n window.addEventListener(\"restoreKernel\", event => restoreKernel(event.detail));\n\n window.onkeyup = event => {\n let keycode = event.keyCode;\n if (kernel.getTerminal().isVisible()) { // kernel events\n if (kernel.getTerminal().getInput().editableNode != document.activeElement && !event.ctrlKey && \n ((keycode > 47 && keycode < 58) || keycode == 32 || keycode == 13 || \n (keycode > 64 && keycode < 91) || (keycode > 95 && keycode < 112) || \n (keycode > 185 && keycode < 193))) {\n if ((keycode > 47 && keycode < 58) || (keycode > 64 && keycode < 91) || \n (keycode > 95 && keycode < 112) || (keycode > 185 && keycode < 193))\n kernel.getTerminal().getInput().write(event.key);\n focusInput(kernel.getTerminal());\n }\n } else if (kernel.getEditor().isVisible()) { // editor events\n if (kernel.getEditor().getMode() == Editor.MODE_COMMAND)\n kernel.getEditor().verifyCommandInputValidity();\n }\n }\n\n window.onkeydown = event => {\n if (kernel.getTerminal().isVisible()) { // kernel events\n // ...\n } else if (kernel.getEditor().isVisible()) { // editor events\n if (kernel.getEditor().getMode() == Editor.MODE_COMMAND)\n kernel.getEditor().verifyCommandInputValidity();\n\n if (event.keyCode === Editor.KEY_TOGGLE_MODE_GENERAL)\n kernel.getEditor().changeMode(Editor.MODE_GENERAL);\n else if (event.keyCode === Editor.KEY_TOGGLE_MODE_COMMAND) {\n if (kernel.getEditor().getMode() == Editor.MODE_GENERAL)\n kernel.getEditor().changeMode(Editor.MODE_COMMAND);\n } else if (event.keyCode === Editor.KEY_TOGGLE_MODE_INSERT) {\n if (kernel.getEditor().getMode() == Editor.MODE_GENERAL) {\n event.preventDefault();\n kernel.getEditor().changeMode(Editor.MODE_INSERT);\n }\n }\n }\n };\n\n window.onclick = event => {\n if (kernel.getEditor().isVisible())\n focusInput(kernel.getEditor());\n else if (kernel.getTerminal().isVisible()) {\n if (event.target.id != TerminalInput.NODE_ID)\n focusInput(kernel.getTerminal());\n }\n }\n \n document.getElementById(TerminalInput.EDITABLE_NODE_ID).onblur = () => {\n if (kernel.getTerminal().isVisible())\n kernel.getTerminal().setCursorPosition(window.getSelection().anchorOffset);\n else\n return;\n }\n\n document.getElementById(EditorInput.EDITABLE_NODE_ID).onblur = () => {\n if (kernel.getEditor().isVisible()) {\n kernel.getEditor().setCursorPosition(window.getSelection().anchorOffset);\n } else\n return;\n };\n}", "title": "" }, { "docid": "9779ee2349aef2dece8186ef7400882d", "score": "0.56572115", "text": "_textBoxKeyDownHandler(event) {\n const that = this,\n key = event.key,\n ctrlPressed = event.ctrlKey,\n //shiftPressed = event.shiftKey,\n ctrlHandledCodes = ['KeyA', 'KeyC', 'KeyV', 'KeyX'],\n selectionEnd = that.$.input.selectionEnd,\n asciiRegExpString = 'xxx[\\x00-\\x7F]+xxx',\n asciiRegExp = new RegExp(asciiRegExpString),\n allSupportedKeyboardCharacters = /^[a-zA-ZÀ-ÿа-яА-Я0-9.!@?#\"$%&:';()*\\+,\\/;\\-=[\\\\\\]\\^_{|}<>~` ]+$/;\n\n let selectionStart = that.$.input.selectionStart;\n\n\n\n if (ctrlPressed && (ctrlHandledCodes.indexOf(event.code) > -1)) {\n const performClipboard = function (command, callback) {\n const textArea = document.createElement('textarea');\n\n textArea.style.position = 'absolute';\n textArea.style.left = '-1000px';\n textArea.style.top = '-1000px';\n\n document.body.appendChild(textArea);\n textArea.focus();\n if (command === 'Paste') {\n setTimeout(function () {\n let value = textArea.value;\n\n if (value.length === 0 && window.clipboardData) {\n // pasteFrom.value = window.clipboardData.getData('Text');\n textArea.value = window.clipboardData.getData('Text');\n\n value = textArea.value;\n }\n\n textArea.parentNode.removeChild(textArea);\n that.$.input.focus();\n callback(value);\n }, 25);\n }\n else {\n textArea.value = that._cutCopyHandler(null, command);\n textArea.focus();\n textArea.setSelectionRange(0, textArea.value.length);\n setTimeout(function () {\n document.designMode = 'off';\n textArea.focus();\n textArea.parentNode.removeChild(textArea);\n that.$.input.focus();\n }, 25);\n\n if (window.clipboardData) {\n window.clipboardData.setData('Text', textArea.value);\n }\n }\n };\n\n switch (event.code) {\n case 'KeyA':\n that.$.input.setSelectionRange(0, that.$.input.value.length);\n break;\n case 'KeyC':\n performClipboard('Copy');\n break;\n case 'KeyV':\n performClipboard('Paste', function (text) {\n const context = that.context;\n\n that.context = that;\n that._textBoxPasteHandler(null, text)\n that.context = context;\n });\n break;\n case 'KeyX':\n performClipboard('Cut');\n break;\n }\n\n return;\n }\n\n if (key === 'Backspace') {\n that._deleteHandler(event);\n that._updateMaskFullAndCompleted();\n return;\n }\n\n\n if (key === 'Delete') {\n that._deleteHandler(event);\n that._updateMaskFullAndCompleted();\n return;\n }\n\n if (!that.allowPromptAsInput && (key === that.promptChar)) {\n that._preventDefault(event);\n return;\n }\n\n if (that.disabled || that.readonly || (that.asciiOnly && !asciiRegExp.test(key)) || (!allSupportedKeyboardCharacters.test(key) || key.length > 1)) {\n return;\n }\n\n that._preventDefault(event);\n\n if (selectionStart === selectionEnd && selectionStart === that.$.input.value.length) {\n return;\n }\n\n if (key === ' ' && !that.resetOnSpace) {\n return;\n }\n\n selectionStart = that._getEditableSelectionStart(selectionStart, key);\n\n const nonEditableKeyHandler = function () {\n selectionStart = that._getNonEditableSelectionStart(that.$.input.selectionStart, key);\n if (selectionStart !== -1) {\n that.$.input.selectionStart = that.$.input.selectionEnd = selectionStart + 1;\n }\n }\n\n if (selectionStart === -1) {\n nonEditableKeyHandler();\n return;\n }\n\n const isChanged = that._setCharAtPosition(key, selectionStart);\n\n if (isChanged) {\n that._setMaskToInput();\n that._updateMaskFullAndCompleted();\n that.$.input.selectionStart = that.$.input.selectionEnd = selectionStart + 1;\n }\n else {\n nonEditableKeyHandler();\n }\n }", "title": "" }, { "docid": "b5a984cc9d7bcc5d42ce7b0ec7a1b096", "score": "0.5652447", "text": "function inputTextHandler(e) {\n setInputText(e.target.value);\n }", "title": "" }, { "docid": "46f7eb37175c8dad74399c936ae394a8", "score": "0.56518036", "text": "function processKeyPress(e) {\n\tconsole.log(\"<<KEYPRESS>> : \" + keyCode(e) + \" - \" + e.which + \" - \" + getChar(e));\n\te.preventDefault();\n\tif (isPrintable(e)) {\n\t\tconsole.log(\"::KEYPRESS EVENT::PRINTABLE\");\n\t\twriteDown(e);\n\t} else {\n\t\tconsole.log(\"::KEYPRESS EVENT::NOT PRINTABLE\");\n\t}\n\te.stopPropagation();\n}", "title": "" }, { "docid": "cd9649eed159fb03191cce12dd77738b", "score": "0.564944", "text": "function setupKeyEvent() {\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n}", "title": "" }, { "docid": "ef71a49ceebc9f80764d0a0d820da95d", "score": "0.56427854", "text": "function keyUp(event) {\n var e = event; // Global?\n var out = e.srcElement;\n if (e.code == \"CapsLock\") {\n inCapsLock = false;\n }\n }", "title": "" }, { "docid": "e9f67b3903568c1a6dd99727ba9aab87", "score": "0.5642319", "text": "function textonly(e){\n\tvar code;\n\tif (!e) var e = window.event;\n\tif (e.keyCode) code = e.keyCode;\n\telse if (e.which) code = e.which;\n\tvar character = String.fromCharCode(code);\n\tvar AllowRegex = /^[\\ba-zA-Z\\s-]$/;\n\tif (AllowRegex.test(character)) return true; \n\treturn false;\n\t}", "title": "" }, { "docid": "87d5087c20974748cd60d06fc1e20f61", "score": "0.5625319", "text": "function trustedKeyEvent(window)\n{\n return function(targetElement, type, ctrl, alt, shift, meta, keyCode, charCode) {\n // Check that window matches targetElement.ownerDocument? Nah.\n try {\n var event = targetElement.ownerDocument.createEvent(\"KeyboardEvent\");\n event.initKeyEvent(\"key\" + type, true, true, null, ctrl, alt, shift, meta, keyCode, charCode);\n targetElement.dispatchEvent(event);\n } catch(e) {\n dumpln(\"Error thrown while trying to make an event?\");\n dumpln(e);\n }\n };\n}", "title": "" }, { "docid": "cc458a43cf5e406dd443f74ef52bc488", "score": "0.5616212", "text": "function dispatchKeyboardEvent(target, eventType, char) {\n var evt = document.createEvent(\"KeyboardEvent\");\n evt.initKeyEvent(eventType, true, true, window,\n false, false, false, false,\n 0, char.charCodeAt(0));\n target.dispatchEvent(evt);\n }", "title": "" }, { "docid": "c7d3ceb79686d27630502860443ac299", "score": "0.5613398", "text": "function checkEvent(el) {\n // First check, for if Firefox fixes its issue with el.oninput = function\n el.setAttribute(\"oninput\", \"return\");\n if (typeof el.oninput == \"function\") {\n return true;\n }\n // Second check, because Firefox doesn't map oninput attribute to oninput property\n try {\n\n // \"* Note * : Disabled focus and dispatch of keypress event due to conflict with DOMready, which resulted in scrolling down to the bottom of the page, possibly because layout wasn't finished rendering.\n var e = document.createEvent(\"KeyboardEvent\"),\n ok = false,\n tester = function(e) {\n ok = true;\n e.preventDefault();\n e.stopPropagation();\n };\n\n // e.initKeyEvent(\"keypress\", true, true, window, false, false, false, false, 0, \"e\".charCodeAt(0));\n\n document.body.appendChild(el);\n el.addEventListener(\"input\", tester, false);\n // el.focus();\n // el.dispatchEvent(e);\n el.removeEventListener(\"input\", tester, false);\n document.body.removeChild(el);\n return ok;\n\n } catch(error) {\n\n }\n }", "title": "" }, { "docid": "27fb8b5865eafb2b469c917bae4b399b", "score": "0.56106824", "text": "onTextChanged_() {\n // Delay the 'textchanged' event so StreamingEngine time to absorb the\n // changes before the user tries to query it.\n const event = this.makeEvent_(conf.EventName.TextChanged)\n this.delayDispatchEvent_(event)\n }", "title": "" }, { "docid": "06b9b832dcc94bb99b04968101736cc4", "score": "0.5599153", "text": "function typeText(selector, text) {\n var $selector = $(selector);\n $selector.val(text);\n var event = document.createEvent(\"Events\");\n event.initEvent('input', true, true);\n $selector[0].dispatchEvent(event);\n }", "title": "" }, { "docid": "555bf15a54793e57c5d8526731de348b", "score": "0.55932003", "text": "handleKeyPress(e) {\n\t\tthis.check(e);\n\t}", "title": "" }, { "docid": "c9ec0eac2ea8fcc4e81279a9ed51b110", "score": "0.55883324", "text": "function Input(event) {\n}", "title": "" }, { "docid": "55bf1ff011b36e9a4ea3020f6c35811a", "score": "0.55876356", "text": "function inputKeyDownEvent(e)\n {\n if(e.defaultPrevented) return false;\n \n var __element = this,\n __extensions = __element.__pikantnyExtensions__,\n __set = _setStandard,\n __update = _updateStandard,\n __value = __element.value,\n __oldUpdateValue = __extensions.__prevalue__,\n __oldValue = __value;\n \n /* checkif in IME mode */\n if(__extensions.isIME || __InputIMEDetect__.indexOf(e.key) !== -1)\n {\n __extensions.isIME = true;\n \n /* this prevents the form from being submitted on IE when a user hits enter when in IME mode */\n if(checkIfEnter(e)) return !!e.preventDefault();\n return true;\n }\n \n __extensions.isInputUpdate = undefined;\n __extensions.isAltered = undefined;\n __extensions.isIME = undefined;\n __extensions.__prevalue__ = __oldValue;\n \n if(e.key && (e.key.length !== 1 && !checkIfBackspace(e))) return true;\n \n if(checkIfPaste(e) || checkIfCut(e))\n {\n __extensions.isAltered = true;\n return true;\n }\n \n if(e.ctrlKey || e.altKey) return true;\n \n __value = getInputKeyDownValue(__element,e);\n __extensions.isKeyDownUpdate = true;\n if(__set(__element,'value',__value,__oldValue,__extensions,__extensions.stop))\n {\n if(__extensions.isPressed)\n {\n __extensions.isPressedUpdate = true;\n if(!__extensions.stop) __update(__element,'value',__element.value,__oldUpdateValue,__extensions);\n __extensions.stop = undefined;\n }\n else\n {\n __extensions.isPressed = true;\n }\n }\n else\n {\n __extensions.stop = true;\n __extensions.latestValue = __element.value;\n return !!e.preventDefault();\n }\n return true;\n }", "title": "" }, { "docid": "cee60d2026584d48d0d5f86dba2b8af5", "score": "0.55869967", "text": "function handleEvent() {\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n}", "title": "" }, { "docid": "a42875a7210ba6ba434ad07266c29fd3", "score": "0.5583929", "text": "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "title": "" }, { "docid": "a42875a7210ba6ba434ad07266c29fd3", "score": "0.5583929", "text": "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "title": "" }, { "docid": "b148c420ac3c4f610a6168da5f8213bb", "score": "0.5583597", "text": "_proxyInputEvent() {\n this.dispatchEvent(\n new CustomEvent('user-input-changed', {\n bubbles: true,\n composed: true,\n }),\n );\n }", "title": "" }, { "docid": "a05a88d352adea2a55c3cadbbb26782e", "score": "0.55818814", "text": "function vChars(objEvent) \r\n{\r\n //browser detection\r\n var strUserAgent = navigator.userAgent.toLowerCase(); \r\n var isIE = strUserAgent.indexOf(\"msie\") > -1; \r\n var isNS6 = strUserAgent.indexOf(\"netscape6\") > -1; \r\n var isNS4 = !isIE && !isNS6 && parseFloat(navigator.appVersion) < 5; \r\n\r\n //regular expressions\r\n var reValidDigits = /\\d/;\r\n\r\n //regular expressions for alphanumerics\r\n var reValidAlpha = /\\w/i;\r\n\r\n var iKeyCode, strKey; \r\n\r\n if (isIE) {\r\n iKeyCode = objEvent.keyCode;\r\n } else {\r\n iKeyCode = objEvent.which;\r\n }\r\n\r\n strKey = String.fromCharCode(iKeyCode);\r\n\r\n //aqui van todos los keycodes que te quieres saltear...\r\n if (iKeyCode == 8) return true; //el backspace...\r\n\r\n //aqui van todos los keycodes que no quieres dejar pasar...\r\n if (iKeyCode == 95) return false; //el underscore...\r\n if (iKeyCode == 241) return false; //la n con tilde\r\n\r\n if (reValidAlpha.test(strKey) && !reValidDigits.test(strKey))\r\n {//si es alfanumerico y no es caracter -> es letra\r\n //alert(\"Valid Character Detected!\\nKeyCode = \" + iKeyCode + \"\\nCharacter =\" + strKey);\r\n }\r\n else\r\n {\r\n //alert(\"Invalid Character Detected!\\nKeyCode = \" + iKeyCode + \"\\nCharacter =\" + strKey);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "3a666a80c4d51e9226c0cc21dee7b48d", "score": "0.5579641", "text": "function TextExtFocus() {}", "title": "" }, { "docid": "72ed0e072688409fe159f2ac833e8ea3", "score": "0.5577818", "text": "function textInputKeydownEventHandler(e)\n{\n letter = String.fromCharCode(e.keyCode).toLowerCase();\n buttonId = e.target.id.substring(\"button\".length) - 0;\n sticks[stickId - 1].setKey(buttonId - 1, letter);\n updateDOMButtons();\n e.preventDefault();\n}", "title": "" }, { "docid": "6c7d6188ae2018d69940989bcb11da3c", "score": "0.557092", "text": "function textInput() {\n if (skipTextInput) return;\n var text = textarea.val();\n if (!text) return;\n textarea.val('');\n // textarea can contain more than one character\n // when typing quickly on slower platforms;\n // so process each character separately\n for (var i=0; i<text.length; i++) {\n cursor.parent.textInput(text[i]);\n }\n }", "title": "" }, { "docid": "bce46a64b0b597bb7d3c52e57f8587dd", "score": "0.555825", "text": "function KeyPress(e) {\r\n\r\n var evtobj = window.event? event : e\r\n\r\n //Ctrl + z trigger\r\n if(evtobj.keyCode == 90 && evtobj.ctrlKey) { undo(); }\r\n\r\n //Ctrl + a trigger\r\n if((evtobj.keyCode == 65 || evtobj.keyCode == 97) && evtobj.ctrlKey) { selectEverything(); }\r\n\r\n //Ctrl + x trigger\r\n if(evtobj.keyCode == 88 && evtobj.ctrlKey) { cutSelection(); }\r\n\r\n //Delete trigger\r\n if(evtobj.keyCode == 46) { deleteSelected(); }\r\n\r\n //Ctrl + v trigger\r\n if(evtobj.keyCode == 86 && evtobj.ctrlKey) { paste(); }\r\n\r\n //Ctrl + c trigger\r\n if(evtobj.keyCode == 67 && evtobj.ctrlKey) { copySelection(); }\r\n\r\n //Ctrl + F trigger\r\n if(evtobj.keyCode == 70 && evtobj.ctrlKey) { showSearchDialog(); }\r\n\r\n}", "title": "" }, { "docid": "3b3f42426ed5d341364363922fa78fa0", "score": "0.5554044", "text": "function keyUpHandler(e) { e }", "title": "" }, { "docid": "a63ed1a86a6b4a1e265a9e661d152193", "score": "0.5550768", "text": "_onFocus(input) { this._onKeyChanges(null, input); }", "title": "" }, { "docid": "80c47efa4262c0df1a307e85e409d028", "score": "0.5533438", "text": "function onKeyDown( aEvt )\n{\n if ( !aEvt )\n aEvt = window.event;\n\n var code = aEvt.keyCode || aEvt.charCode;\n\n if( !processingEffect && keyCodeDictionary[currentMode] && keyCodeDictionary[currentMode][code] )\n {\n return keyCodeDictionary[currentMode][code]();\n }\n else\n {\n document.onkeypress = onKeyPress;\n return null;\n }\n}", "title": "" }, { "docid": "7eb97bb300d87f314cf77c37a6c8b463", "score": "0.55325234", "text": "function SSI_ClickableTyping(event)\n{\n\t// If they have focus on the other specify box, then don't toggle select\n\tvar OtherTextBox = jQuery(this).find(\"input[type=text]\");\n\t\n\tif(OtherTextBox.length == 0)\n\t{\n\t\tOtherTextBox = jQuery(this).find(\"textarea\");\n\t}\n\n\tif (OtherTextBox.length)\n\t{\n\t\t// Allow spaces to be typed in the other specify.\n\t\tif (OtherTextBox[0].hasfocus)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//Space was pushed (Prevents page from shifting down on spacebar press for graphical select buttons)\n\tif(jQuery(this).find(\".graphical_select\").length && event.keyCode == 32)\n\t{\n\t\treturn false;\n\t} \t\n}", "title": "" }, { "docid": "ba5e7f2191c1bcbcf5587def846e3557", "score": "0.553086", "text": "function keyTyped() {\n\n}", "title": "" }, { "docid": "b523d833d1038de017700da5314a92ce", "score": "0.55274266", "text": "function checkInputTextAlphaNumeric(event, obj) {\n var noIE = false;\n var code;\n if (!event) var event = window.event;\n if (event.keyCode) code = event.keyCode;\n else if (event.which) { code = event.which; noIE = true; }\n if (code == 8 || code == 9) {\n return true;\n }\n return inCharset(String.fromCharCode(code).toUpperCase(), ALPHA_NUMERIC_CHAR_SET);\n}", "title": "" }, { "docid": "a365cfe49126090cd776e6179c4e6dd4", "score": "0.55231285", "text": "function fireKeyboardEvent(event, keycode) {\r\n var keyboardEvent = document.createEventObject ?\r\n document.createEventObject() : document.createEvent(\"Events\");\r\n\r\n if(keyboardEvent.initEvent) {\r\n keyboardEvent.initEvent(event, true, true);\r\n }\r\n\r\n keyboardEvent.keyCode = keycode;\r\n keyboardEvent.which = keycode;\r\n\r\n document.dispatchEvent ? document.dispatchEvent(keyboardEvent) \r\n : document.fireEvent(event, keyboardEvent);\r\n }", "title": "" }, { "docid": "68903ef8b47cfcc70d2aa836fa983749", "score": "0.5522426", "text": "function handleTextKeyPress(event) {\n if (event.key === 'Enter') handleSearch();\n }", "title": "" }, { "docid": "9a1434160d3c53a10f6b1a16e1e8d720", "score": "0.55195093", "text": "_textBoxKeyUpHandler() {\n const that = this;\n\n const value = that.value;\n that.value = that._getValueWithTextMaskFormat({ start: 0, end: that._mask.length }, that.textMaskFormat);\n\n if (value !== that.value) {\n that.$.fireEvent('change', {\n 'newValue': that.value,\n 'oldValue': value\n });\n }\n }", "title": "" }, { "docid": "32375d27edcd321ea221b25f0fd6d137", "score": "0.55117357", "text": "function makeKeyPressEvent(k) {\n console.assert(k.length === 1, k);\n // https://code.google.com/p/chromium/issues/detail?id=327853\n var e = document.createEvent('Events');\n // KeyboardEvents bubble and are cancelable.\n // https://developer.mozilla.org/en-US/docs/Web/API/Event/initEvent\n e.initEvent('keypress', true, true);\n e.which = util.canonicalizeLineBreaks(k).charCodeAt(0);\n return e;\n}", "title": "" }, { "docid": "5345b375db79816ce3a85a6bddd4b07a", "score": "0.55018145", "text": "function tiKeyPressed(event) {\n var e = event || window.event;\n var keyCode;\n if (e.keyCode) keyCode = e.keyCode;\n else if (e.which) keyCode = e.which;\n\n //var charCode = e.charCode || e.keyCode;\n var charCode;\n if (e.keyCode) charCode = e.keyCode;\n else if (e.which) charCode = e.which;\n\n var targetElement = (e.currentTarget || e.srcElement);\n\n if (keyCode == 8 ) {\n previous_sequence[targetElement.id] = '';\n return true;\n } // Backspace\n // If this keystroke is a function key of any kind, do not filter it\n if (e.charCode == 0 || e.which ==0 ) return true; // Function key (Firefox and Opera), e.charCode for Firefox and e.which for Opera\n // If control or alt or meta key pressed\n if(e.ctrlKey || (e.altKey && !transettings.current_scheme.extended_keyboard) || e.metaKey) {\n //if (navigator.userAgent.indexOf(\"Firefox\")!=-1) {\n //\treturn shortKeyPressed(event);\n //}\n return true;\n }\n if (charCode < 32) return true; // ASCII control character\n if(trasliteration_fields[targetElement.id])\n {\n\n var c = String.fromCharCode(charCode);\n var selectionRange = GetCaretPosition(targetElement);\n var lastSevenChars = getLastNChars(targetElement.value, selectionRange['start'], transettings.check_str_length);\n var oldString;\n var newString;\n\n if(charCode ==62 && previous_sequence[targetElement.id ].substring(previous_sequence[targetElement.id ].length-1)==\"<\")\n {\n oldString = \"<>\";\n newString = \"\";\n temp_disable[targetElement.id] = !temp_disable[targetElement.id];\n }\n else {\n if(!temp_disable[targetElement.id])\n {\n var transPair;\n if(transettings.current_scheme.extended_keyboard && e.altKey) {\n transPair = transli(lastSevenChars+c, e, transettings.current_scheme.rules_x);\n }\n else transPair = transli(lastSevenChars+c, e, transettings.current_scheme.rules);\n oldString = transPair[0];\n newString = transPair[1];\n }\n else\n {\n oldString = c;\n newString = c;\n }\n }\n replaceTransStringAtCaret(targetElement, oldString.length, newString , selectionRange);\n previous_sequence[targetElement.id ] += c;\n if(previous_sequence[targetElement.id ].length > 6 ) previous_sequence[targetElement.id ] = previous_sequence[targetElement.id ].substring(previous_sequence[targetElement.id ].length-6);\n stopPropagation(e);\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "30b3869200c4a8cd5283c88d83ed6f6f", "score": "0.5500574", "text": "onInputEvent(pointer) { return false; }", "title": "" }, { "docid": "0d99644fc576d65108d3c764f19e37f9", "score": "0.54950833", "text": "onTextInput(e) {\n \n }", "title": "" }, { "docid": "0fc5a6a877ad62b008b42028e56d9aaa", "score": "0.54944515", "text": "function keydownEvent(e) {\n var k = e.keyCode;\n ignore = (k < 16 || (k > 16 && k < 32) || (k > 32 && k < 41));\n\n //backspace, delete, and escape get special treatment\n if (k == 8 || k == 46 || (iPhone && k == 127)) {//backspace/delete\n return true;\n } else if (k == 27) {//escape\n return true;\n }\n //return false;\n }", "title": "" }, { "docid": "f0353e4039b0051ae947e5706e780a28", "score": "0.5481561", "text": "function start()\r\n{\r\n\twindow.onkeypress = handleKeyPress;\r\n}", "title": "" }, { "docid": "9292f193fd1c202c674c02fe6e6d66e1", "score": "0.54813516", "text": "keyStroke(hub, key, e, keystroke){\n\t\t\tif(keystroke.ctrl || key == \"Meta\" || key == \"Win\") return false;\n\t\t\tvar domChain=$(this).parents().addBack();\n\t\t\tvar input=this.input[0];\n\t\t\tvar result=false;\n\t\t\tvar focused=(document.activeElement===input); // If focused then we need to allow the input box to get most keystrokes\n\t\t\tif(!focused && document.activeElement &&\n\t\t\t\t\t(document.activeElement.tagName==\"INPUT\" || document.activeElement.tagName==\"TEXTAREA\")) return false; // some other input has focus\n\n\t\t\tvar iAmActive=false, iAmDisplayed=false;\n\t\t\tif(domChain.hasClass(\"stxMenuActive\")){\n\t\t\t\tiAmDisplayed=true; // if my menu chain is active then I'm alive\n\t\t\t}\n\t\t\tif(focused || iAmDisplayed) iAmActive=true; // If my input is focused or I'm displayed, then I'm alive\n\t\t\tif(!iAmActive){ // Otherwise, I may still be alive under certain conditions\n\t\t\t\tif(typeof(this.node.attr(\"cq-keystroke-default\"))==\"undefined\") return; // I'm always alive if I have default body keystrokes\n\t\t\t\tif(!iAmDisplayed && this.uiManager.topMenu()) return; // unless there's another menu active and it isn't me\n\t\t\t}\n\t\t\tif((key===\" \" || key===\"Spacebar\") && input.value===\"\"){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar self=this;\n\t\t\tif(keystroke.key && keystroke.key.length==1 && e.which>=32 && e.which<=222){\n\t\t\t\tif(!focused) input.value=input.value+keystroke.key; // Changes the <input> value when keystrokes are registered against the body.\n\t\t\t\tself.acceptText(input.value, self.currentFilter);\n\t\t\t\tresult=true;\n\t\t\t}\n\t\t\tif(key==\"Delete\" || key==\"Backspace\" || key==\"Del\"){\n\t\t\t\tif(this.context.stx.anyHighlighted) return false;\n\t\t\t\tif(input.value.length){\n\t\t\t\t\t//ctrl-a or highlight all text + delete implies remove all text\n\t\t\t\t\tif(window.getSelection().toString()){\n\t\t\t\t\t\tinput.value = \"\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(!focused) input.value=input.value.substring(0,input.value.length-1);\n\t\t\t\t\t\tif(input.value.length){\n\t\t\t\t\t\t\tself.acceptText(input.value, self.currentFilter);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresult=true; // only capture delete key if there was something to delete\n\t\t\t\t}\n\t\t\t\tif(key==\"Backspace\") result=true; // always capture backspace because otherwise chrome will navigate back\n\t\t\t}\n\t\t\tif((key===\"Escape\" || key===\"Esc\") && iAmDisplayed){\n\t\t\t\tinput.value=\"\";\n\t\t\t\tthis.close();\n\t\t\t\tCIQ.blur(input);\n\t\t\t\tresult=true;\n\t\t\t}\n\t\t\tif(key===\"Enter\" && input.value!==\"\"){\n\t\t\t\tif(this.isActive()){\n\t\t\t\t\tvar scrollable=this.node.find(\"cq-scroll\");\n\t\t\t\t\tfocused=scrollable.length && scrollable[0].focused(); // Using cursor keys to maneuver down lookup results\n\t\t\t\t\tif(focused && focused.selectFC){\n\t\t\t\t\t\tfocused.selectFC.apply(focused, {});\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar val=input.value;\n\t\t\t\t\t\tvar toUpperCase=this.node.truthyAttr(\"cq-uppercase\");\n\t\t\t\t\t\tif(toUpperCase) val=val.toUpperCase();\n\t\t\t\t\t\tthis.selectItem({symbol:val});\n\t\t\t\t\t}\n\t\t\t\t\tCIQ.blur(this.input);\n\t\t\t\t\tthis.close();\n\t\t\t\t\tinput.value=\"\";\n\t\t\t\t\tresult=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(result){\n\t\t\t\t// If we're focused, then keep the lookup open unless we hit escape.\n\t\t\t\t// Otherwise, if there is no length close it (user hit \"escape\", \"enter\", or \"backspace/delete\" while unfocused)\n\t\t\t\tif(this.usingEmptyDriver || (!input.value.length && (key==\"Escape\" || key==\"Esc\" || key==\"Enter\" || !focused))){\n\t\t\t\t\tthis.close();\n\t\t\t\t}else{\n\t\t\t\t\tthis.open();\n\t\t\t\t}\n\t\t\t\tif(focused) return {allowDefault:true};\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "34a67f14fc2ab26931115854317dc2b5", "score": "0.54800266", "text": "function handleKeyPress(e) {\n\thandleKey(e, '.press');\n}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "84e457915225f2b8e5ce04f4f5665524", "score": "0.54746044", "text": "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "title": "" }, { "docid": "9ed96d27c1a60708b7685edf63f7e532", "score": "0.54649454", "text": "onPreInputEvent(pointer) { return false; }", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" }, { "docid": "8feeda9723fb9d509d069a9611651252", "score": "0.54624826", "text": "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "title": "" } ]
7f674bf5ae870b6f02e9cb5fa865abf1
Lists property prices based on the seasons setup get property ID from listProperties(needs location ID) pullpropertydata
[ { "docid": "f2b5e0d216fd4d8969106d72de1d45ef", "score": "0.5912929", "text": "function listPropertyPrices(propertyID, from, to, pricingModelMode, authInfo) {\n return {\n Pull_ListPropertyPrices_RQ: {\n ...createAuthentication(authInfo),\n PropertyID: propertyID,\n DateFrom: from,\n DateTo: to,\n PricingModelMode: pricingModelMode\n }\n }\n}", "title": "" } ]
[ { "docid": "abf1091bcdc301ad16c06a6370784ef6", "score": "0.5743891", "text": "function getDevelopmentProps(id) {\n\t\t\ttokkoService.getDevelopmentProps(id).then(\n\t\t\t\t(result) => {\n\t\t\t\t\tresult = result.data.objects;\n\n\t\t\t\t\tdevelopment.devProps = result.map((prop) => {\n\t\t\t\t\t\tconst price = utils.getPrice(prop);\n\n\t\t\t\t\t\tif (price.price < development.d.minPrice || !development.d.minPrice) {\n\t\t\t\t\t\t\tdevelopment.d.minPrice = price.price;\n\t\t\t\t\t\t\tdevelopment.d.minPriceCurrency = price.currency;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst getSpecificAddressReg = /.+(\\-.+)$/gs;\n\t\t\t\t\t\tconst address = getSpecificAddressReg.exec(prop.real_address);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: prop.id,\n\t\t\t\t\t\t\ttype: prop.operations[0].operation_type,\n\t\t\t\t\t\t\ttitle: prop.publication_title,\n\t\t\t\t\t\t\tproperty_type: prop.type.name,\n\t\t\t\t\t\t\tcurrency: price.currency,\n\t\t\t\t\t\t\tprice: $filter('currency')(price.price, `${price.currency} `, 0),\n\t\t\t\t\t\t\tcover_photo: prop.photos[0].image,\n\t\t\t\t\t\t\tparkings: prop.parking_lot_amount ? prop.parking_lot_amount : 0,\n\t\t\t\t\t\t\tarea: prop.type.id === 1 ? `${$filter('number')(prop.surface, 0)}m²` : `${$filter('number')(prop.roofed_surface, 0)}m²`,\n\t\t\t\t\t\t\tsell: prop.operations.filter((p) => prop.operation_type == 'Venta')[0]\n\t\t\t\t\t\t\t\t? prop.operations.filter((p) => prop.operation_type == 'Venta')[0].prices.slice(-1)[0]\n\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\t\trent: prop.operations.filter((p) => prop.operation_type == 'Alquiler')[0]\n\t\t\t\t\t\t\t\t? prop.operations.filter((p) => prop.operation_type == 'Alquiler')[0].prices.slice(-1)[0]\n\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\t\tparkings_av: prop.parking_lot_amount > 0 ? 'Si' : 'No',\n\t\t\t\t\t\t\tsuite_amount: prop.suite_amount,\n\t\t\t\t\t\t\tbathroom_amount: result.bathroom_amount ? result.bathroom_amount : 0,\n\t\t\t\t\t\t\taddress: address ? address[1].replace('-', '').trim() : prop.fake_address ? prop.fake_address : prop.address,\n\t\t\t\t\t\t\tprop: prop,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\n\t\t\t\t\tdevelopment.devPropsReady = true;\n\t\t\t\t},\n\t\t\t\t(reject) => null\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "8460b631754b732c76680a7627ac2927", "score": "0.5658918", "text": "function buildPropertyList(list) {\n\n var properties = [];\n\n for (var i = 0; i < list.length; i++) {\n var current = list[i];\n if (current.discount == \"t\") {\n document.querySelector(\"ul\").appendChild(new PropertyDiscount(current.id, current.title, current.price, current.address, current.bedrooms, current.bathrooms, current.image, current.ammenities, current.description, current[\"AVG(r.rating)\"], current.superhost));\n } else {\n document.querySelector(\"ul\").appendChild(new Property(current.id, current.title, current.price, current.address, current.bedrooms, current.bathrooms, current.image, current.ammenities, current.description, current[\"AVG(r.rating)\"], current.superhost));\n }\n }\n}", "title": "" }, { "docid": "bc9600a8db1e6829e535b02fdfc6dde3", "score": "0.5498291", "text": "async fetchPropertyOptions(propertyId) {\n const response = await this.fetch(`cam/getprop?r=${propertyId}`);\n const data = await response.json();\n const property = data[`O${propertyId}`] ? data[`O${propertyId}`] : null;\n if (!property)\n return null;\n return property.rv;\n }", "title": "" }, { "docid": "137583e08f13d5f1a004ca2fe65ac445", "score": "0.54607475", "text": "function display_props_over_time(data, properties, id) {\n $(id + \" .data-details\").remove();\n $(id).append('<div class=\"data-details\">');\n var details = $(id + \" .data-details\");\n\n details.append(\"<a href=\\\"churches/\" + data[0].id + \"\\\">\" + data[0].id + \"</a></br>\");\n details.append(\"Name: \" + data[0].name + \"</br>\");\n details.append(\"District: \" + data[0].district + \"</br>\");\n details.append(\"Location: \" + data[0].city + \", \" + data[0].state + \"</br></br>\");\n details.append(\"<table>\");\n\tproperties.forEach(function(prop) {\n\t\tdetails.append(\"<th>\" + prop + \"</th>\");\n\t});\n\tdetails.append(\"<th>Year</th>\");\n\n data.forEach(function(el) {\n\t\trow = \"<tr>\";\n\t\tproperties.forEach(function(prop) {\n\t\t\trow += \"<td>\" + d3.format(\".2f\")(el[prop]) + \"</td>\";\n\t\t});\n\t\trow += \"<td>\" + el.year + \"</td></tr>\";\n details.append(row);\n });\n details.append(\"</table>\");\n details.append(\"</div>\");\n}", "title": "" }, { "docid": "a1fda3632d69e4bb260ea4ba58422d6e", "score": "0.5388121", "text": "function displayProduct() {\nvar propertyID = localStorage.propertyID;\nvar lang = \"2\";\n var url = \"https://www.kiralikotopark.com/mobile-functions.php?action=getSinglePropertyData&propertyID=\"+localStorage.propertyID+\"&language=\"+lang;\n \t$.ajax({\n type: \"POST\",\n dataType: \"json\",\n crossDomain: true, \n cache: false,\n url: url,\n async: false,\n success: function(data){ \n var details = data[0][\"json_object\"];\n details = details.replace(/field_/g,'');\n details = $.parseJSON(details);\t\n\t\tvar arry = [];\n\t\tvar o = \"\";\n\t\tfor (l=0;l<data[1].length;l++) {\n\t\t\to = data[1][l];\n\t\t\tarry.push(details[o]);\n\t\t}\n\t\tvar w = [];\n\t\tfor (var q = 0; q<arry.length; q++) {\n\t\tw.push(data[2][q].option);\n\t\t}\n\t\t\n\t\tvar exclude = [];\n\t\tfor (i = 0; i<data[3].length;i++) {\n\t\tif (data[5][i]) {\n\t\t} else {\n\t\texclude.push(i);\n\t\t}\n\t\t}\n\t\t\t\t\n\t\tvar coordinates = data[0].gps;\n\t\tcoordinates = coordinates.split(',');\n\t\t\n\t\t//Display property images in carousel\n\t\tvar images = data[0].image_repository;\n if (images == null) {\n $(\".restaurant-img\").html(\"<img src='https://www.kiralikotopark.com/files/no_image.jpg' alt='fotoğrafsız' />\");\n } else {\n\t\timages = images.substring(1, images.length - 1);\n\t\timages = images.replace(/\"/g,'');\n\t\timages = images.split(',');\n\t\tvar collector = \"<div data-pagination='{\\\"el\\\": \\\".swiper-pagination\\\"}' data-space-between=\\\"0\\\" class=\\\"swiper-container swiper-init loop\\\"><div class=\\\"swiper-wrapper\\\" id=\\\"mainsliderhost\\\">\";\n\t\tvar i = 0;\n\t\t$.each(images, function(){\n\t\tcollector += \"<div class=\\\"swiper-slide\\\"><img src=\\\"https://www.kiralikotopark.com/files/\"+images[i]+\"\\\" class=\\\"productSlideShowImg\\\"></div>\";\n\t\ti=i+1;\n\t\t});\n\t\tcollector += \"</div><div class=\\\"swiper-pagination\\\"></div></div>\";\n\t\t$(\".restaurant-img\").html(collector);\n }\n\t\t\t\n\t\t//Display property general info\n var preinfo = '';\n\t\tvar propgeninfo = '<ul><li><div class=\"item-inner\"><div class=\"item-title-row\"><div class=\"item-title margin-left\">İlan Numarası</div><div class=\"item-after link-deeporange\">'+propertyID+'</div></div></div></li>';\n\t\tvar longdescription = \"<p style='text-align:justify'>\";\n\t\tfor (var r = 0; r<arry.length; r++) { \n\t\t\n\t\tif (r == 3) { preinfo = arry[r]; } else {\n\t\t\n\t\tif (exclude.includes(r)) {} else {\n\t\tpropgeninfo += '<li><div class=\"item-inner\"><div class=\"item-title-row\"><div class=\"item-title margin-left\">'+w[r]+'</div><div class=\"item-after link-deeporange\">'+arry[r]+'</div></div></div></li>'; }\n\t\t}\n }\n\t\tpropgeninfo += '</ul>'\n\t\tlongdescription += '</p>'\n\t\t$(\"#preinfo\").html(preinfo);\n\t\t$(\"#t1\").html(propgeninfo);\n\t\t$(\"#t2\").html(details[17]);\n\t\t$(\"#t3\").html('<script>function initMap() { var uluru = {lat: '+coordinates[0]+', lng: '+coordinates[1]+'}; var map = new google.maps.Map(document.getElementById(\"map\"), {zoom: 17, center: uluru}); var marker = new google.maps.Marker({position: uluru, map: map}); } </script> <script async defer src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyAiBBcAFK3mcRZPcE_rgzN9TKEowrsonXg&callback=initMap\"> </script>');\t\t\n\t\t\n\t\t}\n});\n checkFav();\n}", "title": "" }, { "docid": "af2849ab08ef948b1f4a0fa0692dfbe3", "score": "0.5355406", "text": "function getPropertyById(propId) {\n\n for (var i = 0; i < properties.length; i++) {\n\n if (properties[i].id == propId) {\n\n return properties[i];\n }\n }\n}", "title": "" }, { "docid": "dd8e657a3c65c8b3df5dcc2a9b0a8deb", "score": "0.5322358", "text": "function updatePropertyList(properties){\n var list = $(\"<div class='property-list'>\");\n properties.forEach(function(property) {\n addPropertyToListElement(list, property)\n });\n resultSection.html(list);\n }", "title": "" }, { "docid": "449d7b1ccca6018b5e6d0d7c8eb56265", "score": "0.53086865", "text": "loadPropertyData(property) {\n const basicPropertyData = this.getBasicPropertyData(property);\n let propertyData = Object.assign(basicPropertyData, { basic: true });\n\n if (!this.vendorAPI) {\n return this.property(propertyData);\n }\n\n // Set observable to property data and start loading spinner while\n // the rest of the information is fetched via the vendorAPI\n this.isLoading(true);\n this.property(propertyData);\n\n const weatherDetailsPromise = this.vendorAPI.fetchWeatherDetails(property.coordinates);\n const propertyDetailsPromise = this.vendorAPI.fetchPropertyDetails(property);\n\n Promise.all([ weatherDetailsPromise, propertyDetailsPromise ])\n .then(data => {\n const weatherData = this.getWeatherData(data[0]);\n const propertyDetails = this.getAdditionalPropertyData(data[1]);\n propertyData = Object.assign({}, propertyData, weatherData, propertyDetails, { basic: false });\n\n // Update observable with property data (merged with API\n // data) and stop loading spinner\n this.property(propertyData);\n this.isLoading(false);\n })\n .catch((e) => {\n // Additional information is not crucial so any failures will only\n // be logged as warnings\n console.warn(e);\n // Stop loading spinner\n this.isLoading(false);\n })\n }", "title": "" }, { "docid": "4945becdae7dbd095074f5c9eb2b584b", "score": "0.52975786", "text": "function listPropertyDiscounts(propertyID, authInfo) {\n return {\n Pull_ListPropertyDiscounts_RQ: {\n ...createAuthentication(authInfo),\n PropertyID: propertyID\n }\n }\n}", "title": "" }, { "docid": "b40bf06fad6cff1fd93783836998b7ad", "score": "0.52317464", "text": "function populatePropertyList() {\n const Http = new XMLHttpRequest();\n const url = 'http://localhost:3000/api/property/0';\n Http.open(\"GET\", url);\n Http.send();\n\n var parsedJSON = '';\n\n Http.onreadystatechange = function () {\n if (this.readyState === 4 && parsedJSON !== []) {\n parsedJSON = JSON.parse(Http.responseText);\n displayQuoteHistory(parsedJSON);\n }\n };\n}", "title": "" }, { "docid": "2b262422b6dfe1f8e559d5e16c995d0b", "score": "0.5217252", "text": "getPropertyValue(cars, properties) {\n // Holds all values for selected property\n let container = [];\n\n // Decides if there are multiple, or just one property passed.\n if (typeof properties == \"string\") {\n // finds each value for selected property and adds it to container array\n cars.forEach(car => {\n const item = car[properties];\n container.push(item);\n });\n } else {\n // finds each value for selected properties and adds it to container array\n cars.forEach(car => {\n const item = car[properties[0]][properties[1]];\n container.push(item);\n });\n }\n return container;\n }", "title": "" }, { "docid": "f4942b91b6ec8e6f1f098c156f91c10d", "score": "0.51725256", "text": "async function getPlutus() {\n return await scrap(configs.exchangers.plutusDefi, '.details-price span');\n}", "title": "" }, { "docid": "0f642662b8b65743e854e203be70a739", "score": "0.51369166", "text": "async loadProperties(page = null) {\n if (!Is.empty(this.loadedPropertiesInBackground)) {\n this.properties = this.properties.concat(this.loadedPropertiesInBackground.splice(0, this.displayedPropertiesList));\n } else {\n this.loading = true;\n }\n\n let query = this.router.queryString.all();\n\n if (Is.empty(query)) {\n query.home = true;\n }\n\n if (page) {\n query.page = page;\n }\n\n let response = await this.propertiesService.list(query);\n\n if (! Is.empty(response.featuredProperties)) {\n this.featuredProperties = response.featuredProperties;\n\n this.featuredPropertiesIds = collect(this.featuredProperties).pluck('id').toArray();\n }\n\n this.properties = this.properties.concat(response.properties.slice(0, this.displayedPropertiesList));\n\n this.loadedPropertiesInBackground = this.loadedPropertiesInBackground.concat(response.properties.slice(this.displayedPropertiesList, 36 - this.displayedPropertiesList));\n\n if (Is.empty(response.properties) || response.properties.length < 36) {\n this.lastPage = true; \n } else {\n this.loadHiddenProperties(query);\n }\n\n this.properties = this.properties.map(property => {\n property.featured = this.featuredProperties.includes(property.id);\n return property;\n });\n \n this.loading = false;\n }", "title": "" }, { "docid": "d961e8dccacd1f8b4111cbe036ad6771", "score": "0.51267725", "text": "function attachPropertyListeners(response) {\n $(\"ul#property-listings\").on(\"click\", \"li\", function () {\n showInfo(response.listings[this.id]);\n });\n}", "title": "" }, { "docid": "8373146245dc1c9d03cf1b36a47a4f57", "score": "0.5073511", "text": "function getProductProperties(productId) {\n let addedProduct = {};\n\n // get cart id from how many items in the local storage\n //addedProduct.cart_id = Object.entries(localStorage).length; OLD\n addedProduct.cart_id = getHowManyProductInCart();\n\n // get product id if passed param is null get it from page link\n productId\n ? (addedProduct.product_id = productId)\n : (addedProduct.product_id = window.location.search.substring(\n window.location.search.indexOf('=') + 1\n ));\n\n //get product name\n addedProduct.product_name = databaseHandler.getProductById(\n addedProduct.product_id\n ).name;\n\n //get the color form products.html page color selector or directly from database\n\n if (\n window.location.href\n .toString()\n .split(window.location.host)[1]\n .includes('products.html')\n ) {\n let product_color_collection = document.querySelectorAll('.Color-Picker');\n product_color_collection.forEach((element) => {\n if (element.classList.contains('Selected-color')) {\n addedProduct.product_color = element.style.backgroundColor;\n }\n });\n } else {\n addedProduct.product_color = databaseHandler.getProductById(\n addedProduct.product_id\n ).color[0];\n }\n\n // get the size form products.html page size selector or directly from database if product has sizes\n\n if (\n window.location.href\n .toString()\n .split(window.location.host)[1]\n .includes('products.html')\n ) {\n let product_size_collection = document.querySelectorAll('.Size-Selector');\n product_size_collection.forEach((element) => {\n if (element.classList.contains('selectedSize')) {\n addedProduct.product_size = element.textContent.trim();\n }\n });\n } else {\n addedProduct.product_size = databaseHandler.getProductById(\n addedProduct.product_id\n ).size[0];\n }\n\n //get product unit price\n addedProduct.unit_price = databaseHandler.getPriceByProductIdAndColor(\n addedProduct.product_id,\n addedProduct.product_color\n );\n // add two decimal point\n addedProduct.unit_price = addedProduct.unit_price;\n\n //get quantity form products.html page quantity selector or directly from database\n if (\n window.location.href\n .toString()\n .split(window.location.host)[1]\n .includes('products.html')\n ) {\n addedProduct.product_quantity = document.querySelector(\n '.order-quantity-1'\n ).value;\n } else {\n addedProduct.product_quantity = 1;\n }\n\n let quantity = parseInt(addedProduct.product_quantity);\n\n // get product price\n addedProduct.product_price =\n databaseHandler.getPriceByProductIdAndColor(\n addedProduct.product_id,\n addedProduct.product_color\n ) * quantity;\n // add two decimal point\n addedProduct.product_price = addedProduct.product_price;\n\n return addedProduct;\n}", "title": "" }, { "docid": "b14dd8bc4c035984aaf2fbb5ad5ee679", "score": "0.5038749", "text": "function getProperty(){\n var queryParams = new URLSearchParams(window.location.search);\n if (queryParams.has('id') == true){\n var id = queryParams.get('id');\n\n var property = storageManager.getProperty(id);\n if (property != null){\n displayProperty(property);\n } \n else {\n showErrorAndExit();\n } \n }\n else {\n showErrorAndExit();\n }\n}", "title": "" }, { "docid": "c47d16f33e55e49edfa8286e458126e5", "score": "0.503486", "text": "function getProperties() {\n $http\n .get('http://localhost:8080/api/properties')\n .then(function(res){\n vm.all = (res.data.properties);\n }, function(err){\n console.log(err);\n });\n }", "title": "" }, { "docid": "f877c9ceb9e8188dfe76a9dd266f5559", "score": "0.50263244", "text": "function displayProperty(property){\n removeMiniatureImages();\n \n document.getElementById('propertyId').value = property.id;\n document.getElementById('main-image').src = property.images[0];\n document.getElementById(\"price\").innerHTML = property.price + ' €'; \n document.getElementById('likes').innerHTML = property.likes; \n document.getElementById(\"year\").innerHTML = property.year;\n document.getElementById(\"description\").innerHTML = property.description;\n document.getElementById(\"address\").innerHTML = property.address + '. ' + property.city + ' (' + property.region + ')';\n document.getElementById(\"numberOfBedrooms\").innerHTML = property.numberOfBedrooms + ' habitaciones';\n\n addMiniatureImages(property.images);\n}", "title": "" }, { "docid": "36f4913209b18151ab01136597e55e90", "score": "0.49876773", "text": "async function main() {\n try {\n var url = \"properties\";\n var method = \"GET\";\n var headers = {\n \"Content-Type\": \"application/json\"\n };\n\n var res = await fetch(url, {\n method: method,\n headers: headers\n });\n\n if (!res.ok) {\n throw Error(res.statusText);\n }\n\n buildPropertyList(await res.json());\n } catch (e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "94d0d2bd29348556b8d9bff60f6a6df1", "score": "0.49867845", "text": "populateResults() {\n let properties = this.main.databaseMisc.propertiescorrectness.split(\"|\");\n let propertyName;\n\n for(const property of properties) {\n propertyName = property.split(\".\")[0];\n\n if(this.requestedTreeProperties.includes(propertyName)) { // Tree property\n this.treePropertyResults.push(property);\n }\n else { // Node property\n this.nodePropertyResults.push(property);\n }\n }\n }", "title": "" }, { "docid": "4449eb29054f1ee350abc736f1d944c2", "score": "0.49741784", "text": "async function getPropertyInfo(propertyId) {\n return new Promise((resolve) => {\n if (propertyId) {\n var req = unirest(\"GET\", config.RealtorConfig.endpoint.property_details);\n\n req.query({\n property_id: propertyId,\n });\n req.header = req.headers(setRapidApiHeader());\n\n req.end(async function (res) {\n if (res.error) {\n console.log(\"error\");\n resolve(null);\n }\n console.log(\"success\");\n if (res.body && res.body.properties && res.body.properties.length > 0) {\n const resp = {\n year_built: res.body.properties[0].year_built || res.body.properties[0].public_records[0].year_built,\n price: res.body.properties[0].price,\n building_size: res.body.properties[0].building_size.size || res.body.properties[0].public_records[0].building_sqft,\n };\n resolve(resp);\n }\n });\n } else {\n resolve(null);\n }\n });\n}", "title": "" }, { "docid": "211d951e207987d4ae25acc9380d3a2d", "score": "0.4968027", "text": "static get properties() {\n return {\n hotelslist: {\n type: Array,\n value: []\n }\n };\n }", "title": "" }, { "docid": "89118366a10216801aecf95a0915d37f", "score": "0.49578166", "text": "async loadpropertyView() {\n this.setLoader();\n this.wait(\"#container\");\n try {\n import(\"./subcomp/property-view.js\");\n const page = 1;\n const limit = 12;\n\n const res = await axios.get(`${this.host}/property/all/${limit}/${page}`);\n\n if (res.data.length < 1) {\n this._qs(\"#container\").innerHTML = this.notFound;\n } else {\n this._qs(\"#container\").innerHTML = \"\";\n res.data.forEach((item) => {\n this._qs(\"#container\").innerHTML += `\n <property-view \n id=\"${item._id}\"\n data-type=\"${\n this.state.propertyType != undefined\n ? this.state.propertyType[item.property_type_id]\n : undefined\n }\"\n data-data=\"${this.encode(item)}\"\n >\n </property-view>\n `;\n });\n this._qs(\"#pagination\").innerHTML = this.pagination;\n }\n } catch (err) {\n console.log(err);\n this.unwait(\"#container\");\n }\n this.stopLoader();\n }", "title": "" }, { "docid": "76fd0f4f6ca226d108d8ae6f0b529840", "score": "0.49101427", "text": "function printProperties(results) {\n if (results && !results.error) {\n var properties = results.items;\n for (var i = 0, property; property = properties[i]; i++) {\n console.log('Account Id: ' + property.accountId);\n console.log('Property Id: ' + property.id);\n console.log('Property Name: ' + property.name);\n console.log('Property Profile Count: ' + property.profileCount);\n console.log('Property Industry Vertical: ' + property.industryVertical);\n console.log('Property Internal Id: ' + property.internalWebPropertyId);\n console.log('Property Level: ' + property.level);\n if (property.websiteUrl) {\n console.log('Property URL: ' + property.websiteUrl);\n }\n\n console.log('Created: ' + property.created);\n console.log('Updated: ' + property.updated);\n }\n }\n }", "title": "" }, { "docid": "9197f999543c85349f56698c2ca5aeb8", "score": "0.4898503", "text": "init() {\n this.property = this.prop(\"property\");\n\n this.importantProperty = this.prop('star');\n\n this.property.imagesList = this.property.images.map(image => {\n return {\n image: window.isMobile ? image.image_mobile : image.image,\n link: propertyUrl(this.property),\n }\n });\n\n this.property.phoneNumber = this.phoneNumber = this.propertyPhoneNumber();\n }", "title": "" }, { "docid": "0b94c121afe1a2c4cc9975dafecdb14c", "score": "0.48840466", "text": "loadProperties() {\n let okitJson = this.getOkitJson();\n let me = this;\n $(jqId(PROPERTIES_PANEL)).load(\"propertysheets/remote_peering_connection.html\", () => {\n // Build Dynamic Routing Gateways\n this.getJsonView().loadDrgsSelect('drg_id');\n // this.loadDynamicRoutingGateways('drg_id');\n // Regions\n let region_select = $(jqId('peer_region_name'));\n $(region_select).empty();\n region_select.append($('<option>').attr('value', '').text(''));\n for (const region of okitOciData.getRegions()) {\n region_select.append($('<option>').attr('value', region.id).text(region.display_name));\n }\n // Load Sheet\n loadPropertiesSheet(me.artefact);\n });\n }", "title": "" }, { "docid": "b421cd79201084ba4d15a5cbb15f2bdf", "score": "0.48475048", "text": "function fetchCrops() {\n\tcropList = [];\n\n\tvar season = seasons[options.season];\n\n\tfor (var i = 0; i < season.crops.length; i++) {\n\t if ((options.seeds.pierre && season.crops[i].seeds.pierre != 0) ||\n\t \t(options.seeds.joja && season.crops[i].seeds.joja != 0) ||\n\t \t(options.seeds.special && season.crops[i].seeds.special != 0)) {\n\t \tcropList.push(JSON.parse(JSON.stringify(season.crops[i])));\n\t \tcropList[cropList.length - 1].id = i;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "654bdf53d4b362e51bab47af5a33ac80", "score": "0.48442417", "text": "function getPropertyValues( property, julianDates ) {\n return julianDates.map(function( julianDate ) {\n return property.getValue( julianDate );\n });\n }", "title": "" }, { "docid": "75a4b49ee6c1f86d05b76ecf275994a5", "score": "0.48324716", "text": "function loadData() {\n $('#propertiesList').empty();\n dbHandler.dataBase.transaction(function (tx) {\n tx.executeSql(`SELECT Properties.propertyRef, Properties.monthFee, Properties.bedQty, Properties.propertyType, Properties.propertyRef, Properties.postcode,\n Properties.furnitureType, Properties.notes, Properties.createdOn, Properties.postedBy, Properties.avalabilityDate, Propertyimages.imgPath FROM Properties\n INNER JOIN Propertyimages ON Properties.propertyRef = Propertyimages.postRef `, [], function (tx, results) {\n var len = results.rows.length, i;\n var list=\"\";\n for (i = 0; i < len; i++){\n $('#propertiesList').append(`\n <li>\n <a onClick=\"fullDetails(${ results.rows.item(i).propertyRef})\">\n <div><img src=\"${results. rows.item(i).imgPath}\" ></div>\n <h2><strong>£ ${ results.rows.item(i).monthFee} Pcm </strong></h2>\n <p>${ flatType (results.rows.item(i).bedQty)} ${ results.rows.item(i).propertyType} to rent in ${ results.rows.item(i).postcode}</p>\n <p>${ results.rows.item(i).furnitureType}</p>\n <p>${ results.rows.item(i).notes}</p>\n <p>Listed on <strong> ${ results.rows.item(i).createdOn} by ${ results.rows.item(i).postedBy} </strong> </p>\n <p class=\"ui-li-aside\"><strong><a href=\"\"> Available ${ results.rows.item(i).avalabilityDate}</strong></a></p>\n </a>\n </li>`).listview('refresh');\n }\n }, null);\n }); \n }", "title": "" }, { "docid": "218300d77ba5935cd0f61d3b1cd93c78", "score": "0.48281854", "text": "function getProduct() {\n var listPr = getPrFromLocal();\n if (listPr.length > 0) {\n for (var i = 0; i < listPr.length; i++) {\n getPrFromServer(listPr[i].prid, bindingPrById, listPr[i].total);\n }\n }\n else {\n //\n }\n}", "title": "" }, { "docid": "113c01619b170e70d5ab71c5abea2678", "score": "0.4799953", "text": "_find(bookInfos, property) {\n return bookInfos.map(bi => bi.volumeInfo[property]).find(p => p);\n }", "title": "" }, { "docid": "93cb238ead61bf12c65a9fa66de873f0", "score": "0.47844392", "text": "function showResults(thePropertyToShow){\n var titleList = \"\";\n $.each(thePropertyToShow, function(index, value){\n titleList += '<p>' + value.Title + '</p>';\n console.log(value.Title);\n });\n $('#search-results').html('');\n $('#search-results').append(titleList);\n }", "title": "" }, { "docid": "f00ad8e715a6b0f91938c0b943939ce8", "score": "0.47735813", "text": "function retrieveAllListProperties() {\r\n\r\n var clientContext = new SP.ClientContext(appweburl);\r\n var siteContext = new SP.AppContextSite(clientContext, hostweburl);\r\n var oWebsite = siteContext.get_web();\r\n this.collList = oWebsite.get_lists();\r\n\r\n clientContext.load(collList, 'Include(Title, Id)');\r\n\r\n clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededAllListProperties), Function.createDelegate(this, this.onQueryFailedAllListProperties));\r\n}", "title": "" }, { "docid": "248cff77fbbabe62ed4fce3a9b64bd40", "score": "0.47636726", "text": "function createPropSymbols(data, map){\r\n //create marker options\r\n var geojsonMarkerOptions = {\r\n radius: 5,\r\n fillColor: \"#DAA520\",\r\n color: \"#FFFFFF\",\r\n weight: .80,\r\n opacity: 1,\r\n fillOpacity: .85\r\n\t\t};\r\n //add selection menu for years\r\n let controlLayers = L.control.layers().addTo(map);\r\n for (let year=2012; year<=2018; year++){\r\n let attribute = \"YR\" + year;\r\n \t//create a Leaflet GeoJSON layer and add it to the map\r\n let layer = L.geoJson(data, {\r\n pointToLayer: function (feature, latlng) {\r\n var attValue = Number(feature.properties[attribute]);\r\n geojsonMarkerOptions.radius = calcPropRadius(attValue);\r\n //create circle markers\r\n return L.circleMarker(latlng, geojsonMarkerOptions).bindPopup(feature.properties.COUNTY_NAM + \"<br />\" + year + \" Housing Unit Totals: \" + attValue);\r\n }\r\n }).addTo(map);\r\n controlLayers.addBaseLayer(layer, year);\r\n }\r\n //timeline();\r\n}", "title": "" }, { "docid": "ae3d65207738f82284d2bb68b849ec68", "score": "0.47564825", "text": "function fillProperties() {\n var enter = new Property('enter', 'enter', 'Costa Rica', 'right', 'property1', 'url(img/img_costa_rica.jpg)');\n var property1 = new Property('property', 'property1', 'Avenida Central', 'right', 'property2', 'url(img/av_central2.jpg)', 50, 45, 50, 25, 05, 15, 45, 125, 250, 400);\n this.properties['enter'] = enter;\n this.properties['property1'] = property1;\n\n var property2 = new Property('property', 'property2', 'Volcán Arenal', 'right', 'property3', 'url(img/costaRica2.jpg)', 60, 55, 50, 25, 06, 20, 55, 150, 300, 480);\n this.properties['property2'] = property2;\n\n\n\n var property3 = new Property('property', 'property3', 'Teatro Nacional', 'right', 'property4', 'url(img/costaRica3.jpg)', 75, 70, 75, 40, 08, 25, 70, 200, 400, 640);\n this.properties['property3'] = property3;\n\n\n\n var property4 = new Property('property', 'property4', 'Zarcero', 'right', 'hotChair1', 'url(img/costaRica4.jpg)', 85, 75, 75, 40, 09, 25, 80, 225, 450, 720);\n this.properties['property4'] = property4;\n\n var hotChair1 = new Property('hotChair', 'hotChair1', 'Silla Caliente', 'down', 'property6');\n this.properties['hotChair1'] = hotChair1;\n var property5 = new Property('property', 'property5', 'Esferas de Costa Rica', 'up', 'enter', 'url(img/costaRica5.jpg)', 105, 95, 100, 50, 11, 35, 100, 275, 550, 880);\n this.properties['property5'] = property5;\n\n\n\n var property6 = new Property('property', 'property6', 'Museo de los niños', 'down', 'property8', 'url(img/costaRica6.jpg)', 115, 105, 100, 50, 12, 35, 110, 300, 600, 960);\n this.properties['property6'] = property6;\n\n\n\n var property7 = new Property('property', 'property7', 'Universidad de Costa Rica', 'up', 'property5', 'url(img/costaRica7.jpg)', 135, 120, 150, 75, 15, 45, 135, 375, 750, 1200);\n this.properties['property7'] = property7;\n\n\n\n var property8 = new Property('property', 'property8', 'Estadio Nacional', 'down', 'cave', 'url(img/costaRica8.jpg)', 145, 130, 150, 75, 16, 50, 145, 400, 800, 1280);\n this.properties['property8'] = property8;\n\n var cave = new Property('cave', 'cave', 'Cueva de la icnoransia', 'left', 'property12');\n this.properties['cave'] = cave;\n\n var property9 = new Property('property', 'property9', 'Fortín de Heredia', 'left', 'hotChair2', 'url(img/costaRica9.jpg)', 160, 145, 175, 90, 18, 55, 160, 450, 900, 1440);\n this.properties['property9'] = property9;\n\n var hotChair2 = new Property('hotChair', 'hotChair2', 'Silla Caliente', 'up', 'property7');\n this.properties['hotChair2'] = hotChair2;\n\n var property10 = new Property('property', 'property10', 'Monumento Nacional', 'left', 'property9', 'url(img/costaRica10.jpg)', 170, 155, 175, 90, 20, 60, 180, 500, 1000, 1600);\n this.properties['property10'] = property10;\n\n\n var property11 = new Property('property', 'property11', 'Casa de Gobierno', 'left', 'property10', 'url(img/costaRica11.jpg)', 190, 170, 200, 100, 23, 70, 205, 575, 1150, 1840);\n this.properties['property11'] = property11;\n\n var property12 = new Property('property', 'property12', 'Cerro Chirripó', 'left', 'property11', 'url(img/costaRica12.jpg)', 200, 180, 200, 100, 25, 75, 225, 625, 1250, 2000);\n\n\n this.properties['property12'] = property12;\n\n\n\n}", "title": "" }, { "docid": "18730e6773e77565688a1e8a4a30c844", "score": "0.47473273", "text": "function parseProperties(dom) {\n // extract properties\n const properties = [];\n const currentQs = {};\n const currentProperties = {};\n const elems_propsTitle = dom.window.document.querySelectorAll(\".a-size-base\");\n\n // parse option link\n const parseOptionLink = (link, qsName) => {\n let parsedUrl;\n\n try {\n parsedUrl = url.parse(link);\n } catch (error) {\n return false;\n }\n\n // trying to get querystring value\n const qs = querystring.parse(parsedUrl.query);\n const qsPropertyName = `mv_${qsName}`;\n\n const result = {};\n\n if (qs[qsPropertyName] !== void 0) {\n result.qsValue = qs[qsPropertyName];\n }\n\n // trying to get asin\n const regexResult = /[a-z0-9]{10}/i.exec(parsedUrl.pathname);\n\n if (regexResult !== null) {\n result.asin = regexResult[0];\n }\n\n return result;\n };\n\n // trying to find property querystring name\n // in \"mv_size_name\" - size_name is qs name\n const getQsName = elem_container => {\n const optionsLinks = [];\n\n // get all options links\n if (elem_container.classList.contains(\"a-unordered-list\")) {\n for (const elem_option of elem_container.children) {\n const elem_link = elem_option.querySelector(\"a\");\n\n if (elem_link !== null) {\n optionsLinks.push(elem_link.href);\n }\n }\n } else if (elem_container.classList.contains(\"a-dropdown-container\")) {\n for (const elem_option of elem_container.firstElementChild.children) {\n const elem_link = elem_option.querySelector(\"a\");\n optionsLinks.push(elem_option.value);\n }\n }\n\n // parse them and find mv_* value that changes most of the time\n const changesCounter = {};\n const prevValues = {};\n\n for (const link of optionsLinks) {\n let parsedUrl;\n\n try {\n parsedUrl = url.parse(link);\n } catch (error) {\n return false;\n }\n\n const qs = querystring.parse(parsedUrl.query);\n\n for (const [qsName, qsValue] of Object.entries(qs)) {\n if (qsName.startsWith(\"mv_\") === false) {\n continue;\n }\n\n if (prevValues[qsName] !== void 0 && prevValues[qsName] !== qsValue) {\n if (changesCounter[qsName] === void 0) {\n changesCounter[qsName] = 2;\n } else {\n changesCounter[qsName] += 1;\n }\n }\n\n prevValues[qsName] = qsValue;\n }\n }\n\n // find biggest changes value\n const biggestChanges = Object.entries(changesCounter).reduce(\n (accum, [key, value]) => {\n if (value > accum.value) {\n accum.key = key;\n accum.value = value;\n }\n\n return accum;\n },\n { key: void 0, value: 0 }\n );\n\n if (biggestChanges.key !== void 0) {\n return biggestChanges.key.slice(3);\n } else {\n return false;\n }\n };\n\n // extract property data\n for (const elem of elems_propsTitle) {\n let propTitle = elem.textContent.trim();\n\n if (propTitle[propTitle.length - 1] !== \":\") {\n continue;\n }\n\n const elem_propValue = elem.nextElementSibling;\n let propValue;\n\n if (\n elem_propValue !== null &&\n elem_propValue.classList.contains(\"a-size-base\") === true &&\n elem_propValue.classList.contains(\"a-text-bold\") === true\n ) {\n propValue = elem_propValue.textContent.trim();\n\n if (propValue.length === 0) {\n propValue = void 0;\n }\n }\n\n propTitle = propTitle.slice(0, -1);\n\n const options = [];\n\n const prop = {\n title: propTitle,\n options\n };\n\n properties.push(prop);\n\n let elem_propOptions = elem.parentElement.nextElementSibling;\n\n // get querystring name\n const qsName = getQsName(elem_propOptions);\n\n prop.qsName = qsName;\n\n // extract property options\n if (elem_propOptions.classList.contains(\"a-unordered-list\")) {\n // unordered list\n for (const elem of elem_propOptions.children) {\n if (elem.querySelector(\"img\") !== null) {\n // button is image\n const elem_link = elem.querySelector(\"a\");\n\n if (elem_link === null) {\n continue;\n }\n\n const optionLinkDetails = parseOptionLink(elem_link.href, qsName);\n\n if (optionLinkDetails.qsValue === false) {\n continue;\n }\n\n options.push({\n value: \"<img>\",\n qsValue: optionLinkDetails.qsValue,\n asin: optionLinkDetails.asin\n });\n\n // img is selected\n if (elem.querySelector(\".a-button-selected\") !== null) {\n currentQs[qsName] = optionLinkDetails.qsValue;\n currentProperties[qsName] = propValue || \"<img>\";\n }\n } else {\n // usual button\n const elem_button = elem.querySelector('[role=\"button\"]');\n\n if (elem_button === null) {\n continue;\n }\n\n const elem_link = elem.querySelector(\"a\");\n\n if (elem_link === null) {\n continue;\n }\n\n const optionLinkDetails = parseOptionLink(elem_link.href, qsName);\n\n if (optionLinkDetails.qsValue === false) {\n continue;\n }\n\n const propertyValue = elem_button.textContent.trim();\n\n // if (propertyValue === LOWEST_OFFER_EACH) {\n // continue;\n // }\n\n options.push({\n value: propertyValue,\n qsValue: optionLinkDetails.qsValue,\n asin: optionLinkDetails.asin\n });\n\n // button is selected\n if (elem.querySelector(\".a-button-selected\") !== null) {\n currentQs[qsName] = optionLinkDetails.qsValue;\n currentProperties[qsName] = propValue || propertyValue;\n }\n }\n }\n } else if (elem_propOptions.classList.contains(\"a-dropdown-container\")) {\n // dropdown container\n elem_propOptions = elem_propOptions.firstElementChild;\n\n for (const elem of elem_propOptions.children) {\n const propertyValue = elem.textContent.trim();\n\n // if (propertyValue === LOWEST_OFFER_EACH) {\n // continue;\n // }\n\n const optionLinkDetails = parseOptionLink(elem.value, qsName);\n\n if (optionLinkDetails.qsValue === false) {\n continue;\n }\n\n options.push({\n value: propertyValue,\n qsValue: optionLinkDetails.qsValue,\n asin: optionLinkDetails.asin\n });\n\n // option is selected\n if (elem.selected === true) {\n currentQs[qsName] = optionLinkDetails.qsValue;\n currentProperties[qsName] = propValue || propertyValue;\n }\n }\n }\n }\n\n return {\n properties,\n currentQs,\n currentProperties\n };\n}", "title": "" }, { "docid": "0e81ef03cf840eb4996f80718483e311", "score": "0.47077608", "text": "function getIdProperty( id, property )\r\n{\r\n\r\n\treturn document.all[id].style[property];\r\n\r\n}", "title": "" }, { "docid": "11bdfe514f08cab4185de66ef0a61053", "score": "0.4693291", "text": "function loadProperties() {\n\n // Show the loading spinner.\n spinner.classList.add('is-active');\n\n clearTimeout(timeoutHandler);\n timeoutHandler = setTimeout(() => {\n \n // For retrieving data, use a larger (2x) bounds than the actual map bounds,\n // which will allow for some movement of the map, or one level of zooming \n // out, without needed to load new data.\n const ne = map.getBounds().getNorthEast();\n const sw = map.getBounds().getSouthWest();\n const extendedLat = ne.lat() - sw.lat();\n const extendedLng = ne.lng() - sw.lng();\n dataBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(sw.lat() - extendedLat, sw.lng() - extendedLng),\n new google.maps.LatLng(ne.lat() + extendedLat, ne.lng() + extendedLng)\n );\n\n // Build the querystring of parameters to use in the URL given to \n // map.data.loadGeoJson, which consists of the various form field \n // values and the current bounding box.\n const params = {\n ne: dataBounds.getNorthEast().toUrlValue(),\n sw: dataBounds.getSouthWest().toUrlValue()\n };\n Array.prototype.forEach.call(sliders, (item) => params[item.id] = item.value);\n const types = document.querySelectorAll('input[name=\"property-types\"]:checked');\n params['property-types'] = Array.prototype.map.call(types, (item) => item.value).join(',');\n const url = window.propertiesGeoJsonUrl + '?' + Object.keys(params).map((k) => k + '=' + params[k]).join('&');\n\n map.data.loadGeoJson(url, null, (features) => {\n\n // Set the value in the \"Total properties: x\" text.\n document.querySelector('#total-text').innerHTML = features.length;\n // Hide the loading spinner.\n spinner.classList.remove('is-active');\n // Clear the previous marker cluster.\n if (markerCluster !== null) {\n markerCluster.clearMarkers();\n }\n\n // Build an array of markers, one per property.\n const markers = features.map((feature) => {\n\n const marker = new google.maps.Marker({\n position: feature.getGeometry().get(0),\n icon: window.imagePath + 'marker.png'\n });\n\n // Show the property's details in the infowindow when \n // the marker is clicked.\n marker.addListener('click', () => {\n const position = feature.getGeometry().get();\n let content = `\n <div>\n <img src=\"https://maps.googleapis.com/maps/api/streetview?size=200x200&location=${position.lat()},${position.lng()}&key=${window.apiKey}\">\n <h2>${feature.getProperty('address')}</h2>\n <p>${feature.getProperty('description')}</p>\n <ul>\n <li>Bedrooms: ${feature.getProperty('bedrooms')}</li>\n <li>Bathrooms: ${feature.getProperty('bathrooms')}</li>\n <li>Car spaces: ${feature.getProperty('car_spaces')}</li>\n `;\n const nearestSchool = feature.getProperty('nearest_school');\n if (nearestSchool) {\n content += `<li>Nearest school: ${nearestSchool} (${feature.getProperty('nearest_school_distance')} kms)</li>`;\n }\n const nearestTrainStation = feature.getProperty('nearest_train_station');\n if (nearestTrainStation) {\n content += `<li>Nearest train station: ${nearestTrainStation} (${feature.getProperty('nearest_train_station_distance')} kms)</li>`;\n }\n content += '</ul></div>';\n infoWindow.setContent(content);\n infoWindow.setPosition(position);\n infoWindow.open(map); \n });\n\n return marker;\n });\n \n // Build the marker clusterer.\n markerCluster = new MarkerClusterer(map, markers, {\n styles: [1, 2, 3].map(i => ({\n url: window.imagePath + `cluster${i}.png`, \n width: 24+(24*i), \n height: 24+(24*i), \n textColor: '#fff', \n textSize: 12+(4*i)\n }))\n });\n }); \n\n }, 100);\n }", "title": "" }, { "docid": "d9878c5df5175fbcf37f68e50932d978", "score": "0.46916008", "text": "function minutelyWeather(propID, minuteID) {\n\t\t\t\t\treturn darksky.weather.minutely.data[minuteID][propID];\n\t\t\t\t}", "title": "" }, { "docid": "0eb6dcdc3294a3440e7933a785219d40", "score": "0.4680645", "text": "static get properties() {\n return {\n foo: String,\n whales: Number,\n options: Object,\n query: String,\n url: String\n }\n }", "title": "" }, { "docid": "0c91df77203fd53e1c605b1d365361e1", "score": "0.46722016", "text": "getDetails() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n try {\n // Simulate details fetching\n // normally we will get details by id, but here i'm just searching in array\n let data = this.loadDetails(this);\n if (data && data.offer[0]) {\n resolve(new OfferProperties(data.offer[0].properties));\n } else {\n resolve(null);\n }\n } catch(e) {\n reject(e);\n }\n }, 1000);\n\n });\n }", "title": "" }, { "docid": "b0952a6236caddd3c83697580154dd09", "score": "0.46620545", "text": "fetchEhProperties() {\n return fetch('/ehproperties')\n .then(res => {\n return res.json();\n })\n .then(allProperties => {\n const attractions = [];\n Object.entries(allProperties).forEach(([id, property]) => {\n let attract = property;\n attractions.push(attract);\n });\n return attractions;\n });\n }", "title": "" }, { "docid": "0b520065ee0a93be9452b1214f164793", "score": "0.4660773", "text": "function queryStopsProperty(stopPageId, loadId) {\n $(\"#div_datasource_html\").hide();\n $(\"#div_propertiesVo_html\").hide();\n $(\"#div_customized_html\").hide();\n $(\"#div_stops_checkpoint_html\").hide();\n $(\"#div_del_last_reload\").hide();\n $(\"#div_properties_example_html\").hide();\n isShowUpdateStopsName(false);\n ajaxRequest({\n type: \"POST\",\n url: \"/stops/queryIdInfo\",\n async: true,\n data: {\"stopPageId\": stopPageId, \"fid\": loadId},\n success: function (data) {\n var dataMap = JSON.parse(data);\n $('#process_property_inc_loading').hide();\n if (200 === dataMap.code) {\n var stopsVoData = dataMap.stopsVo;\n stopsId = stopsVoData.id;\n if (stopsVoData) {\n //Remove the timer if successful\n window.clearTimeout(timerPath);\n\n // ----------------------- baseInfo start -----------------------\n $('#input_flowStopsVo_id').val(stopsVoData.id);\n $('#input_flowStopsVo_pageId').val(stopsVoData.pageId);\n $('#span_stopsVo_name').text(stopsVoData.name);\n $('#span_processStopVo_description').text(stopsVoData.description);\n $('#span_processStopVo_groups').text(stopsVoData.groups);\n $('#span_flowStopsVo_bundle').text(stopsVoData.bundel);\n $('#span_flowStopsVo_version').text(stopsVoData.version);\n $('#span_processStopVo_owner').text(stopsVoData.owner);\n $('#span_processStopVo_crtDttmString').text(stopsVoData.crtDttmString);\n if (isExample) {\n $('#btn_show_update').hide();\n }\n // ----------------------- baseInfo end -----------------------\n\n // ----------------------- AttributeInfo start -----------------------\n $(\"#div_properties_example_table\").html(\"\");\n var tbody_example = document.createElement(\"tbody\");\n // propertiesVo\n var propertiesVo = stopsVoData.propertiesVo;\n if (propertiesVo && propertiesVo.length > 0) {\n var tbody = document.createElement(\"tbody\");\n for (var y = 0; y < propertiesVo.length; y++) {\n if (!propertiesVo[y]) {\n continue;\n }\n var propertyVo = propertiesVo[y];\n var propertyVo_id = propertyVo.id;\n var propertyVo_name = propertyVo.name;\n var propertyVo_description = propertyVo.description;\n var propertyVo_displayName = propertyVo.displayName;\n var propertyVo_customValue = (!propertyVo.customValue || customValue == 'null') ? '' : propertyVo.customValue;\n var propertyVo_allowableValues = propertyVo.allowableValues;\n var propertyVo_isSelect = propertyVo.isSelect;\n var propertyVo_required = propertyVo.required;\n var propertyVo_sensitive = propertyVo.sensitive;\n var propertyVo_isLocked = propertyVo.isLocked;\n var propertyVo_example = propertyVo.example;\n\n // create tr and td\n var tr_i = document.createElement(\"tr\");\n tr_i.setAttribute('class', 'trTableStop');\n var td_0 = document.createElement(\"td\");\n var td_1 = document.createElement(\"td\");\n var td_2 = document.createElement(\"td\");\n var td_3 = document.createElement(\"td\");\n\n // property name\n var spanDisplayName = document.createElement('span');\n spanDisplayName.textContent = propertyVo_name;\n // property description\n var img = document.createElement(\"img\");\n img.setAttribute('src', web_drawingBoard + '/img/descIcon.png');\n img.style.cursor = \"pointer\";\n img.setAttribute('title', '' + propertyVo_description + '');\n // property value\n var property_value_obj;\n //If it is greater than 4 and isSelect is true, there is a drop-down box\n if (propertyVo_allowableValues.length > 4 && propertyVo_isSelect) {\n propertyVo_allowableValues = propertyVo_allowableValues;\n var selectValue = JSON.parse(propertyVo_allowableValues);\n var selectInfo = JSON.stringify(selectValue);\n var strs = selectInfo.split(\",\");\n\n property_value_obj = document.createElement('select');\n property_value_obj.style.height = \"32px\";\n property_value_obj.setAttribute('id', '' + propertyVo_name + '');\n property_value_obj.setAttribute('onChange', \"updateStopsProperty('\" + propertyVo_id + \"','\" + propertyVo_name + \"','select')\");\n property_value_obj.setAttribute('class', 'form-control');\n var optionDefault = document.createElement(\"option\");\n optionDefault.value = '';\n optionDefault.innerHTML = '';\n optionDefault.setAttribute('selected', 'selected');\n property_value_obj.appendChild(optionDefault);\n //Loop to assign value to select\n for (i = 0; i < strs.length; i++) {\n var option = document.createElement(\"option\");\n option.style.backgroundColor = \"#DBDBDB\";\n var option_value = strs[i].replace(\"\\\"\", \"\").replace(\"\\\"\", \"\").replace(\"\\[\", \"\").replace(\"\\]\", \"\");\n option.value = option_value;\n option.innerHTML = option_value;\n //Sets the default selection\n if (strs[i].indexOf('' + propertyVo_customValue + '') != -1) {\n option.setAttribute('selected', 'selected');\n }\n property_value_obj.appendChild(option);\n }\n } else {\n property_value_obj = document.createElement('input');\n property_value_obj.setAttribute('class', 'form-control');\n property_value_obj.setAttribute('id', '' + propertyVo_id + '');\n property_value_obj.setAttribute('name', '' + propertyVo_name + '');\n property_value_obj.setAttribute('onclick', 'openUpdateStopsProperty(this,false,'+ JSON.stringify(propertyVo.language) +','+propertyVo.isLocked+' )');\n property_value_obj.setAttribute('locked', propertyVo_isLocked);\n property_value_obj.setAttribute('data', propertyVo_customValue);\n property_value_obj.setAttribute('readonly', 'readonly');\n property_value_obj.style.cursor = \"pointer\";\n property_value_obj.style.background = \"rgb(245, 245, 245)\";\n property_value_obj.setAttribute('value', '' + propertyVo_customValue + '');\n //Port uneditable\n if (propertyVo_sensitive){\n property_value_obj.setAttribute('type', 'password');\n }\n if (\"outports\" == propertyVo_name || \"inports\" == propertyVo_name) {\n property_value_obj.setAttribute('disabled', 'disabled');\n }\n if (propertyVo_required) {\n property_value_obj.setAttribute('data-toggle', 'true');\n }\n $(\"#div_datasource_html\").show();\n }\n // Is required\n var spanFlag = document.createElement('span');\n if (propertyVo_required) {\n spanFlag.setAttribute('style', 'color:red');\n spanFlag.textContent = '*';\n }\n\n // set td style\n td_0.style.width = \"60px\";\n td_1.style.width = \"25px\";\n\n // append td content\n td_0.appendChild(spanDisplayName);\n td_1.appendChild(img);\n td_2.appendChild(property_value_obj);\n td_3.appendChild(spanFlag);\n\n // append tr content\n tr_i.appendChild(td_0);\n tr_i.appendChild(td_1);\n tr_i.appendChild(td_2);\n tr_i.appendChild(td_3);\n tbody.appendChild(tr_i);\n\n if (propertyVo_example) {\n var tbody_example_tr_i = document.createElement(\"tr\");\n var tbody_example_td_0 = document.createElement(\"td\");\n var tbody_example_td_1 = document.createElement(\"td\");\n var tbody_example_td_2 = document.createElement(\"td\");\n var tbody_example_td_2_obj = document.createElement('input');\n tbody_example_td_0.innerHTML = td_0.outerHTML;\n tbody_example_td_1.innerHTML = td_1.outerHTML;\n tbody_example_td_0.style.width = \"60px\";\n tbody_example_td_1.style.width = \"25px\";\n tbody_example_td_2_obj.setAttribute('class', 'form-control');\n tbody_example_td_2_obj.setAttribute('value', '' + propertyVo_example + '');\n tbody_example_td_2_obj.setAttribute('readonly', 'readonly');\n tbody_example_td_2.appendChild(tbody_example_td_2_obj);\n tbody_example_tr_i.appendChild(tbody_example_td_0);\n tbody_example_tr_i.appendChild(tbody_example_td_1);\n tbody_example_tr_i.appendChild(tbody_example_td_2);\n tbody_example.appendChild(tbody_example_tr_i);\n if (propertyVo_sensitive){\n tbody_example_td_2_obj.setAttribute('type', 'password');\n }\n }\n }\n if (isExample) {\n $('#datasourceSelectElement').attr('disabled', 'disabled');\n }\n $(\"#div_propertiesVo_table\").html(tbody);\n $(\"#div_propertiesVo_html\").show();\n if (tbody_example.innerHTML) {\n $(\"#div_properties_example_table\").html(tbody_example);\n $(\"#div_properties_example_html\").show();\n }\n }\n\n\n //checkboxCheckpoint\n var checkboxCheckpoint = document.createElement('input');\n checkboxCheckpoint.setAttribute('type', 'checkbox');\n checkboxCheckpoint.setAttribute('id', 'isCheckpoint');\n if (stopsVoData.isCheckpoint) {\n checkboxCheckpoint.setAttribute('checked', 'checked');\n }\n if (isExample) {\n checkboxCheckpoint.setAttribute('disabled', 'disabled');\n }\n checkboxCheckpoint.setAttribute('onclick', 'saveCheckpoints(\"' + stopsVoData.id + '\")');\n $(\"#div_stops_checkpoint_html\").html(\"\");\n $(\"#div_stops_checkpoint_html\").append(checkboxCheckpoint);\n $(\"#div_stops_checkpoint_html\").append('<span>&nbsp;&nbsp;Whether to add Checkpoint</span>');\n $('#div_stops_checkpoint_html').show();\n\n //stopsCustomizedPropertyVoList\n if (stopsVoData.isCustomized) {\n $(\"#div_a_customized_html\").attr(\"href\", \"javascript:openAddStopCustomAttrPage('\" + stopsVoData.id + \"');\");\n $(\"#div_table_customized_html\").html(\"\");\n var tr_default = document.createElement('tr');\n var th_0_default = document.createElement('th');\n var th_1_default = document.createElement('th');\n tr_default.setAttribute(\"style\", \"border: 1px solid #e2e2e2;\");\n th_0_default.setAttribute(\"colspan\", 2);\n th_0_default.setAttribute(\"style\", \"border-bottom: 1px solid #e2e2e2; width: 85px;text-align: center;\");\n th_1_default.setAttribute(\"colspan\", 2);\n th_1_default.setAttribute(\"style\", \"border-bottom: 1px solid #e2e2e2;\");\n tr_default.appendChild(th_0_default);\n tr_default.appendChild(th_1_default);\n $(\"#div_table_customized_html\").append(tr_default);\n var tr_i = \"\";\n if (stopsVoData.stopsCustomizedPropertyVoList && stopsVoData.stopsCustomizedPropertyVoList.length > 0) {\n var stopsCustomizedPropertyVoList = stopsVoData.stopsCustomizedPropertyVoList;\n for (var i = 0; i < stopsCustomizedPropertyVoList.length; i++) {\n tr_i = setCustomizedTableHtml(stopsVoData.pageId, stopsCustomizedPropertyVoList[i], stopsVoData.outPortType);\n $(\"#div_table_customized_html\").append(tr_i);\n }\n }\n $(\"#div_customized_html\").show();\n }\n // datasource\n getDatasourceList(stopsVoData.id, stopsVoData.pageId, stopsVoData.dataSourceVo);\n\n var oldPropertiesVo = stopsVoData.oldPropertiesVo;\n if (oldPropertiesVo && oldPropertiesVo.length > 0) {\n var table = document.createElement(\"table\");\n table.style.borderCollapse = \"separate\";\n table.style.borderSpacing = \"0px 5px\";\n table.style.marginLeft = \"12px\";\n table.style.width = \"97%\";\n var tbody = document.createElement(\"tbody\");\n for (var y = 0; y < oldPropertiesVo.length; y++) {\n var select = document.createElement('select');\n //select.style.width = \"290px\";\n select.style.height = \"32px\";\n select.setAttribute('id', 'old_' + oldPropertiesVo[y].name + '');\n select.setAttribute('class', 'form-control');\n select.setAttribute('disabled', 'disabled');\n var displayName = oldPropertiesVo[y].displayName;\n var customValue = oldPropertiesVo[y].customValue;\n var allowableValues = oldPropertiesVo[y].allowableValues;\n var isSelect = oldPropertiesVo[y].isSelect;\n //Is it required?\n var required = oldPropertiesVo[y].required;\n //If it is greater than 4 and isSelect is true, there is a drop-down box\n if (allowableValues.length > 4 && isSelect) {\n var selectValue = JSON.parse(allowableValues);\n var selectInfo = JSON.stringify(selectValue);\n var strs = selectInfo.split(\",\");\n var optionDefault = document.createElement(\"option\");\n optionDefault.value = '';\n optionDefault.innerHTML = '';\n optionDefault.setAttribute('selected', 'selected');\n select.appendChild(optionDefault);\n //Loop to assign value to select\n for (i = 0; i < strs.length; i++) {\n var option = document.createElement(\"option\");\n option.style.backgroundColor = \"#DBDBDB\";\n option.value = strs[i].replace(\"\\\"\", \"\").replace(\"\\\"\", \"\").replace(\"\\[\", \"\").replace(\"\\]\", \"\");\n option.innerHTML = strs[i].replace(\"\\\"\", \"\").replace(\"\\\"\", \"\").replace(\"\\[\", \"\").replace(\"\\]\", \"\");\n //Sets the default selection\n if (strs[i].indexOf('' + customValue + '') != -1) {\n option.setAttribute('selected', 'selected');\n }\n select.appendChild(option);\n }\n }\n var displayName = document.createElement('input');\n if (required)\n displayName.setAttribute('data-toggle', 'true');\n displayName.setAttribute('class', 'form-control');\n displayName.setAttribute('id', 'old_' + oldPropertiesVo[y].id + '');\n displayName.setAttribute('name', '' + oldPropertiesVo[y].name + '');\n displayName.setAttribute('locked', oldPropertiesVo[y].isLocked);\n // displayName.style.width = \"290px\";\n displayName.setAttribute('readonly', 'readonly');\n displayName.style.cursor = \"pointer\";\n displayName.style.background = \"rgb(245, 245, 245)\";\n customValue = customValue == 'null' ? '' : customValue;\n displayName.setAttribute('value', '' + customValue + '');\n var spanDisplayName = 'span' + oldPropertiesVo[y].displayName;\n var spanDisplayName = document.createElement('span');\n var spanFlag = document.createElement('span');\n spanFlag.setAttribute('style', 'color:red');\n mxUtils.write(spanDisplayName, '' + oldPropertiesVo[y].name + '' + \": \");\n mxUtils.write(spanFlag, '*');\n //Port uneditable\n if (\"outports\" == oldPropertiesVo[y].displayName || \"inports\" == oldPropertiesVo[y].displayName) {\n displayName.setAttribute('disabled', 'disabled');\n }\n\n var img = document.createElement(\"img\");\n img.setAttribute('src', web_drawingBoard + '/img/descIcon.png');\n img.style.cursor = \"pointer\";\n img.setAttribute('title', '' + oldPropertiesVo[y].description + '');\n var tr = document.createElement(\"tr\");\n tr.setAttribute('class', 'trTableStop');\n var td = document.createElement(\"td\");\n td.style.width = \"60px\";\n var td1 = document.createElement(\"td\");\n var td2 = document.createElement(\"td\");\n var td3 = document.createElement(\"td\");\n td3.style.width = \"25px\";\n //Appendchild () appends elements\n td.appendChild(spanDisplayName);\n td3.appendChild(img);\n //This loop is greater than 4 append drop-down, less than 4 default text box\n if (allowableValues.length > 4 && isSelect) {\n td1.appendChild(select);\n } else {\n td1.appendChild(displayName);\n if (required) {\n td2.appendChild(spanFlag);\n }\n }\n tr.appendChild(td);\n tr.appendChild(td3);\n tr.appendChild(td1);\n tr.appendChild(td2);\n tbody.appendChild(tr);\n table.appendChild(tbody);\n }\n var old_data_div = '<div id=\"del_last_reload_div\" style=\"line-height: 27px;margin-left: 10px;font-size: 20px;\">'\n + '<span>last reload data</span>'\n + '<button class=\"btn\" style=\"margin-left: 2px;\" onclick=\"deleteLastReloadData(\\'' + stopsVoData.id + '\\')\"><i class=\"icon-trash\"></i></button>'\n + '</div>';\n table.setAttribute('id', 'del_last_reload_table');\n var attributeInfoDivObj = $(\"#isCheckpoint\").parent();\n attributeInfoDivObj.append(old_data_div);\n attributeInfoDivObj.append(table);\n attributeInfoDivObj.append(\"<hr>\");\n }\n // ----------------------- AttributeInfo end -----------------------\n\n $('#process_property_inc_load_data').show();\n } else {\n $('#process_property_inc_no_data').show();\n }\n } else {\n //STOP attribute query null\n if (!timerPath) {\n timerPath = window.setTimeout(queryStopsProperty(stopPageId, loadId), 500);\n }\n flag++;\n if (flag > 5) {\n window.clearTimeout(timerPath);\n return;\n }\n }\n layer.close(layer.index);\n },\n error: function (request) {\n //alert(\"Jquery Ajax request error!!!\");\n return;\n }\n });\n}", "title": "" }, { "docid": "410d8736384998bf4e784d7a10b93462", "score": "0.46484232", "text": "async getAllPropertyTypes() {\n const response = await fetch(`${remoteURL}/properties`)\n const result = await response.json()\n return result\n }", "title": "" }, { "docid": "ed5c0b7ccfe1ac1615c0443baf19a604", "score": "0.464813", "text": "getByProperty(property, value) {\n\t\tlogHandler.log('Retrieving data that has property ' + property + '=' + value, 0);\n\t\n\t\t// create return object\n\t\tlet returnData = new Array();\n\n\t\t// iterate through all data objects\n\t\tlet dataItem = new Map();\n\t\tfor (dataItem of this.dataStorage.values()) {\n\t\t\tif (dataItem[property] == value) {\n\t\t\t\treturnData.push(dataItem);\n\t\t\t}\n\t\t}\n\n\t\t// return objects from storage\t\n\t\treturn returnData;\n\t}", "title": "" }, { "docid": "9793313d304eacadf30529d114619c47", "score": "0.46453533", "text": "openMortgageModal(mapData, playerDetails) {\n $(\"[data-modal-type=mortgage-properties]\").addClass(\"show-modal\");\n\n this.propertiesForMortgage = [];\n\n // populate list of unmortgaged properties\n for (let square of playerDetails.squares) {\n // ignore if property is already mortgaged\n if (mapData.squares[square].isMortgaged) {\n continue;\n }\n $(\"[data-modal-type=mortgage-properties] [data-my-properties]\")\n .append('<div class=\"mortgage-modal--property\" data-property-id=' + square + '>' + mapData.squares[square].propertyName + '</div>');\n }\n }", "title": "" }, { "docid": "115a33beece977d279a38846c2abc700", "score": "0.46440613", "text": "async getPunksForSale(){\n return punksForSale;\n }", "title": "" }, { "docid": "9eab6f697216c327aba3e4be5b003317", "score": "0.46421945", "text": "function dataFinder(phonesListIndex, jsonDataIndex , listName, fileFormat ) {\n\n var siteUrl = fileFormat.links[jsonDataIndex].link ;\n\n var JsonData = fileFormat.links[jsonDataIndex].price ;\n var JsonDataInt = JsonData.slice(0);\n var ReplaceComma = parseFloat(JsonDataInt.replace(/,/g, ''));\n\n \n listName[phonesListIndex].difference = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n\n listName[phonesListIndex].price = JsonData ;\n // for percent\n \n \n var differenceInPrice = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n \n var percentValue = (parseInt(differenceInPrice) / parseInt(listName[phonesListIndex].normalPrice )) * 100 ;\n\n var roundedPercentValue = Math.round(percentValue) ;\n \n listName[phonesListIndex].percent = roundedPercentValue ;\n\n \n listName[phonesListIndex].linkUrl = siteUrl ;\n\n\n\n\n}", "title": "" }, { "docid": "7f0b3b4cf62e7d26c1c461040764ad29", "score": "0.46400842", "text": "function dataFinder(phonesListIndex, jsonDataIndex , listName, fileFormat ) {\n\n var siteUrl = fileFormat.links[jsonDataIndex].link ;\n\n var JsonData = fileFormat.links[jsonDataIndex].price ;\n var JsonDataInt = JsonData.slice(4);\n var ReplaceComma = parseFloat(JsonDataInt.replace(/,/g, ''));\n\n \n listName[phonesListIndex].difference = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n\n listName[phonesListIndex].price = JsonData ;\n // for percent\n \n \n var differenceInPrice = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n \n var percentValue = (parseInt(differenceInPrice) / parseInt(listName[phonesListIndex].normalPrice )) * 100 ;\n\n var roundedPercentValue = Math.round(percentValue) ;\n \n listName[phonesListIndex].percent = roundedPercentValue ;\n\n \n listName[phonesListIndex].linkUrl = siteUrl ;\n\n\n\n\n}", "title": "" }, { "docid": "7f0b3b4cf62e7d26c1c461040764ad29", "score": "0.46400842", "text": "function dataFinder(phonesListIndex, jsonDataIndex , listName, fileFormat ) {\n\n var siteUrl = fileFormat.links[jsonDataIndex].link ;\n\n var JsonData = fileFormat.links[jsonDataIndex].price ;\n var JsonDataInt = JsonData.slice(4);\n var ReplaceComma = parseFloat(JsonDataInt.replace(/,/g, ''));\n\n \n listName[phonesListIndex].difference = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n\n listName[phonesListIndex].price = JsonData ;\n // for percent\n \n \n var differenceInPrice = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n \n var percentValue = (parseInt(differenceInPrice) / parseInt(listName[phonesListIndex].normalPrice )) * 100 ;\n\n var roundedPercentValue = Math.round(percentValue) ;\n \n listName[phonesListIndex].percent = roundedPercentValue ;\n\n \n listName[phonesListIndex].linkUrl = siteUrl ;\n\n\n\n\n}", "title": "" }, { "docid": "32225f3c694d1866ed0aa9a984616dbf", "score": "0.4637673", "text": "function setRetailYearlyInfo() {\r\n \tvar yearlyInfoList = [];\r\n \tfor (var y = 0; y < $scope.dealInfo/12; y++) {\r\n \t\tvar yearlyData = {};\r\n \t\tyearlyData.year = y+1;\r\n \t\tyearlyData.noOfShops = $scope.retailInfo.shops.children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.retailUnitPriceInfoDtoList= extractServerUnitPrice($scope.retailInfo.shops.children[0],y);\r\n \t\tyearlyData.retailRevenueInfoDtoList = extractServerRevenuePrice($scope.retailInfo.shops.children[0],y);\r\n \t\tyearlyInfoList.push(yearlyData);\r\n \t}\r\n \t$scope.retailInfo.retailYearlyDataInfoDtos = yearlyInfoList;\r\n }", "title": "" }, { "docid": "dd8a1eab2125d6f7266c59d9369b5e36", "score": "0.46351466", "text": "function dataFinder(phonesListIndex, jsonDataIndex , listName, fileFormat ) {\n\n var siteUrl = fileFormat.links[jsonDataIndex].link ;\n\n var JsonData = fileFormat.links[jsonDataIndex].price ;\n var JsonDataInt = JsonData.slice(0,-2);\n var ReplaceComma = parseFloat(JsonDataInt.replace(/,/g, ''));\n\n \n listName[phonesListIndex].difference = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n\n listName[phonesListIndex].price = JsonData ;\n // for percent\n \n \n var differenceInPrice = listName[phonesListIndex].normalPrice - parseInt( ReplaceComma) ;\n \n var percentValue = (parseInt(differenceInPrice) / parseInt(listName[phonesListIndex].normalPrice )) * 100 ;\n\n var roundedPercentValue = Math.round(percentValue) ;\n \n listName[phonesListIndex].percent = roundedPercentValue ;\n\n \n listName[phonesListIndex].linkUrl = siteUrl ;\n\n\n\n\n}", "title": "" }, { "docid": "81ace26025d8f0d2e383ff03e2f41a55", "score": "0.46336517", "text": "function getProperties(endpoint) {\n let ajax = new XMLHttpRequest();\n ajax.addEventListener(\"load\", function () {\n console.log(this);\n cardPopulater(this.response.properties);\n });\n ajax.open(\"GET\", endpoint);\n ajax.responseType = \"json\";\n ajax.send();\n}", "title": "" }, { "docid": "74bb9e83fc5944a30e651a9db1af923b", "score": "0.4626414", "text": "function buildLocationList(data) {\n data.forEach(function (store, i) {\n /**\n * Create a shortcut for `store.properties`,\n * which will be used several times below.\n **/\n var prop = store.properties;\n\n /* Add a new listing section to the sidebar. */\n var listings = document.getElementById(\"listings\");\n var listing = listings.appendChild(\n document.createElement(\"div\")\n );\n\n /* Assign a unique `id` to the listing. */\n listing.id = \"listing-\" + prop.id;\n /* Assign the `item` class to each listing for styling. */\n listing.className = \"item\";\n\n /* Add the link to the individual listing created above. */\n var link = listing.appendChild(document.createElement(\"a\"));\n link.href = \"#\";\n link.className = \"title\";\n link.id = \"link-\" + prop.id;\n link.innerHTML = prop.name;\n\n /* Add details to the individual listing. */\n var details = listing.appendChild(\n document.createElement(\"div\")\n );\n\n var tag = \"\";\n for (let i = 0; i < prop.category.length; i++) {\n tag =\n tag +\n `<span style=\"margin-right: 0.5vh;font-size: 12px;padding: 3px 5px; background-color: #D6D6D6;border-radius: 3px;\">` +\n prop.category[i] +\n `</span>`;\n if (i !== prop.category.length - 1) {\n tag += \" \";\n }\n }\n\n details.innerHTML = `<p>` + tag + `</p>`;\n\n // add the scoring with hearts\n var score = listing.appendChild(document.createElement(\"div\"));\n\n var hearts = \"\";\n var number = prop.score * 10;\n var full_num = Math.floor(number / 10);\n var half_num = score % 10 == 0 ? 0 : 1;\n var no_num = 5 - half_num - full_num;\n var likeButton = \"\";\n\n for (let i = 0; i < full_num; i++) {\n hearts += `<img src=${full_heart} style=\"height: 13px; width: 13px;\">`;\n if (i !== full_num - 1) {\n hearts += \" \";\n }\n }\n hearts += \" \";\n for (let i = 0; i < half_num; i++) {\n hearts += `<img src=${half_heart} style=\"height: 13px; width: 13px;\">`;\n if (i !== half_num - 1) {\n hearts += \" \";\n }\n }\n hearts += \" \";\n for (let i = 0; i < no_num; i++) {\n hearts += `<img src=${no_heart} style=\"height: 13px; width: 13px;\">`;\n if (i !== no_num - 1) {\n hearts += \" \";\n }\n }\n\n // TODO: make likeButton a real button, and handle function\n if (localStorage.getItem(\"user\")) {\n var myID = \"like\" + i;\n if (\n JSON.parse(\n localStorage.getItem(\"restaurants-list\")\n ).find((item) => item._id === store._id)\n ) {\n likeButton += `<span id=${myID}><img src=${minus} id=${store._id} style=\"height: 13px; width: 13px; margin-left: 8px;\" ></span>`;\n } else {\n likeButton += `<span id=${myID}><img src=${add} id=${store._id} style=\"height: 13px; width: 13px; margin-left: 8px;\" ></span>`;\n }\n }\n\n score.innerHTML =\n `<span style=\"margin-right:5px;font-size: 15px;\">` +\n prop.score +\n `</span>` +\n ` ` +\n hearts +\n likeButton;\n\n if (localStorage.getItem(\"user\")) {\n var current = JSON.parse(localStorage.getItem(\"user\"));\n\n var current_id = \"like\" + i;\n var element = document.getElementById(current_id);\n\n if (element) {\n element.addEventListener(\"click\", function (event) {\n AddtoFavAPI(current.favorite, event.target.id);\n if (event.target.src.includes({ add }.add)) {\n event.target.src = \".\" + { minus }.minus;\n } else {\n event.target.src = \".\" + { add }.add;\n }\n });\n }\n }\n\n link.addEventListener(\"click\", function (e) {\n // remove all the former popups\n const popup = document.getElementsByClassName(\n \"mapboxgl-popup\"\n );\n for (let i = 0; i < popup.length; i++) {\n popup[i].remove();\n }\n\n // create a popup\n for (var i = 0; i < data.length; i++) {\n if (this.id === \"link-\" + data[i].properties.id) {\n var clickedListing = data[i];\n flyToStore(clickedListing);\n createPopUp(clickedListing);\n }\n }\n var activeItem = document.getElementsByClassName(\"active\");\n if (activeItem[0]) {\n activeItem[0].classList.remove(\"active\");\n }\n\n this.parentNode.classList.add(\"active\");\n });\n });\n }", "title": "" }, { "docid": "63b280ecc967a61413164a7647dbc17d", "score": "0.4618488", "text": "getVoushersForProductID() {\n\n }", "title": "" }, { "docid": "ad65b5fe9d5c672d92a34f6f786712bd", "score": "0.4617977", "text": "function buildDataUrl(objectId, propList) {\n var propStr = propList.toString();\n var dataUrl = ns.webContextPath +\n \"/rest/data/properties/\" + objectId + \"?properties=\" + propStr;\n return dataUrl;\n }", "title": "" }, { "docid": "bb302b5548ffbc37f5984cf831039f2f", "score": "0.46148002", "text": "function getProps() {\n var propertyCfc = new propertyCFC();\n propertyCfc.setHTTPMethod('GET');\n var inJSON = (contractor === true) ? propertyCfc.getAllOpenMarkerLocs(dbowner).DATA : propertyCfc.getAllOpenMarkerLocs().DATA;\n if (inJSON.ID.length ===0) {\n $(\"#map1\").html(\"<img src='img/no-active-properties.png' style='width:100%;' >\");\n return 0;\n }\n var bounds = new google.maps.LatLngBounds();\n // each variable is made.and passed to the makeMarkers function to make the marker.\n for (var i = 0; i < inJSON.ID.length; i++) {\n var lat = inJSON.LAT[i];\n var lon = inJSON.LON[i];\n var city = inJSON.CITY[i];\n var property_name = inJSON.PROPERTY_NAME[i];\n var address = inJSON.ADDRESS[i];\n var id = inJSON.ID[i];\n var manager = inJSON.MANAGER[i];\n var company = inJSON.COMPANYNAME[i];\n bounds.extend(makeMarkers(lat, lon, property_name, address, id, city, manager, company));\n\n }\n map.fitBounds(bounds);\n\n\n}", "title": "" }, { "docid": "c10aaec40c83a8c2c79654643540199a", "score": "0.4613529", "text": "function populateChart(prop)\n { //create a variable that will be an empty array that will store and return my prop values\nlet propsArray = [];\n//loop \nfor(let i=0; i < beautyImageArray.length; i++) {\n propsArray.push(beautyImageArray[i][prop]);\n}\nreturn propsArray;\n }", "title": "" }, { "docid": "8cd308ffbe4995eb0fd7b2d29071075b", "score": "0.46050107", "text": "function get(domain, prop, cb) {\n var params = {\n 'eq': ['domainName', domain, 'name', prop]\n };\n var url = getMillicoreHost(cfg, null) + '/box/srv/1.1/ent/ten/DomainProp/list';\n doReq(params, url, function(err, props) {\n if (err) return cb(err);\n var prop = null, guid = null;\n if (props.list.length > 0) {\n prop = props.list[0].fields.value;\n guid = props.list[0].guid;\n }\n return cb(null, prop, guid);\n });\n }", "title": "" }, { "docid": "92969c1e39c2591c502f5b1deebde6ad", "score": "0.46008277", "text": "function slideInfoListingProd() {\n\t$('.listing--info--slide').slick({\n\t\tarrows: false,\n\t\tdots: true,\n\t\tslidesToShow: 1,\n\t\tslidesToScroll: 1\n\t});\n}", "title": "" }, { "docid": "5aff2b6e4956e65d58b686e1f55a2ee6", "score": "0.4598633", "text": "function generate_properties(vencodedquery) {\n var vresult = [],\n vlist = {};\n var a = new GlideRecord(\"sys_properties\");\n if (vencodedquery) try {\n a.addEncodedQuery(vencodedquery);\n a.setLimit(100);\n a.orderByDesc(\"sys_created_on\");\n for (a.query(); a.next();) vlist[a.name] = {}, vlist[a.name].value = a.value + \"\";\n vresult.push(JSON.stringify(vlist) + \"\")\n } catch (e) {\n vresult.push(\"Error: generate_properties \" + e)\n } else vresult.push(\"Error: generate_properties 'vencodedquery' is required \" + vencodedquery);\n return vresult\n}", "title": "" }, { "docid": "794e7eae46967158b50f53aede14be9f", "score": "0.45966253", "text": "function paintProperties() {\n\n\n var button;\n var buttonBuy;\n var buttonH;\n\n for (var c = 0; c < this.activePlayer.ownedProperties.length; ++c) {\n representationProperty = document.getElementById(this.activePlayer.ownedProperties[c]);\n dataProperty = this.properties[this.activePlayer.ownedProperties[c]];\n\n if (dataProperty.countHouses == 0) {\n button = representationProperty.getElementsByClassName('propertySell');\n button[0].style.opacity = '0.99';\n button[0].style.backgroundColor = '#7EB5EB';\n button[0].style.border = '1px solid'\n button[0].disabled = false;\n }\n paintLodgementPart(representationProperty, dataProperty);\n }\n}", "title": "" }, { "docid": "bbd900fdb68f601b463263a9aae1079f", "score": "0.4588598", "text": "function loadParks(obj,gridOptions) {\n FullPopupLoader.showPopup();\n var resource = ParksRestService.getResource();\n resource.query(obj, function (data, response) {\n var headers = response();\n gridOptions.data= data;\n gridOptions.totalItems = parseInt(headers['x-pagination-total-count']);\n FullPopupLoader.hidePopup();\n }, function (error) {\n FullPopupLoader.hidePopup();\n });\n }", "title": "" }, { "docid": "2d9c9c16b8aa3c73b2da27b1188ec474", "score": "0.45874485", "text": "function allProductsReturn(products) {\n\n // var swatchDiv = $('.ps-image-cont');\n\n // loop through JSON response\n for (var product in products) {\n\n\n\n var variantTitles_List = products[product].variants;\n\n // create array of variant titles\n var varTitles = variantTitles_List.map( x => {\n\n if (x.title.indexOf(\"/\")) {\n\n return x.title.split(\"/\").join(\" \");\n\n } else {\n\n return x.title;\n\n }\n\n });\n\n\n\n\n // create array of variant urls\n var variantUrl = variantTitles_List.map(x => {\n\n var makeVarUrl = \"https://www.deltachildren.com/products/\" + products[product].handle + \"?variant=\" + x.id;\n\n if (makeVarUrl.indexOf(\"bookcase/hutch\")) {\n makeVarUrl = makeVarUrl.replace(\"bookcase/hutch\", \"bookcase-and-hutches\")\n }\n\n return makeVarUrl;\n\n });\n\n\n // create array of color with number (extract from variant title and manipulate to match syntax of color_number found in swatch image file)\n var varColor_Num = varTitles.map( x => {\n var split1 = x.split(\"(\");\n var rejoin = split1[0]+split1[1];\n var varTitle = rejoin.split(\")\")[0];\n var varTitle_split = varTitle.split(\" \").join(\"_\");\n var color_num_split = varTitle_split.split(\"/\").join(\"\");\n var color_num_split2 = color_num_split.split(\"__\").join(\"_\");\n var color_num_split3 = color_num_split2.split(\"__\").join(\"_\");\n var color_num = color_num_split2.split(\"--\").join(\"\");\n\n\n\n return color_num;\n\n });\n\n // console.log(varColor_Num);\n\n // take appropriate color_number syntax and combine with general cdn prefix to make new usable image file\n // replicating syntax of img files that make up swatches\n var madeSrc = varColor_Num.map(x => {\n\n var swatchValue = Object.values(swatch);\n\n var swatches_src = \"\";\n\n for (var i = 0; i < swatchValue.length; i++) {\n\n var swatchValueLoop = swatchValue[i];\n var splitLoop = swatchValueLoop.split(\"/\");\n var splitLoop2 = splitLoop[4].split(\".\");\n var colorExtracted = splitLoop2[0];\n // console.log(\"from url: \", colorExtracted, \"from variant: \", x);\n\n\n if (x == colorExtracted) {\n\n var the_swatch = swatchValue[i];\n // the_swatch = the_swatch.slice(-1)[0]\n // // x = swatchValue;\n\n }\n\n }\n\n return the_swatch;\n\n\n });\n\n\n // create array of variant featured image src strings\n var variantObject = products[product].variants;\n\n var madeImg = variantObject.map(x => {\n\n if(x.featured_image == null){\n\n\n }\n else{\n\n var makeImg = x.featured_image.src;\n\n // console.log(makeImg);\n return makeImg;\n }\n\n });\n\n\n\n\n\n // get product's tags and convert to array\n function allTagsArray() {\n\n var allTags = products[product].tags;\n\n return $(allTags).toArray();\n\n }\n\n\n /*\n MASTER OBJECT MAPPING ATTRIBUTES FOR NEW INDIVIDUAL PRODUCTS TO BE TEMPLATED\n VIA HANDLE BARS IN COLLECTION.LIQUID WHEN PRODUCT FILTERS ARE INVOKED\n */\n productDetails = new Object();\n // main product details\n productDetails['id'] = products[product].id;\n productDetails['img'] = products[product].images[0].src.replace('.jpg', '_large.jpg');\n productDetails['title'] = products[product].title;\n productDetails['vendor'] = products[product].vendor // inserted SY\n productDetails['price'] = products[product].variants[0].price;\n productDetails['compare_at_price'] = products[product].variants[0].compare_at_price;\n productDetails['handle'] = products[product].handle;\n productDetails['product_type'] = products[product].product_type;\n productDetails['allTags'] = allTagsArray();\n // productDetails['product_url'] = makeVarUrl[0];\n\n // first six variant featured images\n productDetails['img1'] = madeImg[0];\n productDetails['img2'] = madeImg[1];\n productDetails['img3'] = madeImg[2];\n productDetails['img4'] = madeImg[3];\n productDetails['img5'] = madeImg[4];\n productDetails['img6'] = madeImg[5];\n\n // first six variant titles\n productDetails['varTitle1'] = varTitles[0];\n productDetails['varTitle2'] = varTitles[1];\n productDetails['varTitle3'] = varTitles[2];\n productDetails['varTitle4'] = varTitles[3];\n productDetails['varTitle5'] = varTitles[4];\n productDetails['varTitle6'] = varTitles[5];\n\n // first six variant colors from srcs converted to image file\n productDetails['color_src1'] = madeSrc[0];\n productDetails['color_src2'] = madeSrc[1];\n productDetails['color_src3'] = madeSrc[2];\n productDetails['color_src4'] = madeSrc[3];\n productDetails['color_src5'] = madeSrc[4];\n productDetails['color_src6'] = madeSrc[5];\n\n\n\n // additional number of swatches (if any) not rendered\n if (products[product].variants.length > 4) {\n productDetails['swatchOverFour'] = products[product].variants.length - 4\n }\n\n // first four variant urls\n productDetails['var_url1'] = variantUrl[0];\n productDetails['var_url2'] = variantUrl[1];\n productDetails['var_url3'] = variantUrl[2];\n productDetails['var_url4'] = variantUrl[3];\n productDetails['var_url5'] = variantUrl[4];\n productDetails['var_url6'] = variantUrl[5];\n\n /* ----------------HANDLEBARS TEMPLATING RELATED ---------------------*/\n // Grab the template script\n var source = $('#template-src').html();\n // Compile the template\n var template = Handlebars.compile(source);\n // Add the compiled html to the page via productDetails object\n $('#append').append(template(productDetails));\n\n var source = $('#template-src').html();\n var template = Handlebars.compile(source);\n $('#append2').append(template(productDetails));\n var source = $('#template-src').html();\n var template = Handlebars.compile(source);\n $('#append3').append(template(productDetails));\n\n /* ----------------END HANDLEBARS TEMPLATE RELATED ---------------------*/\n\n }\n\n }", "title": "" }, { "docid": "855122bd0c4890b2ddce98234fa8bfcd", "score": "0.4585555", "text": "function Property(rentRollArray) {\n\t\n\t//Init scope variables\n\t//Variables to set input array columns\n\tvar testEmptyCol = 0;\n\tvar leaseCol = 2;\n\tvar areaCol = 7;\n\tvar rentStepsTypeCol = 12;\n\tvar rentDateCol = 13;\n\tvar rentCostCol = 17;\n\tvar leaseStartDateCol = 3;\n\tvar leaseEndDateCol = 4;\n\tvar leaseTypeCol = 10;\n\t\n\t//Variables for function\n\tvar numberOfTenants = 0; //number of tenants\n\tvar line = 0; //line of the rent roll array\n\tvar rentArrayRow = 0; //row counter for crRent \n\tvar subLineX = 0; //row counter for crRent loop\n\tvar crRent = []; //rent schedule array\n\tvar crLease = ''; //lease name\n\tvar crArea = 0; //lease area\n\tvar crRentDate = moment(); //Temporary variable to loop through rent escalation schedule\n\tvar crLeaseStart = moment(); //Moment object for start date of lease\n\tvar crLeaseEnd = moment(); //Moment object for end date of lease\n\tvar i = 0;\n\tvar crLeaseType = '';\n\t//Deprecated Line below, GAS uses different format\n\t//var crRentDate = moment().format('MM/DD/YYY'); \n\t\n\tcrRentDate = '01/01/1900';\t\n\n\t//Init Property Object\n\tvar prop = new Object();\n\tprop.rentRoll = {}; //rentRoll object\n\tprop.tenantCount = 0; //number of tenants in property\n\n\t//Loop throug array and count number of tenants in rent roll\n\tfor (i = 0; i < rentRollArray.length; i++) {\n\t\tif (rentRollArray[i][testEmptyCol] !== '') {\n\t\t\tnumberOfTenants++;\n\t\t}\n\t}\n\n\tprop.tenantCount = numberOfTenants;\n\t\n\t//Main Loop: Loop through all rent roll and create Tenant Objects for Prop Object\n\t//Variable i in the loop below is the tenant number\n\tfor (i = 0; i < (numberOfTenants); i++) {\n\t\tvar tempRentCost = 0;\n\t\tvar tempTypeOfRent = '';\n\n\t\tcrLease = rentRollArray[line][leaseCol];\n\t\tcrArea = rentRollArray[line][areaCol];\n\t\tcrLeaseStart = rentRollArray[line][leaseStartDateCol];\n\t\tcrLeaseEnd = rentRollArray[line][leaseEndDateCol];\n\t\tcrLeaseType = rentRollArray[line][leaseTypeCol];\n\n\t\trentArrayRow = 0;\n\t\tsubLineX = (line + rentArrayRow);\n\t\t\n\t\t//Inner Loop: Loop through rent schedule and push data into crRent[]\n\t\tdo {\t\t\n\t\t\tcrRentDate = rentRollArray[subLineX][rentDateCol];\n\t\t\tcrRentDate = moment(crRentDate).format('MM/DD/YYYY');\n\t\t\t//Deprecated Line below, GAS uses different format\n\t\t\t//crRentDate = moment(crRentDate, 'MM/DD/YYYY').format('MM/DD/YYYY'); \n\t\t\t\n\t\t\ttempRentCost = rentRollArray[subLineX][rentCostCol];\n\t\t\ttempTypeOfRent = rentRollArray[subLineX][rentStepsTypeCol];\n\t\t\t\t\t\t\n\t\t\tcrRent[rentArrayRow] = [crRentDate, tempRentCost, tempTypeOfRent]; \n\t\t\t\n\t\t\trentArrayRow++;\n\t\t\tsubLineX = (line + rentArrayRow);\n\n\t\t\tif(subLineX >= rentRollArray.length) {break; }\n\t\t}\twhile (rentRollArray[subLineX][testEmptyCol] == '');\n\n\t\t//Load rentRoll object with new Tenant object\n\t\tprop.rentRoll[i] = new Tenant(crLease, crLeaseStart, crLeaseEnd, crArea, crLeaseType, crRent);\n\t\tline += rentArrayRow;\n\n\t\t//Reset variables before restarting loop\n\t\tcrLease = 'error';\n\t\tcrArea = 0;\n\t\tcrRent = [];\n\t\tcrRentDate = '01/01/1900';\n\t}\n\treturn prop;\n}", "title": "" }, { "docid": "8ba3e830bb721302ae54d342f49882c2", "score": "0.4583658", "text": "function getSellPrice() {\n let object = props.Pname.prices;\n let head = _.head(object);\n return head.sellPrice;\n }", "title": "" }, { "docid": "709e53d0caa34e8a6c1b892de93d4e7c", "score": "0.45832562", "text": "loadProperties() {\n $(jqId(PROPERTIES_PANEL)).empty()\n this.properties_sheet.show(document.getElementById(PROPERTIES_PANEL))\n this.properties_sheet.load()\n }", "title": "" }, { "docid": "4778090b8772ab1e415e78ae772aaeed", "score": "0.4578287", "text": "function getPromos(idHotel) {\r\n idHotel = parseInt(idHotel);\r\n if(!idHotel) return; // Validação básica. Não enviar requisição caso não tenha vindo um número\r\n\r\n $.get(\"https://www.pmweb.com.br/cro/promocoes/\"+idHotel+\".json\", function(r){\r\n fillPromoModalData(r);\r\n });\r\n}", "title": "" }, { "docid": "87d1ce980439214d3937e162ab6fa1d6", "score": "0.45742726", "text": "function refresh() {\n $.get('http://exceptional-realty-property-ad.herokuapp.com/properties.json', function(response){\n //console.log(response);\n\n Property.all = []; //clear the array of property instances.\n $('table').find('tbody').empty(); //empty table body\n\n $.each(response, function(i, property) {\n var newProperty = new Property(property.street, property.city, property.state, property.price, property.posted);\n });\n\n //console.log(Property.all);\n Property.displayContent();\n });\n }", "title": "" }, { "docid": "8ffca416e8ca18f5da1966a080b71806", "score": "0.45719612", "text": "function getProperty(name, property) {\n\treturn manager.getProperty(name, property);\n}", "title": "" }, { "docid": "95d93bd940134312557e24af1dce6c62", "score": "0.45507544", "text": "function ShowPropertyListBySociety(index)\n{\n if (index != undefined)\n {\n P.SelectedSociety = P.SocietyList[index];\n RunCommand(CMD_PropertyList);\n return;\n }\n\n ShowProcessingMsg(true);\n\n $(\"#divSocietyList\").html(\"Loading...\");\n\n GetSocietyList(function ()\n {\n //console.log(SelectedSociety);\n $(\"#SocietyListHeader\").html(P.SelectedBHK + \" BHK\");\n\n $.ajax({\n url: \"/Data.aspx?Action=GetSocietyAvailability&Data1=\" + P.SelectedSociety.ID + \"&Data2=\" + P.SelectedBHK + \"&Data4=mobile\", cache: false, success: function (data)\n {\n P.AvailabilityList = JSON.parse(ShowError(data)[1]);\n var str = \"<ul data-role='listview'><li data-mini='true'><a href='#' onclick = 'ShowSocietyDetail(\" + P.SelectedSociety.ID + \")' style='color:orange;'>\" + P.SelectedSociety.SocietyName + \"</a></li>\"\n str += GetAvailabilityList(P.AvailabilityList);\n str += \"</ul>\";\n $(\"#divSocietyList\").html(str);\n $(\"#divSocietyList\").trigger(\"create\");\n ShowProcessingMsg(false);\n }\n });\n });\n}", "title": "" }, { "docid": "ba1933623aaec1b41456cf3956a373be", "score": "0.45503834", "text": "function updatePropertyRedraw(body, property, value){\n\n // Special case for Polar coordinates\n if(Globals.coordinateSystem == \"polar\" && $.inArray(property, [\"posx\",\"posy\",\"velx\",\"vely\",\"accx\",\"accy\"]) !== -1){\n // Convert from Polar input to Cartesian coordinate\n var point;\n \n if(property == \"posx\") {\n other = $('#general-properties-position-y').val();\n point = polar2Cartesian([value, other]);\n }\n else if(property == \"posy\") { \n other = $('#general-properties-position-x').val();\n point = polar2Cartesian([other, value]);\n }\n \n if(property == \"velx\") {\n other = $('#pointmass-properties-velocity-y').val();\n point = polar2Cartesian([value, other]);\n }\n else if(property == \"vely\") { \n other = $('#pointmass-properties-velocity-x').val();\n point = polar2Cartesian([other, value]);\n }\n \n if(property == \"accx\") {\n other = $('#pointmass-properties-acceleration-y').val();\n point = polar2Cartesian([value, other]);\n }\n else if(property == \"accy\") { \n other = $('#pointmass-properties-acceleration-x').val();\n point = polar2Cartesian([other, value]);\n }\n var index = bIndex(body);\n // Convert back to default PhysicsJS origin, if a position was updated\n if(property.substring(0,3) == \"pos\")\n point = [origin2PhysicsScalar(\"x\", point[0]), origin2PhysicsScalar(\"y\", point[1])];\n \n point = [convertUnit(point[0], \"posx\", true), convertUnit(point[1], \"posy\", true)]\n \n \n // Update properties within simulator, draw, and return\n onPropertyChanged(index, property.substring(0,3) + \"x\", point[0], false);\n \n if(property.length >= 4 && property.substring(3) === \"x\" && property != \"posx\"){\n point[1] = \"?\";\n }\n \n if(Globals.numKeyframes > 1 && point[1] == \"?\"){\n toggleUnknown(body, property.substring(0,3) + \"y\");\n }\n else {\n onPropertyChanged(index, property.substring(0,3) + \"y\", point[1], false);\n }\n \n if(Globals.numKeyframes == 1) attemptSimulation();\n drawMaster();\n return;\n }\n\n // Convert back to default PhysicsJS origin, update properties, and draw\n if(property == \"posx\" || property == \"posy\")\n value = origin2PhysicsScalar(property.slice(-1), value); \n value = convertUnit(value, property, true);\n \n // Master clamping location\n if(property == \"mass\") value = clamp(0.1,value,1000);\n if(property == \"surfaceWidth\") value = clamp(1,value,100000);\n if(property == \"surfaceHeight\") value = clamp(1,value,100000);\n if(property == \"surfaceFriction\") value = clamp(0,value,1);\n if(property == \"rampWidth\") value = clamp(1,value,50000);\n if(property == \"rampHeight\") value = clamp(1,value,50000);\n if(property == \"rampAngle\") value = clamp(10,value,80);\n if(property == \"rampFriction\") value = clamp(0,value,1);\n if(property == \"k\") value = clamp(0.001,value,0.05);\n \n var index = bIndex(body);\n if(property == \"k\" && bodyType(body) === \"kinematics1D-spring-child\")\n index = body2Constant(body).parent;\n \n onPropertyChanged(index, property, value, false);\n \n if(Globals.numKeyframes == 1) attemptSimulation(); \n drawMaster();\n}", "title": "" }, { "docid": "e4b4e7cf981c2749fabff11f71f468f0", "score": "0.45441324", "text": "function getPrices(startDate, stopDate) {\n // Check how many people there, and add 1.50 for every person\n let peoplePrice = (people * 1.50);\n price = 0;\n price += dogPrice;\n\n // Make a moment object of the dates to make it easier to calculate.\n startDate = moment(startDate);\n stopDate = moment(stopDate);\n\n // While the start date is lower than the stop date.\n while (startDate <= stopDate) {\n dates.push(moment(startDate).format('YYYY-MM-dd'));\n startDate = moment(startDate).add(1, 'days');\n\n // Check months for pricing, add the price of the months.\n switch (startDate.month()) {\n case 0: case 1: case 2: case 9: case 10: case 11:\n price += parseInt(prices['lowSeason']);\n price += peoplePrice;\n halfPrice = (price / 2);\n document.getElementById('price_first').innerHTML = '€' + halfPrice;\n document.getElementById('price_second').innerHTML = '€' + halfPrice;\n document.getElementById('total_price').innerHTML = '€' + price;\n break;\n case 6: case 7:\n price += parseInt(prices['highSeason']);\n price += peoplePrice;\n halfPrice = (price / 2);\n document.getElementById('price_first').innerHTML = '€' + halfPrice;\n document.getElementById('price_second').innerHTML = '€' + halfPrice;\n document.getElementById('total_price').innerHTML = '€' + price;\n break;\n case 3: case 4: case 5: case 8:\n price += parseInt(prices['lateSeason']);\n price += peoplePrice;\n halfPrice = (price / 2);\n document.getElementById('price_first').innerHTML = '€' + halfPrice;\n document.getElementById('price_second').innerHTML = '€' + halfPrice;\n document.getElementById('total_price').innerHTML = '€' + price;\n break;\n }\n }\n return dates;\n}", "title": "" }, { "docid": "a877ef9709c2f2c9e85a9c6c8b69fa6d", "score": "0.4541446", "text": "async function getDrinks() {\n let result = await Axios.get(url);\n setdrinks(result.data.drinks);\n }", "title": "" }, { "docid": "c890dc2ceaa76fc7aa07189f87854704", "score": "0.45385364", "text": "function VF_SY120_SETPROPERTYSPLITTER()\n{\n GLOBAL_strPropertySplitter = document.getElementById(\"VFPROP_Exchange1\").innerText;\n}", "title": "" }, { "docid": "38f8acfeca6ea68f43a3709e776ab199", "score": "0.45361006", "text": "function updateDots() {\r\n if (data.totals[0]) {\r\n let features = map.querySourceFeatures('dots', { 'sourceLayer': 'dots' });\r\n let newdots = [];\r\n for (feature in features) {\r\n let id = features[feature].properties.id;\r\n let state = map.getFeatureState({\r\n source: 'dots',\r\n sourceLayer: 'dots',\r\n id: id\r\n });\r\n if (!state['color']) {\r\n newdots.push(id);\r\n }\r\n }\r\n setProperties(newdots);\r\n }\r\n}", "title": "" }, { "docid": "c1a514e7c57cc8501d4f89908ff8de4d", "score": "0.45354384", "text": "function listProperties(accountID){\n var request = gapi.client.analytics.management.webproperties.list({\n 'accountId': accountID\n });\n request.execute(printProperties);\n}", "title": "" }, { "docid": "c981eab258d043b496855d9a12a7f303", "score": "0.45230052", "text": "function populateProperty(){\n\n var value = \"\";\n \n //Check if the configuration tpye is manual or custom.\n if($('input[name=xConfigType]:checked').val() == \"manual\"){\n \n value = $(\"#xManualConfig\").attr(\"value\");\n\t\n }else if($('input[name=xConfigType]:checked').val() == \"prev\"){\n \n \tvalue = $(\"#xPropertyConfigPopulate\").val();\n\t\n }else{\n \n for (var i = 0; i <= configCount; i++){\n \n if ($(\"#configLine\" + i).length > 0){ //if exists.\n value += $(\"#configLine\" + i).text() + \"\\n\"; \n }\n }\n \n }\n \n document.getElementById(\"id_propertyConfig\").value = value;\n}", "title": "" }, { "docid": "791bcccb34d64e2339438ceb1eb387a3", "score": "0.4513074", "text": "function populateProducts(){\n var i = 0;\n var k = 0;\n $( \".pr-title-des3\" ).find(\"li\").each(function() {\n $( this ).html(Building[i]);\n i++\n });\n $( \".pr-title-name3\" ).find(\"li\").each(function() {\n $( this ).html(Product[k]);\n k++\n });\n}", "title": "" }, { "docid": "4e3db05b92e9b5c512dde710c0a61d72", "score": "0.45107102", "text": "_patch(data) {\n\n /**\r\n * The number of the season\r\n * @type {number}\r\n */\n this.number = data.number;\n\n /**\r\n * The episodes in the season\r\n * @type {Episode[]}\r\n */\n this.episodes = data.episodes;\n }", "title": "" }, { "docid": "2ff9b5af646031592c3912bf985a3f2b", "score": "0.45020735", "text": "function pickPlaylistProperties(playlist) {\n\treturn _.pick(playlist, 'id', 'name', 'owner', 'external_urls');\n}", "title": "" }, { "docid": "71d9041118ce31575021dc65a701c9ab", "score": "0.4476779", "text": "function getPrices(){\n return data[\"items\"].map(p => p.product.price.value) \n}", "title": "" }, { "docid": "7d603db5cc5ee882dcbec8eed07d99ea", "score": "0.4476048", "text": "loadProperties() {\n const self = this;\n $(jqId(PROPERTIES_PANEL)).load(\"propertysheets/user.html\", () => {loadPropertiesSheet(self.artefact);});\n }", "title": "" }, { "docid": "76f1e36d1c792ad3bf46e4154069167a", "score": "0.44714302", "text": "function fetchSeasonDetails(seasonId) {\n\n return fetch(`https://corsaway.herokuapp.com/proxy?url=https://api.sportradar.com/australianrules/trial/v2/en/seasons/${seasonId}/summaries.json?api_key=a2b8gd6xvrnhjaarys8p5yyn`)\n .then(handleErrors)\n .then(function (response) {\n return response.json();\n })\n .catch(function () {\n M.toast({\n html: 'Failed to load season summaries from API, please reload the page to try again',\n classes: 'error'\n });\n\n });\n }", "title": "" }, { "docid": "29717fd12d473b24db546f591b05c90a", "score": "0.44706652", "text": "function formatGroupProperty(propertyList) {\n var propertyListResult = [];\n $.each(propertyList, function (i, v) {\n propertyListResult.push({\n value: v.id,\n name: v.groupName\n });\n });\n return propertyListResult;\n }", "title": "" }, { "docid": "7c57cfb622dbad95afa78c37f563a18f", "score": "0.44659027", "text": "function render_properties(deviceName, deviceId, props) {\n var html = '';\n\n html += \"<p class='device_icon'>\";\n html += \"<b>\" + html_escape(deviceName) + \"</b> - \";\n html += (props.length > 0) ? props.length + ' properties available' : 'no properties available for this device.';\n html += \"</p>\";\n\n if (props.length > 0) {\n html += \"<table class='grid'>\";\n html += \"<tr>\";\n html += \"<th>Description</th>\";\n html += \"<th>Name</th>\";\n html += \"<th>Type</th>\";\n html += \"<th>Read</th>\";\n html += \"<th>Write</th>\";\n html += \"<th>Action</th>\";\n html += \"</tr>\";\n\n for (var i = 0; i < props.length; i++) {\n var p = props[i];\n html += \"<tr>\";\n html += \"<td><a href='#' data-prop-id='\" + p.propertyId + \"' data-prop-name='\" + p.displayName + \"' data-device-id='\" + deviceId + \"' class='app_icon property'>\" + html_escape(p.displayName) + \"</a></td>\";\n html += \"<td>\" + html_escape(p.name) + \"</td>\"\n html += \"<td>\" + html_escape(p.type) + \"</td>\"\n html += \"<td>\" + html_escape(p.read) + \"</td>\"\n html += \"<td>\" + html_escape(p.write) + \"</td>\"\n html += \"<td>\";\n html += \"<a href='#' data-prop-id='\" + p.propertyId + \"' data-prop-name='\" + p.name + \"' data-device-name='\" + deviceName + \"' data-device-id='\" + deviceId + \"' class='edit_icon prop-edit'>Edit</a> \";\n html += \"<a href='#' data-prop-id='\" + p.propertyId + \"' data-prop-name='\" + p.name + \"' data-device-name='\" + deviceName + \"' data-device-id='\" + deviceId + \"' class='delete_icon prop-delete'>Delete</a> \";\n html += \"<a href='#' data-prop-id='\" + p.propertyId + \"' data-prop-name='\" + p.name + \"' data-device-name='\" + deviceName + \"' data-device-id='\" + deviceId + \"' class='history_icon prop-history'>History</a>\";\n\n if (p.write)\n html += \"<a href='#' data-prop-id='\" + p.propertyId + \"' data-device-id='\" + deviceId + \"' data-device-name='\" + deviceName + \"' class='execute_icon prop-apply'>Execute</a> \";\n\n html += \"</td>\";\n html += \"</tr>\";\n }\n html += \"</table>\";\n }\n\n html += \"<p>\" +\n \"<a href='#' data-device-id='\" + deviceId + \"' data-device-name='\" + deviceName + \"' class='add_icon prop-add'>Add new property</a> \" +\n \"<a href='#' data-device-id='\" + deviceId + \"' data-device-name='\" + deviceName + \"' class='refresh_icon properties-refresh'>Refresh</a>\" +\n \"</p>\";\n\n return html;\n}", "title": "" }, { "docid": "0af23791de8c1efcce26b5b4c00d28a8", "score": "0.44583115", "text": "function renderProperty(dataPro){\n console.log(dataPro);\n ordersMsg.className = 'err';\n ordersMsg.innerHTML = dataPro.message;\n const properties= dataPro.Property; \n for ( var i= 0; i< properties.length; i++ ){\n \n let divprop= document.createElement(\"DIV\"); \n\n let displayOwner = document.createElement(\"P\"); \n displayOwner.id ='owner'; \n displayOwner.innerHTML= `<strong>Owner:</strong> ${properties[i].owner}`;\n\n const displayPrice = document.createElement(\"P\");\n displayPrice.id='price';\n displayPrice.innerHTML = `<strong>${properties[i].price} Rwf </strong>`;\n\n const displayCity = document.createElement(\"P\");\n displayCity.id='city';\n displayCity.innerHTML = `<strong> City:</strong>${properties[i].city}, <strong>${properties[i].price}$`;\n\n const displayPhone = document.createElement(\"P\");\n displayPhone.id='phone';\n displayPhone.innerHTML = `<strong>Phone:</strong> ${properties[i].phone}`;\n\n const displayDateCreated = document.createElement(\"P\"); \n displayDateCreated.id = 'dateCreated0;'\n displayDateCreated.innerHTML = `<strong>Date Create:</strong> ${properties[i].dateCreated}`;\n\n const displayAddress = document.createElement(\"P\");\n displayAddress.id = 'address'\n displayAddress.innerHTML = `<strong>Adress:</strong> ${properties[i].address}`;\n\n const displayState = document.createElement(\"P\");\n displayState.id = 'state';\n displayState.innerHTML = `${properties[i].state}`;\n\n // adding image property \n const img = document.createElement('img'); \n img.src = properties[i].url; \n img.style.width= \"270px\";\n img.style.height= \"170px\";\n img.classList.add('imgCreated'); \n \n\n // for flipping divs\n\n const flipBoxInner =document.createElement('div');\n flipBoxInner.classList.add('flip-box-inner');\n\n const flipBoxFront =document.createElement('div');\n flipBoxFront.classList.add('flip-box-front');\n\n const flipBoxBack =document.createElement('div');\n flipBoxBack.classList.add('flip-box-back');\n flipBoxBack.appendChild(displayOwner);\n flipBoxBack.appendChild(displayPhone);\n flipBoxBack.appendChild(displayAddress);\n flipBoxBack.appendChild(displayDateCreated);\n\n const flipBox = document.createElement('div');\n flipBox.classList.add('flip-box'); \n\n\n\n // for accessing id \n const id = `${properties[i]._id}`; \n // console.log(id); \n // const deleteBtn = document.getElementsByClassName('btn-delete'); \n\n //creting view Btn\n const viewBtn= document.createElement('BUTTON');\n viewBtn.classList.add('btn-view');\n viewBtn.innerHTML = \"view\";\n viewBtn.style.margin = \"5px 2px 5px 2px\";\n viewBtn.addEventListener('click', ()=> { \n fetch( `http://localhost:3000/api/v1/property/${id}`, {\n method: 'GET', \n \n }).then((res) =>{\n console.log(res);\n res.json()\n })\n .then(pro =>{\n location.href='../pages/singleProperty.html';\n mainDiv.remove();\n let oneItem = pro.Property;\n const singleDiv= document.getElementById('forSingleElement');\n let container = document.createElement('div');\n container.innerHTML = \n `<div class=\"property-single\"> \n <div>\n <img src=${oneItem.url} class=\"imgSingleCreated\" style=\"width: 770px; height: 470px;\">\n </div>\n <div>\n <p id=\"phone\"><strong>Phone:</strong> ${oneItem.phone}</p>\n <p id=\"address\"><strong>Adress:</strong>${oneItem.address}</p>\n <p id=\"dateCreated0;\"><strong>Date Create:</strong> ${oneItem.dateCreated}</p>\n <p id=\"owner\"><strong>Owner:</strong> ${oneItem.owner}</p>\n <p id=\"city\"><strong> City:</strong>RUBAVU-KIGALI, <strong>${oneItem.price}$</strong></p>\n \n </div>\n </div>`; \n\n\n ordersMsg.innerHTML = `Item Id: ${oneItem._id}`;\n //creating modifiy Btn\n const modifyBtn= document.createElement('BUTTON');\n modifyBtn.classList.add('btn-modify');\n modifyBtn.innerHTML = \"Modify\";\n modifyBtn.style.margin = \"0px 20px 0px 20px\";\n\n // creting delete Btn\n const deleteBtn= document.createElement('BUTTON');\n deleteBtn.classList.add('btn-delete');\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.style.margin = \"0px 20px 0px 20px\";\n\n\n //append everything\n container.appendChild(modifyBtn);\n container.appendChild(deleteBtn);\n singleDiv.append(container);\n console.log(pro)\n //<button class=\"btn-modify\" style=\"margin: 5px 2px;\">Modify</button>\n // <button class=\"btn-delete\" style=\"margin: 5px 2px;\">Delete</button>\n\n\n //for delete option\n deleteBtn.addEventListener('click', fetchDelete());\n\n // fetch delete function\n const fetchDelete = ()=>{ \n fetch( `http://localhost:3000/api/v1/property/${id}`, {\n method: 'DELETE',\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n // Authorization: `Bearer `\n }\n }).then(()=> location.reload()); \n \n }\n\n // for modfying action\n\n modifyBtn.addEventListener('click',()=>{\n location.href='../pages/updated.html';\n displayAddress.innerHTML= oneItem.address;\n console.log(oneItem.address);\n const owner = document.getElementById('#owner').textContent;\n owner.value= `${oneItem.owner}`\n\n\n const updateBtn = document.getElementById('submitUpdates');\n updateBtn.addEventListener('click',(e)=>{\n e.preventDefault();\n console.log(oneItem.address);\n // const owner = document.getElementById('.owner');\n // owner.value= `${oneItem.owner}`\n \n fetch(`http://localhost:3000/api/v1/property/${id}`, {\n method: 'PUT',\n body: JSON.stringify({\n owner:displayOwner.value,\n price:displayPrice,\n state:displayState,\n city:displayCity.value,\n phone: displayPhone.value,\n url:img.value,\n dateCreated:displayDateCreated.value\n })\n }).then(response => {response.json()})\n .then(dataUpdated =>{ console.log(dataUpdated)})\n .catch(err =>console.log(err))\n });\n })\n \n const containerPro = document.querySelector('.singleProperty');\n containerPro.innerHTML = pro.Property;\n }); \n \n });\n \n\n // append img\n flipBoxFront.appendChild(img);\n\n // append my flip action\n flipBoxInner.appendChild(flipBoxFront);\n flipBoxInner.appendChild(flipBoxBack);\n\n // append the whole\n flipBox.appendChild(flipBoxInner);\n\n // adding a class to my divprop \n divprop.setAttribute(\"class\",'column-grid-Property')\n\n \n // append my created object to divprop\n divprop.appendChild(flipBox); \n divprop.appendChild(displayOwner);\n divprop.appendChild(displayCity);\n\n // for adding buttons\n // divprop.appendChild(modifyBtn);\n // divprop.appendChild(deleteBtn);\n divprop.appendChild(viewBtn);\n \n\n // to append my whole create section \n mainDiv.append(divprop); \n \n } \n }", "title": "" }, { "docid": "e8a50de695a00c277c97d1bf60768e63", "score": "0.44517988", "text": "function populatePropertyInformation(data, i, item, property, expirationArr) {\n\tProperty.findOne({ name: property }, function (err, res) {\n\t\tif (err) {\n\t\t\tthrow err;\n\t\t}\n\n\t\tfor (let j = 0; j < data[i]; j++) {\n\t\t\tlet expirationObj = new Expiration();\n\t\t\texpirationObj.name = data[3],\n\t\t\texpirationObj.property.push(res._id);\n\t\t\texpirationObj.save((error) => {\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t});\n\t\t\texpirationArr.push(expirationObj._id);\n\n\t\t\tInventory.update({_id: item._id},\n\t\t\t\t{\"$addToSet\" : { \"expiration\": expirationObj._id,\n\t\t\t\t\"property\": res._id }}, (err, res) => {\n\t\t\t\t\tif (err) throw err;\n\t\t\t\t}\n\t\t\t)\n\t\t}\n\n\t\t\t// the method findOrCreate is not fully working in Mongoose 5\n\t\tCart.findOrCreate({ association: property }, function(err, cart, created) {\n\t\t\tif (err) throw err;\n\t\t\tcart.checkOut = true;\n\t\t\tcart.inventory.push(item._id);\n\t\t\tcart.association = res.name;\n\t\t\tcart.save();\n\n\t\t\tres.savedCart.push(cart._id);\n\t\t\tres.save();\n\t\t});\n\n\t});\n}", "title": "" }, { "docid": "8848f05c4a115a26fc0aada77808fdf2", "score": "0.44393638", "text": "async properties(documentId) {\n const response = await fetch(\n `${PSPDFKIT_SERVER_INTERNAL_URL}/api/documents/${documentId}/properties`,\n {\n method: \"GET\",\n headers: {\n Authorization: `Token token=${AUTH_TOKEN}`,\n },\n }\n ).then((res) => res.json());\n\n return unwrapError(response);\n }", "title": "" }, { "docid": "683341e14ab66ef5ec3771f7bcf83a1a", "score": "0.4426493", "text": "function get_products() {\n return list\n }", "title": "" }, { "docid": "ad6943d9d206e62b92247e9815db3413", "score": "0.44259006", "text": "function getActualUserProperties() {\n\n $.ajax({\n url: appWebUrl + \"/_api/SP.UserProfiles.PeopleManager/GetMyProperties\",\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" },\n success: function (data) {\n var html = \"<ul>\";\n $.each(data.d.UserProfileProperties.results, function(index, prop) {\n html += \"<li>\" + prop.Key + \" : \" + prop.Value + \"</li>\";\n });\n html += \"</ul>\";\n $('#res').html(\"\");\n $('#res').append(html);\n },\n error: function (xhr) {\n alert(xhr.responseText);\n }\n });\n}", "title": "" }, { "docid": "d62a01b39973e39b17763e62c4b65377", "score": "0.4425565", "text": "function getPropertyAVBPrice(propertyID, from, to, authInfo) {\n return {\n Pull_GetPropertyAvbPrice_RQ: {\n ...createAuthentication(authInfo),\n PropertyID: propertyID,\n DateFrom: from,\n DateTo: to,\n }\n }\n}", "title": "" }, { "docid": "14e4bd4a813f59bbfe9dceddbf5c3dcb", "score": "0.4425098", "text": "function setHostingYearlyInfo() {\r\n \tvar yearlyInfoList = [];\r\n \tfor (var y = 0; y < $scope.dealInfo/12; y++) {\r\n \t\tvar yearlyData = {};\r\n \t\tyearlyData.year = y+1;\r\n \t\tif($scope.hostingInfo.serverHosting.open){\r\n \t\t\tyearlyData.servers = $scope.hostingInfo.serverHosting.children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.physical = $scope.hostingInfo.serverHosting.children[0].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalWin = $scope.hostingInfo.serverHosting.children[0].children[0].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalWinSmall = $scope.hostingInfo.serverHosting.children[0].children[0].children[0].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalWinMedium = $scope.hostingInfo.serverHosting.children[0].children[0].children[0].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalWinLarge = $scope.hostingInfo.serverHosting.children[0].children[0].children[0].children[2].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalUnix = $scope.hostingInfo.serverHosting.children[0].children[0].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalUnixSmall = $scope.hostingInfo.serverHosting.children[0].children[0].children[1].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalUnixMedium = $scope.hostingInfo.serverHosting.children[0].children[0].children[1].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.physicalUnixLarge = $scope.hostingInfo.serverHosting.children[0].children[0].children[1].children[2].distributedVolume[y].volume;\r\n \t\tyearlyData.virtual = $scope.hostingInfo.serverHosting.children[0].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublic = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicWin = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicWinSmall = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[0].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicWinMedium = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[0].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicWinLarge = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[0].children[2].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicUnix = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicUnixSmall = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[1].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicUnixMedium = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[1].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPublicUnixLarge = $scope.hostingInfo.serverHosting.children[0].children[1].children[0].children[1].children[2].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivate = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateWin = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateWinSmall = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[0].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateWinMedium = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[0].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateWinLarge = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[0].children[2].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateUnix = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateUnixSmall = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[1].children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateUnixMedium = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[1].children[1].distributedVolume[y].volume;\r\n \t\tyearlyData.virtualPrivateUnixLarge = $scope.hostingInfo.serverHosting.children[0].children[1].children[1].children[1].children[2].distributedVolume[y].volume;\r\n \t\t}\r\n \t\tif($scope.hostingInfo.platformHosting.open){\r\n \t\t\tyearlyData.sqlInstances = $scope.hostingInfo.platformHosting.children[0].distributedVolume[y].volume;\r\n \t\tyearlyData.cotsInstallations = $scope.hostingInfo.platformHosting.children[1].distributedVolume[y].volume;\r\n \t\t}\r\n\r\n \t\tyearlyInfoList.push(yearlyData);\r\n \t}\r\n \t$scope.hostingInfo.hostingYearlyDataInfoDtos = yearlyInfoList;\r\n }", "title": "" }, { "docid": "f126df7fc1c06153589f812a333ba81f", "score": "0.44241506", "text": "function getShelterData() {\r\n // ajax get request from GeoDOT MapServer\r\n // gets all stops with IDS > 0, returns all fields in GeoJSON format\r\n $.get(url, function(data){\r\n // turn output JSON string into JSON Object\r\n shelterData = JSON.parse(data);\r\n // convert JSON Object to Layer\r\n shelterLayer =\r\n L.geoJSON(shelterData, {\r\n pointToLayer: function(feature, latlng) {\r\n return L.circleMarker(latlng, shelterStyle);\r\n }\r\n });\r\n // set Pop up to read:\r\n // Stop ID: [Stop_ID]\r\n // Shelter Owner: [Shelter_Owner]\r\n // Property Owner: [Property_Owner]\r\n shelterLayer.bindPopup(function(layer) {\r\n return \"<b>Stop ID: \" + layer.feature.properties.Stop_ID\r\n + \"</b><br> Shelter Owner: \" + layer.feature.properties.Shelter_Owner\r\n + \"</b><br> Property Owner: \" + layer.feature.properties.Property_Owner;\r\n // add layer to map\r\n }).addTo(mymap);\r\n });\r\n}", "title": "" }, { "docid": "c5eb1c2273f3d99d6f29e48babc5fc2e", "score": "0.44212112", "text": "function extractServerUnitPrice(parent,year){\r\n \tvar unitPrice = [];\r\n \tvar unitInfo={};\r\n\r\n \tif($scope.viewBy.type == 'unit'){\r\n \t\tunitInfo.noOfShops = parent.distributedVolume[year].unit;\r\n \t}\r\n \tif($scope.viewBy.type == 'revenue'){\r\n \t\tunitInfo.noOfShops = parent.distributedVolume[year].revenue / parent.distributedVolume[year].volume;\r\n \t}\r\n \tunitPrice.push(unitInfo)\r\n \treturn unitPrice;\r\n }", "title": "" }, { "docid": "b8bd1f89bae45ecd7f554bb8d73ea307", "score": "0.44151127", "text": "function fetchCatalog() {\n $.getJSON(\"data/laptops.json\", function (data) {\n catalog = data;\n // Find minimum Price and update min-price\n $(\"#min-price\").attr('value', catalog.reduce(function (a, b) {\n if (a == catalog[0]) {\n return Math.min(a.price, b.price);\n }\n else {\n return Math.min(a, b.price);\n }\n }));\n // Find maximum Price and update max-price\n $(\"#max-price\").attr('value', catalog.reduce(function (a, b) {\n if (a == catalog[0]) {\n return Math.max(a.price, b.price);\n }\n else {\n return Math.max(a, b.price);\n }\n }));\n\n // Show the Catalog\n showCatalog(catalog);\n });\n}", "title": "" }, { "docid": "234dc931b965f4b8dcae73e92719eda5", "score": "0.44146585", "text": "function findProperties(options) {\n let articleList = [];\n\n options.$(options.selector).each((_, el) => {\n let strippedName = options.$(\".toggle-link\", el).text().match(options.re);\n let id = options.$(el).attr(\"id\");\n\n // We make sure that we found a match with our regexp.\n if(strippedName && strippedName.length > 1) {\n let article = {\n title: `${options.parentArticle}.${strippedName[1]}`,\n url: `${domain}${options.link}#${id}`,\n description: sanitize(options.$(selectors.propDescription, el)),\n };\n\n // We don't want to duplicate entries that have already been decleared\n // somewhere else.\n if(!/Declared In/.test(article.description)) {\n articleList.push(article);\n }\n }\n });\n\n return articleList;\n}", "title": "" }, { "docid": "478660848837572f2253c4bc9115ddb2", "score": "0.4410135", "text": "function populateSeasonList( data ) {\n\t\t\tconsole.info( '-- populateSeasonList' );\n\t\t\tvar season = data.SEASON_ROMAN;\n\t\t\n\t\t\t$.each(season, function() {\n\t\t\t\tseasonCmb.append( $( \"<option />\" ).val( this )\n\t\t\t\t\t.text( 'Season ' + this ) );\n\t\t\t});\n\t\t\tseasonCmb[0].selectedIndex = 0;\n\t\t\tseasonCmb.selectmenu(\"refresh\");\n\t\t}", "title": "" }, { "docid": "69d1ef91bc0440c658a55de2f691a0c3", "score": "0.440875", "text": "function optionChanged(newPropertyID) {\n\n d3.json('/data',function(propertyData){\n propertyData.forEach(data => {\n //use the value of each option to select the property and pass to global var\n if (data._id === newPropertyID){\n window.selectProperty=data;\n }\n })\n //change the chart\n initChart()\n\n })\n\n\n}", "title": "" }, { "docid": "5f199dbb5ed27facf5eed506790968a4", "score": "0.44071287", "text": "get salesComissionPercentage() { return this.get('salesComissionPercentage'); }", "title": "" } ]
0ec734a6c84913d78f4caa9862785a33
Draw code goes here
[ { "docid": "b2ff94084a5372c2bf707dd115cf8140", "score": "0.0", "text": "function draw() {\n background(55);\n}", "title": "" } ]
[ { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.8213326", "text": "function draw() {}", "title": "" }, { "docid": "a93fec9ef850de8b574fadd71da2a063", "score": "0.8190822", "text": "function draw(){}", "title": "" }, { "docid": "9a8746dfb450920ac3c5b2d1808da6ce", "score": "0.814715", "text": "draw() { }", "title": "" }, { "docid": "6c10091a7ddf8582cfec5f057267b8d7", "score": "0.7994334", "text": "draw(ctx) {\n\n }", "title": "" }, { "docid": "7f584314a32c7f8136d83fef1178e2f0", "score": "0.7982494", "text": "draw() {\n\n }", "title": "" }, { "docid": "7f584314a32c7f8136d83fef1178e2f0", "score": "0.7982494", "text": "draw() {\n\n }", "title": "" }, { "docid": "530cf4d040da4abcdb9a3c2c286224c4", "score": "0.7980718", "text": "draw() {\n }", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.79748946", "text": "draw() {}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.79748946", "text": "draw() {}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.79748946", "text": "draw() {}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.79748946", "text": "draw() {}", "title": "" }, { "docid": "a5f329eb301a46aff3ee07411a026c6f", "score": "0.7857668", "text": "draw(){\r\n }", "title": "" }, { "docid": "143ef6bf565be07cb48bf2fe6dd50763", "score": "0.78195685", "text": "function draw() { \n\t\n}", "title": "" }, { "docid": "8883a17a9c065de40e19b192821ac9c9", "score": "0.7795638", "text": "onDraw() {}", "title": "" }, { "docid": "ac11da497a84bdee2c94b84631d56c6e", "score": "0.77671796", "text": "draw () {\t\t\n\t\tthis._size_elements ()\n\t\tthis._draw_board ()\n\t}", "title": "" }, { "docid": "a8d8126c4e4dae01ff8a8b9921106f78", "score": "0.77608335", "text": "function draw () {\n\n}", "title": "" }, { "docid": "039b8c4b175f6fce47467edeb085f3ae", "score": "0.7756842", "text": "function draw() {\n\t// Old fashion draw, called on each event (mouse, network ...)\n}", "title": "" }, { "docid": "c4702fa7ed7bb25d30cc8cac70628535", "score": "0.77529675", "text": "draw()\n {\n switch(this.id)\n {\n case(\"source\"):\n fill(0,0,255);\n break;\n case(\"target\"):\n fill(255,0,0);\n break;\n case(\"wall\"):\n fill(17,17,17);\n break;\n case(\"blank\"):\n fill(255,255,255);\n break;\n case(\"frontier\"):\n fill(0,255,0);\n break;\n case(\"path\"):\n fill(255,247,0);\n break;\n case(\"debug\"):\n fill(255,255,0);\n break;\n default:\n noFill();\n }\n\n rect(this.drawX + this.offset, this.drawY + this.offset, this.size - this.offset*2, this.size - this.offset*2, 5);\n }", "title": "" }, { "docid": "45b67cc15fa9591f208694568dc32b2a", "score": "0.77170634", "text": "function draw() { \n \n \n\n\n}", "title": "" }, { "docid": "910a3902afcd81ec3e97992adab71012", "score": "0.77148134", "text": "draw(context) {\n }", "title": "" }, { "docid": "e50bf3334eb1d3a9292d20abfa9d8532", "score": "0.7668053", "text": "function draw() {\n \n}", "title": "" }, { "docid": "19c4f547006b76cf26698dfb55b9766c", "score": "0.76330996", "text": "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n\n }", "title": "" }, { "docid": "e7337356da5ee5d101079a4ab15b5d3a", "score": "0.7623974", "text": "draw() {\n this.checkContext();\n this.setRendered();\n\n const tick_context = this.getTickContext();\n const next_context = _tickcontext__WEBPACK_IMPORTED_MODULE_2__[\"TickContext\"].getNextContext(tick_context);\n\n const begin_x = this.getAbsoluteX();\n const end_x = next_context ? next_context.getX() : this.stave.x + this.stave.width;\n const y = this.stave.getYForLine(this.line + (-3)) + 1;\n\n L(\n 'Drawing ',\n this.decrescendo ? 'decrescendo ' : 'crescendo ',\n this.height,\n 'x',\n begin_x - end_x\n );\n\n renderHairpin(this.context, {\n begin_x: begin_x - this.render_options.extend_left,\n end_x: end_x + this.render_options.extend_right,\n y: y + this.render_options.y_shift,\n height: this.height,\n reverse: this.decrescendo,\n });\n }", "title": "" }, { "docid": "fb5f6e71fe4e673fc15fbdf2c3b48cb8", "score": "0.7621915", "text": "_draw() {\n this._drawSpeedbar();\n this._drawVario();\n }", "title": "" }, { "docid": "96abfc30267516e161bdc6cbd889d887", "score": "0.76213", "text": "draw(){\n //take away the border using stroke\n noStroke()\n fill('rgba(246, 36, 89, 0.5)')\n circle(this.pos.x, this.pos.y, this.size);\n }", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "68e386604bb192cfdcc81d696fecd2b1", "score": "0.7619086", "text": "function draw() {\n\n}", "title": "" }, { "docid": "5e4266d11f509e320a28e4780275f253", "score": "0.7606568", "text": "function draw() {\n//drawPrettySquares();\ndrawSomeImage();\ndrawSomeText();\n}", "title": "" }, { "docid": "26aa189db2cc9de9f8c9f17417ddec4f", "score": "0.7604728", "text": "draw(){\n ctx.beginPath();\n ctx.moveTo(this.x1,this.y1);\n ctx.lineTo(this.x2,this.y2);\n ctx.fillStyle = this.fillColour;\n ctx.lineWidth = this.lw;\n ctx.stroke();\n }", "title": "" }, { "docid": "2e99cc9457fe49da76f85603aa8105bd", "score": "0.76005346", "text": "draw():void {}", "title": "" }, { "docid": "e6d0f1993030a3b0bea306a0afaede54", "score": "0.75931734", "text": "draw() {\n this.context.beginPath()\n // je relie les points en fonction de leur dernière position\n this.context.moveTo(this.prevX, this.prevY);\n this.context.lineTo(this.currX, this.currY);\n this.context.strokeStyle = \"black\";\n this.context.lineWidth = 2;\n this.context.stroke();\n this.context.closePath();\n }", "title": "" }, { "docid": "5f78d80c638e448b61a7c48ede42b770", "score": "0.7574606", "text": "draw(){\n\t\t\n\t\tthis.context.setLineDash(this.model.lineDash);\n\t\tthis.context.beginPath();\t\n this.context.lineWidth=this.model.lineWidth;\n\t\tthis.context.strokeStyle=this.model.color;\n this.context.moveTo((this.context.canvas.getAttribute('width')/2)-this.model.lineWidth/2, 0);\n this.context.lineTo((this.context.canvas.getAttribute('width')/2)-this.model.lineWidth/2,this.context.canvas.getAttribute('height'));\n this.context.stroke();\n\t}", "title": "" }, { "docid": "c024f950238d67a344aea0bc4a518d77", "score": "0.75642073", "text": "function render(){\n\t// Draw methods\n}", "title": "" }, { "docid": "04615562ead4e91fc4787529b57fb5ee", "score": "0.7556714", "text": "draw() {\r\n fill(38, 33, this.groundColor);\r\n strokeWeight(0);\r\n rect(0, 590, this.width, this.height);\r\n }", "title": "" }, { "docid": "de914c1ab6f98c60b3352633fcee1612", "score": "0.75109076", "text": "draw() {\n if (this.isVisible) {\n this.preDraw();\n this.internalDraw();\n this.postDraw();\n }\n }", "title": "" }, { "docid": "8c1950ce4d6d18b7270663e6f6005c3d", "score": "0.7503707", "text": "function draw() {\n bg.draw();\n fg1.draw();\n drake.draw();\n pipes.draw();\n fg2.draw();\n score.draw();\n\n }", "title": "" }, { "docid": "0238cd187e4cf7ec4108abf6a63b3547", "score": "0.75006187", "text": "function draw(){\n if(touchWasClicked)\n {\n background(ui.getBackgroundColor());\n ui.drawGrid();\n stroke(ui.getStringColor());\n\n geom.drawLines();\n noStroke();\n\n // draw intersections\n fill(ui.getButtonColor());\n phys.drawNodes();\n\n // draw pinned nodes\n fill(ui.getHighlightColor());\n phys.drawPinnedNodes();\n\n // print text instructions\n fill(ui.getButtonColor());\n ui.pinText();\n\n touchWasClicked = false;\n }\n }", "title": "" }, { "docid": "73d897feb76b32ad82390b439d1065e7", "score": "0.748565", "text": "draw() {\n push();\n this.onDraw();\n pop();\n }", "title": "" }, { "docid": "a2288c3042a68969754f4fa02ac94ae3", "score": "0.74520046", "text": "function draw(){\n /* START OF YOUR CODE */\n \n /* END OF YOUR CODE */\n}", "title": "" }, { "docid": "683082022a01e5c6d3bfa92dd7f10e47", "score": "0.74434024", "text": "display(){\r\n ctx.beginPath();\r\n ctx.moveTo(this.x, this.y);\r\n ctx.lineTo(this.x + this.acc_x*100, this.y + this.acc_y*100);\r\n ctx.strokeStyle = \"green\";\r\n ctx.stroke();\r\n ctx.closePath();\r\n ctx.beginPath();\r\n ctx.moveTo(this.x, this.y);\r\n ctx.lineTo(this.x + this.vel_x*10, this.y + this.vel_y*10);\r\n ctx.strokeStyle = \"blue\";\r\n ctx.stroke();\r\n ctx.closePath();\r\n }", "title": "" }, { "docid": "37f9b8b8619b5a84b9f53f79f49e506c", "score": "0.7431836", "text": "draw(){\n\n\t\tswitch(this.status){\n\t\t\tcase Shape.STATUS.idle:\n\t\t\t\treturn;\n\t\t\tcase Shape.STATUS.start:\n\t\t\t\tthis.points.push(this.startPos) // add point\n\t\t\t\tbreak;\n\t\t\tcase Shape.STATUS.middle:\n\t\t\t\tthis.removeShape(); // remove shape\n\t\t\t\tbreak;\n\t\t\tcase Shape.STATUS.end:\n\t\t\t\tthis.points.push(this.clickPos); //add point\n\t\t}\n\n\t\tlet ctx = this.ctx;\n\t\tctx.fillStyle = this.color;\n\t\tif(this.status !== Shape.STATUS.start){\n\t\t\t// calculate width by subtracting start x value from current x value\n\t\t\tlet width = this.clickPos[0] - this.startPos[0];\n\t\t\t// calculate height by subtracting start y value from current y value\n\t\t\tlet height = this.clickPos[1] - this.startPos[1];\n\t\t\t// draw rectangle\n\t\t\tctx.fillRect(this.startPos[0],this.startPos[1],width,height);\n\t\t}\n\n\t}", "title": "" }, { "docid": "baa99a7c50105e4c841c8682ca463f16", "score": "0.7425878", "text": "function draw(){\n\n}", "title": "" }, { "docid": "524b0c5bf1f6889cbdbac2923fc0e409", "score": "0.7395637", "text": "function draw(context) {\n // Main drawing code\n}", "title": "" }, { "docid": "51a37c8bf236b32ab4e7757e66fdeab8", "score": "0.7391188", "text": "function draw() {\n\t//drawDancingPoints()\n}", "title": "" }, { "docid": "0bed1d54130fbfe21a7c190d34982133", "score": "0.73910666", "text": "draw()\n {\n this.ctx.beginPath();\n this.ctx.rect(this.x, this.y, this.width, this.height);\n for (var key in this.styleOptions.boxStyles[this.style])\n {\n this.ctx[key] = this.styleOptions.boxStyles[this.style][key];\n }\n this.ctx.lineWidth=1+(this.ratio*this.styleOptions.votingStyle[\"maxWidth\"]);\n this.ctx.stroke();\n for (var key in this.styleOptions.textStyles[this.style])\n {\n this.ctx[key] = this.styleOptions.textStyles[this.style][key];\n }\n var [x, y] = this.getLabelPos();\n this.ctx.fillText(this.label, x, y);\n var [x, y] = this.getPercentagePos();\n this.ctx.fillText(this.formatPercentage(), x, y);\n }", "title": "" }, { "docid": "d9458a08e0ca262c37a1cbdface5d433", "score": "0.7368647", "text": "draw() {\n\t\tctx.beginPath();\n\t\tctx.arc(this.x,this.y,this.size,0,Math.PI * 2, false);\n\t\tctx.fillStyle = 'rgb(80, 83, 85)';\n\t\tctx.fill();\n\t}", "title": "" }, { "docid": "89f8703a5ec06e325c677b563fddf304", "score": "0.7360455", "text": "draw() {\n\t\tthis.wrap.draw();\n\t\tctx.fillStyle = palette.background;\n\t\tctx.globalAlpha = .3;\n\t\tctx.fillRect(0, 0, WIDTH, HEIGHT);\n\t\tctx.globalAlpha = .7;\n\t\tctx.fillRect(this.x, this.y, this.width, this.height);\n\t\tctx.globalAlpha = 1;\n\t\tthis.tabs.draw();\n\t\tctx.fillStyle = palette.normal;\n\t\tdrawTextInRect(lg(this.wrap.level.lModeName), this.x, this.y, this.width, 60);\n\t\tdrawParagraphInRect(this.text, this.x, this.y+140, this.width, this.height-200, 24);\n\t\tif (Array.isArray(this.hints)) {\n\t\t\tthis.prevHintButton.draw();\n\t\t\tthis.nextHintButton.draw();\n\t\t\tctx.fillStyle = palette.normal;\n\t\t\tdrawTextInRect((this.hintIndices[this.tabIndex]+1)+\"/\"+this.hints.length, this.prevHintButton.x+this.prevHintButton.width, this.prevHintButton.y, this.nextHintButton.x-this.prevHintButton.x-this.prevHintButton.width, this.prevHintButton.height);\n\t\t}\n\t\tthis.wrap.menuButton.draw();\n\t}", "title": "" }, { "docid": "5a04faac41548052ec62044e7956f070", "score": "0.73602486", "text": "draw (ctx) {\n if (!this.lines) this.createLines()\n\n // uncomment this to see the array of lines\n // console.log(lines)\n\n this.lines.forEach(line => line.draw(ctx))\n this.drawText(ctx)\n }", "title": "" }, { "docid": "4c98f32a7c14ca100d0c3325218147ff", "score": "0.73547834", "text": "draw() {\n background(10, 50, 70);\n this._drawDashedCenterLine();\n this._drawWall(0 + this.wallThickness / 2);\n this._drawWall(height - this.wallThickness / 2);\n this._refreshPlayerScores();\n this._refreshStatusMessage();\n this._refreshUsageMessage();\n this._showPauseState();\n }", "title": "" }, { "docid": "5d25c748d42fe2e8e333dab8bed97c62", "score": "0.73538315", "text": "draw() {\n this.checkContext();\n this.setRendered();\n if (this.unbeamable) return;\n\n if (!this.postFormatted) {\n this.postFormat();\n }\n\n this.drawStems();\n this.applyStyle();\n this.drawBeamLines();\n this.restoreStyle();\n }", "title": "" }, { "docid": "c5d3eb424f64fd38fe2694efb9204845", "score": "0.73468685", "text": "draw() {\r\n this.context.fillStyle = 'black';\r\n this.context.fillRect(this.x, this.y, this.width, this.height);\r\n }", "title": "" }, { "docid": "48d276a26439cc01d16bc5edda5406c7", "score": "0.73462504", "text": "function draw() {\r\n t = model.get_t();\r\n shift = (t%2==0) ? 0 : Math.floor(w/2);\r\n ctx.fillStyle = '#eeeeee';\r\n ctx.fillRect(0, w*model.get_t()+1, cw, w);\r\n ctx.fillStyle = '#ffffff';\r\n ctx.fillStyle = (model.get_n()>0) ? '#ffffff' : '#f9f9f9';\r\n ctx.fillRect(0, w*model.get_t(), cw, w);\r\n ctx.fillStyle = '#3366cc';\r\n for(i=0; i<L+1; ++i) {\r\n if(model.state[i]==1) {\r\n ctx.fillRect(w*i - shift, w*model.get_t(), w, w);\r\n }\r\n }\r\n\r\n if(!(graph === undefined)) {\r\n graph.draw(t, model.get_val());\r\n }\r\n }", "title": "" }, { "docid": "11af13da6b7da774c2bbd3c2875e2a53", "score": "0.73449796", "text": "draw(ctx) {this.AbstractMethod(\"draw\");}", "title": "" }, { "docid": "f88097c3d6d5098a924f3d6f3b710f1c", "score": "0.7339169", "text": "function draw() {\n\t\t\t\tctx.clearRect(0, 0, ctx.canvas.width * 4/3, ctx.canvas.width * 4/3);\n\n\t\t\t\tfor (var i = 0; i < scope.arrows.length; i += 1) {\n\t\t\t\t\tif (scope.arrows[i].i !== scope.arrows[i].d.length)\n\t\t\t\t\t\tdrawArrow(scope.arrows[i]);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "5514bc0d13449f1160b4b80145a19a31", "score": "0.73324096", "text": "draw() {\n let xOffset = this.bob.getNextX();\n\n this.drawBody(xOffset);\n this.drawHead(xOffset);\n this.drawFace(xOffset);\n this.drawCrown(xOffset);\n this.drawMoustache(xOffset);\n }", "title": "" }, { "docid": "37aa30535fb3f165cf0601d6c93b9107", "score": "0.73280656", "text": "draw() {\n var ctx = this.ctx; // Make sure canvas is the correct size\n\n this.resize(); // Reset drawn objects list\n\n this._drawnElements = []; // Draw the entire GUI\n\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.model.activeTimeline.guiElement.draw(); // Draw current popup menu\n\n if (this._popupMenu) {\n this._popupMenu.draw();\n } // Draw tooltips\n\n\n this._mouseHoverTargets.forEach(target => {\n if (target.tooltip) {\n target.tooltip.draw(target.localTranslation.x, target.localTranslation.y);\n }\n });\n }", "title": "" }, { "docid": "8163806043129f24aeb8433400c202ae", "score": "0.73251134", "text": "draw() {\n var pixelBoundX = this.boundX * this.size;\n var pixelBoundY = this.boundY * this.size;\n // Background color\n this.__ctx.fillStyle = this.backgroundColor;\n this.__ctx.fillRect(0, 0, pixelBoundX, pixelBoundY);\n // Draw Grid\n this.__ctx.lineWidth = 2;\n //this.__ctx.setLineDash([7]);\n this.__ctx.strokeStyle = this.gridLineColor;\n for (var x = 0; x < pixelBoundX; x += this.size) {\n this.__ctx.beginPath();\n this.__ctx.moveTo(x, 0);\n this.__ctx.lineTo(x, pixelBoundY);\n this.__ctx.stroke();\n }\n for (var y = 0; y < pixelBoundY; y += this.size) {\n this.__ctx.beginPath();\n this.__ctx.moveTo(0, y);\n this.__ctx.lineTo(pixelBoundX, y);\n this.__ctx.stroke();\n }\n this.__ctx.setLineDash([]);\n // Draw Elevators\n this.elevators.forEach(function (elevator) {\n elevator.draw(this.size);\n }, this);\n // Draw Rooms\n this.rooms.forEach(function (room) {\n room.draw();\n }, this);\n this.rooms.forEach(function (room) {\n room.secondDraw();\n }, this);\n // Banner\n this.drawBanner();\n }", "title": "" }, { "docid": "3d8e15c3ec83f2b198da6e056cf7415f", "score": "0.73233867", "text": "draw() {\n\n ctx.beginPath();\n ctx.rect(this.x, this.y, this.width * tileSize, tileSize);\n ctx.fillStyle = this.color;\n ctx.fill();\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.closePath();\n\n }", "title": "" }, { "docid": "b6f4a3a093fbd5407552e14536c63ae5", "score": "0.7314636", "text": "draw() {\n this.canvas.draw();\n }", "title": "" }, { "docid": "ba9686270224d6401338408c4b2a6a2f", "score": "0.73014617", "text": "function draw() {\n\t\tdrawMap();\n\t\tdrawDawg();\n\t}", "title": "" }, { "docid": "82a3763f6382ca5f1459bf4c3f9fba07", "score": "0.7298638", "text": "draw(){\n push();\n // fill(255,125);\n noFill();\n noStroke();\n rect(this.x,this.y,this.width,this.height);\n pop();\n }", "title": "" }, { "docid": "84020125b067f354d1e06665d084ba12", "score": "0.72873247", "text": "function startDraw()\r\n {\r\n drawCanvas();\r\n }", "title": "" }, { "docid": "47d69ec0eddada45ebecb72531e8a839", "score": "0.72843224", "text": "function draw(){\n}", "title": "" }, { "docid": "283b7262150ae712dd95b4c0293a4ed4", "score": "0.7282739", "text": "draw (ctx) {\n if (this.game.showOutlines && this.radius) {\n drawOutline(ctx)\n }\n if (this.img) {\n this.drawImg(ctx)\n }\n }", "title": "" }, { "docid": "8510a4887c900f38f2a89aa05e0308c3", "score": "0.7274097", "text": "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "title": "" }, { "docid": "79904e442ad878ffc7acde9bbe1b7768", "score": "0.7267806", "text": "draw () {\n for (let i = 0; i < this.pos.length; i++) {\n context.fillStyle=this.color;\n context.fillRect(offset + fieldSize * this.pos[i], offset + fieldSize * this.pos[i+1], fieldVisibleSize, fieldVisibleSize);\n i = i+1\n }\n }", "title": "" }, { "docid": "300208a3cf9d00123b001c4dffb546a1", "score": "0.7261277", "text": "function draw() {\n\n l.draw().forEach(pos => {\n cntx.fillRect(pos.x, pos.y, 1, 1);\n });\n \n}", "title": "" }, { "docid": "511165bd636f9778a6f8629f0449deec", "score": "0.72022897", "text": "draw() {\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI*2, false);\r\n ctx.fillStyle = '#BD4B4B';\r\n ctx.fill(); \r\n }", "title": "" }, { "docid": "46b01db94c22d6815390d493c0460d18", "score": "0.71745807", "text": "draw() {\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.fillStyle = this.color;\n\t\tctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, true);\n\t\tctx.fill();\n\t\tctx.restore();\n\t}", "title": "" }, { "docid": "173640aa2ef7370d596ce791d6b7ca08", "score": "0.71736", "text": "draw(ctx) {\n ctx.fillStyle = '#0ff';\n ctx.fillRect(this.postion.x, this.postion.y, this.width, this.height);\n }", "title": "" }, { "docid": "db3a6810bbdb030caa4909cb5a1bdcd7", "score": "0.7160634", "text": "function draw() {\n update();\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 1;\n\n if (drawingOptions.drawBackground) ctx.drawImage(backgroundImage, 0, 0);\n if (drawingOptions.drawVertices) drawVertices(vertices);\n if (drawingOptions.drawEdges) drawEdges(edges, vertices);\n\n if (drawingOptions.drawVerticeLabels) drawVerticeLabels();\n if (drawingOptions.drawEdgeLabels) drawEdgeLabels();\n\n if (selectedVertices.length > 0) {\n ctx.beginPath();\n ctx.strokeStyle = \"red\";\n ctx.lineWidth = 4;\n\n drawVertices(selectedVertices.map(vidx => vertices[vidx]));\n }\n }", "title": "" }, { "docid": "80cfe2d4486e3f79d85f95372a45b3b9", "score": "0.71524775", "text": "draw() {\n this.drawSide(true);\n this.drawSide(false);\n this.drawMain();\n this.tick = this.tick + 0.01;\n this.levelStats();\n }", "title": "" }, { "docid": "1a14e082d1473c88ecc85271fba8260d", "score": "0.7109526", "text": "draw() {\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.fillStyle = this.color;\n\t\tctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, true);\n\t\tctx.closePath();\n\t\tctx.fill();\n\t\tctx.restore();\n\t}", "title": "" }, { "docid": "4eb4e4683328bcf2a3cbee18ccb0ef98", "score": "0.71084523", "text": "function draw() {\n translate(150,-250);\n draw_full();\n }", "title": "" }, { "docid": "01c6482a3eb7e5f954096e277d5b60df", "score": "0.7108024", "text": "draw() {\n // Placeholer\n }", "title": "" }, { "docid": "73b2181a205b4c26aeb8264d8b422f62", "score": "0.7107267", "text": "draw() {\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n }", "title": "" }, { "docid": "6d9f9690a5f758ebd2b6dea31da0ac3c", "score": "0.71063936", "text": "draw()\n\t{\n\t\tthis._context.fillStyle='#055';\n\t\tthis._context.fillRect(0,0, \n\t\t\tthis._canvas.width, this._canvas.height);\n\t\tthis.drawCirc(this.ball);\n\t\tthis.players.forEach(player=>{\n\t\t\tthis.drawPaddle(player);\n\t\t});\n\t\tthis.drawScore();\n\t\tif(this.isPaused)\n\t\t{\n\t\t\tthis.drawPaused();\n\t\t}\n\t}", "title": "" }, { "docid": "6e85ed9ef97cc5bac406e5c9dbfab3cc", "score": "0.71021736", "text": "draw () {\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x * box, this.y * box, box, box);\n }", "title": "" }, { "docid": "7daed1ec9affced23c503c040328b440", "score": "0.7099428", "text": "draw(g){\n\t\tsuper.draw(g);\n\t}", "title": "" }, { "docid": "ac34e83c5bdf5a324545abba99417840", "score": "0.7090898", "text": "function draw() {\r\n context.clearRect(0, 0, canvas.width, canvas.height); \r\n context.strokeStyle = \"#ff0000\"; \r\n context.beginPath();\r\n context.rect(x - 5, y - 5, 10, 10);\r\n context.fill();\r\n}", "title": "" }, { "docid": "639dcb81b18859cc09efd6441b45ed5f", "score": "0.7078451", "text": "draw() {\n push();\n\n let lineNum = this.currentLineNum;\n\n // set drawY based on top or bottom drawing\n let drawY;\n if( this.topDraw ) {\n drawY = 25;\n }\n else {\n drawY = height - (this.vOffset + (this.numLines * this.lineHeight) );\n }\n\n // rect-drawing\n if( this.drawBackgroundRect ) {\n noStroke();\n fill(0,0,0,64);\n rectMode(CORNER);\n rect( this.hOffset-this.rectOffset, drawY-this.rectOffset*2, width, this.numLines*this.lineHeight + this.rectOffset*2);\n }\n \n // text-drawing settings\n fill(this.fillColor);\n textSize(this.textSize);\n textAlign(LEFT);\n\n // draw each line\n for( let i = 0; i < this.numLines; i++ ) {\n text( this.lines[lineNum], this.hOffset, drawY + (i * this.lineHeight) );\n lineNum++;\n if( lineNum === this.numLines ) {\n lineNum = 0;\n }\n }\n\n pop();\n }", "title": "" }, { "docid": "adae7090b4a713ce953333137126278a", "score": "0.7076271", "text": "draw() {\n // Always call the super() version of the method if there is one\n // just in case it does something important.\n super.draw();\n\n background(0);\n\n // Call the state's methods to make the animation work\n this.move();\n this.display();\n this.checkEnding();\n }", "title": "" } ]
2f566755a2e36a138e6bf8e38685bbe4
Check value is present or not & call google api function
[ { "docid": "2e8fdc0fa8227bb5d1b8b79b726698cc", "score": "0.0", "text": "function initializeCurrent(latcurr, longcurr) {\n currgeocoder = new google.maps.Geocoder();\n console.log(latcurr + \"-- ######## --\" + longcurr);\n\n if (latcurr != '' && longcurr != '') {\n var myLatlng = new google.maps.LatLng(latcurr, longcurr);\n return getCurrentAddress(myLatlng);\n }\n }", "title": "" } ]
[ { "docid": "cc620e4f7784cafa12308f3eef4d8cb1", "score": "0.55776703", "text": "function initAutocomplete() {\nvar input = document.getElementById('pac-input');\nvar searchBox = new google.maps.places.SearchBox(input);\nsearchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n \n\n if (places.length == 0) {\n return;\n }\n\n});\n\n} // retrieving search box places google function goes here.......", "title": "" }, { "docid": "001701fa4950f61544064bb9dd85552c", "score": "0.55714184", "text": "function callBckFunGeoAddLoc(status, resulttable)\n{\n\tif(status == 400) \n\t{\n\t\tif (resulttable[\"results\"]== undefined)\n\t\t{\n\t\t\tfrmGeoCurrentNWatch.lblGeoAdress.text = \"Service not available.Please check your network connections and try again.\";\n\t\t\tkony.application.dismissLoadingScreen();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tif (resulttable[\"results\"] ==[])\n\t\t\t{\n\t\t\t\tfrmGeoCurrentNWatch.lblGeoAdress.text = \"No address found with the current latitude and longitude\"\n\t\t\t\tkony.application.dismissLoadingScreen();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfrmGeoCurrentNWatch.lblGeoAdress.text = resulttable[\"results\"][0][\"formatted_address\"];\n\t\t\t\tkony.application.dismissLoadingScreen();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "05af796c6fc16ad048b406fa12302fb1", "score": "0.55671865", "text": "function geoLocateApiRequest(address) {\n const queryA = {\n address: address,\n };\n\n const geocoder = new google.maps.Geocoder();\n geocoder.geocode(queryA, function(results, status) {\n if (status == 'OK') {\n campApiRequest(results);\n } \n else if (status == 'ZERO_RESULTS') {\n const displayZero = `<p class=\"zero\"><b>ZERO RESULTS</b>.<br>This may occur when the \"Where\" input was passed a non-existent location.</p>`\n $('#campTitle').prop('hidden', false);\n $('.js-camp-results').prop('hidden', false).html(displayZero);\n }\n else {\n $('.js-camp-results').prop('hidden', false).html(`<p class=\"zero\">INVALID REQUEST: Something was entered incorrectly</p>`);\n }\n });\n}", "title": "" }, { "docid": "b931acd1e45edffdef4253ec3bc24a73", "score": "0.55005914", "text": "function check_api_availability(queryData) {\n var keys = common.getDictionaryKeyList(queryData);\n if(keys.indexOf(\"loc\") > -1 && keys.indexOf(\"hosp\") > -1) {\n if(queryData[\"loc\"].length < 1 || queryData[\"loc\"].split(\";\").length != 2) {\n return 2;\n }\n if(parseInt(queryData[\"hosp\"]) < 1 || parseInt(queryData[\"hosp\"]) > 3) {\n return 3;\n }\n return 0;\n }\n return 1;\n}", "title": "" }, { "docid": "c645498c343818bc1d852a2aa4a53036", "score": "0.5500436", "text": "function checkAnnotationInput(annotation, obj, url) {\n url= url || '/SNORic/api/snorna/';\n $.getJSON(url+annotation, function(data){\n if(data.length > 0){\n showSuccess(obj,'');\n }else{\n showError(obj, 'No match for ['+ annotation +']')\n }\n });\n }", "title": "" }, { "docid": "2a440a5074694e7186a5743604672250", "score": "0.549825", "text": "function koreksiessay_value(e){\r\nvar idbaris = e.parameter.brs;\r\n var rowk = idbaris;\r\nvar nilaiEssay = e.parameter.nilaiEssay;\r\nvar ss = SpreadsheetApp.openById(\"14tAB-F2JlTBhdItrcr5ZPEmGlktcV65thf3djcacRd0\").getSheetByName(\"responnilai\");\r\n ss.getRange(rowk, 8).setValue(nilaiEssay)\r\n//var urlk = ss.getParent().getUrl()\r\n\r\n\r\n var output=\"Data Nilai Essay telah berhasil diperbarui.\";\r\n\r\n var result = JSON.stringify({\r\n \"result\": output\r\n }); \r\n \r\n return ContentService\r\n .createTextOutput(e.parameter.callback + \"(\" + result + \")\")\r\n .setMimeType(ContentService.MimeType.JAVASCRIPT); \r\n\r\n \r\n}", "title": "" }, { "docid": "e78cf404fda6b13184cc0db67ff35567", "score": "0.54915696", "text": "function noBuenoGoogle(){\n alert(\"Unable to reach the Google Maps API. Please check your network connection and try again later.\");\n}", "title": "" }, { "docid": "9c320e211bf319ca139c3af72115a3f3", "score": "0.5417916", "text": "function def(x)\n{\n\tvar theUrl=\"https://googledictionaryapi.eu-gb.mybluemix.net/?lang=en&define=\"\n\ttheUrl+=x;\n\n\trequest(theUrl, function(error, response, body){\n\t\tlet result = JSON.parse(body);\n\t\tconsole.log(result.status);\n\t\treturn result.status;\n\t})\n}", "title": "" }, { "docid": "ac68f392a478ac4f9d5cafb54825857a", "score": "0.5409959", "text": "function searchKeyWord() {\n\tkeyWord = $('#keyWord').val(); // get value from key word input\n\n\tif(keyWord == null || keyWord =='' ){\n\t\talert('You need to type a key word');\n\t}\n\t\n\tgetApi();\n}", "title": "" }, { "docid": "68a2c2cf41c1943ad483a63da2576501", "score": "0.53629893", "text": "function swapi4() {\n \n // Add the base URL for the Star Wars API to a variable\n var queryString = \"http://swapi.co/api/\"\n var endpoint = \"bob\"\n \n var params = {\n 'method': 'GET',\n 'muteHttpExceptions': true // allows program to continue despite error fetching the API with missing endpoint\n }\n \n // deliberately use the wrong URL\n var rc = UrlFetchApp.fetch(queryString + endpoint, params).getResponseCode();\n \n if (rc == 200) {\n // output the planet name in our Google Sheet\n Logger.log(rc);\n }\n else {\n // do something...\n Logger.log(\"Uh-oh! I searched for '\" + endpoint + \"' but the server returned response code \" + rc + \", which means I didn't find what you were looking for.\"); \n }\n \n}", "title": "" }, { "docid": "87b689449f6966c907b755ffa85b226d", "score": "0.53520364", "text": "function makeApiCall() {\n gapi.client.sheets.spreadsheets.values.get({\n spreadsheetId: process.env.REACT_APP_SHEET_ID,\n range: \"A:D\"\n }).execute(res => {\n setStudents(res['values'])\n });\n }", "title": "" }, { "docid": "ef94a7d1f3a2b13883b971df8f1ac0b8", "score": "0.5323887", "text": "function FormApiPull(number, name, city, zipcode) {\n var numSet = number.trim().split(\" \").join(\"+\") + ',';\n var nameSet = name.trim().split(\" \").join(\"+\") + ',+';\n var citySet = city.trim().split(\" \").join(\"+\") + ',+';\n var zipSet = zipcode.trim().split(\" \").join(\"+\");\n address = 'https://maps.googleapis.com/maps/api/geocode/json?address=' +\n numSet +\n nameSet +\n citySet +\n 'NC+' +\n zipSet +\n '&key=AIzaSyCF_LnSPL7yY5VIDbPCbBo9e03StuCuTTs';\n console.log(address);\n return address;\n}", "title": "" }, { "docid": "112a777df24d0cfdcfb3e80054729331", "score": "0.53146154", "text": "function keyWordsearch(){\n gapi.client.setApiKey(\"AIzaSyD0YSEl2wfZp3a6dJFKIU6rWLLhSJYyRwo\");\n gapi.client.load('youtube', 'v3', function() {\n makeRequest();\n });\n }", "title": "" }, { "docid": "0e877e6dca12170665b74e75990eb253", "score": "0.53126264", "text": "function checkCountry(covid_data, country){\n\n var check = false; // Boolean to check if a country is found during check\n for( i=0; i<covid_data.length-1; i++){\n var test = covid_data[i][\"Country_text\"].toLowerCase()\n if (country == test){\n check = true;\n parseData(covid_data[i]);\n return;\n }\n }\n //if no country submitted in the form is found in the JSON dict, check Bool remains false - alert is given \n if(check == false){\n alert('Country not found');\n }\n //Page is reset to the default entry of World Data after alert\n pullData(covid_data, '');\n}", "title": "" }, { "docid": "9de536dedcadc07ca69597448857fb8f", "score": "0.528055", "text": "function userSubmit(){\n checkVersion();\n userName = document.getElementById(\"userInputName\").value;\n userRegion = document.getElementById(\"userInputRegion\").value;\n if (userName!==\"\"){\n getData(userName, userRegion);\n }\n else {console.log(\"Please provide a summoner name\")}\n}", "title": "" }, { "docid": "3907e4065173f8fb7de5bce4734d5de2", "score": "0.5272444", "text": "function selectItem(value) {\r\n if (value == null || value == \"\") {\r\n alert(\"Please select a keyword to search for tweets\");\r\n }\r\n else {\r\n // open pop up window on web page when adding new tweets.\r\n window.confirm(\"Notification: New Tweets are adding for topic:\" + value.toUpperCase());\r\n globalVal=value;\r\n deleteMarkers()\r\n httpGetAsync(\"API-GATEWAY-FOR-ES\");\r\n console.log(value.toUpperCase())\r\n }\r\n}", "title": "" }, { "docid": "a96166f531db8a26e1deb6912600e945", "score": "0.5262919", "text": "function get_lat_lon_val() {\n var name = document.forms[\"name_distance_mag\"][\"name_val\"].value;\n if (name == \"\") {\n alert(\"Details must be filled out\");\n return false;\n }\n else{\n fetch('/profile/get_lat_lon_val', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({name: name}),\n })\n .then(response => response.json())\n .then(data => {\n console.log('Success:', data);\n loc_details(data);\n })\n .catch((error) => {\n console.error('Error:', error);\n }); \n return false;\n }\n}", "title": "" }, { "docid": "b7df11cb15621c1b68cdd824006fa924", "score": "0.52627355", "text": "function LooksPlacePrice(location,values) { \n app.progressbar.show('multi');\nvar request = {\n location: location,\n radius: '200',\n query: filtro,\n minPriceLevel:values.min,\n maxPriceLevel:values.max \n };\n\n service.textSearch(request, ShowResult);\n\n}", "title": "" }, { "docid": "6ca66d01b723637130bc05380deb3b43", "score": "0.5261728", "text": "_getValue_unavailable() {}", "title": "" }, { "docid": "6ca66d01b723637130bc05380deb3b43", "score": "0.5261728", "text": "_getValue_unavailable() {}", "title": "" }, { "docid": "fb96aa741992d49db45174b8e8554a22", "score": "0.5261051", "text": "function locationFunction(request, response) {\n const city = request.query.city;\n let key = process.env.GEODUDE_API_KEY;\n const url = `https://us1.locationiq.com/v1/search.php?key=${key}&q=${city}&format=json`;\n if (city === '' || city === ' ') {\n invalidInput(response);\n } else {\n checkForDatabaseLocation(city, response, url);\n flagTrigger = false;\n }\n}", "title": "" }, { "docid": "1a5b98e8a5e0ce5fc35aebe0cda63d9a", "score": "0.52528", "text": "function Search_Placesi(location,rad)\n{\n console.log(\"inside Search Places\");\n var selectedMode=document.getElementById('soflow').value;\n var service = new google.maps.places.PlacesService(map);\n service.nearbySearch({\n location: location,\n radius: rad*1000 ,\n type: selectedMode,\n }, callback);\n return 1; \n}", "title": "" }, { "docid": "6b117de58c5ec03048954dbfd297628e", "score": "0.52450633", "text": "function chkEligibility (uin, callback) {\n firestore.collection('appts').doc(uin).get()\n .then(doc => {\n let eligibility = {status: 0, data: {}};\n if (doc.exists && doc.data().slot.length !== 0) {\n console.log(\"Appointment slot has already assigned: \", doc.data());\n eligibility.status = 9; \n eligibility.data = doc.data();\n } else if (doc.exists && doc.data().slot.length === 0) {\n console.log(\"Eligible to make appointment: \", doc.data());\n eligibility.status = 1; \n eligibility.data = doc.data();\n } else {\n console.log(\"Not eligible for appointment \", uin);\n eligibility.status = 0; \n eligibility.data = doc.data();\n }\n callback(eligibility);\n return \"Elgibility checks completed\";\n })\n .catch(error => {\n console.error(\"Error getting document:\", error);\n });\n}", "title": "" }, { "docid": "986db6246cde5f1869dc6237fbc11c58", "score": "0.5242189", "text": "function getGoogleplacesResult(postalCode, googleAPIkey) {\n return new Promise((resolve, reject) => {\n\n let https = require('https');\n let url = \"https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=\" + postalCode + \"&inputtype=textquery&fields=geometry&key=\" + googleAPIkey\n\n request(url, function (err, res, body) {\n //console.log('before if')\n if (err) {\n console.log('Error', err)\n reject(err)\n //check status\n } else {\n //console.log('HERE', body)\n resolve(body)\n }\n })\n })\n}", "title": "" }, { "docid": "87d0f7500e054bf881b9e1ae5a2d5e1a", "score": "0.5229206", "text": "function getGeoCode(isIntial){\n\n var srch = document.getElementById('search');\n var location = _app.default;\n var process = processIntialGC;\n\n if(isIntial==false){\n if(_app.reg.test(srch.value)==true){\n location = srch.value;\n process = processGeoCode;\n srch.value = \"\";\n }\n else{\n return;\n }\n }\n var url = \"https://www.mapquestapi.com/geocoding/v1/address?key=\"+_app.Geokey+\"&location=\"+location+\",NZ\";\n fetch(url,{method:'GET'}).then(response => response.json()).then(process,handleGCError);\n}", "title": "" }, { "docid": "4939c3de81a87830e68a2f0f1a484d21", "score": "0.5193133", "text": "function getCurrentAdress()\n{\n\t\n\tkony.application.showLoadingScreen(\"loadingscreen\",\"Loading...\",constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true,null);\n\tvar url = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\"+latitude+\",\"+longitude+\"&sensor=false\" \n\tvar inputParam = {};\n\tinputParam[\"serviceID\"] = \"GeoAddressJSON\";\n\tinputParam[\"httpheaders\"] = {};\n\tinputParam[\"httpconfigs\"] = {};\n\tinputParam.appID = \"ksa\";\n\tinputParam.appver =\"1.0.0\";\n\tinputParam[\"channel\"] = \"rc\";\n\tinputParam[\"platform\"] = kony.os.deviceInfo().name;\n \n var connHandle = kony.net.invokeServiceAsync(url, inputParam, callBckFunGeoAddLoc)\n}", "title": "" }, { "docid": "aa413e9dc81ed99172159df1582c58f6", "score": "0.5190336", "text": "function retrieveAPIkey() {\n for(var i=0;i<document.getElementsByClassName('span6').length;i++){\n if(document.getElementsByClassName('span6')[i].getAttribute('placeholder')==\"Key has not been generated\")\n apiKey = document.getElementsByClassName('span6') [i].getAttribute('value');\n }\n alert('WaniKani Real Numbers API key set to: ' + apiKey);\n if (apiKey) {\n localStorage.setItem('apiKey', apiKey);\n localStorage.setItem('WRN_doneReviews', 'true');\n //GM_setValue('apikey', apikey);\n //GM_setValue('doneReviews', true);\n }\n}", "title": "" }, { "docid": "aa53c0fd4cbec125484c609a56dc9088", "score": "0.5183698", "text": "function doGet(e){\n Logger.log(\"--- doGet ---\");\n \n // this helps during debuggin\n if (e == null){\n e={}; e.parameters = {name: \"Hornet\", date:new Date(),badValues:\"1\",minTemp:\"40\",meanTemp:\"43\",maxTemp:\"101\", minHumidity:\"-3\",meanHumidity:\"51\",maxHumidity:\"55\"};\n }\n\n try {\n var ss = SpreadsheetApp.openByUrl(ssUrl);\n var summarySheet = ss.getSheetByName(\"Summary\");\n \n date = e.parameters.date;\n badValues = e.parameters.badValues;\n temps = [e.parameters.minTemp, e.parameters.meanTemp, e.parameters.maxTemp];\n humids = [e.parameters.minHumidity, e.parameters.meanHumidity, e.parameters.maxHumidity];\n \n // save the data to spreadsheet\n save_data(ss, e.parameters.name, date, temps, humids, badValues);\n\n SpreadsheetApp.flush();\n\n notify_violations(ss, e.parameters.name);\n\n send_summary(summarySheet);\n \n return ContentService.createTextOutput(\"Wrote:\\n \" + date + \"\\n Name:\" + e.parameters.name);\n \n } catch(error) { \n Logger.log(error); \n return ContentService.createTextOutput(\"oops....\" + error.message \n + \"\\n\" + new Date() \n + \"\\n\" + JSON.stringify(e.parameters));\n } \n}", "title": "" }, { "docid": "f629512fadb32db1698273b5f4aee813", "score": "0.5174022", "text": "function giphAsk() {\nvar url = api + apiKey + input.value() ;\nloadJSON(url, gotData);\n\n}", "title": "" }, { "docid": "65b2eb4c2aefd3072312b3e1e37d0fe8", "score": "0.51679564", "text": "projectvalidateValidProjectNameGet(incomingOptions, cb) {\n const Jira = require(\"./dist\");\n let defaultClient = Jira.ApiClient.instance;\n // Configure OAuth2 access token for authorization: OAuth2\n let OAuth2 = defaultClient.authentications[\"OAuth2\"];\n OAuth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Jira.ProjectKeyAndNameValidationApi(); // Object | Cloudi of the projec // String | The project name.\n /*let cloudid = null;*/ /*let name = \"name_example\";*/ apiInstance.projectvalidateValidProjectNameGet(\n incomingOptions.cloudid,\n incomingOptions.name,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "title": "" }, { "docid": "2d366523d1427991106ef949fe6621c0", "score": "0.5163214", "text": "function gapiCall(userCurrentMessage) {\r\n\t\t\t\t\t\tvar service_url = 'https://kgsearch.googleapis.com/v1/entities:search';\r\n\t\t\t\t\t\tvar params = {\r\n\r\n\t\t\t\t\t\t\t'query' : userCurrentMessage,\r\n\t\t\t\t\t\t\t'limit' : 1,\r\n\t\t\t\t\t\t\t'indent' : true,\r\n\t\t\t\t\t\t\t'key' : '<<api key>>',\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\t$.getJSON(service_url + '?callback=?', params,\r\n\t\t\t\t\t\t\t\tfunction(response) {\r\n\t\t\t\t\t\t\t\t\tconsole.log(response);\r\n\t\t\t\t\t\t\t\t\trep = response;\r\n\t\t\t\t\t\t\t\t\tbotReply();\r\n\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}", "title": "" }, { "docid": "a550c0a899c52456f84b3ccaeb2a9ab9", "score": "0.5147588", "text": "function requestVolunteerByBusiness1() {\n kony.application.showLoadingScreen(null, \"Loading..\", constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true, {\n shouldShowLabelInBottom: \"false\",\n separatorHeight: 20\n });\n //kony.application.dismissLoadingScreen();\n //gblVolunteerId=volunteerID.widgetInfo.data[0].volunteerId;\n // alert(\"the selected\"+JSON.stringify(gblVolunteerId));\n if (!mobileFabricConfigurationForVolunteerRequestVolunteer.isKonySDKObjectInitialized) {\n initializeMobileFabricRequestVolunteerByBusiness();\n } else if (mobileFabricConfigurationForVolunteerRequestVolunteer.isKonySDKObjectInitialized) {\n requestVolunteerByBusiness();\n }\n}", "title": "" }, { "docid": "2639bae7179632f0681e6fd22de48d0b", "score": "0.51441693", "text": "function api_call_url(keywords, results, postcode) {\n var base_url = \"/services/search/FindingService/v1?\";\n var appid = \"GMackeld-40b4-41b0-8799-c897cec58896\"; \n var apicall = base_url + querystring.stringify({\n \"OPERATION-NAME\": \"findItemsByKeywords\",\n \"SERVICE-VERSION\": \"1.0.0\",\n \"SECURITY-APPNAME\": appid,\n \"GLOBAL-ID\": \"EBAY-GB\",\n \"RESPONSE-DATA-FORMAT\": \"JSON\",\n \"keywords\": keywords,\n \"paginationInput.entriesPerPage\": results\n }) + \"&REST-PAYLOAD\";\n if (typeof postcode !== 'undefined') { apicall += \"&buyerPostalCode=\"+postcode+\n \"&itemFilter(0).name=LocalSearchOnly\" +\n \"&itemFilter(0).value=false\" +\n \"&itemFilter(1).name=MaxDistance\" +\n \"&itemFilter(1).value=100\";\n }\n return apicall;\n}", "title": "" }, { "docid": "97506e18e1eff777c070841c765f1d9c", "score": "0.5130577", "text": "function creatCondition() {\r\n return params.ajaxUrl+'user_name='+params.user_name+'&check_token='+params.check_token+'&sdate='+params.sdate+'&plat='+params.plat+'&gbook_type='+params.gbook_type+'&page='+params.page+'&custom_id='+params.custom_id.join()+'&callback=?';\r\n}", "title": "" }, { "docid": "667f460cde8c59985f2d069ecb311970", "score": "0.5126614", "text": "projectvalidateKeyGet(incomingOptions, cb) {\n const Jira = require(\"./dist\");\n let defaultClient = Jira.ApiClient.instance;\n // Configure OAuth2 access token for authorization: OAuth2\n let OAuth2 = defaultClient.authentications[\"OAuth2\"];\n OAuth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Jira.ProjectKeyAndNameValidationApi(); // Object | Cloudi of the project\n /*let cloudid = null;*/ let opts = {\n // 'key': \"key_example\" // String | The project key.\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.projectvalidateKeyGet(\n incomingOptions.cloudid,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "title": "" }, { "docid": "4e48d31014c5aae91a4122b43c4f7d68", "score": "0.5119289", "text": "function kirimsuka_value(e){\r\n var t = e.parameter;\r\n var col = e.parameter.kol;\r\n var brs = e.parameter.brs;\r\n var nama = e.parameter.nama;\r\n var sukake = (col -12)/5;\r\n \r\n var ss = SpreadsheetApp.openById(\"14tAB-F2JlTBhdItrcr5ZPEmGlktcV65thf3djcacRd0\").getSheetByName(\"anjangsana\");\r\n \r\n //isiheader dulu, biarin timpa juga:\r\n ss.getRange(1, col).setValue(\"suka\" + sukake);\r\n //isi siapa namanya\r\n ss.getRange(brs, col).setValue(nama);\r\n \r\n \r\n var result = \"Selamat, Anda berhasil menyukai status Sahabat Anda ....\"\r\n result = JSON.stringify({\"result\":result})\r\n \r\n return ContentService\r\n .createTextOutput( result )\r\n .setMimeType(ContentService.MimeType.JAVASCRIPT); \r\n}", "title": "" }, { "docid": "da46c0a6792107953e7be34129c528ae", "score": "0.511671", "text": "function toggle_google_api_visibility(){\n var google_font_warning = customize.control('indie_studio_font_api_missing'); \n if ( customize( 'indie_studio_google_api' ).get().length < 0 ){\n google_font_warning.activate();\n } else {\n google_font_warning.deactivate();\n }\n }", "title": "" }, { "docid": "5187f45ea90e81b9eb2b0fe666296120", "score": "0.510714", "text": "function cityRequest() {\n var city = document.getElementById(\"cityName\").value\n if (city.length < 1) return;\n else pullWeather(\"\" + city);\n\n }", "title": "" }, { "docid": "30a6e84dbc5708ac8e010e11e6184f91", "score": "0.510545", "text": "function address()\r\n{\r\n location = parse($post('https://maps.googleapis.com/maps/api/geocode/json?latlng=' + latitude + ',' + longitude + '&key=YOURAPIKEY').results[0].formatted_address);\r\n}", "title": "" }, { "docid": "e25dd041d9ba7d24255399c26166888f", "score": "0.5105001", "text": "function googleApiCall() {\n database.ref().limitToLast(1).on('child_added',function(snapshot){\n console.log(\"yelp snapshot: \" + snapshot.val());\n userChoice = snapshot.val();\n console.log(userChoice);\n var lat = snapshot.val().coordinates.latitude;\n var lon = snapshot.val().coordinates.longitude;\n console.log(\"lat &lon\" + lat + lon);\n var input = snapshot.val().name;\n var placeInput = \"input=\" + encodeURI(input);\n var location = \"locationbias=point:\" +lat+\",\"+lon;\n var queryURL = \"https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/place/findplacefromtext/json?\" + placeInput + \"&inputtype=textquery&fields=photos,formatted_address,name,opening_hours,rating&\"+location+\"&key=\"+googleKey\n console.log(\"queryurl: \" + queryURL);\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function(gresponse) {\n googleRating = gresponse.candidates[0].rating;\n yelpRating = userChoice.rating;\n placeName = userChoice.name; \n // console.log(\"inside func googleapi results\" + placeName + googleRating + \"yelp rating: \" +yelpRating);\n showFinal();\n });\n });\n\n}", "title": "" }, { "docid": "12e0ba4a6cdb7ecbc5c8e7e40c70d7ae", "score": "0.50968695", "text": "function get_parameters(){\n zipCode = input_zipCode.value\n\n //petGender = input_petGender.value\n console.log(\"button was checked\", petGender )\n\n clearResults(); \n goGetDogs();\n}", "title": "" }, { "docid": "9730fd94a9715d3540aba4c56aeb6e9f", "score": "0.50949126", "text": "async function callApiSubmit(){\n\n // storing what user submit\n let current_ip_submit = document.getElementById('input_ip').value;\n//\n if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(current_ip_submit))\n {\n console.log('good ip');\n alertt.style.display = 'none';\n } else {\n alertt.style.display = 'block';\n alert(\"You have entered an invalid IP address!\");\n return\n }\n\n\n\n//\n console.log(current_ip_submit);\n const IP_API_LINK_SUBMIT = `https://ipgeolocation.abstractapi.com/v1/?api_key=${api_key}&ip_address=${current_ip_submit}` ; // url for second call\n\ntry{\n const response = await fetch(IP_API_LINK_SUBMIT);\n const data = await response.json();\n\n current_ip = data.ip_address ;\n ip_text.innerText = current_ip ;\n \n current_city = data.region ;\n if(current_city == null){\n current_city = '????'\n } else {\n current_city = data.region ;\n }\n current_country_code = data.country_code ;\n locationn.innerText = `${current_city} , ${current_country_code}`\n \n current_timezone_abbreviation = data.timezone.abbreviation ;\n current_time = data.timezone.current_time ;\n timezonee.innerText = `${current_timezone_abbreviation} - ${current_time}`\n \n current_isp_name = data.connection.isp_name ;\n isp.innerText = current_isp_name;\n\nlatitude = data.latitude ;\nlongitude = data.longitude ;\n\n setNewMap();\n\n console.log('succes' ,data)\n} catch (err) {\nconsole.log( \"error\" , err)\n}\n\n}", "title": "" }, { "docid": "a548613de61f3a7ad78bd95ac7cd2e36", "score": "0.50900763", "text": "function Consult_paciente_gineco(){\n\tif (true) {\n\t\t\n\t}else{\n\t\t\n\t}\n}", "title": "" }, { "docid": "bed41e86e4c664eb7e0ba2256fd964b6", "score": "0.5090043", "text": "function callPlacesAutocomplete() {\n if (!$.isArray(google_places_json) || !google_places_json.length) {\n return false;\n }\n var google_api_key = el_tpl_settings.google_maps_key, extra_param;\n if (google_api_key) {\n extra_param = \"&key=\" + google_api_key;\n }\n\n if (typeof google == \"object\") {\n loadPlacesAutocomplete();\n } else {\n $.getScript('https://www.google.com/jsapi', function () {\n google.load('maps', '3', {\n other_params: 'sensor=false&libraries=places' + extra_param,\n callback: function () {\n loadPlacesAutocomplete();\n }\n });\n });\n }\n}", "title": "" }, { "docid": "9129e38bccdef7a398273cb8bb1a39da", "score": "0.50772613", "text": "function validation_spo(){\n if ((!parameters.get(':s') && !parameters.get(':p') && !parameters.get(':o'))) {\n alert('Parameter S, P or O must be defined.')\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "4974cb1c82d35bc5614e6959de567bfd", "score": "0.50770193", "text": "function checkGoogle()\n{\n\tif($(\"#tickGmail\").is(\":visible\") == true)\n\t{\n\t\t$(\"#tickGmail\").hide();\n\t\t$(\"#googlesigninButton\").html(\"<span class='fa fa-google'></span> <span id='g' style='font-size:11pt'>Gmail</span>\");\n\t\tvar gmailEmail =findPim(\"gmail\");\n\t\tvar gmailAuthCode = {id:gmailEmail,pimSource:\"gmail\",authCode:\"\"};\n\t\tUpdateSourcesObject.authcodes.push(gmailAuthCode);\n\t\tconsole.log(\"GmailAuthCode: \" + JSON.stringify(gmailAuthCode));\n\t}\n\telse\n\t{\n\t\tgoogleretrieve();\n\t\tsetTimeout(function(){\n\t\t\tconsole.log(\"Timeout\");\n\t\t},5000);\n\t\tconsole.log(\"Gmail is now selected!\");\n\t\t\t$(\"#Loading\").fadeIn(1000, function() { \n\t\t\t});\n\n\t\t\tsetTimeout(function(){\n\t\t \t\t$(\"#Loading\").fadeOut(1000, function(){}); \t\n\t\t \t\t$(\"#tickGmail\").show();\n\t\t \t\t$(\"#googlesigninButton\").html(\"<span class='fa fa-google'></span> <span id='g' style='font-size:11pt'>Remove Gmail</span>\");\n\t\t\t\t\n\t\t\t},2000);\n\t} \n}", "title": "" }, { "docid": "3f05e0c0f7ef52c7fb9878454a8d912b", "score": "0.5073254", "text": "function searchCity(event) {\n event.preventDefault();\n let searchInput = document.querySelector(\"#city-input-form\").value;\n let cityApiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${searchInput}&appid=${apiKey}&units=metric`;\n //Second function inside then only runs if get is not sucessfull\n axios.get(cityApiUrl).then(updateCity, errorAlert);\n}", "title": "" }, { "docid": "1916940f9df809992d3e3e502bbc9ead", "score": "0.50728226", "text": "function getAtEventGoogleMarker() {\r\n $timeout(function () {\r\n $scope.request.types = ['bar', 'restaurant'];\r\n $scope.service.nearbySearch($scope.request, setGoogleBarMarker);\r\n $ionicLoading.hide();\r\n }, 0);\r\n }", "title": "" }, { "docid": "505a59f16a4ee343392c5c414d72bc58", "score": "0.5070074", "text": "static checkAPIStatus (postcode) {\n const dummy_payload = {\n 'Control': {\n 'Postcode': 2000,\n 'PremiseType': 'office',\n 'RatingScope': 'Whole Building'\n },\n 'RatingInputs': {}\n }\n\n // Get the access token then fetch results.\n return this.getToken().then((access_token) => {\n return axios({\n method: 'post',\n url: API.apiURL,\n timeout: 15000, // Timeout after 15 seconds.\n headers: {\n 'content-Type': 'application/json',\n 'Authorization': 'Bearer ' + access_token\n },\n data: dummy_payload\n }).then(response => {\n return response.data.length !== 0\n }).catch(e => {\n console.log(e)\n return false\n })\n }).catch(e => {\n console.log(e)\n return false\n })\n }", "title": "" }, { "docid": "fc598c94d1373b9cf5a2e18fd4cf4beb", "score": "0.5067773", "text": "function getOrt(type){\n console.log(\"type: \" + type);\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function(){\n if(xmlhttp.readyState == 4 && xmlhttp.status == 200){\n var data = JSON.parse(xmlhttp.responseText);\n if(data.results[0] == undefined){\n currentloc = \"Sie befinden sich bei keinem Ort, der bewertet werden kann.\"\n return \"Sie befinden sich bei keinem Ort, der bewertet werden kann.\";\n }\n else{\n currentloc = data.results[0].name;\n return data.results[0].name;\n }\n }\n }\n xmlhttp.open(\"GET\",googleurl + params.location + \"&radius=\" + params.radius + \"&type=\"+params.type+\"&key=\" + googleapi, true);\n xmlhttp.send();\n }", "title": "" }, { "docid": "d1aa7bd3fccb425dcd2715399dbc75bd", "score": "0.5065579", "text": "function respondToAdd(e){\r\n var app = UiApp.getActiveApplication();\r\n \r\n var name = library.upperC(e.parameter.nametextbox);\r\n var cont1 = library.proper(e.parameter.cont1nametextbox);\r\n var surname = library.proper(e.parameter.surnametextbox);\r\n var email = library.proper(e.parameter.emailtextbox);\r\n var remail = library.proper(e.parameter.remailtextbox);\r\n var country = library.proper(e.parameter.countrytextbox);\r\n var region = library.proper(e.parameter.regiontextbox);\r\n var city = library.proper(e.parameter.citytextbox);\r\n var site = library.proper(e.parameter.sitetextbox);\r\n var logo = library.proper(e.parameter.logotextbox);\r\n var gdgid = library.idGenerator();\r\n \r\n if ( library.isNotEmpty(name)) {\r\n if (doesExists(name)) {\r\n // \r\n // \r\n // This GDG already exists in the spreadsheet.\r\n //\r\n //\r\n app.getElementById('feedbacklabel').setVisible(true).setText(\"It seems This name: \"+ name + \" is already in use.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n }\r\n else { // GDG already exists\r\n if ( library.isNotEmpty(cont1)) {\r\n \r\n if (email != remail) {\r\n //\r\n // Diference in the emails\r\n //\r\n app.getElementById('feedbacklabel').setVisible(true).setText(\"Error in the email.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n }\r\n else {// diference in emails\r\n var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\r\n if (email != '' & emailPattern.test(email) == true){\r\n \r\n \r\n if (library.isNotEmpty(country)) { \r\n \r\n if (library.isNotEmpty(region)) { \r\n \r\n if (library.isNotEmpty(city)) { \r\n \r\n \r\n \r\n // disable the submit button a moment\r\n app.getElementById('addbutton').setEnabled(false);\r\n \r\n\r\n //\r\n // lock this part of the script \r\n // \r\n // \r\n var lock = LockService.getPublicLock();\r\n if (lock.tryLock(10000)) {\r\n //\r\n // Got the lock can do the sheet stuff now\r\n //\r\n //var File = DocsList.find(\"gdg\"); // Note: DocsList.find returns an array into your variable.\r\n //var Id = File[0].getId();\r\n //var Id = '0AjHGZg_MuQ8KdFhMRDlhUkVNWkpZTmNaREVCb2tTRkE';\r\n var Id = '0AjHGZg_MuQ8KdFpMNE1wR3BtOXBwNjNHdjB4dTZMaFE'; \r\n var Ss = SpreadsheetApp.openById(Id);\r\n var Sheet = Ss.getSheetByName(\"gdg_sheet\");\r\n\r\n // find out the number of rows and columns of the sheet.\r\n var NumRows = Sheet.getLastRow();\r\n var newRow = NumRows + 1;\r\n \r\n Sheet.getRange([newRow],[1]).setValue(library.genTimestamp());\r\n Sheet.getRange([newRow],[2]).setValue(library.whoIs());\r\n Sheet.getRange([newRow],[3]).setValue(library.genTimestamp()); \r\n Sheet.getRange([newRow],[4]).setValue(library.whoIs()); \r\n Sheet.getRange([newRow],[5]).setValue(gdgid); \r\n Sheet.getRange([newRow],[6]).setValue(name);\r\n Sheet.getRange([newRow],[7]).setValue(country); \r\n Sheet.getRange([newRow],[8]).setValue(region); \r\n Sheet.getRange([newRow],[9]).setValue(city); \r\n Sheet.getRange([newRow],[10]).setValue(cont1);\r\n Sheet.getRange([newRow],[11]).setValue(surname); \r\n Sheet.getRange([newRow],[12]).setValue(email);\r\n Sheet.getRange([newRow],[13]).setValue(site); \r\n Sheet.getRange([newRow],[14]).setValue(logo); \r\n Sheet.getRange([newRow],[15]).setValue(gdgid); \r\n \r\n } else { // lock \r\n //\r\n // I couldn’t get the lock, now for plan B :(\r\n //\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"An error ocurred, please try again.\");\r\n \r\n }\r\n lock.releaseLock();\r\n \r\n //\r\n // clean up the sheet and leave a message\r\n // \r\n app.getElementById('addbutton').setEnabled(true); \r\n var site = SitesApp.getActiveSite(); \r\n \r\n app.getElementById('feedbacklabel').setVisible(true).setText(\"GDG: \" + name + \" added corectly.\"+ site).setStyleAttribute(\"color\", \"green\").setStyleAttribute('font-size', '14px'); \r\n \r\n app.getElementById('nametextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('cont1nametextbox').setVisible(true).setText(\"\");\r\n app.getElementById('surnametextbox').setVisible(true).setText(\"\"); \r\n app.getElementById('emailtextbox').setVisible(true).setValue(\"\");\r\n app.getElementById('remailtextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('countrytextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('countrytextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('regiontextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('citytextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('sitetextbox').setVisible(true).setValue(\"\"); \r\n app.getElementById('logotextbox').setVisible(true).setValue(\"\"); \r\n \r\n \r\n \r\n //\r\n // \r\n // \r\n // Send an email to the people within GDG interested in this contact. \r\n //\r\n \r\n MailApp.sendEmail('jacob@gtugs.org'\r\n ,'[GDG-BH], GDG: '+ name +' added.' \r\n ,'textBody', {htmlBody: 'Hi Everybody,' +\r\n '<br><br>GDG: <b>'+ name + \r\n '</b>&nbsp;Has been added to the system<br>By: <b>'+ cont1 + ' ' + surname +\r\n '</b><br>Email: <b>'+ email + \r\n '</b><br>This GDG is from: <b>'+ country +', ' + city +\r\n '</b><br><br> Greets,<br><br> ' +\r\n '<div name=\"background\" style=\"background-image: url(https://static-focus-opensocial.googleusercontent.com/gadgets/proxy?url=https://b253654b-a-906ce31e-s-sites.googlegroups.com/a/gtugs.org/bh/800pxnocoloniesblankworoc1.png?attachauth%3DANoY7cqwL7TE9yoEbNf6fS4Z3LSHHiuvnDA4E6uOJmKaDV0Hr1oGBSJQX10e8gXtMct5ZhaIY5g2I7DZsV5pCxnH4_tMaZV6DeSoon798BtDdL4494LOlI5Wt70govu1US_LbkIn00lBZ4XZabEIhrXrtSPNCcwXGO2sQZ-LpAcX_8fEcIellBG-M5MbUoAGV41i-X1DG0echCPCZLA7lBRib7opOcjXGA%253D%253D%26attredirects%3D0&amp;container=focus&amp;gadget=AppsScriptb605eab590c360c2&amp;rewriteMime=image/*&amp;no_expand=1&amp;refresh=60); width: 100%; height: 62px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; \">'+\r\n '<div name=\"text\" style=\"margin-left:10px;display:inline;vertical-align:middle;font-family: verdana; font-size: xx-large; font-weight: bold; color: grey\">GDG BH'+\r\n '</div>'+\r\n '<div name=\"text\" style=\"display:inline;vertical-align:middle;\">'+\r\n '<img src=\"https://static-focus-opensocial.googleusercontent.com/gadgets/proxy?url=https://b253654b-a-906ce31e-s-sites.googlegroups.com/a/gtugs.org/bh/gdg_logo.png?attachauth%3DANoY7cpcz4cicRU3Uaql0Ejhpd78gHjW7kHsAglUQItFnNZb6vsetXeiav2LRF3Jb8oE6IRdC_EHzLgEhC3mv0leC-vgFcLcLY_kiBzcnK53HixqrbSxJdu96wp9wZO0vyvT_RCZcbl4B0iFHe1aEHJDDtPO3Oxz7RJdGl5n91_W1N077KUn4SG3TCDWMpyEn5H_Z1YsYmsy%26attredirects%3D0&amp;container=focus&amp;gadget=AppsScriptb605eab590c360c2&amp;rewriteMime=image/*&amp;no_expand=1&amp;refresh=60\" style=\"height: 60px; width: 30px; margin-left: 10px;display:inline;vertical-align:middle; \">'+\r\n '</div>'\r\n ,replyTo: 'jacob@gtugs.org'});\r\n\r\n //\r\n // \r\n // \r\n // Send an email to the contact of the new GDG. \r\n //\r\n \r\n MailApp.sendEmail(email\r\n ,'[GDG-BH], GDG: '+ name +' added.' \r\n ,'textBody', {htmlBody: 'Hi ' + cont1 + ', ' +\r\n '<br><br>Thanks for adding the GDG: <b>'+ name + \r\n '</b><br><br>The primary contact for this GDG is: <b>'+ cont1 + ' ' + surname +\r\n '</b><br>The contact email is: <b>'+ email + \r\n '</b><br>The GDG location is: <b>'+ country +', ' + region+', ' + city +\r\n '</b><br><br><br> The GDG Locator is: <b>' + gdgid +'</b>' +\r\n '</b><br><div style=\"font-size:0.8em\" >Save this Locater for future use.</div>' + \r\n '</b><br><br> With kind Regards,<br><br> ' +\r\n '<div name=\"background\" style=\"background-image: url(https://static-focus-opensocial.googleusercontent.com/gadgets/proxy?url=https://b253654b-a-906ce31e-s-sites.googlegroups.com/a/gtugs.org/bh/800pxnocoloniesblankworoc1.png?attachauth%3DANoY7cqwL7TE9yoEbNf6fS4Z3LSHHiuvnDA4E6uOJmKaDV0Hr1oGBSJQX10e8gXtMct5ZhaIY5g2I7DZsV5pCxnH4_tMaZV6DeSoon798BtDdL4494LOlI5Wt70govu1US_LbkIn00lBZ4XZabEIhrXrtSPNCcwXGO2sQZ-LpAcX_8fEcIellBG-M5MbUoAGV41i-X1DG0echCPCZLA7lBRib7opOcjXGA%253D%253D%26attredirects%3D0&amp;container=focus&amp;gadget=AppsScriptb605eab590c360c2&amp;rewriteMime=image/*&amp;no_expand=1&amp;refresh=60); width: 100%; height: 62px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; \">'+\r\n '<div name=\"text\" style=\"margin-left:10px;display:inline;vertical-align:middle;font-family: verdana; font-size: xx-large; font-weight: bold; color: grey\">GDG'+\r\n '</div>'+\r\n '<div name=\"text\" style=\"display:inline;vertical-align:middle;\">'+\r\n '<img src=\"https://static-focus-opensocial.googleusercontent.com/gadgets/proxy?url=https://b253654b-a-906ce31e-s-sites.googlegroups.com/a/gtugs.org/bh/gdg_logo.png?attachauth%3DANoY7cpcz4cicRU3Uaql0Ejhpd78gHjW7kHsAglUQItFnNZb6vsetXeiav2LRF3Jb8oE6IRdC_EHzLgEhC3mv0leC-vgFcLcLY_kiBzcnK53HixqrbSxJdu96wp9wZO0vyvT_RCZcbl4B0iFHe1aEHJDDtPO3Oxz7RJdGl5n91_W1N077KUn4SG3TCDWMpyEn5H_Z1YsYmsy%26attredirects%3D0&amp;container=focus&amp;gadget=AppsScriptb605eab590c360c2&amp;rewriteMime=image/*&amp;no_expand=1&amp;refresh=60\" style=\"height: 60px; width: 30px; margin-left: 10px;display:inline;vertical-align:middle; \">'+\r\n '</div>'\r\n ,noReply: true});\r\n\r\n //\r\n //\r\n // Add this contact to a list in GDG contacts\r\n //\r\n //\r\n if(ContactsApp.findContactGroup(\"GDGlist\")==null){\r\n ContactsApp.createContactGroup(\"GDGlist\");\r\n }\r\n \r\n if ( ContactsApp.getContact(email)== null) { \r\n // add the contact\r\n ContactsApp.createContact(cont1,surname,email); \r\n // add the email data to the contacts and to the mail list.\r\n var group = ContactsApp.findContactGroup(\"GDGlist\")\r\n var myContact = ContactsApp.getContact(email); \r\n myContact.addCompany(name, 'GDG');\r\n myContact.addUrl('Site', site);\r\n myContact.addCustomField('Country', country);\r\n myContact.addCustomField('Region', region);\r\n myContact.addCustomField('City', city);\r\n group.addContact(myContact);\r\n \r\n }\r\n \r\n // \r\n // add a page for this gdg \r\n //\r\n var site = SitesApp.getSite('gtugs.org', 'bh');\r\n var targetParent = site.getChildByName('test');\r\n var gdgPageTemplate = site.getTemplates()[3];\r\n \r\n// for (var i = 1; i < gdgPageTemplate.length ; i++) { \r\n// if ( gdgPageTemplate[i] == 'gdg_page' ) {\r\n// var template = gdgPageTemplate[i] \r\n// }\r\n// } \r\n \r\n var templateUrl = site.getChildByName('GDG_page');\r\n\r\n var clean = library.blanksToUnderscore(name);\r\n var html = SitesApp.getPageByUrl('https://sites.google.com/a/gtugs.org/bh/test/gdg_page_dummy').getHtmlContent();\r\n var add = targetParent.createWebPage(clean, clean, html ); \r\n var newUrl = 'https://sites.google.com/a/gtugs.org/bh/test/' + clean\r\n Sheet.getRange([newRow],[16]).setValue(newUrl); \r\n\r\n // } \r\n\r\n//} \r\n \r\n \r\n } // City empty\r\n else {\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"Please enter a City.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n } \r\n \r\n } // Region empty\r\n else {\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"Please enter a Region.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n } \r\n } // Country empty\r\n else {\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"Please enter a country.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n } \r\n } // email patern\r\n else {\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"Please enter a valid email.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px'); \r\n } \r\n } // diference in email \r\n } // Cont1 empty\r\n else {\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"Please enter a contact.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n }\r\n } //name allready in use \r\n \r\n \r\n } // name empty\r\n else { // name empty\r\n app.getElementById('feedbacklabel').setVisible(true).setText( \"Please enter a name.\").setStyleAttribute(\"color\", \"#E81A1D\").setStyleAttribute('font-size', '14px');\r\n }\r\n\r\n \r\n return app;\r\n}", "title": "" }, { "docid": "3a017f07829d49b83a9080c0bee2b006", "score": "0.5061362", "text": "function isAvailable(request,isRoomAvailable){\r\n var event_Conflicts = events_Cal.getEvents(request.date, request.standardEndTime); \r\n var trinity1_Conflicts = reservation_Cal.getEvents(request.date, request.standardEndTime, {search: 'Trinity1'});\r\n var trinity2_Conflicts = reservation_Cal.getEvents(request.date, request.standardEndTime, {search: 'Trinity2'});\r\n var ignatius1_Conflicts = reservation_Cal.getEvents(request.date, request.standardEndTime, {search: 'Ignatius1'});\r\n var resurrection1_Conflicts = reservation_Cal.getEvents(request.date, request.standardEndTime, {search: 'Resurrection1'});\r\n \r\n if (trinity1_Conflicts.length < 1){\r\n sheet.getRange(lastRow, 5).setValue('Trinity1');\r\n } \r\n else if (trinity2_Conflicts.length < 1){\r\n sheet.getRange(lastRow, 5).setValue('Trinity2');\r\n } \r\n else if (ignatius1_Conflicts.length < 1){\r\n sheet.getRange(lastRow, 5).setValue('Ignatius1');\r\n } \r\n else if(event_Conflicts.length < 1 && resurrection1_Conflicts.length < 1){\r\n sheet.getRange(lastRow, 5).setValue('Resurrection1');\r\n }\r\n else{\r\n isRoomAvailable = false;\r\n sheet.getRange(lastRow, 8).setValue('full');\r\n }\r\n Logger.log(isRoomAvailable);\r\n return isRoomAvailable;\r\n}", "title": "" }, { "docid": "3fe0ea5270aca1df2ad382fa4c7506ce", "score": "0.50611573", "text": "function responnilai_value(e){\r\n var ss = SpreadsheetApp.openById(\"14tAB-F2JlTBhdItrcr5ZPEmGlktcV65thf3djcacRd0\")//.getSheetByName(\"responnilai\")\r\n var output = ContentService.createTextOutput(),\r\n data = {};\r\n //NAMA sheet yang ada di Database Dapodik (kalo beda, ganti. Sesuaikan dengan nama sheetnya).\r\n var sheet=\"responnilai\";\r\n\r\n data.records = readData_(ss, sheet);\r\n \r\n var callback = e.parameters.callback;\r\n \r\n if (callback === undefined) {\r\n output.setContent(JSON.stringify(data));\r\n } else {\r\n output.setContent(callback + \"(\" + JSON.stringify(data) + \")\");\r\n }\r\n output.setMimeType(ContentService.MimeType.JAVASCRIPT);\r\n \r\n return output;\r\n}", "title": "" }, { "docid": "b615f1d27d3c9f00f5062283ca8cf6f1", "score": "0.5054781", "text": "function doLMSSetValue(name, value)\n{\n if (API == null) {\n alert(\"Unable to locate the LMS's API Implementation.\\nLMSSetValue was not successful.\");\n return;\n } else {\n var result = API.LMSSetValue(name, value);\n if (result.toString() != \"true\") {\n var err = ErrorHandler();\n }\n }\n return;\n}", "title": "" }, { "docid": "bf9e7949356cb0950f6567397c839f83", "score": "0.50543004", "text": "function getData(val) {\n if (provider == 'google') {\n return $http.get('//maps.googleapis.com/maps/api/geocode/json', {\n withCredentials: false,\n params: {\n address: val,\n sensor: false\n }\n }).then(function (response) {\n return response.data.results.map(function (item) {\n return item;\n });\n });\n } else {\n var url = searchUrl + val;\n return $http.get(url, {withCredentials: false}).then(function (response) {\n return response.data\n });\n }\n }", "title": "" }, { "docid": "14e84dd8e8a5207ea946e60106430ed2", "score": "0.5033936", "text": "function searchCountry() {\n let searchValue = $(\"country-search\").value;\n $(\"search-error\").classList.add(\"hidden\");\n if (typeof searchValue === \"string\") {\n searchValue = searchValue.toLowerCase();\n let query = PHP_FILE + \"?country=\" + searchValue;\n fetch(query)\n .then(checkStatus)\n .then(JSON.parse)\n .then(updatePage)\n .catch(handleSearchError);\n }\n }", "title": "" }, { "docid": "09ab18ca4f440c6890ce26ddb4fb42f8", "score": "0.502993", "text": "function CryptoCreditStatus(paramater) {\n var url = 'https://pro-api.coinmarketcap.com/v1/key/info';\n\n var requestOptions = {\n method: 'GET',\n headers: {\n 'X-CMC_PRO_API_KEY': '89fa067b-9764-405b-80ba-21c643bc9bbd' //api key for cbcarroll@gmail.com at CoinMarketCap.com\n },\n json: true,\n gzip: true\n }\n \n var response = UrlFetchApp.fetch(url,requestOptions);\n var text = response.getContentText();\n var json = JSON.parse(text);\n \n //Returns percentage of daily cap used\n if (paramater === 'Daily Percentage' || paramater === 'DailyPercentage' || paramater === 'dailypercentage' || paramater === 'daily percentage' || paramater === 'dailyPercentage') {\n return json.data.usage.current_day.credits_used / json.data.plan.credit_limit_daily;\n }\n //Returns aggregate total of daily API credit cap used\n else if (paramater === 'Daily Total' || paramater === 'DailyTotal' || paramater === 'dailytotal' || paramater === 'daily total' || paramater === 'dailyTotal') {\n return json.data.usage.current_day.credits_used;\n }\n //Returns percentage of monthly API credit cap used\n else if (paramater === 'Monthly Percentage' || paramater === 'MonthlyPercentage' || paramater === 'monthlypercentage' || paramater === 'monthly percentage' || paramater === 'monthlyPercentage') {\n return json.data.usage.current_month.credits_used / json.data.plan.credit_limit_monthly;\n }\n //Returns aggregate total of monthly API credit cap used\n else if (paramater === 'Monthly Total' || paramater === 'MonthlyTotal' || paramater === 'monthlytotal' || paramater === 'monthly total' || paramater === 'monthlyTotal') {\n return json.data.usage.current_month.credits_used;\n }\n}", "title": "" }, { "docid": "e3bc62a841ff8db6f6e9a17eb0093398", "score": "0.5025645", "text": "function _isAPIAvailable() {\n if ($rootScope.isAndroid) {\n return (typeof android !== \"undefined\" && typeof android.enableGoogleNearby !== \"undefined\");\n } else if ($rootScope.isIOS) {\n return (typeof enableGoogleNearby !== \"undefined\"); \n } else {\n return false;\n }\n }", "title": "" }, { "docid": "195a5b89c041c726b61aa8ba2ba897d4", "score": "0.5021612", "text": "projectvalidateValidProjectKeyGet(incomingOptions, cb) {\n const Jira = require(\"./dist\");\n let defaultClient = Jira.ApiClient.instance;\n // Configure OAuth2 access token for authorization: OAuth2\n let OAuth2 = defaultClient.authentications[\"OAuth2\"];\n OAuth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Jira.ProjectKeyAndNameValidationApi(); // Object | Cloudi of the project\n /*let cloudid = null;*/ let opts = {\n // 'key': \"key_example\" // String | The project key.\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.projectvalidateValidProjectKeyGet(\n incomingOptions.cloudid,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "title": "" }, { "docid": "28206a8c7ebe75186c0b3c2c5b159e5f", "score": "0.50195813", "text": "function swapi3() {\n \n try {\n \n // Call the Star Wars API\n // deliberately use the wrong URL\n var response = UrlFetchApp.fetch(\"http://ZZZswapi.co/api/planets/1/\");\n \n // Parse the JSON reply\n var json = response.getContentText();\n var data = JSON.parse(json);\n \n // output the planet name in our Google Sheet\n Browser.msgBox(data.name);\n \n } catch (e) {\n \n // TO DO\n // log the error\n Logger.log(e); // full error message\n Logger.log(e.message); // content of error message\n // .. what else....?\n \n }\n \n}", "title": "" }, { "docid": "8d33d4f4ff3e81581a561833e7ac1e7a", "score": "0.5016883", "text": "function sf_search() {\n var queryString = \"FIND {*\" + searchTerm.term +\"*} RETURNING Case(Id, Description, Subject, CaseNumber) \";\n var callUrl = oauth2_identity.urls.rest + \"search/?q=\" + encodeURIComponent(queryString);\n//console.log(\"!!!!!!!!!!!!!!!!!! callUrl :\" + callUrl); \n \n var params = {};\n params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;\n params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;\n //params[gadgets.io.RequestParameters.POST_DATA] = postdata;\n params[gadgets.io.RequestParameters.HEADERS] = {\n \"Authorization\": \"OAuth \" + oAuthToken.access_token,\n \"X-PrettyPrint\": \"1\"\n };\n \n var callback = function(obj) { \n if (obj.data == null) {\n responseFunc([]);\n return;\n }\n var arr = [];\n for (var i=0;i<obj.data.length;i++) {\n var record = obj.data[i];\n \n arr.push({label:record.Subject, value:record.Id});\n }\n \n// responseFunc([{label:\"hallo\",value:\"depp\"},{label:\"hallo\",value:\"depp\"},{label:\"hallo\",value:\"depp\"}]);\n responseFunc(arr);\n };\n \n \n gadgets.io.makeRequest(callUrl, callback, params);\n }", "title": "" }, { "docid": "67c051fa27d71119c0e710274d8490a8", "score": "0.50148356", "text": "fetchGeocodeResults() {\n const { dispatch, userTextInput } = this.props;\n // If the text input has more then 0 characters..\n if (userTextInput.length > 0) {\n dispatch(\n fetchHereGeocode({\n inputValue: userTextInput\n })\n );\n }\n }", "title": "" }, { "docid": "0b8a1a0ed729e57af7691fd030bc3275", "score": "0.5013112", "text": "function checkGAPI() {\n\t \t\tif (gapi && gapi.client && gapi.auth) {\n\t \t\tready(new GapiManager());\n\t \t\t} else {\n\t \t\tsetTimeout(checkGAPI, 100);\n\t \t\t}\n\t \t}", "title": "" }, { "docid": "c6671f20caebe7c3147af881936b0474", "score": "0.501284", "text": "function checkBooleanValueOfApiVariable() {\n if (bAccount && bGetUserProfile && bCartHist && bGetCart && bpSchedPay) {\n clearIntervalApp(apiSuccessCountDown);\n hideProgressBar();\n isInitMainPage = false;\n apiSuccessCountDown = \"\";\n calcHeightAndUpdateBills();\n }\n}", "title": "" }, { "docid": "24c5cd3d1d1719d1909dab15be57df72", "score": "0.4998051", "text": "function check_City(){\r\n\tlet temp=document.getElementById(\"search_input\").value;\r\n\tif(temp!=\"\"&&temp!=null){\r\n\t\tsearch_weather(temp);\r\n\t}else{\r\n\t\talert(\"Please enter a valid City Name\");\r\n\t}\r\n}", "title": "" }, { "docid": "00dadbdf9114ac8a546bcfa565811f0b", "score": "0.4992043", "text": "function callGoogle(clientRequest, callback){\n\thttps.get(clientRequest, function(response){\n \tvar body = '';\n\n \tresponse.on('data', function(chunk){\n \tbody += chunk;\n \t});\n\n \tresponse.on('end', function(){\n \tgoogRes = JSON.parse(body);\n \t\n \t\t// lacing in our callback to return JSON\n \t\tcallback();\n \t});\n\n\t}).on('error', function(e){\n \t\n \tconsole.log(\"Got an error: \", e);\n\t\n\t});\n}", "title": "" }, { "docid": "f72942a7586d81969df6d411f0311b00", "score": "0.49860206", "text": "function checkInfo() {\n\n // No attorney chosen if blank\n if (firstName === \"\" || lastName === \"\" || dob === \"\" || address === \"\" || city === \"\" || twoLetterState === \"\" || zipcode === \"\" || ssn === \"\") {\n setIsError(true);\n }\n else {\n // Make the Post call\n getDocFile();\n }\n }", "title": "" }, { "docid": "a76d90af203a33b0e2e5969280a31035", "score": "0.49855298", "text": "function createSignupVal(user, pass) {\n\n if (inputGoogle.val === \"\") {\n //if user input is empty\n alertSystem();\n }\n //create validation later.\n //kelii this is your job.\n return user\n}", "title": "" }, { "docid": "dad6681a5643b2cb17bddf9fd2003841", "score": "0.49843666", "text": "function check_optional(obj)\n{\n\tset_busy_icon();\n\tvar AddCode = obj.value;\n\tif(trim(AddCode) == '')\n\t{\n\t\tdocument.getElementById(\"ADDLINT_USE_CODE_OPT_HEADING\").value = '' ;\n\t\tdocument.getElementById(\"ADDLINT_KEY_USE_CODE_DESC\").value = '' ;\n\t\tdocument.getElementById('ADDLINT_DESCRIPTION_LINE_6').style.display = 'none';\n//WAG4547 - Start\n\t\tdocument.getElementById(\"ADDLINT_DESCRIPTION_LINE_5A\").value = '' ;\n//WAG4547 - End\n\t\treset_busy_icon();\n\t\treturn;\n\t}\n\tvar url = \"../jsp/PolAddtlInterestTypeDetails.jsp?AddCode=\"+AddCode;\n\ttop.First.frameTopLeft.location = url;\n}", "title": "" }, { "docid": "371f479a2d83d18df8b159073e4a59cd", "score": "0.49586067", "text": "function checkCRUD(param) {\n\n return gw_com_api.getCRUD(\"grdData_분류\", \"selected\", true);\n\n}", "title": "" }, { "docid": "56a76e438b46b17dbe9a44c79b70b0ba", "score": "0.4950808", "text": "function geoLocationCode(event){\n event.preventDefault();\n var location = document.getElementById('location-input').value; //gets the value from input field\n $.get(`https://maps.googleapis.com/maps/api/geocode/json?address=${location}&key=AIzaSyD5XrrqpfdzbKeFRmqQ1CpQuc0VzHxXZsU`)\n .then(function(response){\n console.log(response);\n \n var results = response.results;\n return results[0].geometry.location;\n \n \n })\n .then(trailInfo) \n \n .catch(function(error){\n window.alert(\"Please enter the zipcode or the city for your search!\");\n })\n\n}", "title": "" }, { "docid": "2275d2b38fc998f1432d0cfeac8441ff", "score": "0.49503395", "text": "function triggered() {\n var options =\n {\n \"method\" : \"get\",\n \"muteHttpExceptions\": true\n };\n var response = UrlFetchApp.fetch(\"https://script.google.com/macros/s/AKfycbySXmsz4YrnduBCLfrvjr8wlSXriVmnrorVMwPw3ncGrt8CjuGZ/exec?run=1\", options);\n}", "title": "" }, { "docid": "40e020260ddc1f4143ddac3f5be35752", "score": "0.49468404", "text": "function checkInput() {\n if (inputValue === '') {\n fetchPopularMoviesList();\n } else {\n fetchFilms();\n }\n}", "title": "" }, { "docid": "74a77d3f2b74dd1d4f86d30d1bf0dcf4", "score": "0.49453497", "text": "function defineSearch() {\n //Set variables based on user input\n var searchTerms = $(\"#search-terms\").val();\n\n //Call the function that will formulate a query for Google Sheets\n formulateQuery(searchTerms);\n\n}", "title": "" }, { "docid": "ead7872bfa16f0f442f9689e8f6e6d6f", "score": "0.49451995", "text": "function checkUrlParameters() {\n var s = ls.urlParameters;\n\n var address = query(s.address),\n latitude = query(s.latitude),\n longitude = query(s.longitude),\n latlong = query(s.latlong),\n search = query(s.search),\n facets = query(s.facets),\n page = query(s.page);\n\n /*\n \n facets: 'fc',\n page: 'p', */\n\n //Split LatLong\n if (latlong && latlong.indexOf(',') != -1) {\n latitude = latlong.split(',')[0];\n longitude = latlong.split(',')[1];\n }\n\n //Apply Parameters\n if (search) {\n // escape double quotes if they are at the beginning or end of the search string\n ls.searchParams.search = search.replace(/[\\\"]{1}/gi, '\\\\\"');\n //ls.searchParams.search = encodeURIComponent(search);\n local.queryText = search; \n }\n\n if (page && ls.results.pager.updateHistory) {\n local.currentPage = Math.floor(parseFloat(page));\n if(ls.results.pager.loadMore) {\n ls.searchParams.skip = 0;\n ls.searchParams.top = local.currentPage * ls.results.pager.pageSize;\n } else {\n ls.searchParams.skip = (local.currentPage - 1) * ls.results.pager.pageSize;\n } \n }\n\n if(facets) {\n ls.facetsSelected = facets.split(';');\n }\n \n if (latitude && longitude) {\n ls.geoSearch.lat = latitude;\n ls.geoSearch.lng = longitude;\n }\n\n //Check is is necessary to resolve the address\n if (address && !latitude && !longitude && !latlong) {\n var r = resolveAddress(address);\n if (r) {\n latitude = r[0];\n longitude = r[1];\n }\n }\n\n }", "title": "" }, { "docid": "f1478e23a87ad4dd0aea0ba14eaec0d3", "score": "0.49446768", "text": "function checkGoogleContactHasCompany() {\n \n \n var contacts = ContactsApp.getContactGroup(\"System Group: My Contacts\").getContacts();\n \n var message = \"\";\n \n for (var i=0; i<contacts.length; i++){\n if(contacts[i].getCompanies().length === 0){\n if(message !== '') {\n message += ', ';\n }\n \n message += contacts[i].getFullName()\n }\n }\n \n message = ('Contact without company : ' + message );\n \n if(messae !== ''){\n MailApp.sendEmail('email@gmail.com, 'Contact without Company', message);\n }\n \n}", "title": "" }, { "docid": "9215fb497dd11179c924049ca0bd5e6c", "score": "0.49408048", "text": "function callApi(userInput, callback) {\n const settings = {\n url: `https://api.wunderground.com/api/5f1b6d8103e5bf4c/conditions/q/${userInput}.json`,\n dataType: \"jsonp\",\n success: callback\n };\n $.ajax(settings);\n}", "title": "" }, { "docid": "6603ddae8260700bf48257bfdcbc0470", "score": "0.49398592", "text": "function pullData(covid_data, country){\n country = country == '' ? 'world' : country.toLowerCase(); \n checkCountry(covid_data, country); \n}", "title": "" }, { "docid": "1d3bc198a940b9ec4f7cb5aa007a826a", "score": "0.49369836", "text": "function searchAddress(){\n $(\"form\").submit(function(e){\n e.preventDefault();\n var address= $(\"#place\").val();\n var url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\"+address+\"&key=AIzaSyCwLY1vDNFqYUY7eSj4kTVwiuW1-XZC55U\";\nconsole.log(\"submitted\",address,url);\n \n //get data and location geotag(longitude & lagitude) from the api \n$.get( url, function( data ) {\n console.log(data.results[0].formatted_address,data.results[0].geometry.location);\n fenway = data.results[0].geometry.location;\n addMap();\n}); \n});\n}", "title": "" }, { "docid": "83c02c13d7f1759babb62e2e289d86ea", "score": "0.49335018", "text": "function withGoogle(cells, row, address) {\n location = googleGeocoder.geocode(address);\n\n if (location.status !== 'OK') {\n insertDataIntoSheet(cells, row, [\n [foundAddressColumn, ''],\n [latColumn, ''],\n [lngColumn, ''],\n [qualityColumn, 'No Match'],\n [sourceColumn, 'Google']\n ]);\n\n return 1;\n }\n\n lat = location['results'][0]['geometry']['location']['lat'];\n lng = location['results'][0]['geometry']['location']['lng'];\n foundAddress = location['results'][0]['formatted_address'];\n\n var quality;\n if (location['results'][0]['partial_match']) {\n quality = 'Partial Match';\n } else {\n quality = 'Match';\n }\n\n insertDataIntoSheet(cells, row, [\n [foundAddressColumn, foundAddress],\n [latColumn, lat],\n [lngColumn, lng],\n [qualityColumn, quality],\n [sourceColumn, 'Google']\n ]);\n\n return 0;\n}", "title": "" }, { "docid": "118d27014334a7a90827fb72cccbf8cf", "score": "0.4929483", "text": "function doGet(e) {\n try {\n PropertiesService.getScriptProperties().setProperty(\n \"firstVar\",\n e.parameter.arg\n );\n } catch (e) {}\n try {\n PropertiesService.getScriptProperties().setProperty(\n \"meetingDate\",\n e.parameter.date\n );\n } catch (e) {}\n try {\n PropertiesService.getScriptProperties().setProperty(\n \"meetingOdds\",\n e.parameter.chance\n );\n } catch (e) {\n PropertiesService.getScriptProperties().setProperty(\n \"meetingOdds\",\n \"default\"\n );\n }\n try {\n PropertiesService.getScriptProperties().setProperty(\n \"rate\",\n e.parameter.rate\n );\n } catch (e) {}\n try {\n PropertiesService.getScriptProperties().setProperty(\n \"jsonData\",\n e.parameter.data\n );\n } catch (e) {\n PropertiesService.getScriptProperties().setProperty(\"jsonData\", \"default\");\n }\n\n Logger.log(\"log test\");\n\n if (\n PropertiesService.getScriptProperties().getProperty(\"jsonData\") != \"default\"\n ) {\n var jsonData =\n PropertiesService.getScriptProperties().getProperty(\"jsonData\");\n var meeting = [];\n meeting = jsonData.split(\"!\"); // split data into individual meetings\n\n for (var i = 0; i < meeting.length; i++) {\n meeting[i] = meeting[i].split(\";\"); // split each meeting into each set of potential rates and corresponding chances\n for (var j = 0; j < meeting[i].length; j++) {\n meeting[i][j] = meeting[i][j].split(\",\");\n }\n }\n\n // meeting[0] = meeting[0].split(\",\");\n // meeting[1] = meeting[1].split(\",\");\n /*\n PropertiesService.getScriptProperties().setProperty('meetingDate', meeting[0][0]);\n PropertiesService.getScriptProperties().setProperty('meetingOdds', meeting[0][1]);\n PropertiesService.getScriptProperties().setProperty('rate', meeting[0][2]);\n */\n printSpreadsheetRow(meeting, \"made if statement\");\n return printHTML();\n } else {\n printSpreadsheetRow(\"did not make it to if statement\");\n }\n}", "title": "" }, { "docid": "35f61afc591cd8433af40d6baad673e1", "score": "0.4926326", "text": "function callSheetsAPIGet(request, source, callback, message) {\n gapi.client.sheets.spreadsheets.values.get(request)\n .then(response => {\n console.log(source, response);\n callback(response, message);\n })\n .catch(err => {\n console.error(\"Google Sheets API call error\", err);\n });\n}", "title": "" }, { "docid": "c34bcf5b51f1d3b8a6efe2f84c1902f9", "score": "0.49260113", "text": "function runGoogle(auth, callback) {\n console.log(\"getting data\")\n var sheets = google.sheets('v4');\n sheets.spreadsheets.values.get({\n auth: auth,\n spreadsheetId: '1K4kx2e8zpMfomO3zusm0mOTYQCfE2KEXh62HaLYRgF0',\n range: 'A:B',\n }, function(err, response) {\n console.log(\"got data\")\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n var rows = response.values;\n\n callback(rows);\n });\n}", "title": "" }, { "docid": "1549ffc0c17f9ce85fd7735268348a5b", "score": "0.4924691", "text": "function askApiInCloudFunction() {\n //This api provide random text as json only for test purpose\n request('https://jsonplaceholder.typicode.com/posts', function(error, response, body) {\n //Log are available in Firebase Cloud Function page for this app\n console.log('error: ', error);\n console.log('statusCode: ', response && response.statusCode);\n console.log('body: ', body);\n });\n}", "title": "" }, { "docid": "7dc46de4b8ebf9eaa5b533aeba38062e", "score": "0.49187416", "text": "function callUserHabitualAddressGet() {\n\tuserHabitualAddressGet(processUserHabitualAddressGetSuccess, processServiceRequestError);\n}", "title": "" }, { "docid": "8f42fd544a987bddad837269e3684811", "score": "0.49131706", "text": "function findCity(){\n if ($(\"#searchQuery\").val() !== \"\"){\n var q = $(\"#searchQuery\").val();\n ajaxCall(q);\n }\n }", "title": "" }, { "docid": "0d756226380aefd2ce0fd928c14319a7", "score": "0.4906469", "text": "function checkAuth() {\n\n \talert (\"entrada\"); \n gapi.auth.authorize(\n {\n 'client_id': CLIENT_ID,\n 'scope': SCOPES.join(' '),\n 'immediate': true\n }, handleAuthResult);\n\n\t\t\t \n }", "title": "" }, { "docid": "b1a89e1ef9cfd2b6c2d887845fc7a6f1", "score": "0.49021706", "text": "function verify_func_asign(code) {\n var str = \"\";\n var token = getCookie(\"Token\");\n var flickerAPI = \"https://api.immgroup.com/crm/check/func/\" + token + \"/\" + code;\n $.getJSON(flickerAPI, {\n format: \"json\"\n }).done(function (data) {\n jQuery.each(data, function (i, val) { \n if (val.SfaSignFlag === 1) {\n return true;\n } \n }) \n });\n return false;\n}", "title": "" }, { "docid": "426e7f6f3d1ca6623cc49266408f4275", "score": "0.49018368", "text": "function check(val){\n http.get(`http://localhost:3000/employees`)\n .then(res => {\n const arr = res;\n arr.forEach(item => {\n if(val === item.name || val === item.phone ||Number(val) === item.car_number){\n ui.paintIndividal(item);\n ui.showAlert('נמצאו תוצאות לבקשתך', 'alert success');\n }\n })\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "dbda3014ede3554ebdc12893b1a6cb01", "score": "0.48988295", "text": "function validation_set(){\n if (!(parameters.get('A') && parameters.get('B'))) {\n alert('Parameter A and B must be defined.')\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "3500cd8cb0b28313216606e7531a207f", "score": "0.48987898", "text": "requestRegistration() {\n this.app.post(\"/requestValidation\",\n check('address').exists({ checkNull: true }).withMessage('must exist'),\n check('address').isLength({ min: 1 }).withMessage('must not be empty')\n , (req, res) => {\n\n const errors = validationResult(req);\n if (!errors.isEmpty()) {\n return res.status(422).json({ errors: errors.array() });\n }\n\n res.send(this.registrationProvider.appendAddress(req.body['address']));\n\n\n })\n }", "title": "" }, { "docid": "ad7e17aaba5e9d6ca0ec71eab49c78d4", "score": "0.48959947", "text": "function geolocate()\r\n{\r\n console.log(latitude);\r\n console.log(longitude);\r\n latitude = parseFloat($.post('https://www.googleapis.com/geolocation/v1/geolocate?key=YOURAPIKEY').location.lat);\r\n longitude = parseFloat($.post('https://www.googleapis.com/geolocation/v1/geolocate?key=YOURAPIKEY').location.lng);\r\n console.log(latitude);\r\n console.log(longitude);\r\n}", "title": "" }, { "docid": "5177de3a3bfc4f1eb27c6e586e512059", "score": "0.48959628", "text": "function cb(data) {\n g_def = data.result;\n}", "title": "" }, { "docid": "25440808ddd5ff16925468f77948ceb1", "score": "0.4895563", "text": "function doGet(e){\n Logger.log(\"--- doGet ---\");\n console.log (\"do get started\");\nvar Tbuit = \"1\", Tbinnen = \"1\",mEVLT = \"2\", mEVHT = \"1\",mEOLT = \"2\", mEOHT = \"1\", mEAT = \"1\",mEAV = \"2\", mGAS = \"1\", CRC2 = \"0\", CRC3 = \"0\";\n \n try {\n \n Tbinnen = e.parameters.Tbinnen_val;\n Tbuit = e.parameters.Tbuit_val;\n mEVLT = e.parameters.mEVLT_val;\n mEVHT = e.parameters.mEVHT_val;\n mEOLT = e.parameters.mEOLT_val;\n mEOHT = e.parameters.mEOHT_val;\n mEAT = e.parameters.mEAT_val;\n mEAV = e.parameters.mEAV_val;\n mGAS = e.parameters.mGAS_val;\n CRC2 = e.parameters.CRC2_val;\n CRC3 = e.parameters.CRC3_val;\n\n \n console.log (mEVLT); console.log (mEVHT);\n \n \n // save the data to spreadsheet\n save_data( Tbinnen, Tbuit, mEVLT, mEVHT,mEOLT, mEOHT, mEAT, mEAV, mGAS, CRC2, CRC3);\n \n \n return ContentService.createTextOutput(\"Wrote:\\n Tbinnen: \" + Tbinnen + \"\\n Tbuit: \" + Tbuit);\n \n } catch(error) { \n Logger.log(error); \n return ContentService.createTextOutput(\"oops....\" + error.message \n + \"\\n\" + new Date() \n + \"\\ntag: \" + Tbinnen +\n + \"\\nvalue: \" + Tbuit);\n } \n}", "title": "" }, { "docid": "dd8d34f26082ca384b831c16af0b96e8", "score": "0.4895228", "text": "function failureCB() {\n alert('Erreur lors du chargement GoogleEarth');\n }", "title": "" }, { "docid": "2037bef79de003808a99803db8e15cf0", "score": "0.48938635", "text": "function checkInputExists(input) { // check parameter exists\n if (input == undefined) {\n throw 'input does not exist'\n }\n}", "title": "" }, { "docid": "49ec3fd16e2b7f605ee3d293a78b7ded", "score": "0.4892067", "text": "function postalCodeLookup() {\n\n\tvar country = document.getElementById(\"countrySelect\").value;\n\n\tif (geonamesPostalCodeCountries.toString().search(country) == -1) {\n return; // selected country not supported by geonames\n }\n // display loading in suggest box\n document.getElementById('suggestBoxElement').style.visibility = 'visible';\n document.getElementById('suggestBoxElement').innerHTML = '<small><i>loading ...</i></small>';\n\n var postalcode = document.getElementById(\"postalcodeInput\").value;\n\n request = 'http://api.geonames.org/postalCodeLookupJSON?postalcode=' + postalcode + '&country=' + country + '&callback=getLocation' + '&style=long&username=brianyee';\n\n // Create a new script object\n aObj = new JSONscriptRequest(request);\n // Build the script tag\n aObj.buildScriptTag();\n // Execute (add) the script tag\n aObj.addScriptTag();\n}", "title": "" }, { "docid": "7e45cedb26ed4634702aa913ee0ba4b0", "score": "0.48897752", "text": "function weatherResult() {\n notification ();\n const inputField = document.getElementById('input-value');\n const apiKey = 'dc7b65ba5881074ed1dc9abdf396d72c';\n const inputText = inputField.value;\n inputField.value = '';\n if (inputText === '') {\n notification (true, false);\n }\n else {\n const url = `https://api.openweathermap.org/data/2.5/weather?q=${inputText}&appid=${apiKey}&units=metric`;\n fetch(url)\n .then(res => res.json())\n .then(data => loadData(data))\n .catch(error => {\n console.log(error);\n notification (false, inputText);\n });\n }\n}", "title": "" }, { "docid": "71605bfb77c1e1fcf74eb7f1cfa8e7cb", "score": "0.48892754", "text": "function doLMSSetValue(name, value)\r\n{\r\n\tif (_Debug)\r\n\t\tlogDebug(\"LMSSetValue(\"+name+\",\"+value+\")\");\r\n var api = getAPIHandle();\r\n if (api == null)\r\n {\r\n \tif (_Debug)\r\n\t logDebug(\"Unable to locate the LMS's API Implementation.\\nLMSSetValue was not successful.\");\r\n return;\r\n }\r\n else\r\n {\r\n var result = api.LMSSetValue(name, value);\r\n //if (result.toString() != \"true\")\r\n if (result != true)\r\n {\r\n var err = ErrorHandler();\r\n }\r\n }\r\n\r\n return;\r\n}", "title": "" }, { "docid": "19ac924cde3b18c160247d36c26b33ba", "score": "0.48883024", "text": "function doGetValue(name)\n{\n var api = getAPIHandle();\n if (api == null)\n {\n// alert(\"Unable to locate the LMS's API Implementation.\\nGetValue was not successful.\");\n return \"\";\n }\n else\n {\n return value = api.GetValue(name);\n }\n}", "title": "" }, { "docid": "b381b5fd82fa31b9df63599f6b5638e2", "score": "0.48848784", "text": "function getPostEventGoogleMarkers() {\r\n $timeout(function () {\r\n $scope.request.types = ['bar', 'restaurant'];\r\n $scope.service.nearbySearch($scope.request, setGoogleBarMarker);\r\n $scope.request.types = ['night_club']\r\n $scope.service.nearbySearch($scope.request, setGoogleNightLifeMarker);\r\n $scope.request.types = ['hotel']\r\n $scope.service.nearbySearch($scope.request, setGoogleHotelMarker);\r\n $ionicLoading.hide();\r\n }, 0);\r\n }", "title": "" } ]
375ac9c665609679c952b12a3db6ce8f
Returns 'true' or 'false' as a String
[ { "docid": "8532ed2b3c019e7c4a63cd0de3626756", "score": "0.0", "text": "function onSelfServePaidPlan () {\n var v = window.optimizely.get('visitor');\n var ACCOUNT_TYPE_DIMENSION_ID = 9023731522;\n if (v && v.custom && v.custom[ACCOUNT_TYPE_DIMENSION_ID]) {\n var SELF_SERVE_PAID_ACCOUNT_TYPES = ['Starter', 'Team', 'Professional'];\n var accountType = v.custom[ACCOUNT_TYPE_DIMENSION_ID];\n if (SELF_SERVE_PAID_ACCOUNT_TYPES.indexOf(accountType.value) !== -1) {\n return 'true';\n }\n }\n return 'false';\n }", "title": "" } ]
[ { "docid": "abf2220fcab69677e89f7ec817d8fd34", "score": "0.8282326", "text": "function trueToString(value)\n{\n if(value){return 'TRUE';}\n else{return 'FALSE';}\n}", "title": "" }, { "docid": "e1ee8d8e1498b62920679419a65b3ca8", "score": "0.79259896", "text": "function booleanToString(b){\n return b ? 'true' : 'false';\n}", "title": "" }, { "docid": "03d8dc842edc4043f0f3400dad6a3bbb", "score": "0.7845103", "text": "boolToStr(value) {\n return value ? 'true' : 'false';\n }", "title": "" }, { "docid": "ab5d88754fc54287e99e7437d67d6105", "score": "0.7764011", "text": "function trueOrFalse(val){\n return !val ? 'false':'true'\n}", "title": "" }, { "docid": "f2c02ec069fed98818f7a82e448d2038", "score": "0.7729196", "text": "function booleanToString(b){\n \n return b.toString()\n}", "title": "" }, { "docid": "4f59c25a1ad94d0b00fc2484f0002e1f", "score": "0.7589685", "text": "function boolToString(value) {\n return value ? '1' : '0';\n}", "title": "" }, { "docid": "627a5fa847a9153c53d216c118600bc0", "score": "0.75483596", "text": "function ourTrueOrFalse(isItTrue){\n if(isItTrue){\n return \"Yes, it's true\";\n }\n return \"No, it's false\";\n }", "title": "" }, { "docid": "cf3179c67098e3260b9da1455ab7b5cb", "score": "0.74890614", "text": "function booleanToString(b){\r\n let x = bool = b\r\n return x.toString()\r\n }", "title": "" }, { "docid": "afb423b0892bb247f03ecda60f10e946", "score": "0.730548", "text": "function trueOrFalse (isItTrue) {\n\tif (isItTrue) {\n\t\treturn \"Yes, it's true\";\n\t}\n\t\n\treturn \"No, it's false\";\n\t\n}", "title": "" }, { "docid": "27f9c7e54c63d7024a028d86d856f2d9", "score": "0.7300461", "text": "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"Yes, it's true\";\n }\n return \"No, it's false\";\n}", "title": "" }, { "docid": "f8160f895c28bc58a49d4196d6d7139a", "score": "0.7293434", "text": "function ourTrueorFalse(isItTrue) {\n if (isItTrue) {\n return \"Yes, ity is true\"\n }\n return \"No, Its is true\"\n}", "title": "" }, { "docid": "601b0cb3c2b8ddf143b799925a778709", "score": "0.71862936", "text": "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"yes, it's true \";\n }\n return \"no, it's false\";\n}", "title": "" }, { "docid": "6ec4a1335be5eba8e791f4e71dde8e80", "score": "0.7151432", "text": "function test(){ /** Stringifying a Boolean */\r\n\tvar passed= (JSON.stringify( new Boolean(true)))==='true' ;\r\n\treturn passed ;\r\n}", "title": "" }, { "docid": "6331b0463163e950e571dea13fc545f1", "score": "0.70413584", "text": "function ourTrueOrFalse(isItTrue) {\n if(isItTrue){\n return \"The truth\";\n }\n return \"no it is false\"; \n}", "title": "" }, { "docid": "16bb667e77189941d9e5ea3846fce600", "score": "0.702881", "text": "function boolsToString (k, v) {\n if (typeof v === 'boolean') {\n return String(v)\n }\n return v\n }", "title": "" }, { "docid": "442666da1ce931c39681ed5bed57fcb8", "score": "0.6927561", "text": "function _boolean(obj) {\n return exports.PREFIX.boolean + ':' + obj.toString();\n}", "title": "" }, { "docid": "89ca2caf3b39d3b102eddad39b80aa5b", "score": "0.6762827", "text": "function flse() {\r\n return {type:FALSE, toString: function () { return \"false\"; } };\r\n}", "title": "" }, { "docid": "ad204919bf635eef9269b34d8c68cbb9", "score": "0.669302", "text": "function boolToWord( bool ){\n if (bool == true) {\nreturn \"Yes\"\n }else{\nreturn \"No\"\n }\n}", "title": "" }, { "docid": "d5ada74e5d4891396b2c9c7b2df6f8d8", "score": "0.6596388", "text": "function trueOrFlase(wasThatTrue){\n if(wasThatTrue) {\n return \"yes! that was true\";\n }\n\n return \"No, that was false\";\n\n}", "title": "" }, { "docid": "c6d8608e2ffba9aaac40884a523ab092", "score": "0.6588408", "text": "function boolToWord( bool ){\n //...\n return bool ? \"Yes\" : \"No\";\n }", "title": "" }, { "docid": "b62291f2bb96b60cdc0db0202c6a3bc2", "score": "0.6535057", "text": "function booleanify(val) {\n if (val === \"true\") return true;\n if (val === \"false\") return false;\n return val;\n}", "title": "" }, { "docid": "31ccecf333d315b11b4c6dabf8c3083c", "score": "0.65308183", "text": "function boolToWord( bool ){\n return bool ? 'Yes':'No';\n }", "title": "" }, { "docid": "502c1da531001cb8726ff6e0594a1e42", "score": "0.65196866", "text": "function strRep(s) {\n let newStr = Boolean(s).toString();\n if (newStr.length < 5) {\n newStr = \" \" + s;\n }\n return newStr;\n }", "title": "" }, { "docid": "cc65adc93ace4f19044d6bba8b388ede", "score": "0.6517266", "text": "function boolOrBoolString(value) {\n return value === \"true\" ? true : isBoolean(value) ? value : false;\n}", "title": "" }, { "docid": "0daccd92ba01a1668940fc1668abeded", "score": "0.6497139", "text": "function boolToWord( bool ){\n return bool ? 'Yes':'No';\n}", "title": "" }, { "docid": "9c62185c825e3294ad7bc7e0628cd3dc", "score": "0.6429639", "text": "function formatBool(bool) {\n if (bool === null) {\n // This property is not applicable for this thing\n return 'N/A'\n }\n\n return bool ? 'Yes' : 'No'\n}", "title": "" }, { "docid": "3fbde18c0e3a156acb50387c13e721df", "score": "0.63395584", "text": "function boolToWord(bool) {\n if (bool) return 'Yes';\n return 'No';\n}", "title": "" }, { "docid": "255bdc7fc43c0530162730ef380e251a", "score": "0.63180584", "text": "function booleanValue() {\n return true;\n}", "title": "" }, { "docid": "e007d19dc3cc795feccb8983109178db", "score": "0.6308567", "text": "function boolToWord(bool) {\n if (bool) {\n return \"Yes\";\n }\n return \"No\";\n}", "title": "" }, { "docid": "4b90c080cef1a5c5f40ea8e0160c4b8b", "score": "0.6232668", "text": "function boolToWord( bool ){\n if (bool === true) {\n return \"Yes\";\n } else {\n return \"No\";\n }\n }", "title": "" }, { "docid": "ab48725f0c7b974a8cbbec97648eff57", "score": "0.6220529", "text": "function boolToWord( bool ){\n if (bool === true){\n return \"Yes\";\n } else{\n return \"No\";\n }\n }", "title": "" }, { "docid": "b6631af56d6867c5e18c3086a5022f4d", "score": "0.6211993", "text": "function getBoolAttr(name, value) {\r\n return ' ' + name + '=\"' + !!value + '\"';\r\n }", "title": "" }, { "docid": "3901cfcc21de738b8673c0ebc7f2c9bb", "score": "0.6207185", "text": "function takeBoolString(b1,s1) {\n if (b1) {\n alert(s1)\n } else {\n console.log(s1)\n }\n}", "title": "" }, { "docid": "d4b9edee7065a75ccf64a7d1b5f527be", "score": "0.61811984", "text": "function boolToWord(bool) {\r\n if (bool) {\r\n bool = \"Yes\";\r\n } else {\r\n bool = \"No\";\r\n }\r\n return bool;\r\n}", "title": "" }, { "docid": "e1e33ae6239d0264be70e7aa7e417c36", "score": "0.61782926", "text": "function boolToWord(bool) {\n if (bool === true) {\n return \"Yes\";\n } else {\n return \"No\";\n }\n}", "title": "" }, { "docid": "446dda5e5cd0e77d6313ce087889a06e", "score": "0.61678016", "text": "function exampleBoolean() {\n\treturn true; // or false\n}", "title": "" }, { "docid": "b07d42f66a6927f245fba01c0cc82117", "score": "0.6134558", "text": "function boolToWord( bool ){\n switch (bool) {\n case true: \n return 'Yes'\n case false: \n return 'No' \n }\n}", "title": "" }, { "docid": "f294be2cf35170e4e8c49b2916da78ad", "score": "0.6108433", "text": "function to_boolean(str) {\n\treturn str === true || jQuery.trim(str).toLowerCase() === 'true'; \n}", "title": "" }, { "docid": "d0de209e3730940b3bb3b6c99d06629a", "score": "0.6107022", "text": "function addBooleanExpression(node) {\n if (node.value === \"true\")\n return \"01\";\n else if (node.value === \"false\")\n return \"00\";\n else {\n var value = getReferenceKey(node);\n\n return value;\n }\n}", "title": "" }, { "docid": "69e57daa7c6919d64f9e8940a745262e", "score": "0.6105709", "text": "function unpackBool(val) {\n if (val == null) {\n return \"\";\n }\n\n if (val === true) {\n return \"yes\";\n }\n\n if (val == \"true\") {\n return \"yes\";\n }\n\n return \"no\";\n}", "title": "" }, { "docid": "3fbd2e2fd753b510ed440cdaddf5b2ce", "score": "0.6096158", "text": "function boolToWord( bool ){\n if(bool === true){\n const x = \"Yes\";\n return x\n } else {\n const x = \"No\";\n return x\n }\n }", "title": "" }, { "docid": "4bb5e479ad84bb082b6dd70a51fb30b2", "score": "0.60748357", "text": "function boolToWord(bool) {\n if (bool === true) {\n return \"Yes\";\n } else {\n return \"No\";\n }\n}", "title": "" }, { "docid": "55c3731523e7cc971c42a5e9dead709d", "score": "0.6071365", "text": "function toBoolean(s) {\n if (s == undefined) { return false; }\n if (s.constructor == Boolean) { return s.valueOf(); }\n try { if (s instanceof XML) s = s.toString(); } catch (e) {}\n if (s.constructor == String) { return s.toLowerCase() == \"true\"; }\n\n return Boolean(s);\n}", "title": "" }, { "docid": "d47fad82ae6a704e5c85090c4cb46f8c", "score": "0.60622287", "text": "function inputToBoolean(value) {\n return value != null && `${value}` !== 'false';\n}", "title": "" }, { "docid": "cb75ca73103d15d1787fece578ea84be", "score": "0.6059594", "text": "function WelcometoBoolean() {\n return true\n}", "title": "" }, { "docid": "e3f44717c7528135b138445e7c834554", "score": "0.6048354", "text": "function formatValue(value) {\n\tif (value === 'true') {\n\t\treturn true;\n\t} else if (value === 'false') {\n\t\treturn false;\n\t}\n\treturn value;\n}", "title": "" }, { "docid": "08ffa425ba0c1cacb3b26ad2394d4512", "score": "0.60483277", "text": "function convertToHandlebarsFalse(bool) {\n\t\treturn bool ? true : '';\n\t}", "title": "" }, { "docid": "8b5e1f67a6dab4632819760b46d1be49", "score": "0.6046929", "text": "function truth(value){\n if(value){\n return \"Vrai!\";\n }\n return \"Faux!\";\n}", "title": "" }, { "docid": "3b0b3b23f11ded57775acd1a4dd3bbe4", "score": "0.60465133", "text": "static getBoolean(value) { return value; }", "title": "" }, { "docid": "65a4d3300c49927e7ad9b5073161b21c", "score": "0.60335755", "text": "function truthyOrFalsy(exp){\n if(exp) return \"this is true\";\n else return \"this is false\";\n}", "title": "" }, { "docid": "06939593a1c06cc3e1b130f101e8d43c", "score": "0.6020173", "text": "function getTrueMsg (msg) {\n if (msg) return msg\n msg = msg || ''\n if (terst.autoMsg === true) { //experimental\n var params = getParams(T)\n for (var i = 0 ; i < params.length; ++i) {\n try {\n var e = eval(params[i].param)\n } catch (err) {\n console.error(err)\n }\n if (typeof e === 'boolean' && e === false) {\n msg = params[i].param\n return msg\n } \n }\n }\n}", "title": "" }, { "docid": "f9a7867a6a212502d490b500b87ddee6", "score": "0.59922004", "text": "function _booleanCoerce(obj) {\n return obj ? '1' : '0';\n}", "title": "" }, { "docid": "2f06c75a7a6cac6ea3b94bdf5fa96f11", "score": "0.59766674", "text": "function jyonif(really) {\n\treturn IsIt(really) ? 'yes' : 'no';\n}", "title": "" }, { "docid": "7a009e2b4e723508173315deccb45b8d", "score": "0.59479696", "text": "function bool(soup){\n return Boolean(soup)\n}", "title": "" }, { "docid": "1b9f5233f0bea6d870a90ffde594360f", "score": "0.5937462", "text": "function isTrue(input){\n return input===true;\n}", "title": "" }, { "docid": "852dd5199bc70939eaa7b82a24d131b5", "score": "0.59339726", "text": "function isBlankString(a) {\n var b = '';\n if (typeof a === 'string' && a.length === 0) {\n b += 'true';\n } else {\n b += 'false';\n }\n return b;\n}", "title": "" }, { "docid": "0072cca291cc59f56478de55caaa43db", "score": "0.5925394", "text": "function truthOrFalsy(exp) {\n if(exp) return \"this is true\";\n else return \"this is false\";\n }", "title": "" }, { "docid": "4c450b8ad7dc690c6d7cbfec16f107ff", "score": "0.5912693", "text": "function boolballotbox(arg) {\n\tswitch (arg.trim()) {\n\t\tcase '&#x2610;' : {\n\t\t\treturn 'false';\n\t\t\tbreak;\n\t\t}\n\t\tcase '&#9744;' : {\n\t\t\treturn 'false';\n\t\t\tbreak;\n\t\t}\n\t\tcase '\\u2610' : {\n\t\t\treturn 'false';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase '&#x2611;' : {\n\t\t\treturn 'true';\n\t\t\tbreak;\n\t\t}\n\t\tcase '&#9745;' : {\n\t\t\treturn 'true';\n\t\t\tbreak;\n\t\t}\n\t\tcase '\\u2611' : {\n\t\t\treturn 'true';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase '&#x2612;' : {\n\t\t\treturn 'true';\n\t\t\tbreak;\n\t\t}\n\t\tcase '&#9746;' : {\n\t\t\treturn 'true';\n\t\t\tbreak;\n\t\t}\n\t\tcase '\\u2612' : {\n\t\t\treturn 'true';\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault : {\n\t\t\treturn 'ixt:formatError';\n\t\t}\n\t}\n\treturn 'ixt:formatError';\n}", "title": "" }, { "docid": "f5af9a3f9571adf8bec7e6a46d69a7f1", "score": "0.59109217", "text": "visitBooleanLiteral(ctx) {\n const text = ctx.text;\n const value = text === 'true';\n return new ReactiveLiteralBoolean(value);\n }", "title": "" }, { "docid": "85b53a32082b53edf60875b30b4eb1c2", "score": "0.59085786", "text": "function booleanify(val /*: any*/) /*: boolean | any*/ {\n if (val === \"true\" || val == 1) {\n return true;\n }\n\n if (val === \"false\" || val == 0 || !val) {\n return false;\n }\n\n return val;\n }", "title": "" }, { "docid": "b01979f4461aa235390b7be2071e6e56", "score": "0.5894982", "text": "function booWho(bool) {\n return typeof bool === \"boolean\";\n}", "title": "" }, { "docid": "b01979f4461aa235390b7be2071e6e56", "score": "0.5894982", "text": "function booWho(bool) {\n return typeof bool === \"boolean\";\n}", "title": "" }, { "docid": "ac3b1bd55f06ab531ca45c3c6cc841f9", "score": "0.5893307", "text": "toString() {\n return this.val_ && this.val_.toString();\n }", "title": "" }, { "docid": "a30567e4dd25bac1edf33ce6f75935b6", "score": "0.58793366", "text": "function speakTheTruth() {\n return \"Brian is amazing\"\n }", "title": "" }, { "docid": "6982af8727746ac5c3e71ee9f6e04cb6", "score": "0.5857173", "text": "get state() {\n\n // Check state and return a string\n if (!this.isSetup)\n return \"Not set up\"\n else if (!this.enabled)\n return \"Disabled\"\n else if (this.error)\n return this.error.message\n else\n return \"Enabled\"\n\n }", "title": "" }, { "docid": "1531abea74e07a7f5d3b3ae0c152fc4a", "score": "0.58362424", "text": "function truefalse (val) {\r\n if (val==true) {\r\n console.log(\"Truthy!\");\r\n } else {\r\n console.log(\"Falsy.\");\r\n }\r\n}", "title": "" }, { "docid": "534c15a0f9901633cd197e99a889bfd0", "score": "0.58291787", "text": "toString() {\n let output = \"\";\n for (let val of this) {\n output = (val ? \"1\" : \"0\") + output;\n }\n return output;\n }", "title": "" }, { "docid": "9ee9601e9fd04da62a2708b6d2145c13", "score": "0.5808354", "text": "function coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}", "title": "" }, { "docid": "9ee9601e9fd04da62a2708b6d2145c13", "score": "0.5808354", "text": "function coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}", "title": "" }, { "docid": "5c364cecdf21a587f12aa67178e0cd84", "score": "0.57982063", "text": "function boole_Ans() {\n\tdocument.getElementById('boolean_23').innerHTML = Boolean(10>9);\n}", "title": "" }, { "docid": "be1e3c0617005981d3a4b1e5e1f73e33", "score": "0.5796867", "text": "function booWho(bool) {\n return typeof bool === 'boolean';\n}", "title": "" }, { "docid": "f8aa8af89be2c079dea1da0bde5d06e4", "score": "0.5771877", "text": "function booleanize(value) {\n\t\tif (typeof value === 'string') {\n\t\t\treturn value.match(/^(true|t|1)$/i);\n\t\t}\n\t\treturn !!value;\n\t}", "title": "" }, { "docid": "2ce95c4b218d428c411af78c56fd83a0", "score": "0.57660234", "text": "function convertBoolean () {\n return function (item) {\n return item ? 'Yes' : 'No';\n };\n }", "title": "" }, { "docid": "7ece354edcc11767bc7cce204466debf", "score": "0.57597977", "text": "function isString(a) {\n if (typeof a === 'string') {\n return 'true'\n } else {\n return 'false'\n }\n}", "title": "" }, { "docid": "bde3e3488212e1c216da23bb53687c12", "score": "0.57583576", "text": "function booWho(bool) {\n return bool === true || bool === false ? true: false;\n }", "title": "" }, { "docid": "62c182e96be907e561249d20597b6772", "score": "0.57575995", "text": "function booWho(bool) {\n return typeof bool === \"boolean\";\n }", "title": "" }, { "docid": "1ff821c426ec007f363091c4a950f477", "score": "0.5744957", "text": "function booWho(bool) {\n\treturn typeof bool === \"boolean\";\n}", "title": "" }, { "docid": "aa884f1beb5fb4f3088badd3ad0509fd", "score": "0.5714841", "text": "function boolean() {\n var BigInt = TypeUtil.getBigIntFactoryFunctionOrError();\n return fLib.or(fLib.boolean(), fLib.literal(\"0\", \"1\", 0, 1, \"false\", \"true\", BigInt(0), BigInt(1)).pipe(function (name, v) {\n switch (v) {\n case \"0\": return false;\n case \"1\": return true;\n case 0: return false;\n case 1: return true;\n case \"false\": return false;\n case \"true\": return true;\n default: {\n var str = String(v);\n if (str == \"0\") {\n return false;\n }\n else if (str == \"1\") {\n return true;\n }\n //Shouldn't happen\n throw new Error(\"Expected \" + name + \" to be one of '0'|'1'|0|1|'false'|'true'|'0n'|'1n'\");\n }\n }\n })).withExpectedInput();\n}", "title": "" }, { "docid": "aa6e21b31106673c03428450ec7ece26", "score": "0.5711855", "text": "static optionStr(options: Object): string {\n\n return Object.keys(options).map(key => {\n\n const val = options[key]\n\n if (typeof val === 'boolean') { return val ? `--${key}` : '' }\n\n return val != null ? `--${key} ${val}` : ''\n })\n .filter(v => v)\n .join(' ')\n }", "title": "" }, { "docid": "77c47ab02f2729c6eab0f1eecd61d8fb", "score": "0.57094574", "text": "function retTrue (){ return true; }", "title": "" }, { "docid": "8cd1d30ba5baee2cd0250bbf5624ff76", "score": "0.56969017", "text": "function returnTrue() { return true; }", "title": "" }, { "docid": "8cd1d30ba5baee2cd0250bbf5624ff76", "score": "0.56969017", "text": "function returnTrue() { return true; }", "title": "" }, { "docid": "8cd1d30ba5baee2cd0250bbf5624ff76", "score": "0.56969017", "text": "function returnTrue() { return true; }", "title": "" }, { "docid": "98327e93ea86727addc2bc05fd543d13", "score": "0.56959456", "text": "toString() {\n return this.value && this.value.toString();\n }", "title": "" }, { "docid": "b1967e1c95ec80dc8f69a0e58799813e", "score": "0.5690365", "text": "function booWho(bool) {\n\n if (typeof bool === \"boolean\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "218158a1314e0c63efd56f0dbd8a1ce6", "score": "0.5689665", "text": "function hasShortLegs(shortLegs){\n return (shortLegs === 1 ? 'False' : 'True');\n }", "title": "" }, { "docid": "8f8959436c32464d2c8d3ecfb7cf1c38", "score": "0.5686152", "text": "function boolStrNum(){return {type:[Boolean,String,Number],'default':false};}", "title": "" }, { "docid": "340bc7bc8fb40e3341c6c0051a884bfa", "score": "0.5684156", "text": "function isBoolean(s) {\n return s === 'true' || s === 'false';\n //if (typeof s === 'boolean') return true;\n }", "title": "" }, { "docid": "e39a06fbacf1b6856898a1c71847016d", "score": "0.5669904", "text": "function toTrue() {\n var BigInt = TypeUtil.getBigIntFactoryFunctionOrError();\n return fLib.or(fLib.literal(true), fLib.literal(\"1\", 1, \"true\", BigInt(1)).pipe(function (name, v) {\n switch (v) {\n case \"1\": return true;\n case 1: return true;\n case \"true\": return true;\n default: {\n var str = String(v);\n if (str == \"1\") {\n return true;\n }\n //Shouldn't happen\n throw new Error(\"Expected \" + name + \" to be one of '1'|1|'true'\");\n }\n }\n })).withExpectedInput();\n}", "title": "" }, { "docid": "57f32cd5f07061b65a28dc5da26e2398", "score": "0.56670433", "text": "function bool2VarByte(v) {\n return v ? '01' : '00';\n}", "title": "" }, { "docid": "24f510442693437520b24b14927e3aba", "score": "0.56623626", "text": "function boolean() {\n return define('boolean', (value) => {\n return typeof value === 'boolean';\n });\n }", "title": "" }, { "docid": "7cf8e0f68a9fb8d9cb82b6fe1636f079", "score": "0.5661374", "text": "static Bool(val) {\n const asn1 = new ASN1(Class.UNIVERSAL, Tag.BOOLEAN, Buffer.from([val ? 0xff : 0x0]));\n asn1._value = val;\n return asn1;\n }", "title": "" }, { "docid": "dfd51bd2b3bb40b34d67638e6c23ad6a", "score": "0.56552887", "text": "function coerceBooleanProperty(value) {\n return value != null && \"\" + value !== 'false';\n}", "title": "" }, { "docid": "e3c2cf0cbfcc9c3c12f275fc3ca0a972", "score": "0.5648256", "text": "function str(a){\r\n\tif(a===\"\"){\r\n\t\treturn true \r\n\t}else {\r\n\t\treturn false\r\n\t}\r\n}", "title": "" }, { "docid": "d5003491417c9aa9bb66a2221931bb46", "score": "0.56225485", "text": "function isTrue(val){\n if(val === \"doggy\"){\n return true;\n }\n\n}", "title": "" }, { "docid": "13fac66c57d53130229ad8dff6028716", "score": "0.561484", "text": "function this_is_true(){\n console.log(\"This is true 1\");\n console.log(\"This is true 2\");\n}", "title": "" }, { "docid": "f0ae42c8cacd632e490fc7c710521375", "score": "0.56143475", "text": "get ariaChecked() {\n\t\tif(this.args.indeterminate) {\n\t\t\tthis.debug(`ariaChecked: mixed`);\n\t\t\treturn 'mixed';\n\t\t}\n\n\t\tthis.debug(`ariaChecked: ${this.isChecked ? 'true' : 'false'}`);\n\t\treturn this.isChecked ? 'true' : 'false';\n\t}", "title": "" }, { "docid": "b3eba87f9018a6951b49ee6e51fcfb28", "score": "0.5606072", "text": "function isTrue (bool){\n\treturn bool === true;\n}", "title": "" }, { "docid": "c8ab77f50aa69cc827e132a13870f6d8", "score": "0.56058323", "text": "function devuelveBoolean(variable) {\r\n if (variable == \"ok\") {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "5e3b4812a3fbf7135d486212c477871e", "score": "0.56047225", "text": "function trueFn() { return true; }", "title": "" }, { "docid": "2395bc487dd48f4a5aa2f7fbd03cbb23", "score": "0.56003875", "text": "function bool(ciuresult){\n if (ciuresult == 'y' || ciuresult == 'a') return true;\n // 'p' is for polyfill\n if (ciuresult == 'n' || ciuresult == 'p') return false;\n throw 'unknown return value from can i use';\n }", "title": "" } ]
e5f1b4165a07d4dbf4fae3c89771b4a7
Looks for the first active and writes its hash into url
[ { "docid": "c86ab1369246374b483d910d3e5e48a4", "score": "0.5388377", "text": "_refreshUrlHash() {\n const obj = this;\n\n if (obj.sectionToUrl) {\n const activeSection = document.querySelector(obj.sectionSelector + '.' + obj.activeClass);\n const activeHash = window.location.hash;\n if (activeSection instanceof Element) {\n const sectionSelector = activeSection.getAttribute('data-scrollinator-selector');\n if (typeof sectionSelector === 'string' && sectionSelector.charAt(0) === '#') {\n if (sectionSelector !== activeHash) {\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname + window.location.search + sectionSelector\n );\n }\n return true;\n }\n }\n }\n\n // Else: Remove Hash from url\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname + window.location.search\n );\n }", "title": "" } ]
[ { "docid": "569ac0f4a01a9b9f91f4a005d7802cd9", "score": "0.70284873", "text": "function updateURLHash() {\n var activeSlide = getFlexSlider().find(\".slides > li.flex-active-slide\");\n var key = activeSlide.attr(\"data-key\");\n location.hash = \"!\" + key;\n }", "title": "" }, { "docid": "2f4bad90c31fdfe5c82462b564be3fb4", "score": "0.6583785", "text": "handleHashChange() {\n const activeItem = [...this.nodes.items].find(item => item.firstElementChild.getAttribute('href').replace('/', '') === window.location.hash);\n\n if (activeItem) {\n this.setActiveItem(activeItem);\n }\n }", "title": "" }, { "docid": "d97d49e7453deb4bdb71b1d15ffc3782", "score": "0.6138989", "text": "_setupActiveTabLink() {\n // If the location.hash matches one of the links, use that as the active tab.\n this.$activeTabLink = $(this.$tabLinks.filter('[href=\"' + location.hash + '\"]'));\n \n // If no match is found, use the first link or any with class 'active' as the initial active tab.\n if (this.$activeTabLink.length === 0) {\n this.$activeTabLink = this.$el\n .children('li.tab')\n .children('a.active')\n .first();\n }\n if (this.$activeTabLink.length === 0) {\n this.$activeTabLink = this.$el\n .children('li.tab')\n .children('a')\n .first();\n }\n \n this.$tabLinks.removeClass('active');\n this.$activeTabLink[0].classList.add('active');\n \n this.index = Math.max(this.$tabLinks.index(this.$activeTabLink), 0);\n \n if (this.$activeTabLink.length) {\n this.$content = $(M.escapeHash(this.$activeTabLink[0].hash));\n this.$content.addClass('active');\n }\n }", "title": "" }, { "docid": "f750d2ccfc548bf3570ae65f9629ad76", "score": "0.6089706", "text": "function setToOne() {\n location.hash = \"1\";\n \n}", "title": "" }, { "docid": "aea5a589a654d8381d532e9c934ef1ef", "score": "0.60707796", "text": "runHashMode() {\n this.linksHash();\n window.location.hash = '/';\n this.links[0].className += ' active';\n\n window.addEventListener('hashchange', () => {\n if (this.routs.map((el) => el.route).includes(window.location.hash.replace('#', ''))) {\n this.fetchHtml(window.location.hash.replace('#', ''));\n this.setActiveLink(window.location.hash.replace('#', ''));\n } else {\n this.fetch404();\n }\n }, false);\n }", "title": "" }, { "docid": "ab9f582a11cc38625b53643743dfbe9f", "score": "0.5998566", "text": "isActive() {\n let path = decodeURI(location.pathname + location.search);\n if(!path) return;\n if(!this.exact) {\n path = path.substring(0, this.href.length);\n }\n //Check if the current url matches the href property\n if(this.href === path) {\n if(this.active) return;\n else this.active = true;\n }\n else {\n if(this.active) this.active = false;\n else return;\n }\n }", "title": "" }, { "docid": "b039c9678627b0bd43a80e58fe1a63f2", "score": "0.59454256", "text": "function setTabToHash() {\n\t\tvar activeTab = $('.nav-tabs a[href=' + window.location.hash + ']').tab('show');\n\t}", "title": "" }, { "docid": "d744647d4dac983fed1b19da869134ba", "score": "0.5944584", "text": "function getUrlHash() {\n return window.location.href.split(\"#\")[1];\n }", "title": "" }, { "docid": "fe8e9d984490448b3d51f007afea6ce2", "score": "0.5893701", "text": "function hashChange() {\n var href = window.location.hash,\n loc = href,\n anchor = document.querySelector( 'a[href=\"' + href +'\"]' );\n\n if ( oldAnchor ) {\n oldAnchor.classList.remove( 'active' );\n anchor.classList.add( 'active' );\n }\n\n oldAnchor = anchor;\n\n if ( href ) {\n iframe.src = href.replace( /^#/, '' )\n .replace( /$/, '.html' ) ;\n }\n }", "title": "" }, { "docid": "4e4b19b850f02b34192f435b76f6faf8", "score": "0.5891074", "text": "function get_hash() {\n if( window.location.hash ) {\n // Get the hash from URL\n var url = window.location.hash;\n\n // Remove the #\n var current_hash = url.substring(1);\n\n // Split the IDs with comma\n var current_hashes = current_hash.split(\",\");\n\n // Loop over the array and activate the tabs if more then one in URL hash\n $.each( current_hashes, function( i, v ) {\n set_tab( $( 'a[rel=\"' + v + '\"]' ).parent().parent().parent().attr( 'id' ), v );\n });\n }\n}", "title": "" }, { "docid": "09fee8ff8a5958b5f27d7449db8a3992", "score": "0.58264554", "text": "function updateHash() {\n var hash = [];\n $('.video').each(function (i, elem) {\n hash.push( $(elem).attr('data-id') );\n });\n window.location.hash = hash.join('/');\n }", "title": "" }, { "docid": "ed8343a509660368a631eafb488759cc", "score": "0.5801933", "text": "function setHash(json) {\n window.location.hash = Base64.encode(JSON.stringify(json));\n}", "title": "" }, { "docid": "09f5e3c6b6be7b7f03002943a52977d3", "score": "0.5784885", "text": "function get_hash(url) {\n return hash_pattern.exec(url)[0].toLowerCase();\n}", "title": "" }, { "docid": "73a8d8cbe09c7750c8c5e5396771cd86", "score": "0.573066", "text": "function getActiveClass (path) {\n\tvar current = window.location.hash.slice(1);\n\treturn current === path ? 'active' : '';\n}", "title": "" }, { "docid": "274bf1d5b170375f26f1a419e4e3f6d8", "score": "0.569994", "text": "function goToSlideFromURLHash() {\n // get key from url\n var slideKey = location.hash.replace(\"#!\", \"\");\n\n if (slideKey != \"\") {\n // find the index of the slide with matching data-key attribute\n var matchingSlideIndex = parseInt(getFlexSlider().find('.slides > li[data-key=\"' + slideKey + '\"]').attr(\"data-index\"));\n\n // find the index of the active slide\n var activeSlideIndex = parseInt(getFlexSlider().find(\".slides > li.flex-active-slide\").attr(\"data-index\"));\n\n // if matchingSlideIndex is a number and is not the index of the currently active slide, then go to that slide\n if (!isNaN(matchingSlideIndex) && matchingSlideIndex != activeSlideIndex) {\n getFlexSlider().flexslider(matchingSlideIndex);\n }\n }\n }", "title": "" }, { "docid": "94324ae4b26ee0865ad541516cf8944d", "score": "0.5695641", "text": "function updateHash(page, slide) {\n\t\t\t\tvar list = 'page='+page;\t\t\t\t\t // add page hash\n\t\t\t\tif (slide) list += '&amp;slide='+slide;\t\t // add slide hash if exists\n\t\t\t\twindow.location.hash = list;\t\t\t\t // update hash\n\t\t\t}", "title": "" }, { "docid": "fdbf62e4c93aabeed67f00338a7b1562", "score": "0.5676343", "text": "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "f5b88c97389eb382f99153c62d610bba", "score": "0.56753796", "text": "static setURLHashItem(index, value) {\r\n const items = window.location.hash.split('/');\r\n if (items.length > index) {\r\n items[index] = value;\r\n window.location.hash = items.join('/');\r\n }\r\n else {\r\n if (items.length === 0 && index === 1) {\r\n window.location.hash = `/${value}`;\r\n }\r\n else if (items.length === index) {\r\n items.push(value);\r\n window.location.hash = items.join('/');\r\n }\r\n else {\r\n console.error('Previous URL hash item not set!');\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ce54dee3ad31a88db01ed63d03efee7e", "score": "0.56572765", "text": "function updateActiveHash(event, data) {\n //notify parent\n hashUsed(data.value);\n }", "title": "" }, { "docid": "b2e9617efaba83916bd3ab3dbc282b2d", "score": "0.5654863", "text": "function get_effective_hash() {\r\n var hash = window.location.hash.replace(/^#/, '');\r\n if (!hash) {\r\n hash = get_path();\r\n }\r\n if (!hash) {\r\n hash = 'home'\r\n }\r\n return hash;\r\n}", "title": "" }, { "docid": "7b5dbb68e4216be7e9e7172b741f47ec", "score": "0.5650524", "text": "function checkHash(){\n hash = document.location.hash;\n //console.log(\"IN CHECKHASH\");\n if(hash){\n \t var index;\n \t if((index = hash.indexOf(\"_\"))> -1){\n \t\t //hash = hash.substr(4, index-4);\n \t\t hash = hash.substr(4);\n \t }else{\n \t\t hash = hash.substr(4);\n \t }\n \n if(hash === prevHash){\n return;\n }\n console.log(\"HASH:\"+ hash);\n console.log(\"PREVHASH:\"+ prevHash);\n getHtml();\n clickedId = hash;\n prevHash = hash;\n\n }\n }", "title": "" }, { "docid": "ee4a4f23559beb2d2ffd7a24ae250340", "score": "0.5641426", "text": "function getUrlHash() {\n return window.location.hash.slice(1);\n }", "title": "" }, { "docid": "2a1c69e2116e71809ceadd4cadc5eaeb", "score": "0.56053466", "text": "function checkURL(hash) {\n if (!hash) hash = window.location.hash; //if no parameter is provided, use the hash value from the current address\n if (hash != lasturl) // if the hash value has changed\n {\n lasturl = hash; //update the current hash\n loadView(hash); // and load the new page\n }\n}", "title": "" }, { "docid": "8fd9f8c0778d3f9a25f478a65c770a7d", "score": "0.5604765", "text": "function updateHeaderActiveClass() {\n $('.header__menu li').each(function (i, val) {\n if ($(val).find('a').attr('href') == window.location.pathname.split('/').pop()) {\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "357886901ada4f8ed9efab6daf43f3da", "score": "0.5602608", "text": "function updateHeaderActiveClass() {\n $('.header__menu li').each(function (i, val) {\n if ($(val).find('a').attr('href') == window.location.pathname.split('/').pop()) {\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active');\n }\n });\n }", "title": "" }, { "docid": "b134ec141cecd43d3883ee07d6884453", "score": "0.55857503", "text": "function getHash(url) {\n\tvar hashPos = url.lastIndexOf('#');\n\treturn url.substring(hashPos + 1);\n}", "title": "" }, { "docid": "6ed7ea3488752d4fee4478b66c485309", "score": "0.55826294", "text": "function setActiveTabAccordingToHash(type) {\n makeAllTabsInactive()\n var tabToActivate = document.querySelector(`[href=\"#${type}\"]`)\n tabToActivate.classList.add('active')\n}", "title": "" }, { "docid": "4c42eeaca760f6e7f176d1d72a9208ca", "score": "0.5575562", "text": "function FirstLoad() {\n var Hash = window.location.hash;\n if (Hash.length <= 1) {\n LoadQuick('enrolment-information');\n $('.enrolment-information')\n .css({'color':window.ThemeColor, 'font-weight':'bold'});\n } else {\n LoadQuick(window.location.hash.replace('#', ''));\n $('.'+window.location.hash.replace('#', '').replace('/','-'))\n .css({'color':window.ThemeColor, 'font-weight':'bold'});\n }\n }", "title": "" }, { "docid": "f19065b2ed6cc45667c533a48c4f925c", "score": "0.5564559", "text": "getHashValue(){\n return window.location.hash.substr(1);\n }", "title": "" }, { "docid": "f37368ab2ea83ed45441d01812ffdb3a", "score": "0.5563652", "text": "function updateHashHistory() {\n hashHistory = window.location.hash.replace('#','').split('!');\n\n if (hashHistory.length == 1) {\n hashHistory = ['tree-node-start'];\n }\n }", "title": "" }, { "docid": "a0c44e23a484c2ec6705ea4ccb01d704", "score": "0.55611306", "text": "function updateURL() {\n\t\tconsole.log(\"Update Called\");\n\t\t\n\t\t//First check if any tabs are open\n\t\tchrome.tabs.query({}, (anyTabs) => {\n\t\t\tif (anyTabs.length !== 0) {\t\t\t\n\t\t\t\t//Then check if the chrome window is focused\n\t\t\t\tchrome.windows.getLastFocused({}, (theWindow) => {\t\t\t\t\t\n\t\t\t\t\t//If a window is is focused...\n\t\t\t\t\tif (theWindow.focused) {\n\t\t\t\t\t\t//Then we get the information about the active tab in the open window\n\t\t\t\t\t\tchrome.tabs.query({ active: true, windowId: theWindow.id}, (tabs) => {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//We also check to see if the computer is idle\n\t\t\t\t\t\t\tchrome.idle.queryState(60, (newState) => {\n\t\t\t\t\t\t\t\t//If the computer is not idle OR if the active tab is both audible and not muted send the current URL\n\t\t\t\t\t\t\t\tif (newState === \"active\" || (tabs[0].audible && !tabs[0].mutedInfo.muted)) {\n\t\t\t\t\t\t\t\t\trecordTimeSegment(tabs[0].url);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//If the computer is idle AND the active tab is either not playing music or the music is muted then record an idle\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\trecordTimeSegment(\"IDLE\");\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//If there is no foused window then we send an idle\n\t\t\t\t\telse {\n\t\t\t\t\t\trecordTimeSegment(\"IDLE\");\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t})\n\t\t\t}\n\t\t\t//If there is no open tab then we send an idle\n\t\t\telse {\n\t\t\t\trecordTimeSegment(\"IDLE\");\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "611ed2cf2233ff34117be5bfe92d7a7b", "score": "0.55606604", "text": "function updateHeaderActiveClass() {\n $('.header__menu li').each(function(i, val) {\n if ($(val).find('a').attr('href') == window.location.pathname.split('/').pop()) {\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "847848b7969faa1c3c0de0ab71094a3c", "score": "0.55537075", "text": "function activeID() {\n return $('.tabs li.active a').attr('href');\n }", "title": "" }, { "docid": "9452f55b9816d73ec4e7a6ab90d22751", "score": "0.5535848", "text": "function updateWithHash() {\n\t\t\t\t\tprop.resolve(window.location.hash);\n\t\t\t\t}", "title": "" }, { "docid": "942b6bb51dbc85eefd418c6c78f8243f", "score": "0.5519249", "text": "function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n}", "title": "" }, { "docid": "0b3eee0499e17d359f136cd45975c293", "score": "0.55177313", "text": "activeClass(path){\n if (window.location.hash == path) {\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "e1b7f92dce13c22bfe43c9e555ecdb9f", "score": "0.54983366", "text": "static getURLHashItem(index) {\r\n const items = window.location.hash.split('/');\r\n if (items.length > index) {\r\n return items[index];\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "06ea85ffac723e1751c6eed7fd997069", "score": "0.54980576", "text": "function setupPage(){\n var hash = window.location.hash;\n}", "title": "" }, { "docid": "88a7d8e75b6e880c1aa4261fd5ab1560", "score": "0.5482562", "text": "function checkActive(){\n var address = location.pathname.split('/')[2];\n if(address == \"\")\n goToPage(menu_data[0].link_name);\n else\n menu_bar.select(\"#menu_\"+address).attr(\"class\", \"active\");\n }", "title": "" }, { "docid": "4659b0f83926c4e4ab81fd2a9c4323ac", "score": "0.546175", "text": "function setHeaderActiveClass(){\n $('.header__menu li a').each(function(i,val){\n if ( $(val).attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "fe1cc882d31f9f6bac323d339e76179f", "score": "0.54476684", "text": "function _onHashChange() {\n\t\t\t\tsf.preHash = sf.currHash;\n\t\t\t\tsf.currHash = hashMgr.hash();\n\t\t\t\t//sf.currHash = window.location.hash;\n\t\t\t\tif (tplConfig[sf.currHash] == null) {\n\t\t\t\t\thashMgr.hash('#' + defaultRouter);\n\t\t\t\t\t//window.location.hash = '#' + defaultRouter;\n\t\t\t\t\tsf.currHash = sf.preHash;\n\t\t\t\t} else {\n\t\t\t\t\tif (sf.preHash != sf.currHash) {\n\t\t\t\t\t\tsf.changeSignal.dispatch(sf.preHash, sf.currHash);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "bc81a54021098c6c50ddc376535450d1", "score": "0.5443348", "text": "appendHash(url, hash) {\n if (!url) {\n return url;\n }\n return url + (url.indexOf('?') === -1 ? '?' : '&') + hash;\n }", "title": "" }, { "docid": "88e159ab0c0e36d8e4649f82bcab2745", "score": "0.54319996", "text": "function checkURL(url) {\n var href = '';\n //get the url by removing the hash\n // Do this if url exists (for page refresh, etc...)\n if (url) {\n href = url;\n// url = toModUrl(url);\n loadURL(url);\n } else {\n\n // grab the first URL from nav\n //$this = $('nav > ul > li:first-child > a[href!=\"#\"]');\n //update hash\n window.location.hash = $.defaultHash;//$this.attr('href');\n// $(\"nav ul a[href *='#modules']:first-child\").click();\n }\n\n}", "title": "" }, { "docid": "e1f7a579f583277ed7042ea6322aa388", "score": "0.5423126", "text": "function itemClick(clickedItem){\n if (!clickedItem.isActive()){\n location.hash=clickedItem.hashTag;\n }\n }", "title": "" }, { "docid": "79d0f119ec565670873f32ec77b7df13", "score": "0.541289", "text": "function initializePage() {\n if (!window.location.hash) {\n window.location.hash = 'cuisines'\n document.querySelector('[href=\"#cuisines\"]').classList.add('active')\n } else {\n document\n .querySelector(`[href=\"${window.location.hash}\"]`)\n .classList.add('active')\n }\n setContentAccordingToHash()\n}", "title": "" }, { "docid": "408675fa78552655328bbb49565e88b7", "score": "0.5400798", "text": "function changeHash(vh, aboutTop, workTop, contactTop, prevHash) {\n if (\n window.pageYOffset <= (aboutTop + vh) ||\n ((workTop - 200) <= window.pageYOffset && window.pageYOffset <= (workTop + vh)) ||\n ((contactTop - 200) <= window.pageYOffset && window.pageYOffset <= (contactTop + vh))\n ) {\n $(\"#link-about\").removeClass(\"active\");\n $(\"#link-work\").removeClass(\"active\");\n $(\"#link-contact\").removeClass(\"active\");\n history.pushState(null, null, \"#\");\n } else if (\n ((aboutTop + vh) < window.pageYOffset) && (window.pageYOffset < workTop - 200) &&\n prevHash !== \"about\"\n ) {\n $(\"#link-about\").addClass(\"active\");\n $(\"#link-work\").removeClass(\"active\");\n $(\"#link-contact\").removeClass(\"active\");\n history.pushState(null, null, \"#about\");\n } else if (\n ((workTop + vh) < window.pageYOffset) && (window.pageYOffset < (contactTop - 200)) &&\n prevHash !== \"work\"\n ) {\n $(\"#link-about\").removeClass(\"active\");\n $(\"#link-work\").addClass(\"active\");\n $(\"#link-contact\").removeClass(\"active\");\n history.pushState(null, null, \"#work\");\n } else if (\n ((contactTop + vh) < window.pageYOffset) &&\n prevHash !== \"contact\"\n ) {\n $(\"#link-about\").removeClass(\"active\");\n $(\"#link-work\").removeClass(\"active\");\n $(\"#link-contact\").addClass(\"active\");\n history.pushState(null, null, \"#contact\");\n }\n}", "title": "" }, { "docid": "1ba19d16f280f31396e0713a80b23352", "score": "0.53936565", "text": "function checkAndParseURL() {\n\t \t\tvar url = window.location.hash.slice(2).replace('/', '');\t\n\t \t\tconsole.log(url);\t \t\t\n\t\t\tif(url === '' || url === '*'){\n\t\t\t\t$selector = '*';\t\n\t\t\t\tsetPortfolioList($selector);\n\t\t\t}\t\n\t\t\telse{\n\t\t\t\t$('#portfolio-tax-terms li').each(function(){\n\t\t\t\t\t$theLink = $(this).attr('data-type');\t\n\t\t\t\t\tif($theLink == url){\t\n\t\t\t\t\t\t$(this).addClass('active');\n\t\t\t\t\t\tsetPortfolioList($theLink);\n\t\t\t\t\t\treturn false;\t\t\t\t\n\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": "34b69a5a5d3fadc5a9082d94d46c0043", "score": "0.53904176", "text": "function updateUrl() {\n // Do this instead of directly setting window.location.hash to prevent adding extra history entries\n /*var baseUrl = window.location.origin + '/basic-income-basic-job/local/';\n var url = baseUrl + '#' + encodeURIComponent(state.regionName + ',' + state.basicIncome + ',' + numAdults + ',' + state.laborForce + ',' + state.disabledAdults);\n if (window.location.pathname.indexOf('local') >= 0) {\n window.location.replace(url);\n }\n document.getElementById('permalink').value = 'Permalink not implemented yet, but eventually this will link to a self-contained mini-page';*/\n }", "title": "" }, { "docid": "38d71cded7534ad67f56b5cf98ec6592", "score": "0.53881276", "text": "function updateFromHash() {\n //If the URL has a hash component and the second character is '/'\n //(a hashslash, so we distinguish from in-page anchoring)\n if (location.hash && location.hash.substr(1,1) == '/'\n && location.hash.length > 2){\n beginPhrase(slugify(decodeURIComponent(location.hash.substr(2))));\n\n //If the URL has no hash component, or it has some meaningless\n //non-hashslash value\n } else {\n //Reset to the initial state\n document.title = 'Chatphrase';\n document.getElementById(\"phrase\").value = \"\";\n switchState(\"landing\");\n }\n}", "title": "" }, { "docid": "c18acf1b091c230921cf590a3bbd4ad3", "score": "0.53775436", "text": "function activateTab() {\n var activeTab = $('[href=' + window.location.hash.replace('/', '') + ']');\n if (activeTab) activeTab.tab('show');\n }", "title": "" }, { "docid": "cd73ed2c66295f31ca026bccac99b056", "score": "0.5374888", "text": "function changeHeaderActive(){\n\n if(event.target.hash == '#profile'){\n document.querySelector('ul li a.active').classList.remove('active');\n return;\n }\n if(event.target.tagName == 'A' && event.target.href !== ''){\n var previousSelection = document.querySelector('ul li a.active');\n if(previousSelection){\n previousSelection.classList.remove('active');\n }\n\n event.target.setAttribute('class', 'active');\n }\n\n}", "title": "" }, { "docid": "79f6ec67fb9193a4394424d6f9762555", "score": "0.5373734", "text": "hashUrlChangeHandler(event) {\n if (event.newURL != event.oldURL) {\n let newUrlId = window.location.hash.substr(1);\n //let oldUrlId = event.oldURL.split('#')[1];\n\n this.displayPage(newUrlId);\n }\n }", "title": "" }, { "docid": "6983cc77b6efba97c625c271402b79ca", "score": "0.5371253", "text": "function $updateURLFragment(path) {\n window.location.hash = path;\n }", "title": "" }, { "docid": "16b47ecd710e5c0d17d5fb1e01fa6720", "score": "0.53670967", "text": "function updateHash ($accordion) {\n // get id of accordion which contains unique accordion name\n var hashVal = $.trim($accordion.attr('id'))\n\n if (window.history.replaceState) {\n window.history.replaceState(null, null, '#' + hashVal)\n } else {\n // warning: for older browsers, this causes the accordion to be scrolled to\n window.location.hash = hashVal\n }\n }", "title": "" }, { "docid": "abd95362654f9f233f8e430430493889", "score": "0.5366747", "text": "function getLocation () {\n\t return location.hash !== '' ? location.hash.substring (1) : 'The Jibe Side';\n\t }", "title": "" }, { "docid": "2c45abe214f428eacdf583277f3bc8c5", "score": "0.53544146", "text": "handleNavItemActive() {\n var activeHref = window.location.href;\n var navItems = [];\n\n navItems = navItems.concat(this.state.navLeftItem).concat(this.state.navRightItem);\n\n this.findLinkInUrl(navItems, activeHref, (dataId) => {\n this.setState({ activeNavItem: { 'dataId': dataId } });\n });\n\n }", "title": "" }, { "docid": "b0bf4056ec19e3181fdf9ff0a58d403f", "score": "0.5341705", "text": "function firstHandle() {\n if(a.page.event.hash.getHash() !== currentHash) {\n window.location.href = \"#\" + currentHash;\n max = 0;\n }\n if(max-- <= 0) {\n\t\t\ta.timer.remove(timerId);\n }\n }", "title": "" }, { "docid": "24588efc6518408eef4b964fad7aa5b5", "score": "0.53325784", "text": "function locationHashChanged() \n { \n var hashLocation = window.location.hash;\n // Go to blog entry via click on archive\n if(hashLocation.indexOf(\"blog_entry_\") > -1)\n { \n var result = window.location.hash.split('blog_entry_');\n var hashArticleTitle = articleTitles[result[1]/*-1*/];\n\n var loaded = false;\n \n for (var i = 0; i < loadedArticles.length; i++) \n {\n if(loadedArticles[i] == hashArticleTitle)\n {\n loaded = true;\n \n var title = loadedArticles[i+1];\n \n if(history.pushState) \n history.pushState(null, null, 'blog.php#'+ (hashArticleTitle));\n else \n location.hash = hashArticleTitle; \n \n break;\n }\n }\n if(loaded == false)\n {\n hashArticleTitle = articleTitles[result[1]];\n if(history.pushState) \n history.pushState(null, null, 'blog.php#'+ hashArticleTitle);\n else \n location.hash = hashArticleTitle;\n window.location.reload(true);\n }\n }\n\n // Go to image \n else if(hashLocation.indexOf(\"_fullsize_image_\") > -1)\n {\n //Do Nothing\n }\n\n // Image close (go back to current article)\n else if(hashLocation.indexOf(\"close\") > -1)\n {\n var title = articleTitles[currentArticle];\n if(history.pushState) \n history.pushState(null, null, 'blog.php#'+ title);\n else \n location.hash = title;\n }\n\n // hash changed to article title\n else\n {\n var articleExists = false;\n var titleWithHash = hashLocation.split('#');\n var titleWithoutHash = titleWithHash[1];\n var recordLoaded = false;\n\n for (var i = 0; i < articleTitles.length; i++) \n { \n if(articleTitles[i] == titleWithoutHash)\n {\n articleExists = true;\n break;\n }\n }\n \n if(articleExists == true)\n {\n for (var i = 0; i < loadedArticles.length; i++) \n {\n if(loadedArticles[i] == titleWithoutHash)\n { \n var nextArticleToLoad = startFromArticle + 2 + i;\n\n if(targetArticle+1 == nextArticleToLoad)\n {\n var title = articleTitles[currentArticle+1];\n \n if(history.pushState) \n history.pushState(null, null, 'blog.php#'+ title);\n else \n location.hash = title;\n \n recordLoaded = false;\n \n break;\n }\n\n //fill all the scroll backgrounds before current article\n for(var i = currentArticle - 1; i > topArchivePost-1; i--)\n {\n var blog_entry_scroll_id = \"blog_entry_scroll_\" + i;\n var blog_entry_scroll = document.getElementById(blog_entry_scroll_id); \n \n if(blog_entry_scroll != null)\n {\n if(currentArticle != startFromArticle+1 && currentArticle != startFromArticle+2)\n blog_entry_scroll.style.background = \"#d9e3f5\";//\"#d9e3f5\" rgba(129,129,129,0.3)\n }\n\n var percent_article_read = 1;\n var scroll_height = archive_record_height * percent_article_read;\n if(blog_entry_scroll != null)\n {\n if(currentArticle != startFromArticle+1 && currentArticle != startFromArticle+2)\n blog_entry_scroll.style.height = \"76px\"; \n }\n \n }\n\n recordLoaded = true;\n \n if(window.innerWidth < 1500 && archiveHidden == false)\n toggleArchiveDisplay();\n \n break; \n }\n\n }\n \n\n\n if(recordLoaded == false)\n window.location.reload(true);\n }\n }\n }", "title": "" }, { "docid": "06f24641222c5b267bf3a3fb7255c216", "score": "0.5328629", "text": "function detectActiveTab() {\n\t\t$( '.nav-tab:first' ).trigger( 'click' );\n\t\t$( '.nav-tab' ).filter( '[href=\"' + location.hash + '\"]' ).trigger( 'click' );\n\t}", "title": "" }, { "docid": "8e559f2917757201fb24721c8fb975d5", "score": "0.53159195", "text": "static get hash() {\n return window.location.hash.startsWith('#')\n ? window.location.hash.substring(1)\n : window.location.hash;\n }", "title": "" }, { "docid": "6919d7418bf2a1ffbadc87fe6d06ff10", "score": "0.53158224", "text": "function hashUrlHandler() {\n if (location.hash) {\n var identifier =decodeURIComponent( location.hash.slice(1));\n console.log(identifier);\n loadArtist(identifier, query, $('#q1'), false);\n //$('#q1').addClass('active').siblings('[data-tab]').removeClass('active');\n //$('[data-tab=q1]').trigger('click')\n reset_page();\n $('#identifier-search').val(identifier);\n document.title = identifier + ' | DBpeida Search';\n } else {\n console.debug('hashUrlHandler: error');\n }\n}", "title": "" }, { "docid": "746386d0a0ba7933529786386ea8da7b", "score": "0.53133583", "text": "function currentUrl(element) {\n\n if (element === currentPage) {\n return false;\n }\n\n currentPage = element;\n\n if (window.history.pushState) {\n window.history.pushState(element, element, '#' + element);\n }\n\n }", "title": "" }, { "docid": "72338c0f6e042ef22445cf8e7a8c04d6", "score": "0.5311327", "text": "function navigate(ev) {\n ev.preventDefault();\n let link = ev.currentTarget;\n //console.log(link);\n // split a string into an array of substrings using # as the seperator\n let id = link.href.split(\"#\")[1]; // get the href page name\n //console.log(id);\n //update what is shown in the location bar\n history.replaceState({}, \"\", link.href);\n for (let i = 0; i < pages.length; i++) {\n if (pages[i].id == id) {\n pages[i].classList.add(\"active\");\n }\n else {\n pages[i].classList.remove(\"active\");\n }\n }\n}", "title": "" }, { "docid": "9e049aff576178560516b5da84b40521", "score": "0.5306494", "text": "function viewSetUrl(viewStatus)\n{\n var hash=rison.encode(viewStatus);\n console.log(\"view changing url hash to: \"+hash);\n //switch to the new status right right now, to prevent race conditions (the history loader lags behind)\n viewSwitch(viewStatus);\n jQuery.history.load(hash);\n}", "title": "" }, { "docid": "9e66ce074f72c535fdf76fbde654627c", "score": "0.53049684", "text": "function addActiveLink() {\n\t\t\"use strict\";\n\t\t$('a[href=\"' + window.location.pathname + '\"]').\n\t\t\tparent().\n\t\t\taddClass('active');\n\t}", "title": "" }, { "docid": "bd2c938993af8e034c4c344014627006", "score": "0.52931327", "text": "function addHash(index, word) {\n var uniq_id = word;\n window.location.hash += (escape(uniq_id) + '&');\n window.addthis.update('share', 'url', window.location.href);\n window.addthis.update('share', 'template', \"Awesome text+icons: {{url}} @kawantum #nounproject\");\n}", "title": "" }, { "docid": "610cb6e02a2462ac1ad4fa3831f2b4ab", "score": "0.5290121", "text": "function getLocation () {\n return location.hash !== '' ? location.hash.substring (1) : 'The Jibe Side';\n }", "title": "" }, { "docid": "9db2fbd1797449bd5d1cdc3139f01d88", "score": "0.5289425", "text": "function setActiveMenuItem() {\n $(\".active-check a.item\").each(function () {\n if ($(this).attr(\"href\") === window.location.pathname) {\n $(this).addClass(\"active\");\n }\n });\n}", "title": "" }, { "docid": "8939223080bddeaddeb3d544affefe36", "score": "0.52871627", "text": "function changeHashTo(location){\n\t\tif(window.location.href.indexOf(\"view\") || (window.location.href.indexOf(\"browse\"))){\n\t\t\twindow.location.href = base_url+location;\n\t\t}else {\n\t\t\twindow.location.hash = location;\n\t\t}\n\t}", "title": "" }, { "docid": "b62536972da87a26da74e84d453b55db", "score": "0.5265889", "text": "initHash() {\n let tab,\n prefix = this.prefix.replace('-', ''),\n hash = getHashVars()[prefix],\n setHash = false;\n if (hash && this.elem.querySelector('[data-tab=\"' + hash + '\"]')) {\n setHash = true;\n tab = hash;\n } else {\n let elem = this.elem.querySelector('[data-tab]');\n tab = elem ? elem.dataset.tab : null;\n }\n\n if (tab) this.activate(tab, setHash);\n }", "title": "" }, { "docid": "e33d6bbc1e64c5e12da951a288bf991d", "score": "0.52626914", "text": "function updateHashInUrl(href) {\n var hashInUrl = href;\n if (href.indexOf(generalDocsFolder) !== -1) {\n hashInUrl = href.substring((generalDocsFolder).length);\n }\n\n //lastClickElementHref = hashInUrl;\n window.location.hash = '#' + hashInUrl;\n}", "title": "" }, { "docid": "584044df59fc497f477d896db1bd10f7", "score": "0.5257913", "text": "handleUrlHash(props) {\n const hashParts = _.split(location.hash.substring(1), '-')\n const phaseId = hashParts[0] === 'phase' ? parseInt(hashParts[1], 10) : null\n if (phaseId === props.phaseId) {\n setTimeout(() => scrollToHash(props.location.hash), 100)\n }\n }", "title": "" }, { "docid": "dd31fcb1efead29f157ecc4e652fa656", "score": "0.52557886", "text": "function start()\n{\n name = (window.location.hash.length > 1) ? window.location.hash.substring(1) : 'default';\n document.getElementById('image').setAttribute('src', initial);\n}", "title": "" }, { "docid": "8082df0576119cf55c0845aca08ce41b", "score": "0.52508456", "text": "function verifyURLHash (mode) {\n var href = window.location.href;\n var hidx = href.indexOf(\"#\");\n if(hidx < 0) {\n href += \"#\"; }\n else {\n href = href.slice(0, hidx + 1); }\n if(mode === \"reference\") {\n href += \"menu=refmode\"; }\n jt.log(\"verifyURLHash \" + href);\n window.location.href = href;\n }", "title": "" }, { "docid": "a8a655574bf8954bc6d7d3a357e16c95", "score": "0.524958", "text": "function updateBrowserURL() {\n history.pushState({\n id: 'homepage'\n }, 'Home', '?' + document.getElementById(\"fs-url\").value + ',' + document.getElementById(\"selection\").value + ',' + document.getElementById(\"animation-time\").value + ',' + mapLongLattZoom);\n }", "title": "" }, { "docid": "c50ec541f7c019ec645a779f581f3f5e", "score": "0.52281016", "text": "function parseHash() {\n\tif (location.hash === \"\") location.hash = \"#general\";\n\tif (location.hash === \"#general\") selectTab(\"tab-general\");\n\tif (location.hash === \"#storage\") selectTab(\"tab-storage\");\n\tif (location.hash === \"#notifs\") selectTab(\"tab-notifs\");\n\tif (location.hash === \"#community\") selectTab(\"tab-community\");\n\tif (location.hash === \"#tracks\") selectTab(\"tab-tracks\");\n\tif (location.hash === \"#about\") selectTab(\"tab-about\");\n}", "title": "" }, { "docid": "1e3c58d6cb62a4990a72579b18efaf5b", "score": "0.52272594", "text": "function addHashToUrl($url)\n{\n if ('' == $url || undefined == $url) {\n $url = '_'; // it is empty hash because if put empty string here then browser will scroll to top of page\n }\n $hash = $url.replace(/^.*#/, '');\n var $fx, $node = jQuery('#' + $hash);\n if ($node.length) {\n $fx = jQuery('<div></div>')\n .css({\n position:'absolute',\n visibility:'hidden',\n top: jQuery(window).scrollTop() + 'px'\n })\n .attr('id', $hash)\n .appendTo(document.body);\n $node.attr('id', '');\n }\n document.location.hash = $hash;\n if ($node.length) {\n $fx.remove();\n $node.attr('id', $hash);\n }\n}", "title": "" }, { "docid": "a3294dcc65146bfe0ba08cc10aec47cc", "score": "0.5224943", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "title": "" }, { "docid": "364461fe239179c6846d7fc329923400", "score": "0.52187365", "text": "function processHash() {\n\t// Process hash\n\tvar searchBox = document.getElementById('searchBox');\n\tvar hashValue = decodeURI(window.location.hash.substr(1));\n\tif (searchBox.value !== hashValue) {\n\t\tsearchBox.value = hashValue;\n\t\tsearch();\n\t}\n}", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "753ac8df762d69959094ac7ba9175554", "score": "0.5215357", "text": "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "title": "" }, { "docid": "845b40290e23273a9bcfca3880559e75", "score": "0.5207193", "text": "function expandHash(key, value) {\r\n location.hash += ( location.hash.length > 1 ? \";\" : \"\" ) + encodeURIComponent(key) + \"=\" + encodeURIComponent(value);\r\n }", "title": "" }, { "docid": "cf40d7daa3832a643d7427818dcac382", "score": "0.52068055", "text": "_handleHashChange(event) {\n if (!event.newURL) return;\n let index = event.newURL.lastIndexOf('#');\n if (index < 0) return;\n let sel = event.newURL.substr(index+1);\n this.selection = sel;\n }", "title": "" }, { "docid": "3945179d297b3cd764109df4f89f04f1", "score": "0.52063257", "text": "function getParameterHash()\n{\n var hashIndex = window.location.href.indexOf(\"#\");\n if (hashIndex >= 0) {\n return parameterStringToHash(window.location.href.substring(hashIndex + 1));\n } else {\n return {};\n } \n}", "title": "" }, { "docid": "2093ab9ad9f441171291347afe0ae8a6", "score": "0.52043223", "text": "function loadBoard()\n{\n parseUrl(location.hash ? location.hash : '#home:main');\n}", "title": "" }, { "docid": "d3fede5efd04fb9e9cf01a2f8c210712", "score": "0.52042973", "text": "static currentHashLocation(){\n let hash = window.location.hash,\n match = hash.match(/^#([^\\?]+)(\\?.+)?/);\n return {\n pathname: match ? match[1] : '',\n query: match && match[2] ? match[2] : ''\n }\n }", "title": "" }, { "docid": "3ef41cf89b4f830ae683ea12904c71f8", "score": "0.52027106", "text": "function poll() {\n\t\t\t\t\t\tvar hash = get_fragment(),\n\t\t\t\t\t\t\thistory_hash = history_get(last_hash);\n\n\t\t\t\t\t\tif (hash !== last_hash) {\n\t\t\t\t\t\t\thistory_set(last_hash = hash, history_hash);\n\n\t\t\t\t\t\t\t$(window).trigger(str_hashchange);\n\n\t\t\t\t\t\t} else if (history_hash !== last_hash) {\n\t\t\t\t\t\t\tlocation.href = location.href.replace(/#.*/, '') + history_hash;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n\t\t\t\t\t}", "title": "" }, { "docid": "3a03a1fb38662a18732da5bdb97999b1", "score": "0.5200505", "text": "function get_hash(){\n try {\n if (window.location.hash) {\n return JSON.parse(decodeURIComponent(window.location.hash.replace('#','')));\n } else {\n return {}\n }\n } catch (error) {\n console.error(error);\n return {}\n }\n }", "title": "" }, { "docid": "4c3ea92d3695e1e94292b9caa51de5d4", "score": "0.5197889", "text": "function useLastHash() {\n self.updateLastHash(lastHash);\n }", "title": "" }, { "docid": "c7ef209dc0e741272b4fa46918cbbeea", "score": "0.51965183", "text": "function navFrameSelected() { \n var typeLinks = document.getElementById(\"invent_type\").getElementsByTagName(\"a\"),\n i=0, len=typeLinks.length,\n full_path = location.href.split('#')[0]; //Ignore hashes?\n\n // Loop through each link.\n for(; i<len; i++) {\n if(typeLinks[i].href.split(\"#\")[0] == full_path) {\n typeLinks[i].className += \" frame-active\";\n }\n }\n}", "title": "" }, { "docid": "c589fd6a25808262552be4e8fc5a271a", "score": "0.5183462", "text": "function onHashChange() {\n var urlParms = getURLParms()\n assimilateTopic(urlParms.topic)\n }", "title": "" }, { "docid": "f5c12ab04fb19dfa8776f025ef1184bb", "score": "0.517558", "text": "activeRoute(routeName) {\n localStorage.setItem('n',routeName);\n var get_item = localStorage.getItem('n');\n if(get_item == routeName){\n\n }\n return routeName ;\n }", "title": "" }, { "docid": "6e8cab7c9c20bfd6165f34d50ab683d7", "score": "0.51755047", "text": "function updateActive(href, rel) {\n\t\t\t\t// remove active from all links\n\t\t\t\t$('a.active').removeClass('active');\n\t\t\t\t// add active to all links with same destination\n\t\t\t\t$('a[href= \"'+href+'\"]').addClass('active');\n\t\t\t\t// add active to main level link regardless of destination\n\t\t\t\t$('#main-menu a[name=\"'+rel+'\"]').addClass('active');\n\t\t\t}", "title": "" }, { "docid": "c34d86ca268f5e89b5ac246249874f0d", "score": "0.51730245", "text": "function updateHashWithParams(params) {\n const fullHash = genBaseHash + params;\n //window.location.hash = fullHash;\n history.replaceState(null, document.title, \"#\" + fullHash);\n broadcastHashChange();\n}", "title": "" } ]
019a7c910022e044953c600ba676b18f
Removes all keyvalue entries from the hash.
[ { "docid": "64082cb8d7381e2bab71e554f71288f1", "score": "0.0", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t}", "title": "" } ]
[ { "docid": "c039e9addc74c139980132b75fead6f3", "score": "0.69789934", "text": "clear() {\n\t\tthis._keyMap.clear();\n\t\tthis._valueMap.clear();\n\t}", "title": "" }, { "docid": "dc0ee219346644da8ae4e9bc2ecf8803", "score": "0.671836", "text": "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "title": "" }, { "docid": "dc0ee219346644da8ae4e9bc2ecf8803", "score": "0.671836", "text": "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "title": "" }, { "docid": "4f4271b966c3f9b1f9d8146b7af60854", "score": "0.6497985", "text": "clear() {\r\n this.keys = [];\r\n this.values = [];\r\n }", "title": "" }, { "docid": "fbf52c87dedd403d11cd58b2eea2ed94", "score": "0.6430296", "text": "clearKeys(){\n this.keyList.clearKeys();\n }", "title": "" }, { "docid": "b44f5ea89900e8b9bc802e7d409a9603", "score": "0.6357992", "text": "clear() {\n let values = this.values();\n\n while (values[0]) {\n this.delete(values[0]);\n }\n }", "title": "" }, { "docid": "dcb20fc6f9292f7ccfcb0c4b21c59bbe", "score": "0.6312501", "text": "function cleanMap(){\n for(let [key, value] of userMap){\n if(value === 0) userMap.delete(key);\n }\n}", "title": "" }, { "docid": "14aa260b42478ae4eadaba0127267832", "score": "0.62913424", "text": "clearKeys(){\n this.keyList.clearKeys()\n }", "title": "" }, { "docid": "9ba905913063c8258cec7b9ce6453192", "score": "0.61689585", "text": "clear() {\n map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "title": "" }, { "docid": "cd57516c0a7979421d8c661e27ed3702", "score": "0.61414677", "text": "deleteAll(dict) {\n delete dict['ALL'];\n }", "title": "" }, { "docid": "6775514b59218a6a51fbf0c25548b75d", "score": "0.599221", "text": "clear() {\n this.hash = Object.create(null);\n this.size_ = 0;\n }", "title": "" }, { "docid": "76f04caeef0b2948614e643b20ba4d52", "score": "0.59075505", "text": "clearAll () {\n // Keys that will be cleared\n let keys = [SESSION_DATA, NOTIFICATION_DATA]\n keys.map(key => {\n let emptyObject = {}\n store.set(key, emptyObject)\n })\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "5562dd39049da66f1a2109446d2e3325", "score": "0.59072584", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "ee493160b143c2098193d896f90cffbe", "score": "0.59061575", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "a13030afe1a005403e69bb38f4e0a6cd", "score": "0.5888568", "text": "remove( key ) {\n let index = this.hash(key)\n let bucket = this.data[index]\n delete bucket[key.toString()]\n this.count--\n bucket == {} && this.data.splice[index, 1]\n }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "d4d00e41b1afee48fe0acc3ce2e5e9a2", "score": "0.58648694", "text": "function hashClear() {\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "1db7e50ecc6df5c2b5908e32ce2ad435", "score": "0.58600336", "text": "reset() {\n this.get('keys')\n .slice() // copy, so we dont mess with binding/loops\n .forEach((key) => {\n delete this[key];\n });\n\n this.get('keys').clear();\n }", "title": "" }, { "docid": "c47577886fe8e4225101c754574e3fe6", "score": "0.5859224", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {}\n this.size = 0\n }", "title": "" }, { "docid": "1615074aca49e1617c3e48d9cee9bc12", "score": "0.5855454", "text": "function hashClear() {\r\n\t this.__data__ = nativeCreate ? nativeCreate(null) : {};\r\n\t this.size = 0;\r\n\t }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" }, { "docid": "cb99f793e01bbd6225e102235d5d9163", "score": "0.58496314", "text": "function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }", "title": "" } ]
da5287577f5f7e3697c817d1e4d0871c
Revert a change stored in a document's history.
[ { "docid": "913bc4d9ea256c98d606682850100d1c", "score": "0.0", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }", "title": "" } ]
[ { "docid": "cac4a946a338799ffcccc09365b0f8c9", "score": "0.6383812", "text": "function undo(history) {\n\t\t debug('undo', { history: history });\n\t\t\n\t\t var past = history.past;\n\t\t var present = history.present;\n\t\t var future = history.future;\n\t\t\n\t\t\n\t\t if (past.length <= 0) return history;\n\t\t\n\t\t return {\n\t\t past: past.slice(0, past.length - 1), // remove last element from past\n\t\t present: past[past.length - 1], // set element as new present\n\t\t future: [present].concat(_toConsumableArray(future))\n\t\t };\n\t\t}", "title": "" }, { "docid": "3032fb11476d34764eafaa299a4ae59f", "score": "0.63444906", "text": "function undo(history) {\n\t debug('undo', { history: history });\n\t\n\t var past = history.past;\n\t var present = history.present;\n\t var future = history.future;\n\t\n\t if (past.length <= 0) return history;\n\t\n\t return {\n\t past: past.slice(0, past.length - 1), // remove last element from past\n\t present: past[past.length - 1], // set element as new present\n\t future: [present].concat(future)\n\t };\n\t}", "title": "" }, { "docid": "db1f15df0237f5ffd1e53880195dcb22", "score": "0.6256717", "text": "undo() {\n this.history.pop();\n const last = _.last(this.history);\n _.each(last, (value, key) => {\n this[key] = JSON.parse(JSON.stringify(value));\n });\n }", "title": "" }, { "docid": "11478370f94769db088a9ebdd06fe271", "score": "0.61288875", "text": "function undoRecord() {\n undoChanging = true;\n}", "title": "" }, { "docid": "a39c33459c4eed9aa92af5933e9582f5", "score": "0.60588735", "text": "revert() {\n this._editor.raw.revert();\n }", "title": "" }, { "docid": "a18a5c5a5cadd4ffdf0610455570e8ba", "score": "0.6057474", "text": "revertChanges() {\n const playedOperations = this.playedOperations;\n if (playedOperations.length > 0) {\n this.currentOperation = playedOperations[0];\n this.revertChange(this.editor, this.currentOperation);\n } else {\n this.lastOperationTime = 0;\n this.stopSeek();\n return;\n }\n }", "title": "" }, { "docid": "64483148b6247c78933082be614b4a66", "score": "0.6027152", "text": "function Undo()\n{\n undo.Rollback(redo);\n}", "title": "" }, { "docid": "5de09cd268130927bb858c16e81ff2dc", "score": "0.6020823", "text": "function undo() {\n transactions.popUndoTransaction().undoTransaction();\n}", "title": "" }, { "docid": "7efb4edfb1ae19d030779b595c00b704", "score": "0.59808105", "text": "undoTransaction() {\n this.model.revertTaskText(this.index, this.oldHTML);\n }", "title": "" }, { "docid": "972f2350aadf4b3e3b80ac58739988b9", "score": "0.59357893", "text": "handleUndo() {\n if (this.state.history.length > 0) {\n var history = this.state.history.pop();\n this.setState({\n active: history.active,\n auxiliary: history.auxiliary,\n cells: history.cells.slice(),\n ongoing: history.ongoing,\n selected: history.selected,\n dead: history.dead,\n timestamp: history.timestamp\n });\n }\n }", "title": "" }, { "docid": "a27fa8ac5a3682a91206c72a0c657d7e", "score": "0.59095997", "text": "function back() {\n if (history.length > 1) {\n setMode(history[history.length - 2]);\n setHistory(prev => prev.slice(0, prev.length - 1));\n }\n }", "title": "" }, { "docid": "d3f502e4e58beda003f5d2ced6b3fa35", "score": "0.58074224", "text": "previousState() {\n this.historyPosition = Math.max(0, this.historyPosition-1);\n }", "title": "" }, { "docid": "8d0980282a6a701f73bff0f65a3a3639", "score": "0.5804278", "text": "function revertButton() {\n\tif (window.confirm(\"This will undo all changes since you last saved the file.\")) {\n\t\tload();\n\t\tupdateLists();\n\t\tpopupPrompt(\"Reverted\", \"50\", \"50\", \"320\", \"24\", true);\n\t}\n}", "title": "" }, { "docid": "26e4a8a31bdaf51679f337890e6c26a1", "score": "0.579735", "text": "function back() {\n let currentHistory = [...history];\n if (currentHistory.length > 1) {\n currentHistory.pop();\n setHistory(currentHistory);\n setMode(currentHistory[currentHistory.length - 1]);\n } else {\n setHistory(currentHistory);\n setMode(currentHistory[currentHistory.length - 1]);\n }\n }", "title": "" }, { "docid": "b39ba86b789123d67c64f5fbbf51e5cb", "score": "0.5787139", "text": "function UndoHistory(xmlState, editor) {\n\tthis.xmlState = xmlState;\n\tthis.editor = editor;\n\t// History of document states\n\tthis.states = [];\n\t// Index of the currently active history state\n\tthis.headIndex = -1;\n\t// Callback triggered after a change is undone or redone\n\tthis.stateChangeEvent = null;\n\t// Callback triggered after a new state is added to the history\n\tthis.stateCaptureEvent = null;\n\t// Disable undo history if the browser doesn't support cloning documents\n\tthis.disabled = (typeof(document.implementation.createDocument) == \"undefined\");\n}", "title": "" }, { "docid": "5e920ba74845f60a5fa5bb902e41d1b8", "score": "0.5731202", "text": "cancel() {\n if (this.__undoStack.length > 0) {\n if (this.__currChange) {\n this.__currChange.off('updated', this.__currChangeUpdated)\n this.__currChange = null\n }\n\n const change = this.__undoStack.pop()\n change.undo()\n }\n }", "title": "" }, { "docid": "a285b53e7cf32f5dbbb9ec78e78dd0c8", "score": "0.5723909", "text": "function _revertToPreviousContext() {\n if(!this.previousContext) {\n return this;\n }\n return this.previousContext.clone();\n }", "title": "" }, { "docid": "1b9dfddd09bb3df5c60237e8ba108c8c", "score": "0.5707783", "text": "_undoChange(change) {\n let index = 0;\n let serializer = this._serializer;\n switch (change.type) {\n case 'add':\n algorithm_1.each(change.newValues, () => {\n this.remove(change.newIndex);\n });\n break;\n case 'set':\n index = change.oldIndex;\n algorithm_1.each(change.oldValues, value => {\n this.set(index++, serializer.fromJSON(value));\n });\n break;\n case 'remove':\n index = change.oldIndex;\n algorithm_1.each(change.oldValues, value => {\n this.insert(index++, serializer.fromJSON(value));\n });\n break;\n case 'move':\n this.move(change.newIndex, change.oldIndex);\n break;\n default:\n return;\n }\n }", "title": "" }, { "docid": "28c234960b8d2c9dea25f14b909d04f8", "score": "0.57072854", "text": "function undoStep() {\n if (gGame.history.length > 0 && gGame.GameIsOn) {\n var backStep = gGame.history.pop();\n gBoard = backStep.board;\n gGame.shownCount = backStep.shownCount;\n gGame.markedCount = backStep.markedCount;\n gGame.lives = backStep.lives;\n gGame.hints = backStep.hints;\n renderBoard(gBoard, '.board-container');\n if (gGame.history.length === 0)\n initGame();\n }\n}", "title": "" }, { "docid": "6becd315a698ba8dfd411a7a81824a16", "score": "0.56768304", "text": "function redo(history) {\n\t\t debug('redo', { history: history });\n\t\t\n\t\t var past = history.past;\n\t\t var present = history.present;\n\t\t var future = history.future;\n\t\t\n\t\t\n\t\t if (future.length <= 0) return history;\n\t\t\n\t\t return {\n\t\t future: future.slice(1, future.length), // remove element from future\n\t\t present: future[0], // set element as new present\n\t\t past: [].concat(_toConsumableArray(past), [present // old present state is in the past now\n\t\t ])\n\t\t };\n\t\t}", "title": "" }, { "docid": "8df4f1be9c59eb8ab7aea9e7953f6086", "score": "0.5649271", "text": "function redo(history) {\n\t debug('redo', { history: history });\n\t\n\t var past = history.past;\n\t var present = history.present;\n\t var future = history.future;\n\t\n\t if (future.length <= 0) return history;\n\t\n\t return {\n\t future: future.slice(1, future.length), // remove element from future\n\t present: future[0], // set element as new present\n\t past: [].concat(past, [present])\n\t };\n\t}", "title": "" }, { "docid": "c2f5a64caba6c5a4b1a7c3e1b541e87b", "score": "0.5633802", "text": "rollbackDiff() {\n const changes = this.previousState.diff(this.currentState);\n if (changes.$set) {\n changes.set = changes.$set;\n delete changes.$set;\n }\n \n if (changes.$unset) {\n changes.unset = changes.$unset;\n delete changes.$unset;\n }\n \n if (changes.$addToSet) {\n changes.addToSet = changes.$addToSet;\n delete changes.$addToSet;\n\n for (const key in changes.addToSet) {\n if (changes.addToSet[key].$each) {\n changes.addToSet[key].each = changes.addToSet[key].$each;\n delete changes.addToSet[key].$each;\n }\n }\n }\n \n if (changes.$pull) {\n changes.pull = changes.$pull;\n delete changes.$pull;\n for (const key in changes.pull) {\n if (changes.pull[key].$in) {\n changes.pull[key].in = changes.pull[key].$in;\n delete changes.pull[key].$in;\n }\n }\n }\n\n return changes;\n }", "title": "" }, { "docid": "b704638acff5904b7c15fa55f079f370", "score": "0.5632235", "text": "function back() {\n //if there is no history to go back, end the function\n if (history.length < 2) {\n return;\n }\n // prev is the latest history\n setHistory(prev => [...prev.slice(0, prev.length - 1)])\n }", "title": "" }, { "docid": "45a2adcb7c0495dd67e0bc3be6ddd162", "score": "0.5625745", "text": "function back() {\n history.go(-1)\n}", "title": "" }, { "docid": "249a94d328e5158c35f42ca8c49c0c5f", "score": "0.5564473", "text": "back() {\n if (this.idx > 0) {\n this.idx--;\n this.isInPast = true;\n }\n return this.history[this.idx];\n }", "title": "" }, { "docid": "5c90984684e7b495b3bd8393364e00a6", "score": "0.5534757", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "52a9b233ac32a061b7e63f2bd1eac813", "score": "0.55292964", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n}", "title": "" }, { "docid": "2d3145819cfee06a994de1998ae52634", "score": "0.55151284", "text": "function historyChangeFromChange(doc, change) {\n var histChange = { from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to) };\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) {\n return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n }, true);\n return histChange;\n }", "title": "" }, { "docid": "f37f4c03920e3ac055779a0695e2ce9e", "score": "0.55136013", "text": "function undo() {\n counter.decrement();\n document.getElementById(\"textarea\").value = historylist[counter.current];\n}", "title": "" }, { "docid": "cabc745d2a86e8870c71e3bb0ef10be4", "score": "0.5501161", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "cabc745d2a86e8870c71e3bb0ef10be4", "score": "0.5501161", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "107227aaff79546fdd7dd99b54b343f6", "score": "0.5498743", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }", "title": "" }, { "docid": "62b4e312e6e77a6e63012a8100754f91", "score": "0.5490321", "text": "function undo() {\n\tif (moveHistory.length >= 1) {\n\t\tvar lastMove = moveHistory.shift();\n\t\tvar row = lastMove[0];\n\t\tvar column = lastMove[1];\n\t\t(grid[row])[column] = \" \";\n\t\tgridUpdater();\n\t\tswitchPlayer();\n\t\tif (play_with_computer && currentPlayer === ai) {\n\t\t\tundo();\n\t\t}\n\t} else {\n\t\tdocument.getElementById(\"message\").innerHTML = \"No previous move\";\n\t\tdocument.getElementById(\"message\").style.display = \"block\";\n\t\tsetTimeout(function () {document.getElementById(\"message\").style.display = \"none\"}, 2000);\n\t\tif (play_with_computer && currentPlayer === ai) {\n\t\t\taiMove();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7d1a84222bcde6ff9ccd96baf4062054", "score": "0.54900676", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {\n from: copyPos(change.from),\n to: changeEnd(change),\n text: getBetween(doc, change.from, change.to)\n };\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) {\n return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n }, true);\n return histChange;\n }", "title": "" }, { "docid": "3a04ae5d570c686c159ccf51be80459b", "score": "0.5487158", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n\t return histChange\n\t}", "title": "" }, { "docid": "dabc9614d8c36da6f144d305318d60af", "score": "0.5485056", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n\t return histChange\n\t}", "title": "" }, { "docid": "dabc9614d8c36da6f144d305318d60af", "score": "0.5485056", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n\t linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n\t return histChange\n\t}", "title": "" }, { "docid": "958a57190ec553f4f42e1d5118589019", "score": "0.5471482", "text": "undo() {\n let undoAction = this.actionUndoStack.pop();\n if (undoAction) {\n this.apply(undoAction);\n this.actionRedoStack.push(this.invertOldNewData(undoAction));\n }\n }", "title": "" }, { "docid": "5d3e5570af26bc7911255982043909d9", "score": "0.5459872", "text": "clearHistory() {\n this.doc.clearHistory();\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "d24668e020aa5814120f5ac043378f78", "score": "0.5448485", "text": "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }", "title": "" }, { "docid": "4965f5459989926ea3b8d98918fe6383", "score": "0.54446524", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n\t if (doc.cm && doc.cm.state.suppressEdits) return;\n\n\t var hist = doc.history, event, selAfter = doc.sel;\n\t var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n\t // Verify that there is a useable event (so that ctrl-z won't\n\t // needlessly clear selection events)\n\t for (var i = 0; i < source.length; i++) {\n\t event = source[i];\n\t if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n\t break;\n\t }\n\t if (i == source.length) return;\n\t hist.lastOrigin = hist.lastSelOrigin = null;\n\n\t for (;;) {\n\t event = source.pop();\n\t if (event.ranges) {\n\t pushSelectionToHistory(event, dest);\n\t if (allowSelectionOnly && !event.equals(doc.sel)) {\n\t setSelection(doc, event, {clearRedo: false});\n\t return;\n\t }\n\t selAfter = event;\n\t }\n\t else break;\n\t }\n\n\t // Build up a reverse change object to add to the opposite history\n\t // stack (redo when undoing, and vice versa).\n\t var antiChanges = [];\n\t pushSelectionToHistory(selAfter, dest);\n\t dest.push({changes: antiChanges, generation: hist.generation});\n\t hist.generation = event.generation || ++hist.maxGeneration;\n\n\t var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n\t for (var i = event.changes.length - 1; i >= 0; --i) {\n\t var change = event.changes[i];\n\t change.origin = type;\n\t if (filter && !filterChange(doc, change, false)) {\n\t source.length = 0;\n\t return;\n\t }\n\n\t antiChanges.push(historyChangeFromChange(doc, change));\n\n\t var after = i ? computeSelAfterChange(doc, change) : lst(source);\n\t makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n\t if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});\n\t var rebased = [];\n\n\t // Propagate to the linked documents\n\t linkedDocs(doc, function(doc, sharedHist) {\n\t if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n\t rebaseHist(doc.history, change);\n\t rebased.push(doc.history);\n\t }\n\t makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n\t });\n\t }\n\t }", "title": "" }, { "docid": "4965f5459989926ea3b8d98918fe6383", "score": "0.54446524", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n\t if (doc.cm && doc.cm.state.suppressEdits) return;\n\n\t var hist = doc.history, event, selAfter = doc.sel;\n\t var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n\t // Verify that there is a useable event (so that ctrl-z won't\n\t // needlessly clear selection events)\n\t for (var i = 0; i < source.length; i++) {\n\t event = source[i];\n\t if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n\t break;\n\t }\n\t if (i == source.length) return;\n\t hist.lastOrigin = hist.lastSelOrigin = null;\n\n\t for (;;) {\n\t event = source.pop();\n\t if (event.ranges) {\n\t pushSelectionToHistory(event, dest);\n\t if (allowSelectionOnly && !event.equals(doc.sel)) {\n\t setSelection(doc, event, {clearRedo: false});\n\t return;\n\t }\n\t selAfter = event;\n\t }\n\t else break;\n\t }\n\n\t // Build up a reverse change object to add to the opposite history\n\t // stack (redo when undoing, and vice versa).\n\t var antiChanges = [];\n\t pushSelectionToHistory(selAfter, dest);\n\t dest.push({changes: antiChanges, generation: hist.generation});\n\t hist.generation = event.generation || ++hist.maxGeneration;\n\n\t var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n\t for (var i = event.changes.length - 1; i >= 0; --i) {\n\t var change = event.changes[i];\n\t change.origin = type;\n\t if (filter && !filterChange(doc, change, false)) {\n\t source.length = 0;\n\t return;\n\t }\n\n\t antiChanges.push(historyChangeFromChange(doc, change));\n\n\t var after = i ? computeSelAfterChange(doc, change) : lst(source);\n\t makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n\t if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});\n\t var rebased = [];\n\n\t // Propagate to the linked documents\n\t linkedDocs(doc, function(doc, sharedHist) {\n\t if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n\t rebaseHist(doc.history, change);\n\t rebased.push(doc.history);\n\t }\n\t makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n\t });\n\t }\n\t }", "title": "" }, { "docid": "4965f5459989926ea3b8d98918fe6383", "score": "0.54446524", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n\t if (doc.cm && doc.cm.state.suppressEdits) return;\n\n\t var hist = doc.history, event, selAfter = doc.sel;\n\t var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n\t // Verify that there is a useable event (so that ctrl-z won't\n\t // needlessly clear selection events)\n\t for (var i = 0; i < source.length; i++) {\n\t event = source[i];\n\t if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n\t break;\n\t }\n\t if (i == source.length) return;\n\t hist.lastOrigin = hist.lastSelOrigin = null;\n\n\t for (;;) {\n\t event = source.pop();\n\t if (event.ranges) {\n\t pushSelectionToHistory(event, dest);\n\t if (allowSelectionOnly && !event.equals(doc.sel)) {\n\t setSelection(doc, event, {clearRedo: false});\n\t return;\n\t }\n\t selAfter = event;\n\t }\n\t else break;\n\t }\n\n\t // Build up a reverse change object to add to the opposite history\n\t // stack (redo when undoing, and vice versa).\n\t var antiChanges = [];\n\t pushSelectionToHistory(selAfter, dest);\n\t dest.push({changes: antiChanges, generation: hist.generation});\n\t hist.generation = event.generation || ++hist.maxGeneration;\n\n\t var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n\t for (var i = event.changes.length - 1; i >= 0; --i) {\n\t var change = event.changes[i];\n\t change.origin = type;\n\t if (filter && !filterChange(doc, change, false)) {\n\t source.length = 0;\n\t return;\n\t }\n\n\t antiChanges.push(historyChangeFromChange(doc, change));\n\n\t var after = i ? computeSelAfterChange(doc, change) : lst(source);\n\t makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n\t if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});\n\t var rebased = [];\n\n\t // Propagate to the linked documents\n\t linkedDocs(doc, function(doc, sharedHist) {\n\t if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n\t rebaseHist(doc.history, change);\n\t rebased.push(doc.history);\n\t }\n\t makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n\t });\n\t }\n\t }", "title": "" }, { "docid": "9a1dbd631eaf6a82a63b73f5952584c5", "score": "0.54365605", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0\n for (; i < source.length; i++) {\n event = source[i]\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null\n\n for (;;) {\n event = source.pop()\n if (event.ranges) {\n pushSelectionToHistory(event, dest)\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false})\n return\n }\n selAfter = event\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = []\n pushSelectionToHistory(selAfter, dest)\n dest.push({changes: antiChanges, generation: hist.generation})\n hist.generation = event.generation || ++hist.maxGeneration\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")\n\n var loop = function ( i ) {\n var change = event.changes[i]\n change.origin = type\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change))\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source)\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }\n var rebased = []\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))\n })\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "75c885fde2bcb2335efa3c1bc0db5891", "score": "0.54318094", "text": "undo() {\n this.doc.undo();\n }", "title": "" }, { "docid": "28ee69c6c8cd10dda18de1a4b6dcbf5a", "score": "0.54255176", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n\t if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) return;\n\t\n\t var hist = doc.history, event, selAfter = doc.sel;\n\t var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\t\n\t // Verify that there is a useable event (so that ctrl-z won't\n\t // needlessly clear selection events)\n\t for (var i = 0; i < source.length; i++) {\n\t event = source[i];\n\t if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n\t break;\n\t }\n\t if (i == source.length) return;\n\t hist.lastOrigin = hist.lastSelOrigin = null;\n\t\n\t for (;;) {\n\t event = source.pop();\n\t if (event.ranges) {\n\t pushSelectionToHistory(event, dest);\n\t if (allowSelectionOnly && !event.equals(doc.sel)) {\n\t setSelection(doc, event, {clearRedo: false});\n\t return;\n\t }\n\t selAfter = event;\n\t }\n\t else break;\n\t }\n\t\n\t // Build up a reverse change object to add to the opposite history\n\t // stack (redo when undoing, and vice versa).\n\t var antiChanges = [];\n\t pushSelectionToHistory(selAfter, dest);\n\t dest.push({changes: antiChanges, generation: hist.generation});\n\t hist.generation = event.generation || ++hist.maxGeneration;\n\t\n\t var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\t\n\t for (var i = event.changes.length - 1; i >= 0; --i) {\n\t var change = event.changes[i];\n\t change.origin = type;\n\t if (filter && !filterChange(doc, change, false)) {\n\t source.length = 0;\n\t return;\n\t }\n\t\n\t antiChanges.push(historyChangeFromChange(doc, change));\n\t\n\t var after = i ? computeSelAfterChange(doc, change) : lst(source);\n\t makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n\t if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});\n\t var rebased = [];\n\t\n\t // Propagate to the linked documents\n\t linkedDocs(doc, function(doc, sharedHist) {\n\t if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n\t rebaseHist(doc.history, change);\n\t rebased.push(doc.history);\n\t }\n\t makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n\t });\n\t }\n\t }", "title": "" }, { "docid": "c6ebd63663b520710a6c2efe465747c8", "score": "0.5414279", "text": "function undo(g) {\n g.eachEdge(function(e, s, t, a) {\n if (a.reversed) {\n delete a.reversed;\n g.delEdge(e);\n g.addEdge(e, t, s, a);\n }\n });\n}", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5411015", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5411015", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5411015", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5411015", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "1e92997288ac74cfebd03e9e59606805", "score": "0.5411015", "text": "function historyChangeFromChange(doc, change) {\n\t var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n\t attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n\t linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n\t return histChange;\n\t }", "title": "" }, { "docid": "567474533f39a23b5109c4c1e7099480", "score": "0.5410501", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n\t if (doc.cm && doc.cm.state.suppressEdits) return;\n\t\n\t var hist = doc.history, event, selAfter = doc.sel;\n\t var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\t\n\t // Verify that there is a useable event (so that ctrl-z won't\n\t // needlessly clear selection events)\n\t for (var i = 0; i < source.length; i++) {\n\t event = source[i];\n\t if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n\t break;\n\t }\n\t if (i == source.length) return;\n\t hist.lastOrigin = hist.lastSelOrigin = null;\n\t\n\t for (;;) {\n\t event = source.pop();\n\t if (event.ranges) {\n\t pushSelectionToHistory(event, dest);\n\t if (allowSelectionOnly && !event.equals(doc.sel)) {\n\t setSelection(doc, event, {clearRedo: false});\n\t return;\n\t }\n\t selAfter = event;\n\t }\n\t else break;\n\t }\n\t\n\t // Build up a reverse change object to add to the opposite history\n\t // stack (redo when undoing, and vice versa).\n\t var antiChanges = [];\n\t pushSelectionToHistory(selAfter, dest);\n\t dest.push({changes: antiChanges, generation: hist.generation});\n\t hist.generation = event.generation || ++hist.maxGeneration;\n\t\n\t var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\t\n\t for (var i = event.changes.length - 1; i >= 0; --i) {\n\t var change = event.changes[i];\n\t change.origin = type;\n\t if (filter && !filterChange(doc, change, false)) {\n\t source.length = 0;\n\t return;\n\t }\n\t\n\t antiChanges.push(historyChangeFromChange(doc, change));\n\t\n\t var after = i ? computeSelAfterChange(doc, change) : lst(source);\n\t makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n\t if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});\n\t var rebased = [];\n\t\n\t // Propagate to the linked documents\n\t linkedDocs(doc, function(doc, sharedHist) {\n\t if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n\t rebaseHist(doc.history, change);\n\t rebased.push(doc.history);\n\t }\n\t makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n\t });\n\t }\n\t }", "title": "" }, { "docid": "bb57885e9cee6ea4ace55c47319042d8", "score": "0.5409865", "text": "_back() {\n if (this._history.length) {\n this._navigateTo(Math.max(this._index - 1, 0));\n }\n }", "title": "" }, { "docid": "2e032a4375aa6faeec54ca728a705e3e", "score": "0.5409058", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "2e032a4375aa6faeec54ca728a705e3e", "score": "0.5409058", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "2e032a4375aa6faeec54ca728a705e3e", "score": "0.5409058", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "2e032a4375aa6faeec54ca728a705e3e", "score": "0.5409058", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "2e032a4375aa6faeec54ca728a705e3e", "score": "0.5409058", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "2e032a4375aa6faeec54ca728a705e3e", "score": "0.5409058", "text": "function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}", "title": "" }, { "docid": "3516896a335497429bf87ceca0dad13d", "score": "0.5400797", "text": "dropHistory() {\n this.__history.splice( 0 );\n this.__historyIndex = 0;\n }", "title": "" }, { "docid": "3409917c7f67370c90f61cb996fae00a", "score": "0.5398366", "text": "function undo(){\n\n }", "title": "" } ]
9ef00c2c20a742ba14f7320878cd587d
Define a function maxOfThree() that takes three numbers as arguments and returns the largest of them.
[ { "docid": "58b684d5e231310389d5627d175ca828", "score": "0.80717415", "text": "function maxOfThree(x,y,z){\n \"use strict\";\n if (x > y && x > z ){\n return x;\n } else if (y > z){\n return y;\n } else {\n return z;\n }\n\n }", "title": "" } ]
[ { "docid": "d79619667349e8f31373ac918f670ae5", "score": "0.8932081", "text": "function maxOfThree(a,b,c) {\n return max(max(a, b), c);\n}", "title": "" }, { "docid": "ae57f213d5b215fb429feed7cf785772", "score": "0.8925561", "text": "function maxOfThreeNumbers(a, b, c) {\n return Math.max(a, b, c)\n}", "title": "" }, { "docid": "b50acdd06d09b745aa878bd5ae17c7a3", "score": "0.89068437", "text": "function maxOfThree(num1, num2, num3){\n return Math.max(num1, num2, num3)\n}", "title": "" }, { "docid": "11163607687f6bc7b9f37259c830d288", "score": "0.8889689", "text": "function maxOfThree(num1, num2, num3)\n{\n let max = Math.max(num1, num2, num3);\n return max;\n}", "title": "" }, { "docid": "a57e928cb1a4f32b12b16b3a2b7740d0", "score": "0.88832784", "text": "function maxOfThree(num1, num2, num3){\n return Math.max(num1, num2, num3);\n}", "title": "" }, { "docid": "e7391837105f41b53aa787c9995a0577", "score": "0.88797975", "text": "function maxOfThree(a, b, c) {\n return max(max(a, b), c);\n\n}", "title": "" }, { "docid": "2bf7c793fcb4b5b5fab8bba45517ae07", "score": "0.88764566", "text": "function maxOfThree(a, b, c) {\n return max(max(a,b),c);\n}", "title": "" }, { "docid": "99514dff85a64b5f599f615f2bea9b7e", "score": "0.8870628", "text": "function maxOfThreeNumbers(a, b, c) {\n //\n return Math.max(a, b, c);\n}", "title": "" }, { "docid": "a8e8eb8d74767c40999a0f696a4190bb", "score": "0.88543826", "text": "function maxOfThree(num1,num2,num3) {\n return Math.max(num1,num2,num3);\n}", "title": "" }, { "docid": "a0c8264de2599f28cef93174cda7eee1", "score": "0.8835993", "text": "function maxOfThree(a,b,c){\n return Math.max(a,b,c);\n}", "title": "" }, { "docid": "14aa249575e72644649495fb33f5c279", "score": "0.87990534", "text": "function maxOfThree (a,b,c) {\n\treturn Math.max(a,b,c);\n}", "title": "" }, { "docid": "4bab4c3d1817e1b25d1c36f421b7fa77", "score": "0.8737161", "text": "function largestOfThree(value1, value2, value3) {\n return Math.max(value1, value2, value3);\n}", "title": "" }, { "docid": "0bbdcb81e7a4239b58edfcada8033fac", "score": "0.86968416", "text": "function maxOfThree(a, b, c) {\n\tvar maxNumber=0;\n\tif(a>b){\n\t\tmaxNumber=a\n\t}\n\telse{\n\t\tmaxNumber=b\n\t}\n\n\n \tif( maxNumber> c){\n \t\treturn maxNumber\n \t}\n \telse{\n \t\treturn c\n \t}\n\n}", "title": "" }, { "docid": "1ddd104e83db45d8a6e7202ef306fc39", "score": "0.8692332", "text": "function maxOfThree(a, b, c) {\n\treturn max(a, max(b, c));\n}", "title": "" }, { "docid": "62767b2542bdcaa62f67bd3543d335f5", "score": "0.86610085", "text": "function maxOfThree(a, b, c) {\n let max = a;\n if (b > max) {\n max = b;\n }\n if (c > max) {\n max = c;\n }\n return max;\n \n}", "title": "" }, { "docid": "1c3de13b594b94da18f10451d478d8ea", "score": "0.8624876", "text": "function maxOfThree(x, y, z){\n return Math.max(x, y, z);\n}", "title": "" }, { "docid": "a2ceb8d853e1f8de664273f9c6e88a34", "score": "0.8612606", "text": "function maxOfThree(num1, num2, num3){\n if (num1 > num2 && num1 > num3) {\n return num1;\n }\n else if (num2 > num1 && num2 > num3) {\n return num2;\n }\n else {\n return num3;\n }\n}", "title": "" }, { "docid": "d1a2014ca0932149631309798388c0c6", "score": "0.86002195", "text": "function maxOfThree(num1, num2, num3){\n if (num1 > num2 && num1 > num3){\n return num1\n }\n else if (num2 > num1 && num2 > num3){\n return num2\n }\n else {\n return num3\n }\n}", "title": "" }, { "docid": "3c2221e0970e066f06ec1f0677be8829", "score": "0.8584466", "text": "function maxOfThree(first, second, third){\nif(first > second && first > third)\nreturn first;\nelse if(second > first && second > third)\nreturn second;\nelse return third;\n}", "title": "" }, { "docid": "21186d2a2db6e8f5e259048529552293", "score": "0.858224", "text": "function maxOfThree(a, b, c) {\n\tif (a>b && a>c) return a\n\tif (b>a && b>c) return b\n\treturn c;\n}", "title": "" }, { "docid": "44f98d32e5074042a5638bf6528e7f20", "score": "0.8571936", "text": "function maxOfThree(a,b,c) {\n if (a > b && a > c) {\n return a\n }\n else if ( b > c) {\n return b\n }\n else {\n return c\n }\n }", "title": "" }, { "docid": "3314f35039dc69486bd27bebbf41d275", "score": "0.85708445", "text": "function largest(num1, num2, num3) {\n return Math.max(num1, num2, num3)\n}", "title": "" }, { "docid": "3fdae9dca7c42b60b80a77b7c6d86791", "score": "0.85570925", "text": "function max3(a, b, c) {\n}", "title": "" }, { "docid": "c1f2e04e1db74e29932691cff8ac5707", "score": "0.85539037", "text": "function maxOfThree(number1,number2,number3){\n return((number1>number2)?\n ((number1>number3)?number1:number3) :(number2>number3)?number2:number3 );\n}", "title": "" }, { "docid": "a813c762b8265926b94cbcd873d9e12f", "score": "0.85497016", "text": "function maxOfThree(n1,n2,n3) {\n var max = Math.max(n1,n2,n3);\n return max\n }", "title": "" }, { "docid": "28d2bb3f3700fc385942e52bf81451df", "score": "0.8531822", "text": "function maxOfThree(num1,num2,num3){\n \"use strict\";\n\n var biggest = [num1, num2, num3];\n var max = Math.max.apply(null,biggest);\n return max;\n}", "title": "" }, { "docid": "cf76c256d3f52b16c42868da870afe22", "score": "0.8531323", "text": "function maxOfThree(x,y,z) {\n\n}", "title": "" }, { "docid": "c1197994b50761fc7cdd4edc6eef0dd8", "score": "0.85241383", "text": "function maxOfThreeNumbers(a, b, c) {\n if (a > b && a > b ) {\n return a \n } else if (b > a && b >c ){\n return b\n }else if (c > a && c > b)\n return c\n \n }", "title": "" }, { "docid": "86b34ba853d8e5a765f35ab7b07d751a", "score": "0.8521522", "text": "function maxOfThree(...args) {\n return Math.max(...args);\n}", "title": "" }, { "docid": "4991f50b652533614f2d01558de98390", "score": "0.8516194", "text": "function maxOfThree(n1, n2, n3) {\r\n\tif (n1 > n2 && n1 > n3) {\r\n\t\treturn n1;\r\n\t} else if (n2 > n1 && n2 > n3) {\r\n\t\treturn n2;\r\n\t} else {\r\n\t\treturn n3;\r\n\t}\r\n}", "title": "" }, { "docid": "94a3ee8faa4ba26d4aef37bef39e87d2", "score": "0.8471773", "text": "function maxOfThree(num1, num2, num3) {\n if (num1 > num2 && num1 > num3) {\n return num1\n } else if (num2 > num1 && num2 > num3) {\n return num2 \n } else if (num3 > num2 && num3 > num1) {\n return num3\n } else {\n return num1\n }\n }", "title": "" }, { "docid": "d06e9baf36ac82fb80e6d1d85e89fe39", "score": "0.8466468", "text": "function maxOfThree(a, b, c){\n if(a > b && a > c){\n return a\n }else if( b > a && b > c){\n return b;\n }else if (c > a && c > b){\n return c;\n }\n}", "title": "" }, { "docid": "32bcffc42961958e571212f724722ac0", "score": "0.84659404", "text": "function maxOfThreeNumbers(a, b, c) {\n if (a>b && a>c){\n return a;\n } else if (b>a && b>c){\n return b; \n } else {\n return c;\n }\n}", "title": "" }, { "docid": "3ca5877d92c5ea560d82c3abeb6ef36b", "score": "0.8452542", "text": "function maxOfThreeNumbers (num1, num2, num3){\n\t\tif (num1 > num2 && num1 > num3){\n\t\t\treturn num1;\n\t\t} else if (num2 > num1 && num2 > num3) {\n\t\t\treturn num2;\n\t\t} else {\n\t\t\treturn num3;\n\t\t}\n\t}", "title": "" }, { "docid": "1dad7c84115305ed25bdab6f78f4eb7a", "score": "0.84430116", "text": "function maxOfThree(num1, num2, num3){\n if (num1 > num2 && num1 > num3) {\n return num1;\n } else if (num2 > num1 && num2 > num3) {\n return num2;\n } else if (num3 > num1 && num3 > num2) {\n return num3;\n } else {\n return 'No one number is greatest.';\n }\n}", "title": "" }, { "docid": "419fdc60c32761ffe2cf32520293544c", "score": "0.84373486", "text": "function maxOfThreeNumbers(a, b, c) {\n if (a > b && a > c) {\n return a;\n } else if (a < b && b > c) {\n return b;\n } else if (c > b && c > a) {\n return c;\n }\n //\n}", "title": "" }, { "docid": "e9783345f769c646d595ad74762c5988", "score": "0.84284383", "text": "function maxOfThreeNumbers(a, b, c) {\n //\n if ( a > b && a > c ){\n return a;\n } else if ( b > a && b > c ) {\n return b;\n } else if (c > a && c >b ) {\n return c;\n }\n}", "title": "" }, { "docid": "bc3f7b7352229d3fe4260a10021ab96f", "score": "0.8425481", "text": "function maxOfThree(x, y, z) {\n var w = x > y ? x : y;\n return w > z ? w : z;\n}", "title": "" }, { "docid": "64c73170df8f71ee2ec3a232b90b7f68", "score": "0.84241927", "text": "function maxOfThree(a, b, c){\n\n if(a > b && a > c){\n return a\n\n }\n else if (a > b && b > c){\n return b\n }\n else {\n return c\n }\n\n}", "title": "" }, { "docid": "dfeebf63dc826dbe485b620a65ff72d8", "score": "0.8421177", "text": "function largestNum(num1, num2, num3) {\n return Math.max(num1, num2, num3);\n}", "title": "" }, { "docid": "3ccbcd8b4d6a7fd3874f12e2221dfcd9", "score": "0.8410483", "text": "function maxOfThree(num1, num2, num3) {\n let biggestNum;\n\n if (num1 <= num2) {\n biggestNum = num2;\n //find out which is larger, num1 or num2 \n } else biggestNum = num1;\n\n if (biggestNum < num3) {\n biggestNum = num3;\n return biggestNum;\n // return the biggest number between the result of the first if and num3\n } else\n return biggestNum;\n}", "title": "" }, { "docid": "cf2f8a69271f942145dd3b9bc4cb0a04", "score": "0.8394627", "text": "function largestOfThree(number1, number2, number3) {\n if((number1 > number2) && (number1 > number3)){\n return number1;\n }\n else if((number2 > number1) && (number2 > number3)){\n return number2;\n }\n else {\n return number3;\n }\n}", "title": "" }, { "docid": "7b9932edca8a7445f14fd676dac72b0d", "score": "0.8379717", "text": "function maxOfThree(num1, num2, num3) {\n if (num1 > num2 && num1 > num3){\n return num1;\n\n }else if (num2 > num1 && num2 > num3) {\n return num2;\n\n }else if (num3 > num1 && num3 > num2) {\n return num3;\n\n }else{\n console.log('Beats me!')\n }\n}", "title": "" }, { "docid": "301a1564f50d6ca85dd529df5092bf49", "score": "0.835834", "text": "function maxOfThree(x,y,z) {\n if (x > y && x > z)\n return x;\n else if (y > x && x > z)\n return y;\n else\n return z;\n}", "title": "" }, { "docid": "097aedf9dc9ca714ffb84d51583bfac3", "score": "0.8324665", "text": "function GetMax3Numbers( num1, num2, num3 )\r\n{\r\n\tvar Result;\t\r\n\tvar maxof2numbers = GetMax2Numbers( num1, num2 );\r\n\tresult = GetMax2Numbers( maxof2numbers, num3 );\r\n\treturn result;\r\n}", "title": "" }, { "docid": "b4f2cba02f3721bc41583b7eefc66e32", "score": "0.8289856", "text": "function maxOfThree(x , y , z){\n if(x > y){\n \tif(x > z){\n \t\treturn x;\n \t} else {return z;} \n } else if(y > z){\n \treturn y;\n } else {return z;}\n}", "title": "" }, { "docid": "b1a36a419a50fe2881d2b0eb663f152b", "score": "0.8282143", "text": "function maxOfThree(a,b,c) {\n if (a>(b&&c)) {\n return a;\n }\n if (b>(a&&c)) {\n return b;\n }\n if (c>(a&&b)) {\n return c;\n }\n else {\n return 'You have passed equal values into the function. Please choose different numbers.';\n }\n}", "title": "" }, { "docid": "d0ffb3f7262278504f0961db9623cfc2", "score": "0.8279745", "text": "function maxOfThree(a, b, c) {\n if (a >= b && a >= c) {\n return (a);\n } else if (b >= a && b >= c) {\n return b;\n } else {\n return c;\n }\n}", "title": "" }, { "docid": "bf44a1cd26ed5a6fd61b9d2d8f55926d", "score": "0.824414", "text": "function largestOfThree(a, b, c) {\r\n if ((a >= b) && (a >= c)) { \r\n return a;\r\n } else if ((b >= a) && (b >= c)) {\r\n return b;\r\n } else {\r\n return c;\r\n }\r\n}", "title": "" }, { "docid": "cf836ec7a0ff8ced9d04dd4aef30b62c", "score": "0.8236883", "text": "function maxOfThree(num3,num4,num5){\n if (num3 > num4 && num3 > num5){\n return num3;\n }\n else if (num4 > num3 && num4 > num5){\n return num4;\n }\n else if (num5 > num3 && num5 > num4){\n return num5;\n }\n else{\n return \"Something went wrong. Figure out what!\"\n }\n}", "title": "" }, { "docid": "356c077eba8ac49cf15a0b8c5752ba32", "score": "0.8232477", "text": "function largestOfThree(value1, value2, value3) {\n if(value1 > value2 && value1 > value3) {\n return value1;\n } else if (value2 > value1 && value2 > value3) {\n return value2;\n } else {\n return value3;\n }\n}", "title": "" }, { "docid": "ff6246a1edcd265242df5e871e3c444c", "score": "0.8231904", "text": "function maxOfThree() {\n //...\n}", "title": "" }, { "docid": "c72612f251546eccf18756acee6c7bb0", "score": "0.8210289", "text": "function largest(a,b,c) {\n return Math.max(a,b,c);\n}", "title": "" }, { "docid": "6688648a0c0040ae718af2fca003b0df", "score": "0.8204829", "text": "function maxOfThree(num1, num2, num3) {\n // Your answer here\n if (num1 > num2 && num1 > num3) {\n return num1;\n } else if (num2 > num1 && num2 > num3) {\n return num2;\n } else if (num3 > num1 && num3 > num2) {\n return num3;\n } else {\n return \"You done screwed up fool!!!\";\n }\n\n}", "title": "" }, { "docid": "bbfc44f9ce60e697b99ae82841677fbe", "score": "0.8188526", "text": "function maxOfThree(a, b, c) {\n if (isNaN(a) === false && isNaN(b) === false && isNaN(c) === false) {\n return Math.max(a, b, c);\n } else if (isNaN(a) === true && isNaN(b) === false && isNaN(c) === false) {\n return Math.max(b, c);\n } else if (isNaN(a) === false && isNaN(b) === true && isNaN(c) === false) {\n return Math.max(a, c);\n } else if (isNaN(a) === false && isNaN(b) === false && isNaN(c) === true) {\n return Math.max(a, b);\n } else if (isNaN(a) === true && isNaN(b) === true && isNaN(c) === false) {\n return c;\n } else if (isNaN(a) === true && isNaN(b) === false && isNaN(c) === true) {\n return b;\n } else if (isNaN(a) === false && isNaN(b) === true && isNaN(c) === true) {\n return a;\n } else {\n return NaN\n }\n}", "title": "" }, { "docid": "a73fe4746d871d6349012a971c878201", "score": "0.81620216", "text": "function biggestOfThree (a, b, c) {\n\tif (a > b) {\n\t\tif (a > c) {\n\t\t\treturn a;\n\t\t} else {\n\t\t\treturn c;\n\t\t}\n\t}\n\tif (c > b) {\n\t\treturn c;\n\t} else {\n\t\treturn b;\n\t}\n}", "title": "" }, { "docid": "37e45c79b59c5da0c95745751d1bc884", "score": "0.8133357", "text": "function biggest3Nums([n1, n2, n3]) {\n let [num1, num2, num3] = [n1, n2, n3].map(Number);\n\n console.log(Math.max(num1, num2, num3));\n}", "title": "" }, { "docid": "8ca830409d74e85eecb9a829c3402e5b", "score": "0.81233037", "text": "function maxNum(num1, num2, num3) {\n var max = 0;\n if ((num1 >= num2) && (num1 >= num3)) {\n max = num1;\n } else if ((num2 >= num1) && (num2 >= num3)) {\n max = num2;\n } else {\n max = num3;\n }\n return max;\n}", "title": "" }, { "docid": "cef48dc763938aa025371750eb6078dc", "score": "0.8094238", "text": "function maxOfThree (x, y, z) {\n const numbers = [x, y, z]\n let max = numbers[0]\n for (let i = 1; i < numbers.length; i++) {\n if (max < numbers[i]) {\n max = numbers[i]\n }\n }\n return 'max is: ' + max\n}", "title": "" }, { "docid": "5a8bd68ab562d140783bd4cec1e96bdc", "score": "0.80606425", "text": "function maxOfThree(nUm1, nUm2, nUm3){\n if (nUm1 > nUm2 && nUm1 > nUm3){\n return nUm1;\n }\n else if (nUm2 > nUm1 && nUm2> nUm3) {\n return nUm2;\n }\n else {\n return nUm3;\n }\n}", "title": "" }, { "docid": "58f9ba3b8caf34aa86b5845716c9821b", "score": "0.8050898", "text": "function maxOfThree(num1,num2,num3) {\n if (num1 > num2 && num1 > num3) {\n alert(num1);\n } else if (num2 > num1 && num2 > num3) {\n alert(num2);\n } else if (num3 > num1 && num3 > num2) {\n alert(num3);\n }\n}", "title": "" }, { "docid": "57cf16961a0ac18e72ab04d9df64e371", "score": "0.8030073", "text": "function maxNum(a , b , c) {\n max = 0\n for (let i = 0; i < 3; i++) {\n if (a > max) {\n max = a\n } if (b > max) {\n max = b\n } if (c > max) {\n max = c\n }\n return max\n }\n}", "title": "" }, { "docid": "07a6b4d9415ed5f0873cc3b10336b7ae", "score": "0.80105644", "text": "function maxOfThree(x, y, z) {\n if (x >= y && x >= z){\n return x;\n } else if(y >= x && y >= z){\n return y;\n } else if(z >= x && z >= y){\n return z;\n }\n }", "title": "" }, { "docid": "9686d2ca8ee2c15e47a5b522e436369f", "score": "0.79674155", "text": "function max3( a, b, c ) { return ( a >= b && a >= c ) ? a : ( b >= a && b >= c ) ? b : c; }", "title": "" }, { "docid": "d786e07624abae8e0e238cd3c2807f7b", "score": "0.7929042", "text": "function largestNumber(a, b, c) {\n if (a > b && a > c) {\n return a;\n } else if (b > a && b > c) {\n return b;\n } else {\n return c;\n }\n}", "title": "" }, { "docid": "cd47cdbc2ed0e3156157e282e3e311c3", "score": "0.79148304", "text": "function findMax(n1, n2, n3) {\n let maximum;\n if (n1 > n2 && n1 > n3) {\n maximum = n1;\n } else if (n2 > n1 && n2 > n3) {\n maximum = n2;\n } else {\n maximum = n3;\n }\n return maximum;\n}", "title": "" }, { "docid": "50dca16948424d9f15513390f7a9c45d", "score": "0.7913896", "text": "function findLargestFromThree(firstOne, secondOne, thirdOne){\n if(firstOne > secondOne && firstOne > thirdOne){\n return firstOne;\n }\n else if( secondOne > firstOne && secondOne > thirdOne){\n return secondOne;\n }\n else{\n return thirdOne;\n }\n}", "title": "" }, { "docid": "d49f46531f5fab5e6f339e9f433cadf8", "score": "0.791169", "text": "function thirdMax(nums) {\n nums.sort((a, b) => b - a);\n\n const uniques = [...new Set(nums)];\n\n return uniques.length >= 3 ? uniques[2] : Math.max(...uniques);\n}", "title": "" }, { "docid": "57be01d0a237d47382022a36ae10e8ee", "score": "0.78788775", "text": "function highest_number(x,y,z) {\n\n return Math.max(x,y,z);\n\n}", "title": "" }, { "docid": "47dd52173d90994cdb09554378e4cade", "score": "0.78742176", "text": "function maxOfThree(num1, num2, num3){\n // Your answer here\n if(isNaN(num1) && isNaN(num2) && isNaN(num3))\n {\n return null;\n }\n else {\n return Math.max(num1, num2, num3);\n }\n}", "title": "" }, { "docid": "65eb2737e6b95709ae325ab4ff2ce304", "score": "0.7868411", "text": "function highestOfThree(arr) {\n arr.sort((a, b) => {\n return a - b;\n })\n const last = arr.length - 1;\n return Math.max(arr[0]*arr[1], arr[last-2]*arr[last-1]) * arr[last];\n}", "title": "" }, { "docid": "d1382d9d457a0f0c8950b0aab3c55802", "score": "0.786592", "text": "function maxOfThree(n1, n2, n3){\n if (n1 > n2 && n1 > n3) {\n console.log(n1)\n }\n else if (n2 > n1 && n2 > n3){\n console.log(n2)\n }\n else {\n console.log(n3)\n }\n \n}", "title": "" }, { "docid": "309791ac45cfb1734d33b6497fb92bfb", "score": "0.7846802", "text": "function largestNumber(num1,num2,num3){\r\n let result;\r\n if( num1> num2 && num1 > num3)\r\n {\r\n result = num1;\r\n }\r\n else if (num2 > num1 && num2 > num3)\r\n {\r\n result = num2\r\n }\r\n else if (num3 > num1 && num3 > num2)\r\n {\r\n result = num3\r\n }\r\n\r\n console.log(`The largest number is ${result}.`);\r\n}", "title": "" }, { "docid": "3688cc75992043d9b92fe0aeefe1ac6b", "score": "0.783645", "text": "function maximum(a, b, c) {\n let max = a;\n\n if (max < b) {\n max = b;\n }\n\n if (max < c) {\n max = c;\n }\n\n return max;\n}", "title": "" }, { "docid": "6dded145cb75e349c05eee911048c18c", "score": "0.781918", "text": "function greatestNum(param1, param2, param3) {\n let greatest = Math.max(param1, param2, param3);\n return greatest;\n}", "title": "" }, { "docid": "d99d46bc35edd0571fdff332f1e80a95", "score": "0.77922", "text": "function largestNumber(a,b,c){\n if (a>b && a>c){\n return a;\n }else{\n if (b>a && b>c){\n return b;\n }\n else{\n return c;\n }\n }\n}", "title": "" }, { "docid": "d1103e953fa9bda40529e73a214e59e9", "score": "0.7789305", "text": "function max_of_three() {\r\n var num1 = +document.getElementById('num1_max_of_three').value;\r\n var num2 = +document.getElementById('num2_max_of_three').value;\r\n var num3 = +document.getElementById('num3_max_of_three').value;\r\n // var max_value = 0;\r\n if (num1 >= num2 && num1 >= num3) {\r\n document.getElementById('result_max_of_three').innerHTML = \"The largest number is : \" + num1;\r\n } else if (num2 >= num1 && num2 >= num3) {\r\n document.getElementById('result_max_of_three').innerHTML = \"The largest number is : \" + num2;\r\n } else if (num3 >= num1 && num3 >= num2) {\r\n document.getElementById('result_max_of_three').innerHTML = \"The largest number is : \" + num3;\r\n }\r\n}", "title": "" }, { "docid": "33e68c879427d8093db7ddd889efaec5", "score": "0.7755391", "text": "function maxOfThree(num1,num2,num3){\n if (num1 > num2)\n { \n if (num1>num3){ \n return(\"number 1 is greater of the three \" + num1);\n }else\n {\n return(\"number 3 is greater of the three \" +num3);\n }\n }else {\n return (\"number 2 is greater of the three \" +num2);\n }\n}", "title": "" }, { "docid": "1380523141f354c757636d1d7c9bd36a", "score": "0.77055496", "text": "function takeBiggestOfThreeNumbers(firstNum, secondNum, thirdNum) {\n var result = firstNum;\n\n if (result < secondNum) {\n result = secondNum;\n if (result < thirdNum) {\n result = thirdNum;\n }\n } else if (result < thirdNum) {\n result = thirdNum;\n }\n\n return result;\n}", "title": "" }, { "docid": "90c8195d6c427f90ad3918652f54275f", "score": "0.7705127", "text": "function highestProductOfThree(nums) {\n\n}", "title": "" }, { "docid": "d9acc420197d1d7893a65b1555875f86", "score": "0.7675754", "text": "function getLargestNumber(args) {\n var input = args[0].split(' ').map(Number),\n firstNumber = input[0],\n secondNumber = input[1],\n thirdNumber = input[2];\n\n if (getMax(firstNumber, secondNumber) > thirdNumber) {\n return getMax(firstNumber, secondNumber);\n } else {\n return thirdNumber;\n }\n\n function getMax(first, second) {\n return first > second ? first : second;\n }\n}", "title": "" }, { "docid": "f3b13d576660f07ea386fe30d55e7d40", "score": "0.7642283", "text": "function findLargest(first, second,third){\n if(first > second && first > third){\n return first;\n }\n else if(second > first && second > third){\n return second;\n }\n else{\n return third;\n }\n }", "title": "" }, { "docid": "d050ab7cd216b9cc6c7bc8fed67614f6", "score": "0.75608325", "text": "function biggestNumber(a,b,c) {\n let dummy = Math.max(a,b,c);\n console.log(dummy);\n}", "title": "" }, { "docid": "eda7e8441af371e272d56ce7b725ffd3", "score": "0.7370287", "text": "function maxProductOfThree(A) {\n A.sort((a,b) => a-b);\n\n let negativeMax;\n\n if (A[0] < 0 && A[1] < 0) {\n negativeMax = A[0] * A[1];\n }\n\n let potentialMax1 = negativeMax * A[A.length-1];\n let potentialMax2 = A[A.length-3] * A[A.length-2] * A[A.length-1];\n\n return potentialMax1 > potentialMax2 ? potentialMax1 : potentialMax2;\n}", "title": "" }, { "docid": "b66ea91f2373118073ef4414fd5e8175", "score": "0.7364927", "text": "function getMaxThree(numbersArray) {\n sortNumbersArray(numbersArray);\n let maxThreeArray = [numbersArray[0], numbersArray[1], numbersArray[2]];\n return maxThreeArray;\n}", "title": "" }, { "docid": "ec79d65a73e13586792f6ecd24a6fee9", "score": "0.73385465", "text": "function largestProductOfThree (array) {\n\n\t// sort array from smallest to largest numbers\n\tarray.sort(function(a,b){\n\t\treturn a - b;\n\t})\n\n\t// define array length\n\tvar length = array.length;\n\n\t// product if two smallest numbers are negative\n\tvar doubleNegCombo = array[0] * array[1] * array[length-1];\n\n\t// product if three largest numbers are all positive or all negative\n\tvar bigThreeCombo = array[length-1] * array[length-2] * array[length-3];\n\n\t// return the largest number from the two possible products\n\treturn Math.max(doubleNegCombo, bigThreeCombo);\n}", "title": "" }, { "docid": "b038926a0029c9c191a5992bfb70aea6", "score": "0.72937906", "text": "function max(a, b, c, d) {\n var max = a;\n if (b > a) max = b;\n if (c > a) max = c;\n if (d > a) max = d;\n return max;\n}", "title": "" }, { "docid": "cd0c8d37dae3af0e41048fdeaf1ed9d4", "score": "0.72928834", "text": "function third_greatest(nums) {\n\n nums.sort(function(a, b) {\n return b - a\n });\n return nums[2];\n\n }", "title": "" }, { "docid": "b8fae5c2075da6018dc52af2835cb1df", "score": "0.72745013", "text": "function largestProductOfThree(array) {\n //solution code here\n}", "title": "" }, { "docid": "485ce47d23b33721d632a1bd989536ec", "score": "0.7239681", "text": "function biggestOfThree(input) {\n let a = parseFloat(input[0]);\n let b = parseFloat(input[1]);\n let c = parseFloat(input[2]);\n \n if (a === b & b === c) {\n console.log(a)\n }\n else if (a >= b && b >= c) {\n console.log(a);\n }\n else if (a >= c && c >= b) {\n console.log(a);\n }\n else if (b >= a && a >= c) {\n console.log(b);\n }\n else if (b >= c && c >= a) {\n console.log(b);\n }\n else if (c >= b && b >= a) {\n console.log(c);\n }\n else if (c >= a && a >= b) {\n console.log(c);\n }\n}", "title": "" }, { "docid": "6eedce55ffc46686c1c98e30b632b6f3", "score": "0.7220163", "text": "function largestNumber(a,b,c,d,e){\n if(a > b && a > b && a > c && a > d && a > e){\n return a;\n }\n else if(b > a && b > c && b > d && b > e){\n return b;\n }\n else if(c > a && c > b && c > d && c > e){\n return c;\n }\n else if(d > a && d > b && d > c && d > e){\n return d;\n }\n else if(e > a && e > b && e > c && e > d){\n return e;\n }\n}", "title": "" }, { "docid": "623da52b9e74243109f6ecfff927aef1", "score": "0.71787727", "text": "function getHighestProductOfThree(intArray){\n if (intArray.length < 3){\n throw new Error (\"Less than 3 items!\");\n }\n var highest = Math.max(intArray[0], intArray[1]);\n var lowest = Math.min(intArray[0], intArray[1]);\n var highestProductOf2 = intArray[0] * intArray[1];\n var lowestProductOf2 = intArray[0] * intArray[1];\n var highestProductOf3 = intArray[0] * intArray[1] * intArray[2];\n\n\n for (var i=0; i<intArray.length; i++){\n var current = intArray[i];\n\n highestProductOf3 = Math.max(\n highestProductOf3,\n highestProductOf2 * current,\n current * lowestProductOf2\n );\n highestProductOf2 = Math.max(\n highestProductOf2,\n current * highest,\n current * lowest\n );\n lowestProductOf2 = Math.min(\n lowestProductOf2,\n current * lowestProductOf2,\n );\n highest = Math.max(highest, current);\n lowest = Math.min(lowest, current);\n\n }\n return highestProductOf3;\n}", "title": "" }, { "docid": "d034e4e0052043cfced87b4b55098f88", "score": "0.7174393", "text": "function findTheBiggest(a, b, c, d, e) {\n var max = a;\n if(b > max) max = b;\n if(c > max) max = c;\n if(d > max) max = d;\n if(e > max) max = e;\n\n return max;\n}", "title": "" }, { "docid": "92c1292e904192659757ced5c2feac1f", "score": "0.71550596", "text": "function myThirdMax(arr) {\n \n let max = arr[0];\n let secondMax = -Infinity;\n let third = -Infinity;\n \n for (let i = 1; i < arr.length; i++) {\n let element = arr[i];\n \n if (element > max) {\n \n third = secondMax;\n secondMax = max;\n max = element;\n } else if (element < max && element > secondMax) {\n third = secondMax;\n secondMax = element;\n } else if (element > third && element < secondMax) {\n third = element;\n }\n }\n return third === -Infinity ? max : third;\n }", "title": "" }, { "docid": "fc4541ab0cf2e83a590aa7023007acf0", "score": "0.7126685", "text": "function findNumber(num1,num2,num3){\n\n if (num1 - num2 >0 && num1 -num3 >0) {\n console.log ( num1 + \" is the largest\");\n }\n \n else if (num2 - num1 >0 && num2 -num3 >0)\n {\n console.log ( num2 + \" is the largest\");\n } \n \n else {\n console.log ( num3 + \" is the largest\");\n }\n \n}", "title": "" }, { "docid": "2c373a814e948c2c92d74fd76b9ac712", "score": "0.70795536", "text": "function biggestOfThree() {\n var biggestInput = document.getElementById(\"biggest-input\").value;\n\n biggestInput = biggestInput.split(\", \");\n var bigFirst = parseInt(biggestInput[0]);\n var bigSecond = parseInt(biggestInput[1]);\n var bigThird = parseInt(biggestInput[2]);\n\n var bigger = 0; // oh the irony\n\n if (bigFirst > bigSecond) {\n if (bigFirst > bigThird) {\n bigger = bigFirst;\n }\n else {\n bigger = bigThird;\n }\n }\n else {\n if (bigSecond > bigThird) {\n bigger = bigSecond;\n }\n else {\n bigger = bigThird;\n }\n }\n document.getElementById(\"biggest-output\").value = bigger;\n}", "title": "" }, { "docid": "890812e31f3c49011c44eb963b4ae987", "score": "0.706439", "text": "function getBiggestOfFive(a, b, c, d, e) {\r\n var max = Math.max();\r\n\r\n if (a > max) {\r\n max = a;\r\n }\r\n if (b > max) {\r\n max = b;\r\n }\r\n if (c > max) {\r\n max = c;\r\n }\r\n if (d > max) {\r\n max = d;\r\n }\r\n if (e > max) {\r\n max = e;\r\n }\r\n return console.log('The biggest of five numbers is ', max);\r\n}", "title": "" }, { "docid": "e6d60fd64d3f16c3c820b7a2e04bc8c1", "score": "0.69973516", "text": "function maxOfThree(playerOne, playerTwo, playerThree){\n // Your answer here\n if ((playerOne > playerTwo) && (playerOne > playerThree)) {\n return \"Jack is greater than the rest\";\n } else if ((playerTwo > playerOne) && (playerTwo > playerThree)) {\n return \"Jill is greater than the rest\";\n } else if ((playerThree > playerOne) && (playerThree > playerTwo)) {\n return \"Bill is greater than the rest\";\n }\n}", "title": "" }, { "docid": "89c67cff8e9ee53eb9b0463583eefb75", "score": "0.6986371", "text": "function largeVal(a,b,c){\n if (a > b && a > c){\n return \"a is the Largest\";\n }\n else if (b > a && b > c){\n return \"b is the Largest\";\n }\n else \n return \"c is the Largest\";\n }", "title": "" }, { "docid": "2cd3f7c67889753d014016db2aa40324", "score": "0.6983241", "text": "function sum( num1,num2,num3){\nreturn Math.max(num1,num2,num3)\n}", "title": "" } ]
3107b756956da1e4adbe6b3de98e2479
craete the play function
[ { "docid": "918407b73d198780aaa8e79c14b01e63", "score": "0.0", "text": "play()\n {\n form.hide();\n\n Player.getPlayerInfo();\n \n if(allPlayers !== undefined)\n {\n\n //give color to the background by using hexadecimal number\n background(\"white\");\n\n \n\n // //add image to the background\n // rotate(90);\n // rect(0,0,180,180);\n // image(track,0,-displayHeight*4,displayWidth,displayHeight*5);\n \n //var display_position = 100;\n \n //index of the array\n var index = 0;\n\n //x and y position of the players\n var x ;\n var y = 45;\n\n for(var plr in allPlayers)\n {\n //add 1 to the index for every loop\n index = index + 1 ;\n\n //position the playes a little away from each other in x direction\n y = y + 120;\n //use data form the database to display the players in y direction\n x = displayWidth + allPlayers[plr].distance;\n console.log(allPlayers[plr].distance);\n cars[index-1].x = x;\n cars[index-1].y = y;\n\n if (index === player.index)\n {\n\n //mark the player\n stroke(10);\n fill(\"green\");\n ellipse(x,y,110,110);\n cars[index - 1].shapeColor = \"black\";\n camera.position.x = cars[index-1].x\n camera.position.y = displayHeight/2;\n }\n \n //textSize(15);\n //text(allPlayers[plr].name + \": \" + allPlayers[plr].distance, 120,display_position)\n }\n\n }\n\n if(keyIsDown(RIGHT_ARROW) && player.index !== null)\n {\n if(gameState === 1) {\n player.distance +=10\n }\n player.update();\n }\n\n //change the game state to 2\n if(player.distance > 6600)\n {\n gameState = 2;\n //text(\"GAME ENDED\" , 600,500);\n\n }\n\n // if(player.distance === 1440 && gameState === 1)\n // {\n // score = score + 200;\n // console.log(\"200\");\n\n // } else if(player.distance === 2410 && gameState === 1)\n // {\n // score = score + 200;\n\n // } else if(player.distance === 3380 && gameState === 1)\n // {\n // score = score + 200;\n\n // }\n\n // if(keyDown(32))\n // {\n // space = true;\n // up = true;\n\n // }\n\n // if(space === true)\n // {\n\n \n \n // if(up === true)\n // {\n // if(jump>-20)\n // {\n // jump = jump-5;\n // }else\n // {\n // up = false;\n \n // }\n\n // } \n\n // } else \n // {\n\n // if(jump<0)\n // {\n // jump = jump + 5;\n // } else \n // {\n // space = false;\n\n // }\n // }\n\n // cars[0].y = cars[0].y+ jump;\n\n \n drawSprites();\n }", "title": "" } ]
[ { "docid": "94424d991b33b797dffd84931ded2635", "score": "0.8779972", "text": "play() {}", "title": "" }, { "docid": "f5764d19b488431a29a5791caf46f52d", "score": "0.8321046", "text": "function play() {\n\n\n}", "title": "" }, { "docid": "0d396cc30f9c12155f84f1cd70da2d46", "score": "0.82847905", "text": "prePlay() {}", "title": "" }, { "docid": "0d396cc30f9c12155f84f1cd70da2d46", "score": "0.82847905", "text": "prePlay() {}", "title": "" }, { "docid": "6114a958e0841985ddf162f43b2f7b52", "score": "0.81939983", "text": "play () {\n\t\tthis.loop()\n\t}", "title": "" }, { "docid": "a82c6020934abb528810cccf45113c51", "score": "0.81798595", "text": "function play() {\n\n //The play state is not needed in this example\n}", "title": "" }, { "docid": "4e86c8939d76efa16fda9372144ed90c", "score": "0.80335146", "text": "play(item) {\n\n\t}", "title": "" }, { "docid": "74bbef0a5853276e1e44faefac22a348", "score": "0.7885971", "text": "_play() {\n TheFragebogen.logger.debug(this.constructor.name + \"._play()\", \"This method must be overridden if playback is desired.\");\n }", "title": "" }, { "docid": "ae07e55130c3560577bf62a0ae3694c0", "score": "0.7858747", "text": "function play(){\n //start playback\n}", "title": "" }, { "docid": "43c059695b35006c593a7f7bd1ba9ddd", "score": "0.7841373", "text": "playMove() {\n\t\t\t\n\t\t}", "title": "" }, { "docid": "e878db6dfd57894bbef0684eeb91e763", "score": "0.7741464", "text": "play(){\n super.play();\n }", "title": "" }, { "docid": "5b326c21d5587daf97e1cc6c30c05b30", "score": "0.7611422", "text": "function playMain() {\n\n}", "title": "" }, { "docid": "637da298efeee96878be33886f566029", "score": "0.76101273", "text": "play(){\n\t\tthis.gameLoop();\n\t}", "title": "" }, { "docid": "e390d3fd33c3d6fbf8c130f2fc0fb1b6", "score": "0.75910854", "text": "function playboom(){xb.play();}", "title": "" }, { "docid": "a9e2339ac0eb08e9ff8efc6bc3b383d8", "score": "0.7563724", "text": "play() {\n this.sdnPostMessage_('play2');\n }", "title": "" }, { "docid": "d79414cb71497c975ee9d83cc619c29e", "score": "0.74275094", "text": "onPlay() {\n this.trigger('play');\n }", "title": "" }, { "docid": "cd4a5bc0ba98756b7b5a77b83c46e336", "score": "0.7313244", "text": "play() {\n this._parentPlay();\n this._markPlaying();\n this._markCurrentTimePlaying();\n }", "title": "" }, { "docid": "5fd9aae9b945ed063ea9549c6ebbb3b1", "score": "0.7261379", "text": "function playOneTrack () {\n // TODO: fill this out\n \n \n}", "title": "" }, { "docid": "1214dbe48927f392b2cdee30614980bc", "score": "0.72375613", "text": "play() {\n this.log('client called play()');\n RNFMAudioPlayer.play();\n }", "title": "" }, { "docid": "32d3ef5711cfccdd838eeb32247a4db3", "score": "0.7200262", "text": "play() {\n // imposto un ritardo di .8 secondi per far partire lo slide\n this.timer = setTimeout(this.goNext, 800);\n // scorro le immagini ogni 3 secondi\n this.timer = setInterval(this.goNext, 3000);\n this.playing = true;\n }", "title": "" }, { "docid": "342c6996d328f0db19684077ed59a115", "score": "0.7143258", "text": "function play() {\n\tconsole.log('beginning of the play function');\n\tif (!config.debug) {\n\t\treqprom(config.adressSpotUtils, {\n\t\t\t'auth': {\n\t\t\t\t'user': config.userSpotUtils,\n\t\t\t\t'pass': config.passwordSpotUtils,\n\t\t\t\t'sendImmediately': false\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "7e2b8195dcd7fd958a90776ce23fdfd1", "score": "0.71206677", "text": "_touchToPlay () { }", "title": "" }, { "docid": "bc913ff136d8460c00b9b060b87f8fdc", "score": "0.7110236", "text": "_replay() {\n\t\tthis._play(this.operations);\n\t}", "title": "" }, { "docid": "b3892bfbd8b4eb5cc58d0976bd8b719a", "score": "0.71082234", "text": "function play() {\n if($('#play').html() === 'Replay') {\n $('#playScale').attr('src', maqam[randomNumber].file);\n $('#playScale')[0].play();\n } else {\n generateNumber();\n //play audio\n $('#playScale').attr('src', maqam[randomNumber].file);\n $('#playScale')[0].play();\n $('#play').toggleClass('.replay').html('Replay');\n }\n}", "title": "" }, { "docid": "f669d8f23f8463adae4bceee772399d2", "score": "0.7104926", "text": "play() {\n\n\t\t// Mute?\n\t\tif(window.mute){\n\t\t\tthis.player.volume = 0;\n\t\t}\n\n\t\t// Looping things\n\t\tif(this.loop){\n\t\t\tthis.current_player = \"a\";\n\t\t\tthis.play_loop();\n\t\t} else {\n\t\t\tthis.player.play();\n\t\t}\n\t}", "title": "" }, { "docid": "2e68f4951863a14fdede6fcb2d293d13", "score": "0.7083136", "text": "function _play() {\n\t\tif (_intervalId === \"\") {\n\t\t\t//_intervalId = setInterval(_nextFrame, _options.framerate);\n\t\t}\n\t}", "title": "" }, { "docid": "8ae829922d19c4090760a0de9aff58f5", "score": "0.7078699", "text": "function onClickPlay () {\n\t\tthis.state.start('play');\n\t}", "title": "" }, { "docid": "8aa0cb31278eba63e30775de399f1a5f", "score": "0.7077229", "text": "function play() {\n player.play();\n }", "title": "" }, { "docid": "5005814726301ee0306d9efebf2302f6", "score": "0.7072394", "text": "function playRock() {\r\n play(\"rock\");\r\n}", "title": "" }, { "docid": "655f5484a282cd121c9cabd1d48362cb", "score": "0.7068208", "text": "function willyD(e){\r\n\tdocument.getElementById(\"hell\").play();\r\n}", "title": "" }, { "docid": "3a1c1c530adb678e45a044240f9a547b", "score": "0.7051182", "text": "play(){\r\n this.reference.amp(1.5);\r\n this.reference.start();\r\n }", "title": "" }, { "docid": "0a6ec11f81cbafd8554efa7ffc6bd35f", "score": "0.7048451", "text": "function startPlay() {\n\ttimerClear();\n clearUI();\n mode = activeMode;\n}", "title": "" }, { "docid": "bb4c03e4b2ed659a8071e07ddc56d81b", "score": "0.7033322", "text": "mediaPlay() {\n this.tvRequest(WEBOS_URI_PLAY, {}, ``);\n }", "title": "" }, { "docid": "32e2de02a4d585600ef0d9affe4510fd", "score": "0.70309424", "text": "replay() {\n this._time.end = -1;\n this.play();\n }", "title": "" }, { "docid": "66033c68ae29e3245b62ef2d6e36b036", "score": "0.7029628", "text": "function playSongs(r) {\n\tsongs[r].play();\n}", "title": "" }, { "docid": "8527d951ce4ccd0240a110590999c94a", "score": "0.702309", "text": "play() {\n if (this._isPlaying) return;\n // if (!this.currentTrace) this.currentTrace = this._getFirstTraceInOrder();\n this.timer = setInterval(this._onPlay, this.timerInterval);\n this._isPlaying = true;\n }", "title": "" }, { "docid": "d29c6af691216d9ccccb4a27815b39db", "score": "0.70079595", "text": "play() {\n this.playing = 1;\n }", "title": "" }, { "docid": "85a5e77dda745786e869a85892ec8b60", "score": "0.6991094", "text": "play(){\n //console.log('Now playing: ' + this.songArray[0].name);\n this.player.play();\n }", "title": "" }, { "docid": "9e94799cab0e2ed9af7448245c9e2ec2", "score": "0.69850993", "text": "function play() {\n\toutlet(0,noteHist[0]);\n}", "title": "" }, { "docid": "72fe80966e42c00ab9b0b49a6bbc0e1e", "score": "0.69809693", "text": "function playFire(e) { \n \tfire.play();\n}", "title": "" }, { "docid": "c70d3a035f36f1c5149ca149339f0541", "score": "0.69759655", "text": "function sound(){\n snd.play()\n }", "title": "" }, { "docid": "5b41f941113f2619537b6ab214258d9f", "score": "0.69660985", "text": "play_loop() {\n\t\tlet self = this,\n\t\t\t\tplayer = null;\n\n\t\tswitch(this.current_player){\n\t\t\tcase \"a\":\n\t\t\t\tplayer = this.player;\n\t\t\t\tthis.current_player = \"b\";\n\t\t\t\tbreak;\n\t\t\tcase \"b\":\n\t\t\t\tplayer = this.player_loop;\n\t\t\t\tthis.current_player = \"a\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tplayer.play();\n\n\t\tthis.loop_timeout = setTimeout(function(){\n\t\t\tself.play_loop();\n\t\t}, this.duration - 1000);\n\t}", "title": "" }, { "docid": "916c15e9f4c8b82ece29199689f2d462", "score": "0.69567275", "text": "__delayPlay__ () {\n let media = this.$media[0];\n\n media.paused && media.play(); \n this.__events__.emit('play');\n }", "title": "" }, { "docid": "bcfa7ca2682630c36b36eb53fc8c89e8", "score": "0.6942426", "text": "function playOrPauseMusic() {\n\n\tnowPlay();\n}", "title": "" }, { "docid": "dfad5d4d1cb4ac62b1740d0d29d08319", "score": "0.69358087", "text": "function preparePlay() {\n $body.addClass('paused')\n var $playButton = jQuery('#playButton')\n $playButton.on('click', that.play.bind(that))\n }", "title": "" }, { "docid": "4739ed99f4f438142e81f9ed43567451", "score": "0.6926648", "text": "play() {\n this.player.play();\n }", "title": "" }, { "docid": "0620759f44563328272e00214cea5e39", "score": "0.69252306", "text": "function play()\r\n{\r\n if (chosen == \"hp\"){\r\n hp.play()}\r\n if (chosen == \"pan\"){\r\npan.play()}\r\n}", "title": "" }, { "docid": "1d855ad49b611bb908c4b9059a972f36", "score": "0.69189036", "text": "play() {\n if (this.player) {\n this.startedNotes = [];\n this.player.play();\n }\n }", "title": "" }, { "docid": "a622c4cc26abb69dd6f465e6252f5562", "score": "0.6916724", "text": "function loaded() {\n song.play();\n}", "title": "" }, { "docid": "8557e08d91bb24812dde1325758bde35", "score": "0.69045866", "text": "function play() {\n hls.media.play();\n}", "title": "" }, { "docid": "13fc7b9a2bf3538d7e91adfea589f398", "score": "0.69035596", "text": "handlePlay(...args) {\n const { actions, onPlay } = this.props;\n actions.handlePlay(this.getProperties());\n\n if (onPlay) {\n onPlay(...args);\n }\n }", "title": "" }, { "docid": "4feca6c5ae0fc4fb5c55128e51da1223", "score": "0.6900019", "text": "attemptAutoPlay() {\n this.canAutoPlay((result, error) => { // eslint-disable-line no-unused-vars\n result && this.play()\n })\n }", "title": "" }, { "docid": "8015460395fd67f0a59ad0240f9bb3d5", "score": "0.68991965", "text": "play () {\n console.log(\"the \" + this.family + \" \" + this.verb + \" at \" + this.volume);\n }", "title": "" }, { "docid": "8dc1a4a5d80921002d5cae7f79ca2f57", "score": "0.6884349", "text": "function justplay(){\r\n \tif(Playing_song==false){\r\n \t\tplaysong();\r\n \t}else{\r\n \t\tpausesong();\r\n \t}\r\n }", "title": "" }, { "docid": "4d0f8104f0c62697288aed4e0e00fa4b", "score": "0.6883834", "text": "function justplay(){\r\n \tif(Playing_song==false){\r\n \t\tplaysong();\r\n\r\n \t}else{\r\n \t\tpausesong();\r\n \t}\r\n }", "title": "" }, { "docid": "cc19b99d6999492ef221ee43d7fd6461", "score": "0.687408", "text": "function playPause() {\n playing ? pause() : play();\n}", "title": "" }, { "docid": "8f1ecd8c391bff2fa9b1569c8ba32f88", "score": "0.6865094", "text": "function onClickPlay () {\n\t//\tgame.state.start('play');\n\t}", "title": "" }, { "docid": "40e22ad018e023fea54835152fa5227c", "score": "0.6863652", "text": "function play (board, guide) {\n\n}", "title": "" }, { "docid": "6e662c15cf754bf9e660ed582548941f", "score": "0.6859565", "text": "play() {\n\t\tthis.render();\n\t\tthis._isPlaying = true;\n\t\tthis.startRendering();\n\t}", "title": "" }, { "docid": "f381ea1b0acb174006156c47bf4b1ba9", "score": "0.685725", "text": "function videoPlay()\n{\n executeCommand(Command.Play);\n}", "title": "" }, { "docid": "3ed6445eb954dbe6be9631bc0f7daed9", "score": "0.6845539", "text": "function playStop(){\r\n if(!playing) {\r\n console.log(\"(playrec.js)(playStop) not playing\"+playing);\r\n return false;\r\n }\r\n else\r\n playing = false;\r\n}", "title": "" }, { "docid": "892cf2c37955b160d7352a15c7e1a972", "score": "0.68440115", "text": "play(){\r\n console.log(`playing '${this.title}' from object literal`);\r\n }", "title": "" }, { "docid": "48b8a6b649f1215819299590b35c9f0d", "score": "0.684185", "text": "function play() {\n\t\tif(canPlay == true){\n\t\t\tplay = setInterval(showNext, duration);\n\t\t\tcanPlay = false;\n\t\t\t$(\"#pauseOrPlay\").removeClass(\"fa-play\");\n\t\t\t$(\"#pauseOrPlay\").addClass(\"fa-pause\");\n\t\t}else{\n\t\t\tclearInterval(play);\n\t\t\tcanPlay = true;\n\t\t\twatchHover = false;\n\t\t\t$(\"#pauseOrPlay\").removeClass(\"fa-pause\");\n\t\t\t$(\"#pauseOrPlay\").addClass(\"fa-play\");\n\t\t}\n\t}", "title": "" }, { "docid": "859756ab974d38ea1f0e2099ae61eedc", "score": "0.6837604", "text": "play() {\n this.paused = false;\n this.playing = true;\n }", "title": "" }, { "docid": "7a4edd02ca1247cae42614edab5d5da5", "score": "0.6826121", "text": "function playSong()\r\n{\r\n bgsong.play();\r\n}", "title": "" }, { "docid": "c0667c9d853845a8bd0db135d49fd063", "score": "0.6825054", "text": "function playAutomatic(){\r\n if(pista.ended){\r\n icono.className=\"fa fa-play-circle\";\r\n icono2.className=\"fa fa-play\";\r\n if(stateRep) setAudio(currentAudio);\r\n else next();\r\n }\r\n}", "title": "" }, { "docid": "09ea31a533740e32d44989a8360d5b8a", "score": "0.68211126", "text": "function justplay()\r\n{\r\n if(playing_song==false)\r\n {\r\n playsong();\r\n}else {\r\n pausesong();}\r\n}", "title": "" }, { "docid": "128c777471d711edbf93eb2cbc056270", "score": "0.68206924", "text": "function playAudio() {\n song.play();\n}", "title": "" }, { "docid": "bb681208eeb54a928a56f0bca6179c21", "score": "0.6808291", "text": "function playMusic() {\n fightMusic.play();\n}", "title": "" }, { "docid": "8d1dfc6a600126397584fa3982f9114e", "score": "0.68042433", "text": "function prehraj() {\n audioElement.play();\n}", "title": "" }, { "docid": "47026a9e738a56cca99bd6b06760104e", "score": "0.6801795", "text": "play(audio) {\n audio.play()\n }", "title": "" }, { "docid": "6730d1430fff7943e8d8901605c2a675", "score": "0.6793226", "text": "function onClickPlay() {\n requestForPlayReturnBool();\n displayAll();\n}", "title": "" }, { "docid": "59283ce6152ec0210a47986aaabdaa58", "score": "0.6791375", "text": "play(){\r\n console.log(`playing '${this.title}' from extending objects.`);\r\n }", "title": "" }, { "docid": "016948d2988b8ab4cf2fbc092a149c4f", "score": "0.6788769", "text": "function playBtn(){\n\t\taud.play();\n\t}", "title": "" }, { "docid": "89d9f9a430a91abf446eab3379058915", "score": "0.67882955", "text": "function playBadHitMusic(){\n\t\t// console.log(\"playing badHit music\");\n\t}", "title": "" }, { "docid": "44c6bf4844f88935d8ced61e33455e54", "score": "0.6787511", "text": "handlePlay() {\n RAG.speech.stop();\n this.btnPlay.disabled = true;\n // Has to execute on a delay, otherwise native speech cancel becomes unreliable\n window.setTimeout(this.handlePlay2.bind(this), 200);\n }", "title": "" }, { "docid": "ae3770b16e9610c8b9bb43f222d438c3", "score": "0.6782856", "text": "function startPlay() {\n\t\tif(running || list.length < 1) return;\n\t\trunning = true;\n\t\t\n\t\tgenerateResult();\n\t\t\n\t\tfor(var i = 0; i < reels.length; i++) {\n\t\t\tvar r = reels[i];\n\t\t\tvar extra = Math.floor(Math.random() * 3);\n\t\t\tvar target = r.position + 10 + i * 5 + extra;\n\t\t\tvar time = 2500 + i * 600 + extra * 600;\n\t\t\n\t\t\t// Update reel target\n\t\t\tr.target = target;\n\t\t\ttweenTo(r, 'position', time, backout(0.5), i === reels.length-1 ? reelsComplete : null)\n\t\t}\n\t}", "title": "" }, { "docid": "1c60d716fc230670957cce0929c328a6", "score": "0.6779927", "text": "function cluck() {\n\tdocument.getElementById('cluck').play();\n}", "title": "" }, { "docid": "f5cb85e8b68631a45b5f7c6f092ab71c", "score": "0.6773671", "text": "playFromQueue(item) {\n\n\t}", "title": "" }, { "docid": "63ec84b15c0efc5f48bcf662af669d1c", "score": "0.67701143", "text": "function playAudio() { \n \taudio.play(); \n \t}", "title": "" }, { "docid": "988039250473f1977fa82ba4d00b493e", "score": "0.6768395", "text": "play() {\n this._postToIframe({\n command: 'blitzr_play'\n });\n }", "title": "" }, { "docid": "9a3d43fd595e75307362c8eeb713a999", "score": "0.67655087", "text": "function _onPlay() {\n reportingPaused = false;\n }", "title": "" }, { "docid": "fa8c9e69d784125b836121252acfbf7b", "score": "0.67603004", "text": "function Play() {\n video.play();\n}", "title": "" }, { "docid": "f10ff2072ed977db1c9cc2c63dfea5d4", "score": "0.6754031", "text": "function playMusic(){\n\t\t\tgetRandomSong();\n\t\t\tmyAudio.play();\n\t\t}", "title": "" }, { "docid": "b428bd0e131aca83ba1bc2750673a0a4", "score": "0.67490494", "text": "function justplay() {\r\n if (playing_song == false) {\r\n playsong();\r\n } else {\r\n pausesong();\r\n }\r\n}", "title": "" }, { "docid": "457c5c91e7796e0470e0008a3e7a1b19", "score": "0.6729802", "text": "play() {\n changeImg(playImg);\n // happy, tired, hungry, bored, angry, lonely\n this.updateMood(\n randomNum(25), // happy\n randomNum(25), // tired\n randomNum(25), // hungry\n -randomNum(25), // bored\n -randomNum(25), // angry\n -randomNum(25), // lonely\n );\n }", "title": "" }, { "docid": "f2c261067c0f57e2bb8394fec29f40cf", "score": "0.67268556", "text": "resumePlay() {\n const howler = this.getHowler()\n howler.play()\n\n this.props.dispatch({ type: 'RESUME_PLAYING' })\n\n this.capture(CAPTURE_TYPES.PLAY, {\n pos: this.getSeek()\n })\n }", "title": "" }, { "docid": "21b47431f27738dbb3ce3784fbe2d783", "score": "0.6722772", "text": "function just_play() {\r\n if(playing_song == false){\r\n playSong()\r\n } else {\r\n pauseSong();\r\n }\r\n}", "title": "" }, { "docid": "06d495e9bcc9e7b15ead0a6cb6f7bee7", "score": "0.67227024", "text": "playIntroMusic() { this.introMusic.play(); }", "title": "" }, { "docid": "d28b2544dcd5871391bb7819cd67e214", "score": "0.6716451", "text": "handleClick() {\n\t\tthis.resumePlay();\n\t}", "title": "" }, { "docid": "f0538d85441396b3bc599634773a40a0", "score": "0.6708147", "text": "play() {\n this.snake.moveHead(this.action);\n }", "title": "" }, { "docid": "b327aa976c6e6040c15b02c5051f954d", "score": "0.669889", "text": "playOnce() {\r\n\t\tthis.howl.play();\r\n\t\tthis.howl.on('end', () => {\r\n\t\t\tthis.playedOnce = true;\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "0bf517ba62f312a5f5e7924a52213317", "score": "0.669878", "text": "play() {\n this._playState = 'play';\n this._lastAnimationFrame = performance.now();\n this._play(this._lastAnimationFrame);\n }", "title": "" }, { "docid": "d08062caf14bc19100a66f357311e541", "score": "0.6694999", "text": "function play() {\n if (!playing) {\n start_time = context.currentTime;\n scheduleSounds(0);\n playing = true;\n requeued = false;\n tick(0);\n document.querySelector('#play-button').classList.add('hidden');\n document.querySelector('#pause-button').classList.remove('hidden');\n }\n}", "title": "" }, { "docid": "9225d7270f291a137291e7dd892ef149", "score": "0.66893536", "text": "play(id, del, dep, dep_args, volume) {\n if (id === 'blank') {\n play_blank();\n return;\n }\n //if(device.o_s === 'iOS' && !media.sound.iOS_unlocked){\n // return;\n //}\n var sound = id.key ? id : media.get(\"sounds\", id);\n if (del) {\n TweenMax.delayedCall(del, delay_play, [\n sound,\n dep,\n dep_args,\n volume\n ]);\n } else {\n delay_play(sound, dep, dep_args, volume);\n }\n }", "title": "" }, { "docid": "711d00a17d217cced241eed8fd096f22", "score": "0.66875905", "text": "playJump() {\n if (!this.saltando && this.sonidoAct) {\n this.saltar.play();\n this.flotar.play();\n this.saltando = true;\n }\n }", "title": "" }, { "docid": "285f70c44e865800ab1c1d4f262b1bb3", "score": "0.66870606", "text": "function gamePlay() {\n\n\n}", "title": "" }, { "docid": "3398686e4eb01654467f626c56e7cc56", "score": "0.6683462", "text": "onPlayToggle() {\n const isPlaying = this.props.player.is_playing\n if (isPlaying) {\n this.stopPlay()\n } else {\n this.resumePlay()\n }\n }", "title": "" }, { "docid": "092ae9f49b5b0871289bc251b4a30f71", "score": "0.66787905", "text": "function play() {\n\t//input assigned to user guess field, tuning it into a value\n\tuserGuess = input.val(); \n\n\t//reset input field\n\tinput.val('');\n\n\t//put cursor back in input section\n\tinput.focus();\n\n\t//respond to guess\n\t\t//only put the guess through if qualify() is true\n\t\tif(qualify()){return ;}\n\n\t//adjust feedback\n\tgiveFeedback();\n\n\t//store the guess in list below\n\ttrackGuess();\n\n\t//increase count upon submission\n\taddCount();\n\n\t//render changes? I still kind of don't get why this is a seperate function...\n\trender();\n\t}", "title": "" }, { "docid": "c6a52415e61fec92c03acca2faab2acc", "score": "0.66786814", "text": "function play() {\n\t\tstopPlayback();\n\t\tinterval_id = window.setInterval(nextFrame, PLAY_SPEED);\n\t}", "title": "" }, { "docid": "72e86a10c9100387f59a7eae53891126", "score": "0.6674133", "text": "startPlaying () {\n if (this.endTime === 0 && this.config.sayStart === true) {\n this.saySomething(this.startText)\n window.setTimeout(this.startPlayingInner, this.preSpeakStart, this)\n } else {\n this.startPlayingInner(this)\n }\n }", "title": "" } ]
31cbbeb1966babba1b4c0656c17a60fd
const Picker = require('pickerdialog')
[ { "docid": "f0a4e436ebfae5d9d031f0b75fdeac9e", "score": "0.0", "text": "function select(locals) {\n let {enabled, error, hasError, help, hidden, itemStyle, label,\n onChange, options, prompt, stylesheet, value} = locals\n if (hidden) {\n return null;\n }\n const styles = StyleSheet.create({\n error: {\n color: \"rgb(220, 19, 38)\",\n fontSize: 12,\n paddingVertical: 7\n },\n });\n const {controlLabel, errorBlock, formGroup, helpBlock, pickerContainer,\n select} = stylesheet;\n\n var formGroupStyle = formGroup.normal;\n var controlLabelStyle = controlLabel.normal;\n var selectStyle = Object.assign(\n {},\n select.normal,\n pickerContainer.normal\n );\n var helpBlockStyle = helpBlock.normal;\n var errorBlockStyle = errorBlock;\n\n if (hasError) {\n formGroupStyle = formGroup.error;\n controlLabelStyle = controlLabel.error;\n selectStyle = select.error;\n helpBlockStyle = helpBlock.error;\n }\n\n const formattedLabel = label ? (\n <Text style={controlLabelStyle}>{label}</Text>\n ) : null;\n const formattedHelp = help ? (\n <Text style={helpBlockStyle}>{help}</Text>\n ) : null;\n const formattedError =\n hasError ? (\n <Text accessibilityLiveRegion=\"polite\" style={[errorBlockStyle, styles.error]}>\n Required field\n </Text>\n ) : null;\n\n const data = options.map(({value, text: label}) => ({label, value}))\n\n if(prompt)\n {\n const data0 = data[0]\n\n if(data0.value === '' && data0.label === '-') data0.label = prompt\n }\n\n const cleanData = data.filter(obj => !Object.keys(obj).some((key) => obj[key] == null))\n\n if (locals.path.length > 0) {\n let changedValue\n const path = locals.path[0]\n let field = locals.config.fields[path]\n\n if (locals.path.length > 1) {\n const iterator = locals.path[1]\n const subPath = locals.path[2]\n const fieldID = `${subPath}ID`\n \n field = field.item.fields[subPath]\n\n if (field.isObject) {\n changedValue = field.form && field.form.props.value[path][iterator][subPath] && field.form.props.value[path][iterator][subPath][fieldID]\n if (value !== changedValue && (changedValue != undefined)) onChange(changedValue)\n }\n }\n }\n\n return (\n <View style={formGroupStyle}>\n {formattedLabel}\n <SearchablePicker\n isSearchable\n options={cleanData.map(opt => ({ label: String(opt.label), value: opt.value }))}\n value={value ? cleanData.find(item => item.value == value) : null}\n onChange={val => onChange(val.value)}\n placeholder=\"Select or start typing...\"\n />\n {formattedHelp}\n {formattedError}\n </View>\n );\n}", "title": "" } ]
[ { "docid": "3773bff1ffc9b62d0bb34dc5edf0ef19", "score": "0.7060721", "text": "function showPicker() {\n showDialog('a.my-project.picker.view', 600, 425,\n 'Upload or select grade book files');\n}", "title": "" }, { "docid": "60be3b98830f3cbd9f4293762527753b", "score": "0.69886893", "text": "static get tag(){return\"simple-picker\"}", "title": "" }, { "docid": "c081a9c7d1b7b9a65f4c1ec90096fe46", "score": "0.68139654", "text": "static get tag() {\n return \"simple-picker\";\n }", "title": "" }, { "docid": "ef882c7004905a6b70ab1c3c8e3c2773", "score": "0.6642012", "text": "function loadPicker() {\n gapi.load('picker', {'callback': onPickerApiLoad});\n }", "title": "" }, { "docid": "b3cafdee3b7914d3cdb58014d72fb41f", "score": "0.6440871", "text": "function PickerConstructor(ELEMENT,NAME,COMPONENT,OPTIONS){// If there’s no element, return the picker constructor.\nif(!ELEMENT)return PickerConstructor;var IS_DEFAULT_THEME=false,// The state of the picker.\nSTATE={id:ELEMENT.id||'P'+Math.abs(~~(Math.random()*new Date()))},// Merge the defaults and options passed.\nSETTINGS=COMPONENT?$.extend(true,{},COMPONENT.defaults,OPTIONS):OPTIONS||{},// Merge the default classes with the settings classes.\nCLASSES=$.extend({},PickerConstructor.klasses(),SETTINGS.klass),// The element node wrapper into a jQuery object.\n$ELEMENT=$(ELEMENT),// Pseudo picker constructor.\nPickerInstance=function PickerInstance(){return this.start();},// The picker prototype.\nP=PickerInstance.prototype={constructor:PickerInstance,$node:$ELEMENT,/**\n * Initialize everything\n */start:function start(){// If it’s already started, do nothing.\nif(STATE&&STATE.start)return P;// Update the picker states.\nSTATE.methods={};STATE.start=true;STATE.open=false;STATE.type=ELEMENT.type;// Confirm focus state, convert into text input to remove UA stylings,\n// and set as readonly to prevent keyboard popup.\nELEMENT.autofocus=ELEMENT==getActiveElement();ELEMENT.readOnly=!SETTINGS.editable;ELEMENT.id=ELEMENT.id||STATE.id;if(ELEMENT.type!='text'){ELEMENT.type='text';}// Create a new picker component with the settings.\nP.component=new COMPONENT(P,SETTINGS);// Create the picker root and then prepare it.\nP.$root=$('<div class=\"'+CLASSES.picker+'\" id=\"'+ELEMENT.id+'_root\" />');prepareElementRoot();// Create the picker holder and then prepare it.\nP.$holder=$(createWrappedComponent()).appendTo(P.$root);prepareElementHolder();// If there’s a format for the hidden input element, create the element.\nif(SETTINGS.formatSubmit){prepareElementHidden();}// Prepare the input element.\nprepareElement();// Insert the hidden input as specified in the settings.\nif(SETTINGS.containerHidden)$(SETTINGS.containerHidden).append(P._hidden);else $ELEMENT.after(P._hidden);// Insert the root as specified in the settings.\nif(SETTINGS.container)$(SETTINGS.container).append(P.$root);else $ELEMENT.after(P.$root);// Bind the default component and settings events.\nP.on({start:P.component.onStart,render:P.component.onRender,stop:P.component.onStop,open:P.component.onOpen,close:P.component.onClose,set:P.component.onSet}).on({start:SETTINGS.onStart,render:SETTINGS.onRender,stop:SETTINGS.onStop,open:SETTINGS.onOpen,close:SETTINGS.onClose,set:SETTINGS.onSet});// Once we’re all set, check the theme in use.\nIS_DEFAULT_THEME=isUsingDefaultTheme(P.$holder[0]);// If the element has autofocus, open the picker.\nif(ELEMENT.autofocus){P.open();}// Trigger queued the “start” and “render” events.\nreturn P.trigger('start').trigger('render');},//start\n/**\n * Render a new picker\n */render:function render(entireComponent){// Insert a new component holder in the root or box.\nif(entireComponent){P.$holder=$(createWrappedComponent());prepareElementHolder();P.$root.html(P.$holder);}else P.$root.find('.'+CLASSES.box).html(P.component.nodes(STATE.open));// Trigger the queued “render” events.\nreturn P.trigger('render');},//render\n/**\n * Destroy everything\n */stop:function stop(){// If it’s already stopped, do nothing.\nif(!STATE.start)return P;// Then close the picker.\nP.close();// Remove the hidden field.\nif(P._hidden){P._hidden.parentNode.removeChild(P._hidden);}// Remove the root.\nP.$root.remove();// 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);setTimeout(function(){$ELEMENT.off('.'+STATE.id);},0);// Restore the element state\nELEMENT.type=STATE.type;ELEMENT.readOnly=false;// Trigger the queued “stop” events.\nP.trigger('stop');// Reset the picker states.\nSTATE.methods={};STATE.start=false;return P;},//stop\n/**\n * Open up the picker\n */open:function open(dontGiveFocus){// If it’s already open, do nothing.\nif(STATE.open)return P;// Add the “active” class.\n$ELEMENT.addClass(CLASSES.active);aria(ELEMENT,'expanded',true);// * 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\nsetTimeout(function(){// Add the “opened” class to the picker root.\nP.$root.addClass(CLASSES.opened);aria(P.$root[0],'hidden',false);},0);// If we have to give focus, bind the element and doc events.\nif(dontGiveFocus!==false){// Set it as open.\nSTATE.open=true;// Prevent the page from scrolling.\nif(IS_DEFAULT_THEME){$html.css('overflow','hidden').css('padding-right','+='+getScrollbarWidth());}// Pass focus to the root element’s jQuery object.\nfocusPickerOnceOpened();// Bind the document events.\n$document.on('click.'+STATE.id+' focusin.'+STATE.id,function(event){var target=event.target;// 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.\nif(target!=ELEMENT&&target!=document&&event.which!=3){// If the target was the holder that covers the screen,\n// keep the element focused to maintain tabindex.\nP.close(target===P.$holder[0]);}}).on('keydown.'+STATE.id,function(event){var// Get the keycode.\nkeycode=event.keyCode,// Translate that to a selection change.\nkeycodeToMove=P.component.key[keycode],// Grab the target.\ntarget=event.target;// On escape, close the picker and give focus.\nif(keycode==27){P.close(true);}// Check if there is a key movement or “enter” keypress on the element.\nelse if(target==P.$holder[0]&&(keycodeToMove||keycode==13)){// Prevent the default action to stop page movement.\nevent.preventDefault();// Trigger the key movement action.\nif(keycodeToMove){PickerConstructor._.trigger(P.component.key.go,P,[PickerConstructor._.trigger(keycodeToMove)]);}// On “enter”, if the highlighted item isn’t disabled, set the value and close.\nelse if(!P.$root.find('.'+CLASSES.highlighted).hasClass(CLASSES.disabled)){P.set('select',P.component.item.highlight);if(SETTINGS.closeOnSelect){P.close(true);}}}// If the target is within the root and “enter” is pressed,\n// prevent the default action and trigger a click on the target instead.\nelse if($.contains(P.$root[0],target)&&keycode==13){event.preventDefault();target.click();}});}// Trigger the queued “open” events.\nreturn P.trigger('open');},//open\n/**\n * Close the picker\n */close:function close(giveFocus){// If we need to give focus, do it before changing states.\nif(giveFocus){if(SETTINGS.editable){ELEMENT.focus();}else{// ....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.\nP.$holder.off('focus.toOpen').focus();setTimeout(function(){P.$holder.on('focus.toOpen',handleFocusToOpenEvent);},0);}}// Remove the “active” class.\n$ELEMENT.removeClass(CLASSES.active);aria(ELEMENT,'expanded',false);// * 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\nsetTimeout(function(){// Remove the “opened” and “focused” class from the picker root.\nP.$root.removeClass(CLASSES.opened+' '+CLASSES.focused);aria(P.$root[0],'hidden',true);},0);// If it’s already closed, do nothing more.\nif(!STATE.open)return P;// Set it as closed.\nSTATE.open=false;// Allow the page to scroll.\nif(IS_DEFAULT_THEME){$html.css('overflow','').css('padding-right','-='+getScrollbarWidth());}// Unbind the document events.\n$document.off('.'+STATE.id);// Trigger the queued “close” events.\nreturn P.trigger('close');},//close\n/**\n * Clear the values\n */clear:function clear(options){return P.set('clear',null,options);},//clear\n/**\n * Set something\n */set:function set(thing,value,options){var thingItem,thingValue,thingIsObject=$.isPlainObject(thing),thingObject=thingIsObject?thing:{};// Make sure we have usable options.\noptions=thingIsObject&&$.isPlainObject(value)?value:options||{};if(thing){// If the thing isn’t an object, make it one.\nif(!thingIsObject){thingObject[thing]=value;}// Go through the things of items to set.\nfor(thingItem in thingObject){// Grab the value of the thing.\nthingValue=thingObject[thingItem];// First, if the item exists and there’s a value, set it.\nif(thingItem in P.component.item){if(thingValue===undefined)thingValue=null;P.component.set(thingItem,thingValue,options);}// Then, check to update the element value and broadcast a change.\nif(thingItem=='select'||thingItem=='clear'){$ELEMENT.val(thingItem=='clear'?'':P.get(thingItem,SETTINGS.format)).trigger('change');}}// Render a new picker.\nP.render();}// When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.\nreturn options.muted?P:P.trigger('set',thingObject);},//set\n/**\n * Get something\n */get:function get(thing,format){// Make sure there’s something to get.\nthing=thing||'value';// If a picker state exists, return that.\nif(STATE[thing]!=null){return STATE[thing];}// Return the submission value, if that.\nif(thing=='valueSubmit'){if(P._hidden){return P._hidden.value;}thing='value';}// Return the value, if that.\nif(thing=='value'){return ELEMENT.value;}// Check if a component item exists, return that.\nif(thing in P.component.item){if(typeof format=='string'){var thingValue=P.component.get(thing);return thingValue?PickerConstructor._.trigger(P.component.formats.toString,P.component,[format,thingValue]):'';}return P.component.get(thing);}},//get\n/**\n * Bind events on the things.\n */on:function on(thing,method,internal){var thingName,thingMethod,thingIsObject=$.isPlainObject(thing),thingObject=thingIsObject?thing:{};if(thing){// If the thing isn’t an object, make it one.\nif(!thingIsObject){thingObject[thing]=method;}// Go through the things to bind to.\nfor(thingName in thingObject){// Grab the method of the thing.\nthingMethod=thingObject[thingName];// If it was an internal binding, prefix it.\nif(internal){thingName='_'+thingName;}// Make sure the thing methods collection exists.\nSTATE.methods[thingName]=STATE.methods[thingName]||[];// Add the method to the relative method collection.\nSTATE.methods[thingName].push(thingMethod);}}return P;},//on\n/**\n * Unbind events on the things.\n */off:function off(){var i,thingName,names=arguments;for(i=0,namesCount=names.length;i<namesCount;i+=1){thingName=names[i];if(thingName in STATE.methods){delete STATE.methods[thingName];}}return P;},/**\n * Fire off method events.\n */trigger:function trigger(name,data){var _trigger=function _trigger(name){var methodList=STATE.methods[name];if(methodList){methodList.map(function(method){PickerConstructor._.trigger(method,P,[data]);});}};_trigger('_'+name);_trigger(name);return P;}//trigger\n//PickerInstance.prototype\n/**\n * Wrap the picker holder components together.\n */};function createWrappedComponent(){// Create a picker wrapper holder\nreturn PickerConstructor._.node('div',// Create a picker wrapper node\nPickerConstructor._.node('div',// Create a picker frame\nPickerConstructor._.node('div',// Create a picker box node\nPickerConstructor._.node('div',// Create the components nodes.\nP.component.nodes(STATE.open),// The picker box class\nCLASSES.box),// Picker wrap class\nCLASSES.wrap),// Picker frame class\nCLASSES.frame),// Picker holder class\nCLASSES.holder,'tabindex=\"-1\"');//endreturn\n}//createWrappedComponent\n/**\n * Prepare the input element with all bindings.\n */function prepareElement(){$ELEMENT.// Store the picker data by component name.\ndata(NAME,P).// Add the “input” class name.\naddClass(CLASSES.input).// If there’s a `data-value`, update the value of the element.\nval($ELEMENT.data('value')?P.get('select',SETTINGS.format):ELEMENT.value);// Only bind keydown events if the element isn’t editable.\nif(!SETTINGS.editable){$ELEMENT.// On focus/click, open the picker.\non('focus.'+STATE.id+' click.'+STATE.id,function(event){event.preventDefault();P.open();}).// Handle keyboard event based on the picker being opened or not.\non('keydown.'+STATE.id,handleKeydownEvent);}// Update the aria attributes.\naria(ELEMENT,{haspopup:true,expanded:false,readonly:false,owns:ELEMENT.id+'_root'});}/**\n * Prepare the root picker element with all bindings.\n */function prepareElementRoot(){aria(P.$root[0],'hidden',true);}/**\n * Prepare the holder picker element with all bindings.\n */function prepareElementHolder(){P.$holder.on({// For iOS8.\nkeydown:handleKeydownEvent,'focus.toOpen':handleFocusToOpenEvent,blur:function blur(){// Remove the “target” class.\n$ELEMENT.removeClass(CLASSES.target);},// When something within the holder is focused, stop from bubbling\n// to the doc and remove the “focused” state from the root.\nfocusin:function focusin(event){P.$root.removeClass(CLASSES.focused);event.stopPropagation();},// When something within the holder is clicked, stop it\n// from bubbling to the doc.\n'mousedown click':function mousedownClick(event){var target=event.target;// Make sure the target isn’t the root holder so it can bubble up.\nif(target!=P.$holder[0]){event.stopPropagation();// * 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.\nif(event.type=='mousedown'&&!$(target).is('input, select, textarea, button, option')){event.preventDefault();// Re-focus onto the holder so that users can click away\n// from elements focused within the picker.\nP.$holder[0].focus();}}}}).// If there’s a click on an actionable element, carry out the actions.\non('click','[data-pick], [data-nav], [data-clear], [data-close]',function(){var $target=$(this),targetData=$target.data(),targetDisabled=$target.hasClass(CLASSES.navDisabled)||$target.hasClass(CLASSES.disabled),// * For IE, non-focusable elements can be active elements as well\n// (http://stackoverflow.com/a/2684561).\nactiveElement=getActiveElement();activeElement=activeElement&&(activeElement.type||activeElement.href);// If it’s disabled or nothing inside is actively focused, re-focus the element.\nif(targetDisabled||activeElement&&!$.contains(P.$root[0],activeElement)){P.$holder[0].focus();}// If something is superficially changed, update the `highlight` based on the `nav`.\nif(!targetDisabled&&targetData.nav){P.set('highlight',P.component.item.highlight,{nav:targetData.nav});}// If something is picked, set `select` then close with focus.\nelse if(!targetDisabled&&'pick'in targetData){P.set('select',targetData.pick);if(SETTINGS.closeOnSelect){P.close(true);}}// If a “clear” button is pressed, empty the values and close with focus.\nelse if(targetData.clear){P.clear();if(SETTINGS.closeOnClear){P.close(true);}}else if(targetData.close){P.close(true);}});//P.$holder\n}/**\n * Prepare the hidden input element along with all bindings.\n */function prepareElementHidden(){var name;if(SETTINGS.hiddenName===true){name=ELEMENT.name;ELEMENT.name='';}else{name=[typeof SETTINGS.hiddenPrefix=='string'?SETTINGS.hiddenPrefix:'',typeof SETTINGS.hiddenSuffix=='string'?SETTINGS.hiddenSuffix:'_submit'];name=name[0]+ELEMENT.name+name[1];}P._hidden=$('<input '+'type=hidden '+// Create the name using the original input’s with a prefix and suffix.\n'name=\"'+name+'\"'+(// 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];$ELEMENT.// If the value changes, update the hidden input with the correct format.\non('change.'+STATE.id,function(){P._hidden.value=ELEMENT.value?P.get('select',SETTINGS.formatSubmit):'';});}// Wait for transitions to end before focusing the holder. Otherwise, while\n// using the `container` option, the view jumps to the container.\nfunction focusPickerOnceOpened(){if(IS_DEFAULT_THEME&&supportsTransitions){P.$holder.find('.'+CLASSES.frame).one('transitionend',function(){P.$holder[0].focus();});}else{P.$holder[0].focus();}}function handleFocusToOpenEvent(event){// Stop the event from propagating to the doc.\nevent.stopPropagation();// Add the “target” class.\n$ELEMENT.addClass(CLASSES.target);// Add the “focused” class to the root.\nP.$root.addClass(CLASSES.focused);// And then finally open the picker.\nP.open();}// For iOS8.\nfunction handleKeydownEvent(event){var keycode=event.keyCode,// Check if one of the delete keys was pressed.\nisKeycodeDelete=/^(8|46)$/.test(keycode);// For some reason IE clears the input value on “escape”.\nif(keycode==27){P.close(true);return false;}// Check if `space` or `delete` was pressed or the picker is closed with a key movement.\nif(keycode==32||isKeycodeDelete||!STATE.open&&P.component.key[keycode]){// Prevent it from moving the page and bubbling to doc.\nevent.preventDefault();event.stopPropagation();// If `delete` was pressed, clear the values and close the picker.\n// Otherwise open the picker.\nif(isKeycodeDelete){P.clear().close();}else{P.open();}}}// Return a new picker instance.\nreturn new PickerInstance();}//PickerConstructor", "title": "" }, { "docid": "f88d6368aabdd93aa01cc4bcba3fe9a3", "score": "0.6419794", "text": "createPicker() {\n\t\t//renewAccessToken().then(function(accessToken) {\n\t\t\t////console.log(['create picker',pickerApiLoaded,accessToken]);\n\t\t\t//if (pickerApiLoaded) {\n\t\t\t\t////console.log('really create picker');\n\t\t\t\t//var view = new google.picker.View(google.picker.ViewId.DOCS);\n\t\t\t\t//view.setMimeTypes(\"audio/mp3,audio/mpeg\");\n\t\t\t\t//var picker = new google.picker.PickerBuilder()\n\t\t\t\t//.enableFeature(google.picker.Feature.NAV_HIDDEN)\n\t\t\t\t//.enableFeature(google.picker.Feature.MULTISELECT_ENABLED)\n\t\t\t\t////.setAppId(appId)\n\t\t\t\t//.setOAuthToken(accessToken)\n\t\t\t\t//.addView(view)\n\t\t\t\t//.addView(new google.picker.DocsUploadView())\n\t\t\t\t//.setDeveloperKey(apiKey)\n\t\t\t\t//.setCallback(pickerCallback)\n\t\t\t\t//.build();\n\t\t\t\t//picker.setVisible(true);\n\t\t\t //} \n\t\t\t//});\n\t\t}", "title": "" }, { "docid": "9562c4e6533d2b8920ec7865396c96f6", "score": "0.6353326", "text": "function createPicker() {\n if (pickerApiLoaded && oauthToken) {\n var picker = new google.picker.PickerBuilder().\n addView(google.picker.ViewId.PHOTOS).\n addView(google.picker.ViewId.PHOTO_UPLOAD).\n //addView(google.picker.ViewId.DOCS_IMAGES_AND_VIDEOS).\n //addView(new google.picker.DocsUploadView()).\n setOAuthToken(oauthToken).\n setDeveloperKey(developerKey).\n setCallback(pickerCallback).\n build();\n picker.setVisible(true);\n }\n }", "title": "" }, { "docid": "97eb4b50687afe14580bbd27b444f649", "score": "0.63393617", "text": "function loadPicker() {\n\tconsole.log(\"loadPicker\");\n\tgapi.load('auth', {'callback': onAuthApiLoad});\n\tgapi.load('picker', {'callback': onPickerApiLoad});\n}", "title": "" }, { "docid": "93f2dc0ce73af9bdc2586dbd2500405b", "score": "0.6328258", "text": "function loadPicker() {\n gapi.load('auth', {'callback': onAuthApiLoad});\n gapi.load('picker', {'callback': onPickerApiLoad});\n}", "title": "" }, { "docid": "0d73bed13f417f88c3b246c5d87c40a8", "score": "0.62628543", "text": "function handlePickerLoad() {\n\tgapi.load('picker', {'callback': arc.app.drive.picker.loadHandler});\n}", "title": "" }, { "docid": "03da748de378c6e94a0ecd206c88a23a", "score": "0.62524396", "text": "function loadPicker() {\n gapi.load('auth', { 'callback': onAuthApiLoad });\n gapi.load('picker', { 'callback': onPickerApiLoad });\n}", "title": "" }, { "docid": "0314fd10b942932116e6595470ecf536", "score": "0.6197702", "text": "function createPicker() {\n if (pickerApiLoaded && oauthToken) {\n\n //generates a 'select a file' button\n let pickfileBtn = document.getElementById('pickfile');\n pickfileBtn.addEventListener('click', function() {\n createPicker()\n });\n pickfileBtn.disabled = false;\n pickfileBtn.hidden = false;\n\n //allows for folders to be selected\n let docsView = new google.picker.DocsView()\n .setIncludeFolders(true)\n .setSelectFolderEnabled(true)\n .setParent('root');\n\n // renders google uploader\n let docsUpload = new google.picker.DocsUploadView()\n\n // renders the Picker Object with all parameters we set\n let picker = new google.picker.PickerBuilder()\n .addView(docsView)\n .addView(docsUpload)\n .setOAuthToken(oauthToken)\n .setDeveloperKey(developerKeyHardCoded)\n .setCallback(pickerCallback)\n .build();\n picker.setVisible(true);\n }\n}", "title": "" }, { "docid": "4a26eb53bb280c2fc811184325b4bd0c", "score": "0.60885936", "text": "function createPicker() {\n if (pickerApiLoaded && oauthToken) {\n let view = new google.picker.View(google.picker.ViewId.PRESENTATIONS);\n let picker = new google.picker.PickerBuilder()\n .enableFeature(google.picker.Feature.NAV_HIDDEN)\n .enableFeature(google.picker.Feature.MULTISELECT_ENABLED)\n .setAppId(appId)\n .setOAuthToken(oauthToken)\n .addView(view)\n .addView(new google.picker.DocsUploadView())\n .setDeveloperKey(developerKey)\n .setCallback(pickerCallback)\n .build();\n picker.setVisible(true);\n }\n}", "title": "" }, { "docid": "8bd6857a76370a4186412894d2c5afd0", "score": "0.60844785", "text": "function showPicker() {\n var html = HtmlService.createHtmlOutputFromFile('dialog.html')\n .setWidth(600)\n .setHeight(425)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME);\n SpreadsheetApp.getUi().showModalDialog(html, 'Select a file');\n}", "title": "" }, { "docid": "2b62b7682cc025072b60e0fa78e2743d", "score": "0.6067277", "text": "function createPicker () {\n if (pickerApiLoaded && oauthToken) {\n const picker = new google.picker.PickerBuilder()\n .addView(pickFolderView())\n .setOAuthToken(oauthToken)\n .setDeveloperKey(G_DEV_KEY)\n .setCallback(callback)\n .build()\n picker.setVisible(true)\n }\n}", "title": "" }, { "docid": "d98f05b90953e9ed36ca3e27b3725f4d", "score": "0.6059216", "text": "static get tag() {\n return \"simple-icon-picker\";\n }", "title": "" }, { "docid": "b96e90575781a11cb701296e97de0c4a", "score": "0.60431755", "text": "static get tag() {\n return \"simple-picker-option\";\n }", "title": "" }, { "docid": "03e7ecb4fc4643ac4ca43143cb0422fb", "score": "0.60294414", "text": "function createPicker() {\n if (pickerApiLoaded && oauthToken) {\n var view = new google.picker.View(google.picker.ViewId.PRESENTATIONS);\n view.setMimeTypes('application/vnd.google-apps.presentation');\n // if picker is not already set, create it\n if (!picker) {\n picker = new google.picker.PickerBuilder()\n .enableFeature(google.picker.Feature.NAV_HIDDEN)\n .setAppId(appId)\n .setOAuthToken(oauthToken)\n .addView(view)\n .setDeveloperKey(developerKey)\n .setCallback(pickerSlideCallback)\n .build();\n // set picker in the store\n store.dispatch({type:'SET_PICKER', picker: picker})\n }\n // set picker to visible\n picker.setVisible(true);\n }\n}", "title": "" }, { "docid": "ed2def2cee5254f93368fc542e8729ae", "score": "0.6026419", "text": "getPickerDisplay(mode, date) {\n /*jshint unused:false */\n throw new Error('getPickerDisplay Not Implemented');\n }", "title": "" }, { "docid": "da9f9bf0e8d459006254b47836bd3272", "score": "0.6021931", "text": "function showPicker() {\n el('file-input').click();\n}", "title": "" }, { "docid": "4450d0e3e419efa949667a04f5a6bc9b", "score": "0.60145825", "text": "function Picker() {\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.defineComponent)({\n name: 'Picker',\n inheritAttrs: false,\n props: ['prefixCls', 'id', 'tabindex', 'dropdownClassName', 'dropdownAlign', 'popupStyle', 'transitionName', 'generateConfig', 'locale', 'inputReadOnly', 'allowClear', 'autofocus', 'showTime', 'showNow', 'showHour', 'showMinute', 'showSecond', 'picker', 'format', 'use12Hours', 'value', 'defaultValue', 'open', 'defaultOpen', 'defaultOpenValue', 'suffixIcon', 'presets', 'clearIcon', 'disabled', 'disabledDate', 'placeholder', 'getPopupContainer', 'panelRender', 'inputRender', 'onChange', 'onOpenChange', 'onFocus', 'onBlur', 'onMousedown', 'onMouseup', 'onMouseenter', 'onMouseleave', 'onContextmenu', 'onClick', 'onKeydown', 'onSelect', 'direction', 'autocomplete', 'showToday', 'renderExtraFooter', 'dateRender', 'minuteStep', 'hourStep', 'secondStep', 'hideDisabledOptions'],\n setup(props, _ref) {\n let {\n attrs,\n expose\n } = _ref;\n const inputRef = (0,vue__WEBPACK_IMPORTED_MODULE_2__.ref)(null);\n const presets = (0,vue__WEBPACK_IMPORTED_MODULE_2__.computed)(() => props.presets);\n const presetList = (0,_hooks_usePresets__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(presets);\n const picker = (0,vue__WEBPACK_IMPORTED_MODULE_2__.computed)(() => {\n var _a;\n return (_a = props.picker) !== null && _a !== void 0 ? _a : 'date';\n });\n const needConfirmButton = (0,vue__WEBPACK_IMPORTED_MODULE_2__.computed)(() => picker.value === 'date' && !!props.showTime || picker.value === 'time');\n // ============================ Warning ============================\n if (true) {\n (0,_utils_warnUtil__WEBPACK_IMPORTED_MODULE_4__.legacyPropsWarning)(props);\n }\n // ============================= State =============================\n const formatList = (0,vue__WEBPACK_IMPORTED_MODULE_2__.computed)(() => (0,_utils_miscUtil__WEBPACK_IMPORTED_MODULE_5__.toArray)((0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_6__.getDefaultFormat)(props.format, picker.value, props.showTime, props.use12Hours)));\n // Panel ref\n const panelDivRef = (0,vue__WEBPACK_IMPORTED_MODULE_2__.ref)(null);\n const inputDivRef = (0,vue__WEBPACK_IMPORTED_MODULE_2__.ref)(null);\n const containerRef = (0,vue__WEBPACK_IMPORTED_MODULE_2__.ref)(null);\n // Real value\n const [mergedValue, setInnerValue] = (0,_util_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(null, {\n value: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'value'),\n defaultValue: props.defaultValue\n });\n const selectedValue = (0,vue__WEBPACK_IMPORTED_MODULE_2__.ref)(mergedValue.value);\n const setSelectedValue = val => {\n selectedValue.value = val;\n };\n // Operation ref\n const operationRef = (0,vue__WEBPACK_IMPORTED_MODULE_2__.ref)(null);\n // Open\n const [mergedOpen, triggerInnerOpen] = (0,_util_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(false, {\n value: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'open'),\n defaultValue: props.defaultOpen,\n postState: postOpen => props.disabled ? false : postOpen,\n onChange: newOpen => {\n if (props.onOpenChange) {\n props.onOpenChange(newOpen);\n }\n if (!newOpen && operationRef.value && operationRef.value.onClose) {\n operationRef.value.onClose();\n }\n }\n });\n // ============================= Text ==============================\n const [valueTexts, firstValueText] = (0,_hooks_useValueTexts__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(selectedValue, {\n formatList,\n generateConfig: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'generateConfig'),\n locale: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'locale')\n });\n const [text, triggerTextChange, resetText] = (0,_hooks_useTextValueMapping__WEBPACK_IMPORTED_MODULE_9__[\"default\"])({\n valueTexts,\n onTextChange: newText => {\n const inputDate = (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_10__.parseValue)(newText, {\n locale: props.locale,\n formatList: formatList.value,\n generateConfig: props.generateConfig\n });\n if (inputDate && (!props.disabledDate || !props.disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n });\n // ============================ Trigger ============================\n const triggerChange = newValue => {\n const {\n onChange,\n generateConfig,\n locale\n } = props;\n setSelectedValue(newValue);\n setInnerValue(newValue);\n if (onChange && !(0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_10__.isEqual)(generateConfig, mergedValue.value, newValue)) {\n onChange(newValue, newValue ? (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_10__.formatValue)(newValue, {\n generateConfig,\n locale,\n format: formatList.value[0]\n }) : '');\n }\n };\n const triggerOpen = newOpen => {\n if (props.disabled && newOpen) {\n return;\n }\n triggerInnerOpen(newOpen);\n };\n const forwardKeydown = e => {\n if (mergedOpen.value && operationRef.value && operationRef.value.onKeydown) {\n // Let popup panel handle keyboard\n return operationRef.value.onKeydown(e);\n }\n /* istanbul ignore next */\n /* eslint-disable no-lone-blocks */\n {\n (0,_vc_util_warning__WEBPACK_IMPORTED_MODULE_11__.warning)(false, 'Picker not correct forward Keydown operation. Please help to fire issue about this.');\n return false;\n }\n };\n const onInternalMouseup = function () {\n if (props.onMouseup) {\n props.onMouseup(...arguments);\n }\n if (inputRef.value) {\n inputRef.value.focus();\n triggerOpen(true);\n }\n };\n // ============================= Input =============================\n const [inputProps, {\n focused,\n typing\n }] = (0,_hooks_usePickerInput__WEBPACK_IMPORTED_MODULE_12__[\"default\"])({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen,\n forwardKeydown,\n isClickOutside: target => !(0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_6__.elementsContains)([panelDivRef.value, inputDivRef.value, containerRef.value], target),\n onSubmit: () => {\n if (\n // When user typing disabledDate with keyboard and enter, this value will be empty\n !selectedValue.value ||\n // Normal disabled check\n props.disabledDate && props.disabledDate(selectedValue.value)) {\n return false;\n }\n triggerChange(selectedValue.value);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: () => {\n triggerOpen(false);\n setSelectedValue(mergedValue.value);\n resetText();\n },\n onKeydown: (e, preventDefault) => {\n var _a;\n (_a = props.onKeydown) === null || _a === void 0 ? void 0 : _a.call(props, e, preventDefault);\n },\n onFocus: e => {\n var _a;\n (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);\n },\n onBlur: e => {\n var _a;\n (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);\n }\n });\n // ============================= Sync ==============================\n // Close should sync back with text value\n (0,vue__WEBPACK_IMPORTED_MODULE_2__.watch)([mergedOpen, valueTexts], () => {\n if (!mergedOpen.value) {\n setSelectedValue(mergedValue.value);\n if (!valueTexts.value.length || valueTexts.value[0] === '') {\n triggerTextChange('');\n } else if (firstValueText.value !== text.value) {\n resetText();\n }\n }\n });\n // Change picker should sync back with text value\n (0,vue__WEBPACK_IMPORTED_MODULE_2__.watch)(picker, () => {\n if (!mergedOpen.value) {\n resetText();\n }\n });\n // Sync innerValue with control mode\n (0,vue__WEBPACK_IMPORTED_MODULE_2__.watch)(mergedValue, () => {\n // Sync select value\n setSelectedValue(mergedValue.value);\n });\n const [hoverValue, onEnter, onLeave] = (0,_hooks_useHoverValue__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(text, {\n formatList,\n generateConfig: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'generateConfig'),\n locale: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'locale')\n });\n const onContextSelect = (date, type) => {\n if (type === 'submit' || type !== 'key' && !needConfirmButton.value) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n (0,_PanelContext__WEBPACK_IMPORTED_MODULE_14__.useProvidePanel)({\n operationRef,\n hideHeader: (0,vue__WEBPACK_IMPORTED_MODULE_2__.computed)(() => picker.value === 'time'),\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: (0,vue__WEBPACK_IMPORTED_MODULE_2__.toRef)(props, 'defaultOpenValue'),\n onDateMouseenter: onEnter,\n onDateMouseleave: onLeave\n });\n expose({\n focus: () => {\n if (inputRef.value) {\n inputRef.value.focus();\n }\n },\n blur: () => {\n if (inputRef.value) {\n inputRef.value.blur();\n }\n }\n });\n return () => {\n const {\n prefixCls = 'rc-picker',\n id,\n tabindex,\n dropdownClassName,\n dropdownAlign,\n popupStyle,\n transitionName,\n generateConfig,\n locale,\n inputReadOnly,\n allowClear,\n autofocus,\n picker = 'date',\n defaultOpenValue,\n suffixIcon,\n clearIcon,\n disabled,\n placeholder,\n getPopupContainer,\n panelRender,\n onMousedown,\n onMouseenter,\n onMouseleave,\n onContextmenu,\n onClick,\n onSelect,\n direction,\n autocomplete = 'off'\n } = props;\n // ============================= Panel =============================\n const panelProps = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, props), attrs), {\n class: (0,_util_classNames__WEBPACK_IMPORTED_MODULE_15__[\"default\"])({\n [`${prefixCls}-panel-focused`]: !typing.value\n }),\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined,\n onChange: null\n });\n let panelNode = (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"div\", {\n \"class\": `${prefixCls}-panel-layout`\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_PresetPanel__WEBPACK_IMPORTED_MODULE_16__[\"default\"], {\n \"prefixCls\": prefixCls,\n \"presets\": presetList.value,\n \"onClick\": nextValue => {\n triggerChange(nextValue);\n triggerOpen(false);\n }\n }, null), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_PickerPanel__WEBPACK_IMPORTED_MODULE_17__[\"default\"], (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[\"default\"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, panelProps), {}, {\n \"generateConfig\": generateConfig,\n \"value\": selectedValue.value,\n \"locale\": locale,\n \"tabindex\": -1,\n \"onSelect\": date => {\n onSelect === null || onSelect === void 0 ? void 0 : onSelect(date);\n setSelectedValue(date);\n },\n \"direction\": direction,\n \"onPanelChange\": (viewDate, mode) => {\n const {\n onPanelChange\n } = props;\n onLeave(true);\n onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, mode);\n }\n }), null)]);\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n const panel = (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"div\", {\n \"class\": `${prefixCls}-panel-container`,\n \"ref\": panelDivRef,\n \"onMousedown\": e => {\n e.preventDefault();\n }\n }, [panelNode]);\n let suffixNode;\n if (suffixIcon) {\n suffixNode = (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"span\", {\n \"class\": `${prefixCls}-suffix`\n }, [suffixIcon]);\n }\n let clearNode;\n if (allowClear && mergedValue.value && !disabled) {\n clearNode = (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"span\", {\n \"onMousedown\": e => {\n e.preventDefault();\n e.stopPropagation();\n },\n \"onMouseup\": e => {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n \"class\": `${prefixCls}-clear`,\n \"role\": \"button\"\n }, [clearIcon || (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"span\", {\n \"class\": `${prefixCls}-clear-btn`\n }, null)]);\n }\n const mergedInputProps = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n id,\n tabindex,\n disabled,\n readonly: inputReadOnly || typeof formatList.value[0] === 'function' || !typing.value,\n value: hoverValue.value || text.value,\n onInput: e => {\n triggerTextChange(e.target.value);\n },\n autofocus,\n placeholder,\n ref: inputRef,\n title: text.value\n }, inputProps.value), {\n size: (0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_6__.getInputSize)(picker, formatList.value[0], generateConfig)\n }), (0,_utils_miscUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(props)), {\n autocomplete\n });\n const inputNode = props.inputRender ? props.inputRender(mergedInputProps) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"input\", mergedInputProps, null);\n // ============================ Warning ============================\n if (true) {\n (0,_vc_util_warning__WEBPACK_IMPORTED_MODULE_11__.warning)(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n }\n // ============================ Return =============================\n const popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"div\", {\n \"ref\": containerRef,\n \"class\": (0,_util_classNames__WEBPACK_IMPORTED_MODULE_15__[\"default\"])(prefixCls, attrs.class, {\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-focused`]: focused.value,\n [`${prefixCls}-rtl`]: direction === 'rtl'\n }),\n \"style\": attrs.style,\n \"onMousedown\": onMousedown,\n \"onMouseup\": onInternalMouseup,\n \"onMouseenter\": onMouseenter,\n \"onMouseleave\": onMouseleave,\n \"onContextmenu\": onContextmenu,\n \"onClick\": onClick\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"div\", {\n \"class\": (0,_util_classNames__WEBPACK_IMPORTED_MODULE_15__[\"default\"])(`${prefixCls}-input`, {\n [`${prefixCls}-input-placeholder`]: !!hoverValue.value\n }),\n \"ref\": inputDivRef\n }, [inputNode, suffixNode, clearNode]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_PickerTrigger__WEBPACK_IMPORTED_MODULE_18__[\"default\"], {\n \"visible\": mergedOpen.value,\n \"popupStyle\": popupStyle,\n \"prefixCls\": prefixCls,\n \"dropdownClassName\": dropdownClassName,\n \"dropdownAlign\": dropdownAlign,\n \"getPopupContainer\": getPopupContainer,\n \"transitionName\": transitionName,\n \"popupPlacement\": popupPlacement,\n \"direction\": direction\n }, {\n default: () => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(\"div\", {\n \"style\": {\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n }\n }, null)],\n popupElement: () => panel\n })]);\n };\n }\n });\n}", "title": "" }, { "docid": "4a6ed1cdd1690a79740b5a2896480b53", "score": "0.6012917", "text": "static get properties(){return{/**\n * Optional. Sets the aria-labelledby attribute\n */ariaLabelledby:{name:\"ariaLabelledby\",type:\"String\",value:null},/**\n * Is the picker disabled?\n */disabled:{name:\"disabled\",type:\"Boolean\",value:!1},/**\n * Is it expanded?\n */expanded:{name:\"expanded\",type:\"Boolean\",value:!1,reflectToAttribute:!0},/**\n * Renders html as title. (Good for titles with HTML in them.)\n */titleAsHtml:{name:\"titleAsHtml\",type:\"Boolean\",value:!1},/**\n * Hide option labels? As color-picker or icon-picker, labels may be redundant.\n * This option would move the labels off-screen so that only screen-readers will have them.\n */hideOptionLabels:{name:\"hideOptionLabels\",type:\"Boolean\",value:!1},/**\n * Whether r not a label shoudl be added\n */hasLabel:{name:\"label\",type:\"Boolean\",computed:\"_hasLabel(label)\"},/**\n * Optional. The label for the picker input\n */label:{name:\"label\",type:\"String\",value:null},/**\n * An array of options for the picker, eg.: `\n[\n {\n \"icon\": \"editor:format-paint\", //Optional. Used if the picker is used as an icon picker.\n \"alt\": \"Blue\", //Required for accessibility. Alt text description of the choice.\n \"style\": \"background-color: blue;\", //Optional. Used to set an option's style.\n ... //Optional. Any other properties that should be captured as part of the selected option's value\n },...\n]`\n */options:{name:\"options\",type:\"Array\",value:[[]],notify:!0,observer:\"_setSelectedOption\"},/**\n * position the swatches relative to the picker, where:\n * `left` aligns the swatches to the picker's left edge\n * `right` aligns the swatches to the picker's right edge\n * `center` aligns the swatches to the picker's center\n \"position\": {\n \"name\": \"position\",\n \"type\": \"Boolean\",\n \"value\": \"left\",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n */ /**\n * An string that stores the current value for the picker\n */value:{name:\"value\",type:\"Object\",value:null,notify:!0,observer:\"_setSelectedOption\",reflectToAttribute:!0},/**\n * The aria-activedescendant attribute (active option's ID)\n */__activeDesc:{name:\"__activeDesc\",type:\"String\",value:\"option-0-0\"},/**\n * The selected option based on the value of the picker\n */__selectedOption:{name:\"_setSelectedOption\",type:\"Object\"}}}", "title": "" }, { "docid": "d6c8188d0209b5e0ac5e820e982e1a80", "score": "0.59384274", "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.59384274", "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.5922474", "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": "85ed8d532a725e33a5e397fbadc379af", "score": "0.5922474", "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": "396cd76ecea6928fbefa648123c726b2", "score": "0.5915436", "text": "createPicker(picker) {\n const me = this;\n return new TimePicker(Object.assign({\n owner: me,\n floating: true,\n forElement: me[me.pickerAlignElement],\n align: {\n align: 't0-b0',\n axisLock: true,\n anchor: me.overlayAnchor,\n target: me[me.pickerAlignElement]\n },\n value: me.value,\n format: me.format,\n\n onTimeChange({\n time\n }) {\n me._isUserAction = true;\n me.value = time;\n me._isUserAction = false;\n }\n\n }, picker));\n }", "title": "" }, { "docid": "ec9bf16e42264d6eb2892628c70b2c05", "score": "0.5900052", "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 ? $$$1.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},\n\n\n // Merge the default classes with the settings classes.\n CLASSES = $$$1.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),\n\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = $$$1( 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 = $$$1( '<div class=\"' + CLASSES.picker + '\" id=\"' + ELEMENT.id + '_root\" />' );\n prepareElementRoot();\n\n\n // Create the picker holder and then prepare it.\n P.$holder = $$$1( 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 ) $$$1( 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 ) $$$1( 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 = $$$1( 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 ( $$$1.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 = $$$1.isPlainObject( thing ),\n thingObject = thingIsObject ? thing : {};\n\n // Make sure we have usable options.\n options = thingIsObject && $$$1.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 = $$$1.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' && !$$$1( 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 = $$$1( 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 && !$$$1.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 = $$$1(\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": "e1729e2f54cea9dd5058637bc87cae77", "score": "0.58886117", "text": "static get tag() {\n return \"rich-text-editor-picker\";\n }", "title": "" }, { "docid": "e1729e2f54cea9dd5058637bc87cae77", "score": "0.58886117", "text": "static get tag() {\n return \"rich-text-editor-picker\";\n }", "title": "" }, { "docid": "04e4385bfb2d7a1e39386dd97b2277ea", "score": "0.58595014", "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": "6394c0aebdd32e2942e56ed648194a17", "score": "0.5849032", "text": "function createPicker(props) {\n if (pickerApiLoaded && oauthToken) {\n var view = new window.google.picker.View(window.google.picker.ViewId.DOCS);\n var docsView = new window.google.picker.DocsView()\n .setIncludeFolders(true)\n .setSelectFolderEnabled(true);\n\n var picker = new window.google.picker.PickerBuilder()\n .enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED)\n .setMaxItems(5)\n .setAppId(appId)\n .setOAuthToken(oauthToken)\n .addView(docsView)\n // .addView(docsView)\n .setDeveloperKey(developerKey)\n .setCallback(pickerCallback)\n .build();\n picker.setVisible(true);\n }\n}", "title": "" }, { "docid": "5f4b4ae4f96c3242356d9e7bf8f7149b", "score": "0.58481467", "text": "function createPicker() {\n\tif (pickerApiLoaded && oauthToken) {\n\t\tvar picker = new google.picker.PickerBuilder().addViewGroup(\n\t\t\t\tnew google.picker.ViewGroup(google.picker.ViewId.DOCS).addView(\n\t\t\t\t\t\tgoogle.picker.ViewId.DOCUMENTS).addView(\n\t\t\t\t\t\tgoogle.picker.ViewId.PRESENTATIONS)).setOAuthToken(\n\t\t\t\toauthToken).setDeveloperKey(developerKey).setCallback(\n\t\t\t\tpickerCallback).build();\n\t\tpicker.setVisible(true);\n\t}\n}", "title": "" }, { "docid": "f10633359d9fa70adce32faca8c1e5aa", "score": "0.5827192", "text": "polyfillDialog () {\n dialogPolyfill.registerDialog(this.element)\n }", "title": "" }, { "docid": "bcceb3f5677c7b2d95a585571ac9d9e7", "score": "0.5826893", "text": "function createPicker() {\n var picker = new google.picker.PickerBuilder().\n addView(google.picker.ViewId.SPREADSHEETS).\n enableFeature(google.picker.Feature.NAV_HIDDEN).\n setDeveloperKey(context.developer_key).\n setAppId(context.client_id).\n setOAuthToken(context.access_token).\n setCallback(pickerCallback).\n build();\n jQuery(\"#spreadsheet_id\").click(function() {\n picker.setVisible(true);\n })\n }", "title": "" }, { "docid": "1e7492256ff86c290ed4936342d15853", "score": "0.5826638", "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\n\t var\n\t 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() {\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 /**\n\t * Initialize everything\n\t */\n\t start: function() {\n\t\n\t // If it’s already started, do nothing.\n\t if ( STATE && STATE.start ) return P\n\t\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\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\n\t // Create a new picker component with the settings.\n\t P.component = new COMPONENT(P, SETTINGS)\n\t\n\t\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\t\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\n\t // Prepare the input element.\n\t prepareElement()\n\t\n\t\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\t\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\n\t // Once we’re all set, check the theme in use.\n\t IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )\n\t\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\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( entireComponent ) {\n\t\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\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() {\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( 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\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.\n\t css( 'overflow', 'hidden' ).\n\t css( 'padding-right', '+=' + getScrollbarWidth() )\n\t }\n\t\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.eq(0).focus()\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.$root.children()[0] )\n\t }\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 // Translate that to a selection change.\n\t keycodeToMove = P.component.key[ keycode ],\n\t\n\t // Grab the target.\n\t target = event.target\n\t\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\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\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 ).close()\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( giveFocus ) {\n\t\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' ).eq(0).focus()\n\t setTimeout( function() {\n\t P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )\n\t }, 0 )\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\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.\n\t css( 'overflow', '' ).\n\t 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( 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( thing, value, options ) {\n\t\n\t var thingItem, 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.\n\t val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).\n\t 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( 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 ?\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\t\n\t\n\t\n\t /**\n\t * Bind events on the things.\n\t */\n\t on: function( thing, method, internal ) {\n\t\n\t var thingName, 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 /**\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\t\n\t\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\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\n\t // Picker wrap class\n\t CLASSES.wrap\n\t ),\n\t\n\t // Picker frame class\n\t CLASSES.frame\n\t ),\n\t\n\t // Picker holder class\n\t CLASSES.holder\n\t ) //endreturn\n\t } //createWrappedComponent\n\t\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 // Remove the tabindex.\n\t attr('tabindex', -1).\n\t\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\t\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, 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.eq(0).focus()\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\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 /**\n\t * Prepare the root picker element with all bindings.\n\t */\n\t function prepareElementRoot() {\n\t\n\t P.$root.\n\t\n\t on({\n\t\n\t // For iOS8.\n\t keydown: handleKeydownEvent,\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( 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( 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, select, textarea, button, option' )) {\n\t\n\t event.preventDefault()\n\t\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.eq(0).focus()\n\t }\n\t }\n\t }\n\t }).\n\t\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\t\n\t // Open the picker and adjust the root “focused” state\n\t on( 'focus.toOpen', handleFocusToOpenEvent ).\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 // * 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.$root.eq(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 }\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 }\n\t\n\t else if ( targetData.close ) {\n\t P.close( true )\n\t }\n\t\n\t }) //P.$root\n\t\n\t aria( P.$root[0], 'hidden', true )\n\t }\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 }\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\t\n\t P._hidden = $(\n\t '<input ' +\n\t '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 (\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\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 ?\n\t P.get('select', SETTINGS.formatSubmit) :\n\t ''\n\t })\n\t\n\t\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\t\n\t\n\t // For iOS8.\n\t function handleKeydownEvent( event ) {\n\t\n\t var keycode = event.keyCode,\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 ) { P.clear().close() }\n\t else { P.open() }\n\t }\n\t }\n\t\n\t\n\t // Separated for IE\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 // 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\t\n\t // And then finally open the picker.\n\t P.open()\n\t }\n\t\n\t\n\t // Return a new picker instance.\n\t return new PickerInstance()\n\t}", "title": "" }, { "docid": "d31613f79309eff4ee4dec25c93ebfba", "score": "0.5795208", "text": "showPicker(object, completionHandler = (value, index) => {\n }) {\n this.setState({\n pickerData: object,\n isModalOpen: true,\n completionHandler: completionHandler,\n });\n }", "title": "" }, { "docid": "949d01899d28f4bbe392331dd69885c1", "score": "0.5785528", "text": "function dialogProductPicker() {\n var args = {\n dialogClass : 'wpdk-dialog-jquery-ui',\n modal : true,\n resizable : true,\n draggable : true,\n closeText : wpSmartShopJavascriptLocalization.closeText,\n title : wpSmartShopJavascriptLocalization.productPickerTitle,\n open : dialogProductPickerDidOpen,\n width : 640,\n height : 440,\n minWidth : 500,\n minHeight : 460,\n buttons : [\n {\n text : wpSmartShopJavascriptLocalization.Cancel,\n click : function () {\n $( this ).dialog( \"close\" );\n }\n }\n ]\n };\n\n if ( $( '#wpss-product-picker' ).parents( 'div.wpdk-jquery-ui .ui-dialog' ).length ) {\n $( '#wpss-product-picker' ).dialog( args );\n } else {\n $( '#wpss-product-picker' ).dialog( args ).parent( \".ui-dialog\" ).wrap( \"<div class='wpdk-jquery-ui'></div>\" );\n }\n }", "title": "" }, { "docid": "12dc132f5f73cff9a912945049f7fe28", "score": "0.5780287", "text": "openFilePicker() {\n FileUploaderActions.openFilePicker();\n }", "title": "" }, { "docid": "2cae46da87d235dfaded3e4cc77cf371", "score": "0.5778037", "text": "function onstart () { console.log(\"onstart picker\"); }", "title": "" }, { "docid": "468953bf20f3a4e2124302e6451e320e", "score": "0.5758048", "text": "createPicker(picker) {\n const me = this;\n picker = new DatePicker(Object.assign({\n owner: me,\n forElement: me[me.pickerAlignElement],\n floating: true,\n scrollAction: 'realign',\n align: {\n align: 't0-b0',\n axisLock: true,\n anchor: me.overlayAnchor,\n target: me[me.pickerAlignElement]\n },\n value: me.value,\n minDate: me.min,\n maxDate: me.max,\n weekStartDay: me._weekStartDay,\n // need to pass the raw value to let the component to use its default value\n onSelectionChange: ({\n selection,\n source: picker\n }) => {\n // We only care about what DatePicker does if it has been opened\n if (picker.isVisible) {\n me._isUserAction = true;\n me.value = selection[0];\n me._isUserAction = false;\n picker.hide();\n }\n }\n }, picker));\n\n if (me.calendarContainerCls) {\n picker.element.classList.add(me.calendarContainerCls);\n }\n\n return picker;\n }", "title": "" }, { "docid": "dd80d1bf3910698adb6b5fe20fdfe768", "score": "0.575161", "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\n\t // Picker wrap class\n\t CLASSES.wrap\n\t ),\n\t\n\t // Picker frame class\n\t CLASSES.frame\n\t ),\n\t\n\t // Picker holder class\n\t CLASSES.holder\n\t ) //endreturn\n\t }", "title": "" }, { "docid": "dbeb87098a627382dd911f9575a3ce97", "score": "0.5743955", "text": "function createPicker(obj) {\n\tif (pickerApiLoaded && oauthToken) {\n\t\tlet photoUploadView = new google.picker.View(google.picker.ViewId.PHOTO_UPLOAD);\n\t\tlet imageSearchView = new google.picker.ImageSearchView();\n\t\tlet photosView = new google.picker.PhotosView();\n\t\timageSearchView.setQuery(obj.query);\n\t\tphotoUploadView.setMimeTypes(\"image/png,image/jpeg,image/jpg\");\n\t\tvar picker = new google.picker.PickerBuilder()\n\t\t\t\t.setAppId(appId)\n\t\t\t\t.setOAuthToken(oauthToken)\n\t\t\t\t.addView(imageSearchView)\n\t\t\t\t.addView(photosView)\n\t\t\t\t.addView(photoUploadView)\n\t\t\t\t.setOrigin(window.location.protocol + '//' + window.location.host)\n\t\t\t\t//.setRelayUrl(relayURL)\n\t\t\t\t.setDeveloperKey(developerKey)\n\t\t\t\t.setCallback(pickerCallback)\n\t\t\t\t.build();\n\t\t\tpicker.setVisible(true);\n\t}\n}", "title": "" }, { "docid": "040ce912116affb4bd0ec0ec5e9ffc7f", "score": "0.57412374", "text": "createPicker(pickerConfig) {\n const me = this,\n {\n multiSelect\n } = me,\n pickerWidth = me.pickerWidth || pickerConfig.width,\n picker = WidgetHelper.createWidget(ObjectHelper.merge({\n type: 'list',\n owner: me,\n floating: true,\n scrollAction: 'realign',\n itemsFocusable: false,\n activateOnMouseover: true,\n store: me.store,\n selected: me.valueCollection,\n multiSelect,\n cls: me.listCls,\n itemTpl: me.listItemTpl || (item => item[me.displayField]),\n forElement: me[me.pickerAlignElement],\n align: {\n align: 't-b',\n axisLock: true,\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 maxHeight: 324,\n scrollable: {\n overflowY: true\n },\n autoShow: false,\n focusOnHover: false\n }, pickerConfig));\n picker.element.dataset.emptyText = me.emptyText || me.L('L{noResults}');\n return picker;\n }", "title": "" }, { "docid": "c695b7db15e67a997b054706710b6d73", "score": "0.5737999", "text": "create(options) {\n return __chunk_4.createOverlay('ion-picker', options);\n }", "title": "" }, { "docid": "4e63ec36b89b9711dcd0f09091eb1237", "score": "0.57041556", "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.57041556", "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.57041556", "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": "1f0ef45509c7fea7b6c8b47fada45a4f", "score": "0.5701226", "text": "togglePicker(focusPicker) {\n if (this.pickerVisible) {\n this.hidePicker();\n } else {\n this.showPicker(focusPicker);\n }\n }", "title": "" }, { "docid": "6929e21058949fdae8c5c347d51a64bc", "score": "0.5688427", "text": "function launchPicker() {\n\t$('#__SPNS__pickerIframe').attr('src', _deliveryPaletteUrl + _selectedContent.contentType[_selectedContent.contentMode] + '\")');\n\t_eventer(_messageEvent, handlePaletteResult, false);\n}", "title": "" }, { "docid": "3be3424011019a45487c4beecb821ec2", "score": "0.56840366", "text": "function open() {\n chooser.click(); \n}", "title": "" }, { "docid": "166bf0bd627a6a4d6763db8dd8639980", "score": "0.56791145", "text": "static get tag() {\n return \"simple-symbol-picker\";\n }", "title": "" }, { "docid": "ef0b3366b2245d241690f256cb473f7f", "score": "0.56748486", "text": "openPicker(callback, multiple = false) {\n if (this.uploading) return;\n\n const $input = $('<input type=\"file\">');\n $input.attr('multiple', multiple);\n $input.appendTo('body').hide().click().on('change', e => {\n callback($(e.target)[0].files);\n });\n }", "title": "" }, { "docid": "19b7d66e5048272c6e312f25b2274f46", "score": "0.5674672", "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": "20d8472b393f32d7a6cc38e3bea5738d", "score": "0.5674672", "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.5674672", "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": "127d9554a4356a5191bbce0489b37d15", "score": "0.56620705", "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": "127d9554a4356a5191bbce0489b37d15", "score": "0.56620705", "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": "1fba18b32af7941b4185ed3fe75d98ea", "score": "0.56466264", "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\tvar SETTINGS;\n\t\n\t// Merge the defaults and options passed.\n\tif (COMPONENT) {\n\t\tSETTINGS = COMPONENT.defaults;\n\t\tangular.extend(SETTINGS, OPTIONS);\n\t} else {\n\t\tSETTINGS = OPTIONS || {};\n\t}\n\t\n\t// Merge the default classes with the settings classes.\n\tvar CLASSES = PickerConstructor.klasses();\n\tangular.extend(CLASSES, SETTINGS.klass);\n\t\n\n var\n // The state of the picker.\n STATE = {\n id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )\n },\n\n // The element node wrapper into a jQuery object.\n $ELEMENT = angular.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 == document.activeElement\n ELEMENT.type = 'text'\n ELEMENT.readOnly = !SETTINGS.editable\n ELEMENT.id = ELEMENT.id || STATE.id\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 = angular.element( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id=\"' + ELEMENT.id + '_root\"') )\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 ) {\n angular.element( SETTINGS.container ).append( P.$root )\n } \n else {\n $ELEMENT.after( P.$root )\n }\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 // If the element has autofocus, open the picker.\n if ( ELEMENT.autofocus ) {\n P.open()\n }\n\n P.attachLiveEvents();\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 // Insert a new component holder in the root or box.\n if ( entireComponent ) P.$root.html( createWrappedComponent() )\n else angular.element(P.$root[0].querySelectorAll( '.' + CLASSES.box )).html( P.component.nodes( STATE.open ) )\n\n P.attachLiveEvents();\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 // If it’s already open, do nothing.\n if ( STATE.open ) return P\n\n\n // Add the “active” class.\n $ELEMENT.addClass( CLASSES.active )\n aria( ELEMENT, 'expanded', true )\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 // 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 // Pass focus to the element’s jQuery object.\n $ELEMENT.triggerHandler( 'focus' )\n\n // Bind the document events.\n\t\t\t\t\tangular.element(document.querySelectorAll('#' + STATE.id)).off('click focusin').on('click focusin', function( event ) {\n var target = event.target;\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 });\n\t\t\t\t\t\n\t\t\t\t\tangular.element(document.querySelectorAll('#' + STATE.id)).off('keydown').on('keydown', function( event ) {\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 == ELEMENT && ( 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 ( !angular.element(P.$root[0].querySelectorAll( '.' + 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 ( P.$root[0].contains(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 $ELEMENT.off( 'focus.' + STATE.id );\n\t\t\t\t\t$ELEMENT.triggerHandler( 'focus' );\n setTimeout( function() {\n angular.element(document.querySelectorAll('#' + STATE.id)).on( 'focus', focusToOpen )\n }, 0 )\n }\n\n // Remove the “active” class.\n $ELEMENT.removeClass( CLASSES.active )\n aria( ELEMENT, 'expanded', false )\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 aria( P.$root[0], 'selected', false )\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 $ELEMENT[0].blur();\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() {\n return P.set( 'clear' )\n }, //clear\n\n\n /**\n * Set something\n */\n set: function( thing, value, options ) {\n\n var thingItem, thingValue,\n thingIsObject = angular.isObject( thing ),\n thingObject = thingIsObject ? thing : {}\n\n // Make sure we have usable options.\n options = thingIsObject && angular.isObject( 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 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[0].value = thingItem == 'clear' ?\n '' : P.get( thingItem, SETTINGS.format );\n\t\t\t\t\t\t\t$ELEMENT.triggerHandler('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 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 return PickerConstructor._.trigger(\n P.component.formats.toString,\n P.component,\n [ format, P.component.get( thing ) ]\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 ) {\n var thingName, thingMethod,\n thingIsObject = angular.isObject( 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 // 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 methodList = STATE.methods[ name ]\n if ( methodList ) {\n methodList.map( function( method ) {\n PickerConstructor._.trigger( method, P, [ data ] )\n })\n }\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\t\t// Store the picker data by component name.\n $ELEMENT.data(NAME, P);\n\n // Add the “input” class name.\n $ELEMENT.addClass(CLASSES.input)\n\t\t\n\t\t// If there’s a `data-value`, update the value of the element.\n\t\t$ELEMENT[0].value = $ELEMENT.attr('data-value') ?\n\t\t\tP.get('select', SETTINGS.format) :\n\t\t\tELEMENT.value;\n\n\t\t// On focus/click, open the picker and adjust the root “focused” state.\n\t\tangular.element(document.querySelectorAll('#' + STATE.id)).on('focus', focusToOpen);\n\t\tangular.element(document.querySelectorAll('#' + STATE.id)).on('click', focusToOpen);\n\t\t\n // Only bind keydown events if the element isn’t editable.\n if ( !SETTINGS.editable ) {\n\n // Handle keyboard event based on the picker being opened or not.\n angular.element(document.querySelectorAll('#' + STATE.id)).on('keydown', function(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\n // Update the aria attributes.\n aria(ELEMENT, {\n haspopup: true,\n expanded: false,\n readonly: false,\n owns: ELEMENT.id + '_root' + (P._hidden ? ' ' + P._hidden.id : '')\n })\n }\n\n\n /**\n * Prepare the root picker element with all bindings.\n */\n function prepareElementRoot() {\n\t\t// When something within the root is focused, stop from bubbling\n\t\t// to the doc and remove the “focused” state from the root.\t\n P.$root.on('focusin', function( event ) {\n\t\t\tP.$root.removeClass( CLASSES.focused )\n\t\t\taria( P.$root[0], 'selected', false )\n\t\t\tevent.stopPropagation()\n\t\t});\n\t\n\t\t// When something within the root holder is clicked, stop it\n // from bubbling to the doc.\n P.$root.on('mousedown click', function( event ) {\n\n\t\t\tvar target = event.target\n\n\t\t\t// Make sure the target isn’t the root holder so it can bubble up.\n\t\t\tif ( target != P.$root.children()[ 0 ] ) {\n\n\t\t\t\tevent.stopPropagation()\n\n\t\t\t\t// * For mousedown events, cancel the default action in order to\n\t\t\t\t// prevent cases where focus is shifted onto external elements\n\t\t\t\t// when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).\n\t\t\t\t// Also, for Firefox, don’t prevent action on the `option` element.\n\t\t\t\tif ( event.type == 'mousedown' && angular.element( target )[0].tagName !== 'input' && target.nodeName != 'SELECT' && target.nodeName != 'OPTION' ) {\n\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\t// Re-focus onto the element so that users can click away\n\t\t\t\t\t// from elements focused within the picker.\n\t\t\t\t\tELEMENT.focus()\n\t\t\t\t}\n\t\t\t} else if ( event.type == 'click' && P.get('open') ) {\n\t\t\t\tP.close();\n\t\t\t}\n\t\t});\n\n P.attachLiveEvents = function() {\n // If there’s a click on an actionable element, carry out the actions.\n angular.element(P.$root[0].querySelectorAll('[data-pick], [data-nav], [data-clear], [data-close]')).off('click').on('click', function() {\n var $target = angular.element( this ),\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 = document.activeElement\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 && !P.$root[0].contains(activeElement) ) {\n ELEMENT.focus()\n }\n\n // If something is superficially changed, update the `highlight` based on the `nav`.\n if ( $target.attr('data-nav') && !targetDisabled ) {\n P.set( 'highlight', P.component.item.highlight, { nav: parseInt($target.attr('data-nav')) } )\n P.attachLiveEvents();\n }\n\n // If something is picked, set `select` then close with focus.\n else if ( PickerConstructor._.isInteger( parseInt($target.attr('data-pick')) ) && !targetDisabled ) {\n P.set( 'select', parseInt($target.attr('data-pick')) ).close( true )\n P.attachLiveEvents();\n }\n\n // If a “clear” button is pressed, empty the values and close with focus.\n else if ( $target.attr('data-clear') ) {\n P.clear().close( true )\n P.attachLiveEvents();\n }\n\n // If a \"close\" button is pressed, close with focus.\n else if ( $target.attr('data-close') ) {\n P.close( true );\n P.attachLiveEvents();\n }\n\n });\n }\n\t\t\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 id = [\n typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',\n typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'\n ]\n\n P._hidden = angular.element(\n '<input ' +\n 'type=hidden ' +\n\n // Create the name and ID by using the original\n // input’s with a prefix and suffix.\n 'name=\"' + id[0] + ELEMENT.name + id[1] + '\"' +\n 'id=\"' + id[0] + ELEMENT.id + id[1] + '\"' +\n\n // If the element has a value, set the hidden value as well.\n (\n $ELEMENT.attr('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 // Insert the hidden input after the element.\n after(P._hidden)\n }\n\n\n // Separated for IE\n function focusToOpen( 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 aria( P.$root[0], 'selected', true )\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": "4e9b8926d0c2f0ccda7b2bcadfe01c1d", "score": "0.55930144", "text": "function PickerPanel(props) {\n var _classNames;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n className = props.className,\n style = props.style,\n locale = props.locale,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n pickerValue = props.pickerValue,\n defaultPickerValue = props.defaultPickerValue,\n disabledDate = props.disabledDate,\n mode = props.mode,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n showNow = props.showNow,\n showTime = props.showTime,\n showToday = props.showToday,\n renderExtraFooter = props.renderExtraFooter,\n hideHeader = props.hideHeader,\n onSelect = props.onSelect,\n onChange = props.onChange,\n onPanelChange = props.onPanelChange,\n onMouseDown = props.onMouseDown,\n onPickerValueChange = props.onPickerValueChange,\n _onOk = props.onOk,\n components = props.components,\n direction = props.direction,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n var isHourStepValid = 24 % hourStep === 0;\n var isMinuteStepValid = 60 % minuteStep === 0;\n var isSecondStepValid = 60 % secondStep === 0;\n\n if (true) {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__.default)(!value || generateConfig.isValidate(value), 'Invalidate date pass to `value`.');\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__.default)(!value || generateConfig.isValidate(value), 'Invalidate date pass to `defaultValue`.');\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__.default)(isHourStepValid, \"`hourStep` \".concat(hourStep, \" is invalid. It should be a factor of 24.\"));\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__.default)(isMinuteStepValid, \"`minuteStep` \".concat(minuteStep, \" is invalid. It should be a factor of 60.\"));\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__.default)(isSecondStepValid, \"`secondStep` \".concat(secondStep, \" is invalid. It should be a factor of 60.\"));\n } // ============================ State =============================\n\n\n var panelContext = react__WEBPACK_IMPORTED_MODULE_5__.useContext(_PanelContext__WEBPACK_IMPORTED_MODULE_19__.default);\n var operationRef = panelContext.operationRef,\n panelDivRef = panelContext.panelRef,\n onContextSelect = panelContext.onSelect,\n hideRanges = panelContext.hideRanges,\n defaultOpenValue = panelContext.defaultOpenValue;\n\n var _React$useContext = react__WEBPACK_IMPORTED_MODULE_5__.useContext(_RangeContext__WEBPACK_IMPORTED_MODULE_21__.default),\n inRange = _React$useContext.inRange,\n panelPosition = _React$useContext.panelPosition,\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var panelRef = react__WEBPACK_IMPORTED_MODULE_5__.useRef({}); // Handle init logic\n\n var initRef = react__WEBPACK_IMPORTED_MODULE_5__.useRef(true); // Value\n\n var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_9__.default)(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(val) {\n if (!val && defaultOpenValue && picker === 'time') {\n return defaultOpenValue;\n }\n\n return val;\n }\n }),\n _useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // View date control\n\n\n var _useMergedState3 = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_9__.default)(null, {\n value: pickerValue,\n defaultValue: defaultPickerValue || mergedValue,\n postState: function postState(date) {\n var now = generateConfig.getNow();\n if (!date) return now; // When value is null and set showTime\n\n if (!mergedValue && showTime) {\n if ((0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_3__.default)(showTime) === 'object') {\n return (0,_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__.setDateTime)(generateConfig, date, showTime.defaultValue || now);\n }\n\n if (defaultValue) {\n return (0,_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__.setDateTime)(generateConfig, date, defaultValue);\n }\n\n return (0,_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__.setDateTime)(generateConfig, date, now);\n }\n\n return date;\n }\n }),\n _useMergedState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_useMergedState3, 2),\n viewDate = _useMergedState4[0],\n setInnerViewDate = _useMergedState4[1];\n\n var setViewDate = function setViewDate(date) {\n setInnerViewDate(date);\n\n if (onPickerValueChange) {\n onPickerValueChange(date);\n }\n }; // Panel control\n\n\n var getInternalNextMode = function getInternalNextMode(nextMode) {\n var getNextMode = _utils_uiUtil__WEBPACK_IMPORTED_MODULE_20__.PickerModeMap[picker];\n\n if (getNextMode) {\n return getNextMode(nextMode);\n }\n\n return nextMode;\n }; // Save panel is changed from which panel\n\n\n var _useMergedState5 = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_9__.default)(function () {\n if (picker === 'time') {\n return 'time';\n }\n\n return getInternalNextMode('date');\n }, {\n value: mode\n }),\n _useMergedState6 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_useMergedState5, 2),\n mergedMode = _useMergedState6[0],\n setInnerMode = _useMergedState6[1];\n\n react__WEBPACK_IMPORTED_MODULE_5__.useEffect(function () {\n setInnerMode(picker);\n }, [picker]);\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_5__.useState(function () {\n return mergedMode;\n }),\n _React$useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.default)(_React$useState, 2),\n sourceMode = _React$useState2[0],\n setSourceMode = _React$useState2[1];\n\n var onInternalPanelChange = function onInternalPanelChange(newMode, viewValue) {\n var nextMode = getInternalNextMode(newMode || mergedMode);\n setSourceMode(mergedMode);\n setInnerMode(nextMode);\n\n if (onPanelChange && (mergedMode !== nextMode || (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_18__.isEqual)(generateConfig, viewDate, viewDate))) {\n onPanelChange(viewValue, nextMode);\n }\n };\n\n var triggerSelect = function triggerSelect(date, type) {\n var forceTriggerSelect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (mergedMode === picker || forceTriggerSelect) {\n setInnerValue(date);\n\n if (onSelect) {\n onSelect(date);\n }\n\n if (onContextSelect) {\n onContextSelect(date, type);\n }\n\n if (onChange && !(0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_18__.isEqual)(generateConfig, date, mergedValue) && !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date))) {\n onChange(date);\n }\n }\n }; // ========================= Interactive ==========================\n\n\n var onInternalKeyDown = function onInternalKeyDown(e) {\n if (panelRef.current && panelRef.current.onKeyDown) {\n if ([rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.LEFT, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.RIGHT, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.UP, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.DOWN, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.PAGE_UP, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.PAGE_DOWN, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__.default.ENTER].includes(e.which)) {\n e.preventDefault();\n }\n\n return panelRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__.default)(false, 'Panel not correct handle keyDown event. Please help to fire issue about this.');\n return false;\n }\n /* eslint-enable no-lone-blocks */\n };\n\n var onInternalBlur = function onInternalBlur(e) {\n if (panelRef.current && panelRef.current.onBlur) {\n panelRef.current.onBlur(e);\n }\n };\n\n if (operationRef && panelPosition !== 'right') {\n operationRef.current = {\n onKeyDown: onInternalKeyDown,\n onClose: function onClose() {\n if (panelRef.current && panelRef.current.onClose) {\n panelRef.current.onClose();\n }\n }\n };\n } // ============================ Effect ============================\n\n\n react__WEBPACK_IMPORTED_MODULE_5__.useEffect(function () {\n if (value && !initRef.current) {\n setInnerViewDate(value);\n }\n }, [value]);\n react__WEBPACK_IMPORTED_MODULE_5__.useEffect(function () {\n initRef.current = false;\n }, []); // ============================ Panels ============================\n\n var panelNode;\n\n var pickerProps = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.default)({}, props), {}, {\n operationRef: panelRef,\n prefixCls: prefixCls,\n viewDate: viewDate,\n value: mergedValue,\n onViewDateChange: setViewDate,\n sourceMode: sourceMode,\n onPanelChange: onInternalPanelChange,\n disabledDate: disabledDate\n });\n\n delete pickerProps.onChange;\n delete pickerProps.onSelect;\n\n switch (mergedMode) {\n case 'decade':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_DecadePanel__WEBPACK_IMPORTED_MODULE_17__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'year':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_YearPanel__WEBPACK_IMPORTED_MODULE_16__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'month':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_MonthPanel__WEBPACK_IMPORTED_MODULE_14__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'quarter':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_QuarterPanel__WEBPACK_IMPORTED_MODULE_15__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'week':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_WeekPanel__WEBPACK_IMPORTED_MODULE_13__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'time':\n delete pickerProps.showTime;\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_TimePanel__WEBPACK_IMPORTED_MODULE_10__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_3__.default)(showTime) === 'object' ? showTime : null, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n default:\n if (showTime) {\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_DatetimePanel__WEBPACK_IMPORTED_MODULE_11__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n } else {\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_panels_DatePanel__WEBPACK_IMPORTED_MODULE_12__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__.default)({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n }\n\n } // ============================ Footer ============================\n\n\n var extraFooter;\n var rangesNode;\n\n var onNow = function onNow() {\n var now = generateConfig.getNow();\n var lowerBoundTime = (0,_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__.getLowerBoundTime)(generateConfig.getHour(now), generateConfig.getMinute(now), generateConfig.getSecond(now), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1);\n var adjustedNow = (0,_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__.setTime)(generateConfig, now, lowerBoundTime[0], // hour\n lowerBoundTime[1], // minute\n lowerBoundTime[2]);\n triggerSelect(adjustedNow, 'submit');\n };\n\n if (!hideRanges) {\n extraFooter = (0,_utils_getExtraFooter__WEBPACK_IMPORTED_MODULE_22__.default)(prefixCls, mergedMode, renderExtraFooter);\n rangesNode = (0,_utils_getRanges__WEBPACK_IMPORTED_MODULE_23__.default)({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue),\n locale: locale,\n showNow: showNow,\n onNow: needConfirmButton && onNow,\n onOk: function onOk() {\n if (mergedValue) {\n triggerSelect(mergedValue, 'submit', true);\n\n if (_onOk) {\n _onOk(mergedValue);\n }\n }\n }\n });\n }\n\n var todayNode;\n\n if (showToday && mergedMode === 'date' && picker === 'date' && !showTime) {\n var now = generateConfig.getNow();\n var todayCls = \"\".concat(prefixCls, \"-today-btn\");\n var disabled = disabledDate && disabledDate(now);\n todayNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(\"a\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(todayCls, disabled && \"\".concat(todayCls, \"-disabled\")),\n \"aria-disabled\": disabled,\n onClick: function onClick() {\n if (!disabled) {\n triggerSelect(now, 'mouse', true);\n }\n }\n }, locale.today);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(_PanelContext__WEBPACK_IMPORTED_MODULE_19__.default.Provider, {\n value: (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__.default)({}, panelContext), {}, {\n mode: mergedMode,\n hideHeader: 'hideHeader' in props ? hideHeader : panelContext.hideHeader,\n hidePrevBtn: inRange && panelPosition === 'right',\n hideNextBtn: inRange && panelPosition === 'left'\n })\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(\"div\", {\n tabIndex: tabIndex,\n className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(\"\".concat(prefixCls, \"-panel\"), className, (_classNames = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames, \"\".concat(prefixCls, \"-panel-has-range\"), rangedValue && rangedValue[0] && rangedValue[1]), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames, \"\".concat(prefixCls, \"-panel-has-range-hover\"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_classNames, \"\".concat(prefixCls, \"-panel-rtl\"), direction === 'rtl'), _classNames)),\n style: style,\n onKeyDown: onInternalKeyDown,\n onBlur: onInternalBlur,\n onMouseDown: onMouseDown,\n ref: panelDivRef\n }, panelNode, extraFooter || rangesNode || todayNode ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraFooter, rangesNode, todayNode) : null));\n}", "title": "" }, { "docid": "8d1f506e18efc08984fb67dcd36122ee", "score": "0.55451536", "text": "function prepareElement(){$ELEMENT.// Store the picker data by component name.\ndata(NAME,P).// Add the “input” class name.\naddClass(CLASSES.input).// If there’s a `data-value`, update the value of the element.\nval($ELEMENT.data('value')?P.get('select',SETTINGS.format):ELEMENT.value);// Only bind keydown events if the element isn’t editable.\nif(!SETTINGS.editable){$ELEMENT.// On focus/click, open the picker.\non('focus.'+STATE.id+' click.'+STATE.id,function(event){event.preventDefault();P.open();}).// Handle keyboard event based on the picker being opened or not.\non('keydown.'+STATE.id,handleKeydownEvent);}// Update the aria attributes.\naria(ELEMENT,{haspopup:true,expanded:false,readonly:false,owns:ELEMENT.id+'_root'});}", "title": "" }, { "docid": "131b2e54a03e9e921002355ed4e97d09", "score": "0.5500553", "text": "function PickerPanel(props) {\n var _classNames;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n className = props.className,\n style = props.style,\n locale = props.locale,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n pickerValue = props.pickerValue,\n defaultPickerValue = props.defaultPickerValue,\n disabledDate = props.disabledDate,\n mode = props.mode,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n showNow = props.showNow,\n showTime = props.showTime,\n showToday = props.showToday,\n renderExtraFooter = props.renderExtraFooter,\n hideHeader = props.hideHeader,\n onSelect = props.onSelect,\n onChange = props.onChange,\n onPanelChange = props.onPanelChange,\n onMouseDown = props.onMouseDown,\n onPickerValueChange = props.onPickerValueChange,\n _onOk = props.onOk,\n components = props.components,\n direction = props.direction,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n var isHourStepValid = 24 % hourStep === 0;\n var isMinuteStepValid = 60 % minuteStep === 0;\n var isSecondStepValid = 60 % secondStep === 0;\n\n if (true) {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(!value || generateConfig.isValidate(value), 'Invalidate date pass to `value`.');\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(!value || generateConfig.isValidate(value), 'Invalidate date pass to `defaultValue`.');\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(isHourStepValid, \"`hourStep` \".concat(hourStep, \" is invalid. It should be a factor of 24.\"));\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(isMinuteStepValid, \"`minuteStep` \".concat(minuteStep, \" is invalid. It should be a factor of 60.\"));\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(isSecondStepValid, \"`secondStep` \".concat(secondStep, \" is invalid. It should be a factor of 60.\"));\n } // ============================ State =============================\n\n\n var panelContext = react__WEBPACK_IMPORTED_MODULE_4__[\"useContext\"](_PanelContext__WEBPACK_IMPORTED_MODULE_18__[\"default\"]);\n var operationRef = panelContext.operationRef,\n panelDivRef = panelContext.panelRef,\n onContextSelect = panelContext.onSelect,\n hideRanges = panelContext.hideRanges,\n defaultOpenValue = panelContext.defaultOpenValue;\n\n var _React$useContext = react__WEBPACK_IMPORTED_MODULE_4__[\"useContext\"](_RangeContext__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n inRange = _React$useContext.inRange,\n panelPosition = _React$useContext.panelPosition,\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var panelRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"]({}); // Handle init logic\n\n var initRef = react__WEBPACK_IMPORTED_MODULE_4__[\"useRef\"](true); // Value\n\n var _useMergedState = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(val) {\n if (!val && defaultOpenValue && picker === 'time') {\n return defaultOpenValue;\n }\n\n return val;\n }\n }),\n _useMergedState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // View date control\n\n\n var _useMergedState3 = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(null, {\n value: pickerValue,\n defaultValue: defaultPickerValue || mergedValue,\n postState: function postState(date) {\n return date || generateConfig.getNow();\n }\n }),\n _useMergedState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_useMergedState3, 2),\n viewDate = _useMergedState4[0],\n setInnerViewDate = _useMergedState4[1];\n\n var setViewDate = function setViewDate(date) {\n setInnerViewDate(date);\n\n if (onPickerValueChange) {\n onPickerValueChange(date);\n }\n }; // Panel control\n\n\n var getInternalNextMode = function getInternalNextMode(nextMode) {\n var getNextMode = _utils_uiUtil__WEBPACK_IMPORTED_MODULE_19__[\"PickerModeMap\"][picker];\n\n if (getNextMode) {\n return getNextMode(nextMode);\n }\n\n return nextMode;\n }; // Save panel is changed from which panel\n\n\n var _useMergedState5 = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(function () {\n if (picker === 'time') {\n return 'time';\n }\n\n return getInternalNextMode('date');\n }, {\n value: mode\n }),\n _useMergedState6 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_useMergedState5, 2),\n mergedMode = _useMergedState6[0],\n setInnerMode = _useMergedState6[1];\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n setInnerMode(picker);\n }, [picker]);\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_4__[\"useState\"](function () {\n return mergedMode;\n }),\n _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_React$useState, 2),\n sourceMode = _React$useState2[0],\n setSourceMode = _React$useState2[1];\n\n var onInternalPanelChange = function onInternalPanelChange(newMode, viewValue) {\n var nextMode = getInternalNextMode(newMode || mergedMode);\n setSourceMode(mergedMode);\n setInnerMode(nextMode);\n\n if (onPanelChange && (mergedMode !== nextMode || Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_17__[\"isEqual\"])(generateConfig, viewDate, viewDate))) {\n onPanelChange(viewValue, nextMode);\n }\n };\n\n var triggerSelect = function triggerSelect(date, type) {\n var forceTriggerSelect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (mergedMode === picker || forceTriggerSelect) {\n setInnerValue(date);\n\n if (onSelect) {\n onSelect(date);\n }\n\n if (onContextSelect) {\n onContextSelect(date, type);\n }\n\n if (onChange && !Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_17__[\"isEqual\"])(generateConfig, date, mergedValue)) {\n onChange(date);\n }\n }\n }; // ========================= Interactive ==========================\n\n\n var onInternalKeyDown = function onInternalKeyDown(e) {\n if (panelRef.current && panelRef.current.onKeyDown) {\n if ([rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].LEFT, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].RIGHT, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].UP, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].DOWN, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].PAGE_UP, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].PAGE_DOWN, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ENTER].includes(e.which)) {\n e.preventDefault();\n }\n\n return panelRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(false, 'Panel not correct handle keyDown event. Please help to fire issue about this.');\n return false;\n }\n /* eslint-enable no-lone-blocks */\n };\n\n var onInternalBlur = function onInternalBlur(e) {\n if (panelRef.current && panelRef.current.onBlur) {\n panelRef.current.onBlur(e);\n }\n };\n\n if (operationRef && panelPosition !== 'right') {\n operationRef.current = {\n onKeyDown: onInternalKeyDown,\n onClose: function onClose() {\n if (panelRef.current && panelRef.current.onClose) {\n panelRef.current.onClose();\n }\n }\n };\n } // ============================ Effect ============================\n\n\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n if (value && !initRef.current) {\n setInnerViewDate(value);\n }\n }, [value]);\n react__WEBPACK_IMPORTED_MODULE_4__[\"useEffect\"](function () {\n initRef.current = false;\n }, []); // ============================ Panels ============================\n\n var panelNode;\n\n var pickerProps = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({}, props), {}, {\n operationRef: panelRef,\n prefixCls: prefixCls,\n viewDate: viewDate,\n value: mergedValue,\n onViewDateChange: setViewDate,\n sourceMode: sourceMode,\n onPanelChange: onInternalPanelChange,\n disabledDate: mergedMode !== 'decade' ? disabledDate : undefined\n });\n\n delete pickerProps.onChange;\n delete pickerProps.onSelect;\n\n switch (mergedMode) {\n case 'decade':\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_DecadePanel__WEBPACK_IMPORTED_MODULE_16__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'year':\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_YearPanel__WEBPACK_IMPORTED_MODULE_15__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'month':\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_MonthPanel__WEBPACK_IMPORTED_MODULE_13__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'quarter':\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_QuarterPanel__WEBPACK_IMPORTED_MODULE_14__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'week':\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_WeekPanel__WEBPACK_IMPORTED_MODULE_12__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'time':\n delete pickerProps.showTime;\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_TimePanel__WEBPACK_IMPORTED_MODULE_9__[\"default\"], Object.assign({}, pickerProps, Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(showTime) === 'object' ? showTime : null, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n default:\n if (showTime) {\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_DatetimePanel__WEBPACK_IMPORTED_MODULE_10__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n } else {\n panelNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_panels_DatePanel__WEBPACK_IMPORTED_MODULE_11__[\"default\"], Object.assign({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n }\n\n } // ============================ Footer ============================\n\n\n var extraFooter;\n var rangesNode;\n\n var onNow = function onNow() {\n var now = generateConfig.getNow();\n var lowerBoundTime = Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_23__[\"getLowerBoundTime\"])(generateConfig.getHour(now), generateConfig.getMinute(now), generateConfig.getSecond(now), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1);\n var adjustedNow = Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_23__[\"setTime\"])(generateConfig, now, lowerBoundTime[0], // hour\n lowerBoundTime[1], // minute\n lowerBoundTime[2]);\n triggerSelect(adjustedNow, 'submit');\n };\n\n if (!hideRanges) {\n extraFooter = Object(_utils_getExtraFooter__WEBPACK_IMPORTED_MODULE_21__[\"default\"])(prefixCls, mergedMode, renderExtraFooter);\n rangesNode = Object(_utils_getRanges__WEBPACK_IMPORTED_MODULE_22__[\"default\"])({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue),\n locale: locale,\n showNow: showNow,\n onNow: needConfirmButton && onNow,\n onOk: function onOk() {\n if (mergedValue) {\n triggerSelect(mergedValue, 'submit', true);\n\n if (_onOk) {\n _onOk(mergedValue);\n }\n }\n }\n });\n }\n\n var todayNode;\n\n if (showToday && mergedMode === 'date' && picker === 'date' && !showTime) {\n var now = generateConfig.getNow();\n var todayCls = \"\".concat(prefixCls, \"-today-btn\");\n var disabled = disabledDate && disabledDate(now);\n todayNode = react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"a\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_5___default()(todayCls, disabled && \"\".concat(todayCls, \"-disabled\")),\n \"aria-disabled\": disabled,\n onClick: function onClick() {\n if (!disabled) {\n triggerSelect(now, 'mouse', true);\n }\n }\n }, locale.today);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](_PanelContext__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Provider, {\n value: Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({}, panelContext), {}, {\n hideHeader: 'hideHeader' in props ? hideHeader : panelContext.hideHeader,\n hidePrevBtn: inRange && panelPosition === 'right',\n hideNextBtn: inRange && panelPosition === 'left'\n })\n }, react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"div\", {\n tabIndex: tabIndex,\n className: classnames__WEBPACK_IMPORTED_MODULE_5___default()(\"\".concat(prefixCls, \"-panel\"), className, (_classNames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames, \"\".concat(prefixCls, \"-panel-has-range\"), rangedValue && rangedValue[0] && rangedValue[1]), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames, \"\".concat(prefixCls, \"-panel-has-range-hover\"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames, \"\".concat(prefixCls, \"-panel-rtl\"), direction === 'rtl'), _classNames)),\n style: style,\n onKeyDown: onInternalKeyDown,\n onBlur: onInternalBlur,\n onMouseDown: onMouseDown,\n ref: panelDivRef\n }, panelNode, extraFooter || rangesNode || todayNode ? react__WEBPACK_IMPORTED_MODULE_4__[\"createElement\"](\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraFooter, rangesNode, todayNode) : null));\n}", "title": "" }, { "docid": "4a1b18cbe2ebfa457ebd4e7bc262447e", "score": "0.5500207", "text": "function PickerPanel(props) {\n var _classNames;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n className = props.className,\n style = props.style,\n locale = props.locale,\n generateConfig = props.generateConfig,\n value = props.value,\n defaultValue = props.defaultValue,\n pickerValue = props.pickerValue,\n defaultPickerValue = props.defaultPickerValue,\n disabledDate = props.disabledDate,\n mode = props.mode,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n showNow = props.showNow,\n showTime = props.showTime,\n showToday = props.showToday,\n renderExtraFooter = props.renderExtraFooter,\n hideHeader = props.hideHeader,\n onSelect = props.onSelect,\n onChange = props.onChange,\n onPanelChange = props.onPanelChange,\n onMouseDown = props.onMouseDown,\n onPickerValueChange = props.onPickerValueChange,\n _onOk = props.onOk,\n components = props.components,\n direction = props.direction,\n _props$hourStep = props.hourStep,\n hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep,\n _props$minuteStep = props.minuteStep,\n minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep,\n _props$secondStep = props.secondStep,\n secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep;\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time';\n var isHourStepValid = 24 % hourStep === 0;\n var isMinuteStepValid = 60 % minuteStep === 0;\n var isSecondStepValid = 60 % secondStep === 0;\n\n if (true) {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(!value || generateConfig.isValidate(value), 'Invalidate date pass to `value`.');\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(!value || generateConfig.isValidate(value), 'Invalidate date pass to `defaultValue`.');\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(isHourStepValid, \"`hourStep` \".concat(hourStep, \" is invalid. It should be a factor of 24.\"));\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(isMinuteStepValid, \"`minuteStep` \".concat(minuteStep, \" is invalid. It should be a factor of 60.\"));\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(isSecondStepValid, \"`secondStep` \".concat(secondStep, \" is invalid. It should be a factor of 60.\"));\n } // ============================ State =============================\n\n\n var panelContext = react__WEBPACK_IMPORTED_MODULE_5__[\"useContext\"](_PanelContext__WEBPACK_IMPORTED_MODULE_19__[\"default\"]);\n var operationRef = panelContext.operationRef,\n panelDivRef = panelContext.panelRef,\n onContextSelect = panelContext.onSelect,\n hideRanges = panelContext.hideRanges,\n defaultOpenValue = panelContext.defaultOpenValue;\n\n var _React$useContext = react__WEBPACK_IMPORTED_MODULE_5__[\"useContext\"](_RangeContext__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n inRange = _React$useContext.inRange,\n panelPosition = _React$useContext.panelPosition,\n rangedValue = _React$useContext.rangedValue,\n hoverRangedValue = _React$useContext.hoverRangedValue;\n\n var panelRef = react__WEBPACK_IMPORTED_MODULE_5__[\"useRef\"]({}); // Handle init logic\n\n var initRef = react__WEBPACK_IMPORTED_MODULE_5__[\"useRef\"](true); // Value\n\n var _useMergedState = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(null, {\n value: value,\n defaultValue: defaultValue,\n postState: function postState(val) {\n if (!val && defaultOpenValue && picker === 'time') {\n return defaultOpenValue;\n }\n\n return val;\n }\n }),\n _useMergedState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // View date control\n\n\n var _useMergedState3 = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(null, {\n value: pickerValue,\n defaultValue: defaultPickerValue || mergedValue,\n postState: function postState(date) {\n var now = generateConfig.getNow();\n if (!date) return now; // When value is null and set showTime\n\n if (!mergedValue && showTime) {\n if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(showTime) === 'object') {\n return Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__[\"setDateTime\"])(generateConfig, date, showTime.defaultValue || now);\n }\n\n if (defaultValue) {\n return Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__[\"setDateTime\"])(generateConfig, date, defaultValue);\n }\n\n return Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__[\"setDateTime\"])(generateConfig, date, now);\n }\n\n return date;\n }\n }),\n _useMergedState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_useMergedState3, 2),\n viewDate = _useMergedState4[0],\n setInnerViewDate = _useMergedState4[1];\n\n var setViewDate = function setViewDate(date) {\n setInnerViewDate(date);\n\n if (onPickerValueChange) {\n onPickerValueChange(date);\n }\n }; // Panel control\n\n\n var getInternalNextMode = function getInternalNextMode(nextMode) {\n var getNextMode = _utils_uiUtil__WEBPACK_IMPORTED_MODULE_20__[\"PickerModeMap\"][picker];\n\n if (getNextMode) {\n return getNextMode(nextMode);\n }\n\n return nextMode;\n }; // Save panel is changed from which panel\n\n\n var _useMergedState5 = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(function () {\n if (picker === 'time') {\n return 'time';\n }\n\n return getInternalNextMode('date');\n }, {\n value: mode\n }),\n _useMergedState6 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_useMergedState5, 2),\n mergedMode = _useMergedState6[0],\n setInnerMode = _useMergedState6[1];\n\n react__WEBPACK_IMPORTED_MODULE_5__[\"useEffect\"](function () {\n setInnerMode(picker);\n }, [picker]);\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_5__[\"useState\"](function () {\n return mergedMode;\n }),\n _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_React$useState, 2),\n sourceMode = _React$useState2[0],\n setSourceMode = _React$useState2[1];\n\n var onInternalPanelChange = function onInternalPanelChange(newMode, viewValue) {\n var nextMode = getInternalNextMode(newMode || mergedMode);\n setSourceMode(mergedMode);\n setInnerMode(nextMode);\n\n if (onPanelChange && (mergedMode !== nextMode || Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_18__[\"isEqual\"])(generateConfig, viewDate, viewDate))) {\n onPanelChange(viewValue, nextMode);\n }\n };\n\n var triggerSelect = function triggerSelect(date, type) {\n var forceTriggerSelect = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (mergedMode === picker || forceTriggerSelect) {\n setInnerValue(date);\n\n if (onSelect) {\n onSelect(date);\n }\n\n if (onContextSelect) {\n onContextSelect(date, type);\n }\n\n if (onChange && !Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_18__[\"isEqual\"])(generateConfig, date, mergedValue) && !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date))) {\n onChange(date);\n }\n }\n }; // ========================= Interactive ==========================\n\n\n var onInternalKeyDown = function onInternalKeyDown(e) {\n if (panelRef.current && panelRef.current.onKeyDown) {\n if ([rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].LEFT, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].RIGHT, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].UP, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].DOWN, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].PAGE_UP, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].PAGE_DOWN, rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ENTER].includes(e.which)) {\n e.preventDefault();\n }\n\n return panelRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(false, 'Panel not correct handle keyDown event. Please help to fire issue about this.');\n return false;\n }\n /* eslint-enable no-lone-blocks */\n };\n\n var onInternalBlur = function onInternalBlur(e) {\n if (panelRef.current && panelRef.current.onBlur) {\n panelRef.current.onBlur(e);\n }\n };\n\n if (operationRef && panelPosition !== 'right') {\n operationRef.current = {\n onKeyDown: onInternalKeyDown,\n onClose: function onClose() {\n if (panelRef.current && panelRef.current.onClose) {\n panelRef.current.onClose();\n }\n }\n };\n } // ============================ Effect ============================\n\n\n react__WEBPACK_IMPORTED_MODULE_5__[\"useEffect\"](function () {\n if (value && !initRef.current) {\n setInnerViewDate(value);\n }\n }, [value]);\n react__WEBPACK_IMPORTED_MODULE_5__[\"useEffect\"](function () {\n initRef.current = false;\n }, []); // ============================ Panels ============================\n\n var panelNode;\n\n var pickerProps = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({}, props), {}, {\n operationRef: panelRef,\n prefixCls: prefixCls,\n viewDate: viewDate,\n value: mergedValue,\n onViewDateChange: setViewDate,\n sourceMode: sourceMode,\n onPanelChange: onInternalPanelChange,\n disabledDate: disabledDate\n });\n\n delete pickerProps.onChange;\n delete pickerProps.onSelect;\n\n switch (mergedMode) {\n case 'decade':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_DecadePanel__WEBPACK_IMPORTED_MODULE_17__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'year':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_YearPanel__WEBPACK_IMPORTED_MODULE_16__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'month':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_MonthPanel__WEBPACK_IMPORTED_MODULE_14__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'quarter':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_QuarterPanel__WEBPACK_IMPORTED_MODULE_15__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'week':\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_WeekPanel__WEBPACK_IMPORTED_MODULE_13__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n case 'time':\n delete pickerProps.showTime;\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_TimePanel__WEBPACK_IMPORTED_MODULE_10__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(showTime) === 'object' ? showTime : null, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n break;\n\n default:\n if (showTime) {\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_DatetimePanel__WEBPACK_IMPORTED_MODULE_11__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n } else {\n panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_panels_DatePanel__WEBPACK_IMPORTED_MODULE_12__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, pickerProps, {\n onSelect: function onSelect(date, type) {\n setViewDate(date);\n triggerSelect(date, type);\n }\n }));\n }\n\n } // ============================ Footer ============================\n\n\n var extraFooter;\n var rangesNode;\n\n var onNow = function onNow() {\n var now = generateConfig.getNow();\n var lowerBoundTime = Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__[\"getLowerBoundTime\"])(generateConfig.getHour(now), generateConfig.getMinute(now), generateConfig.getSecond(now), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1);\n var adjustedNow = Object(_utils_timeUtil__WEBPACK_IMPORTED_MODULE_24__[\"setTime\"])(generateConfig, now, lowerBoundTime[0], // hour\n lowerBoundTime[1], // minute\n lowerBoundTime[2]);\n triggerSelect(adjustedNow, 'submit');\n };\n\n if (!hideRanges) {\n extraFooter = Object(_utils_getExtraFooter__WEBPACK_IMPORTED_MODULE_22__[\"default\"])(prefixCls, mergedMode, renderExtraFooter);\n rangesNode = Object(_utils_getRanges__WEBPACK_IMPORTED_MODULE_23__[\"default\"])({\n prefixCls: prefixCls,\n components: components,\n needConfirmButton: needConfirmButton,\n okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue),\n locale: locale,\n showNow: showNow,\n onNow: needConfirmButton && onNow,\n onOk: function onOk() {\n if (mergedValue) {\n triggerSelect(mergedValue, 'submit', true);\n\n if (_onOk) {\n _onOk(mergedValue);\n }\n }\n }\n });\n }\n\n var todayNode;\n\n if (showToday && mergedMode === 'date' && picker === 'date' && !showTime) {\n var now = generateConfig.getNow();\n var todayCls = \"\".concat(prefixCls, \"-today-btn\");\n var disabled = disabledDate && disabledDate(now);\n todayNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](\"a\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(todayCls, disabled && \"\".concat(todayCls, \"-disabled\")),\n \"aria-disabled\": disabled,\n onClick: function onClick() {\n if (!disabled) {\n triggerSelect(now, 'mouse', true);\n }\n }\n }, locale.today);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](_PanelContext__WEBPACK_IMPORTED_MODULE_19__[\"default\"].Provider, {\n value: Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({}, panelContext), {}, {\n mode: mergedMode,\n hideHeader: 'hideHeader' in props ? hideHeader : panelContext.hideHeader,\n hidePrevBtn: inRange && panelPosition === 'right',\n hideNextBtn: inRange && panelPosition === 'left'\n })\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](\"div\", {\n tabIndex: tabIndex,\n className: classnames__WEBPACK_IMPORTED_MODULE_6___default()(\"\".concat(prefixCls, \"-panel\"), className, (_classNames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames, \"\".concat(prefixCls, \"-panel-has-range\"), rangedValue && rangedValue[0] && rangedValue[1]), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames, \"\".concat(prefixCls, \"-panel-has-range-hover\"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_classNames, \"\".concat(prefixCls, \"-panel-rtl\"), direction === 'rtl'), _classNames)),\n style: style,\n onKeyDown: onInternalKeyDown,\n onBlur: onInternalBlur,\n onMouseDown: onMouseDown,\n ref: panelDivRef\n }, panelNode, extraFooter || rangesNode || todayNode ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5__[\"createElement\"](\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, extraFooter, rangesNode, todayNode) : null));\n}", "title": "" }, { "docid": "efd017e5e2ec0d67d93ce5bd6b59b498", "score": "0.54920125", "text": "function dialogCouponUserPicker() {\n var args = {\n dialogClass : 'wpdk-dialog-jquery-ui',\n modal : true,\n resizable : true,\n draggable : true,\n closeText : wpSmartShopJavascriptLocalization.closeText,\n title : wpSmartShopJavascriptLocalization.userPickerTitle,\n open : dialogCouponUserPickerDidOpen,\n width : 640,\n height : 440,\n minWidth : 500,\n minHeight : 460,\n buttons : [\n {\n text : wpSmartShopJavascriptLocalization.Cancel,\n click : function () {\n $( this ).dialog( \"close\" );\n }\n }\n ]\n };\n if ( $( '#wpss-dialog-userpicker' ).parent( 'div.wpdk-jquery-ui .ui-dialog' ).length ) {\n $( '#wpss-dialog-userpicker' ).dialog( args );\n\n } else {\n $( '#wpss-dialog-userpicker' ).dialog( args ).parent( \".ui-dialog\" ).wrap( \"<div class='wpdk-jquery-ui'></div>\" );\n\n }\n }", "title": "" }, { "docid": "a0668c949d72dc07004c7d4895ad0912", "score": "0.5487643", "text": "showPicker(focusPicker) {\n const me = this,\n picker = me.picker;\n picker.initialValue = me.value;\n picker.format = me.format;\n picker.maxTime = me.max;\n picker.minTime = me.min; // Show valid time from picker while editor has undefined value\n\n me.value = picker.value;\n super.showPicker(focusPicker);\n }", "title": "" }, { "docid": "7d4307329a61a693ff673ae007ff67f7", "score": "0.54790103", "text": "function togglePicker() {\n if ($picker.hasClass('hidden')) {\n $picker.removeClass('hidden');\n $add.hide();\n } else {\n $picker.addClass('hidden');\n $add.show();\n }\n }", "title": "" }, { "docid": "3527d1bcede262445369cc6dc465fcdd", "score": "0.54505634", "text": "function InnerPicker(props) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n tabIndex = props.tabIndex,\n style = props.style,\n className = props.className,\n dropdownClassName = props.dropdownClassName,\n dropdownAlign = props.dropdownAlign,\n popupStyle = props.popupStyle,\n transitionName = props.transitionName,\n generateConfig = props.generateConfig,\n locale = props.locale,\n inputReadOnly = props.inputReadOnly,\n allowClear = props.allowClear,\n autoFocus = props.autoFocus,\n showTime = props.showTime,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n format = props.format,\n use12Hours = props.use12Hours,\n value = props.value,\n defaultValue = props.defaultValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n defaultOpenValue = props.defaultOpenValue,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n disabled = props.disabled,\n disabledDate = props.disabledDate,\n placeholder = props.placeholder,\n getPopupContainer = props.getPopupContainer,\n pickerRef = props.pickerRef,\n panelRender = props.panelRender,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onContextMenu = props.onContextMenu,\n onClick = props.onClick,\n _onKeyDown = props.onKeyDown,\n _onSelect = props.onSelect,\n direction = props.direction,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete;\n var inputRef = react__WEBPACK_IMPORTED_MODULE_8__[\"useRef\"](null);\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time'; // ============================= State =============================\n\n var formatList = Object(_utils_miscUtil__WEBPACK_IMPORTED_MODULE_15__[\"toArray\"])(Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__[\"getDefaultFormat\"])(format, picker, showTime, use12Hours)); // Panel ref\n\n var panelDivRef = react__WEBPACK_IMPORTED_MODULE_8__[\"useRef\"](null);\n var inputDivRef = react__WEBPACK_IMPORTED_MODULE_8__[\"useRef\"](null); // Real value\n\n var _useMergedState = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_11__[\"default\"])(null, {\n value: value,\n defaultValue: defaultValue\n }),\n _useMergedState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // Selected value\n\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_8__[\"useState\"](mergedValue),\n _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_React$useState, 2),\n selectedValue = _React$useState2[0],\n setSelectedValue = _React$useState2[1]; // Operation ref\n\n\n var operationRef = react__WEBPACK_IMPORTED_MODULE_8__[\"useRef\"](null); // Open\n\n var _useMergedState3 = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_11__[\"default\"])(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return disabled ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n triggerInnerOpen = _useMergedState4[1]; // ============================= Text ==============================\n\n\n var _useValueTexts = Object(_hooks_useValueTexts__WEBPACK_IMPORTED_MODULE_20__[\"default\"])(selectedValue, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_useValueTexts, 2),\n valueTexts = _useValueTexts2[0],\n firstValueText = _useValueTexts2[1];\n\n var _useTextValueMapping = Object(_hooks_useTextValueMapping__WEBPACK_IMPORTED_MODULE_19__[\"default\"])({\n valueTexts: valueTexts,\n onTextChange: function onTextChange(newText) {\n var inputDate = Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__[\"parseValue\"])(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n\n if (inputDate && (!disabledDate || !disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n }),\n _useTextValueMapping2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_useTextValueMapping, 3),\n text = _useTextValueMapping2[0],\n triggerTextChange = _useTextValueMapping2[1],\n resetText = _useTextValueMapping2[2]; // ============================ Trigger ============================\n\n\n var triggerChange = function triggerChange(newValue) {\n setSelectedValue(newValue);\n setInnerValue(newValue);\n\n if (onChange && !Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__[\"isEqual\"])(generateConfig, mergedValue, newValue)) {\n onChange(newValue, newValue ? Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__[\"formatValue\"])(newValue, {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '');\n }\n };\n\n var triggerOpen = function triggerOpen(newOpen) {\n if (disabled && newOpen) {\n return;\n }\n\n triggerInnerOpen(newOpen);\n };\n\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n\n var onInternalMouseUp = function onInternalMouseUp() {\n if (onMouseUp) {\n onMouseUp.apply(void 0, arguments);\n }\n\n if (inputRef.current) {\n inputRef.current.focus();\n triggerOpen(true);\n }\n }; // ============================= Input =============================\n\n\n var _usePickerInput = Object(_hooks_usePickerInput__WEBPACK_IMPORTED_MODULE_18__[\"default\"])({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen: triggerOpen,\n forwardKeyDown: forwardKeyDown,\n isClickOutside: function isClickOutside(target) {\n return !Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__[\"elementsContains\"])([panelDivRef.current, inputDivRef.current], target);\n },\n onSubmit: function onSubmit() {\n if (disabledDate && disabledDate(selectedValue)) {\n return false;\n }\n\n triggerChange(selectedValue);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: function onCancel() {\n triggerOpen(false);\n setSelectedValue(mergedValue);\n resetText();\n },\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }),\n _usePickerInput2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_usePickerInput, 2),\n inputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n focused = _usePickerInput2$.focused,\n typing = _usePickerInput2$.typing; // ============================= Sync ==============================\n // Close should sync back with text value\n\n\n react__WEBPACK_IMPORTED_MODULE_8__[\"useEffect\"](function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n\n if (!valueTexts.length || valueTexts[0] === '') {\n triggerTextChange('');\n } else if (firstValueText !== text) {\n resetText();\n }\n }\n }, [mergedOpen, valueTexts]); // Change picker should sync back with text value\n\n react__WEBPACK_IMPORTED_MODULE_8__[\"useEffect\"](function () {\n if (!mergedOpen) {\n resetText();\n }\n }, [picker]); // Sync innerValue with control mode\n\n react__WEBPACK_IMPORTED_MODULE_8__[\"useEffect\"](function () {\n // Sync select value\n setSelectedValue(mergedValue);\n }, [mergedValue]); // ============================ Private ============================\n\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n blur: function blur() {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n }\n };\n }\n\n var _useHoverValue = Object(_hooks_useHoverValue__WEBPACK_IMPORTED_MODULE_21__[\"default\"])(text, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(_useHoverValue, 3),\n hoverValue = _useHoverValue2[0],\n onEnter = _useHoverValue2[1],\n onLeave = _useHoverValue2[2]; // ============================= Panel =============================\n\n\n var panelProps = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[\"default\"])({}, props), {}, {\n className: undefined,\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined,\n onChange: null\n });\n\n var panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_PickerPanel__WEBPACK_IMPORTED_MODULE_12__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({}, panelProps, {\n generateConfig: generateConfig,\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({}, \"\".concat(prefixCls, \"-panel-focused\"), !typing)),\n value: selectedValue,\n locale: locale,\n tabIndex: -1,\n onSelect: function onSelect(date) {\n _onSelect === null || _onSelect === void 0 ? void 0 : _onSelect(date);\n setSelectedValue(date);\n },\n direction: direction,\n onPanelChange: function onPanelChange(viewDate, mode) {\n var onPanelChange = props.onPanelChange;\n onLeave(true);\n onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, mode);\n }\n }));\n\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n\n var panel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, panelNode);\n var suffixNode;\n\n if (suffixIcon) {\n suffixNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n\n var clearNode;\n\n if (allowClear && mergedValue && !disabled) {\n clearNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n className: \"\".concat(prefixCls, \"-clear\")\n }, clearIcon || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n } // ============================ Warning ============================\n\n\n if (true) {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n } // ============================ Return =============================\n\n\n var onContextSelect = function onContextSelect(date, type) {\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n\n var popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_PanelContext__WEBPACK_IMPORTED_MODULE_16__[\"default\"].Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n panelRef: panelDivRef,\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: defaultOpenValue,\n onDateMouseEnter: onEnter,\n onDateMouseLeave: onLeave\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_PickerTrigger__WEBPACK_IMPORTED_MODULE_13__[\"default\"], {\n visible: mergedOpen,\n popupElement: panel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n popupPlacement: popupPlacement,\n direction: direction\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(prefixCls, className, (_classNames2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-focused\"), focused), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onMouseDown: onMouseDown,\n onMouseUp: onInternalMouseUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onContextMenu: onContextMenu,\n onClick: onClick\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(\"\".concat(prefixCls, \"-input\"), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({}, \"\".concat(prefixCls, \"-input-placeholder\"), !!hoverValue)),\n ref: inputDivRef\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"input\", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({\n id: id,\n tabIndex: tabIndex,\n disabled: disabled,\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !typing,\n value: hoverValue || text,\n onChange: function onChange(e) {\n triggerTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: placeholder,\n ref: inputRef,\n title: text\n }, inputProps, {\n size: Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__[\"getInputSize\"])(picker, formatList[0], generateConfig)\n }, Object(_utils_miscUtil__WEBPACK_IMPORTED_MODULE_15__[\"default\"])(props), {\n autoComplete: autoComplete\n })), suffixNode, clearNode))));\n} // Wrap with class component to enable pass generic with instance method", "title": "" }, { "docid": "7705805d21f5891d4705bac171590529", "score": "0.543938", "text": "function PeoplePickerDesignManager() {\n var searchString = '';\n var dialogOptions = 'resizable:yes; status:no; scroll:no; help:no; center:yes; dialogWidth :575px; dialogHeight :500px;';\n var dialogURL = '/_layouts/picker.aspx';\n dialogURL += '?MultiSelect=False';\n dialogURL += '&CustomProperty=User,SecGroup,SPGroup;;15;;;False';\n dialogURL += '&EntitySeparator=;';\n dialogURL += '&DialogTitle=Select People and Groups';\n dialogURL += '&DialogImage=/_layouts/images/ppeople.gif';\n dialogURL += '&PickerDialogType=Microsoft.SharePoint.WebControls.PeoplePickerDialog, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c';\n dialogURL += '&DefaultSearch=' + escapeProperly(searchString);\n\n //commonShowModalDialog(dialogURL, dialogOptions, DelegatePeoplePickerDMCallback);\n\tShowPeoplePicker('Select People and Groups',dialogURL,DelegatePeoplePickerDMCallback);\n}", "title": "" }, { "docid": "6ba5796e73aa600d31a2f9cc8a2554c0", "score": "0.5437536", "text": "function InnerPicker(props) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n tabIndex = props.tabIndex,\n style = props.style,\n className = props.className,\n dropdownClassName = props.dropdownClassName,\n dropdownAlign = props.dropdownAlign,\n popupStyle = props.popupStyle,\n transitionName = props.transitionName,\n generateConfig = props.generateConfig,\n locale = props.locale,\n inputReadOnly = props.inputReadOnly,\n allowClear = props.allowClear,\n autoFocus = props.autoFocus,\n showTime = props.showTime,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n format = props.format,\n use12Hours = props.use12Hours,\n value = props.value,\n defaultValue = props.defaultValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n defaultOpenValue = props.defaultOpenValue,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n disabled = props.disabled,\n disabledDate = props.disabledDate,\n placeholder = props.placeholder,\n getPopupContainer = props.getPopupContainer,\n pickerRef = props.pickerRef,\n panelRender = props.panelRender,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onContextMenu = props.onContextMenu,\n onClick = props.onClick,\n _onKeyDown = props.onKeyDown,\n _onSelect = props.onSelect,\n direction = props.direction,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete;\n var inputRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null);\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time'; // ============================= State =============================\n\n var formatList = (0,_utils_miscUtil__WEBPACK_IMPORTED_MODULE_15__.toArray)((0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__.getDefaultFormat)(format, picker, showTime, use12Hours)); // Panel ref\n\n var panelDivRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null);\n var inputDivRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null); // Real value\n\n var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_11__.default)(null, {\n value: value,\n defaultValue: defaultValue\n }),\n _useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // Selected value\n\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_8__.useState(mergedValue),\n _React$useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_React$useState, 2),\n selectedValue = _React$useState2[0],\n setSelectedValue = _React$useState2[1]; // Operation ref\n\n\n var operationRef = react__WEBPACK_IMPORTED_MODULE_8__.useRef(null); // Open\n\n var _useMergedState3 = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_11__.default)(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return disabled ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n triggerInnerOpen = _useMergedState4[1]; // ============================= Text ==============================\n\n\n var _useValueTexts = (0,_hooks_useValueTexts__WEBPACK_IMPORTED_MODULE_20__.default)(selectedValue, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useValueTexts, 2),\n valueTexts = _useValueTexts2[0],\n firstValueText = _useValueTexts2[1];\n\n var _useTextValueMapping = (0,_hooks_useTextValueMapping__WEBPACK_IMPORTED_MODULE_19__.default)({\n valueTexts: valueTexts,\n onTextChange: function onTextChange(newText) {\n var inputDate = (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__.parseValue)(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n\n if (inputDate && (!disabledDate || !disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n }),\n _useTextValueMapping2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useTextValueMapping, 3),\n text = _useTextValueMapping2[0],\n triggerTextChange = _useTextValueMapping2[1],\n resetText = _useTextValueMapping2[2]; // ============================ Trigger ============================\n\n\n var triggerChange = function triggerChange(newValue) {\n setSelectedValue(newValue);\n setInnerValue(newValue);\n\n if (onChange && !(0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__.isEqual)(generateConfig, mergedValue, newValue)) {\n onChange(newValue, newValue ? (0,_utils_dateUtil__WEBPACK_IMPORTED_MODULE_14__.formatValue)(newValue, {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '');\n }\n };\n\n var triggerOpen = function triggerOpen(newOpen) {\n if (disabled && newOpen) {\n return;\n }\n\n triggerInnerOpen(newOpen);\n };\n\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_10__.default)(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n\n var onInternalMouseUp = function onInternalMouseUp() {\n if (onMouseUp) {\n onMouseUp.apply(void 0, arguments);\n }\n\n if (inputRef.current) {\n inputRef.current.focus();\n triggerOpen(true);\n }\n }; // ============================= Input =============================\n\n\n var _usePickerInput = (0,_hooks_usePickerInput__WEBPACK_IMPORTED_MODULE_18__.default)({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen: triggerOpen,\n forwardKeyDown: forwardKeyDown,\n isClickOutside: function isClickOutside(target) {\n return !(0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__.elementsContains)([panelDivRef.current, inputDivRef.current], target);\n },\n onSubmit: function onSubmit() {\n if (disabledDate && disabledDate(selectedValue)) {\n return false;\n }\n\n triggerChange(selectedValue);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: function onCancel() {\n triggerOpen(false);\n setSelectedValue(mergedValue);\n resetText();\n },\n onKeyDown: function onKeyDown(e, preventDefault) {\n _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }),\n _usePickerInput2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_usePickerInput, 2),\n inputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n focused = _usePickerInput2$.focused,\n typing = _usePickerInput2$.typing; // ============================= Sync ==============================\n // Close should sync back with text value\n\n\n react__WEBPACK_IMPORTED_MODULE_8__.useEffect(function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n\n if (!valueTexts.length || valueTexts[0] === '') {\n triggerTextChange('');\n } else if (firstValueText !== text) {\n resetText();\n }\n }\n }, [mergedOpen, valueTexts]); // Change picker should sync back with text value\n\n react__WEBPACK_IMPORTED_MODULE_8__.useEffect(function () {\n if (!mergedOpen) {\n resetText();\n }\n }, [picker]); // Sync innerValue with control mode\n\n react__WEBPACK_IMPORTED_MODULE_8__.useEffect(function () {\n // Sync select value\n setSelectedValue(mergedValue);\n }, [mergedValue]); // ============================ Private ============================\n\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n blur: function blur() {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n }\n };\n }\n\n var _useHoverValue = (0,_hooks_useHoverValue__WEBPACK_IMPORTED_MODULE_21__.default)(text, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_7__.default)(_useHoverValue, 3),\n hoverValue = _useHoverValue2[0],\n onEnter = _useHoverValue2[1],\n onLeave = _useHoverValue2[2]; // ============================= Panel =============================\n\n\n var panelProps = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__.default)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__.default)({}, props), {}, {\n className: undefined,\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined,\n onChange: null\n });\n\n var panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(_PickerPanel__WEBPACK_IMPORTED_MODULE_12__.default, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__.default)({}, panelProps, {\n generateConfig: generateConfig,\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()((0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)({}, \"\".concat(prefixCls, \"-panel-focused\"), !typing)),\n value: selectedValue,\n locale: locale,\n tabIndex: -1,\n onSelect: function onSelect(date) {\n _onSelect === null || _onSelect === void 0 ? void 0 : _onSelect(date);\n setSelectedValue(date);\n },\n direction: direction,\n onPanelChange: function onPanelChange(viewDate, mode) {\n var onPanelChange = props.onPanelChange;\n onLeave(true);\n onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, mode);\n }\n }));\n\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n\n var panel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, panelNode);\n var suffixNode;\n\n if (suffixIcon) {\n suffixNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n\n var clearNode;\n\n if (allowClear && mergedValue && !disabled) {\n clearNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n className: \"\".concat(prefixCls, \"-clear\")\n }, clearIcon || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n } // ============================ Warning ============================\n\n\n if (true) {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_10__.default)(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n } // ============================ Return =============================\n\n\n var onContextSelect = function onContextSelect(date, type) {\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n\n var popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(_PanelContext__WEBPACK_IMPORTED_MODULE_16__.default.Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n panelRef: panelDivRef,\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: defaultOpenValue,\n onDateMouseEnter: onEnter,\n onDateMouseLeave: onLeave\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(_PickerTrigger__WEBPACK_IMPORTED_MODULE_13__.default, {\n visible: mergedOpen,\n popupElement: panel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n popupPlacement: popupPlacement,\n direction: direction\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(prefixCls, className, (_classNames2 = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)(_classNames2, \"\".concat(prefixCls, \"-focused\"), focused), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onMouseDown: onMouseDown,\n onMouseUp: onInternalMouseUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onContextMenu: onContextMenu,\n onClick: onClick\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(\"\".concat(prefixCls, \"-input\"), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__.default)({}, \"\".concat(prefixCls, \"-input-placeholder\"), !!hoverValue)),\n ref: inputDivRef\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(\"input\", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__.default)({\n id: id,\n tabIndex: tabIndex,\n disabled: disabled,\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !typing,\n value: hoverValue || text,\n onChange: function onChange(e) {\n triggerTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: placeholder,\n ref: inputRef,\n title: text\n }, inputProps, {\n size: (0,_utils_uiUtil__WEBPACK_IMPORTED_MODULE_17__.getInputSize)(picker, formatList[0], generateConfig)\n }, (0,_utils_miscUtil__WEBPACK_IMPORTED_MODULE_15__.default)(props), {\n autoComplete: autoComplete\n })), suffixNode, clearNode))));\n} // Wrap with class component to enable pass generic with instance method", "title": "" }, { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.540682", "text": "function Datepicker() {}", "title": "" }, { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.540682", "text": "function Datepicker() {}", "title": "" }, { "docid": "a531fbb43e67659c29e662a9eb41a3b1", "score": "0.5400409", "text": "function PeoplePickerProjectManager() {\n var searchString = '';\n var dialogOptions = 'resizable:yes; status:no; scroll:no; help:no; center:yes; dialogWidth :575px; dialogHeight :500px;';\n var dialogURL = '/_layouts/picker.aspx';\n dialogURL += '?MultiSelect=False';\n dialogURL += '&CustomProperty=User,SecGroup,SPGroup;;15;;;False';\n dialogURL += '&EntitySeparator=;';\n dialogURL += '&DialogTitle=Select People and Groups';\n dialogURL += '&DialogImage=/_layouts/images/ppeople.gif';\n dialogURL += '&PickerDialogType=Microsoft.SharePoint.WebControls.PeoplePickerDialog, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c';\n dialogURL += '&DefaultSearch=' + escapeProperly(searchString);\n\n //commonShowModalDialog(dialogURL, dialogOptions, DelegatePeoplePickerPMCallback);\n\tShowPeoplePicker('Select People and Groups',dialogURL,DelegatePeoplePickerPMCallback);\n}", "title": "" }, { "docid": "be82d08ce240111fd4fb66229d9b47e4", "score": "0.53914046", "text": "function open(dialog) {\n\t\n}", "title": "" }, { "docid": "1381a58aed5adf25fe59d81d35726dd6", "score": "0.53770655", "text": "function dialogCouponProductTypePicker() {\n var args = {\n dialogClass : 'wpdk-dialog-jquery-ui',\n modal : true,\n resizable : true,\n draggable : true,\n closeText : wpSmartShopJavascriptLocalization.closeText,\n title : wpSmartShopJavascriptLocalization.productTypesPickerTitle,\n open : dialogCouponProductTypePickerDidOpen,\n width : 640,\n height : 440,\n minWidth : 500,\n minHeight : 460,\n buttons : [\n {\n text : wpSmartShopJavascriptLocalization.Cancel,\n click : function () {\n $( this ).dialog( \"close\" );\n }\n }\n ]\n };\n if ( $( '#wpss-dialog-coupon-product-picker' ).parents( 'div.wpdk-jquery-ui .ui-dialog' ).length ) {\n $( '#wpss-dialog-coupon-product-picker' ).dialog( args );\n } else {\n $( '#wpss-dialog-coupon-product-picker' ).dialog( args ).parent( \".ui-dialog\" ).wrap( \"<div class='wpdk-jquery-ui'></div>\" );\n }\n\n }", "title": "" }, { "docid": "64730617deb201ce2c8ec68a5647541a", "score": "0.537559", "text": "showPicker(focusPicker) {\n this.picker.value = this.picker.activeDate = this.value;\n super.showPicker(focusPicker);\n }", "title": "" }, { "docid": "6cefe290c54c0c3f12b4858c0b144a13", "score": "0.5373523", "text": "async function loadPicker() {\n\tconsole.log(window.location.host + \"== replit.com: \" + (window.location.host == \"replit.com\"));\n\tif (window.location.host != \"replit.com\") {\n\t\tgapi.load('auth', {'callback': onAuthApiLoad});\n\t\tgapi.load('picker', {'callback': onPickerApiLoad});\n\t}\n}", "title": "" }, { "docid": "e43f85138c070a3701078fef86f6e17e", "score": "0.5365914", "text": "function MailingPicker(){}", "title": "" }, { "docid": "d6e4263ef2f0d58208b8ef4339812f19", "score": "0.53630894", "text": "function InnerPicker(props) {\n var _classNames2;\n\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,\n id = props.id,\n tabIndex = props.tabIndex,\n style = props.style,\n className = props.className,\n dropdownClassName = props.dropdownClassName,\n dropdownAlign = props.dropdownAlign,\n popupStyle = props.popupStyle,\n transitionName = props.transitionName,\n generateConfig = props.generateConfig,\n locale = props.locale,\n inputReadOnly = props.inputReadOnly,\n allowClear = props.allowClear,\n autoFocus = props.autoFocus,\n showTime = props.showTime,\n _props$picker = props.picker,\n picker = _props$picker === void 0 ? 'date' : _props$picker,\n format = props.format,\n use12Hours = props.use12Hours,\n value = props.value,\n defaultValue = props.defaultValue,\n open = props.open,\n defaultOpen = props.defaultOpen,\n defaultOpenValue = props.defaultOpenValue,\n suffixIcon = props.suffixIcon,\n clearIcon = props.clearIcon,\n disabled = props.disabled,\n disabledDate = props.disabledDate,\n placeholder = props.placeholder,\n getPopupContainer = props.getPopupContainer,\n pickerRef = props.pickerRef,\n panelRender = props.panelRender,\n onChange = props.onChange,\n onOpenChange = props.onOpenChange,\n onFocus = props.onFocus,\n onBlur = props.onBlur,\n onMouseDown = props.onMouseDown,\n onMouseUp = props.onMouseUp,\n onMouseEnter = props.onMouseEnter,\n onMouseLeave = props.onMouseLeave,\n onContextMenu = props.onContextMenu,\n onClick = props.onClick,\n direction = props.direction,\n _props$autoComplete = props.autoComplete,\n autoComplete = _props$autoComplete === void 0 ? 'off' : _props$autoComplete;\n var inputRef = react__WEBPACK_IMPORTED_MODULE_7__[\"useRef\"](null);\n var needConfirmButton = picker === 'date' && !!showTime || picker === 'time'; // ============================= State =============================\n\n var formatList = Object(_utils_miscUtil__WEBPACK_IMPORTED_MODULE_14__[\"toArray\"])(Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_16__[\"getDefaultFormat\"])(format, picker, showTime, use12Hours)); // Panel ref\n\n var panelDivRef = react__WEBPACK_IMPORTED_MODULE_7__[\"useRef\"](null);\n var inputDivRef = react__WEBPACK_IMPORTED_MODULE_7__[\"useRef\"](null); // Real value\n\n var _useMergedState = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(null, {\n value: value,\n defaultValue: defaultValue\n }),\n _useMergedState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_useMergedState, 2),\n mergedValue = _useMergedState2[0],\n setInnerValue = _useMergedState2[1]; // Selected value\n\n\n var _React$useState = react__WEBPACK_IMPORTED_MODULE_7__[\"useState\"](mergedValue),\n _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_React$useState, 2),\n selectedValue = _React$useState2[0],\n setSelectedValue = _React$useState2[1]; // Operation ref\n\n\n var operationRef = react__WEBPACK_IMPORTED_MODULE_7__[\"useRef\"](null); // Open\n\n var _useMergedState3 = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(false, {\n value: open,\n defaultValue: defaultOpen,\n postState: function postState(postOpen) {\n return disabled ? false : postOpen;\n },\n onChange: function onChange(newOpen) {\n if (onOpenChange) {\n onOpenChange(newOpen);\n }\n\n if (!newOpen && operationRef.current && operationRef.current.onClose) {\n operationRef.current.onClose();\n }\n }\n }),\n _useMergedState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n triggerInnerOpen = _useMergedState4[1]; // ============================= Text ==============================\n\n\n var _useValueTexts = Object(_hooks_useValueTexts__WEBPACK_IMPORTED_MODULE_19__[\"default\"])(selectedValue, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useValueTexts2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_useValueTexts, 2),\n valueTexts = _useValueTexts2[0],\n firstValueText = _useValueTexts2[1];\n\n var _useTextValueMapping = Object(_hooks_useTextValueMapping__WEBPACK_IMPORTED_MODULE_18__[\"default\"])({\n valueTexts: valueTexts,\n onTextChange: function onTextChange(newText) {\n var inputDate = Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_13__[\"parseValue\"])(newText, {\n locale: locale,\n formatList: formatList,\n generateConfig: generateConfig\n });\n\n if (inputDate && (!disabledDate || !disabledDate(inputDate))) {\n setSelectedValue(inputDate);\n }\n }\n }),\n _useTextValueMapping2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_useTextValueMapping, 3),\n text = _useTextValueMapping2[0],\n triggerTextChange = _useTextValueMapping2[1],\n resetText = _useTextValueMapping2[2]; // ============================ Trigger ============================\n\n\n var triggerChange = function triggerChange(newValue) {\n setSelectedValue(newValue);\n setInnerValue(newValue);\n\n if (onChange && !Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_13__[\"isEqual\"])(generateConfig, mergedValue, newValue)) {\n onChange(newValue, newValue ? Object(_utils_dateUtil__WEBPACK_IMPORTED_MODULE_13__[\"formatValue\"])(newValue, {\n generateConfig: generateConfig,\n locale: locale,\n format: formatList[0]\n }) : '');\n }\n };\n\n var triggerOpen = function triggerOpen(newOpen) {\n if (disabled && newOpen) {\n return;\n }\n\n triggerInnerOpen(newOpen);\n };\n\n var forwardKeyDown = function forwardKeyDown(e) {\n if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) {\n // Let popup panel handle keyboard\n return operationRef.current.onKeyDown(e);\n }\n /* istanbul ignore next */\n\n /* eslint-disable no-lone-blocks */\n\n\n {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(false, 'Picker not correct forward KeyDown operation. Please help to fire issue about this.');\n return false;\n }\n };\n\n var onInternalMouseUp = function onInternalMouseUp() {\n if (onMouseUp) {\n onMouseUp.apply(void 0, arguments);\n }\n\n if (inputRef.current) {\n inputRef.current.focus();\n triggerOpen(true);\n }\n }; // ============================= Input =============================\n\n\n var _usePickerInput = Object(_hooks_usePickerInput__WEBPACK_IMPORTED_MODULE_17__[\"default\"])({\n blurToCancel: needConfirmButton,\n open: mergedOpen,\n value: text,\n triggerOpen: triggerOpen,\n forwardKeyDown: forwardKeyDown,\n isClickOutside: function isClickOutside(target) {\n return !Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_16__[\"elementsContains\"])([panelDivRef.current, inputDivRef.current], target);\n },\n onSubmit: function onSubmit() {\n if (disabledDate && disabledDate(selectedValue)) {\n return false;\n }\n\n triggerChange(selectedValue);\n triggerOpen(false);\n resetText();\n return true;\n },\n onCancel: function onCancel() {\n triggerOpen(false);\n setSelectedValue(mergedValue);\n resetText();\n },\n onFocus: onFocus,\n onBlur: onBlur\n }),\n _usePickerInput2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_usePickerInput, 2),\n inputProps = _usePickerInput2[0],\n _usePickerInput2$ = _usePickerInput2[1],\n focused = _usePickerInput2$.focused,\n typing = _usePickerInput2$.typing; // ============================= Sync ==============================\n // Close should sync back with text value\n\n\n react__WEBPACK_IMPORTED_MODULE_7__[\"useEffect\"](function () {\n if (!mergedOpen) {\n setSelectedValue(mergedValue);\n\n if (!valueTexts.length || valueTexts[0] === '') {\n triggerTextChange('');\n } else if (firstValueText !== text) {\n resetText();\n }\n }\n }, [mergedOpen, valueTexts]); // Change picker should sync back with text value\n\n react__WEBPACK_IMPORTED_MODULE_7__[\"useEffect\"](function () {\n if (!mergedOpen) {\n resetText();\n }\n }, [picker]); // Sync innerValue with control mode\n\n react__WEBPACK_IMPORTED_MODULE_7__[\"useEffect\"](function () {\n // Sync select value\n setSelectedValue(mergedValue);\n }, [mergedValue]); // ============================ Private ============================\n\n if (pickerRef) {\n pickerRef.current = {\n focus: function focus() {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n },\n blur: function blur() {\n if (inputRef.current) {\n inputRef.current.blur();\n }\n }\n };\n } // ============================= Panel =============================\n\n\n var panelProps = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({}, props), {}, {\n className: undefined,\n style: undefined,\n pickerValue: undefined,\n onPickerValueChange: undefined\n });\n\n var panelNode = react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](_PickerPanel__WEBPACK_IMPORTED_MODULE_11__[\"default\"], Object.assign({}, panelProps, {\n generateConfig: generateConfig,\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({}, \"\".concat(prefixCls, \"-panel-focused\"), !typing)),\n value: selectedValue,\n locale: locale,\n tabIndex: -1,\n onChange: setSelectedValue,\n direction: direction\n }));\n\n if (panelRender) {\n panelNode = panelRender(panelNode);\n }\n\n var panel = react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"div\", {\n className: \"\".concat(prefixCls, \"-panel-container\"),\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n }\n }, panelNode);\n var suffixNode;\n\n if (suffixIcon) {\n suffixNode = react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, suffixIcon);\n }\n\n var clearNode;\n\n if (allowClear && mergedValue && !disabled) {\n clearNode = react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"span\", {\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n },\n onMouseUp: function onMouseUp(e) {\n e.preventDefault();\n e.stopPropagation();\n triggerChange(null);\n triggerOpen(false);\n },\n className: \"\".concat(prefixCls, \"-clear\")\n }, clearIcon || react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"span\", {\n className: \"\".concat(prefixCls, \"-clear-btn\")\n }));\n } // ============================ Warning ============================\n\n\n if (true) {\n Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(!defaultOpenValue, '`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead.');\n } // ============================ Return =============================\n\n\n var onContextSelect = function onContextSelect(date, type) {\n if (type === 'submit' || type !== 'key' && !needConfirmButton) {\n // triggerChange will also update selected values\n triggerChange(date);\n triggerOpen(false);\n }\n };\n\n var popupPlacement = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';\n\n var _useHoverValue = Object(_hooks_useHoverValue__WEBPACK_IMPORTED_MODULE_20__[\"default\"])(text, {\n formatList: formatList,\n generateConfig: generateConfig,\n locale: locale\n }),\n _useHoverValue2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_useHoverValue, 3),\n hoverValue = _useHoverValue2[0],\n onEnter = _useHoverValue2[1],\n onLeave = _useHoverValue2[2];\n\n return react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](_PanelContext__WEBPACK_IMPORTED_MODULE_15__[\"default\"].Provider, {\n value: {\n operationRef: operationRef,\n hideHeader: picker === 'time',\n panelRef: panelDivRef,\n onSelect: onContextSelect,\n open: mergedOpen,\n defaultOpenValue: defaultOpenValue,\n onDateMouseEnter: onEnter,\n onDateMouseLeave: onLeave\n }\n }, react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](_PickerTrigger__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n visible: mergedOpen,\n popupElement: panel,\n popupStyle: popupStyle,\n prefixCls: prefixCls,\n dropdownClassName: dropdownClassName,\n dropdownAlign: dropdownAlign,\n getPopupContainer: getPopupContainer,\n transitionName: transitionName,\n popupPlacement: popupPlacement,\n direction: direction\n }, react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()(prefixCls, className, (_classNames2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-disabled\"), disabled), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-focused\"), focused), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2)),\n style: style,\n onMouseDown: onMouseDown,\n onMouseUp: onInternalMouseUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onContextMenu: onContextMenu,\n onClick: onClick\n }, react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()(\"\".concat(prefixCls, \"-input\"), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({}, \"\".concat(prefixCls, \"-input-placeholder\"), !!hoverValue)),\n ref: inputDivRef\n }, react__WEBPACK_IMPORTED_MODULE_7__[\"createElement\"](\"input\", Object.assign({\n id: id,\n tabIndex: tabIndex,\n disabled: disabled,\n readOnly: inputReadOnly || typeof formatList[0] === 'function' || !typing,\n value: hoverValue || text,\n onChange: function onChange(e) {\n triggerTextChange(e.target.value);\n },\n autoFocus: autoFocus,\n placeholder: placeholder,\n ref: inputRef,\n title: text\n }, inputProps, {\n size: Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_16__[\"getInputSize\"])(picker, formatList[0], generateConfig)\n }, Object(_utils_miscUtil__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(props), {\n autoComplete: autoComplete\n })), suffixNode, clearNode))));\n} // Wrap with class component to enable pass generic with instance method", "title": "" }, { "docid": "178cfc4f4e58b7698b850eb58c67db5e", "score": "0.5362076", "text": "showPicker(focusPicker) {\n const me = this,\n picker = me.picker;\n\n picker.initialValue = me.value;\n picker.format = me.format;\n picker.maxTime = me.max;\n picker.minTime = me.min;\n\n // Show valid time from picker while editor has undefined value\n me.value = picker.value;\n\n super.showPicker(focusPicker);\n }", "title": "" }, { "docid": "7c4dad5caa77972fe6159387fe26eb17", "score": "0.5355783", "text": "function colorPicker() {\n var picker = $.colorPicker();\n if (picker>=0) { \n var color = accessToRGBA(picker); \n return color; \n }else { return null;}\n }", "title": "" }, { "docid": "9dbfbee4eca2f5daf2a0827c29a1efd3", "score": "0.53382796", "text": "function dialogCouponProductPicker() {\n var args = {\n dialogClass : 'wpdk-dialog-jquery-ui',\n modal : true,\n resizable : true,\n draggable : true,\n closeText : wpSmartShopJavascriptLocalization.closeText,\n title : wpSmartShopJavascriptLocalization.productPickerTitle,\n open : dialogCouponProductPickerDidOpen,\n width : 640,\n height : 440,\n minWidth : 500,\n minHeight : 460,\n buttons : [\n {\n text : wpSmartShopJavascriptLocalization.Cancel,\n click : function () {\n $( this ).dialog( \"close\" );\n }\n }\n ]\n };\n\n if ( $( '#wpss-dialog-coupon-product-picker' ).parents( 'div.wpdk-jquery-ui .ui-dialog' ).length ) {\n $( '#wpss-dialog-coupon-product-picker' ).dialog( args );\n } else {\n $( '#wpss-dialog-coupon-product-picker' ).dialog( args ).parent( \".ui-dialog\" ).wrap( \"<div class='wpdk-jquery-ui'></div>\" );\n }\n }", "title": "" }, { "docid": "c98961b7a363bee47c39bea09100b378", "score": "0.5321328", "text": "function selectpicker() {\n if ($.fn.selectpicker) {\n $(\".selectpicker\").selectpicker()\n }\n }", "title": "" }, { "docid": "946696315aa6130fe01175b5a164a693", "score": "0.53012335", "text": "function initPickers() {\n for (const key of Object.keys(uiElements.pickers)) {\n uiElements.pickers[key].spectrum({\n showButtons: false,\n });\n }\n}", "title": "" }, { "docid": "69c533ce3d4287d453fd4bc407fb4ade", "score": "0.5299341", "text": "static get tag() {\n return \"rich-text-editor-heading-picker\";\n }", "title": "" }, { "docid": "a428007d7080978b77e4f9bfccea6a0e", "score": "0.52675927", "text": "function PeoplePickerQSManager() {\n var searchString = '';\n var dialogOptions = 'resizable:yes; status:no; scroll:no; help:no; center:yes; dialogWidth :575px; dialogHeight :500px;';\n var dialogURL = '/_layouts/picker.aspx';\n dialogURL += '?MultiSelect=False';\n dialogURL += '&CustomProperty=User,SecGroup,SPGroup;;15;;;False';\n dialogURL += '&EntitySeparator=;';\n dialogURL += '&DialogTitle=Select People and Groups';\n dialogURL += '&DialogImage=/_layouts/images/ppeople.gif';\n dialogURL += '&PickerDialogType=Microsoft.SharePoint.WebControls.PeoplePickerDialog, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c';\n dialogURL += '&DefaultSearch=' + escapeProperly(searchString);\n\n //commonShowModalDialog(dialogURL, dialogOptions, DelegatePeoplePickerQSCallback);\n\tShowPeoplePicker('Select People and Groups',dialogURL,DelegatePeoplePickerQSCallback);\n}", "title": "" }, { "docid": "aab5dc2f03d7ed94d1f43462037ae5bf", "score": "0.5257951", "text": "function pickerCallback(data) {\n let url = 'no current selection';\n let name;\n let filetype;\n let typeicon\n if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) {\n let doc = data[google.picker.Response.DOCUMENTS][0];\n console.log('Google Drive Object', doc)\n name = doc.name\n url = doc[google.picker.Document.URL];\n filetype = doc.type\n typeicon = `<img src=${doc.iconUrl}/>`\n }\n let message = 'You have selected: ' + name + ' [file type: ' + filetype + ' ' + typeicon + ']';\n document.getElementById('result').innerHTML = message;\n document.getElementById('copy-to-dropbox-btn').innerHTML = '<button>Copy To Dropbox</button>'\n}", "title": "" }, { "docid": "8ebbfb669691cbb4fe7041d5f6c8d24f", "score": "0.52559376", "text": "createModal(value) {\n this.props.createModal(value);\n }", "title": "" }, { "docid": "d06c0abd97a18f9c4dc4515205a26e6d", "score": "0.5251982", "text": "async open() {\n if (this.disabled || this.isExpanded) {\n return;\n }\n const pickerOptions = this.generatePickerOptions();\n const picker = await pickerController.create(pickerOptions);\n this.isExpanded = true;\n picker.onDidDismiss().then(() => {\n this.isExpanded = false;\n this.setFocus();\n });\n addEventListener(picker, 'ionPickerColChange', async (event) => {\n const data = event.detail;\n const colSelectedIndex = data.selectedIndex;\n const colOptions = data.options;\n const changeData = {};\n changeData[data.name] = {\n value: colOptions[colSelectedIndex].value\n };\n if (data.name !== 'ampm' && this.datetimeValue.ampm !== undefined) {\n changeData['ampm'] = {\n value: this.datetimeValue.ampm\n };\n }\n this.updateDatetimeValue(changeData);\n picker.columns = this.generateColumns();\n });\n await picker.present();\n }", "title": "" }, { "docid": "cbebe694a87b39e46740546197431bb0", "score": "0.5242815", "text": "present() {\n var _this5 = this;\n\n return (0,_var_www_html_PokeSPR_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(function* () {\n yield (0,_overlays_f469834d_js__WEBPACK_IMPORTED_MODULE_10__.d)(_this5, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);\n\n if (_this5.duration > 0) {\n _this5.durationTimeout = setTimeout(() => _this5.dismiss(), _this5.duration);\n }\n })();\n }", "title": "" }, { "docid": "f81d70a8424460336808fe098f32b3f1", "score": "0.5230246", "text": "function DateTimePicker() {\n}", "title": "" }, { "docid": "27c4f51e04cf30d77c872d5d0982fc5a", "score": "0.5225962", "text": "function initUI(){$(\".selectpicker\").selectpicker()}", "title": "" }, { "docid": "1fea95971f424f1a688d071a7f7999d8", "score": "0.5207087", "text": "function getDatePicker() {\n return box;\n }", "title": "" }, { "docid": "dfa446d434d18907acb7099638c1427b", "score": "0.52062356", "text": "function PickerPopup(title, value, type, maxDate) {\n\tvar _self = null;\n\tvar _value = ( value ? value : '');\n\tvar _type = type;\n\tvar _maxDate = maxDate;\n\n\tvar _btnCancel = null;\n\tvar _btnDone = null;\n\tvar _toolbar = null;\n\n\t_self = Ti.UI.createWindow();\n\n\tvar _slide_in = Titanium.UI.createAnimation({\n\t\tbottom : 0\n\t});\n\n\tvar _slide_out = Titanium.UI.createAnimation({\n\t\tbottom : -251\n\t});\n\n\tvar _picker_view = Titanium.UI.createView({\n\t\theight : 251,\n\t\tbottom : -251,\n\t\twidth : Ti.UI.SIZE\n\t});\n\n\t_btnCancel = Ti.UI.createButton({\n\t\ttitle : 'Cancel',\n\t\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n\t});\n\n\t_btnDone = Ti.UI.createButton({\n\t\ttitle : 'Done',\n\t\tstyle : Ti.UI.iPhone.SystemButtonStyle.BORDERED\n\t});\n\n\tvar _spacer = Ti.UI.createButton({\n\t\tsystemButton : Ti.UI.iPhone.SystemButton.FLEXIBLE_SPACE\n\t});\n\n\t_toolbar = Ti.UI.iOS.createToolbar({\n\t\ttop : 0,\n\t\twidth : 320,\n\t\titems : [_btnCancel, _spacer, _btnDone],\n\t\tbarColor : '#6c6c6c'\n\t});\n\n\tvar _picker = Titanium.UI.createPicker({\n\t\ttop : 43,\n\t\ttype : _type,\n\t\t//type : ( _type ? _type : Ti.UI.PICKER_TYPE_DATE),\n\t\tselectionIndicator : true\n\t});\n\n\tif (_maxDate) {\n\t\t_picker.maxDate = _maxDate;\n\t}\n\t_picker.addEventListener(\"change\", function(e) {\n\t\t_self.xsetValue(e.value);\n\t});\n\n\t_picker_view.slideIn = function(callback) {\n\t\t_picker_view.animate(_slide_in, callback());\n\t}\n\t_picker_view.slideOut = function(callback) {\n\t\t_picker_view.animate(_slide_out, callback());\n\t}\n\n\t_picker_view.add(_toolbar);\n\t_picker_view.add(_picker);\n\t_self.add(_picker_view);\n\n\t_btnCancel.addEventListener('click', function() {\n\t\t_picker_view.slideOut(function() {\n\t\t\t_self.close();\n\t\t});\n\t});\n\n\t_btnDone.addEventListener('click', function(e) {\n\t\t_self.fireEvent('done', {\n\t\t\tvalue : _value\n\t\t});\n\t\t_picker_view.slideOut(function() {\n\t\t\t_self.close();\n\t\t});\n\t\t_self.close();\n\t});\n\n\t_self.addEventListener('open', function() {\n\t\t_picker_view.slideIn(function() {\n\t\t});\n\t});\n\n\t_self.xsetValue = function(value) {\n\t\t_value = value;\n\t}\n\n\treturn _self;\n}", "title": "" }, { "docid": "96767b52496215cd2ebf64ad951dfbf3", "score": "0.5189025", "text": "function DraggableModalDialog(props) {\n return (\n <Draggable handle=\".modal-header\"><ModalDialog {...props} /></Draggable>\n )\n }", "title": "" }, { "docid": "79f14a507e7ae8c517b3b6e1c0100003", "score": "0.5183514", "text": "function setupPicker(k) {\n $('#picker' + k).farbtastic(function onColorChangeLocal(color) {\n // this is the callback fired when the user manipulates a color picker\n\n // set colors associated with color picker\n setExtraColors(k, color);\n\n // publish the color change event on our topic\n sess.publish(\"event:color-change\", { index: k, color: color });\n });\n}", "title": "" }, { "docid": "a6fbce41af40b7c813436ae89b25c202", "score": "0.51769555", "text": "showPreferencesDialog() {\n DialogActions.showSettingDialog();\n }", "title": "" }, { "docid": "3b679bc60042b48c425e7049c66a213a", "score": "0.51689106", "text": "function open(cb) {\n element.className = 'colour-picker';\n callback = cb;\n }", "title": "" }, { "docid": "41d5ae2a3cb05e2dbef41f2f3b571d35", "score": "0.51603496", "text": "function pickerCallback(data) {\n if (data.action == google.picker.Action.PICKED) {\n var fileId = data.docs[0].id;\n loadFile(fileId);\n }\n}", "title": "" }, { "docid": "e776d61038d12acdc48c85676de3da6d", "score": "0.5157452", "text": "function setupPicker(k) {\n $('#picker' + k).farbtastic(function onColorChangeLocal(color) {\n // this is the callback fired when the user manipulates a color picker\n\n // set colors associated with color picker\n setExtraColors(k, color);\n\n // publish the color change event on our topic\n sess.publish(\"api:\" + controllerChannelId + \".color_change\", [{ index: k, color: color }], {}, {acknowledge: true}).then(\n function(publication) {\n console.log(\"published\", publication, \"api\" + controllerChannelId + \".color_change\");\n\n },\n function(error) {\n console.log(\"publication error\", error);\n }\n );\n });\n}", "title": "" }, { "docid": "0e74618be106c2051c52ac4b8f199132", "score": "0.51544255", "text": "function PeoplePickerBidLead() {\n var searchString = '';\n var dialogOptions = 'resizable:yes; status:no; scroll:no; help:no; center:yes; dialogWidth :575px; dialogHeight :500px;';\n var dialogURL = '/_layouts/picker.aspx';\n dialogURL += '?MultiSelect=False';\n dialogURL += '&CustomProperty=User,SecGroup,SPGroup;;15;;;False';\n dialogURL += '&EntitySeparator=;';\n dialogURL += '&DialogTitle=Select People and Groups';\n dialogURL += '&DialogImage=/_layouts/images/ppeople.gif';\n dialogURL += '&PickerDialogType=Microsoft.SharePoint.WebControls.PeoplePickerDialog, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c';\n dialogURL += '&DefaultSearch=' + escapeProperly(searchString);\n\n //commonShowModalDialog(dialogURL, dialogOptions, DelegatePeoplePickerCallback);\n\tShowPeoplePicker('Select People and Groups',dialogURL,DelegatePeoplePickerCallback);\n}", "title": "" }, { "docid": "70f46bf51b01c604f464c5cea5ea86af", "score": "0.51508427", "text": "function createPicker() {\n var view = new google.picker.DocsView()\n .setIncludeFolders(true)\n .setMimeTypes('application/vnd.google-apps.folder')\n .setSelectFolderEnabled(true);\n \n var picker = new google.picker.PickerBuilder()\n .enableFeature(google.picker.Feature.NAV_HIDDEN)\n .setTitle(\"Select a folder\")\n .setOAuthToken(gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse(true).access_token)\n .addView(view)\n .setCallback(pickerCallback)\n .build();\n picker.setVisible(true);\n}", "title": "" } ]
2dabad14eeb3e0bde7ba682de1681dde
Cancels all running AnimationJobs.
[ { "docid": "922822855c2cbd328cf71c38c76f9d47", "score": "0.85232013", "text": "function cancelAll() {\r\n while (animator.jobs.length) {\r\n cancelJob(animator.jobs[0]);\r\n }\r\n }", "title": "" } ]
[ { "docid": "0f61c962372d47c6f41e1c6f4190b6c5", "score": "0.7630864", "text": "cancelAllAnimations() {\n\t\tthis._cameraAnimationQueue.clear();\n\t\tthis._currentAnimation = null;\n\t}", "title": "" }, { "docid": "a8be0eff9d408f916ec8a48da2a4cd53", "score": "0.76259303", "text": "function cancelAllJobs() {\n for (var job in scheduler.scheduledJobs) {\n if (scheduler.scheduledJobs.hasOwnProperty(job)) {\n scheduler.scheduledJobs[job].cancel();\n }\n }\n updateJobs = [];\n areJobsScheduled = false;\n}", "title": "" }, { "docid": "a0df50dac309a1c66d8aa7c460650e17", "score": "0.68920255", "text": "stopAll() {\n this.clearQueue();\n this.stop();\n }", "title": "" }, { "docid": "35b2ece5bab88053f35242318125a3d6", "score": "0.6768932", "text": "killAnimations() {\n this.timelines.forEach((timeline) => {\n this.killTimeline(timeline);\n });\n\n this.tweens.forEach((tween) => {\n this.killTween(tween);\n });\n\n this.timelines = [];\n this.tweens = [];\n }", "title": "" }, { "docid": "107fce1da15ab6529a5e58101036e74f", "score": "0.6658912", "text": "function fx_cancel_all(element) {\n var uid = $uid(element._);\n\n (running_fx[uid] || []).each('cancel');\n (scheduled_fx[uid] || []).splice(0);\n}", "title": "" }, { "docid": "4d5b41a4724e15dfac51671136415dca", "score": "0.66561764", "text": "cancelAllEnemiesMovement() {\n if (game.model.bonus) {\n game.model.bonus.cancelAnimation();\n game.model.bonus.resetPosition();\n }\n\n if (game.model.finalBoss && game.model.finalBoss.elem.style.display !== \"none\") {\n game.model.finalBoss.myMovementTween.stop();\n clearTimeout(this.bossAnimationTimerId);\n this.bossAnimationTimerId = null;\n }\n\n if (game.gameState === \"spaceInvaders\") {\n for (let i = 0; i < game.model.siEnemies.length; i++) {\n for (let j = 0; j < game.model.siEnemies[i].length; j++) {\n cancelAnimationFrame(game.model.siEnemies[i][j].moveAnimationId);\n clearTimeout(game.model.siEnemies[i][j].moveAnimationId);\n }\n }\n clearInterval(this.spaceInvadersEnemiesShootsTimerId);\n } else {\n clearTimeout(this.svEnemiesMoveTimerId);\n this.svEnemiesMoveTimerId = null;\n game.model.svEnemiesPool.showingObjects.forEach(x => {\n clearTimeout(x.moveAnimationId);\n if (x.myMovementTween)\n x.myMovementTween.stop();\n });\n }\n }", "title": "" }, { "docid": "0b405ee465dd5880ba98365a40bb0cbf", "score": "0.6644546", "text": "stopAllTasks() {\n for (let iTask = 0; iTask < this._scheduledTasks.length; ++iTask) {\n this._scheduledTasks[iTask].cancel();\n }\n\n this._scheduledTasks = [];\n }", "title": "" }, { "docid": "cca6fc10067bab27a3c8386265815a46", "score": "0.6550324", "text": "cancel() {\n this.instanceQueue = [];\n this.loadedImages = {};\n this.fetchQueue = [];\n }", "title": "" }, { "docid": "055d5ff3f739f076c2bd05c30af4cddf", "score": "0.6541305", "text": "function clearAnimationTimers() {\r\tfor(var i = 0; i < animationTimers.length; i++)\r\t{\r\t\tvar timer = animationTimers.pop();\r\t\tif(timer)\r\t\t{\r\t\t\ttry{\r\t\t\t\tclearTimout(timer);\r\t\t\t}catch(e){\r\t\t\t\t//really can't do anything}\r\t\t\t}\r\t\t}\r\t}\r}", "title": "" }, { "docid": "75419cdd91e373c9a3f071ac18007a36", "score": "0.6480471", "text": "cancel() {\n this.scheduled.forEach(clearTimeout);\n this.scheduled = [];\n this.synthesis.cancel();\n }", "title": "" }, { "docid": "c1ed360f63a4377a283287b3b88ea356", "score": "0.6475399", "text": "function cancelJobs() {\r\n var salesOrder = nlapiLoadRecord('salesorder', nlapiGetRecordId());\r\n var i = 1, n = salesOrder.getLineItemCount('item') + 1;\r\n for (;i < n; i++) { \r\n var jobId = salesOrder.getLineItemValue('item', 'job', i);\r\n if (jobId != null) {\r\n cancelJob(jobId);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ce784d317a3f9337c08d18794291cb70", "score": "0.64724696", "text": "stop() {\n this.pendingJobs = [];\n }", "title": "" }, { "docid": "dd13f9dc703e58cfaec3e93f6e558de9", "score": "0.641442", "text": "function finishAllAnimations() {\n runningAnimations.forEach(function (animation) {\n animation.finishNow();\n });\n clearTimeout(fadeInTimer);\n clearTimeout(animateHeightTimer);\n clearTimeout(animationsCompleteTimer);\n runningAnimations.length = 0;\n }", "title": "" }, { "docid": "93c361192f3fa34f2f0bc24f1d8bd73c", "score": "0.63360596", "text": "function _stopAllQueues(){\n for(var i = 0; i<queueOnAction.length; i++){\n queueOnAction[i] = false;\n }\n }", "title": "" }, { "docid": "4f7197544128fab864f5ccf8a6a30663", "score": "0.6327625", "text": "function clearAllTimers() {\n clearInterval(intervalId);\n clearTimeout(frame1Id);\n clearTimeout(frame2Id);\n clearTimeout(frame3Id);\n clearTimeout(frame4Id);\n clearTimeout(frame5Id);\n clearTimeout(frame6Id);\n clearTimeout(frame7Id);\n clearTimeout(frame8Id);\n clearTimeout(frame9Id);\n clearTimeout(frame10Id);\n clearTimeout(frame11Id);\n clearTimeout(frame12Id);\n}", "title": "" }, { "docid": "19f794595165faabb26288e0b368bceb", "score": "0.6278376", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED$1;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"f\" /* TASK_CANCEL */], false);\n }\n }", "title": "" }, { "docid": "648002e8710f1b707cd0ec8293a10a57", "score": "0.62108886", "text": "endAll() {\n this.animations.forEach((anim) => anim.onEnd());\n this.animations = [];\n }", "title": "" }, { "docid": "a79c8ad5bafa90f8e562fb02618391b4", "score": "0.6207414", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"], false);\n }\n }", "title": "" }, { "docid": "a79c8ad5bafa90f8e562fb02618391b4", "score": "0.6207414", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"], false);\n }\n }", "title": "" }, { "docid": "93ddc67920399226a0a6230dcf89ced5", "score": "0.61990035", "text": "function stopAllAnims()\n{\n if(script.idleAnimScript != null && script.idleAnimScript.api.animMixer != null)\n {\n var animLayers = script.idleAnimScript.api.animMixer.getLayers();\n for(var i=0; i<animLayers.length; i++)\n {\n animLayers[i].stop();\n } \n } \n}", "title": "" }, { "docid": "8a1c1c509ccca44d2c94c60c6447e9d5", "score": "0.6187676", "text": "cancelAnimation(id) {\n\t\tif (this._currentAnimation != null && this._currentAnimation.animationEntry.id === id) {\n\t\t\tthis._currentAnimation = null;\n\t\t}\n\t\telse {\n\t\t\tfor (let i = 0; i < this._cameraAnimationQueue.length; i++) {\n\t\t\t\tif (this._cameraAnimationQueue[i].entry.id === id) {\n\t\t\t\t\tthis._cameraAnimationQueue.splice(i, 1);\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "acda86380f243b7e25af6fdd5f1ed722", "score": "0.6178386", "text": "async stop () {\n for (const watcher of this._jobWatchers) {\n clearInterval(watcher)\n }\n\n await this._orbitdb.disconnect()\n }", "title": "" }, { "docid": "ca50a0dbb269db9feb3a6d5fc81f7bd4", "score": "0.6168582", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = redux_saga_core_esm_CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(TASK_CANCEL, false);\n }\n }", "title": "" }, { "docid": "af0ddab4a0b93709bf26d035f727f595", "score": "0.6165628", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(symbols.TASK_CANCEL, false);\n }\n }", "title": "" }, { "docid": "6545dd7de3842c15e6aaf45700343a05", "score": "0.61179024", "text": "stop() {\n if (!this.running) {\n return;\n }\n\n this.running = false;\n\n for (const worker of this.workers) {\n worker.stop();\n }\n }", "title": "" }, { "docid": "d5fc2ae9fab0d55f2a6dbd268e3d03ee", "score": "0.61096644", "text": "cancelPending() {\n this.views.forEach(view => view.cancelProgress());\n }", "title": "" }, { "docid": "ae3153427b6f1fb26abd29fe9d681346", "score": "0.6097077", "text": "cancelBatch() {\n this.batching = null;\n this.meta.batchChanges = null;\n }", "title": "" }, { "docid": "ae3153427b6f1fb26abd29fe9d681346", "score": "0.6097077", "text": "cancelBatch() {\n this.batching = null;\n this.meta.batchChanges = null;\n }", "title": "" }, { "docid": "42d811d925388164636cfee42d315fb6", "score": "0.60888416", "text": "abortTest () {\n\t\tif (this.runningQueue) {\n\t\t\tthis.runningQueue.cancel()\n\t\t}\n\t}", "title": "" }, { "docid": "d8a8589c602d2333d5cfd6993482484c", "score": "0.60640126", "text": "cancelAllAnimations(camera) {\n\t\tlet cameraControls = this._camerasControls[camera._uuid];\n\n\t\tif (cameraControls != null) {\n\t\t\tcameraControls.cancelAllAnimations();\n\t\t}\n\t\telse {\n\t\t\tconsole.warn(\"Cannot cancel camera animations. Controls for the given camera do not exist.\")\n\t\t}\n\t}", "title": "" }, { "docid": "d32c2a81b3f7ab7d93d48b75c05f36cb", "score": "0.60533184", "text": "cancel() {\n\t\tthis.removeAllListeners()\n\t}", "title": "" }, { "docid": "91a730eae0fd076a041658cb8bc25876", "score": "0.60322", "text": "stop() {\n this.finishAll();\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.6030993", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "3736469872de4e6a954623af6d98ba06", "score": "0.6022762", "text": "function cancel() {\n\t /**\n\t We need to check both Running and Cancelled status\n\t Tasks can be Cancelled but still Running\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\n\t Ending with a Never result will propagate the Cancellation to all joiners\n\t **/\n\t end(TASK_CANCEL);\n\t }\n\t }", "title": "" }, { "docid": "5770b44a3dcb3a5c3f61a1804027e844", "score": "0.60160595", "text": "function cancel() {\n\t /**\n\t We need to check both Running and Cancelled status\n\t Tasks can be Cancelled but still Running\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\n\t Ending with a Never result will propagate the Cancellation to all joiners\n\t **/\n\n\t end(TASK_CANCEL);\n\t }\n\t }", "title": "" }, { "docid": "6d3eee8e18e789b4994d2021dc477643", "score": "0.5999693", "text": "cleanIdleJobs() {\n logger.debug(\"Jobs.cleanIdleJobs: called\");\n\n const jobsTypesToRemove = [];\n\n const jobsToRestart = Jobs.find(\n {\n status: \"running\",\n type: {\n $nin: jobsTypesToRemove\n }\n },\n {\n fields: {\n _id: 1\n }\n }\n ).fetch();\n if (jobsToRestart && jobsToRestart.length) {\n const jobsToRestartIds = _.pluck(jobsToRestart, \"_id\");\n\n if (jobsToRestartIds.length) {\n logger.debug(\"Jobs.cleanIdleJobs: restarting this jobs\", {\n jobsToRestartIds\n });\n }\n Jobs.cancelJobs(jobsToRestartIds); // need to cancel before restart\n Jobs.restartJobs(jobsToRestartIds);\n }\n\n const jobsToRemove = Jobs.find(\n {\n status: \"running\",\n type: {\n $in: jobsTypesToRemove\n }\n },\n {\n fields: {\n _id: 1\n }\n }\n ).fetch();\n if (jobsToRemove && jobsToRemove.length) {\n const jobsToRemoveIds = _.pluck(jobsToRemove, \"_id\");\n\n if (jobsToRemoveIds.length) {\n logger.debug(\"Jobs.cleanIdleJobs: removing this jobs\", {\n jobsToRemoveIds\n });\n }\n Jobs.cancelJobs(jobsToRemoveIds); // need to cancel before remove\n return Jobs.removeJobs(jobsToRemoveIds);\n }\n }", "title": "" }, { "docid": "13a1e084b65d210ebfbd5e30c67c51b1", "score": "0.59962004", "text": "function onCleanJobs () {\r\n state.jobs\r\n .filter(job => (job.state !== 'waiting' && job.state !== 'active'))\r\n .forEach(job => {\r\n let index = state.jobs.indexOf(job);\r\n state.jobs.splice(index, 1);\r\n });\r\n\r\n return Promise.resolve(state.jobs);\r\n}", "title": "" }, { "docid": "605163d387730016aadb5554702beec2", "score": "0.59879375", "text": "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "title": "" }, { "docid": "104448b62b50e5d5999eb71eaad62465", "score": "0.5982893", "text": "stopAll() {\n const _ = this;\n for (const entry of _._map.values()) {\n clearTimeout(entry.handle);\n }\n _._map.clear();\n }", "title": "" }, { "docid": "cc13bcedb2bffa57885a12d6e1b11130", "score": "0.5981278", "text": "function stopAll() {\n for (let i = 0; i < playingLoop.length; i++) {\n playingLoop[i].audio.pause()\n }\n setKeepPlaying(false)\n\n }", "title": "" }, { "docid": "fabac6d213a7a5812210ec818cfdd953", "score": "0.5980733", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n //\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true\n taskQueue.cancelAll() // cancel all tasks,特别是 mainTask\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n // 主动 cancel task (saga | iterator)\n // end task with cancel signal\n end(TASK_CANCEL)\n }\n }", "title": "" }, { "docid": "ed148f148f3ff303aef744b8bf396f3d", "score": "0.59798676", "text": "cleanUp() {\n // clear activeEnemies\n this.activeEnemies.forEach(function(enemy) {\n enemy.cleanUp();\n });\n // clear active players\n this.activeObjects.forEach(function(object) {\n object.cleanUp();\n });\n // stop game loop\n this.animation.forEach(function(frame,index) {\n cancelAnimationFrame(frame);\n });\n }", "title": "" }, { "docid": "15fc320f1824cc4e8eb97c529514846d", "score": "0.59728825", "text": "updateAnimations() {\n this.animations.forEach((animation, index) => {\n if (animation.finished) {\n this.animations.splice(index, 1);\n }\n });\n }", "title": "" }, { "docid": "45f7d52d55be54d0a5f76497a5b1564c", "score": "0.5965058", "text": "cancel() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n this.timeoutId = undefined;\n this.intervalId = undefined;\n this.sequence = 0;\n this.isActive = false;\n this.times = [];\n if (this.rejectCallback) {\n this.rejectCallback(new Error('cancel'));\n }\n this.rejectCallback = undefined;\n }", "title": "" }, { "docid": "3940f01aedf18c272e75cb8332ad136e", "score": "0.59555584", "text": "function stop() {\n cronJobs.forEach(function (job) {\n job.stop();\n });\n log.info('Stopped all cron jobs');\n}", "title": "" }, { "docid": "4bc5eb65759f6a619b4e047f568a5bc7", "score": "0.5947194", "text": "function stopAll() {\n\t\tfor (var channel in games) {\n\t\t\tif (games.hasOwnProperty(channel))\n\t\t\t\tstopGame(channel, channel);\n\t\t}\n\t}", "title": "" }, { "docid": "b9178e9139619f55c293a1ae6ea12510", "score": "0.59067285", "text": "clearWaitingQueue() {\n this._waitingQueue.forEach((queueItem) => { queueItem.reject(); });\n }", "title": "" }, { "docid": "f8c84304aca80a104fda68c7636d29f3", "score": "0.590353", "text": "function animationManager () {\n for (var i = tasks.length; i--;) {\n if (tasks[i].step() == false) {\n // remove animation tasks\n logToScreen(\"remove animation\");\n tasks.splice(i, 1);\n }\n }\n }", "title": "" }, { "docid": "13dde33fbb3669f9709838ec59a73bf8", "score": "0.59019834", "text": "function __clearObjectAnimationsFromQueues(_obj){ //We may need to pass objects to sleep etc. functions to be able to remove them here\n for(var i=0;i<animationQueue.length;i++){\n for(var j=0;j<animationQueue[i].length;j++){\n if(!animationQueue[i][j]['animation']['object']){\n continue;\n }\n if(animationQueue[i][j]['animation']['object'].selector ==='#'+_obj[0].id){ //TODO something better than concatenating with # ??\n animationQueue[i].splice(j,1);\n }\n }\n }\n }", "title": "" }, { "docid": "ce23e2e4d017aa53b7c139a90483d675", "score": "0.58617115", "text": "function killAllActions() {\n outstandingPendingActions = [];\n return outstandingPendingActions;\n }", "title": "" }, { "docid": "1bc882baa5a451360532aecd904d21ef", "score": "0.5827186", "text": "cleanupStagesOutStandingTimers() {\n Object.keys(this.startTimers).forEach(dependencyName => {\n clearTimeout(this.startTimers[dependencyName]);\n delete this.startTimers[dependencyName];\n });\n }", "title": "" }, { "docid": "3737df1fb5e8e29f0b3f5ecd0d104068", "score": "0.5825962", "text": "cancel() {\n cancel();\n }", "title": "" }, { "docid": "c2f742b6d0a8c2752a9970e87c2306a6", "score": "0.5807", "text": "cleanupStagesOutStandingTimers() {\n Object.keys(this.checkpointTimers).forEach(checkpointName => {\n clearTimeout(this.checkpointTimers[checkpointName]);\n delete this.checkpointTimers[checkpointName];\n });\n }", "title": "" }, { "docid": "1a6e6f2b6a341cb2517139687ba3725b", "score": "0.5800579", "text": "clearQueue() {\n if (this.isAnimating) {\n this._queue = [this._queueFirst];\n return;\n }\n this._queue = [];\n }", "title": "" }, { "docid": "69d1b1a0900b4b27f6bc4c0d04af5ba0", "score": "0.5799488", "text": "stop() {\n this._scheduler.stop();\n this._queues.stop();\n }", "title": "" }, { "docid": "6c43982df18bd52ec49db85f21d0164a", "score": "0.5792246", "text": "async function detenerCheckJobs() {\n clearInterval(nIntervId);\n monitorJobs = false;\n }", "title": "" }, { "docid": "16cb2f39c9fac17d90d466ca954b3cd6", "score": "0.5790869", "text": "_abortAllRequests() {\n while (this._requests.length > 0) {\n const req = this._requests.pop();\n req.abort = true;\n req.xhr.abort();\n req.xhr.onreadystatechange = function () {};\n }\n }", "title": "" }, { "docid": "1ef572289b8b20d0c8828ebd43ad22b2", "score": "0.57797617", "text": "function cancel(){if(status===RUNNING){// Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n// effects in the iterator's finally block will still be executed\nstatus=CANCELLED;queue.cancelAll();// Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\nend(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"],false);}}", "title": "" }, { "docid": "7311dc8ebbd5fc5e8053eff716b1d679", "score": "0.5745108", "text": "cancelFrame() {\n cancelAnimationFrame(this.frame.count);\n }", "title": "" }, { "docid": "7311dc8ebbd5fc5e8053eff716b1d679", "score": "0.5745108", "text": "cancelFrame() {\n cancelAnimationFrame(this.frame.count);\n }", "title": "" }, { "docid": "da87c6abf47bd784b19cc7e02c4aef9b", "score": "0.57447934", "text": "function clearAll(){\n\tfor(var i=1;i<99999;i++){\n\t\tclearInterval(i);\n\t}\n}", "title": "" }, { "docid": "5ca03e63e51ea8dd98d07e5b59f6efe0", "score": "0.5741824", "text": "function clearAll() {\n for (let i = 0; i < 11; i++) {\n setNone(i);\n }\n running = false;\n }", "title": "" }, { "docid": "e2f1c46e6cd09c148efab208e2036812", "score": "0.57330006", "text": "stopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i >= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}", "title": "" }, { "docid": "e2f1c46e6cd09c148efab208e2036812", "score": "0.57330006", "text": "stopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i >= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}", "title": "" }, { "docid": "b00f98e5b2ee098f15fb63146b41de09", "score": "0.57328993", "text": "function clearAll() {\n _.each(timers, (timer) => {\n // We don't know whether it's a setTimeout or a setInterval, but it doesn't really matter. If the id doesn't\n // exist nothing bad happens.\n clearTimeout(timer);\n clearInterval(timer);\n });\n}", "title": "" }, { "docid": "da5ca61f85fc5730406068f2d059749c", "score": "0.57231444", "text": "killAll() {\n for (var label in this.processes) {\n this.kill(label);\n }\n }", "title": "" }, { "docid": "b6a3c34e58814f200e04b15d48830297", "score": "0.5698358", "text": "terminate() {\n\n\t\tthis.clearSubgoals();\n\n\t}", "title": "" }, { "docid": "71d5d82de10870a6ab947eaca32bd919", "score": "0.5688479", "text": "pauseAll() {\n const that = this;\n\n if (that.disabled || that._items.length === 0) {\n return;\n }\n\n for (let i = that._items.length - 1; i >= 0; i--) {\n let item = that._items[i];\n\n if (item.xhr) {\n item.xhr.abort();\n }\n }\n }", "title": "" }, { "docid": "e5519a192c9d226dfc039fcbd03b6ab2", "score": "0.56863", "text": "function stopAnimation() {\n cancelAnimationFrame(animationID)\n}", "title": "" }, { "docid": "933e4b28f07c0c183af8b6092a94dbd8", "score": "0.56858355", "text": "function dec_busy()\n{\n background_jobs--;\n if(background_jobs<0)\n {\n background_jobs = 0;\n }\n update_busy_indicator();\n}", "title": "" }, { "docid": "5bde237eb547e37c5193838f3bab8307", "score": "0.56825465", "text": "function clearInte(){\n clearInterval(aniMay);\n clearInterval(aniMay2);\n clearInterval(aniMay3);\n clearInterval(aniMay4);\n clearInterval(aniMay5);\n clearInterval(aniMay6);\n clearInterval(aniMay7);\n}", "title": "" }, { "docid": "4022f55b479da410402c221729002208", "score": "0.5678653", "text": "cancelAll() {\n const that = this;\n\n if (that.disabled || that._items.length === 0) {\n return;\n }\n\n for (let i = that._items.length - 1; i >= 0; i--) {\n that.cancelFile(that._items[i].index);\n }\n\n that.$.browseButton.disabled = (!that.multiple && that._selectedFiles.length > 0) || that.disabled ? true : false;\n }", "title": "" }, { "docid": "427c4e30aa9ab0bc6a679fb4d2f12b04", "score": "0.56768423", "text": "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "title": "" }, { "docid": "f467043c311953123ab8b402563a6a86", "score": "0.5671449", "text": "pauseAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(true);\n }\n }\n }", "title": "" }, { "docid": "e39d2668526295945b4f62bf68fc36ea", "score": "0.5669939", "text": "stop() {\n clearInterval(this.animation);\n this.canvas.clear();\n }", "title": "" }, { "docid": "ab7124bfd271d726e4d7e6c38c6e5ce6", "score": "0.5663509", "text": "function CancelAllTimeouts(win) {\n if (win && win._tm) {\n try {\n for (var i in win._tm) {\n win.clearTimeout(i);\n }\n win._tm = [];\n } catch (e) {\n DumpException(e);\n }\n }\n}", "title": "" }, { "docid": "ed2bb5806dde3b3eb3b91818778812da", "score": "0.5650742", "text": "function clearAllTimers() {\n\tfor (var i = 1; i < 9999; i++)\n\t\twindow.clearTimer(i);\n}", "title": "" }, { "docid": "bc64808db47c71754aa601a307893659", "score": "0.56504464", "text": "function clear_animation_timer() {\n\n clearTimeout(window.animationTimer1);\n clearTimeout(window.animationTimer2);\n clearTimeout(window.animationTimer3);\n clearTimeout(window.animationTimer4);\n\n }", "title": "" }, { "docid": "3977f1843189c6918e3aa07eb2ea2388", "score": "0.56297517", "text": "function clearAll () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].finish();\n\t\tdelete p[i];\n\t}\n\tPelota.prototype.ID = 0;\n\tnum = 0;\n\tsetTimeout(function () {\n\t\tctx.clearRect(0, 0, can.width, can.height);\n\t}, 100);\n}", "title": "" }, { "docid": "1bb4d70c4ba77410dfad840657638bf9", "score": "0.56252384", "text": "stop() {\n this.isRunning = false; // Clear the general queue\n\n this._queue.clear(); // Clear the cold call queue\n\n\n this._coldCallQueue.clear();\n\n this._cleanInterval.clear(); // Abort the individual peer queues\n\n\n const queues = Object.values(this._queues);\n queues.forEach(dialQueue => {\n dialQueue.abort();\n delete this._queues[dialQueue.id];\n });\n }", "title": "" }, { "docid": "0eb07080d7c954292354f543a1e3aef8", "score": "0.5618001", "text": "remove_all_keyframes () {\n this.glitch('keyframe', () => null);\n }", "title": "" }, { "docid": "a8540dba5987490964ac74fe13c83217", "score": "0.5612923", "text": "function cancelAnimFrame(id) {\n if (id) {\n cancelFn.call(window, id);\n }\n }", "title": "" }, { "docid": "4c381dea48d2a021e235aa40893fc620", "score": "0.5607863", "text": "function stopAnimation() {\n for (var i = 0; i < self.markerArray().length; i++) {\n self.markerArray()[i][1].setAnimation(null);\n }\n}", "title": "" }, { "docid": "efb8f26658eaf1ea287a577ac01f18d9", "score": "0.56042475", "text": "function stopCurrentAnimation() {\n cancelAnimationFrame(nextAnimationFrame);\n nextAnimationFrame = 0;\n clearTimeout(nextTimeout);\n nextTimeout = 0;\n}", "title": "" }, { "docid": "49679bd1a0e42dd436164aa1a0bde135", "score": "0.55901426", "text": "stop() {\n if (this._animationFrame) {\n cancelAnimationFrame(this._animationFrame);\n }\n }", "title": "" }, { "docid": "3c2d14a19dc94e2141cbdb0129355642", "score": "0.557824", "text": "stopCurrentWork() {\n for (let i = 0; i < this._workers.length; i += 1) {\n const worker = this._workers[i];\n\n /** @type {MessageFromMasterToSlave} */\n const message = {\n type: \"stop\",\n };\n\n worker.postMessage(message);\n }\n }", "title": "" }, { "docid": "a3dc6a4b7a7780a0f38a31b4e794c25b", "score": "0.5574051", "text": "stopSeq() {\n for (var i = 1; i < 99999; i++)\n window.clearInterval(i)\n }", "title": "" }, { "docid": "d4a47a8b4bdaba282e83443ae0b70a75", "score": "0.55672824", "text": "function clear_loops() {\n tasks.clear();\n}", "title": "" }, { "docid": "d4a47a8b4bdaba282e83443ae0b70a75", "score": "0.55672824", "text": "function clear_loops() {\n tasks.clear();\n}", "title": "" }, { "docid": "d4a47a8b4bdaba282e83443ae0b70a75", "score": "0.55672824", "text": "function clear_loops() {\n tasks.clear();\n}", "title": "" } ]
926ceecef86a4952683bc20f1b717aff
Determines if it should show points/sec
[ { "docid": "956e024f7dc688c5bebca559e0455c68", "score": "0.0", "text": "function canGenPoints(){\n\treturn true\n}", "title": "" } ]
[ { "docid": "f49b828be426e125f36e5359f37aff65", "score": "0.6370226", "text": "function isSignificantPassed(){\n\t\t\n\t\tif(g_temp.numPanes == 1)\n\t\t\treturn(false);\n\t\t\n\t\tvar objData = g_functions.getStoredEventData(g_temp.storedEventID);\n\t\t\n\t\tvar passedTime = objData.diffTime;\n\t\t\n\t\tvar currentInnerPos = getInnerPos();\n\t\tvar passedDistanceAbs = Math.abs(currentInnerPos - objData.startInnerPos);\n\t\t\n\t\tif(passedDistanceAbs > 30)\n\t\t\treturn(true);\n\t\t\n\t\tif(passedDistanceAbs > 5 && passedTime > 300)\n\t\t\treturn(true);\n\t\t\t\t\n\t\treturn(false);\n\t}", "title": "" }, { "docid": "f49b828be426e125f36e5359f37aff65", "score": "0.6370226", "text": "function isSignificantPassed(){\n\t\t\n\t\tif(g_temp.numPanes == 1)\n\t\t\treturn(false);\n\t\t\n\t\tvar objData = g_functions.getStoredEventData(g_temp.storedEventID);\n\t\t\n\t\tvar passedTime = objData.diffTime;\n\t\t\n\t\tvar currentInnerPos = getInnerPos();\n\t\tvar passedDistanceAbs = Math.abs(currentInnerPos - objData.startInnerPos);\n\t\t\n\t\tif(passedDistanceAbs > 30)\n\t\t\treturn(true);\n\t\t\n\t\tif(passedDistanceAbs > 5 && passedTime > 300)\n\t\t\treturn(true);\n\t\t\t\t\n\t\treturn(false);\n\t}", "title": "" }, { "docid": "bae1635b3cd12978bcc27bdf5f1010a9", "score": "0.6294585", "text": "function ShowPointsEarned()\n{\n\tif(gm == null)\n\t\treturn;\n\t\t\n\tgm.GetComponent(PointsText).DisplayText(transform.position, \"\" + points, 5.0);\n\tpm.AddPoints(points);\n}", "title": "" }, { "docid": "46e532a368bcd2dbc1b040d1dd29c059", "score": "0.6238644", "text": "function showPointGen() {\n\treturn (tmp.pointGen.neq(new Decimal(0)))\n}", "title": "" }, { "docid": "20d3ecf20e46bb7012d83dac9d5b8738", "score": "0.6089518", "text": "function timerPoints(){\n\tpoints = Math.max(Math.floor((countDownTime - (elapsedTime / 1000))+1), 1); \n}", "title": "" }, { "docid": "c2109bee91f9667e307236a69317273c", "score": "0.6051014", "text": "function verifPtsAction(cout){\r\n\t\tvar ptsAction = recup('ptsAction');\t\r\n\t\tvar assez = true;\r\n\t\tif(ptsAction<cout){\r\n\t\t\tassez=false;\r\n\t\t}\r\n\t\treturn assez;\r\n\t\t}", "title": "" }, { "docid": "920a088c07d4a0b29a723cb59a6c67f7", "score": "0.59799385", "text": "function pointsCheck() {\n\tvar pointsFilter = points.toGeoJSON(); // Convert data to the right format for turf.js calculations\n\n\tfor (i in signposts) {\n\t\tvar ptsWithin = turf.pointsWithinPolygon(pointsFilter, window[signposts[i]]).features.length; // Use turf.js to count the points in a polygon. It returns a feature collection so we query the length. \n\n\t\tdocument.getElementById(signposts[i]).innerHTML = ptsWithin; // Finds the span in the target signpost and updates the count. jQuery alternative $('#'+signposts[i]).text(ptsWithin);\n\n\t\tvar name = signposts[i]+\"control\"; // Builds the name of the L.control object eg. NNWcontrol\n\t\tif (ptsWithin == 0) { // If the count is zero, we hide the signpost by adding a CSS class. If not, we remove the class.\n\t\t\twindow[name]._div.classList.add('hideSignpost');\n\t\t\t\t} else {\n\t\t\t\twindow[name]._div.classList.remove('hideSignpost');}\n\t}\n}", "title": "" }, { "docid": "b2d65b3afa975e624c0addd34a03e815", "score": "0.59764665", "text": "function checkPoints() {\n if (points >= 0 && points <= 1250) {\n setLevel(0);\n } else if (points >= 1251 && points <= 3750) {\n setLevel(1);\n } else if (points >= 3751 && points <= 7500) {\n setLevel(2);\n } else if (points >= 7501) {\n setLevel(3);\n }\n }", "title": "" }, { "docid": "f2f8db7899bd9caefb2f0fcc361165de", "score": "0.5918695", "text": "function atDotted() {\n\t\t\treturn yPos >= 100;\n\t\t}", "title": "" }, { "docid": "f2f8db7899bd9caefb2f0fcc361165de", "score": "0.5918695", "text": "function atDotted() {\n\t\t\treturn yPos >= 100;\n\t\t}", "title": "" }, { "docid": "840e2f78078c0132506eb08a0224cee4", "score": "0.5744497", "text": "function setPoints() {\r\n seconds = (end - start) / 1000\r\n alert(`Terminaste o jogo em ${seconds} segundos!!!`)\r\n}", "title": "" }, { "docid": "60ddde5ecdb6a9e52eea3e792bbff5cd", "score": "0.57433045", "text": "function setPoints() {\r\n \r\n seconds = (end - start) / 1000\r\n alert(`Terminaste o jogo em ${seconds} segundos!!!`)\r\n }", "title": "" }, { "docid": "d1f3c5d611ec1130713210cfe6a79bce", "score": "0.5649103", "text": "function showPointsRes() {\n $(\"#rndPointParagraph\").html(\"You achieve \" + rndPoints + \" points in this round!\");\n $(\"#totalPointParagraph\").html(\"Your total results is \" + totalPoints + \" points!\");\n}", "title": "" }, { "docid": "e892978f15984b0a0087012fc426802c", "score": "0.5631522", "text": "getPoints() { return 1; }", "title": "" }, { "docid": "ee8c06a31bb8e856d9f8cf7017c0f809", "score": "0.56118727", "text": "function highlightVictimsPoints( points ) {\r\n\tvar tmp = profile.letsfight;\r\n\t\r\n\tif (\r\n\t\t(tmp.max_points > points) &&\r\n\t\t(tmp.min_points < points)\r\n\t\t)\r\n\t\tstr = '<span class=\"high\">' + points + '</span>';\r\n\telse\r\n\t\tstr = '<span style=\"font-weight:bold\">' + points + '</span>';\r\n\t\r\n\treturn str;\r\n}", "title": "" }, { "docid": "133eb010ba06ce6601421f4988873d93", "score": "0.56081975", "text": "function isWorthPoints(grade_opt)\n{\n if (grade_opt == GRADING_OPT_1_PT)\n {\n return true;\n }\n else if (grade_opt == GRADING_OPT_2_PT)\n {\n return true;\n }\n else if (grade_opt == GRADING_OPT_3_PT)\n {\n return true;\n }\n else if (grade_opt == GRADING_OPT_4_PT)\n {\n return true;\n }\n else if (grade_opt == GRADING_OPT_5_PT)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "title": "" }, { "docid": "ed58ffab697fce11346a5c9ff27a8fa3", "score": "0.56026846", "text": "get isTrivial(): boolean {\n return this.offset === Infinity;\n }", "title": "" }, { "docid": "782ba5a9237aec1870fa1fd21ec26d15", "score": "0.55800253", "text": "visuallyContainsPoint(p, resolution) {\n // This closeEnough factor was chosen while tuning the unit test\n // for pow(x,y)=pow(y,x). I visually inspected that (0,0) looks included in\n // the graph and adjusted this factor so the point would pass this check.\n let closeEnough = resolution/1.4\n\n // containsPoint is a better check when the line segment is long\n if (this.containsPoint(p, closeEnough)) {\n return true\n }\n\n // These distance checks are better when the segment is short or\n // p is barely beyond one of the endpoints\n\n let dist1 = this.p1.distanceTo(p)\n let dist2 = this.p2.distanceTo(p)\n let distMid = this.midpoint().distanceTo(p)\n\n //if (p.x == 0.5 && p.y == 0.25 && (dist1+dist2+distMid < 0.3)) {\n // console.log(`vCP closeEnough ${closeEnough} dist1 ${dist1} dist2 ${dist2} distMid ${distMid} ${this.toString()}`)\n //}\n\n if ((dist1 < closeEnough) || (dist2 < closeEnough) || (distMid < closeEnough)) {\n return true\n }\n\n return false\n }", "title": "" }, { "docid": "7983f7f9bae10328bb45d81c7eed1da1", "score": "0.55761665", "text": "function showPointsOfInterest(amount) {\n if (pOIFlag) {\n let testPoints = []\n // the screenPoisition() function projects coordinates from 3D space into the 2D projections of the Screen\n let tZurich = screenPosition(zurich.x, zurich.y, zurich.z)\n let tCDMX = screenPosition(cdmx.x, cdmx.y, cdmx.z)\n for (let i = 0; i < amount; i++) {\n testPoints[i] = screenPosition(pOI[i].x, pOI[i].y, pOI[i].z)\n }\n let user = createVector(mouseX - windowWidth / 2, mouseY - windowHeight / 2)\n // in case the touch display or device is available use the touchX instead\n if (isTouch) {\n user = createVector(touchX - windowWidth / 2, touchY - windowHeight / 2)\n }\n // similar to pushMatrix()\n easycam.beginHUD()\n for (let i = 0; i < amount; i++) {\n if (user.dist(testPoints[i]) < 10) {\n fill(255, 180, 255)\n noStroke()\n circle(testPoints[i].x + windowWidth / 2, testPoints[i].y + windowHeight / 2, 15)\n let lat = Math.asin(pOI[i].z / r)\n let lon = Math.atan2(pOI[i].y, -pOI[i].x)\n lat = lat * 180 / Math.PI\n lon = lon * 180 / Math.PI\n textSize(12)\n let latLon = 'lat : ' + lat.toFixed(3) + ' , lon : ' + lon.toFixed(3);\n text(cities[i + 1] + \" , \" + latLon, testPoints[i].x + windowWidth / 2 + 10, testPoints[i].y + windowHeight / 2 + 5)\n } else {\n fill(200, 180, 200)\n noStroke()\n circle(testPoints[i].x + windowWidth / 2, testPoints[i].y + windowHeight / 2, 2)\n }\n }\n fill(255, 100, 100)\n if (user.dist(tZurich) < 25) {\n let lat = Math.asin(zurich.z / r)\n let lon = Math.atan2(zurich.y, zurich.x)\n lat = lat * 180 / PI\n lon = lon * 180 / PI\n textSize(16)\n let latLon = 'ZURICH, LAT : ' + lat.toFixed(3) + ' , LON : ' + lon.toFixed(3) + ' , Z pos : ' + tZurich.z\n if (mouseX > windowWidth / 2) {\n text(latLon, tZurich.x + windowWidth / 2 - 240, tZurich.y + windowHeight / 2 + 25)\n } else {\n text(latLon, tZurich.x + windowWidth / 2 + 20, tZurich.y + windowHeight / 2 + 25)\n }\n circle(tZurich.x + windowWidth / 2, tZurich.y + windowHeight / 2, 25)\n } else {\n circle(tZurich.x + windowWidth / 2, tZurich.y + windowHeight / 2, 15)\n }\n fill(100, 100, 255)\n circle(tCDMX.x + windowWidth / 2, tCDMX.y + windowHeight / 2, 5)\n // popMatrix()\n easycam.endHUD()\n }\n}", "title": "" }, { "docid": "ec610e3e78aef1b588342916264e5d9a", "score": "0.5535075", "text": "function showPoints(backwards = false) {\r\n if (backwards) {\r\n } else {\r\n d3.selectAll(\".Points-layer\").call(show);\r\n }\r\n }", "title": "" }, { "docid": "5e547d1c7f199b1701dd0f93f39d9276", "score": "0.55327034", "text": "function showPoint(e) {\n var pos = getMousePos(canvas, e); // get mouse coordinates on canvas\n var posX = pos.x; //X coordinates\n var posY = pos.y; //Y coordinates\n for (var i = 0; i < positionXArray.length; i++) {\n //if the mouse is located near by Point and status of the points that have not been selected\n if ((posX <= positionXArray[i] + 15) && (posX >= positionXArray[i] - 15) && (posY <= positionYArray[i] + 15) && (posY >= positionYArray[i] - 15) && !flag) {\n // display value data point from the outside\n var valuePoint = data.dataPoints[i].x + \" : \" + data.dataPoints[i].y;\n context.beginPath();\n // widh rectangle display container valuePoint\n context.lineWidth = \"2\";\n // color rectangle\n context.strokeStyle = splineStyle;\n // display rectangle\n context.rect(positionXArray[i] - 25, positionYArray[i] - 40, 50, 30);\n // background rectangle\n context.fillStyle = \"#f6f6f6\";\n // fill rectangle\n context.fill();\n context.stroke();\n // color text display valuePoint\n context.fillStyle = \"#032538\";\n // font text display valuePoint\n context.font = \"10pt Myriad Pro\";\n // display text\n context.fillText(valuePoint, positionXArray[i], positionYArray[i] - 20);\n // redraw larger radius points\n drawPoint(positionXArray[i], positionYArray[i], 4);\n // have point selected \n flag = true;\n break;\n }\n else if (flag) { //the mouse beyond point and have point selected\n // no points are selected\n flag = false;\n // redraw canvas with color white\n context.fillStyle = '#FFFFFF';\n // redraw canvas with rectangle width, height by width, height of canvas\n context.fillRect(0, 0, chartWidth, chartHeight);\n // redraw \n drawGenerality();\n }\n\n\n\n }\n }", "title": "" }, { "docid": "30c1a7f40f6d3a172cd7589e5d5133bf", "score": "0.5529002", "text": "function draw_points () {\n\n\t// draw points (either circles or squares)\n\tif (scatter_plot_type == \"circle\") {\n\t\tdraw_circles();\n\t} else {\n\t\tdraw_squares();\n\t}\n\n}", "title": "" }, { "docid": "6893114d2a4f14df9acadfa6fec6ca13", "score": "0.5523584", "text": "get is_overfull() {\n return this.num_points > this.capacity;\n }", "title": "" }, { "docid": "8d37e60269b50915c3f58f0719962687", "score": "0.55181855", "text": "isValidPointValue(pointValue) {\n return pointValue * 100 % 25 === 0;\n }", "title": "" }, { "docid": "914f1229ab37446433cd5e428cd20f95", "score": "0.5510179", "text": "actualizePoints(){\n\t\tif (this.previousPoints[0] != points[0]){\n\t\t\tthis.roundEndText1 = this.add.text(gameWidth*(12/60), gameHeight*(12/20), 'Un punto para el jugador 1', { font: '64px Caveat Brush', fill: '#ffffff' });\n\t\t} if (this.previousPoints[1] != points[1]){\n\t\t\tthis.roundEndText2 = this.add.text(gameWidth*(12/60), gameHeight*(16/20), 'Un punto para el jugador 2', { font: '64px Caveat Brush', fill: '#ffffff' });\n\t\t}\n\t\tthis.marcador.setText(points[0] + \" - \" + points[1]);\n\t}", "title": "" }, { "docid": "cdf0203aaf8bf10accd255c43cf2e7ed", "score": "0.54949796", "text": "updatePointsCounter() {\n this.currentScore.html('Points: ' + this.skier.points);\n this.highScore.html('High Score: ' + this.skier.highScore);\n this.allTimeScore.html('All Time High Score: ' + this.skier.allTimeHighScore);\n this.currentSpeed.html('Speed: ' + this.skier.skierSpeedDisplay + ' MPH');\n }", "title": "" }, { "docid": "dea038c140f472eb42b8c7a084d462d4", "score": "0.5492388", "text": "function showGameOverPanel(points) {\n earnedPoints.textContent = points;\n gameOverPanel.style.display = \"block\";\n}", "title": "" }, { "docid": "c1e345ad8b5c4cb959c9b13418a7dca1", "score": "0.54917896", "text": "get _hasTime() {\n return (this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds));\n }", "title": "" }, { "docid": "7270fab362c9813cb467773b2b18394a", "score": "0.5461967", "text": "async function statsShown() {\n // Checking whether the app is in zero state\n try {\n await page.waitForSelector(`div > fire-stat.stat.crashes > div > div.value-wrapper.ng-star-inserted > span`);\n await page.waitForSelector(`div > fire-stat.stat.secondary > div > div.value-wrapper.ng-star-inserted > span`);\n } catch (e) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "98172a5375d732cdcdc28f2a7759f80a", "score": "0.54518396", "text": "show() {\n //if this dot is the best dot from the previous generation then draw it as a big green dot\n if (this.isBest) {\n ctx.fillStyle = 'green'\n ellipse(this.pos.x, this.pos.y, 8, 8);\n }\n else { //all other dots are just smaller black dots\n ctx.fillStyle = 'black'\n ellipse(this.pos.x, this.pos.y, 2, 2);\n }\n\n // if (this.dead && !this.reachedGoal && !this.isBest) {\n // this.erase();\n // }\n }", "title": "" }, { "docid": "9fde6612b06811835cf38742456c0f12", "score": "0.54391706", "text": "isPoint() {\n return this.getWidth() === 0 && this.getHeight() === 0;\n }", "title": "" }, { "docid": "715810d3d583eec8665d23a44c1a3142", "score": "0.54309493", "text": "function checkSpeed(speed) {\r\n const speedLimit = 70;\r\n const kmPerPoint = 5\r\n if (speed < speedLimit + kmPerPoint) {\r\n console.log(\"Ok\");\r\n return;\r\n }\r\n const points = Math.floor((speed - speedLimit) / kmPerPoint);\r\n if (points >= 12)\r\n console.log(\"License suspended\");\r\n else\r\n console.log('Points', points);\r\n}", "title": "" }, { "docid": "0e85520ecac5b16bdd5a47b48b0d06aa", "score": "0.54225874", "text": "function whyNotPoint(img, pointName) {\n var pcolor = config.points[pointName];\n var pxcolor = getColor(img, pcolor);\n var diff = myDiffColor(pcolor, pxcolor);\n if (diff < 60) {\n mylog('dbg: v', diff, pointName, pcolor, pxcolor);\n } else {\n mylog('dbg: x', diff, pointName, pcolor, pxcolor);\n }\n}", "title": "" }, { "docid": "604051d137a6a2b0039457c371e4a0a1", "score": "0.5416718", "text": "renderPoints() {\n const curr_user = Users.findOne({pid: this.props.pid});\n const curr_points_history = curr_user.points_history;\n var points = 0;\n curr_points_history.map(curr_point => {\n if (curr_point.session === this.props.session_id) {\n points = curr_point.points;\n }\n });\n if (this.state.correct) {\n if (points !== 1) return <div><h2>You guessed right! You earned 1 point.<br/>Now you have {points} points!</h2></div>;\n else return <div><h2>You guessed right! You earned 1 point.<br/>Now you have {points} point!</h2></div>;\n } else {\n if (points !== 1) return <div><h2>You guessed wrong!<br/>You still have {points} points.</h2></div>;\n else return <div><h2>You guessed wrong!<br/>You still have {points} point.</h2></div>;\n }\n }", "title": "" }, { "docid": "9754e1d4dfbdea00f14674a95d219386", "score": "0.5414615", "text": "function pointValueList(settings) {\n var output = '';\n var pointCatCounter = 0;\n if(settings.powers == '20pts') {\n output += '20\\n';\n pointCatCounter++;\n }\n else if(settings.powers == '15pts') {\n output += '15\\n';\n pointCatCounter++;\n }\n output += '10\\n';\n pointCatCounter++;\n if(settings.negs == 'yes') {\n output += '-5\\n';\n pointCatCounter++;\n }\n while(pointCatCounter < 4) { //there must be exactly four lines\n output += '0\\n';\n pointCatCounter++;\n }\n return output;\n}", "title": "" }, { "docid": "b4de106e6afe1c7b0725313d792ffc97", "score": "0.5411905", "text": "function CheckScore(message) {\n\n if (/^\\d+(?:[.,]\\d+)?$/.test($('#points').val()) == false) {\n alert(message);\n el.css({\"visibility\" : \"hidden\"}); // Answer zone not visible\n } else {\n el.css({\"visibility\" : \"visible\"});// Answer zone visible\n }\n}", "title": "" }, { "docid": "796fd3a0b35bd1406ae562025627a20f", "score": "0.54097825", "text": "function displayStartPoints(){\n\t\t\t\n\n\n\t\t\tif(singleFeatureSelection == false){\n\t\t\tclearMap();\n\t\t\t\n\t\t\tpointsLayer = L.geoJson(pointsObj, {\n\t\t\tonEachFeature: onEachFeature,\n\t\t\t\n\t\t\tfilter: function (feature, latlng) {\n\t\t\t\t\n\t\t\t\treturn feature.properties.position == 0;\n\t\t\t},\n\t\t\tpointToLayer: function (feature, latlng) {\n\t\t\t\treturn L.circleMarker(latlng, startMarkerOptions);\n\t\t\t}\n\n\t\t});\n\t\tpointsLayer.setStyle(startMarkerOptions);\n\t\tpointsLayer.addTo(map);\n\t\tsingleFeatureSelection = true;\n\t}else{\n\t\t\tclearMap();\n\t\t\tpointsLayer = L.geoJson(pointsObj, {\n\t\t\tonEachFeature: onEachFeature,\n\t\t\t\n\t\t\tfilter: function (feature, latlng) {\n\t\t\t\t\n\t\t\t\treturn feature.properties.position == 0;\n\t\t\t},\n\t\t\tpointToLayer: function (feature, latlng) {\n\t\t\t\treturn L.circleMarker(latlng, startMarkerOptions);\n\t\t\t}\n\n\t\t}).addTo(map);\n\t\t\tsingleFeatureSelection = false;\n\t\t\n\t}\t\n}", "title": "" }, { "docid": "c95b64d48b09c453fb2bbfcaae093a6c", "score": "0.54066646", "text": "function statistics() {\n\tvar time = Date.now() - startTime - pauseTime;\n\tvar seconds = ((time / 1000) % 60).toFixed(2);\n\tvar minutes = ~~(time / 60000);\n\tstatsTime.innerHTML =\n\t\t(minutes < 10 ? '0' : '') + minutes + (seconds < 10 ? ':0' : ':') + seconds;\n}", "title": "" }, { "docid": "8026ad050e70e65e54c1132cc51dde72", "score": "0.5404366", "text": "isOvershooting() {\n const start = this._startValue\n const end = this._endValue\n return (\n this._springConfig.tension > 0 &&\n ((start < end && this.getCurrentValue() > end) ||\n (start > end && this.getCurrentValue() < end))\n )\n }", "title": "" }, { "docid": "fd56b76090df301376dbb4202388c9e6", "score": "0.54042274", "text": "function is_playPose() {\n let off;\n\n if ('nose' in allPoints &&\n 'leftShoulder' in allPoints &&\n 'rightShoulder' in allPoints &&\n 'leftElbow' in allPoints &&\n 'leftWrist' in allPoints &&\n 'rightElbow' in allPoints) {\n // LOOP\n for (let i in allPoints) {\n if (i in playPosePoints && dist(allPoints[i].getX(), allPoints[i].getY(), playPosePoints[i][0], playPosePoints[i][1]) > safeR) {\n off = true;\n break;\n } else {\n off = false;\n }\n }\n // LOOP END\n if (!off) {\n offTime = 0;\n return true;\n } else if (off) {\n if (offTime > 100) {\n return false;\n } else {\n // Not off long enough\n offTime += 1;\n return true;\n }\n }\n } else {\n // Not all points detected\n return false;\n }\n}", "title": "" }, { "docid": "70556d20d9bde1c50eaaf5193c017000", "score": "0.5404056", "text": "function showResult() {\n if (area <= 400000) {\n stressCounter++;\n changeBg();\n }\n}", "title": "" }, { "docid": "fea99cc31af3973da29e45c0f017efd1", "score": "0.5400854", "text": "setShowFps(val) {\n this.showFps = val;\n }", "title": "" }, { "docid": "725595f823d51ce1bcf5bed0c52f26f0", "score": "0.5382328", "text": "scatterModeEnded() {\n // if current mode of ghost is scatter and duration of timer is equal to duration of scatter mode\n // reset and return true\n if (this.mode.scatter && this.timer == this.scatterModeDuration) {\n this.timer = 0;\n return true;\n }\n return false;\n\n }", "title": "" }, { "docid": "9037a6e23b6f26548dc10f928a98bd1e", "score": "0.5365052", "text": "function rateCheck(point, rate) {\n var pt = Number(point);\n var rt = Number(rate);\n if (Math.floor(Math.random() * 100) - rt <= 0) {\n total = total + pt;\n createLog(1, pt);\n count++;\n } else {\n total = total - pt;\n createLog(0, pt);\n count++;\n }\n document.getElementById('total').innerHTML = `${total}`;\n document.getElementById('count').innerHTML = `${count}`;\n drawProgress();\n endCheck();\n}", "title": "" }, { "docid": "fbbe281dc85dbcdc660e2b40af510382", "score": "0.53548443", "text": "function betterThanAverage(classPoints, yourPoints) {\n return classPoints.reduce((tot, item) => tot += item, 0) / classPoints.length > yourPoints ? false : true\n }", "title": "" }, { "docid": "46dbd7491ef7f79fd15c7c4d12c74c04", "score": "0.5349992", "text": "function checkSpeed(speed) {\n const speedLimit = 70\n const kmPerPoint = 5;\n if (speed < speedLimit + kmPerPoint )\n return 'Ok';\n let point = Math.floor((speed - speedLimit) / 5);\n return point >= 12 ? \"Lisence suspended\" : 'Point : ' + point;\n\n}", "title": "" }, { "docid": "3c0e7d5ea027ff444f1e30003c31e706", "score": "0.53482157", "text": "function getGoodPosture(curPoints) {\n let expShoulderDiff = [Math.abs(initPosturePoints[5].x - initPosturePoints[6].x), Math.abs(initPosturePoints[5].y - initPosturePoints[6].y)];\n let curShoulderDiff = [Math.abs(curPoints[5].x - curPoints[6].x), Math.abs(curPoints[5].y - curPoints[6].y)];\n for (let i = 0; i < curPoints.length; i++) {\n if (Math.abs(initPosturePoints[i].x - curPoints[i].x) > 100 || Math.abs(initPosturePoints[i].y - curPoints[i].y) > 50 || \n Math.abs(expShoulderDiff[0] - curShoulderDiff[0]) > 40 || Math.abs(expShoulderDiff[1] - curShoulderDiff[1]) > 20) {\n if(color !== 'red') {\n color = 'red';\n notificationBtn.click();\n }\n localPostures[1]++;\n break;\n } else {\n color = 'green';\n localPostures[0]++;\n }\n }\n}", "title": "" }, { "docid": "561df83e9040c738053dcfa1274ef7cf", "score": "0.5339641", "text": "function speedIndicators(){\n $('.speedDisplay').text(Math.round(audio.playbackRate/1*100)/100 +\" x\");\n if (audio.playbackRate>1){\n $('.speedUp').css('opacity','.7');\n $('.slowDown').css('opacity','');\n } else if (audio.playbackRate < 1){\n $('.slowDown').css('opacity','.7');\n $('.speedUp').css('opacity','');\n } else {\n $('.speedDisplay').text(\"\");\n $('.slowDown').css('opacity','');\n $('.speedUp').css('opacity','');\n }\n }", "title": "" }, { "docid": "a9dfab2e6584384cf3180ded31443ec5", "score": "0.53305227", "text": "function checkSpeed(speed) {\r\n let points;\r\n if (speed < 75) return \"Ok\";\r\n else if (speed >= 75 && speed < 180) {\r\n points = (speed - 70) / 5;\r\n return points;\r\n }\r\n return \"License suspended\";\r\n}", "title": "" }, { "docid": "9ccd218aeaa38043da247841f01660d7", "score": "0.5329799", "text": "showStatus() {\r\n if (this.values.length === 0)\r\n return 'Game has not been analyzed yet.'\r\n return 'The average value of the game is ' + Math.round(this.values[0]*10)/10 + '.'\r\n }", "title": "" }, { "docid": "b1f7b78b5ca4678840f9253390d374df", "score": "0.5328114", "text": "function checkSpeed(speed) {\n const speedLimit = 70;\n const kmPerPoint = 5;\n const maxPoints = 12;\n\n if (speed < speedLimit + kmPerPoint) \n console.log(\"OK\");\n else {\n const points = Math.floor((speed - speedLimit) / kmPerPoint);\n if (points >= maxPoints) console.log(\"License Suspended\");\n else console.log(\"Points\", points);\n }\n}", "title": "" }, { "docid": "0916a7c04af81956af69ae861635e679", "score": "0.5323578", "text": "function shouldBeVisible() {\n return visibleValues > 1;\n}", "title": "" }, { "docid": "0916a7c04af81956af69ae861635e679", "score": "0.5323578", "text": "function shouldBeVisible() {\n return visibleValues > 1;\n}", "title": "" }, { "docid": "9a0e0193ea4167d8d434f40701418f4c", "score": "0.5323153", "text": "function drawPoints() {\n if (time < 260) {\n for (var i = 0; i < points.length; i++) {\n points[i].move(points[i].direction);\n points[i].display();\n }\n }\n else if (time >= 260 && time < 480) {\n for (var i = 0; i < points.length; i++) {\n points[i].glide();\n points[i].display();\n }\n }\n else if (time >= 480) {\n for (var i = 0; i < points.length; i++) {\n points[i].finalize();\n }\n }\n}", "title": "" }, { "docid": "dec01884027f1646aea8f8565a7176e5", "score": "0.5321773", "text": "ifMoreThanTwoSeconds() {\n\n var currentTime = Date.now();\n\n // if the square's color is white (starting point)\n if(this.time == 0) {\n this.time = Date.now();\n return true;\n }\n\n if((currentTime - this.time) > 2000) {\n // print out the difference in time (ms) between the second color change\n // to the first color change\n console.log(currentTime - this.time);\n this.time = currentTime;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "538e216a0077690a013ba8b23a50c647", "score": "0.5294728", "text": "shouldMetric() {\n\t\tif (this.options.metrics) {\n\t\t\tthis._sampleCount++;\n\t\t\tif (this._sampleCount * this.options.metricsRate >= 1.0) {\n\t\t\t\tthis._sampleCount = 0;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "d43e532ee04dc0462e3153d6b65c1693", "score": "0.5294698", "text": "function displaypoint() {\r\n\t\tvar i;\r\n\t\tfor(i=0; i< selectedFeatures.length; i++) {\r\n\t\tselectedFeatures[i].setStyle(null);\r\n\t\t}\r\n\t\tselectedFeatures = [];\r\n\t\tvar env1 = (mapleft.getSize()[0])/2;\r\n\t\tvar env2 = (mapleft.getSize()[1])/2;\r\n\t\tvar pixel = [];\r\n\t\tpixel.push(Math.round(env1),Math.round(env2));\r\n\t\tif (mapleft.getView().getZoom() > 8)\r\n\t\t{\r\n\t\tdisplayFeatureInfo(pixel);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "69fa14bc9a246a6d66125fe0558c8657", "score": "0.5285498", "text": "calcPoints(){\n \n }", "title": "" }, { "docid": "c4462ef1837f04c57b88bb354bd91821", "score": "0.52761954", "text": "showPoints(points) {\n this.load().then(() => {\n this.resetMap();\n this.pointsLayer.setVisible(true);\n this.pointsLayer.clear();\n points.forEach(p => this.showPoint(p, this.genericColors[4]));\n this.centerMapOnMedian(points);\n });\n }", "title": "" }, { "docid": "a541bbdb74955e4bc6096660a2b799da", "score": "0.5275642", "text": "function showpt()\n{\nvar times = prayTimes.getTimes(new Date(), [43, 87], 6);\n//showDot(times.sunrise);\n//showDot(times.sunset);\n\nshowDot(times.fajr,\"بامدات\");\nshowDot(times.dhuhr,\"پىشىن\");\nshowDot(times.asr,\"ئەسىر\");\nshowDot(times.maghrib,\"شام\");\nshowDot(times.isha,\"خۇپتەن\");\n\n\n}", "title": "" }, { "docid": "8651893ee6d1b1cd54a6c26658d287c9", "score": "0.5275513", "text": "function renderTime() {\n minutesDisplay.textContent = getFormattedMinutes();\n secondsDisplay.textContent = getFormattedSeconds();\n if (timeElapsed >= totalSeconds) {\n stopTimer();\n }\n }", "title": "" }, { "docid": "94bb2881b763561d8cafdb1ea3edcb20", "score": "0.52737224", "text": "function validPoint(point) {\r\n if (point[0] >= 0 && point[1] <= outerHeight - margin.top - margin.bottom) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "8ab9a7fe3c0826f3f2acceff27f33652", "score": "0.5268424", "text": "function drawSecondsAnnotation() {\n\n}", "title": "" }, { "docid": "f617ce70720e201dd4acb42b909778b2", "score": "0.5268239", "text": "async isRetirementFriendly() {\r\n const suburbInfo = this.props.stats;\r\n var agesArray = suburbInfo.demographics[0].items;\r\n var arrayLength = agesArray.length;\r\n if (arrayLength === 0) {\r\n return false;\r\n }\r\n const total = suburbInfo.demographics[0].total;\r\n for (var i = 0; i < arrayLength; i++) {\r\n if (agesArray[i].label === \"60+\") {\r\n if ((agesArray[i].value / total) > 0.15) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fc73c4b9a600d95fcd07adf121864d3a", "score": "0.5266808", "text": "function displayPoints(pointsToDisplay, pointsToHide) {\n d3.select(\"#slider-tooltip\")\n .classed(\"hidden\", true);\n d3.selectAll(pointsToDisplay)\n .style(\"display\", \"block\");\n d3.selectAll(pointsToHide)\n .style(\"display\", \"none\");\n}", "title": "" }, { "docid": "7d87c340c17738395f03d9c9a902684c", "score": "0.52630955", "text": "function counterTick() {\n\tif (this.points > 0)\n\t\tthis.points--;\n\tthis.printPoints();\n}", "title": "" }, { "docid": "7429b7c23ff3b8b935acaffaef2c12b4", "score": "0.5259325", "text": "infoHover(){\n let d = dist(mouseX, mouseY, this.x, this.y);\n if(d < this.size/2){\n this.viewing = true;\n return true;\n }\n else{\n this.viewing = false;\n return false;\n }\n }", "title": "" }, { "docid": "c25decfa6302f6433c074729fffbeb7d", "score": "0.52457654", "text": "printStats() {\n\t\tconst $timer = $('#timer');\n\t\tconst $score = $('#score');\n\t\t$timer.text(`TIMER: ${this.time}s`)\n\t\t$score.text(`SCORE: ${Math.floor(this.score)}`)\n\t}", "title": "" }, { "docid": "7adfabe44dc1c644a0c91d028b0b4a89", "score": "0.52406454", "text": "function _tracksTotalDwellTime() {\n return config.dwellTimes === true || config.dwellTimes.total;\n }", "title": "" }, { "docid": "e85b20b800f1e05d00a7dfb18595f11e", "score": "0.523384", "text": "function show_stats(minute) {\n var probs = get_minute_stats(minute),\n results = ['win', 'lose', 'draw']\n\n results.forEach(function(r) {\n var output = d3.select('#' + r + '-rate')\n\n output.text(function() {\n return probs[r] !== undefined ? formatPercentOne(probs[r]) : '-'\n })\n })\n\n ct_output = d3.select('#game-ct')\n ct_output.text(function() {\n return probs.ct && probs.ct > 0 ? formatNum(probs.ct) : '-'\n })\n }", "title": "" }, { "docid": "de7daa9ef436fd389f87ba17fba650e6", "score": "0.5232143", "text": "get times_displayed() {\n var i = Cookies.get(`hint_${this.get(\"hint_id\")}`);\n if(i == null)\n return 0;\n else\n return parseInt(i);\n }", "title": "" }, { "docid": "ece02e645e081383c6890f8e2d138cda", "score": "0.52257323", "text": "function displayTime(totalMinutes, secondsPerMinute){\n // console.log(totalMinutes, secondPerMinute);\n if(totalMinutes == 2){\n totalMinutes = 1;\n }\n if(secondsPerMinute < 10){\n timeLeft.textContent = totalMinutes + \":\" + \"0\" + secondsPerMinute;\n }\n else{\n timeLeft.textContent = totalMinutes + \":\" + secondsPerMinute;\n }\n //secondsLeft = secondsPerMinute; \n}", "title": "" }, { "docid": "d413e6b42976edc8495e8ff718414e9f", "score": "0.52251655", "text": "pointsScore() {\n if(this.tieBreak) {\n return this.players[0].points + \"-\" + this.players[1].points;\n }\n\n if(this.advantage == 1)\n {\n return \"Advantage \" + this.players[0].name;\n }\n\n if(this.advantage == 2)\n {\n return \"Advantage \" + this.players[1].name;\n }\n\n if(this.advantage == 3)\n {\n return \"Deuce\";\n }\n\n return this.pointsKey[this.players[0].points] + \"-\" + this.pointsKey[this.players[1].points];\n }", "title": "" }, { "docid": "d405f97384e073d0c30105213d51904b", "score": "0.5221607", "text": "_hitTest(point) {\n\n if (point.y < this.ruler.props.height) {\n\n if (this.props.loop) {\n let loopRect = this._getLoopRect();\n\n if (point.y >= loopRect.y1 && point.y < loopRect.y2) {\n if (Math.abs(point.x - loopRect.x1) < 5) {\n return this.loopStartMarker;\n } else if (Math.abs(point.x - loopRect.x2) < 5) {\n return this.loopEndMarker;\n } else if (point.x >= loopRect.x1 && point.x < loopRect.x2) {\n return this.loopLengthMarker;\n }\n }\n }\n\n if (point.x) {return this.ruler;}\n }\n return this.waveForm;\n }", "title": "" }, { "docid": "4f4a9e3b35c95e0e08801f94690f31b6", "score": "0.5218448", "text": "estVivant()\n\t{\n\t\treturn this._pointsDeVie > 0;\n\t}", "title": "" }, { "docid": "13a4bf350bb786bf88a9fa7224aaba44", "score": "0.5210148", "text": "function revealPoints(add){\n\n if(playerTurn%2==0){ \n pointsP1+=helper;\n document.getElementById(\"pointsPlayer1\").innerHTML = \"You have $\" + pointsP1;\n document.getElementById(\"myBtn\").style.display = \"inline\";\n }\n\n else{\n pointsP2+=helper;\n document.getElementById(\"pointsPlayer2\").innerHTML = \"You have $\" + pointsP2;\n document.getElementById(\"myBtn\").style.display = \"inline\";\n } \n\n }", "title": "" }, { "docid": "e383d99452cc865269945c8e181bfcdc", "score": "0.5207097", "text": "function drawPoints() {\n \tctx.fillText(player.points.toString(), 0, 40);\n }", "title": "" }, { "docid": "587d34277445d7b2cfe0ccd5af60264d", "score": "0.52064955", "text": "isTourPoint(){\n if(this.type !== MapPointType.WAYPOINT){ return true; }\n return false;\n }", "title": "" }, { "docid": "46e7ca3595ddc44fc9dc5619889ff006", "score": "0.5204084", "text": "function _tracksDwellTimePerSlide() {\n return config.dwellTimes === true || config.dwellTimes.perSlide;\n }", "title": "" }, { "docid": "6c0c6e7aac06d0aa1fb0330be59b87a0", "score": "0.51999766", "text": "function isTimeCorrect() {\n // Get Current time\n let timeNow = new Date();\n if (timeNow.getSeconds() - lastClickedTime < 0.2){\n return true;\n }\n lastClickedTime = timeNow.getSeconds();\n return false;\n }", "title": "" }, { "docid": "6579a77523d537b0ab6d319cd11915f2", "score": "0.5195764", "text": "function displayBlock(){\n var time = 9;\n console.log(`comparing ${time} to ${currentMilitaryTime}`)\n if (time < currentMilitaryTime) {\n console.log(\"time is less than currenttime\")\n $(\".notes\").addClass(\"past\");\n } else {\n console.log(\"time is NOT less than currentTime\")\n }\n}", "title": "" }, { "docid": "92e17615dad7a636a319267c9d71a963", "score": "0.5189066", "text": "function betterThanAverage(classPoints, yourPoints) {\n let total = 0;\n for(let i = 0; i < classPoints.length; i++) {\n total += classPoints[i]\n }\n let average = total / classPoints.length\n if(yourPoints > average) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "9527c40292563a6a68559b69271b399c", "score": "0.518468", "text": "function checkpoints(){\n if(playerPoints >= 500){\n winGame();\n }\n}", "title": "" }, { "docid": "2a13124fbe78e506c07262366efabfc2", "score": "0.51821107", "text": "function showStats() {\n alert(\"Stats:\" + wins + \", losses:\" + losses + \", ties:\" + ties);\n }", "title": "" }, { "docid": "6281e901b02d1dbc60d2afb1767261af", "score": "0.5172786", "text": "get isDisplayLimitReached() {\n return (Cookies.get(`hint_${this.get(\"hint_id\")}_never_show_again`) == \"1\") || (this.get(\"display_limit\") != null && this.get(\"display_limit\") <= this.times_displayed);\n }", "title": "" }, { "docid": "6e9dd6ba244ac9b13788ba8246cf4e5f", "score": "0.5170629", "text": "function getDecimalPlaces() {\n return cur_dampening > accurate_dampening ? 2 : 1;\n}", "title": "" }, { "docid": "6b7a4f1f0792b67f552fe263832665c4", "score": "0.51703423", "text": "function showCoordinates(pt) {\n var coords = \"Lat/Lon \" + pt.latitude.toFixed(3) + \" \" + pt.longitude.toFixed(3) + \n \" | Scale 1:\" + Math.round(view.scale * 1) / 1 +\n \" | Zoom \" + view.zoom;\n coordsWidget.innerHTML = coords;\n }", "title": "" }, { "docid": "8e1784174989d4d8456395eddb3c1afc", "score": "0.51681894", "text": "function checkPlay() {\n \n if(DEBUG) {\n console.log(\"checkPlay() :: CurrentVideo:\",player.getPlaylistIndex(),\"CurrentTime:\",player.getCurrentTime(),\"Totaltime\",player.getDuration());\n }\n \n if(player.getCurrentTime() > 0.5 && player.getCurrentTime() < player.getDuration() - 1 && player.getPlayerState() == 1) { // duration values have to be the same\n hideNoise();\n }\n if(player.getCurrentTime() != 0.5 && player.getCurrentTime() > player.getDuration() - 1 ) { // duration values have to be the same\n showNoise();\n }\n}", "title": "" }, { "docid": "4ec01d9940e77b91ff3facebd6eecb9d", "score": "0.5165895", "text": "function checkPoint () {\n\t'use strict';\n\tvar pointX = document.getElementById('pointX').value;\n\tvar pointY = document.getElementById('pointY').value;\n\n\tdocument.getElementById('checkPointOutput').innerHTML = Math.pow(pointX, 2) + Math.pow(pointY, 2) <= Math.pow(5, 2);\n}", "title": "" }, { "docid": "6ca9beaae990751e2f3a1e6489ad99f3", "score": "0.515611", "text": "function checkScore() {\n if (moves === 15 || moves === 18 || moves === 22) {\n hideStar();\n }\n}", "title": "" }, { "docid": "e8118978dbeeab7de1f54f4e038cb6b1", "score": "0.5154623", "text": "function isParticleVisible(particle) {\n if (particle.opacity <= 0) {\n return false;\n }else {\n return true;\n }\n}", "title": "" }, { "docid": "e8376ac4f98648ed4e010e28bfff17ce", "score": "0.5151214", "text": "function spotPoint(y, x, p, c) {\n // console.log(\"points\" + x, y);\n if (spotFade != 0) {\n clearInterval(timerId);\n }\n spotScore.innerHTML = p;\n spotScore.style.color = c;\n spotScore.style.opacity = 1;\n opacity = 1;\n spotScore.style.visibility = \"visible\";\n spotScore.style.top = y + 'px';\n spotScore.style.left = x + 'px';\n hideScore()\n spot++;\n\n function hideScore() {\n setTimeout(function() { // start a delay\n spotScore.style.opacity = 1;\n spotFade++;\n timerId = setInterval(function() {\n opacity = spotScore.style.opacity;\n if (opacity == 0) {\n clearInterval(timerId);\n spotFade = 0;\n } else {\n spotScore.style.opacity = opacity - 0.05;\n }\n }, 100);\n }, 500);\n }\n\n}", "title": "" }, { "docid": "36d2f2ceaa24df29d86bacf801f1f4c6", "score": "0.5147016", "text": "function pt(t){// Detect if the value is -0.0. Based on polyfill from\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nreturn 0===t&&1/t==-1/0;}", "title": "" }, { "docid": "e75413b422f42df32eb9070ba7a11480", "score": "0.5143899", "text": "function updatePointsDisplay(points) {\n const scoreReadOutElement = document.getElementById(\"scoreReadOut\");\n scoreReadOutElement.innerText = points;\n\n}", "title": "" }, { "docid": "44b70701cc190bd5c41d922a65ed0656", "score": "0.51394933", "text": "function displayTime() {\n\t\tvar minutes = Math.floor(myPlayer.currentTime / 60);\n\t\tvar seconds = Math.round(myPlayer.currentTime % 60);\n\n\t\tvar durMinutes = Math.floor(myPlayer.duration / 60);\n\t\tvar durSeconds = Math.round(myPlayer.duration % 60);\n\n\t\tif (durSeconds < 10) {\n\t\t\tdurSeconds = \"0\" + durSeconds;\n\t\t}\n\n\t\tif (seconds < 10) {\n\t\t\tseconds = \"0\" + seconds;\n\t\t} else if (seconds == 60) {\n\t\t\tseconds = \"00\";\n\t\t}\n\n\t\t// show the calculated time in the control bar\n\t\ttimeCounter.innerHTML = minutes + \":\" + seconds + \" / \" + durMinutes + \":\" + durSeconds;\n\t}", "title": "" }, { "docid": "01b8d88784f00093d7d6eb308e1300ec", "score": "0.5138097", "text": "function collectPoints(point) {\n \n //if the distance between the center point of the enemy and the center point of the player is less than the enemies width divided by two plus the players width divided by two\n if (checkDistance(point.x, point.y, this.dx+12, this.dy+12) < (point.radius + 12/2)) {\n \n return true;\n }\n \n return false;\n \n }", "title": "" }, { "docid": "025bb9d7929e5a0437ff02e87370a08e", "score": "0.5136266", "text": "function addStrenght(){ \r\n if (pointlimit > 0){\r\n strenghtpoints = strenghtpoints + 1;\r\n pointlimit = pointlimit - 1;\r\n console.log(\"You now have Strenght \" + strenghtpoints);\r\n }\r\n else{\r\n alert(\"You don't have any points left\");\r\n }\r\n changepoints(); \r\n}", "title": "" }, { "docid": "db99c49d053eea6cc3881cebe36b0d4e", "score": "0.5133049", "text": "function showResult() {\n\n if (playerScore > computerScore) {\n\n console.log(`Good Job! You Won! \\nPlayer: ${playerScore} | Computer: ${computerScore}`);\n\n } else if (playerScore < computerScore) {\n\n console.log(`You Suck! You Lost! \\nPlayer: ${playerScore} | Computer: ${computerScore}`);\n\n }\n }", "title": "" }, { "docid": "cf1f8e0fb96ad4eb92da069cd12b34d5", "score": "0.5130849", "text": "function rbpoints() {\n\tif(CMC.checked){\n\t\treturn(1);\n\t}\n\telse {\n\t\treturn(0);\n\t}\n}", "title": "" }, { "docid": "7eef5844cb8ed2bd1514e54b58984e02", "score": "0.51260686", "text": "function gameOver () {\n clearInterval(timer);\n var pointElement = document.getElementById(\"showPoints\")\n var endscreen = document.querySelector(\"#end-screen\");\n endscreen.removeAttribute(\"class\");\n questionsElement.setAttribute(\"class\", \"hide\");\n pointElement.innerHTML = \"Total correct answers:\" + \" \" + correctAnswer;\n}", "title": "" }, { "docid": "bfce087bbbc40a9c4f1fb069eba95f63", "score": "0.5121465", "text": "function showInfo(){\n if(infoYN[page]){\n return true;\n }else{\n return false;\n }\n }", "title": "" } ]
948cd91ee4144c1b9c2bc95a738c8156
Function renderRegisterConfirmationMessage() renders a modal confirming to the user that their account has been created. Precondition: The Register button is clicked and all the Register form's inputs are correctly filled. Postcondition: A modal is rendered confirming to the user that their account has been created.
[ { "docid": "23cb446ae555048a12922abd392c2993", "score": "0.7359084", "text": "function renderRegisterConfirmationMessage()\n{\n const modal = document.querySelector(\".modal\");\n\n modal.innerHTML = `\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <span class=\"close\">&times;</span>\n <h2>Account Confirmation</h2>\n </div>\n <div class=\"modal-body\">\n <p>\n Your account has been registered!\n </p>\n </div>\n </div>`;\n modal.style.display = \"block\";\n document.querySelector(\".close\").addEventListener(\"click\", () => {\n modal.style.display = \"none\";\n });\n window.onclick = (event) => {\n if (event.target == modal)\n {\n modal.style.display = \"none\";\n }\n }\n}", "title": "" } ]
[ { "docid": "0c81a0ba7051878762c6aacbd6335a50", "score": "0.645016", "text": "function register() {\n var username = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[0].value;\n var password = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[1].value;\n var confirmPassword = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[2].value;\n var email = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[3].value;\n document.getElementById(\"registrationForm\").getElementsByTagName(\"p\")[0].style.display = \"none\";\n\n // Client-side validation.\n if (username === 'undefined' || username == '') {\n alert (\"Please enter a username.\");\n }\n else if (password === 'undefined' || password == '') {\n alert (\"Please enter a password.\");\n }\n else if (confirmPassword != password) {\n alert (\"Passwords do not match.\");\n }\n else if (!validateEmail(email)) {\n alert (\"Invalid email address.\");\n }\n\n // Valid, send to server and await response.\n else {\n authCreateAccount(username, password, email, function (loginResponse) {\n switch (loginResponse) {\n case (RESPONSE_ACCOUNT_CREATED):\n closeModals ();\n openModal(null, genericMessageModal,\n {\n messageTitle:\"Registration Success!\",\n message:\"Welcome to Adventure Guild, \" + username + \"! Check your email to confirm your account.\",\n });\n m.route(\"/home\");\n break;\n case (RESPONSE_USERNAME_TAKEN):\n document.getElementById(\"registrationForm\").getElementsByTagName(\"p\")[0].style.display = \"block\";\n break;\n case (RESPONSE_LOGGED_IN):\n alert(\"Already logged in\");\n break;\n default:\n alert(\"Unknown response code: \" + loginResponse);\n break;\n }\n });\n }\n\n // Suppress submission page refresh;\n return false;\n}", "title": "" }, { "docid": "c0883fac0d89beaa83d00924eded36b2", "score": "0.63860744", "text": "function confirmationTemplate(){\n const firstName = formData.First;\n const lastName = formData.Last;\n const phone = formData.Phone;\n const email = formData.Email;\n const address = formData.Address;\n const city = formData.City;\n const state = formData.State;\n const zip = formData.Zip;\n const newLocation = formData.New;\n const company = formData.Company;\n const agentId = formData.AgentId;\n var confirmationMessage = 'Please confirm all the information filled is correct.\\nYou are submitting the following \\n\\n' + \n 'First Name: ' + firstName + '\\n' + \n 'Last Name: ' + lastName + '\\n' + \n 'Phone Number: ' + phone + '\\n' +\n 'Email Address: ' + email + '\\n' +\n 'Address: ' + address + ' ' + city + ', ' + state + zip + '\\n' + \n 'New Location: ' + newLocation + '\\n' +\n 'Your Agent ID: ' + agentId + '\\n' +\n 'Sending Request to: ' + company;\n return confirmationMessage;\n }", "title": "" }, { "docid": "981db5562701be58a94113c06cfca2f6", "score": "0.63549936", "text": "function registerCallback(result)\n{\n\tif(result === true)\n\t{\n\t\t$(\"#modal\").modal({backdrop: \"static\", keyboard: false, show: true});\n\t\t$(\".modal-body\").html(\"<p>You're account has been created, using some default values.<br/><br/>For Phood Buddy to give you recipes and information that helps <i>you</i> the most,<br/>it needs to know you better.<br/><br/> Go to the settings page after logging in to complete that information.</p>\");\n\t\t$(\".modal-header\").html(\"Registration Successful\");\n\t\t$(\"#btn-confirm\").click(function(){\n\t\t\twindow.location = \"https://phood-buddy.com/login.html\";\n\t\t});\n\t\t$(\"#btn-cancel\").css(\"display\", \"none\");\n\t}\n\telse\n\t{\n\t\t$(\"#modal\").modal({backdrop: \"static\", keyboard: false, show: true});\n\t\t$(\".modal-header\").html(\"Registration Failed\");\n\t\t$(\".modal-body\").html(\"<p>We had trouble registering your account. Perhaps that email has already been used to create an account at Phood Buddy.</p>\");\n\t\t$(\"#btn-cancel\").css(\"display\", \"none\");\n\t\t$(\"#btn-confirm\").click(function(){\n\t\t\t$(\"#btn-cancel\").css(\"display\", \"inline-block\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "be22ccc613429d398336a6f187c69cd9", "score": "0.6024729", "text": "function handleUserRegister() {\n\tvar name = $(\"#registerForm #name\").val();\n\tvar email = $(\"#registerForm #email\").val();\n\tvar password = $(\"#registerForm #password\").val();\n\tvar confirmPassword = $(\"#registerForm #confirmPassword\").val();\n\tvar storeId = $(\"#registerForm #storeId\").val();\n\n\t$('.registerNotification').html('');\n\tif (registrationIsValid(name, email, password, confirmPassword)) {\n\t\tvar result = requestAddCostumer(name, email, password, storeId);\n\n\t\tif (result == \"ok\") {\n\t\t\t$('.registerNotification')\n\t\t\t\t\t.html(\n\t\t\t\t\t\t\t'<div class=\"alert alert-success\"> Registration is complete! </div>');\n\t\t\tsetTimeout(function() {\n\t\t\t\t$('#registrationModal').modal('hide');\n\n\t\t\t}, 1500);\n\t\t} else if (result == \"userExists\") {\n\t\t\t$('.registerNotification')\n\t\t\t\t\t.html(\n\t\t\t\t\t\t\t'<div class=\"alert alert-error\"> Email already in use! </div>');\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "02419be36337c5847ac2b169c8380be5", "score": "0.5985611", "text": "function registerSuccess() {\n\tvar name = $('#register-name').val();\n\tvar mobile = $('#register-mobile').val();\n\t\n\tshowDemoModal('Your TextKey Sample registration is complete...', 'The user name <Strong>' + name + '</Strong> and mobile number <Strong>' + mobile + '</Strong> have been saved for use in this Sample Site. When you click the button below it will take you to a Sample Login page where you will experience how TextKey works.', closeModalDemo, \"Click and Go To Sample Site\", 220, 625);\n\n}", "title": "" }, { "docid": "43fe412355ceac2e5ff11d7b2c0ec4fc", "score": "0.5975566", "text": "function createConfirm(message_confirm, title, isConfirm) {\n // <!-- Modal -->\n if (title === null) {\n if (isConfirm === true)\n title = \"Confirmaci&oacute;n\";\n else\n title = \"Mensaje\";\n }\n var html = '<div class=\"modal fade\" id=\"modalConfirm\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">';\n html+=' <div class=\"modal-dialog\">';\n html+=' <div class=\"modal-content\">';\n html+=' <div class=\"modal-header\">';\n html+=' <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>';\n html+=' <h4 class=\"modal-title\" id=\"myModalLabel\">' + title + '</h4>';\n html+=' </div>';\n html+=' <div class=\"modal-body\">';\n html+=' <div class=\"row\">';\n html+=' <div class=\"col-lg-12\">';\n html+=' <span id=\"spanMessageConfirm\"></span>';\n html+=' </div>';\n html+=' </div>';\n html+=' </div>';\n html+=' <div class=\"modal-footer\">';\n if (isConfirm === true)\n html+=' <button type=\"button\" class=\"btn btn-default\" id=\"btnCancelConfirm\">Cancelar</button>';\n html+=' <button type=\"button\" class=\"btn btn-primary\" id=\"btnAcceptConfirm\">Aceptar</button>';\n html+=' </div>';\n html+=' </div>';\n html+=' <!-- /.modal-content -->';\n html+=' </div>';\n //<!-- /.modal-dialog -->\n html+='</div>';\n //<!-- /.modal -->\n $(\".body\").html(html);\n\n $('#spanMessageConfirm').html(message_confirm);\n $('#modalConfirm').modal('show');\n}", "title": "" }, { "docid": "9c9f36e632ee25e4d63515c306fdabd3", "score": "0.5840537", "text": "function Confirmation(message, callback) {\n if ($('#modalConfirmation_MyTools') != undefined) $('#modalConfirmation_MyTools').remove();\n $('body').append('<div class=\"modal dialog-modal\" id=\"modalConfirmation_MyTools\">\\\n <div class=\"fadeInDown confirmation-win modal-dialog modal-sm\">\\\n <div class=\"modal-content\">\\\n <div class=\"modal-header\">\\\n <h5><span style=\"color:#f49e42;\" class=\"fa fa-exclamation-circle\"></span> <span id=\"spanMessage_MyTools\">&nbsp;&nbsp;</span></h5>\\\n </div>\\\n <div class=\"modal-footer\">\\\n <button type=\"button\" data-dismiss=\"modal\" class=\"btn btn-success\" id=\"btnConfirm_MyTools\">Confirm</button>\\\n <button type=\"button\" data-dismiss=\"modal\" class=\"btn btn-warning\">Cancel</button>\\\n </div>\\\n </div>\\\n</div>\\\n</div>');\n\n document.getElementById('spanMessage_MyTools').append(message);\n $('#modalConfirmation_MyTools').modal('toggle');\n var confirmBtn = document.getElementById('btnConfirm_MyTools');\n confirmBtn.onclick = function () {callback(true);}\n}", "title": "" }, { "docid": "e90d85f73fd5d357dc92f21f443799b4", "score": "0.58115655", "text": "function confirmationMessage() {\n var x = document.getElementById(\"contact_form\");\n //getting the hidden confirmation control\n const confirmationMessage = document.getElementById(\"confirmationMessage\");\n const name = document.getElementById(\"name\").value; //this is the value in the name input box \n const contactUsername = document.getElementById(\"contactUsername\"); //is the placeholder element for the name in the contact field\n \n if (x.style.display === \"none\") {\n //this is showing the form\n x.style.display = \"block\";\n //hidding the confirmation control\n confirmationMessage.style.display = \"none\";\n } else {\n //this hides the form\n x.style.display = \"none\";\n //this shows the confirmation control\n confirmationMessage.style.display = \"block\";\n //add name from contact for to placeholder\n contactUsername.innerHTML += name;\n }\n }", "title": "" }, { "docid": "d8a1fbad180ce2e04e03615c2ffffd3b", "score": "0.57949805", "text": "function renderRegister() {\n\n let loginForm = document.querySelector('#loginForm');\n\n loginForm.innerHTML = ''; // limpa div\n\n loginForm.innerHTML = `\n\n <form> \n <div class=\"alert alert-primary\" role=\"alert\">Novo Usuário</div>\n <div class=\"form-floating\">\n <input type=\"email\" id=\"regEmail\" class=\"form-control\" placeholder=\"name@example.com\">\n <label for=\"floatingInput\">Insira Email</label>\n </div>\n <div class=\"form-floating\">\n <input type=\"password\" id=\"regPassword\" class=\"form-control\" placeholder=\"Password\">\n <label for=\"floatingPassword\">Insira Senha</label>\n </div>\n </form>\n\n <button id=\"btnRegister\" class=\"w-100 btn btn-lg btn-primary\" style=\"margin-bottom: 10px;\">Enviar</button>\n <button id=\"btnBack\" class=\"w-100 btn btn-lg btn-primary\" style=\"margin-bottom: 10px;\" onclick=\"renderLogin()\">Voltar</button>\n\n `;\n \n getInserts(); // procura a caixa de email e senha e o botao de SEND\n}", "title": "" }, { "docid": "3860750f4cc6c10ff638876adbb9acf9", "score": "0.57818335", "text": "generateMessageText() {\n\t\tconst { searchLoading, hasSearched, searchError, regList } = this.props;\n\t\tif(searchLoading){\n\t\t\treturn (<Loading height={112} width={112} color=\"#f5f5f5\" />);\n\t\t}\n\t\tif(hasSearched && !searchError && regList.length === 0) {\t\n\t\t\treturn (\n\t\t\t\t<div className=\"msg-text m-t-15\">\n\t\t\t\t\tSorry! No registrations found...\n\t\t\t\t\t{ this.props.allowWalkIns ? \n\t\t\t\t\t\t<div className=\"register-now-action m-t-15 method-walkin\"><Link to=\"/attendee/walkin\">Register Now</Link></div>\n\t\t\t\t\t\t:\n\t\t\t\t\t\t\"\"\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t);\t\t\t\n\t\t}\n\t\tif(hasSearched && searchError) {\t\t\t\n\t\t\treturn (\n\t\t\t\t<div className=\"msg-text m-t-15\">\n\t\t\t\t\tUh-Oh! We're having some issues searching...\n\t\t\t\t</div>\n\t\t\t);\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "ba384d8a5d24af03c4609f84ff118ac9", "score": "0.5779042", "text": "function accountCreationError(errorMessage) {\n\t$(\"#accountCreationMessage\").html('<br><div class=\"alert alert-danger alert-dismissible fade in\" role=\"alert\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n \t'<span aria-hidden=\"true\">×</span>' +\n '</button>' +\n \t'<p>'+errorMessage+'</p>' +\n \t'<p><button type=\"button\" class=\"btn btn-danger\" data-dismiss=\"alert\">Dismiss</button></p>' +\n '</div>');\n}", "title": "" }, { "docid": "08033370a40ca79bfa4c4e1d45323331", "score": "0.569929", "text": "registration() {\n console.log('registeration')\n dom.createRegistrationModal();\n\n }", "title": "" }, { "docid": "4e51fe2d1efb379e8b4b6dc74158987e", "score": "0.5697861", "text": "showRegisterConfirmation() {\n let registerPopUp = document.getElementById(\"register-popup\");\n let showRegisterConfirmation = document.getElementById(\n \"register-confirmation\"\n );\n showRegisterConfirmation.style.display = \"block\";\n registerPopUp.style.display =\"none\";\n }", "title": "" }, { "docid": "bcd549b0770f83b8c911bc8cbf5b10af", "score": "0.5678987", "text": "function confirmMsg(confirmMsg) {\n // check if error message exists.\n if ($('#errormsg').length)\n // remove error message if it exists.\n $('#errormsg').remove();\n\n // check if confirm message exists\n if (!$(\"#confirmmsg\").length) {\n // if it does not exist, add a confirm message after the heading.\n $('#loginHeading').after('<p id=\"confirmmsg\">' + confirmMsg + '</p>');\n } else {\n // replace the current confirm message with a new message.\n $(\"#confirmmsg\").text(confirmMsg);\n }\n}", "title": "" }, { "docid": "9967b2d85e7e965d4a3e6eb20e597d95", "score": "0.5671162", "text": "function createConfirmationDiv(){\n var html = '<div class=\"confirmation hidden\">' +\n '<span class=\"confirmText\">Are you sure?</span>' +\n '<button class=\"cancel\">Cancel</button>' +\n '<button class=\"continue\">Continue</button></div>';\n return html;\n}", "title": "" }, { "docid": "7ebdc0fbb344cc23edf78a8462bb977f", "score": "0.5638731", "text": "closeConfirmation() {\n let showRegisterConfirmation = document.getElementById(\n \"register-confirmation\"\n );\n\n showRegisterConfirmation.style.display = \"none\";\n /** When registration confirmation is closed - show login field to be able login */\n this.props.showLogin();\n }", "title": "" }, { "docid": "e07a97e9c1c8f6234235d3fb00469e30", "score": "0.5592732", "text": "function handleSignup(e) {\n e.preventDefault();\n\n mainApi\n .register(values.email, values.password, values.username)\n .then((res) => {\n console.log(res);\n if (res.message === 'Duplicate Email') { \n setDuplicateEmailMessage(true);\n return Promise.reject(`Error! ${res.message}`);\n }\n if (res.ok) {\n return res.json();\n }\n })\n .then(() => {\n setConfirmationPopupOpen(true);\n setRegisterPopupOpen(false);\n setDuplicateEmailMessage(false); \n resetForm();\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "9e03023f1bbebf35b74f9e70a4a47cc5", "score": "0.5591451", "text": "function showConfirmation(title, message, yesText, yesHandler) {\r\n displayUserConfirmation(\"#demoModal\", title, message, yesText, yesHandler);\r\n}", "title": "" }, { "docid": "7d1bd3d30910a4a52f02295cb5ff8fdc", "score": "0.5585591", "text": "function showConfirm(message, callback) {\n $('#confirmModal .modal-body p').text(message);\n $('#confirmModal').modal('show');\n $(\"#confirmBtn\").unbind('click');\n $(\"#confirmBtn\").one(\"click\", function () {\n if (callback) {\n callback();\n }\n });\n}", "title": "" }, { "docid": "a4271ce1961d344897ae7ef7ec6aa6ec", "score": "0.55257523", "text": "function displayConfirmationMessage(){\n //Add confirmation section to main\n var mainElement = document.querySelector('main');\n var confirmationMessageSection = document.createElement('section');\n mainElement.appendChild(confirmationMessageSection);\n var confirmationMessage = document.createElement('p');\n\n //Add confirmation text and link to cart\n confirmationMessage.innerHTML = 'Added to cart!';\n confirmationMessageSection.appendChild(confirmationMessage);\n}", "title": "" }, { "docid": "c0a4770f664a30b8b41d42f835fb93a3", "score": "0.5522901", "text": "function registrationErrorMsg(error){\n let displayMessage = '<p>Error creating user account. Please try again later.</p>';\n $('#reg-error-msg').html(displayMessage); \n // reset page\n $('#navbar-login-form').show();\n $('#register').show();\n }", "title": "" }, { "docid": "541deacb66b7ef858b8d9df012f2af8b", "score": "0.5521763", "text": "function sucessfulMsg(e){\n mainContainer.removeChild(signUpContainer);\n signUpSuccessMsg.style.display ='block';\n const name = FullName.value.toUpperCase();\n sucessText.innerHTML = `Thank you for creating account with us ${name}`;\n\n e.preventDefault();\n}", "title": "" }, { "docid": "25aee8ea8e541a659dc262dbd9e6ab6b", "score": "0.5518473", "text": "function showRegisterForm(){\n \"use strict\";\n $('.loginBox').fadeOut('fast',function(){\n $('.registerBox').fadeIn('fast');\n $('.login-footer').fadeOut('fast',function(){\n $('.register-footer').fadeIn('fast');\n });\n $('.modal-title').html('Create an Account');\n $('.modal-subtitle').html('Sign up to Etherparty Beta');\n });\n $('.error').removeClass('alert alert-danger').html('');\n}", "title": "" }, { "docid": "5ac121c86cd601c663f8a84e975aca21", "score": "0.5514782", "text": "function createRegister () {\n $('#registerBtn').click(function () {\n $(\"#errorLog\").html(\"\");\n\n var formData = $(\"#registrationForm\").serialize();\n\n $.ajax({\n url: \"/register\",\n method: \"post\",\n data: formData,\n cache: false,\n success: function (data) {\n $(\"#registerModal\").modal('hide');\n $(\"#loginModal\").modal('show');\n $(\"#regStatus\").removeClass('hidden');\n },\n error: function (args) {\n console.log(args);\n\n var resp = JSON.parse(args.responseText);\n\n for (var key in resp) {\n $(\"#errorLog\").append(\"<span>\" + key + \" \" + resp[key] + \"</span><br>\");\n }\n }\n });\n\n return false;\n });\n}", "title": "" }, { "docid": "8b96eacb5766755279452d536359162b", "score": "0.5512087", "text": "function confirmModal(message1) {\n $(\"#confirm .modal-title\").text(\"Result\");\n $(\"#confirm .modal-body\").html(message1);\n $(\"#confirm\").modal('show');\n $(\"#modalclose\").on(\"click\", function () {\n $(\"#confirm\").modal('hide');\n });\n\n }", "title": "" }, { "docid": "c5a6dd883bee3a01dcff969ed745d57b", "score": "0.5501967", "text": "generateMessage (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: '/no-auth/register',\n\t\t\t\tdata: {\n\t\t\t\t\temail: this.invitedUser.email,\n\t\t\t\t\tusername: RandomString.generate(12),\n\t\t\t\t\tpassword: RandomString.generate(12),\n\t\t\t\t\tfullName: this.userFactory.randomFullName(),\n\t\t\t\t\tinviteCode: this.inviteCode\n\t\t\t\t}\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\t// we expect a \"sanitized\" version of this user in the response\n\t\t\t\tconst user = new User(response.user).getSanitizedObject();\n\t\t\t\tuser.version = 2;\t// version number will be bumped when the user confirms\n\t\t\t\tthis.message = { users: [user] };\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "466c0d51dea47da871c4c9556975be05", "score": "0.5501749", "text": "function signUp() {\n let username = document.getElementById(\"userName_Input\").value;\n let password = document.getElementById(\"password_Input\").value;\n modal.style.display = \"block\";\n if(username != \"\" && password != \"\"){\n document.getElementById(\"modalOutput\").innerHTML = \"User \" + username + \" signed up!\"\n }\n else{\n document.getElementById(\"modalOutput\").innerHTML = \"Please enter a username & password to sign up!\"\n }\n //will eventually save to database & check for user\n}", "title": "" }, { "docid": "bdb370a1fe446949be6e8cb3f57ded01", "score": "0.5486511", "text": "function showSignupFailureMessages(message) {\n if ($('#signupErrors').length > 0) {\n $('#signupErrors').replaceWith(message);\n } else {\n $(message).appendTo('#signUpFooter');\n }\n }", "title": "" }, { "docid": "f3c9f3f6ae027d711b48f36e102bda21", "score": "0.54864013", "text": "function setConfirmation() {\n confirmationMessage.style.display = \"flex\";\n submitBtn.value = \"Close\";\n form.removeEventListener(\"submit\", onSubmit);\n form.addEventListener(\"click\", (e) => {\n e.preventDefault();\n closeModal();\n });\n}", "title": "" }, { "docid": "08e2cd76d4e18113af72133337dd4a54", "score": "0.54826474", "text": "function registration() {\n\n //get the form object\n var user_name = document.getElementById(\"regUser\").value;\n var emailuser = document.getElementById(\"regEmail\").value;\n var passworduser = document.getElementById(\"regPd\").value;\n var password2 = document.getElementById(\"regPdConf\").value;\n fetch('../user/signup', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n username: user_name,\n email: emailuser,\n password: passworduser\n })\n })\n .then((resp) => resp.json())\n .then(function(data) {\n let mes = data.message;\n if (mes.localeCompare(\"User created\") == 0) {\n document.write(`<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\"> <div id='center'><h1>Registrazione avvenuta con successo!</h1><br><h3>Ora prova a fare log In!</h3><br><a href='login.html'> <button style=\" float: left\"class=\"locationbtn\"onclick=\"window.location.href='login.html';\"> Torna al login</button></a></div>\"`);\n } else if (mes.localeCompare(\"user already exist\") == 0) {\n document.write(\"<div id='center'><h1>Utente già esistente!</h1><br><a href='registration.html'>Torna alla registrazione</a></div>\");\n } else {\n document.write(`<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\"> <div id='center'><h1>Errore nella fase di registrazione!</h1><br><a href='registration.html'><button style=\" float: left\"class=\"locationbtn\"onclick=\"window.location.href='registration.html';\"> Torna al signup</button></a></div>`);\n }\n console.log(mes);\n });\n}", "title": "" }, { "docid": "97334b2e1e64432a8e297efaec222659", "score": "0.54472154", "text": "function signupNotSuccessful() {\n const signupNotSucceed = document.createElement('div');\n signupNotSucceed.className = 'red';\n signupNotSucceed.appendChild(document.createTextNode('Username or password not valid'));\n signUp.appendChild(signupNotSucceed);\n}", "title": "" }, { "docid": "7a9daa09dfcf454e1ebd87c856c020ed", "score": "0.5419388", "text": "renderMessage(){\n\t\t\tif(this.state.errorMessage){\n\t\t\t\treturn (\n\t\t\t\t\t<div className=\"alert alert-danger alert-dismissible\" style={comStyles().message}>\n\t\t\t\t\t <strong>Error!</strong> {this.state.errorMessage}\n\t\t\t\t\t\t<b onClick={()=>this.setState({errorMessage: \"\"})} style={comStyles().messageClose}>&times;</b>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tif(this.state.successMessage){\n\t\t\t\treturn (\n\t\t\t\t\t<div className=\"alert alert-success alert-dismissible\" style={comStyles().message}>\\\n\t\t\t\t\t <strong>Success!</strong> {this.state.successMessage}\n\t\t\t\t\t\t<b onClick={()=>this.setState({successMessage: \"\"})} style={comStyles().messageClose}>&times;</b>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fa43aaddf919afb7d1e0d06f10bd316e", "score": "0.5400556", "text": "function displayErrorMessage(message){ \n // captures errors on login \n let displayMessage = '<p>Error: ' + message + ' Please try again.</p>';\n // display on DOM \n $('.error-modal').show();\n $('#error-modal-message').html(displayMessage);\n }", "title": "" }, { "docid": "916a3e02e5ba0dd4dffc072e6573e781", "score": "0.53981084", "text": "function showConfirmDialog(transId, error, message) {\n\n document.getElementById(\"popupImg\").src = error ? \"img/redcross.png\" : \"img/greencheck.png\";\n document.getElementById(\"popupHeader\").innerHTML = error ? \"Error!\" : \"Payment Success!\";\n document.getElementById(\"popupMessage\").innerHTML = message;\n\n document.getElementById(\"transId\").innerHTML = transId;\n document.getElementById(\"modalPopup\").classList.remove(\"closed-sam\");\n}", "title": "" }, { "docid": "61f5ace203980afb9a2c63bcd89752df", "score": "0.53968525", "text": "renderSuccessMessage(){\n\t if(this.state.showSuccess === true){\n\t return <ReactBootstrap.Alert bsStyle=\"success\">Cliente cadastrado com sucesso</ReactBootstrap.Alert>;\n\t }\n\t return null;\n\t }", "title": "" }, { "docid": "f76cb213426051a0ace140a070220f54", "score": "0.5389125", "text": "function registerClicked() {\n console.log(\"Validate register attempt\");\n var inputName = $(\"#nameRegisterField\").val();\n var inputLastName = $(\"#lastNameRegisterField\").val();\n var inputEmail = $(\"#emailRegisterField\").val();\n var inputEdad = $(\"#edadRegisterField\").val();\n var inputPass = $(\"#passwordRegisterField\").val();\n var inputPassRep = $(\"#passwordCheckRegisterField\").val();\n\n var msgN = \"\";\n var msgL = \"\";\n var msgE = \"\";\n var msgD = \"\";\n var msgP = \"\";\n var msgPr = \"\";\n\n var validationSuccess = 0;\n\n // verificamos que el nombre ingresado no sea vacio\n if (notEmptyString(inputName)) {\n //EXITO\n validationSuccess++;\n } else {\n msgN = \"Nombre inválido, el nombre no puede estar vacío, intente nuevamente.\";\n }\n\n // verificamos que el apellido ingresado no sea vacio\n if (notEmptyString(inputLastName)) {\n //EXITO\n validationSuccess++;\n } else {\n msgL = \"Apellido inválido, el apellido no puede estar vacío, intente nuevamente.\";\n }\n\n // verificamos que el email sea valido y no esté previamente ingresado en el sistema\n if (notEmptyString(inputEmail)) {\n inputEmail = myTrim(inputEmail);\n if (isValidEmailFormat(inputEmail)) {\n var cont = 0;\n var emailFound = false;\n while (cont < usuariosPreCargados.length && emailFound === false) {\n if (usuariosPreCargados[cont].email === inputEmail) {\n emailFound = true;\n }\n cont++;\n }\n if (emailFound) {\n msgE = \"Email inválido, la direccion de email ingresada ya existe en el sistema, intente nuevamente con otra direccion de email.\";\n } else {\n //EXITO\n validationSuccess++;\n }\n } else {\n msgE = \"Email inválido, las direcciones de email no pueden contener espacios y tienen que tener al menos un @, intente nuevamente.\";\n }\n } else {\n msgE = \"Email inválido, no puede estar vacío, intente nuevamente.\";\n }\n\n\n // verificamos de la fecha de nacimiento\n inputEdad = myTrim(inputEdad);\n if (notEmptyString(inputEdad)) {\n if (isNumber(inputEdad)) {\n inputEdad = makeInt(inputEdad);\n if (inputEdad >= 0 && inputEdad < 130) {\n //EXITO\n validationSuccess++;\n } else {\n msgD = \"Edad, la edad solo puede ser un valor entre 0 y 130.\";\n }\n } else {\n msgD = \"Edad, la edad solo puede ser numerica.\";\n }\n } else {\n msgD = \"Edad, la edad no puede estar vacía, intente nuevamente.\";\n }\n\n // verificamos que la contrasena no sea vacia\n inputPass = myTrim(inputPass);\n if (notEmptyString(inputPass)) {\n //EXITO\n validationSuccess++;\n } else {\n msgP = \"Contraseña inválida, la contraseña no puede estar vacía, intente nuevamente.\";\n }\n\n\n // verificamos que la confirmacion de la contraseña sea igual a la contraseña\n if (inputPass === inputPassRep) {\n //EXITO\n validationSuccess++;\n } else {\n msgPr = \"La repeticion de la contraseña no coincide con la contraseña ingresada, intente nuevamente.\";\n }\n\n $(\"#registerParagraphName\").html(msgN);\n $(\"#registerParagraphLastName\").html(msgL);\n $(\"#registerParagraphEmail\").html(msgE);\n $(\"#registerParagraphFecha\").html(msgD);\n $(\"#registerParagraphContraseña\").html(msgP);\n $(\"#registerParagraphContraseñaRep\").html(msgPr);\n\n // usuario logra registrarse exitosamente en modo pendiente, se lo lleva a la pagina de inicio\n if (validationSuccess === 6) {\n console.log(\"New user registration validated\");\n\n var _edad = new Date();\n var _favorited = new Array();\n\n var usuario1 = {\n id: nuevoIdUnico(usuariosPreCargados),\n type: \"regUser\",\n status: \"pendiente\",\n name: inputName,\n lastName: inputLastName,\n email: inputEmail,\n edad: _edad,\n password: inputPass,\n favorited: _favorited};\n\n usuariosPreCargados.push(usuario1);\n\n userNav.currentMode = \"ofertas\";\n updateDisplay('full');\n }\n}", "title": "" }, { "docid": "9a7277abf13fbc90188da2efaf2a13d3", "score": "0.53842187", "text": "function showRegisterPopUp() {\n let modal = document.getElementById('registerPopUp');\n modal.style.display='block'\n}", "title": "" }, { "docid": "a9a1cd7ef82ea2cf3b652e5a32696995", "score": "0.53736824", "text": "handleRegister() {\n const hasError = this.generateError();\n if (hasError) {\n $(\"#registerForm\").effect( \"shake\", { direction: \"right\", times: 4, distance: 10}, 500 );\n }\n else {\n // Simple POST request with a JSON body using fetch\n const requestOptions = {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ email: this.state.email,\n name: this.state.name,\n password: this.state.password})\n };\n\n fetch(this.props.URL + '/register', requestOptions)\n .then(response => response.json())\n .then(data => {\n let success = {\n color: 'green',\n paddingLeft: '20px'\n };\n let fail = {\n color: 'red',\n paddingLeft: '20px'\n };\n if (data.response == 'success') {\n this.props.handleChangeToken(data.token);\n $(\"#registerForm\").slideUp();\n this.props.handleToggleMask();\n const msg = `Thank you for your registration. An email has been sent to ${this.state.email}. Please click the link in the email to activate your account`;\n this.props.handlePopupMsg(msg);\n this.setState({\n nameError: '',\n emailError: '',\n passwordError: '',\n againPasswordError: '',\n name: '',\n email: '',\n password: '',\n againPassword: '',\n registerResult: ''\n });\n }\n else {\n $(\"#registerForm\").effect( \"shake\", { direction: \"right\", times: 4, distance: 10}, 500 );\n this.setState({emailError: data.message});\n }\n });\n\n\n }\n }", "title": "" }, { "docid": "0e4ceff0f31a402c0d10556329da100c", "score": "0.5367381", "text": "function UnsuccessfulMessage()\n {\n var unsuccess = '<div class=\"row\">'+\n '<div class=\"col-xs-12\">'+\n '<img id=\"letter\" src=\"images/icons/letter.png\" alt=\"Message\"/>'+\n '<p class=\"red\">'+\n 'Désolé, votre message n\\'a pas pu être envoyé'+\n '</p>'+\n '</div>'+\n '<div class=\"col-xs-12\">'+\n '<button id=\"reload-form\" type=\"submit\" class=\"btn btn-lg\" autocomplete=\"off\">Recharger le Formulaire</button>'+\n '</div>'+\n '</div>';\n\n jQuery('#contact-content').html(unsuccess);\n }", "title": "" }, { "docid": "32c28dc5780090506c091ef0b3f3a662", "score": "0.5355081", "text": "function showVerificationEmailSentModal(username)\n{\n var header = labels.email_sent ;\n var body = '<p style=\"width:320px\">' + sprintf(labels.an_email_has_been_sent_to, username) + '</p>';\n \n var footer = '<div class=\"button\" onclick=\"hideModalContainer()\">' + labels.ok + '</div>';\n \n displayModalContainer(body, header, footer);\n}", "title": "" }, { "docid": "a5be5056e5d4a7e9f6a120bdf15191ec", "score": "0.5332539", "text": "loadRegister() {\n document.querySelector(\".Log_In\").innerHTML = \"\";\n document.querySelector(\".Log_In\").setAttribute(\"id\", \"registerLogin\")\n new comp.title(\"p\", { className: \"alertRegister\", id: \"firstNameRegister\" }, \"You must enter your first name to register.\").render(\".Log_In\");\n new comp.label({}, \"First Name\",\n new comp.input({ name: \"firstName\", id: \"firstName\", placeholder: \"First Name\" })).render(\".Log_In\");\n new comp.title(\"p\", { className: \"alertRegister\", id: \"lastNameRegister\" }, \"You must enter your last name to register.\").render(\".Log_In\");\n new comp.label({}, \"Last Name\",\n new comp.input({ name: \"lastName\", id: \"lastName\", placeholder: \"Last Name\" })).render(\".Log_In\");\n new comp.title(\"p\", { className: \"alertRegister\", id: \"emailBlankRegister\" }, \"You must enter your email to register.\").render(\".Log_In\");\n new comp.title(\"p\", { className: \"alertRegister\", id: \"notValidEmailRegister\" }, \"You must enter a valid email to register.\").render(\".Log_In\");\n new comp.title(\"p\", { className: \"alertRegister\", id: \"emailExistsRegister\" }, \"There is already an account registered to this email.\").render(\".Log_In\");\n new comp.label({}, \"Email\",\n new comp.input({ type: \"email\", id: \"email\", name: \"email\", placeholder: \"email\" })).render(\".Log_In\")\n new comp.title(\"p\", { className: \"alertRegister\", id: \"usernameBlankRegister\" }, \"You must enter a username to register.\").render(\".Log_In\");\n new comp.title(\"p\", { className: \"alertRegister\", id: \"notValidUsernameRegister\" }, \"@ symbol is not allowed in your username.\").render(\".Log_In\");\n new comp.title(\"p\", { className: \"alertRegister\", id: \"usernameExistsRegister\" }, \"There is already an account registered to this username.\").render(\".Log_In\");\n new comp.label({}, \"Username\",\n new comp.input({ name: \"username\", id: \"username\", placeholder: \"username\" })).render(\".Log_In\")\n new comp.title(\"p\", { className: \"alertRegister\", id: \"passwordBlankRegister\" }, \"You must enter and confirm your password.\").render(\".Log_In\");\n new comp.label({ for: \"password\" }, \"Password\",\n new comp.input({ type: \"password\", name: \"password\", id: \"password\", placeholder: \"Password\" })).render(\".Log_In\")\n new comp.title(\"p\", { className: \"alertRegister\", id: \"badConfirmPasswordRegister\" }, \"The passwords entered do not match.\").render(\".Log_In\");\n new comp.label({ for: \"confirmPassword\" }, \"Confirm Password\",\n new comp.input({ type: \"password\", name: \"confirmPassword\", id: \"confirmPassword\", placeholder: \"Confirm Password\" })).render(\".Log_In\");\n new comp.label({ for: \"profilePic\", id: \"registerRadioLabel\" }, \"Select Profile Pic\").render(\".Log_In\");\n new comp.div({ name: \"profilePic\", id: \"registerProfilePicSection\" },\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", checked: \"checked\", value: \"./images/option7edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option7edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option8edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option8edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option1edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option1edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option2edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option2edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option3edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option3edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option4edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option4edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option5edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option5edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option6edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option6edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", name: \"picRadio\", value: \"./images/option0edit.jpg\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/option0edit.jpg\" })),\n new comp.section({},\n new comp.input({ type: \"radio\", value: \"addPhotoUrl\", name: \"picRadio\", className: \"registerPicRadio\" }),\n new comp.image({ className: \"selectPic\", src: \"./images/addPhoto.jpg\" }))\n ).render(\".Log_In\");\n new comp.label({ for: \"profilePicText\", id: \"picUrlContainer\" }, \"Or Add The Web Address of Your Own\",\n new comp.input({ name: \"profilePicText\", id: \"profilePicText\", placeholder: \"Enter The URL Of Your Profile Pic\" })).render(\".Log_In\")\n new comp.btn(\"Register Account\").render(\".Log_In\")\n\n // adds toggle to alerts and picUrlInput and sets to hide\n $(\".alertRegister\").toggle();\n $(\".alertRegister\").hide();\n $(\"#picUrlContainer\").toggle();\n $(\"#picUrlContainer\").hide();\n\n // creates functional toggle for profilePic url input\n $(\"#registerProfilePicSection\").click(function () {\n let tempValue = $(\"input[name='picRadio']:checked\").val();\n console.log(tempValue);\n if(tempValue === \"addPhotoUrl\"){\n $(\"#picUrlContainer\").show();\n } else {\n $(\"#picUrlContainer\").hide()\n }\n });\n\n // add event listeners to register and login buttons\n document.querySelectorAll(\"button\").forEach((button) => {\n button.addEventListener(\"click\", (e) => {\n $(\"#picUrlContainer\").hide();\n $(\".alertRegister\").hide();\n if (e.target.textContent === \"Register Account\") {\n registerFuncs.checkUserFields();\n }\n else {\n document.querySelector(\".Log_In\").removeAttribute(\"id\", \"registerLogin\");\n logInFuncs.loadLogIn();\n }\n })\n })\n }", "title": "" }, { "docid": "d5cb1f2354b2bfe073429376f804ebb4", "score": "0.5319241", "text": "function signUpSubmit() {\n let formElement = document.getElementById(\"name\").value;\n let count = 0;\n if (formElement.length === 0) {\n count++;\n document.getElementsByClassName(\"errortext\")[0].style.visibility =\n \"visible\";\n document.getElementsByClassName(\"triangle\")[0].style.visibility = \"visible\";\n }\n\n formElement = document.getElementById(\"username\").value;\n if (formElement.length === 0) {\n count++;\n document.getElementsByClassName(\"errortext\")[1].style.visibility =\n \"visible\";\n document.getElementsByClassName(\"triangle\")[1].style.visibility = \"visible\";\n }\n\n formElement = document.getElementById(\"password\").value;\n if (formElement.length === 0) {\n count++;\n document.getElementsByClassName(\"errortext\")[2].style.visibility =\n \"visible\";\n document.getElementsByClassName(\"triangle\")[2].style.visibility = \"visible\";\n }\n\n formElement = document.getElementById(\"confirm-password\").value;\n if (formElement.length === 0) {\n count++;\n document.getElementsByClassName(\"errortext\")[3].style.visibility =\n \"visible\";\n document.getElementsByClassName(\"triangle\")[3].style.visibility = \"visible\";\n }\n\n // close the modal if all entries are filled:\n if (count === 0) {\n document.getElementById(\"signup-modal\").style.display = \"none\";\n let elements = document.querySelectorAll(\".errortext\");\n let triangles = document.querySelectorAll(\".triangle\");\n\n // hide error messages:\n for (let i = 0; i < 4; i++) {\n elements[i].style.visibility = \"hidden\";\n triangles[i].style.visibility = \"hidden\";\n }\n }\n}", "title": "" }, { "docid": "f6ea6f5882e48ffb1fdf80bd9a9da813", "score": "0.53182614", "text": "register() {\n var self = this;\n swal(\n {\n title: 'You are about to register this death record!',\n text: 'Are you sure?',\n type: 'info',\n showCancelButton: true,\n confirmButtonClass: 'btn-primary',\n confirmButtonText: 'Register',\n closeOnConfirm: false,\n showLoaderOnConfirm: true\n },\n function(isConfirm) {\n if (!isConfirm) return;\n $.ajax({\n url: Routes.register_death_record_path(self.state.deathRecord.id),\n dataType: 'json',\n contentType: 'application/json',\n type: 'POST',\n success: function(deathRecord) {\n self.setState({\n deathRecord: deathRecord\n });\n swal('Registered!', 'This death record has been successfully registered.', 'success');\n }.bind(self),\n error: function(xhr, status, err) {\n console.error(Routes.register_death_record_path(self.state.deathRecord.id), status, err.toString());\n }.bind(self)\n });\n }\n );\n }", "title": "" }, { "docid": "e1132eec0b5ffe2a21aab3bba7f32bcf", "score": "0.53037894", "text": "function SuccessfulMessage()\n {\n var success = '<div class=\"row\">'+\n '<div class=\"col-xs-12\">'+\n '<img id=\"letter\" src=\"images/icons/letter.png\" alt=\"Message\"/>'+\n '<p class=\"green\">'+\n 'Votre message a bien été envoyé'+\n '</p>'+\n '</div>'+\n '<div class=\"col-xs-12\">'+\n '<button id=\"reload-form\" type=\"submit\" class=\"btn btn-lg\" autocomplete=\"off\">Recharger le Formulaire</button>'+\n '</div>'+\n '</div>';\n\n jQuery('#contact-content').html(success);\n }", "title": "" }, { "docid": "b14a44f08c16b8bffef2182cceb9db4f", "score": "0.5295855", "text": "function renderSignupForm(){\n return `<div id=\"sign-up-form\">\n <h1 class=\"form-title\">Create an account!</h1>\n <br>\n <form class=\"sign-up-form\">\n \n <div class=\"field\">\n <label class=\"label\">Username</label>\n <div class=\"control\">\n <input class=\"input\" type=\"text\" name=\"usernameS\">\n </div>\n </div>\n <div class=\"field\">\n <label class=\"label\">Password</label>\n <div class=\"control\">\n <input class=\"input\" type=\"text\" name=\"passwordS\">\n </div>\n </div>\n \n <div class=\"field\">\n <label class=\"label\">Email</label>\n <div class=\"control\">\n <input class=\"input\" type=\"email\" name=\"emailS\">\n </div>\n </div>\n \n <div class=\"field is-grouped\">\n <div class=\"control\">\n <button class=\"button submitSignupButton is-info\" onclick=\"handleSubmitSignupButtonPress()\">Submit</button>\n </div>\n <div class=\"control\">\n <button class=\"button is-info is-light\">Cancel</button>\n </div>\n </div>\n </form>\n </div>`\n}", "title": "" }, { "docid": "b8fc4c9f58ecf2760ddfaabab61f233c", "score": "0.52926755", "text": "Notification(){\n try{\n //New Account\n if(this.props.location.state.accountCreated === true){\n this.props.location.state.accountCreated = false; //reset \n return <h4 className=\"accountCreatedMsg\">Congratulations, your account has been created!</h4>\n } \n //Password updated\n else if(this.props.location.state.updatedPassword === true){\n this.props.location.state.updatedPassword = false; //reset \n return <h4 className=\"accountCreatedMsg\">Success, your password has been updated!</h4>\n }\n } catch(e){}\n }", "title": "" }, { "docid": "e9cf11e8960f59372228d2acdb584b7e", "score": "0.5290668", "text": "function RegisterForm(props){\n const {baseUrl} = props;\n const [firstName,setFirstName] = useState('');\n const [firstNameError,setFirstNameError] = useState(false);\n const [firstNameErrorMessage,setFirstNameErrorMessage] = useState('');\n const [lastName,setLastName] = useState('');\n const [lastNameError,setLastNameError] = useState(false);\n const [lastNameErrorMessage,setLastNameErrorMessage] = useState('');\n const [email,setEmail] = useState('');\n const [emailError,setEmailError] = useState(false);\n const [emailErrorMessage,setEmailErrorMessage] = useState('');\n const [password,setPassword] = useState('');\n const [passwordError,setPasswordError] = useState(false);\n const [passwordErrorMessage,setPasswordErrorMessage] = useState('');\n const [contactNo,setContactNo] = useState('');\n const [contactNoError,setContactNoError] = useState(false);\n const [contactNoErrorMessage,setContactNoErrorMessage] = useState('');\n const [successMsg,setSuccessMsg] = useState('');\n \n //Function to validate fields and render error text if required. Also posts details if valid entries filled, with a confirmation success message.\n async function registerHandler(){\n let validFirstNameFlag = false;\n let validLastNameFlag = false;\n let validEmailFlag = false;\n let validPasswordFlag = false;\n let validContactNoFlag = false;\n if(firstName === '' || (/\\d/.test(firstName))){\n setFirstNameError(true);\n if(firstName ==='')\n setFirstNameErrorMessage('required');\n else\n setFirstNameErrorMessage('This field cannot contain numerals .');\n }else{\n setFirstNameErrorMessage('');\n setFirstNameError(false);\n validFirstNameFlag = true;\n }\n if(lastName === '' || (/\\d/.test(lastName))){\n setLastNameError(true);\n if(lastName === '')\n setLastNameErrorMessage('required');\n else\n setLastNameErrorMessage('This field cannot contain numerals.');\n }else{\n setLastNameErrorMessage('');\n setLastNameError(false);\n validLastNameFlag = true;\n }\n if( /\\S+@\\S+\\.\\S+/.test(email) === false) {\n if(email === '')\n setEmailErrorMessage('required');\n else\n setEmailErrorMessage('Expected Format Ex : xyz@gmail.com');\n }else{\n setEmailErrorMessage('');\n setEmailError(false);\n validEmailFlag = true;\n }\n if(password.length < 8 || (/[a-z]/.test(password) === false) || (/[A-Z]/.test(password) === false) || (/\\d/.test(password))===false){\n setPasswordError(true);\n if(password ==='')\n setPasswordErrorMessage('required');\n else\n setPasswordErrorMessage('Requires atleast 1 uppercase,1 lowercase,1 number and length of 8');\n }else{\n setPasswordErrorMessage('');\n setPasswordError(false);\n validPasswordFlag = true;\n }\n if((/^[0-9]+$/).test(contactNo) === false || contactNo.length !== 10){\n setContactNoError(true);\n if(contactNo ==='')\n setContactNoErrorMessage('required');\n else\n setContactNoErrorMessage('Must be a 10 digit number.');\n }else{\n setContactNoErrorMessage('');\n setContactNoError(false);\n validContactNoFlag = true;\n }\n if (validFirstNameFlag && validLastNameFlag && validEmailFlag && validPasswordFlag && validContactNoFlag){\n let params = {\n email_address : email,\n first_name: firstName,\n last_name: lastName,\n mobile_number: contactNo,\n password: password\n }\n try{\n const rawResponse = await fetch(baseUrl + \"/signup\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Cache-Control\": \"no-cache\",\n },\n body: JSON.stringify(params),\n });\n const result = await rawResponse.json() \n if(rawResponse.ok){\n setSuccessMsg('Registration Successful. Please Login!');\n }else{\n const error = new Error();\n error.message = result.message || ' There was an error while registering.';\n setSuccessMsg(error.message);\n alert(`Error : ${error.message}`);\n }\n }catch(e){\n alert(`Error : ${e.message}`);\n }\n }else\n setSuccessMsg('');\n }\n return(\n <div className = 'form-container' > \n <div className = 'form-item'>\n <FormControl required = {true} margin = 'normal' >\n <InputLabel htmlFor=\"register-firstname\">First Name</InputLabel>\n <Input id=\"register-firstname\" onChange={(e)=>setFirstName(e.target.value)} />\n {(firstNameError === false) ? null : <FormHelperText id=\"register-firstname\" error={true}>{firstNameErrorMessage}</FormHelperText> }\n </FormControl> \n </div>\n <div className = 'form-item'>\n <FormControl required = {true} margin = 'normal' >\n <InputLabel htmlFor=\"register-lastname\">Last Name</InputLabel>\n <Input id=\"register-lastname\" onChange ={(e)=>setLastName(e.target.value)} />\n {(lastNameError === false) ? null : <FormHelperText id=\"register-lastname\" error = {true}>{lastNameErrorMessage}</FormHelperText> } \n </FormControl> \n </div>\n \n <div className = 'form-item'>\n <FormControl required = {true} margin = 'normal' >\n <InputLabel htmlFor=\"email\">Email</InputLabel>\n <Input id=\"email\" onChange ={(e)=>setEmail(e.target.value)} />\n {(emailError === false) && <FormHelperText id=\"email\" error = {true}>{emailErrorMessage}</FormHelperText> }\n </FormControl> \n </div>\n <div className = 'form-item'>\n <FormControl required = {true} margin = 'normal' >\n <InputLabel htmlFor=\"register-password\">Password</InputLabel>\n <Input id=\"register-password\" onChange ={(e)=>setPassword(e.target.value)} />\n {(passwordError === false) ? null : <FormHelperText id=\"register-password\" error = {true}>{passwordErrorMessage}</FormHelperText> }\n </FormControl> \n </div>\n <div className = 'form-item'>\n <FormControl required = {true} margin = 'normal' >\n <InputLabel htmlFor=\"contact-no\">Contact No.</InputLabel>\n <Input id=\"contact-no\" onChange ={(e)=>setContactNo(e.target.value)} />\n {(contactNoError === false) ? null : <FormHelperText id=\"contact-no\" error = {true}>{contactNoErrorMessage}</FormHelperText> }\n </FormControl> \n </div>\n <div className = 'form-item form-success-msg'>\n <br/>\n {successMsg}\n <br/><br/>\n </div> \n <div className = 'form-item '>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick = {registerHandler}\n >\n Register\n </Button>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "71ca1dde6b7c4259df31b4046b12fa75", "score": "0.5282813", "text": "function onRegisterClicked() {\n var email = document.getElementById('email').value;\n var password = document.getElementById('password').value;\n \n if ($('#form_login').parsley().isValid()) {\n // Show a little animated \"loading\" image\n document.getElementById('register_loader').style.display = \"inline\";\n // Send a post request to server to create a new user in database\n ajax.post(\"../php/register.php\", {register_email:email, register_pw:password}, function(msg) {\n msg = JSON.parse(msg);\n // Redirect to \"success\" page if account creation was successfull\n if (msg.result === \"ok\") {\n window.location.href = \"register_success.php\";\n }\n // Otherwise show an error message. At the moment the only known error is, that the account already exists.\n else {\n document.getElementById('error').innerHTML = \"An account for this email address already exists.\";\n }\n // Hide \"loading\" animation\n document.getElementById('register_loader').style.display = \"none\"; \n });\n }\n}", "title": "" }, { "docid": "0a04784dd7d687af80201cb3605c3182", "score": "0.5277486", "text": "function registerValidate(registerForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\nvar okayMessage=\"Presiona OK para finalizar proceso de registro\";\n\nif (registerForm.firstname.value==\"\")\n{\nerrorMessage+=\"Nombre no diligenciado\\n\";\nvalidationVerified=false;\n}\nif(registerForm.lastname.value==\"\")\n{\nerrorMessage+=\"Apellido no diligenciado\\n\";\nvalidationVerified=false;\n}\nif (registerForm.email.value==\"\")\n{\nerrorMessage+=\"Correo no diligenciado\\n\";\nvalidationVerified=false;\n}\nif(registerForm.password.value==\"\")\n{\nerrorMessage+=\"Contraseña no diligenciada\\n\";\nvalidationVerified=false;\n}\nif(registerForm.ConfirmPassword.value==\"\")\n{\nerrorMessage+=\"Confirmar contraseña no diligenciado\\n\";\nvalidationVerified=false;\n}\nif(registerForm.ConfirmPassword.value!=registerForm.password.value)\n{\nerrorMessage+=\"La contraseñas no coinciden\\n\";\nvalidationVerified=false;\n}\nif (!isValidEmail(registerForm.email.value)) {\nerrorMessage+=\"Dirección de contraseña no diligenciada\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nif(validationVerified)\n{\nalert(okayMessage);\n}\nreturn validationVerified;\n}", "title": "" }, { "docid": "93550d540b4821109ce41d26764e5edb", "score": "0.52763927", "text": "handleValidSubmit() {\n const data = this.state;\n\n fetch(\"/api/register\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n name: data.name,\n email: data.email,\n password: data.password,\n password2: data.password2\n })\n })\n .then(data => data.json())\n .then(response => {\n if (response.success){\n confirmAlert({\n title: 'You have registered successfully',\n message: response.success ,\n buttons: [\n {\n label: 'OK',\n onClick: () => {\n window.location = \"/login\";\n }\n }\n ]\n });\n }\n else {\n this.setState({ error: true});\n confirmAlert({\n title: 'Something went wrong...',\n message: Object.values(response.error).join('<br>'),\n buttons: [\n {\n label: 'OK'\n }\n ]\n });\n }\n })\n .catch(errors => {\n console.log(`Login error: ${errors}`);\n });\n }", "title": "" }, { "docid": "a6d62d45349a9e50e833ea76b711ea0d", "score": "0.52736753", "text": "function register() {\n if(registerPassword.value != confirmPassword.value) {\n confirmPassword.setCustomValidity(\"Passwords stemmer ikke overens!\");\n } else {\n localStorage.setItem('registername', registerName.value);\n localStorage.setItem('registerpassword', registerPassword.value);\n }\n}", "title": "" }, { "docid": "bd8de056665f0da45b409869c141947e", "score": "0.5251014", "text": "function verifyRegisterInputs()\n{\n let noInvalidInputs = true;\n const firstName = document.querySelector(\"#registerFName\").value,\n lastName = document.querySelector(\"#registerLName\").value,\n email = document.querySelector(\"#registerEmail\").value,\n password = document.querySelector(\"#registerPassword\").value,\n confirmPassword = document.querySelector(\"#registerConfirmPassword\").value;\n\n if (firstName.length === 0)\n {\n noInvalidInputs = false;\n document.querySelector(\"#registerFName\").style.borderColor = \"red\";\n document.querySelector(\".first-name-error-text\").style.display = \"block\";\n }\n\n if (lastName.length === 0)\n {\n noInvalidInputs = false;\n document.querySelector(\"#registerLName\").style.borderColor = \"red\";\n document.querySelector(\".last-name-error-text\").style.display = \"block\";\n }\n\n if (email.length === 0 || (!email.includes(\"@\") || !email.includes(\".com\")))\n {\n noInvalidInputs = false;\n document.querySelector(\"#registerEmail\").style.borderColor = \"red\";\n document.querySelector(\".register-email-error-text\").style.display = \"block\";\n }\n else if (emailExistsInStorage(email))\n {\n noInvalidInputs = false;\n document.querySelector(\"#registerEmail\").style.borderColor = \"red\";\n document.querySelector(\".register-email-exists-error-text\").style.display = \"block\";\n }\n\n if (password.length === 0)\n {\n noInvalidInputs = false;\n document.querySelector(\"#registerPassword\").style.borderColor = \"red\";\n document.querySelector(\".register-password-error-text\").style.display = \"block\";\n }\n\n if (confirmPassword.length === 0 || confirmPassword !== password)\n {\n noInvalidInputs = false;\n document.querySelector(\"#registerConfirmPassword\").style.borderColor = \"red\";\n document.querySelector(\".register-confirm-password-error-text\").style.display = \"block\";\n }\n\n return noInvalidInputs;\n}", "title": "" }, { "docid": "ecbfff00ae0613fef31383ff47ab4254", "score": "0.52470416", "text": "function setRegisterTela(){\n modalTitleText.innerHTML = \"Cadastrar-se na RapiArt\"\n loginBody.style.display = 'none'\n registerBody.style.display = 'block'\n registerEmailBody.style.display = 'none'\n recuperarSenhaBody.style.display = 'none'\n myModalLogin.show()\n}", "title": "" }, { "docid": "70a4b4ff936651d48981aa688ca43863", "score": "0.52383643", "text": "function showConfirmation()\n {\n var $confirmPage = $(\"#confirmation\");\n \n $(\"#mainForm\").hide();\n\n // create JSON from input field values\n // display confirmation page from JSON\n \n var jsonRequest = \n {\n \"name\": aMod.name,\n \"email\": aMod.email,\n \"bDay\": aMod.bDay,\n \"bMonth\": aMod.bMonth + 1,\n \"bYear\": aMod.bYear,\n \"schedule\": aMod.schedule\n };\n \n var stringRequest = JSON.stringify(jsonRequest);\n var $json = $(\"#jsonRequest\");\n var $formPersonal = $(\"#formattedPersonal\");\n var $formSchedule = $(\"#formattedSchedule\");\n \n var id, area, classNumber;\n \n $json.text(stringRequest);\n $formPersonal.append(\"<p>Full Name: \" + aMod.name + \"</p>\");\n $formPersonal.append(\"<p>Email: \" + aMod.email + \"</p>\");\n $formPersonal.append(\"<p>Birthday: \" + months[aMod.bMonth] + \" \" + aMod.bDay + \", \" + aMod.bYear + \"</p>\");\n\n for (var i = 0; i < aMod.schedule.length; i++)\n {\n id = aMod.schedule[i];\n area = id.match(/[^0-9]+/)[0];\n classNumber = id.match(/[0-9]+$/)[0];\n $formSchedule.append(\"<p>\" + area + \" Class \" + classNumber + \"</p>\");\n }\n \n $confirmPage.show();\n \n $(\"#confirmSubmit\").click({param1: jsonRequest}, confirmSubmit);\n $(\"#cancelSubmit\").click(cancelSubmit);\n }", "title": "" }, { "docid": "c77fdc006da2519a2fa83e27f8810ebc", "score": "0.5233571", "text": "function register()\n{\n //variable to check if an error is thrown.\n var alerts = 0;\n \n //grabs username from form and checks it for presence and length\n var username = document.getElementById(\"username\").value;\n \n if (username == \"\")\n {\n alert(\"You must fill in a username.\");\n alerts++;\n }\n else if (username.length < 8)\n {\n alert(\"Username must be at least 8 characters long.\");\n alerts++;\n }\n \n //grabs password from form and checks it for presence and length\n var password = document.getElementById(\"password\").value;\n \n if (password == \"\")\n {\n alert(\"You must fill in a password.\");\n alerts++;\n }\n else if (password.length < 8)\n {\n alert(\"Password must be at least 8 characters long.\");\n alerts++;\n }\n \n //grabs verification password from form and checks it for presence and that it matches password\n var passverify = document.getElementById(\"passverify\").value;\n \n if (passverify== \"\")\n {\n alert(\"You must verify password.\");\n alerts++;\n }\n else if (passverify != password)\n {\n alert(\"Password and verification do not match.\");\n alerts++;\n }\n \n //if all fields are filedl in correctly, information is sent to register.php. This checks that if the user already exists and adds user and password to database if it does not. User is alerted of result. User is logged in on success.\n if (alerts == 0)\n {\n var parameters = {\n username: username,\n password: password \n };\n \n $.getJSON(\"register.php\", parameters)\n .done(function(data, textStatus, jqXHR){\n alert(data[\"message\"]);\n \n if(data[\"message\"] == \"Account successfully created\")\n {\n login(username, password);\n }\n })\n .fail(function(jqXHR, textStatus, errorThrown){\n console.log(errorThrown);\n });\n }\n \n //this function was activated by submit button with obsubmit=\"return\", which requires returning of false to prevent page from reloading.\n return false;\n}", "title": "" }, { "docid": "2157525a7182fa53014ea5ba73b50127", "score": "0.5227361", "text": "function createGuest(){\n $(\"#confirmbutton\").css('display', 'none');\n $(\"#btnsubmit\").attr('onclick', 'submitGuest();');\n document.getElementById(\"modal-title\").innerHTML=\"Create Guest\";\n}", "title": "" }, { "docid": "f392175e83778d3cd52205aaaf6d6213", "score": "0.5226844", "text": "function submitForm() {\n let data = $(\"#register-form\").serialize();\n $.ajax({\n\n type: 'POST',\n url: '/register.php',\n data: data,\n beforeSend: function () {\n $(\"#alert\").fadeOut();\n $(\"#btn-submit\").html('<span class=\"glyphicon glyphicon-transfer\"></span> &nbsp; sending ...');\n },\n success: function (data) {\n console.log(data);\n if (data === \"exists\") {\n $(\"#alert\").fadeIn(1000, function () {\n $(\"#alert\").html('<div class=\"alert alert-danger\">Sorry, that account name already exists.</div>');\n $(\"#btn-submit\").html(\"Join Zifina!\");\n });\n }\n else if (data === \"registered\") {\n $(\"#alert\").fadeIn(1000, function () {\n $(\"#alert\").html('<div class=\"alert alert-success\">Successfully created account!</div>');\n $(\".form-signin\").trigger(\"reset\");\n window.location.replace(\"account/login\");\n });\n $(\".form-signin\").fadeOut(1000);\n }\n else if (data === \"captcha\") {\n $(\"#alert\").fadeIn(1000, function () {\n $(\"#alert\").html('<div class=\"alert alert-danger\">Please make sure you check the security CAPTCHA box.</div>');\n });\n }\n },\n error: function (data) {\n console.log(data);\n }\n });\n return false;\n }", "title": "" }, { "docid": "12321cc85419e41ca7e49f9ea332d847", "score": "0.522151", "text": "function register(event) {\n //check name length, chars\n var login_name = document.getElementById('name-id').value;\n if (login_name === '' || login_name.length < 5) {//check length, alphanumeric\n var msg = \"Name must be at least 5 characters. Please re-enter.\";\n showError('name-id', msg);\n return false;//NOTE- must return false here to not continue\n }\n var alpha_numeric = /^[a-zA-z0-9-_]+$/.test(login_name);\n if (!alpha_numeric) {\n msg = \"Name must contain alpha-numeric, dash, underscore characters. Please re-enter.\";\n showError('name-id', msg);\n return false;\n }\n\n //validate 2 passwords are identical\n var pwd1 = document.getElementById('pwd-id').value;\n var pwd2 = document.getElementById('pwd-confirm-id').value;\n if (pwd1 !== pwd2) {\n msg = \"Passwords do not confirm. Please check.\";\n showError('pwd-id', msg);\n return false;//NOTE- must return false here to not continue\n }\n\n //user must click agree\n var agree = document.getElementById('agree-id').checked;\n if (!agree) {\n msg = \"You must agree to the term of registration. Please check the checbox\";\n showError('agree-id', msg);\n return false;//NOTE- must return false here to not continue\n }\n\n //success validation, populate summary form, hide form, show summary\n var elems = document.getElementsByClassName('field-confirm');\n elems[0].innerHTML = \"Login name ==> \" + login_name;\n elems[1].innerHTML = \"Password ==> \" + pwd1;\n var email = document.getElementById('email-id').value;\n elems[2].innerHTML = \"Email ==> \" + email;\n elems[3].innerHTML = \"Country ==> \" + getSelectedText('country-id');\n elems[4].innerHTML = \"State ==> \" + getSelectedText('state-id');\n elems[5].innerHTML = \"City ==> \" + getSelectedText('city-id');\n var genders = document.getElementsByName('gender');\n var gv = genders[0].value;\n if (genders[1].checked)\n gv = genders[1].value;\n elems[6].innerHTML = \"Gender ==> \" + gv;\n document.getElementById('register-id').style.display = 'none';//hide register block\n document.getElementById('summary-id').style.display = 'block';//show confirm block\n\n //save user information in cookie\n var new_email = \"user-email=\" + email;\n var new_pwd = \"password=\" + pwd1;\n document.cookie = \"PADDING=DUMMY\";\n document.cookie = new_email;\n document.cookie = new_pwd;\n console.log(document.cookie);\n return false;//don't submit//NOTE- must return false here to not reload form\n}", "title": "" }, { "docid": "a63554cc13e27dd0e20fb8049580456b", "score": "0.520759", "text": "function raiseSuccess(content) {\r\n var mheader = document.createElement(\"div\");\r\n mheader.append(`Thành công`);\r\n var mbody = document.createElement(\"div\");\r\n mbody.append(content);\r\n var mfooter = document.createElement(\"div\");\r\n mfooter.innerHTML = `<button name=\"cancel\" class=\"bg-gray-800 text-white roudend-sm w-full h-full hover:bg-gray-600\" type=\"submit\" style=\"border-radius: 0px 0px 25px 25px\">Thoát</button>`;\r\n mfooter.children[0].addEventListener(\"click\", () => {\r\n closeModal();\r\n });\r\n // Then open modal\r\n openModal(mheader, mbody, mfooter);\r\n}", "title": "" }, { "docid": "e17e02a9d25568591cbe1b72902bfb7c", "score": "0.5198504", "text": "function successMessage(messageType, message) {\n \tdocument.getElementById(\"successMessageText\").innerHTML = messageType;\n \tdocument.getElementById(\"successMessageSolution\").innerHTML = message;\n \t$('#modalSuccess').modal(\"show\");\n}", "title": "" }, { "docid": "e3c3a8897eb5da273fdde8447b81306b", "score": "0.51843387", "text": "function submitClicked(){\r\n formIsValid = form.checkValidity()\r\n\r\n // text validation\r\n if (!formIsValid){\r\n messageForUser.textContent = \"Please fill out all fields.\"\r\n messageForUser.style.color = \"#FF8F5C\"\r\n }\r\n \r\n // password validation\r\n if (password.value === confirmedPassword.value){\r\n passwordMatch = true\r\n password.style.borderColor = \"green\"\r\n confirmedPassword.style.borderColor = \"green\"\r\n }\r\n else{\r\n passwordMatch = false\r\n password.style.borderColor = \"#FF8F5C\"\r\n confirmedPassword.style.borderColor = \"#FF8F5C\"\r\n messageForUser.textContent = \"Check your password.\"\r\n }\r\n\r\n // all validation\r\n if (formIsValid && passwordMatch){\r\n messageForUser.textContent = \"Registration succeed!\"\r\n messageForUser.style.color = \"#8AA896\"\r\n }\r\n}", "title": "" }, { "docid": "12093df552e7da67d473271dd46a4204", "score": "0.51818997", "text": "async function register() {\r\n if(user.classList.contains(\".invalid\")) {\r\n event.preventDefault();\r\n }\r\n if(description.classList.contains(\".invalid\")) {\r\n event.preventDefault();\r\n }\r\n if(balance.classList.contains(\".invalid\")) {\r\n event.preventDefault();\r\n }\r\n let testUser = await getUserList(`${user.value}`)\r\n if(user.value == testUser.user) {\r\n userWarning.classList.remove('hide');\r\n console.log(\"I think it should be working...\")\r\n return;\r\n }\r\n\r\n const registerForm = document.getElementById('registerForm');\r\n const formData = new FormData(registerForm);\r\n const data = Object.fromEntries(formData);\r\n const jsonData = JSON.stringify(data);\r\n const result = await createAccount(jsonData);\r\n\r\n if (result.error) {\r\n return console.log('An error occured:', result.error);\r\n }\r\n currentUser = user.value;\r\n document.querySelector(\".loginSection\").classList.add('hide');\r\n registerForm.classList.add('hide');\r\n document.querySelector('h4').classList.add('hide');\r\n document.querySelector(\".newTransaction\").classList.remove('hide');\r\n \r\n console.log('Account created!', result);\r\n }", "title": "" }, { "docid": "4a3a4c7345afbe44cb652abedc53803e", "score": "0.516845", "text": "function notification_modal_confirm_branded_prompt(equipment, type) {\n\n if ($('#txtBrandedQuantity').val() == null || $('#txtBrandedQuantity').val() == \"\") {\n notification_modal_dynamic_super(\"Notification\", \"Branded Quantity is required\", 'danger', 'modal_div', identifier);\n identifier++;\n return;\n }\n\n header_style = 'style=\"background-color: #1DB198; color: #ffffff;\"';\n\n var modal = '<div class=\"modal fade\" id=\"modal_div_branded\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">';\n modal += '<div class=\"modal-dialog\">';\n modal += '<div class=\"modal-content\">';\n\n modal += '<div class=\"modal-header\" ' + header_style + '>';\n modal += '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>';\n modal += '<h4 class=\"modal-title\" id=\"myModalLabel\">' + \"Confirmation\" + '</h4>';\n modal += '</div>';\n\n modal += '<div class=\"modal-body\"><br />';\n modal += \"Are you sure you want to proceed?\";\n modal += '</div>';\n\n modal += '<div class=\"modal-footer\" style=\"text-align:center;\">';\n modal += '<button type=\"button\" class=\"btn btn-success\" onclick=\"proceed(' + \"'\" + equipment + \"'\" + \",\" + \"'\" + type + \"'\" + ');\">OK</button>';\n modal += '<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>';\n\n modal += '</div>';\n\n modal += '</div>';\n modal += '</div>';\n modal += '</div>';\n\n $(\"#modal_div\").modal(\"hide\");\n $(\"#notification_modal2\").html(modal);\n $(\"#modal_div_branded\").modal(\"show\");\n $(\"#modal_div_branded\").css('z-index', '1000001');\n\n $(\"body\").css(\"margin\", \"0px\");\n $(\"body\").css(\"padding\", \"0px\");\n\n $(\"#modal_div_branded\").on(\"hidden.bs.modal\", function () {\n if (confirm_branded2 == 0) {\n $(\"#modal_div\").modal(\"show\");\n }\n else {\n $(\"#modal_div\").modal(\"hide\");\n }\n\n $(\"body\").css(\"margin\", \"0px\");\n $(\"body\").css(\"padding\", \"0px\");\n\n confirm_branded2 = 0;\n\n });\n\n}", "title": "" }, { "docid": "c5503998c899de4aa2389ed4f4ddd766", "score": "0.5154037", "text": "function register()\n {\n //Progress Bar\n if(document.getElementById(\"password\").value!==document.getElementById(\"password1\").value)\n {\n setMsg({\n disp: true,\n severity: \"error\",\n message: \"The passwords don't match!\"\n });\n return;\n }\n ReactDOM.render(<LinearProgress />, document.getElementById(\"progress\"));\n firebase.auth().createUserWithEmailAndPassword(document.getElementById(\"email\").value, document.getElementById(\"password\").value).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n setMsg({\n disp: true,\n message: errorMessage,\n severity: \"error\"\n });\n ReactDOM.render(\"\", document.getElementById(\"progress\"));\n });\n }", "title": "" }, { "docid": "a458a7d06483a19543dc101bcef9b106", "score": "0.5148527", "text": "function ShowConfirmMessage(LabelHeaderText,LabelDisplaytext,ButtonConfirmYesText,ButtonConfirmNoText,ReturnFunctionName)\r\n{\r\n\ttry\r\n\t{ \r\n\t\tvar divConfirmMessage = document.getElementById('ConfirmMessage1_DivMainConfirmMessage');\r\n\t\tvar LabelHeader = document.getElementById('ConfirmMessage1_LabelHeaderText');\r\n\t\tvar LabelDisplay = document.getElementById('ConfirmMessage1_LabelDisplaytext');\r\n\t\tvar ButtonConfirmYes = document.getElementById('ConfirmMessage1_ButtonConfirmYes');\r\n\t\tvar ButtonConfirmNo = document.getElementById('ConfirmMessage1_ButtonConfirmNo');\r\n\t\t\r\n\t\tSetLabelValue(LabelHeader,LabelHeaderText,true);\r\n\t\tSetLabelValue(LabelDisplay,LabelDisplaytext,true);\r\n\t\tButtonConfirmYes.value = ButtonConfirmYesText;\r\n\t\tButtonConfirmNo.value = ButtonConfirmNoText;\r\n\t\t\r\n\t\tvar CallingFunction = document.getElementById('ConfirmMessage1_HiddenFieldCallingFunction');\r\n\t\tCallingFunction.value = ReturnFunctionName;\t\t\r\n\t\t\r\n\t\tif(divConfirmMessage!=null)\r\n\t\t{ \r\n\t\t\tdivConfirmMessage.style.cssText = 'background-color: White; vertical-align: middle;position: absolute; z-index: 315; left: 60px; top: 250px; display: block; overflow: auto;';\r\n\r\n\t\t\theight = divConfirmMessage.style.height;\r\n\t\t\twidth = divConfirmMessage.style.width; \r\n\t\t}\t\r\n\t\treturn false;\r\n\t}\r\n\tcatch(ex)\r\n\t{\r\n\t\talert('ShowConfirmMessage--'+ex.message);\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "05e43c4bdf426e1d332517a7259916b4", "score": "0.5147891", "text": "function handleRegisterLinkClick() {\n setRegisterPopupOpen(true);\n setLoginPopupOpen(false);\n setWrongEmailOrPasswordMessage(false);\n }", "title": "" }, { "docid": "b9fec8739f8454159caab6872c364a9f", "score": "0.51459455", "text": "function showRegisterForm(){\n $('.loginBox').fadeOut('fast',function(){\n $('.registerBox').fadeIn('fast');\n $('.login-footer').fadeOut('fast',function(){\n $('.register-footer').fadeIn('fast');\n });\n $('.modal-title').html('Register with');\n }); \n $('.error').removeClass('alert alert-danger').html('');\n \n}", "title": "" }, { "docid": "8ec54040cffdee43bb7ea6c04984c29d", "score": "0.5143191", "text": "function render(state) {\n let view = '';\n\n const {\n registrationState,\n } = state.mrw.wrapped_api;\n\n if (!registrationState) {\n return view;\n }\n\n const { username } = registrationState.pendingState || {};\n if (registrationState.loading) {\n view =\n ` [ You are now being registered, ${username}! . ]`;\n } else {\n view = registrationState.status === 'success' ?\n ` [ You're now registered, ${username}! ✓ ]` :\n ` [ You failed to register, ${username}! ⤫ ]`;\n }\n return view;\n}", "title": "" }, { "docid": "4a5cc5a481943873536b95ef66d26d0b", "score": "0.51388735", "text": "render() {\n\n\t\t// If redirect flag is true, next run of render will redirect to home as the user created account successfully\n\t\tif(this.state.redirect) return <Redirect to={'/app/home'}/>\n\n\t\treturn (\n\t\t\t\n\t\t\t<div className=\"registerForm\">\n\n\t\t\t\t<img src={logo}/>\n\n\t\t\t\t<h1 className=\"text-center\">Register:</h1>\n\t\t\t\t<form>\n\t\t\t\t\t<label htmlFor=\"full_name\"><b>Full Name</b></label>\n\t\t\t\t\t<input type=\"text\" placeholder=\"Enter Name\" name=\"full_name\" onChange={this.handleInputChange} value={this.state.user.full_name} />\n\n\t\t\t\t\t<label htmlFor=\"username\"><b>Username</b></label>\n\t\t\t\t\t<input type=\"text\" placeholder=\"Enter Username\" name=\"username\" onChange={this.handleInputChange} value={this.state.user.username} />\n\t\t\t\t\t{this.state.errors.username ? <div className=\"error\">Username is required</div>: null}\n\n\t\t\t\t\t<label htmlFor=\"password\" ><b>Password</b></label>\n\t\t\t\t\t<input type=\"password\" placeholder=\"Enter Password\" name=\"password\" onChange={this.handleInputChange} value={this.state.user.password} />\n\t\t\t\t\t{this.state.errors.password ? <div className=\"error\">password is required</div>: null}\n\n\n\t\t\t\t\t<label htmlFor=\"role\" ><b>Account Type</b></label><br/>\n\t\t\t\t\t<div class=\"form-check form-check-inline\">\n\t\t\t\t\t\t<input class=\"form-check-input\" type=\"radio\" name=\"role\" onChange={this.handleInputChange} id=\"permissions1\" value=\"viewer\" checked/>\n\t\t\t\t\t\t<label class=\"form-check-label\" for=\"permissions1\">I want to view recipes only</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"form-check form-check-inline\">\n\t\t\t\t\t\t<input class=\"form-check-input\" type=\"radio\" name=\"role\" onChange={this.handleInputChange} id=\"permissions2\" value=\"creator\"/>\n\t\t\t\t\t\t<label class=\"form-check-label\" for=\"permissions2\">I want to create and view recipes</label>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{this.state.errors.incorrect ? <div className=\"error\">Details were incorrect</div>: null}\n\n\t\t\t\t\t<button type=\"submit\" onClick={this.handleRegisterClick}>Register</button>\n\t\t\t\t</form>\n\n\t\t\t\t<p>Already have an account? <a href=\"/\">Login.</a></p>\n\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "aa48166e301f0bf526fdc6acfc74867c", "score": "0.51296115", "text": "function confirmMessage() {\n\t//get pickup time selects\n\tvar hours = document.getElementById(\"hours\");\n\tvar minutes = document.getElementById(\"minutes\");\n\tvar ampm = document.getElementById(\"ampm\");\n\t\n\t//get confirmation message element\n\tvar message = document.getElementById(\"confirmMessage\");\n\t\n\t//get day and month from calendar\n\tvar month = document.getElementById(\"calendar_head\").innerHTML.split(\" \")[0];\n\tvar day = document.getElementById(\"calendar_today\").innerHTML;\n\t\n\t//get order total\n\tvar total = document.getElementById(\"total\").innerHTML;\n\t\n\t//if pickup hours, minutes and am/pm selected, display confirmation message\n\tif (hours.value != \"\" && minutes.value != \"\" && ampm.value != \"\") {\n\t\t\n\t\t//check for valid hours\n\t\tif (validateTime(hours, minutes, ampm)) {\n\t\t\t\n\t\t\t//valid pickup time, display confirmation message\n\t\t\tmessage.innerHTML = \"Your order will be ready for pickup at \" + hours.value + \":\" +\n\t\t\t\t\tminutes.value + \" \" + ampm.value + \" on \" + month + \" \" + day +\n\t\t\t\t\t\". Your total will be \" + total + \". Please enter your credit card and information below:\";\n\t\t} else {\n\t\t\tmessage.innerHTML = \"\";\n\t\t\talert(\"Please select a pickup time between 10 AM and 11 PM\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "23674847382903cdd80699751a623ed2", "score": "0.5129516", "text": "function register(){\n\t$(\".errorFormRow\").css(\"display\",\"none\");\n\tdocument.getElementById(\"registerForm\").reset();//reset register form\n\tswitchDivs(\"#outerRegisterDiv\",\"flex\");\t\n}", "title": "" }, { "docid": "837031238c26ea409ad16a0365721cef", "score": "0.5127589", "text": "function showNotification(message) {\n const notification = document.getElementById(\"notification\");\n notification.classList.add(\"notification\");\n notification.textContent = message;\n \n const span = document.createElement(\"span\");\n span.textContent = \"x\";\n span.addEventListener(\"click\", removeClass)\n\n notification.append(span);\n signUpForm.prepend(notification);\n}", "title": "" }, { "docid": "4cbca9afd6ce2ac1b5ead278aed920a1", "score": "0.51209486", "text": "function SetValidationSuccessMessage(message) {\r\n\r\n var currentErrorRegion;\r\n\r\n var modelPopup = $(\".modal-scrollable\");\r\n if (modelPopup.length > 0) {\r\n var currentModel = $(modelPopup)[modelPopup.length - 1];\r\n currentErrorRegion = $(currentModel).find(\"#commonErrorRegion\");\r\n }\r\n else {\r\n currentErrorRegion = $(\"#commonErrorRegion\");\r\n }\r\n\r\n $(currentErrorRegion).show();\r\n\r\n var messageHtml = \"<div class='alert alert-info'>\"\r\n + \"<p>\"\r\n + message\r\n + \"</p>\";\r\n\r\n $(currentErrorRegion).html(messageHtml);\r\n}", "title": "" }, { "docid": "c4f7f50f80ed7874e88edb4a8a9c4671", "score": "0.51178384", "text": "function postSuccess(message = \"Merci ! Votre inscription a bien été enregistrée.\") {\n\n $(\".w-form-done\").html(\"<div>\" + message + \"</div>\")\n /** Show success message */\n $(\".w-form-done\").show()\n\n /** Hide fail message */\n $(\".w-form-fail\").hide()\n\n /** Clear email input */\n $(\"input[type=email]\").val(\"\")\n $(\"input[type=email]\").hide()\n\n /** Remove loader */\n $('#loader').remove()\n\n /** Show sbmit button */\n // $('.w-button').show()\n\n}", "title": "" }, { "docid": "5ff520c8152aa25c4043066034680d41", "score": "0.5114101", "text": "function submitForm(){\n var data = $(\"#register-form\").serialize();\n $.ajax({\n type : 'POST',\n url : '/register',\n data : data,\n beforeSend: function()\n {\n $(\"#error\").fadeIn(100, function(){\n $(\"#error\").html('<p>Registering...</p>');\n })\n },\n success : function(data) {\n if(data === \"registered\"){\n $(\"#error\").fadeIn(1000, function(){\n $(\"#error\").html('<p>Registration Successful!</p>');\n });\n\n }\n else{\n $(\"#error\").fadeIn(1000, function(){\n $(\"#error\").html('<p class=\"alert-danger\">Unexpected error!' + data + '</p>');\n });\n }\n },\n error : function (data) {\n $(\"#error\").fadeIn(1000, function(){\n $(\"#error\").html('<p class=\"alert-danger\">Unexpected error!' + data + '</p>');\n });\n }\n });\n return false;\n }", "title": "" }, { "docid": "70e28f37103126aaa62a8cca28c1caa0", "score": "0.51124823", "text": "function display_confirm(confirm_msg,ok_function,cancel_function){\r\n if(!confirm_msg){confirm_msg=\"\";}\r\n\r\n var container_div = document.getElementById('modal_js_confirm');\r\n var div;\r\n if(!container_div) {\r\n container_div=document.createElement('div');\r\n container_div.id='modal_js_confirm';\r\n container_div.style.position='absolute';\r\n container_div.style.top='0px';\r\n container_div.style.left='0px';\r\n container_div.style.width='100%';\r\n container_div.style.height='1px';\r\n container_div.style.overflow='visible';\r\n container_div.style.zIndex=10000000;\r\n\r\n div=document.createElement('div');\r\n div.id='modal_js_confirm_contents';\r\n div.style.zIndex=10000000;\r\n div.style.backgroundColor='#eee';\r\n div.style.fontFamily='\"lucida grande\",tahoma,verdana,arial,sans-serif';\r\n div.style.fontSize='11px';\r\n div.style.textAlign='center';\r\n div.style.color='#333333';\r\n div.style.border='2px outset #666';\r\n div.style.padding='10px';\r\n div.style.position='relative';\r\n div.style.width='300px';\r\n div.style.height='100px';\r\n div.style.margin='300px auto 0px auto';\r\n div.style.display='block';\r\n\r\n container_div.appendChild(div);\r\n document.body.appendChild(container_div);\r\n\r\n div.innerHTML = '<div style=\"text-align:center\"><div>'+confirm_msg+'</div><br/><div>Press OK to continue.</div><br><button id=\"modal_js_confirm_ok_button\">OK</button> <button id=\"modal_js_confirm_cancel_button\">Cancel</button></div>';\r\n var ok_button = document.getElementById('modal_js_confirm_ok_button');\r\n ok_button.addEventListener('click',function() {\r\n if(ok_function && typeof(ok_function) == \"function\"){\r\n ok_function();\r\n }\r\n container_div.parentNode.removeChild(container_div);\r\n },false);\r\n var cancel_button = document.getElementById('modal_js_confirm_cancel_button');\r\n cancel_button.addEventListener('click',function() {\r\n if(cancel_function && typeof(cancel_function) == \"function\"){\r\n cancel_function();\r\n }\r\n container_div.parentNode.removeChild(container_div);\r\n },false);\r\n }\r\n}", "title": "" }, { "docid": "2be1d38a396508f9ef60af438f21182d", "score": "0.51038116", "text": "function onSignupFailure() {\n $(\"#signupError\").show();\n $(\"#signupButton\").prop(\"disabled\", false);\n }", "title": "" }, { "docid": "2bf0c0c40449e1568f2d018cd7b6776a", "score": "0.51034516", "text": "function checkconfirmpassword1() {\r\n let confirmPassword = document.querySelector(\"#confirm-password\"); // input for confirm password\r\n let confirmPasswordData = document.querySelector(\"#confirmPaswd-data\"); // confirm password error span\r\n if (confirmPassword.value != password.value && confirmPassword.value !== \"\") {\r\n confirmPasswordData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"><span>Password not match</span>';\r\n confirmPasswordData.style.opacity = 1;\r\n return false;\r\n }\r\n if (confirmPassword.value == \"\") {\r\n confirmPasswordData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"><span>Please input this field</span>';\r\n confirmPasswordData.style.opacity = 1;\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "5b8e343dfdb38b9da5931bec2cec7a7b", "score": "0.5103218", "text": "function registerUser(e) {\n let target = $(e.target),\n email = target.find('input[name=\"email\"]'),\n password = target.find('input[name=\"password\"]'),\n confirmPassword = target.find('input[name=\"confirmPassword\"]'),\n securityAnswer1 = target.find('input[name=\"securityAnswer1\"]'),\n securityAnswer2 = target.find('input[name=\"securityAnswer2\"]');\n\n let formValid = email.get(0).checkValidity() &&\n password.get(0).checkValidity() &&\n confirmPassword.get(0).checkValidity() &&\n securityAnswer1.get(0).checkValidity() &&\n securityAnswer2.get(0).checkValidity();\n if (formValid) {\n e.preventDefault();\n let url = SnippetsUrl + '?cmd=create_user';\n $.post(url, {\n email: email.val(),\n password: password.val(),\n confirmPassword: confirmPassword.val(),\n securityAnswer1: securityAnswer1.val(),\n securityAnswer2: securityAnswer2.val(),\n })\n .done(function(data) {\n if (data.status === \"OK\") {\n userAlert('success', 'User successfully registered. Welcome!');\n currentUser = email.val();\n updateLoginStatus();\n } else {\n userAlert('danger', data.errmsg);\n }\n })\n .fail(function(data) {\n userAlert('danger', 'An error has occured creating your account. Please try again.');\n })\n .always(function(data) {\n email.val('');\n password.val('');\n confirmPassword.val('');\n securityAnswer1.val('');\n securityAnswer2.val('');\n $('#registerModal').modal('hide');\n });\n } else { return true; }\n}", "title": "" }, { "docid": "64b6410ef84f89b0ee0689bc3cdc5cb3", "score": "0.5097811", "text": "function register() {\n var username = document.getElementById('username').value;\n var password = document.getElementById('password').value;\n var title = document.getElementById('title').value;\n var fullname = document.getElementById('fullname').value;\n var gender = document.getElementById('gender').value;\n var email = document.getElementById('email').value;\n var birthdate = document.getElementById('birthdate').value;\n var ccn = document.getElementById('ccn').value;\n var apple = document.getElementById('apple').value;\n //store\n localStorage.setItem('username', username);\n localStorage.setItem('password', password);\n localStorage.setItem('title', title);\n localStorage.setItem('fullname', fullname);\n localStorage.setItem('gender', gender);\n localStorage.setItem('email', email);\n localStorage.setItem('birthdate', birthdate);\n localStorage.setItem('ccn', ccn);\n localStorage.setItem('apple', apple);\n\n document.getElementById('registration').innerHTML =\n \"Thank you for joining the North American League of Greninja Enthusiasts!\"\n }", "title": "" }, { "docid": "452b8b7573b7330f13acf62debaee416", "score": "0.5096584", "text": "function doRegister() \n{ \n var token = cocoon.request.get(\"token\");\n\n if (token == null) \n {\n var email = cocoon.request.getParameter(\"email\");\n var accountExists = false;\n var epersonFound = false;\n var errors = new Array();\n\n do {\n \tif (accountExists) {\n\t\t\t\tcocoon.sendPage(\"forgot/verify\", {\"email\":email});\n return;\n }\n \n \tif (email == null) {\n\t cocoon.sendPageAndWait(\"register/start\",{\"email\" : email, \"errors\" : errors.join(','), \"accountExists\" : accountExists});\n\t\t\t}\n\t\t\t\n\t\t\t\n var errors = new Array();\n accountExists = false;\n \n var submit_forgot = cocoon.request.getParameter(\"submit_forgot\");\n \n if (submit_forgot != null)\n {\n // The user attempted to register with an email address that already exists then they clicked\n // the \"I forgot my password\" button. In this case, we send them a forgot password token.\n AccountManager.sendForgotPasswordInfo(getDSContext(),email);\n getDSContext().commit();\n\n cocoon.sendPage(\"forgot/verify\", {\"email\":email});\n return;\n }\n \n email = cocoon.request.getParameter(\"email\");\n email = email.toLowerCase(); // all emails should be lowercase\n epersonFound = (EPerson.findByEmail(getDSContext(),email) != null);\n \n if (epersonFound) \n {\n accountExists = true;\n continue;\n }\n \n var canRegister = AuthenticationUtil.canSelfRegister(getObjectModel(), email);\n \n if (canRegister) \n {\n try \n {\n // May throw the AddressException or a varity of SMTP errors.\n AccountManager.sendRegistrationInfo(getDSContext(),email);\n getDSContext().commit();\n } \n catch (error) \n {\n // If any errors occur while trying to send the email set the field in error.\n errors = new Array(\"email\");\n continue;\n }\n \n cocoon.sendPage(\"register/verify\", { \"email\":email, \"forgot\":\"false\" });\n return; \n } \n else \n {\n cocoon.sendPage(\"register/cannot\", { \"email\" : email});\n return;\n }\n \n } while (accountExists || errors.length > 0)\n } \n else \n {\n // We have a token. Find out who the it's for\n var email = AccountManager.getEmail(getDSContext(), token);\n \n if (email == null) \n {\n cocoon.sendPage(\"register/invalid-token\");\n return;\n }\n \n var setPassword = AuthenticationUtil.allowSetPassword(getObjectModel(),email);\n \n var errors = new Array();\n do {\n cocoon.sendPageAndWait(\"register/profile\",{\"email\" : email, \"allowSetPassword\":setPassword , \"errors\" : errors.join(',')});\n \n // If the user had to retry the form a user may allready be created.\n var eperson = EPerson.findByEmail(getDSContext(),email);\n if (eperson == null)\n {\n eperson = AuthenticationUtil.createNewEperson(getObjectModel(),email);\n }\n \n // Log the user in so that they can update their own information.\n getDSContext().setCurrentUser(eperson);\n \n errors = updateInformation(eperson);\n \n if (setPassword) \n {\n var passwordErrors = updatePassword(eperson);\n errors = errors.concat(passwordErrors);\n }\n \n // Log the user back out.\n getDSContext().setCurrentUser(null);\n } while (errors.length > 0) \n \n // Log the newly created user in.\n AuthenticationUtil.logIn(getObjectModel(),eperson);\n AccountManager.deleteToken(getDSContext(), token);\n getDSContext().commit();\n \n cocoon.sendPage(\"register/finished\");\n return;\n }\n}", "title": "" }, { "docid": "62c6206c6468ec5374d7414418bb032b", "score": "0.5094555", "text": "function displayRegister(){\n let x = \"Your login info will be displayed here\";\n document.getElementById(\"homeResponse\").innerHTML = x;\n document.getElementById(\"register\").style.display = \"block\";\n document.getElementById(\"login\").style.display = \"none\";\n}", "title": "" }, { "docid": "717d78b528752f152aed3503938f4469", "score": "0.50889194", "text": "generateMessage (callback) {\n\t\t// the message we expect to receive is the registered user, with isRegistered flag set\n\t\tlet user = this.users.find(user => {\n\t\t\treturn !user.user.isRegistered && (user.user.teamIds || []).includes(this.team.id);\n\t\t});\n\t\tuser = new User(user.user);\n\t\tlet userObject = user.getSanitizedObject();\n\t\tObject.assign(userObject, {\n\t\t\tisRegistered: true,\n\t\t\tjoinMethod: 'Added to Team',\n\t\t\tprimaryReferral: 'internal',\n\t\t\toriginTeamId: this.team.id,\n\t\t\tversion: 2\n\t\t});\n\t\tdelete userObject.inviteCode;\n\t\tthis.message = {\n\t\t\tusers: [userObject]\n\t\t};\n\t\tthis.beforeConfirmTime = Date.now();\n\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: '/xenv/confirm-user',\n\t\t\t\tdata: {\n\t\t\t\t\temail: userObject.email\n\t\t\t\t},\n\t\t\t\trequestOptions: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'X-CS-Auth-Secret': this.apiConfig.environmentGroupSecrets.requestAuth\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tcallback\n\t\t);\n\t}", "title": "" }, { "docid": "1f430c24c5e32afb1d8875f91f473cd6", "score": "0.50874615", "text": "async confirmUserAsNeeded () {\n\t\tif (this.user.get('isRegistered')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst userData = {};\n\t\t['email', 'username', 'fullName', 'timeZone'].forEach(attribute => {\n\t\t\tif (this.providerInfo[attribute]) {\n\t\t\t\tuserData[attribute] = this.providerInfo[attribute];\n\t\t\t}\n\t\t});\n\n\t\tawait new ConfirmHelper({\n\t\t\trequest: this,\n\t\t\tuser: this.user,\n\t\t\tdontCheckUsername: true,\n\t\t\tnotTrueLogin: true\n\t\t}).confirm(userData);\n\t\tthis.userWasConfirmed = true;\n\t}", "title": "" }, { "docid": "ee98c54c30c9ee7b13762842f04582c6", "score": "0.50857717", "text": "function register() {\n if(emailInput.value && passwordInput.value && passwordConfirmInput \n && passwordConfirmInput.value === passwordInput.value\n && validateEmail(emailInput.value)) {\n submitButton.removeAttribute(\"disabled\",\"\");\n } \n}", "title": "" }, { "docid": "a597433ccec4333cc69f269a80a8a1f0", "score": "0.50825584", "text": "function showConfirm() {\n navigator.notification.confirm(\n BCS.buy_credits_confirmation_box_title, // message\n onConfirm, // callback to invoke with index of button pressed\n BCS.buy_credits_confirmation_box_subtitle, // title\n ''+BCS.pay_now_btn_title+','+ BCS.remind_me_letter_btn_title+'' // buttonLabels\n );\n}", "title": "" }, { "docid": "1b36f1f62383d76805958e33deeabbf6", "score": "0.5078978", "text": "function validateRegistration(){\n\tvar username = document.forms[\"register\"][\"username\"].value;\n\tvar password1 = document.forms[\"register\"][\"pwd1\"].value;\n\tvar password2 = document.forms[\"register\"][\"pwd2\"].value;\n\t\n\tvar errorDiv = document.createElement(\"div\");\n\terrorDiv.setAttribute(\"class\",\"alert alert-danger\");\n\terrorDiv.setAttribute(\"id\",\"error\");\n\t\n\tconsole.log(document.getElementById(\"error\")!=null);\n\tif(document.getElementById(\"error\")!=null){\n\t\tdocument.getElementById(\"error\").remove();\n\t}\n\n\tif(username==\"bobbert\"){\n\t\tvar text = document.createTextNode(\"USERNAME TAKEN!\");\n\t\terrorDiv.appendChild(text);\n\t\t\n\t\t\n\t\tdocument.getElementById(\"username\").appendChild(errorDiv);\n\t\treturn false;\n\t}\n\n\tif(password1!=password2){\n\t\tvar text = document.createTextNode(\"PASSWORDS DON't MATCH\");\n\t\terrorDiv.appendChild(text);\n\t\t\n\t\tdocument.getElementById(\"pwd\").appendChild(errorDiv);\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}", "title": "" }, { "docid": "e4817df610b9dc4e6ab0f7b94a6b1b37", "score": "0.5077713", "text": "success() {\n\n Modal.success({\n okText:\"Done\",\n title: 'You have successfully created an account!',\n // content: 'View your requests to see your new entry.',\n onOk() {\n this.doneRedirect();\n }\n });\n }", "title": "" }, { "docid": "0443ed71a742191d6c1963e9dc03eba2", "score": "0.5075998", "text": "function addCustomerToCheckout(modalContent) {\n // const customer = document.querySelector('.customer-info')\n const buyer = getFormInputInfo(\"#buyer-form\")\n const date = convertDate(buyer.date)\n\n const markupTourCard = `\n <div class=\"pl-3 pr-3\">\n <h5 class=\"m-0 mt-3 mb-3 text-underline\">Contact Information:</h5>\n <p class=\"m-0\"><span class=\"customer-first-name\">${buyer.firstName}</span>&nbsp;<span class=\"customer-last-name\">${buyer.lastName}</span></p>\n <p class=\"m-0 mt-1\"><span class=\"customer-email\">${buyer.email}</span></p>\n <p class=\"m-0 mb-3\"><span class=\"customer-phone\">+${buyer.phone}</span></p><br>\n <h5 class=\"m-0 p-0\">Tour Date: &nbsp;<span class=\"tour-date\">${date}</span></h5>\n </div>\n `;\n modalContent.innerHTML = markupTourCard\n}", "title": "" }, { "docid": "28063f06b361ba3792d0a3ac0ae98c56", "score": "0.5074034", "text": "render() {\n return (\n <form onSubmit={this.props.handleConfirmationSubmit}>\n {!this.props.isConfirmationCodeValid\n ? <Alert className=\"Alert\" bsStyle='danger'>\n Wrong confirmation code. Please try again.\n </Alert>\n : null}\n {this.props.isValidNewPassword !== null\n ? <Alert className=\"Alert\" bsStyle=\"danger\">\n {this.props.invalidPasswordErrMsg}\n </Alert>\n : null}\n <FormGroup controlId=\"confirmationCode\" bsSize=\"large\"\n validationState={this.props.isConfirmationCodeValid\n ? null : 'error'}>\n <ControlLabel>Confirmation Code</ControlLabel>\n <FormControl\n autoFocus\n type=\"tel\"\n value={this.props.confirmationCode}\n onChange={this.props.handleChange}\n />\n <FormControl.Feedback />\n <HelpBlock>Please check your email for the code.</HelpBlock>\n </FormGroup>\n <FormGroup controlId=\"password\" bsSize=\"large\"\n validationState={this.props.isValidNewPassword}>\n <ControlLabel>New Password</ControlLabel>\n <OverlayTrigger\n trigger={['hover','focus']}\n placement='right'\n overlay={passwordPolicy}\n >\n <FormControl\n type=\"password\"\n value={this.props.password}\n onChange={this.props.handleChange}\n placeholder=\"Enter new password\"\n />\n </OverlayTrigger>\n <FormControl.Feedback />\n </FormGroup>\n <FormGroup controlId=\"confirmPassword\" bsSize=\"large\">\n <ControlLabel>Confirm New Password</ControlLabel>\n {this.props.validateConfirmationForm()\n ? <FormControl\n type=\"password\"\n value={this.props.confirmPassword}\n onChange={this.props.handleChange}\n placeholder=\"Re-enter new password\"\n />\n : <OverlayTrigger\n trigger={['hover', 'focus']}\n placement=\"right\"\n overlay={passwordMatch}\n >\n <FormControl\n type=\"password\"\n value={this.props.confirmPassword}\n onChange={this.props.handleChange}\n />\n </OverlayTrigger>\n }\n </FormGroup>\n <LoaderButton\n block\n bsSize=\"large\"\n disabled={!this.props.validateConfirmationForm()}\n type=\"submit\"\n isLoading={this.props.isLoading}\n text=\"Change Password\"\n loadingText=\"Changing Password…\"\n />\n </form>\n );\n }", "title": "" }, { "docid": "6bcdc7a1cac209a3419c53a0e3203837", "score": "0.50729215", "text": "function registration() {\n var email = $('#email').val();\n var username = $('#username').val();\n var password = $('#password').val();\n var confirmPassword = $('#confirm_password').val();\n var responseKey = $('#g-recaptcha-response').val();\n\n // Make sure the fields are not empty.\n if (username === \"\") {\n $('#username-error').text('Username field is required.')\n $('#username-error').attr('hidden', false);\n } else {\n $('#username-error').attr('hidden', true);\n }\n\n if (password === \"\") {\n $('#password-error').text('Password field is required.');\n $('#password-error').attr('hidden', false);\n } else {\n $('#password-error').attr('hidden', true);\n }\n\n if (confirmPassword === \"\") {\n $('#confirm-password-error').text('Password confirmation field is required.');\n $('#confirm-password-error').attr('hidden', false);\n } else {\n $('#confirm-password-error').attr('hidden', true);\n }\n\n // Check if the email is in the correct format.\n if (!validateEmail(email)) {\n $('#email-error').text('Incorrect format.')\n $('#email-error').attr('hidden', false);\n\n if (email === \"\") {\n $('#email-error').text('Email field is required.');\n $('#email-error').attr('hidden', false);\n }\n\n } else {\n\n $('#email-error').attr('hidden', true);\n\n if (email && username && password && confirmPassword) {\n $.ajax({\n type: \"POST\",\n url: \"../../src/auth/registration_action.php\",\n data: {\n submit: \"submit\",\n email: email,\n username: username,\n password: password,\n confirmPassword: confirmPassword,\n gRecaptchaResponse: responseKey\n },\n success: function (data) {\n\n console.log(data);\n \n // If the PHP code sends back the code 0, the user did not type the same password in the\n // confirm password field. Warn the user.\n if (data.includes(\"0\")) {\n $('#confirm-password-error').text('Re-entered password must be the same as the original.');\n $('#confirm-password-error').attr('hidden', false);\n grecaptcha.reset();\n } else {\n $('#confirm-password-error').attr('hidden', true);\n }\n\n // If the PHP code sends back the code 1, the user entered an email that has already been registered.\n // Warn the user.\n if (data.includes(\"1\")) {\n $('#email-error').text('Email is already registered.');\n $('#email-error').attr('hidden', false);\n grecaptcha.reset();\n } else {\n $('#email-error').attr('hidden', true);\n }\n\n // If the PHP code sends back the code 2, the username is already taken. Warn the user.\n if (data.includes(\"2\")) {\n $('#username-error').text('Username is already taken');\n $('#username-error').attr('hidden', false);\n grecaptcha.reset();\n } else {\n $('#password-error').attr('hidden', true);\n }\n\n // If the PHP code sends back the code 3, the RECAPTCHA process wasn't a success, warn the user.\n if (data.includes(\"3\")) {\n $('#recaptcha-error').attr('hidden', false);\n } else {\n $('#recaptcha-error').attr('hidden', true);\n }\n\n // If the code returned is 4, the registration was a success and the user is redirected to the\n // home page.\n if (data == 4) {\n window.location = '../../public/views/home.php';\n }\n }\n });\n }\n }\n\n}", "title": "" }, { "docid": "8d706f503aaade9e80a8da023ec2c216", "score": "0.50646913", "text": "function modalMessage(modalTitle, modalBody) {\n\t$('.notify-modal-title').html(modalTitle);\n\t$('.notify-modal-body').html(modalBody);\n\t$('#notify-modal').modal();\n}", "title": "" }, { "docid": "5e6d607025b89c903b96d7b45f224c81", "score": "0.5063814", "text": "function displayConfirmation()\n{\n\tvar response = confirm(\"Please confirm whether you want to see the message.\");\n\tvar output = \"\";\n\t\n\t// If the user clicks OK\n\tif(response)\n\t{\n\t\toutput = \"I am a cat.\"\n\t}\n\t\n\t// Display the output\n\tdocument.getElementById(\"confirm\").innerHTML = output;\n}", "title": "" }, { "docid": "f7a331d246a42500963efbd737e67b35", "score": "0.50636435", "text": "function myMessage() {\n\tvar x;\n\tif (confirm(\"Press a button!\") == true) {\n\t\t\tx = \"You pressed OK!\";\n\t} else {\n\t\t\tx = \"You pressed Cancel!\";\n\t}\n\tdocument.getElementById(\"btnMessage\").innerHTML = x;\n}", "title": "" }, { "docid": "3816171ef117f0c3be4adc02eacc2009", "score": "0.50598377", "text": "function confirmPassword() {\r\n\t\tconst password = $('#sign-up-password').val();\r\n\t\tconst retype_password = $('#confirmPassword').val();\r\n\t\tif (password === '') {\r\n\t\t\t$('.confirmPassword-error').html('Password cannot be Null');\r\n\t\t\t$('.confirmPassword-error').show();\r\n\t\t\t$('#confirmPassword').css('border', '2px solid #F90A0A');\r\n\t\t\tsignUpPasswordError = true;\r\n\t\t} else if (password !== retype_password) {\r\n\t\t\t$('.confirmPassword-error').html('Passwords Did not Matched');\r\n\t\t\t$('.confirmPassword-error').show();\r\n\t\t\t$('#confirmPassword').css('border', '2px solid #F90A0A');\r\n\t\t\tconfirmPasswordError = true;\r\n\t\t} else {\r\n\t\t\t$('.confirmPassword-error').hide();\r\n\t\t\t$('#confirmPassword').css('border', '2px solid #34F458');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "aaf457061bafa032c64fca5ba3135f08", "score": "0.505824", "text": "function createModal(modalType, mobalMsg){\n modal.classList.add('active');\n var form = document.createElement('form');\n var modalMessage = document.createElement('p');\n var input = document.createElement('input');\n var modalDiv = document.createElement('div');\n var confirm = document.createElement('input');\n var modalCancel = document.createElement('input');\n\n modalMessage.textContent = mobalMsg;\n\n input.placeholder = \"Your response\";\n input.type = \"text\"\n\n\n confirm.type =\"submit\";\n confirm.value = \" Confirm\"\n\n\n modalCancel.type = 'button';\n modalCancel.value = 'cancel'\n\n\n form.append(modalMessage);\n if (modalType === 'prompt'){\n form.append(input);\n modalDiv.append(modalCancel)\n\n }else if(modalType === 'confirm'){\n form.append(modalCancel);\n }\n modalDiv.append(confirm)\n form.append(modalDiv);\n\n modal.append(form);\n\n modalCancel.addEventListener('click', function(){\n modal.removeChild(form);\n modal.classList.remove('active');\n\n });\n\n confirm.addEventListener('click', function(evt){\n evt.preventDefault();\n var userInput = input.value;\n modal.removeChild(form);\n modal.classList.remove('active')\n\n if(input.value){\n var userInput = input.value;\n console.log(userInput);\n }\n\n\n // if(modalType === 'alert'){\n // modal.removeChild(form);\n // modal.classList.remove('active')\n // }else if(modalType === \"prompt\"){\n // console.log(userInput);\n // }\n })\n\n\n\n}", "title": "" }, { "docid": "89faef49cbb312c81e613782ece676d0", "score": "0.50578135", "text": "function register(){\n\tvar username = $(\"user\").value;\n\tvar password = $(\"pass\").value;\n\tvar container=$(\"form\");\n\tvar retpass = $(\"retpass\").value;\n\tvar element=$$(\"strong\")[0];\n\n\tif(username == \"\" && password == \"\" && retpass == \"\"){\n\t\tshowMessage(\"Fill the fields please!\",container,element);\n\t} else if(username == \"\"){\n\t\tshowMessage(\"Username missing!\",container,element);\n\t} else if(password == \"\"){\n\t\tshowMessage(\"Password missing!\",container,element);\n\t} else if(password == \"\"){\n\t\tshowMessage(\"Retype Password please!\",container,element);\n\t} else if(username.length < 3){\n\t\tshowMessage(\"Username must be at least 3 character long!\",container,element);\n\t} else if(password.length < 8){\n\t\tshowMessage(\"Password must be at least 8 character long!\",container,element);\n\t} else {\n\t\t//se le password corrispondono tenta la registrazione se no mostra messaggio di errore\n\t\tif(password == retpass){\n\t\t\tcheckReg(username,password);\n\t\t} else {\n\t\t\tshowMessage(\"The passwords are different!\",container,element);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f5a4a32d24f34c065a65670d3c5909e2", "score": "0.50457704", "text": "function ShowErrorMessagePopUp(msg, isError) {\n if (isError == true || isError == undefined)\n jQuery(\"#alertMessage\").addClass(\"text-danger\")\n else\n jQuery(\"#alertMessage\").removeClass(\"text-danger\")\n jQuery(\"#alertMessage\").html(msg);\n jQuery(\"#confirmModal\").dialog({\n modal: true,\n buttons: [\n {\n text: languageResource.resMsg_Ok,\n click: function () {\n jQuery(\"#confirmModal\").dialog(\"close\");\n }\n }\n ]\n });\n}", "title": "" }, { "docid": "f5a4a32d24f34c065a65670d3c5909e2", "score": "0.50457704", "text": "function ShowErrorMessagePopUp(msg, isError) {\n if (isError == true || isError == undefined)\n jQuery(\"#alertMessage\").addClass(\"text-danger\")\n else\n jQuery(\"#alertMessage\").removeClass(\"text-danger\")\n jQuery(\"#alertMessage\").html(msg);\n jQuery(\"#confirmModal\").dialog({\n modal: true,\n buttons: [\n {\n text: languageResource.resMsg_Ok,\n click: function () {\n jQuery(\"#confirmModal\").dialog(\"close\");\n }\n }\n ]\n });\n}", "title": "" }, { "docid": "e5faa2e1b8c2d908fb2248c139116f2c", "score": "0.50457275", "text": "showRegister() {\n return (\n <div className=\"Register-Box\">\n <Button id=\"LoginButton\" onClick= {() => this.switchPage(true)} primary>LOG IN</Button>\n <Button id= \"RegisterButton\" onClick= {() => this.switchPage(false)} secondary>REGISTER</Button>\n {this.state.formErrorRegister ? <div className='formError'>{this.state.errorMsgRegister}</div> : null}\n <strong className=\"FormLabel\">NAME: </strong>\n <input className=\"nameInput\" focus name ='name' onChange={this.updateUserEntry}/>\n <strong className=\"FormLabel\">EMAIL: </strong>\n <input className=\"emailInput\" focus name ='email' onChange={this.updateUserEntry}/>\n <strong className=\"FormLabel\">PASSWORD: </strong>\n <input className=\"passwordInput\" focus type= 'password' name ='password' onChange={this.updateUserEntry}/>\n <strong className=\"FormLabel\">LOCATION: </strong>\n <input className=\"locationInput\" focus name ='location' onChange={this.updateUserEntry}/>\n <strong className=\"FormLabel\">PROFESSION: </strong>\n <input className=\"professionInput\" focus name ='profession' onChange={this.updateUserEntry}/>\n <Button className=\"Submit2\" animated onClick={this.checkRegister}>\n <Button.Content visible>REGISTER</Button.Content>\n <Button.Content hidden>\n <Icon name='arrow right' />\n </Button.Content>\n </Button>\n </div>\n )\n\n }", "title": "" } ]
e5b9a28b52815d3565564d2520663117
SECTION: handle `change` event
[ { "docid": "e81b1cf29ec47613c461fa8b435b88c6", "score": "0.0", "text": "function shouldUseChangeEvent(elem) {\n var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}", "title": "" } ]
[ { "docid": "4be557fce34f610418722866e72a20dc", "score": "0.77261096", "text": "changed() {\n this.dispatchEvent(new CustomEvent(\"change\"));\n }", "title": "" }, { "docid": "45d24098678cf0ab4c996bae9f0db65f", "score": "0.75955015", "text": "function onchange(){\n \n }", "title": "" }, { "docid": "773215ee1e9c6c40e336ccab519b9b18", "score": "0.74988043", "text": "function handleChange(event) {\n\t\tconsole.log(\"Changed\");\n\t\tconsole.log(\"Value: \" + event.target.value);\n\t\tconsole.log(\"Placeholder: \" + event.target.placeholder);\n\t\tconsole.log(\"Type: \" + event.target.type);\n\n\t\tsetName(event.target.value);\n\t}", "title": "" }, { "docid": "aee0a7a53f6898207e1e4cc93931d922", "score": "0.74731314", "text": "function changeHandler(ev) {\n log('#' + this.id + ' ev:' + ev.type + ' new val:' + ev.data.newValue);\n }", "title": "" }, { "docid": "cfb7fcd96f99d9bc85d3a26bd0ce0791", "score": "0.7292817", "text": "handleChange() {\n\n }", "title": "" }, { "docid": "ca2fc7db8f7b54eb464464165fabe403", "score": "0.7275224", "text": "handleChange(event) {\n // Get the string of the \"value\" attribute on the selected option\n this.selectedOption = event.detail.value;\n this.callMethod();\n }", "title": "" }, { "docid": "f6f02217cfdd3153d0477b050a1b0b3d", "score": "0.72429115", "text": "function handleChange(input) {\n\n}", "title": "" }, { "docid": "9e3ad634c7fd48cfb49fccc4255c6912", "score": "0.7110634", "text": "onChange(value) {\n console.log('changed', value);\n }", "title": "" }, { "docid": "cc3cf89b4d1bc02e8f6ef7cd7aaeddce", "score": "0.7076297", "text": "onChange(callback) {\n this.events.change.push(callback);\n }", "title": "" }, { "docid": "bd831fa8be6cd98326557acf069a2942", "score": "0.7053103", "text": "handleEvent(event) {\n switch (event.type) {\n case 'change':\n this.onValueChanged();\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "99021ad9f7a17c080243980a1c2ff78d", "score": "0.7018657", "text": "function onChange() {\n\t\t\tassert.ok(false, \"unexpected event called\");\n\t\t}", "title": "" }, { "docid": "b9d01d5e3912285af9c1b21bab6786c5", "score": "0.6968202", "text": "function fieldChanged(){}", "title": "" }, { "docid": "dac6b865e04e7395bec239e4822b7815", "score": "0.6940195", "text": "onChange() {}", "title": "" }, { "docid": "dac6b865e04e7395bec239e4822b7815", "score": "0.6940195", "text": "onChange() {}", "title": "" }, { "docid": "dac6b865e04e7395bec239e4822b7815", "score": "0.6940195", "text": "onChange() {}", "title": "" }, { "docid": "dac6b865e04e7395bec239e4822b7815", "score": "0.6940195", "text": "onChange() {}", "title": "" }, { "docid": "b600e7a3cc9d2cfb57261f5222361645", "score": "0.6933181", "text": "onChange(callback) {\n this.on(CHANGE, callback)\n }", "title": "" }, { "docid": "7be86acd8b889368bfee600553ad3420", "score": "0.69315565", "text": "change() {\n this.manager.trigger('changes', this)\n }", "title": "" }, { "docid": "0c9e72d3af1d3b352f2cc26461b2db8f", "score": "0.69306546", "text": "onChange() { }", "title": "" }, { "docid": "85e6d20efb0bc2aba6e6b494208d6912", "score": "0.69249", "text": "handleChange(e) {\n const newValue = e.target.value;\n // Pass it along.\n this.changeValue(newValue);\n }", "title": "" }, { "docid": "e5883e7bddcb98919590f842dcde28d6", "score": "0.6894225", "text": "handleChange(event) {\n\n const target = event.target;\n this.props.handleDiagramContentChange(target.value);\n\n //console.log(\"DiagramEditor.handleChange %s\", value);\n }", "title": "" }, { "docid": "9e91517f47ebdc4631cbc5ac6ef0e5dd", "score": "0.6862619", "text": "function handleDomEvent__handleChange() {\n this._ractive.binding.handleChange();\n }", "title": "" }, { "docid": "e95a4c0ef632c50e61d5b89f40f485a6", "score": "0.68218946", "text": "function handleChange(event) {\n\t\t// eslint-disable-next-line default-case\n\t\t// console.log('handling change');\n\n\t\tswitch (event.target.name) {\n\t\t\tcase 'email':\n\t\t\t\tsetEmail(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'username':\n\t\t\t\tsetUsername(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\tsetPassword(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'confirmPassword':\n\t\t\t\tsetconfirmPassword(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'newItemTier':\n\t\t\t\tsetNewItemTier(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'newItemCategory':\n\t\t\t\tsetNewItemCategory(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'newItemDescription':\n\t\t\t\tsetNewItemDescription(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'newNeedTier':\n\t\t\t\tsetNewNeedTier(event.target.value);\n\t\t\t\tbreak;\n\t\t\tcase 'newNeedCategory':\n\t\t\t\tsetNewNeedCategory(event.target.value);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.log('switch is broke');\n\t\t}\n\t}", "title": "" }, { "docid": "5e352d2b69ebd97997322be2417ab7a8", "score": "0.681234", "text": "function onChange(value) {\n console.log(\"changed\", value);\n}", "title": "" }, { "docid": "7d38951f325a05c02c591121cb98b9df", "score": "0.68092024", "text": "function changeFunction(event) {\n event.preventDefault();\n event.stopPropagation();\n\n event.target.parentNode.setAttribute('value', event.target.value);\n handleChange(event.target.parentNode);\n }", "title": "" }, { "docid": "f8ef06dd431aaa313cd6f00c65c5b5ac", "score": "0.6797026", "text": "set onchange(f) { changeFunc=f; }", "title": "" }, { "docid": "27c2d29b8e0781421ee4b96cc3ffd0cd", "score": "0.67478335", "text": "handleChange(e) {\n let dropdown = e.target;\n let val = dropdown.options[dropdown.selectedIndex].value;\n let onchange = this.get('onchange');\n\n if (onchange) {\n onchange(val, e, this);\n } else {\n return [val, e, this];\n }\n }", "title": "" }, { "docid": "6eb106ac143728d1339ab5b7143c3abe", "score": "0.6724657", "text": "function changeHandler(e) {\n let formObj = e.currentTarget;\n let name = formObj.name, val = formObj.value;\n\n addFormData([name, val]);\n\n if(name === 'theftOrDamage') {\n setTheftDmg(val);\n }\n }", "title": "" }, { "docid": "337b4ebecaca5e83af8fd4877e65a37d", "score": "0.6709186", "text": "function handleChange(event) {\n let { name, value } = event.target;\n\n switch (name) {\n case \"name\":\n setName(value);\n break;\n case \"universe\":\n setUniverse(value);\n break;\n case \"date\":\n setDate(value);\n break;\n default: \n break;\n }\n }", "title": "" }, { "docid": "09d2055fa143c9dc0a5fadcf73f216b5", "score": "0.6697496", "text": "function optionChanged(id) {\n\n getData(id);\n\n}", "title": "" }, { "docid": "ad07b6319440776a7e9d005ad1566be1", "score": "0.66932476", "text": "_onInputChange(e) {\n this._updateValueAndFireEvents(e.target.value, true, [\"change\", \"value-changed\"]);\n }", "title": "" }, { "docid": "bd5627c3311449747c1f1014ae777180", "score": "0.6692893", "text": "function handleChange(event){\n let valued = event.target.value;\n setValue(valued);\n }", "title": "" }, { "docid": "bd5627c3311449747c1f1014ae777180", "score": "0.6692893", "text": "function handleChange(event){\n let valued = event.target.value;\n setValue(valued);\n }", "title": "" }, { "docid": "d90f34d38440f0048424b8f9cabff00b", "score": "0.6692597", "text": "function onChange() {\n if ( scope.change ) {\n $timeout(scope.change, 0);\n }\n }", "title": "" }, { "docid": "c0dcbbaf8e52ca3b01cbaf0ff598e1f7", "score": "0.6691076", "text": "callOnChange() {\n if (this.onchange) {\n this.onchange();\n }\n }", "title": "" }, { "docid": "619de70a56c01c0bbc929ef2bdb21861", "score": "0.668664", "text": "handleChange() {\n this.$emit('change');\n }", "title": "" }, { "docid": "9718395034f8b53135a22b7aa3067d49", "score": "0.6678858", "text": "_onChange() {\n this.forceUpdate();\n this._callbackChange();\n }", "title": "" }, { "docid": "e579023b0c7cecc0591fdabba9c6440c", "score": "0.66556793", "text": "function handleChange(event){\n id = event.target.value;\n setId(id);\n }", "title": "" }, { "docid": "a648631f4c5670dc39f2bc04f9093600", "score": "0.6645852", "text": "function handleChange(e) {\n e.preventDefault();\n setName(e.target.value);\n }", "title": "" }, { "docid": "85f16ad61bf3ff269f4a52d2e4fad24d", "score": "0.6639706", "text": "function onChange() {\n \t\t// fire event named 'message'\n \t\tdispatch(\"change\", {});\n \t}", "title": "" }, { "docid": "a870c96cabf1445ca1a976284f26df8b", "score": "0.6620437", "text": "handleChange(value) {\n this.value = value\n }", "title": "" }, { "docid": "89f87368adca6bf23d4501110bea1df8", "score": "0.6618487", "text": "changeHandler(e) {\n return __awaiter(this, void 0, void 0, function* () {\n const args = e.detail;\n this.setFieldValue(args.name, args.value);\n });\n }", "title": "" }, { "docid": "ddb65759d69e4ae04c2f3466f7e1f0a9", "score": "0.661547", "text": "function firechange() {\n /*\n * Internally, this method is used also on other change methods:\n * addnode, removenode, addlink, removelink\n */\n model = tojson();\n if (changehandler !== undefined) {\n changehandler(model);\n }\n }", "title": "" }, { "docid": "486fb31da8d412513de987e526c810bd", "score": "0.660988", "text": "handleChange(e) {\n e.stopPropagation();\n this.setValue(this.getInputEl().value);\n }", "title": "" }, { "docid": "d6eeeb77d9ffcb1a4019a99f1e7a5290", "score": "0.6600133", "text": "onChange(value) {\n console.log('onChange value:', value)\n }", "title": "" }, { "docid": "a0a9203adec9e2e75ee35b1c153f5249", "score": "0.65965205", "text": "handleChange(e) {\n _self.state[e.name] = e.value;\n }", "title": "" }, { "docid": "a4ecd8f4eec5982f42d8378c95bbd9df", "score": "0.6594108", "text": "function optionChanged(id) {\n getValues(id);\n getData(id);\n}", "title": "" }, { "docid": "4c2514ec7472e71ed1a29527c098dc6a", "score": "0.6593678", "text": "triggerChangeEvent() {\n\t\tif ( this.controlRendered ) {\n\t\t\tthis.events.emit( 'change', this.getSettings() );\n\t\t}\n\t}", "title": "" }, { "docid": "dd7ddad25b6010306e5e7195cec3c840", "score": "0.6587447", "text": "registerChange () {}", "title": "" }, { "docid": "15c9cd0f85084c8d3e439f863dc66329", "score": "0.65854377", "text": "function handleChange(event) {\n var target = event.target;\n var parentNode = target.parentNode;\n self.applyFilter(parentNode.getElementsByClassName('as-rangeFilter__from__' + uid)[0].value, parentNode.getElementsByClassName('as-rangeFilter__to__' + uid)[0].value);\n }", "title": "" }, { "docid": "f6f735d40ce2752efbe1d2dcf854b8e1", "score": "0.6584449", "text": "handleChange(field, value) {\n this.props.onChange(field, value, this.state.eventData);\n }", "title": "" }, { "docid": "f304336308e6fa70e69cc22ea94ad5db", "score": "0.6577556", "text": "function optionChanged(id) {\n Data(id);\n Demographics(id);\n}", "title": "" }, { "docid": "33a38a89188977c158a0a4142c23144f", "score": "0.65742", "text": "handleChange(e) {\n\t\tthis.props.handleChange(e.target.value);\n\t}", "title": "" }, { "docid": "3736ee09358b339c74a6994f23b1b3f1", "score": "0.65737945", "text": "function logChange(val) {\n console.log('Selected: ', val);\n}", "title": "" }, { "docid": "dd9273aa9a94d1c22b614c786707bf9e", "score": "0.6545838", "text": "function shouldUseChangeEvent(elem){return elem.nodeName === 'SELECT' || elem.nodeName === 'INPUT' && elem.type === 'file';}", "title": "" }, { "docid": "98e1c8ad961daa78e70bdf91712fca1e", "score": "0.6536321", "text": "function handleChange(event) {\n var target = event.target;\n var parentNode = target.parentNode;\n console.log(parentNode.getElementsByClassName('as-rangeFilter__from')[0].value);\n console.log(parentNode.getElementsByClassName('as-rangeFilter__to')[0].value);\n self.applyFilter(parentNode.getElementsByClassName('as-rangeFilter__from')[0].value, parentNode.getElementsByClassName('as-rangeFilter__to')[0].value);\n }", "title": "" }, { "docid": "26fc872c5275cac19d51f5f1a454a78a", "score": "0.65327275", "text": "_evtChange(event) {\n let select = this._select;\n let widget = this._notebook;\n if (select.value === '-') {\n return;\n }\n if (!this._changeGuard) {\n let value = select.value;\n actions_1.NotebookActions.changeCellType(widget, value);\n widget.activate();\n }\n }", "title": "" }, { "docid": "a24129183751d482cdbabc919aa943c1", "score": "0.6518347", "text": "handleChange(e) {\r\n \r\n // Prevent legacy form post\r\n e.preventDefault();\r\n\r\n // Get field name and value from event\r\n const target = e.target;\r\n let value = target.type === 'checkbox' ? target.checked : target.value;\r\n const name = target.name;\r\n\r\n this.validateAndSaveChange(name, value);\r\n }", "title": "" }, { "docid": "03e8490e7ef309309eda11645a6b800c", "score": "0.65162486", "text": "function handleChange(e) {\n\t\tsetButtonIcon(false);\n\t\tsetNewItem(e.target.value);\n\t}", "title": "" }, { "docid": "ff71a9f6497e680337fd3b98c344d652", "score": "0.65145344", "text": "function optionChanged(id) {\n getData(id);\n getDataInfo(id);\n}", "title": "" }, { "docid": "5cbc6519c0a12ece04c718ccbf7474bf", "score": "0.6512249", "text": "changeNodeHandler() {\n if (this.properties.onChange) {\n this.properties.onChange();\n }\n }", "title": "" }, { "docid": "86341ef89fd3a5a732d7aae671dcbaa4", "score": "0.6510269", "text": "function handleDomEvent() {\r\n \tthis._ractive.binding.handleChange();\r\n }", "title": "" }, { "docid": "52356f1bf9c4f0c0b79d4744bad72aed", "score": "0.649317", "text": "function triggerChange(e) {\n\t\t\t\tvar $field = $j(e.delegateTarget);\n\n\t\t\t\treturn $field.trigger({\n\t\t\t\t\ttype:\"changes\",\n\t\t\t\t\twho:$field.attr(\"type\"),\n\t\t\t\t\twhat:$field.find(\"input\").val(),\n\t\t\t\t\thow: e.type,\n\t\t\t\t\te:e\n\t\t\t\t})\n\t\t\t}", "title": "" }, { "docid": "e581d9a5442a533e919cac4e27cc06fd", "score": "0.6485412", "text": "changeHandler(e) {\n if (!this.context)\n throw new Error(\n \"The Field component was used inside\" +\n \"of a Component which is not wrapped into a validation HOC!\"\n );\n this.context.publish(e);\n\n if (this.props.onChange) this.props.onChange(e);\n }", "title": "" }, { "docid": "8aac53a53c125701141f034aba0e099d", "score": "0.6484586", "text": "function onChange(control, oldValue, newValue, isLoading) {\n var choice = g_form.getValue('options', notes); // doAlert is our callback function\n}", "title": "" }, { "docid": "1d74b76784a6e36879e6dc66c76ce7d1", "score": "0.6481036", "text": "function handleChange(e) {\n props.handleCallback(e.target.value);\n }", "title": "" }, { "docid": "162a194d710dcace80fb3e296869b620", "score": "0.6478771", "text": "_listenForChange() {\n if (!this._$for) return\n this._$for.addEventListener(\"change\", this._forChangeHandlerFn)\n }", "title": "" }, { "docid": "fc60b34ca4a5f57350411e571575482d", "score": "0.6466881", "text": "productOptionsChanged(event, changedOption) {\n const $changedOption = $(changedOption);\n const $form = $changedOption.parents('form');\n const productId = $('[name=\"product_id\"]', $form).val();\n\n // Do not trigger an ajax request if it's a file or if the browser doesn't support FormData\n if ($changedOption.attr('type') === 'file' || window.FormData === undefined) {\n return;\n }\n\n utils.api.productAttributes.optionChange(productId, $form.serialize(), (err, response) => {\n const productAttributesData = response.data || {};\n\n this.updateProductAttributes(productAttributesData);\n this.updateView(productAttributesData);\n });\n }", "title": "" }, { "docid": "910fdcb28049ddf93c39b28d920ac5e4", "score": "0.64625406", "text": "function handleChange(event) {\n\n\t\tconst val = event.target.value;\n\t\tsetInputFilled(val.length > 0);\n\n\t\tif (props.onChange) {\n\t\t\tprops.onChange(val);\n\t\t}\n\t}", "title": "" }, { "docid": "dbee91b40622327403d451799eff18df", "score": "0.64569396", "text": "function handleChange(e) {\n // e.target refers to the element which raised the event. You might also\n // encounter e.currentTarget, which refers to the element that handles the\n // event. The difference being whether the event of the element bubbles up\n // to its parent container.\n setState({ ...states, [e.target.name]: e.target.value })\n }", "title": "" }, { "docid": "4c49d7e09dd3f1f3a046aaba0776f328", "score": "0.64565617", "text": "function optionChanged(value) {\n \n // firing the functions\n\n buildMetadata(value)\n buildCharts(value)\n}", "title": "" }, { "docid": "cf9d491a16226257328711f279e68eda", "score": "0.6455806", "text": "change(event) {\n if (event.target.files) {\n event.preventDefault();\n this.handleFiles(event.target.files || []);\n }\n }", "title": "" }, { "docid": "e3060011e9ed8e17427fb4f276c76cef", "score": "0.64542437", "text": "_changeSlider(e){\n this.fire(\"value-change\", {value: e.detail.value});\n }", "title": "" }, { "docid": "15b6550d52742d13d6c566cd08badf5e", "score": "0.6449426", "text": "_change(val, ...args) {\n const upstreamVal = val ? this.props.onValue : this.props.offValue\n this.props.valueLink.requestChange(upstreamVal, ...args)\n }", "title": "" }, { "docid": "18ae9c31def8a13bd538cad040c7c666", "score": "0.64466083", "text": "onFieldValueChange() {\n }", "title": "" }, { "docid": "989d557e332eaf23522e213e0c2c710f", "score": "0.6436534", "text": "function changed() {\n\t\t\t\t_dispatchEvent(_this, rootEl, 'change', target, el, rootEl, oldIndex, _index(dragEl, options.draggable), evt);\n\t\t\t}", "title": "" }, { "docid": "d9f3f2b3043e302977ea1adf35db38d8", "score": "0.64350307", "text": "function change() {\n\t fetchComboData(value(), function() {\n\t _selected = null;\n\t var val = input.property('value');\n\n\t if (_suggestions.length) {\n\t if (input.property('selectionEnd') === val.length) {\n\t _selected = tryAutocomplete();\n\t }\n\n\t if (!_selected) {\n\t _selected = val;\n\t }\n\t }\n\n\t if (val.length) {\n\t var combo = context.container().selectAll('.combobox');\n\t if (combo.empty()) {\n\t show();\n\t }\n\t } else {\n\t hide();\n\t }\n\n\t render();\n\t });\n\t }", "title": "" }, { "docid": "a0674fbd5b5bc73e0a7fdf9bc4c74346", "score": "0.6430354", "text": "function handleDomEvent () {\n\tthis._ractive.binding.handleChange();\n}", "title": "" }, { "docid": "8535de55a63bbb96452079ddceee68d3", "score": "0.6429066", "text": "function change(){\n\t\t\t\tif(changeCount == 0 && opts.startValue != null){\n\t\t\t\t\t$value.text(opts.startValue);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$value.text($menu.find('li').eq(selectIndex).text());\n\t\t\t\t}\n\t\t\t\tif(selectExists){\n\t\t\t\t\tif(typeof($.fn.prop) == 'function'){\n\t\t\t\t\t\t$node.prop('selectedIndex', selectIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$node.attr('selectedIndex', selectIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thighlight();\n\t\t\t\tchangeCount++;\n\t\t\t}", "title": "" }, { "docid": "4cb4b4ba6318697083c4d878cad03835", "score": "0.64261645", "text": "function fileInputChange(e) {\n /*jshint validthis:true, unused:vars*/\n handleFiles(this.files);\n }", "title": "" }, { "docid": "b4e34c4741ad5f28cb7d6c0b2fb6f603", "score": "0.6424559", "text": "function SelectionChange() { }", "title": "" }, { "docid": "a35611bb865a6a8343a0d6ddb97e1947", "score": "0.6424536", "text": "function changed() {\n\t\t\t\t\t_dispatchEvent(_this, rootEl, 'change', target, el, rootEl, oldIndex, _index(dragEl), oldDraggableIndex, _index(dragEl, options.draggable), evt);\n\t\t\t\t}", "title": "" }, { "docid": "64c719ea65d55f0f942013bf3ca49f89", "score": "0.6422211", "text": "function changeListener(change) {\n\t router.dispatch(change.path, change.type, dispatchHandler);\n\t }", "title": "" }, { "docid": "081640e9e65971a167c23d07c31ad782", "score": "0.64206594", "text": "function handleChange(editor, data, value) {\n onChange(value);\n editor.showHint({ completeSingle: false });\n\n console.log(editor, data, value);\n }", "title": "" }, { "docid": "09efb5657c96832a1eddc7bfd4d0a817", "score": "0.64169794", "text": "handleEvent(event) {\n switch (event.type) {\n case 'change':\n this._delimiterChanged.emit(this.selectNode.value);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "30f887f8da86a8c93ba93f3c126f4f40", "score": "0.64167434", "text": "handleChange(e) {\n\t\tCastorActions.setTrafficView(this.props.fromIndex,this.props.data[this.props.rowIndex]['idx']);\n\t}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.64149433", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" } ]
e7e73b95774dda661085db73d474c07d
Loads SDK on componentDidMount and handles auto login.
[ { "docid": "eb7a96ea4214a6d259f416dd160c25f4", "score": "0.731241", "text": "componentDidMount () {\n const { appId, autoCleanUri, autoLogin, gatekeeper, redirect, scope, version } = this.props\n this.loadPromise = cancelable(this.sdk.load({ appId, redirect, gatekeeper, scope, version })\n .then((accessToken) => {\n if (autoCleanUri) {\n cleanLocation()\n }\n\n if (accessToken) {\n this.accessToken = accessToken\n }\n\n this.setState((prevState) => ({\n ...prevState,\n isLoaded: true\n }), () => {\n if (typeof this.props.onLoaded === 'function') {\n this.props.onLoaded()\n }\n if (autoLogin || this.accessToken) {\n if (this.fetchProvider && !this.accessToken) {\n this.sdk.login(appId, redirect)\n .catch(this.onLoginFailure)\n } else {\n this.sdk.checkLogin(true)\n .then(this.onLoginSuccess, this.onLoginFailure)\n }\n }\n })\n\n return null\n }, this.onLoginFailure))\n }", "title": "" } ]
[ { "docid": "9b87ac9517fa7d9c6c04f7eb9c928e18", "score": "0.73390436", "text": "async componentDidMount() {\n const token = await sessionService.init();\n\n if (!token) {\n stores.navigatorStore.resetNavigate('Login');\n }\n\n BackHandler.addEventListener(\"hardwareBackPress\", this.onBackPress);\n Linking.addEventListener('url', event => this.handleOpenURL(event.url));\n AppState.addEventListener('change', this.handleAppStateChange);\n }", "title": "" }, { "docid": "06426251787157535da460bada6c06c1", "score": "0.72576314", "text": "async componentDidMount() {\n\t\tGoogleSignin.configure(config.googleSignIn);\n\t\tawait this.checkUserSignedIn();\n\t}", "title": "" }, { "docid": "9283ec679cec3eaa737813623bf4c064", "score": "0.69850683", "text": "componentDidMount() {\n this.initializeAuth0();\n }", "title": "" }, { "docid": "4925254670fc23da8da50c24e818f158", "score": "0.6740855", "text": "componentDidMount() {\n this.login();\n }", "title": "" }, { "docid": "5605203058933d6c068426cb32a84dab", "score": "0.6710813", "text": "async componentDidMount() {\n // let scenes actively listen to new received notif\n this.listener = Notifications.addListener(this.listen);\n // load all the required user data if user is logged-in\n if (this.props.auth.isAuthenticated) {\n // retrieve and setup data\n this.setupUserAppData();\n }\n }", "title": "" }, { "docid": "b928f0363db8290331810198bda20894", "score": "0.66809714", "text": "componentDidMount() {\n this.loginCheck();\n }", "title": "" }, { "docid": "9859821e338334241b463ba0fcb69ebb", "score": "0.6669246", "text": "componentDidMount() {\n NetInfo.isConnected\n .fetch()\n .done(isConnected => this.setState({ isConnected }));\n NetInfo.isConnected.addEventListener(\"connectionChange\", isConnected =>\n this.setState({ isConnected })\n );\n\n Dialogflow_V2.setConfiguration(\n dialogflowConfig.client_email,\n dialogflowConfig.private_key,\n Dialogflow_V2.LANG_SPANISH,\n dialogflowConfig.project_id\n );\n\n // if there isn't a user already, create one\n // (this will later be replaced by actual user auth)\n this.loadInMessages();\n this.props.navigation.setParams({\n sign_in: user => {\n this.setState({ login: user });\n console.log(\"SIGNED IN\");\n }\n });\n\n // setup default settings if there aren't any\n this.initSettings();\n }", "title": "" }, { "docid": "4394ec2d0cee2fdeb1f3d922a71e1b87", "score": "0.6646571", "text": "componentDidMount() {\r\n\r\n this.fetchLogin();\r\n\r\n}", "title": "" }, { "docid": "1768435c78d1c7eabca8f181e26d2355", "score": "0.6599521", "text": "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.1' // use version 2.1\n });\n \n window.FB.getLoginStatus(function(response) {\n // upon opening the ma\n if (response.status === \"connected\") {\n loadStream(response);\n }\n }.bind(this));\n }.bind(this);\n } else {\n window.FB.getLoginStatus(function(response) {\n console.log(\"getting status\");\n this.initiateLoginOrLogout(response);\n }.bind(this));\n }\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "title": "" }, { "docid": "c04197afd2366c59028a1a5827611232", "score": "0.65744007", "text": "componentDidMount() {\n const { autoSignIn } = this.props;\n autoSignIn();\n }", "title": "" }, { "docid": "33b81c3d2a9702b0f7673e992c4a501c", "score": "0.6564752", "text": "componentDidMount() {\n if (this.mounted) {\n this.auth();\n }\n }", "title": "" }, { "docid": "0cb3a2ddc595f7804fe94fcf7efcd08c", "score": "0.65610904", "text": "componentDidMount() {\n this.checkAuth();\n }", "title": "" }, { "docid": "a025d871e2c53ac7e7e199d0c3b6d069", "score": "0.6514796", "text": "componentDidMount() {\n this.props.initializeApp();\n }", "title": "" }, { "docid": "58e6a69228ab7dde008b131e37c850a3", "score": "0.64708716", "text": "componentDidMount(){\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '207358966557597', /* Our specific APP id */\n cookie : true, \n xfbml : true, \n version : 'v2.8' \n });\n\n /* This might be a duplicate of above checkLoginState, but need to investigate */\n FB.getLoginStatus(function(response) {\n this.statusChangeCallback(response);\n }.bind(this));\n }.bind(this)\n }", "title": "" }, { "docid": "440618d4f1662c6f321806d912c120cf", "score": "0.64553815", "text": "componentWillMount() {\n this.handleMountedLogin();\n }", "title": "" }, { "docid": "74ecdb162f6df92cc06b4da8a3790295", "score": "0.6440014", "text": "componentDidMount() { \n this.getSpotifyToken();\n this.getArtist();\n this.getUser();\n }", "title": "" }, { "docid": "d288004dd7322df714f49b6ad89d1538", "score": "0.6439214", "text": "componentDidMount() {\n window.scrollTo(0,0);\n authenticate();\n if (auth.authenticated) {\n this.setState({\n loggedIn : true\n })\n } else {\n this.setState({\n loggedIn : false\n })\n }\n }", "title": "" }, { "docid": "295e09389f30716d707e48116deb075c", "score": "0.6390286", "text": "componentDidMount() {\n this.loadGames();\n this.loadUser(this.state.userID);\n Geocode.setApiKey(\"AIzaSyBFxBvSfL6-CmTt4k6mtU03hLHt9OJgHuI\");\n }", "title": "" }, { "docid": "42b8f824ae691fe963684d682d7774aa", "score": "0.6377112", "text": "componentDidMount()\n\t{\n\t\t// runs before render()\n\t\t// ensure we do not go to register if we are already logged in\n\t\tif (global.client != null)\n\t\t{\n\t\t // go back where we came from\n\t\t this.props.navigation.goBack();\n\t\t}\n }", "title": "" }, { "docid": "b10ac59bd289c751b32949a55c859ec1", "score": "0.63752836", "text": "componentDidMount() {\n\n const jwt = sessionStorage.getItem('accessToken');\n\n if(jwt) {\n this.loadPlayerDetails();\n this.setState({loggedIn: true});\n }\n\n }", "title": "" }, { "docid": "2be9047cd727810e629efe1fe45f7c29", "score": "0.637501", "text": "componentDidMount() {\n\t\tthis.startup();\n\t}", "title": "" }, { "docid": "353bb52e3ae01eb809cd19bee8857426", "score": "0.63609064", "text": "componentDidMount() {\n const auth = new Auth(); \n\n // The Auth() class handles the Authentication and redirects the User based on the success of the authentication. \n auth.handleAuthentication(); \n }", "title": "" }, { "docid": "e4bf8ae975791107e6e46cf3747e7877", "score": "0.63336587", "text": "componentDidMount() {\n GoogleSignin.configure();\n }", "title": "" }, { "docid": "84515f8f6dfbabe2218ed388857321d5", "score": "0.63193077", "text": "componentDidMount() {\n const _this = this;\n\n\n _this._manageGlobalEventHandlers(_this.props);\n\n _this._FB_init(function() {\n _this.setState({\n initializing: false\n });\n });\n }", "title": "" }, { "docid": "3787472da1c5ed6323754b339a2d61b1", "score": "0.6305275", "text": "componentDidMount () {\n this.init();\n }", "title": "" }, { "docid": "3787472da1c5ed6323754b339a2d61b1", "score": "0.6305275", "text": "componentDidMount () {\n this.init();\n }", "title": "" }, { "docid": "3787472da1c5ed6323754b339a2d61b1", "score": "0.6305275", "text": "componentDidMount () {\n this.init();\n }", "title": "" }, { "docid": "6aeb5765256e88feb8d749979b17d77c", "score": "0.6300507", "text": "componentDidMount(){\n this.authListener();\n }", "title": "" }, { "docid": "c91a4dd6c3f6c43ee55e03525d019654", "score": "0.6285646", "text": "async started() {\n\t\tthis._createAxios();\n\t\tthis.dataAccess = await this.login();\n\t}", "title": "" }, { "docid": "df6f1669fb4b6c099bca1a6373cf7977", "score": "0.6284683", "text": "componentDidMount() {\n this.authListener();\n }", "title": "" }, { "docid": "df6f1669fb4b6c099bca1a6373cf7977", "score": "0.6284683", "text": "componentDidMount() {\n this.authListener();\n }", "title": "" }, { "docid": "6fb08670d79dc4e0491cae558d0386b0", "score": "0.62814486", "text": "componentDidMount() {\n\n\t window.fbAsyncInit = function() {\n\t window.FB.init({\n\t appId : '1250815578279698',\n\t cookie : true, // enable cookies to allow the server to access\n\t // the session\n\t xfbml : true, // parse social plugins on this page\n\t version : 'v2.11' // use version 2.1\n\t });\n\n //window.FB.Event.subscribe('auth.statusChange', this.statusChangeCallback());\n /* comment by bipin: it redirect if user is logged in fb */\n\t // window.FB.getLoginStatus(function(response) {\n\t // this.statusChangeCallback(response);\n\t // }.bind(this));\n\t }.bind(this);\n\n // Load the SDK asynchronously\n\t (function(d, s, id) {\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) return;\n\t js = d.createElement(s); js.id = id;js.async = true;\n\t js.src = \"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11\";\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\t}", "title": "" }, { "docid": "c7bc534a06b0e224b51884ef96c2e897", "score": "0.6279422", "text": "componentDidMount() { \n this.authListener();\n }", "title": "" }, { "docid": "7b8b8e13ed02cdc47f85b145e10b018b", "score": "0.62770885", "text": "componentDidMount() {\n\t\tthis.init();\n\t}", "title": "" }, { "docid": "c2ad538eb0cb302231de44f13fa45c60", "score": "0.62664825", "text": "componentDidMount() {\n if (this.props.user.isLoggedIn) {\n this.props.getUserInfo(this.props.user.token);\n }\n }", "title": "" }, { "docid": "88b92762860e5a5a8854e56b0dedb250", "score": "0.62638545", "text": "componentDidMount() {\n /** Load gives us library. */\n window.gapi.load('client:auth2', () => {\n /** Init returns a promise showing that library has been initialized. */\n window.gapi.client.init({\n clientId: '652937323943-4ttsjnmaodlfrktlvit7rk158vodf0q5.apps.googleusercontent.com', \n scope: 'email'\n }).then(\n () => {\n /** \n * Below grabs auth object then\n * passes auth object to onAuth logged in state (i.e true or false) then\n * uses event listener to be used in conjunction with state. \n */\n this.auth = window.gapi.auth2.getAuthInstance();\n this.onAuthChange(this.auth.isSignedIn.get()); // grabs status\n this.auth.isSignedIn.listen(this.onAuthChange); // listens for change\n }\n );\n });\n }", "title": "" }, { "docid": "71f12c3c2363c9e15c39898916eda74b", "score": "0.62526333", "text": "function initializeApp() {\n displayIsInClientInfo();\n registerButtonHandlers();\n\n // check if the user is logged in/out, and disable inappropriate button\n if (liff.isLoggedIn()) {\n $.blockUI({ message: \"<h3>Please wait...</h3>\" });\n document.getElementById('liffLoginButton').disabled = true;\n liff.getProfile().then(function(profile) {\n setValue('USER_ID', profile.userId);\n\n const idToken = liff.getIDToken();\n setValue('ID_TOKEN',idToken);\n\n updateMappingTable();\n }).catch(function(error) {\n\n });\n } else {\n document.getElementById('liffLogoutButton').disabled = true;\n }\n}", "title": "" }, { "docid": "6d4eefed4fccd9ba966e79a86addf2b4", "score": "0.6244127", "text": "componentDidMount() {\n this.getData();\n this.getToken();\n }", "title": "" }, { "docid": "2a46d959688f3c9085886ca691794eac", "score": "0.6238645", "text": "async componentDidMount() {\n //The API calls should be made in componentDidMount method always.\n }", "title": "" }, { "docid": "32cfd131001beded53400333740b4376", "score": "0.6228813", "text": "componentDidMount() {\n this.fetchSignInMethods();\n }", "title": "" }, { "docid": "a8a950d89710fe88c21a257921e0e6c8", "score": "0.6215099", "text": "componentDidMount() {\n this.getUser();\n }", "title": "" }, { "docid": "a8a950d89710fe88c21a257921e0e6c8", "score": "0.6215099", "text": "componentDidMount() {\n this.getUser();\n }", "title": "" }, { "docid": "04bccc65ea451e7fb40f8e0878a72ed3", "score": "0.6203495", "text": "componentDidMount() {\n console.log('component loaded');\n console.log(apiKey);\n this.getApi();\n }", "title": "" }, { "docid": "caeeaae34529637e2e9b864681ce211f", "score": "0.6199275", "text": "componentDidMount() {\n /* eslint-disable react/no-did-mount-set-state */\n /* https://github.com/airbnb/javascript/issues/684 */\n const token = window.localStorage.getItem('khToken');\n if (token) {\n this.setState({\n loggedIn: true,\n token,\n });\n }\n }", "title": "" }, { "docid": "062430a11192e950878bcd6f85af077a", "score": "0.6199115", "text": "Start(){\n // si non securisee on enregistre un token anonyme\n if(this._AppIsSecured == \"false\"){localStorage.setItem(this._DbKeyLogin, \"Anonyme\")}\n // Get Token\n this._LoginToken = this.GetTokenLogin() \n if(this._LoginToken != null){\n this.LoadApp()\n } else {\n const OptionCoreXLogin = {Site:this._Site, CallBackLogedIn:this.LoginDone.bind(this), Color: this._Color, AllowSignUp: this._AllowSignUp}\n let MyLogin = new CoreXLogin(OptionCoreXLogin) // afficher le UI de login\n MyLogin.Render()\n }\n }", "title": "" }, { "docid": "0e40e56ab75f0e6e2f24b17d1bb3927f", "score": "0.6198155", "text": "componentDidMount() {\n window.gapi.load(\"client:auth2\", () => {\n window.gapi.client\n .init({\n clientId:\n \"284084667086-lip1051ib5uc4s4elb4ab52754g7q4ap.apps.googleusercontent.com\",\n scope: \"email\",\n })\n .then(() => {\n this.auth = window.gapi.auth2.getAuthInstance();\n this.onAuthChange(this.auth.isSignedIn.get());\n this.auth.isSignedIn.listen(this.onAuthChange);\n });\n });\n }", "title": "" }, { "docid": "4dd70b959412e14d5d93637545c18030", "score": "0.61958694", "text": "function handleClientLoadLogin() {\n gapi.load('client:auth2', initClient);\n}", "title": "" }, { "docid": "a426eb8b43adacd70989beae255b4936", "score": "0.6172", "text": "componentDidMount() {\n window.gapi.load(\"client:auth2\", () => {\n window.gapi.client\n .init({\n clientId:\n \"438826954142-kaduvs2l000b5cf6u1ppepaikp1h0d9c.apps.googleusercontent.com\",\n scope: \"email\"\n })\n .then(() => {\n this.auth = window.gapi.auth2.getAuthInstance();\n this.onAuthChange(this.auth.isSignedIn.get());\n this.auth.isSignedIn.listen(this.onAuthChange);\n });\n });\n }", "title": "" }, { "docid": "6edee13aeeda3b4121a0bc144982ed22", "score": "0.6168643", "text": "componentDidMount() {\n\n this.loadCurrentUser();\n }", "title": "" }, { "docid": "045bd9f96080fb252528fed8b0d570be", "score": "0.61680955", "text": "componentDidMount() {\r\n\t\t this.getToken()\r\n\r\n\t}", "title": "" }, { "docid": "110dec65ff7f1ad84410c5d8f8c0aaa2", "score": "0.61210835", "text": "componentDidMount () {\n // console.log(\"SignIn componentDidMount\");\n this.onVoterStoreChange();\n this.facebookListener = FacebookStore.addListener(this._onFacebookChange.bind(this));\n this.voterStoreListener = VoterStore.addListener(this.onVoterStoreChange.bind(this));\n AnalyticsActions.saveActionAccountPage(VoterStore.election_id());\n }", "title": "" }, { "docid": "c9c3d772b5a716598d247e71873e10a8", "score": "0.61169547", "text": "async componentDidMount() {\n // Get the user context from Teams and set it in the state\n microsoftTeams.getContext((context, error) => {\n this.setState({\n context: context\n });\n });\n // Next steps: Error handling using the error object\n await this.initTeamsCloud();\n await this.callGraphSilent();\n }", "title": "" }, { "docid": "6978c3f1b4fd6bca477750ec28b2e557", "score": "0.6114715", "text": "function handleClientLoad() {\n\t\t console.log(\"handle login\") \n gapi.client.setApiKey(apiKey);\n window.setTimeout(checkAuth,1);\n }", "title": "" }, { "docid": "2e601175dc7a3b0a850f4c6ec8260909", "score": "0.61125386", "text": "componentDidMount() {\n this.session = App.Session(this);\n // this.loadAllInstances();\n }", "title": "" }, { "docid": "39daf21d5987b4554ff1d0afa74d2e57", "score": "0.6111497", "text": "componentWillMount(){\n if (AuthManager.isRememberMeSet() && !AuthManager.isLoggedIn()) {\n AuthManager.authenticateWithRefreshToken()\n .then(() => this.setState({authenticated: true}));\n }\n }", "title": "" }, { "docid": "508273c0e05d5dc12d153271dce91dea", "score": "0.61041963", "text": "async function initMySky() {\n try {\n // load invisible iframe and define app's data domain\n // needed for permissions write\n const mySky = await client.loadMySky(dataDomain);\n console.log(\"my sky loaded\");\n console.log(mySky)\n console.log(todos)\n \n // load necessary DACs and permissions\n await mySky.loadDacs(contentRecord);\n \n // check if user is already logged in with permissions\n const loggedIn = await mySky.checkLogin();\n \n // set react state for login status and\n // to access mySky in rest of app\n setMySky(mySky);\n setLoggedIn(loggedIn);\n if (loggedIn) {\n setUserID(await mySky.userID());\n console.log(userID)\n }\n } catch (e) {\n console.error(e);\n }\n }", "title": "" }, { "docid": "0ed7d72256f6576f2f37fea272a33442", "score": "0.6102711", "text": "async componentDidMount() {\n // If user is already logged in, forward them to the private area.\n if (isLoggedIn()) {\n navigate(`/app/profile`)\n }\n }", "title": "" }, { "docid": "bf3186bf51dc2c48d1ab0383e8502fc2", "score": "0.61015296", "text": "componentDidMount() {\r\n\r\n\r\n//check if session is set and prevent Direct Access to the App.\r\n\r\nvar app_sess_data_check = localStorage.getItem('appsessdata');\r\n\r\nconst session = app_sess_data_check;\r\n//alert('my sessioning: ' +session);\r\n\r\n//const session= 101;\r\nthis.setState({mysession: session});\r\n\r\n\r\n\r\n\r\n\r\n this.fetchLogin();\r\n\r\n}", "title": "" }, { "docid": "3675a9d3b0f30030ba8a887f1cf3a1d7", "score": "0.61001635", "text": "componentDidMount() {\n this.props.facebookLogin();\n // AsyncStorage.removeItem('fb_token');\n // this.onAuthComplete(this.props);\n }", "title": "" }, { "docid": "45f6dcc41b905446af615132aeabb5cf", "score": "0.6095562", "text": "componentWillMount() {\n firebase.initializeApp(\n {\n apiKey: Config.API_KEY,\n authDomain: Config.AUTH_DOMAIN,\n databaseURL: Config.DATABASE_URL,\n projectId: Config.PROJECT_ID,\n storageBucket: Config.STORAGE_BUCKET,\n messagingSenderId: Config.MESSAGING_SENDER_ID\n });\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ loggedIn: true });\n } else {\n this.setState({ loggedIn: false });\n }\n });\n }", "title": "" }, { "docid": "12d7569b073a38a13f8b3a0000ff5af0", "score": "0.6083612", "text": "componentDidMount() {\n Spotify.getAccessToken();\n }", "title": "" }, { "docid": "185ccf392ee654f572b4a1ef28468aa6", "score": "0.60820657", "text": "async componentDidMount() {\n if (this.state.state === 'ERROR') {\n return;\n }\n await this.state.browser.initialise();\n await this.state.store.initialise();\n await this.loadBookmarks();\n }", "title": "" }, { "docid": "e3bdb714d915b2ee9c9c596fd407dc40", "score": "0.6063603", "text": "componentWillMount() {\n\t\tfirebase.initializeApp({\n\n\t\t\t//copy/paste the \"config\" object from that page\n\t\t apiKey: \"AIzaSyDBKia4lWcYKMcn-AnwGLOlGsTu4JRZDRk\",\n\t\t authDomain: \"authentication-b3c95.firebaseapp.com\",\n\t\t databaseURL: \"https://authentication-b3c95.firebaseio.com\",\n\t\t storageBucket: \"authentication-b3c95.appspot.com\",\n\t\t messagingSenderId: \"84894895664\"\n \t\t});\n\n \t\tfirebase.auth().onAuthStateChanged((user) => {\n \t\t\t//method that's called whenever the user signs in or out\n \t\t\t//'user' is either an object (representing the user) \n \t\t\t//or 'undefined' if they've just logged out\n \t\t\tif (user) {\n \t\t\t\tthis.setState({ loggedIn: true })\n \t\t\t} else {\n \t\t\t\tthis.setState({ loggedIn: false })\n \t\t\t}\n \t\t})\n\t}", "title": "" }, { "docid": "b492614943c30a9efa6e16cd4d2bf41a", "score": "0.6062003", "text": "componentWillMount(){\n\t\tYellowBox.ignoreWarnings(['Require cycles are allowed']);\n\t\tAsyncStorage.getItem(\"token\")\n\t\t.then( (value) => \n\t\t{\n\t\t\tif (value != null){\n\t\t\t this.setState({\n\t\t\t\tlogged: true,\n\t\t\t\tloading: false,\n\t\t\t });\n\t\t\t} else{\n\t\t\t this.setState({\n\t\t\t\tloading: false,\n\t\t\t });\n\t\t\t}\n\t\t});\n\t }", "title": "" }, { "docid": "3695de8402077779eb6a820c1035a387", "score": "0.60612506", "text": "componentDidMount() {\n // Check if logged in\n let loginTime = window.localStorage.getItem('loginTime');\n\n // Check if loginTime is null or login session has been expired\n if (\n loginTime == null ||\n loginTime === 'expired' ||\n new Date().getTime() - loginTime >= 3600 * 1000\n ) {\n // Logged in expired, do not show the state\n this.setState({ loggedIn: false });\n } else {\n // Logged in, load the album\n this.setState({ loggedIn: true });\n\n // Keep checking the player each second\n this.getPlayerInterval = setInterval(() => this.getSpotifyPlayer(), 1000);\n }\n }", "title": "" }, { "docid": "152f0828db044b759f22ec5b61c1d0de", "score": "0.6057988", "text": "function init() {\n const kc = this;\n const cache = kc.cache;\n const token = cache.get('token');\n const state = cache.get('state');\n const authorized = !!(token && state);\n if (!authorized) {\n return kc.onReady(false);\n }\n\n processTokenCallback(kc, token);\n // kc.onAuthSuccess();\n }", "title": "" }, { "docid": "afe7aeab0f08c243aabe74cc2754ea63", "score": "0.6050882", "text": "componentDidMount() {\n // Handle App.js login\n this.props.loginUser(this.state.aToken, this.state.rToken);\n\n // Load the home page and reload to sync the tokens\n this.props.history.push('/');\n window.location.reload(true);\n }", "title": "" }, { "docid": "12b6d9c699e2b05a1bf21dbc8d927601", "score": "0.6049899", "text": "async componentDidMount(){\n const searchStr = window.location.search\n const urlParams = queryString.parse(searchStr);\n if(urlParams.code)\n {\n const accessToken = await fbUtils.getAccessTokenFromCode(urlParams.code);\n if(accessToken){\n document.getElementById('my-login-card').innerHTML = this.uiComponent.accessTokenUI(accessToken);\n } else {\n document.getElementById('my-login-card').innerHTML = this.uiComponent.defaultErrorUI();\n }\n }\n\n }", "title": "" }, { "docid": "c79dd5b596f14f9bcf6be9da181bd295", "score": "0.60468376", "text": "componentDidMount () {\n const authenticationToken = this.props.authenticationToken;\n if (authenticationToken) {\n this.props.loginWithAuthenticationToken(authenticationToken);\n }\n }", "title": "" }, { "docid": "3d6554982edad8c11ef7588ec31cd204", "score": "0.6034652", "text": "componentDidMount() {\n\n // Check if logged in\n Axios.get(\n process.env.REACT_APP_API_URL + '/users/login/check',\n {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n\n withCredentials: true\n }\n ).then(({ data }) => {\n if (data.data.isloggedin) {\n this.setState({ isloggedin: true });\n }\n }).catch(err => {\n this.setState({ isloading: false });\n });\n\n }", "title": "" }, { "docid": "fae7eb1c791a59bf02b0a5a2d9f95e83", "score": "0.5997093", "text": "componentDidMount(){\n if (localStorage.userToken){\n this.getUserData(localStorage.userToken)\n }\n }", "title": "" }, { "docid": "7beb8d0e9c779f89203d67b55d9d6b3d", "score": "0.5990034", "text": "async componentDidMount() {\n\n if (!isLoggedIn()) { // for not loged user go to login\n navigate(`/login`)\n }\n _this.getlogWorks();\n }", "title": "" }, { "docid": "817b0dec60ad16fc8e0ff8ed058d5a11", "score": "0.5986988", "text": "componentDidMount() {\n console.log(\"Dashbord component called!\");\n const tokens = getToken();\n console.log(tokens);\n if (tokens.username == \"undefined\" || tokens.username == \"\")\n return this.props.history.push(\"/signin\");\n else this.handleAPIcall(tokens);\n }", "title": "" }, { "docid": "50684f0b67062f9df49f5be10f0dcf5b", "score": "0.5982458", "text": "async initialize() {\n const { faceTecLicenseKey, faceTecLicenseText, faceTecEncryptionKey } = Config\n\n if (!this.faceTecSDKInitializing) {\n // if not initializing - calling initialize sdk\n this.faceTecSDKInitializing = FaceTecSDK.initialize(\n faceTecLicenseKey,\n faceTecEncryptionKey,\n faceTecLicenseText,\n ).finally(() => (this.faceTecSDKInitializing = null))\n }\n\n // awaiting previous or current initialize call\n await this.faceTecSDKInitializing\n }", "title": "" }, { "docid": "6e0ec16ba4e9f12636de2e5db54dfc4a", "score": "0.5974699", "text": "componentDidMount() {\n this.initialize();\n }", "title": "" }, { "docid": "614565e4b1ec2ff395199f4954068df9", "score": "0.59692055", "text": "componentDidMount() {\n // console.log(\"currentUserContainer Mounted\")\n this.init()\n }", "title": "" }, { "docid": "020f4379850aab8ff5d7f24130f4145f", "score": "0.59644306", "text": "componentDidMount() {\n if (!this.state.keyAPI) {\n // retrieving our Google API key from a secure place.\n const key = process.env.GoogleAPI || require('../../../env').GoogleAPI;\n this.setState({ keyAPI: key });\n }\n }", "title": "" }, { "docid": "e67dd6d84f3bb2b72bdc6c57703bcd4b", "score": "0.5952314", "text": "componentDidMount() {\n axios.get(\n process.env.REACT_APP_API_URL + '/users/login/check', {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n withCredentials: true\n }\n ).then(res => {\n this.setState({ isloggedin: true, isloading: false });\n }).catch(err => {\n this.setState({ isloggedin: false, isloading: false });\n });\n }", "title": "" }, { "docid": "bf3d43e710f0eb59c5b928a428110ecc", "score": "0.5928797", "text": "async componentDidMount() {\n // Load status\n try {\n // Get status from server\n const status = await getStatus();\n console.log(\"STATUS FROM CANVAS\", status);\n\n // > App wasn't launched via Canvas\n if (!status.launched) {\n return this.setState({\n message: 'Please launch this app from Canvas.',\n });\n }\n\n // > App is not authorized\n if (!status.authorized) {\n return this.setState({\n message: 'We don\\'t have access to Canvas. Please re-launch the app.',\n });\n }\n } catch (err) {\n return this.setState({\n message: `Error while requesting state from server: ${err.message}`,\n });\n }\n\n // Load profile information\n try {\n // Get profile from Canvas via api\n const profile = await api.user.self.getProfile();\n\n // Update state\n return this.setState({\n message: `Hi ${profile.name}! Your CACCL app is ready!`,\n });\n } catch (err) {\n return this.setState({\n message: `Error while requesting user profile: ${err.message}`,\n });\n }\n }", "title": "" }, { "docid": "341edec33750540db9c4a3114f2bee18", "score": "0.592122", "text": "async componentDidMount () {\n try {\n const configs = await session.getConfigs();\n if (await this.isUserLoggedIn()) {\n const [groups, neighborhoods] = await Promise.all([\n airtable.listCommunityGroups(),\n airtable.listNeighborhoods()\n ]);\n this.setState({ loading: false, loggedIn: true, groups, neighborhoods, configs });\n } else {\n this.setState({ loading: false, loggedIn: false, configs });\n }\n } catch (err) {\n this.setState({ error: err, loading: false });\n }\n }", "title": "" }, { "docid": "df73eaabd3e1f259bee35cd0d3929554", "score": "0.59046507", "text": "componentDidMount() {\n //calls getUsers method when component is first mounted\n this.getUsers();\n }", "title": "" }, { "docid": "03cda2b2947e866884cd11e1355b9462", "score": "0.589228", "text": "componentDidMount() {\n this.getAllItems();\n this.checkSession();\n this.getLocation();\n }", "title": "" }, { "docid": "c935ed9e3f90ed9ffa4755ee5d846ef5", "score": "0.58884674", "text": "componentDidMount() {\n\n let currentUser = TokenService.getUserId();\n console.log(currentUser)\n\n //if the user is not logged in, send him to landing page\n if (!TokenService.hasAuthToken()) {\n window.location = '/';\n }\n }", "title": "" }, { "docid": "cda6c50dc94a4aa5f7368843b11a2e2a", "score": "0.5887977", "text": "function initAuth() {\n // Check initial connection status.\n if (localStorage.token) {\n processAuth();\n }\n if (!localStorage.token && localStorage.user) {\n // something's off, make sure user is properly logged out\n GraphHelper.logout();\n }\n }", "title": "" }, { "docid": "a0fcb3b2c7e5d8696ff3d1e49e9b4e10", "score": "0.58867323", "text": "initClient() {\n gapi.client.init({\n apiKey: this.API_KEY,\n clientId: this.CLIENT_ID,\n scope: this.SCOPES,\n }).then(() => {\n // Listen for sign-in state changes.\n gapi.auth2.getAuthInstance().isSignedIn.listen(this.updateSigninStatus.bind(this));\n this.setSignInListeners();\n // Handle the initial sign-in state.\n this.updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get());\n });\n }", "title": "" }, { "docid": "36a901bb168abc814a183300d72c1cf0", "score": "0.5882219", "text": "function init() {\n $(document).on('pageBeforeInit', function (e) {\n var page = e.detail.page;\n\n if (page.name.startsWith(\"smart\")) return;\n\n if (localStorage.getItem('auth-token') == null)\n load('login');\n else\n load(page.name, page.query);\n });\n }", "title": "" }, { "docid": "cebda3fa2e921759cbc5dbca60b11648", "score": "0.5880617", "text": "componentWillMount() {\n\t\tif(!this.checkForLogin())\n\t\t\tthis.showLogin();\n\t\telse\n\t\t\tthis.showHome();\n\t}", "title": "" }, { "docid": "e9795c8e1366bcf161e2dd0f208edcff", "score": "0.5874868", "text": "async login() {\n await auth0.loginWithPopup();\n this.user = await auth0.getUser();\n if(this.user) _isLoggedIn = true;\n }", "title": "" }, { "docid": "9b1a6e1a52bdc2a0b230f62b144398e4", "score": "0.58712935", "text": "componentDidMount() {\n this.props.verifySession();\n }", "title": "" }, { "docid": "7237906c0f7be72891e79430732a611a", "score": "0.5869657", "text": "handleLogIn() {\r\n const { apiKey } = this.state;\r\n const { accountUrl, onLoginSuccessful } = this.props;\r\n if (apiKey == \"\") {\r\n this.setState({\r\n showError: true,\r\n errorMessage: Properties.Api_key_error,\r\n });\r\n } else {\r\n ApplicationUtil.userToken = apiKey;\r\n showSpinner();\r\n getHomeBean(apiKey)\r\n .then((res) => {\r\n hideSpinner();\r\n setLocalUserViewPreferenceData(res);\r\n ApplicationUtil.homeBeanData = res;\r\n let prefernceData = {};\r\n prefernceData.accountUrl = accountUrl;\r\n prefernceData.userApiToken = apiKey;\r\n setLocalPreferenceData(prefernceData);\r\n onLoginSuccessful();\r\n })\r\n .catch((err) => {\r\n this.setState({\r\n showError: true,\r\n errorMessage: Properties.Api_valid_key_error,\r\n });\r\n hideSpinner();\r\n });\r\n }\r\n }", "title": "" }, { "docid": "9e0623e9a7716fc1bc84585682b63de9", "score": "0.5866527", "text": "initClient() {\n this.gapi = window['gapi'];\n this.gapi.client.init(Config)\n .then(() => {\n // Listen for sign-in state changes.\n this.gapi.auth2.getAuthInstance().isSignedIn.listen(this.updateSigninStatus);\n // Handle the initial sign-in state.\n this.updateSigninStatus(this.gapi.auth2.getAuthInstance().isSignedIn.get());\n if (this.onLoadCallback) {\n this.onLoadCallback();\n }\n });\n return true;\n }", "title": "" }, { "docid": "912dbb2aa6330e0f5a0f3a3908bebe24", "score": "0.5855875", "text": "componentWillMount() {\n\n //this will be hide in env. but this is'nt important\n firebase.initializeApp({\n apiKey: 'AIzaSyDTnIn585PpiG10GsbI7fBWb4Ze2DqY7RU',\n authDomain: 'react-native-auth-app-8cd27.firebaseapp.com',\n projectId: 'react-native-auth-app-8cd27',\n storageBucket: 'react-native-auth-app-8cd27.appspot.com',\n messagingSenderId: '563343592115',\n appId: '1:563343592115:web:33c47861336405ee9a3ec6',\n measurementId: 'G-KR2R739DTC',\n });\n\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n console.log('login roi');\n this.setState({isLogged: true});\n } else {\n console.log('chua login');\n this.setState({isLogged: false});\n }\n });\n }", "title": "" }, { "docid": "970d033e480c4ec5f7e5950d017b1d6e", "score": "0.5853735", "text": "componentDidMount() {\n this.initializeTermsDictionary(urlBase)\n this.initializeDiscardedInfluencersList(urlBase)\n this.initializeBlacklistsObject(urlBase)\n }", "title": "" }, { "docid": "9d88e46a5961f4cfa4f472941b0e84ba", "score": "0.5851331", "text": "componentDidMount() {\n\t\tfetch(CONSTANTS.ENDPOINT.DASHBOARD)\n\t\t\t.then(response => {\n\t\t\t\tif (!response.ok) { throw Error(response.statusText); }\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.then(result => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tuser: result.user,\n\t\t\t\t\temail: result.email,\n\t\t\t\t\tisAuthenticated: result.isAuthenticated\n\t\t\t\t})\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tisAuthenticated: false\n\t\t\t\t})\n\t\t\t});\n\t}", "title": "" }, { "docid": "83362cdf36310f5fd88f74cae28427d4", "score": "0.58480203", "text": "componentDidMount(){\n\n //using slef to access global this.state\n var self = this\n var authCode = this.urlParam('code')\n\n let host = window.location.hostname\n let port = host === 'localhost' ? `:${window.location.port}/callback` : '';\n let redirectUri = `${window.location.protocol}//${host}${port}`\n\n//trying to retrieve Fizzyo API auth token if the Windows Token has been already retrieved\n if(authCode!==null && authCode!==\"undefined\" && this.state.toRegister!==true && this.state.toRegister!==''){\n\n//POST request to API\nthis.setState({isLoggedIn: \"loading\"})\n\n request\n .post('https://api.fizzyo-ucl.co.uk/api/v1/auth/token')\n .set('Content-Type', 'application/x-www-form-urlencoded')\n .send({redirectUri, authCode})\n .end(function(err, res){\n if (err || !res.ok) {\n console.log(err)\n } else {\n\n //Setting LoggedIn user's variables\n Auth.accessToken = res.body.accessToken\n Auth.user.id = res.body.user.id\n Auth.user.role = res.body.user.role\n Auth.user.name = res.body.user.firstName\n self.setState({isLoggedIn: \"yes\"})\n\n }\n })\n\n }else {\n this.setState({isLoggedIn: \"no\"})\n }\n\n\n}", "title": "" }, { "docid": "37c1dd3007e9fc7ba26579d41884516e", "score": "0.58403015", "text": "function initializeApp() {\n if (liff.isInClient()) {\n liff.getProfile()\n .then( profile => {\n $('#customer').html(profile.displayName);\n $('#profilePictureDiv').html(`<img src=\"${profile.pictureUrl}\" alt=\"\" class=\"circle responsive-img\">`);\n })\n document.getElementById(\"pageLogin\").classList.add('hide');\n document.getElementById(\"pageForm\").classList.remove('hide');\n document.getElementById(\"linkLogout\").classList.add('hide');\n document.getElementById(\"linkExternal\").classList.remove('hide');\n } else {\n if (liff.isLoggedIn()) {\n liff.getProfile()\n .then( profile => {\n $('#customer').html(profile.displayName);\n $('#profilePictureDiv').html(`<img src=\"${profile.pictureUrl}\" alt=\"\" class=\"circle responsive-img\">`);\n })\n document.getElementById(\"pageLogin\").classList.add('hide');\n document.getElementById(\"pageForm\").classList.remove('hide');\n } else {\n document.getElementById(\"pageLogin\").classList.remove('hide');\n document.getElementById(\"pageForm\").classList.add('hide');\n }\n\n document.getElementById(\"linkLogout\").classList.remove('hide');\n document.getElementById(\"linkExternal\").classList.add('hide');\n }\n \n registerButtonHandlers();\n}", "title": "" }, { "docid": "a51d53fbeeae0cc8978fc130b89e87fb", "score": "0.5835876", "text": "componentDidMount(){\n console.log('requireNoAuth.did.mount isAuthenticated:', this.props.isAuthenticated);\n this.onAuthCheck(this.props);\n }", "title": "" }, { "docid": "97f94ca008685ca5e21e378775ad3907", "score": "0.5825638", "text": "componentDidMount(){\n if(localStorage.getItem('userAuthToken')){\n this.setState({ isAuthenticated: true })\n }\n }", "title": "" }, { "docid": "d04fd5eac078f646fe5a3268adae412f", "score": "0.5825298", "text": "componentDidMount() {\n if (!this.props.user) {\n apolloClient.query({\n query: WHOAMI,\n variables: {},\n })\n .then(data => {\n if (data && data.data && data.data.whoami) {\n this.props.setUser(data.data.whoami);\n }\n })\n // eslint-disable-next-line no-console\n .catch(error => console.error('Error checking backend for existing session', error))\n .finally(() => this.props.setChecked());\n }\n }", "title": "" }, { "docid": "25c70234307fc34a49c95d06255bb2ee", "score": "0.5823502", "text": "login() {\n if (!this.API)\n return;\n this.API.redirectAuth();\n }", "title": "" } ]
449e5a20dcaacbd5dd39bbe08a60b006
shift the beats with certain dt
[ { "docid": "4fa08cfa3643c99041bbe494ffbcb16d", "score": "0.7716508", "text": "shift(dt) {\n const { beats } = this.block.metadata;\n\n for (let i = 0; i < beats.length; i++)\n beats[i].time += dt;\n\n this._beats.update();\n this.block.snap();\n }", "title": "" } ]
[ { "docid": "dcdae4a5ddfb50d2b240a7f460b7132a", "score": "0.5529645", "text": "shift (dx, dy) { throw new Error('Unimplemented method shift') }", "title": "" }, { "docid": "48317eb7a1a5a24d48cfe9336c9600d9", "score": "0.5476945", "text": "shift(timeOffset) {\n if (timeOffset !== 0.0) {\n const times = this.times;\n\n for (let i = 0, n = times.length; i !== n; ++i) {\n times[i] += timeOffset;\n }\n }\n\n return this;\n }", "title": "" }, { "docid": "41f07880469e5edbf8697b3a20b29334", "score": "0.52588874", "text": "shift(timeOffset) {\n if (timeOffset !== 0.0) {\n const times = this.times;\n for(let i = 0, n = times.length; i !== n; ++i)times[i] += timeOffset;\n }\n return this;\n }", "title": "" }, { "docid": "c1b85f36fa961f96ef2ceeca211015d6", "score": "0.50580204", "text": "function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;/* no initialization */delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}", "title": "" }, { "docid": "02833bfbcd9ff196a8cf979ea445257c", "score": "0.5043887", "text": "shift(timeOffset) {\n\t\t\tif (timeOffset !== 0.0) {\n\t\t\t\tconst times = this.times;\n\n\t\t\t\tfor (let i = 0, n = times.length; i !== n; ++i) {\n\t\t\t\t\ttimes[i] += timeOffset;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}", "title": "" }, { "docid": "775d693c4b960ebd8945e69e3bd848de", "score": "0.50026435", "text": "function shift (date, amount) {\n date = new Date(date);\n date.setUTCFullYear(date.getUTCFullYear() + amount);\n return date;\n}", "title": "" }, { "docid": "45446b77a0b553b46c9f7331614d8c24", "score": "0.4975165", "text": "function extend_left() {\n\n if (self.xs.length === 0) return\n\n let t = self.xs[0][1][0] // first candle's time\n while (true) {\n t -= self.t_step\n const x = Utils.t2screen(t, range, self.spacex)\n// TODO: upstream has for above line: let x = Math.floor((t - range[0]) * r)\n if (x < 0) break\n if (t % interval === 0) {\n self.xs.unshift([x, [t]]) // TODO: adding bogus datapoint to the front?\n }\n }\n }", "title": "" }, { "docid": "f3c5ca3610758dc4296430b8f0833ad8", "score": "0.49660075", "text": "function adapt(delta, numPoints, firstTime) {\n \t\tvar k = 0;\n \t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n \t\tdelta += floor(delta / numPoints);\n \t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n \t\t\tdelta = floor(delta / baseMinusTMin);\n \t\t}\n \t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n \t}", "title": "" }, { "docid": "e961ffb28d6370e7624aa0f9df847ac6", "score": "0.49560302", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor$1(delta / damp) : delta >> 1;\n delta += floor$1(delta / numPoints);\n for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor$1(delta / baseMinusTMin);\n }\n return floor$1(k + (baseMinusTMin + 1) * delta / (delta + skew));\n}", "title": "" }, { "docid": "9437216d39a4a59d6ac555d491d9cc8e", "score": "0.4936509", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "9437216d39a4a59d6ac555d491d9cc8e", "score": "0.4936509", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "9437216d39a4a59d6ac555d491d9cc8e", "score": "0.4936509", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "9437216d39a4a59d6ac555d491d9cc8e", "score": "0.4936509", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "3690e26d71755616e2c46db93493b96d", "score": "0.49321604", "text": "function adapt(delta, numPoints, firstTime) {\n\t var k = 0;\n\t delta = firstTime ? floor(delta / damp) : delta >> 1;\n\t delta += floor(delta / numPoints);\n\t for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t delta = floor(delta / baseMinusTMin);\n\t }\n\t return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t }", "title": "" }, { "docid": "16156e9403f0eef4ee75aced7ffc4b6a", "score": "0.4929686", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "bb404793bdde5025327ff4cce90c6ebd", "score": "0.4896813", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (;\n /* no initialization */\n delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "279cf3fbea7c33b4b78cee4ec3851f30", "score": "0.48913836", "text": "tick(dt) {}", "title": "" }, { "docid": "ba39f5926a001d2d5829aeb6cc02f76c", "score": "0.4889956", "text": "function adapt(delta, numPoints, firstTime) {\r\n\t\tvar k = 0;\r\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\r\n\t\tdelta += floor(delta / numPoints);\r\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\r\n\t\t\tdelta = floor(delta / baseMinusTMin);\r\n\t\t}\r\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\r\n\t}", "title": "" }, { "docid": "bc37675d736ed47f65aee01e87146868", "score": "0.48854584", "text": "_saveDelta () { this._shift += this._delta; }", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "cc69b9b3a09f5075648b178e53b01855", "score": "0.48738736", "text": "function adapt(delta, numPoints, firstTime) {\n\t\t\tvar k = 0;\n\t\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\t\tdelta += floor(delta / numPoints);\n\t\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t\t}\n\t\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t\t}", "title": "" }, { "docid": "5f8b3f3cd0f7db69e1a9d0047a016c6a", "score": "0.4872329", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n\n for (; delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "292224bc9c8e84f0608ba2ce1c988f53", "score": "0.48711178", "text": "function adapt(delta, numPoints, firstTime) {\n var k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for(; delta > baseMinusTMin * tMax >> 1; k += base)delta = floor(delta / baseMinusTMin);\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n }", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" }, { "docid": "53c131ab782ab677e7d67e04cce1dfdb", "score": "0.48682022", "text": "function adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}", "title": "" } ]
6ad2df6149664bd5d37b301f7fe27de4
Get Data Based on Selected Date.
[ { "docid": "5afe68a69febab987b69dc6f4733e22e", "score": "0.0", "text": "requestOnDate(date) {\n let context = this;\n let starts_on = moment(date).seconds(0).minute(0).hours(0).toISOString(), \n ends_on = moment(date).seconds(59).minute(59).hours(23).toISOString(),\n currentDate = moment(new Date()).seconds(0).minute(0).hours(0).toISOString();\n\n if(moment(starts_on).format(\"X\")<moment(currentDate).format(\"X\")) {\n context.setState({\n isPastDate : true,\n starts_on : starts_on,\n ends_on : ends_on\n });\n } else {\n let leaves = [...this.props.availability.leaves];\n let index = _.findIndex(leaves, function(o) {\n let date2 = moment(starts_on).add(1,'h');\n let date1 = moment(o.starts_on).format(\"X\");\n date2 = moment(date2).format(\"X\");\n return date1 == date2;\n });\n let local = moment(starts_on).add(1,'h');\n context.setState({\n isPastDate : false,\n starts_on : starts_on,\n ends_on : ends_on,\n availability : index < 0 ? true : false,\n local : local\n });\n }\n }", "title": "" } ]
[ { "docid": "40914f2261afe3507fb98945fe7b1ac1", "score": "0.69404036", "text": "getExpensesByDate() {\n mainInfo.loadingExpenses = true;\n $.get({\n url: \"api/info/getExpensesByDate\",\n data: {\n dateFrom: mainInfo.searchFrom, dateTo: mainInfo.searchTo + \" 23:59:59\"\n }\n }).done(function (result) {\n mainInfo.loadingExpenses = false;\n mainInfo.expensesByDate = result;\n }).fail(function () {\n bootbox.alert(\"Hubo un error al recuperar los gastos. Por favor, intente nuevamente.\");\n });\n }", "title": "" }, { "docid": "0a22576185627b0eb250a7c0bd900cfb", "score": "0.68764776", "text": "_onSelectDate() {\n let state, client, clientQuery, clientSettings;\n if (typeof this.id === \"undefined\") {\n return;\n }\n\n state = store.getState();\n store.setDateSelectedFlag(true);\n\n this.toggleLoader();\n\n clientQuery = {\n product_id: this.id,\n rent_date: this._getYmd()\n };\n\n clientSettings = {\n nonce: state.general.nonce,\n action: \"get_available_rent_time\",\n url: state.general.ajaxUrl\n };\n\n client = new ServerClient(clientSettings, clientQuery);\n client.get(this.setNewTimes.bind(this));\n }", "title": "" }, { "docid": "8161b22e764431d1f1730228dde23cf6", "score": "0.6791455", "text": "function getDate(){\n return selectedDate;\n }", "title": "" }, { "docid": "c00c2bbb3215ced337158e5af5b84cf8", "score": "0.6716404", "text": "function getDayData(requestDate) {\n if (!requestDate) return null;\n for (var i = 0; i < $scope.monthData.length; i++){\n var d = $scope.monthData[i];\n if ((d.date.getMonth() === requestDate.getMonth()) && (d.date.getDate() === requestDate.getDate())){\n //console.log(d);\n return d;\n }\n } \n return null;\n }", "title": "" }, { "docid": "d7f85fab6f177f3a4a87eda754d73112", "score": "0.6703845", "text": "function fetchOnDate(get_date, $tab) {\n var utc_moment = moment.utc(get_date);\n console.log(\"Fetching for day \", utc_moment);\n\n // display loader\n pushLoad();\n\n // bind up the controls on the page\n getAccessOnDate(get_date).done(function(data) {\n // populate the bits on the page\n bindComponentsToData(data);\n\n popLoad();\n });\n\n // highlight the date selector whose date is selected (if any)\n // if there isn't a selection, select the 'free selection' tab\n if (!$tab) {\n $tab = $(\".date-choice.free-selector\");\n }\n\n $(\"#date-selector\").find(\".date-choice\")\n .filter($tab).addClass(\"selected\").end()\n .not($tab).removeClass(\"selected\");\n}", "title": "" }, { "docid": "89c329169fb137a178073f3e75c71c73", "score": "0.6419131", "text": "function findDate(tableData, userInput){\n \n\n tableData.filter(tableData.datetime);\n}", "title": "" }, { "docid": "1dadd75ce7177d0289837645fd95c235", "score": "0.63947153", "text": "function doFetchWithDate(){\n fetch('https://kc-exchangeratesapi.herokuapp.com/' + year +'-'+ month +'-' + day)\n .then(response => response.json())\n .then(data => {\n setData(data.rates);\n })\n }", "title": "" }, { "docid": "b7c86cc65d94ccfdf28aa76860362e1f", "score": "0.6369381", "text": "function doFetchWithDate(){\n const accessKey= 'd787bfae4ff1b140e5abf61f63b235d9'\n console.log('fetching');\n fetch('//api.exchangeratesapi.io/v1/' + year +'-'+ month +'-' + day + '?access_key=' + accessKey)\n .then(response => response.json())\n .then(data => {\n setData(data.rates);\n })\n }", "title": "" }, { "docid": "2d71f268ffddfe088a30a948d1476896", "score": "0.6364486", "text": "function getDataByDate(startDate,endDate, callback) {\n let token = Cookies.get('access_token');\n token = (\"Bearer \" + token);\n if (date === \"\") return;\n let URL = URL_PREFIX + \"report/getReport?startDateStr=\" + startDate.toLocaleDateString() + \"&endDateStr=\" + endDate.toLocaleDateString();\n axios.defaults.headers.common['Authorization'] = token;\n axios.get(URL, {}).then(r => {\n if (r.status == 200) {\n callback(r.data);\n } else {\n callback(undefined);\n }\n }).catch(e => {\n callback(undefined);\n });\n\n }", "title": "" }, { "docid": "7d4a0cd1fc964d241960f8706379902a", "score": "0.6279751", "text": "function GetEventsByDate(date) {\n var calData = [];\n for (i in filteredEvents) {\n if (checkDates(filteredEvents[i].StartTime, date) == 0) {\n var dataItem = new Object();\n dataItem.Description = $.extend(true, {}, filteredEvents[i].Description);\n dataItem.Status = filteredEvents[i].Status;\n dataItem.StartTime = filteredEvents[i].StartTime;\n dataItem.EndTime = filteredEvents[i].EndTime;\n calData.push(dataItem);\n }\n }\n return calData;\n }", "title": "" }, { "docid": "48b14ea061219b0391c6e531d67c8539", "score": "0.62589324", "text": "selectDate() {\n let start, end;\n if (_.isObject(this.datavalue)) {\n start = this.datavalue.start;\n end = this.datavalue.end;\n }\n else {\n start = moment(this.datavalue);\n end = moment(this.datavalue).add(1, 'day').startOf('day');\n }\n this.$fullCalendar.fullCalendar('gotoDate', start); // after selecting the date go to the date.\n this.$fullCalendar.fullCalendar('select', start, end);\n }", "title": "" }, { "docid": "607836ac784179ab10fe9bd942946d1a", "score": "0.6234113", "text": "function loadDay() {\n\t\tvar date = currentDay.toDate();\n\t\tsources.day.query(\"date = :1\", {\n\t\t\tparams:[date],\n\t\t\tonSuccess: after_loadDay,\n\t\t\tonError: WAKL.err.handler\n\t\t});\n\t}", "title": "" }, { "docid": "84a1bf52c55ac14cae2eb4f97cb74f07", "score": "0.6231384", "text": "function getPlanByDateRage(dateFrom, dateTo) {\n return $http.get(APP_CONFIG.BASE_URL + APP_CONFIG.meals_by_date + \"?dateFrom=\" + dateFrom + \"&dateTo=\" + dateTo).\n then(function(result) {\n return result;\n });\n }", "title": "" }, { "docid": "3b0dd70bada61889c562652122527ac8", "score": "0.622585", "text": "getDailyServings(date) {\n $.get('/serving', { date: date })\n .done(response => this.setState({ data: response.data }))\n .fail(response => Materialize.toast('Failed to retrieve data. Please try again later.', 2000));\n }", "title": "" }, { "docid": "c205990194a34af8eb9e92640753493c", "score": "0.62108254", "text": "function filterDates(date) {\n return date.date == dropdownDate;\n }", "title": "" }, { "docid": "59813c3bdc6e248a7ee3c10c2587b119", "score": "0.62023616", "text": "function GetEventsForDay(date) {\n var calData = [];\n\n StartTime = new Date(selectedYear, selectedMonth - 1, selectedDay, 9, 0, 0);\n //filteredEvents = [];\n //if (statusFilter != 'off') {\n // for (i in dailyCalData) {\n // if (dailyCalData[i].Status == statusFilter)\n // filteredEvents.push(dailyCalData[i]);\n // }\n //}\n //else {\n // filteredEvents = dailyCalData;\n //}\n //var selectedDate = new Date(selectedYear, selectedMonth - 1, selectedDay, 0, 0, 0);\n \n\n for (i in filteredEvents) {\n if (checkDates(filteredEvents[i].StartTime, date) == 0) {\n var dataItem = new Object();\n dataItem.Description = filteredEvents[i].Description;\n dataItem.Status = filteredEvents[i].Status;\n\n //Calculate The Slot Value For Element\n var startIndex = parseInt(getDifferenceInMinutes(StartTime, filteredEvents[i].StartTime) / slotInterval);\n dataItem.Slot = startIndex;\n\n //Calculate The Span Value For The Element\n var slotTime = new Date(StartTime.getTime());\n addMinutes(slotTime, slotInterval * dataItem.Slot);\n var endIndex = parseInt(getDifferenceInMinutes(slotTime, filteredEvents[i].EndTime) / slotInterval);\n dataItem.Span = endIndex + 1;\n\n calData.push(dataItem);\n }\n }\n\n return calData;\n }", "title": "" }, { "docid": "59da97c0acd4b27a304642696b6c0bd4", "score": "0.6167205", "text": "function getData(data,year)\n {\n debugger;\n //if (check(data))\n //{\n // alert('select any ship from list');\n // return;\n //}\n var startDate=new Date();\n sessionStorage.setItem(\"View\", 0);\n //hide yearly view and display monthly view.\n $('.cal-div').show();\n $('#Cal').hide();\n $('#exp_data').hide();\n\n\n // alert('gotcha');\n // var d = typeof (data);\n // alert(data);\n if (data == undefined)\n {\n return;\n }\n //var yourval = JSON.stringify(data);\n //var parsed = $.parseJSON(data);;\n // var arr = ;\n //console.log(yourval);\n //alert(yourval[0]);\n //alert(yourval[0].date);\n\n\n //var arr = new Array();\n dataList =data;\n\n sessionStorage.setItem('dataList',JSON.stringify(data));\n //$.each(yourval, function (i, obj) {\n \n // //date.push(obj.Date)\n // //console.log(arr[i].Date +\" \"+arr[i].Color);\n //});\n\n\n //$.each(arr, function (i, obj) {\n // // arr.push(obj.Date)\n // \n // console.log(new Date(value));\n //});\n\n //console.log(arr);\n //for (i = 0; i < yourval.length; i++)\n //{\n // console.log(yourval.data[i].date);\n // console.log(yourval.data[i].date);\n //}\n //alert(parsed.length);\n //var arr = new Array(data);\n // console.log(arr);\n // alert(arr[0].Date);\n if (data != undefined && dataList != '') {\n if (dataList.CruiseViewModel.length > 0)\n {\n startDate = convertJSONDate(dataList.CruiseViewModel[0].Date);\n }\n else\n {\n if (year != null) {\n startDate = new Date(\"01/01/\" + year);\n }\n }\n \n \n }\n else\n {\n \n //if (year!= null)\n //{\n // startDate = new Date(\"01/01/\" + year);\n //}\n \n }\n \n // startDate = new Date(parseInt(dataList[0].Date.replace(\"/Date(\", \"\").replace(\")/\", \"\"), 10));\n // console.log(dataList[0].Date);\n createCalendar(startDate);\n }", "title": "" }, { "docid": "317c44eff8d7a1e7020880d87ce35f54", "score": "0.6104022", "text": "filterByDate(event) {\n this.clearValue();\n let sd = this.template.querySelector(\".sd\").value;\n let ed = this.template.querySelector(\".ed\").value;\n let startDate = new Date(sd);\n let endDate = new Date(ed);\n\n if (!sd) {\n this.toastMessage = 'Please enter start date';\n this.showNotification();\n this.filteredData = this.casedata;\n } else if (!ed) {\n \tthis.toastMessage = 'Please enter end date';\n this.showNotification();\n this.filteredData = this.casedata;\n } else if (startDate > endDate) {\n this.toastMessage = 'Start date is greater than end date';\n this.showNotification();\n this.filteredData = this.casedata;\n } else {\n \tlet tableData = this.casedata;\n \tlet results = tableData.filter(m => {\n\t \t\tlet currentRecordDate = new Date(m.submitted__bat);\n\t \t\tcurrentRecordDate.setHours(0,0,0,0);\n\t \t\tstartDate.setHours(0,0,0,0);\n\t \t\tendDate.setHours(0,0,0,0);\n\t\t\t\tif ( currentRecordDate >= startDate && currentRecordDate <= endDate) {\n\t\t\t\t\treturn m;\n\t\t\t\t} \n\t\t });\n \tthis.filteredData = results;\n }\n }", "title": "" }, { "docid": "765cd66838d8f3fef98a903dc2121872", "score": "0.60906184", "text": "function dateSelect(){\n //don't refresh the page!\n d3.event.preventDefault();\n //print the value that was input\n console.log(dateInputText.property(\"value\"));\n //create a new table showing only the filterd data\n var new_table = tableData.filter(sighting => sighting.datetime===dateInputText.property(\"value\"))\n //display the new table\n displayData(new_table);\n}", "title": "" }, { "docid": "6367c0a27481c1b635b934e2cc229839", "score": "0.60515845", "text": "function on_click(){\n var selectedDate = d3.select(\"#datetime\").property(\"value\");\n filteredData = tableData.filter(d => d.datetime === selectedDate);\n\n makeTable(filteredData);\n}", "title": "" }, { "docid": "1d6b3a54523ccca469d1956a6f7ae860", "score": "0.6043964", "text": "function loadThisQuater() {\n var dateObj = {};\n var date = new Date();\n\n dateObj.dateTo = formatDate(date, TIME_END_DAY);\n var month = date.getMonth();\n if (month < 2) {\n month = 0;\n } else {\n month -= 2;\n }\n var first = new Date(date.getFullYear(), month, 1);\n dateObj.dateFrom = formatDate(first, TIME_START_DAY);\n\n dateObj.filterKey = 'quater';\n filterModel.set(dateObj);\n\n}", "title": "" }, { "docid": "8bccc501d0c45513ffe8dbb6e4b40052", "score": "0.6036418", "text": "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n }", "title": "" }, { "docid": "8bccc501d0c45513ffe8dbb6e4b40052", "score": "0.6036418", "text": "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n }", "title": "" }, { "docid": "8bccc501d0c45513ffe8dbb6e4b40052", "score": "0.6036418", "text": "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n }", "title": "" }, { "docid": "fee91f8b737cef08df1ef7a809de2a17", "score": "0.60348606", "text": "function clickSelect(){\r\n //don't refresh the page!\r\n d3.event.preventDefault();\r\n //print inputted value\r\n console.log(dateInputText.property(\"value\"));\r\n //create a new table showing only the filtered data\r\n var new_table = tableData.filter(ufoSighting => ufoSighting.datetime===dateInputText.property(\"value\"))\r\n //display the new table\r\n displayData(new_table);\r\n}", "title": "" }, { "docid": "0fbf41cf1242e04c1838c4e3f7abcc4b", "score": "0.6031005", "text": "function queryDateByRange () {\n Entry.findByDateRange(\n DataAdapter.parsePeriod.start( self.periodStart ),\n DataAdapter.parsePeriod.end( self.periodEnd ),\n self.pageSize\n ).then( onQuerySuccess ).catch( onDatabaseError.showError );\n }", "title": "" }, { "docid": "9f94f2a96099ae2626477d627e030b99", "score": "0.60140556", "text": "function get_dates(){\n\treturn events().select(\"date_start\",\"date_end\");\n}", "title": "" }, { "docid": "ddc9e6b640651ca189e5524741fda5a1", "score": "0.6012788", "text": "function on_click(){\n var selectedDate = d3.select(\"#datetime\").property(\"value\");\n filteredData = tableData.filter(d => d.datetime === selectedDate);\n\n makeTable(filteredData);\n\n}", "title": "" }, { "docid": "28b276329436520e533d2acffc1a2217", "score": "0.59832937", "text": "function filterDataByDate(date)\n {\n return allData.filter(dt => dt.datetime == date)\n }", "title": "" }, { "docid": "a7b19e5443130969fd79a30211baf960", "score": "0.5981368", "text": "function getNetworkStateOnDate(selectedDate){\n // console.log(\"Selected date:\"+selectedDate);\n createMarkers(selectedDate);\n \n}", "title": "" }, { "docid": "62a8aecd3106f3a77731dab6d748134f", "score": "0.5977901", "text": "function handleClick(){\n var date = d3.select(\"#datetime\").property(\"value\");\n let results = tableData;\n if (date){\n results=results.filter(row=>row.datetime === date);\n }\n buildTable(results); \n}", "title": "" }, { "docid": "8e6d2eac28e9430ec7dd5bbbd8226b1f", "score": "0.59652734", "text": "function filterDate() {\n\n var chosenDate = d3.select(\"#datetime\").property(\"value\");\n console.log(chosenDate)\n\n var filtered_Data = table.filter(row => row.datetime === chosenDate);\n Refresher(filtered_Data);\n\n}", "title": "" }, { "docid": "7964eda920e6358e3d33ceffb06efa50", "score": "0.5962871", "text": "_getDate(date, minDate = this.state.minDate, maxDate = this.state.maxDate) {\n // If no date is provided then use current date\n // Make sure we constrain it to the min and max\n const current = (date instanceof Date) ? date : new Date();\n\n if (minDate && current < minDate) {\n return minDate;\n }\n\n if (maxDate && current > maxDate) {\n return maxDate;\n }\n\n return current;\n }", "title": "" }, { "docid": "22759f885162c04d740d2d5ce954c598", "score": "0.59606296", "text": "function runDate() {\n\n //prevent page from refreshing\n d3.event.preventDefault()\n\n // select input element\n let inputElement = d3.select(\"#datetime\");\n\n // Store date value of input\n let inputDate = inputElement.property(\"value\");\n \n // filter data to match by date entered\n let filteredData = tableData.filter(ufo => ufo.datetime === inputDate)\n console.log(filteredData)\n\n // call function on filteredData to populate table\n ufoSightings(filteredData)\n}", "title": "" }, { "docid": "1f1abf17da374b325da84b170ad440fc", "score": "0.5959438", "text": "function getDataFromSoap() {\n let date = $(\"#date\").val();\n if (date !== '') {\n let data = {\n 'date': date,\n };\n let url = '/by_date';\n let method = 'GET';\n\n let response = ajaxRequest(method, url, data);\n drawTable(response);\n }\n}", "title": "" }, { "docid": "f550cbc0c1e8794ab4753737f4799387", "score": "0.5941199", "text": "async function handleDateSelected(selectedLaunchYear) {\n setSelectedLaunchYear(selectedLaunchYear);\n setLoading(true);\n const results = await fetch(\n `https://api.spacexdata.com/v3/launches?launch_year=${selectedLaunchYear}` //here, the API is fetched to load all results that match this query\n );\n results\n .json()\n .then((results) => setLaunches(results))\n .then(() => setLoading(false));\n }", "title": "" }, { "docid": "e4b31e05159e9ca0f7f138d6573eb2af", "score": "0.593386", "text": "function queryData(month,day){\n\t\tvar url = (baseURL + month + '-' + day +'-' + 'birthday');\n\t\t//console.log(url);\n\t\t$.get(url).done(onSuccess).fail(searchForVid); \n\t}", "title": "" }, { "docid": "b6e97bdf1623f37654361c0d16ce9fed", "score": "0.59298795", "text": "function getDiary(){\n var date = `2017-05-18`;\n\n $.getJSON(`${host}/api/v1/diaries/${date}`).then(function(data){\n populateDiary(data)\n })\n}", "title": "" }, { "docid": "8ef97527a3c47d49559f60f469d5e36f", "score": "0.5909797", "text": "function getDate(selector) {\n\t\n\tvar now = new Date().getTime();\n\tvar input = $(selector);\t\n\t\n\tRESULTS_DIV.html('');\n\t\n\tif(input.attr('id') == 'startDate') {\n\t\tSTART_DATE = new Date(input.val());\n\t}else if(input.attr('id') == 'endDate'){\n\t\tEND_DATE = new Date(input.val());\n\t}\n\tCURRENT_TIME_FRAME = 'custom';\n\t\n\tif($('#startDate').val() != '' && $('#endDate').val() != '') {\n\t\t\n\t\tvar dataObject = {\n\t\ttimeFrame: CURRENT_TIME_FRAME,\n\t\tprojectId: CURRENT_PROJECT,\n\t\tview: CURRENT_VIEW,\n\t\tmergeSpan: CURRENT_MERGE_SPAN,\n\t\tmeasureName: CURRENT_MEASURE\n\t\t};\n\t\t\n\t\tvar timeFrame = END_DATE.getTime() - START_DATE.getTime();\n\t\tvar threeMonthsMs = 1000 * 60 * 60 * 24 * 30 * 3;\n\t\tvar twoMonthsMs = 1000 * 60 * 60 * 24 * 30 * 2;\n\t\t\n\t\tsetMergeSpanOptions();\n\t\t\n\t\tif(START_DATE.getTime() >= END_DATE.getTime()) {\n\t\t\tRESULTS_DIV.append('<p>Start date must be before end date.</p></br>');\n\t\t}else if(END_DATE.getTime() > now || START_DATE.getTime() > now) {\n\t\t\tRESULTS_DIV.append('<p>No future dates allowed.</p></br>');\n\t\t}else if((timeFrame > threeMonthsMs && (CURRENT_MERGE_SPAN == \"60\" || CURRENT_MERGE_SPAN == \"15\")) || (timeFrame > twoMonthsMs && CURRENT_MERGE_SPAN == '15')) {\n\t\t\tRESULTS_DIV.append('<p>Please select valid merge span / time frame combination.</p>');\n\t\t}else{\n\t\t\tfetchDataAndDrawTimeseriesSingleProject(dataObject);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dbc35e6e2c28474018e64c19c079c0c2", "score": "0.59054476", "text": "function dateGetter (request) {\n\tvar date = new Date();\n\tif (request == \"day\") {\n\t\treturn days[date.getDay()];\n\t} else {\n\t\treturn date;\n\t}\n\t/*\n\tI may expand this function to decode and return an\n\texpanded range of requests. Currenty it only returns\n\tthe day or a whole date object but could return a number\n\tof other things including:\n\t\t- Year\n\t\t- Month\n\t\t- Day \n\t\t- Time\n\t\t- AM/PM\n\t*/\n}", "title": "" }, { "docid": "9470c935d4d4e9b4f946cfe28a2c99b5", "score": "0.5898587", "text": "function selectDate(event) {\n\tif (event===undefined) { // get caller element in IE8\n\t\tevent=window.event;\n\t}\n\t//assigned based on browser\n\tvar callerElement = event.target || event.srcElement;\n\tif (callerElement.innerHTML === \"\") {\n\t\t// cell contains no date, so don’t close the calendar\n\t\tdocument.getElementById(\"cal\").style.display = \"block\";\n\t\treturn false;\n\t}\n\tdateObject.setDate(callerElement.innerHTML);\n\tvar fullDateToday = new Date();\n\tvar dateToday =Date.UTC(fullDateToday.getFullYear(), fullDateToday.getMonth(), fullDateToday.getDate());\n\tvar selectedDate =Date.UTC(dateObject.getFullYear(), dateObject.getMonth(), dateObject.getDate());\n\tif (selectedDate <= dateToday) {\n\t\tdocument.getElementById(\"cal\").style.display = \"block\";\n\t\treturn false;\n\t}\n\tdocument.getElementById(\"date\").value = dateObject.toLocaleDateString();\n\thideCalendar();\n}", "title": "" }, { "docid": "a89b98ee9b0b67903ad55427935b42a7", "score": "0.589726", "text": "function get_SelectedDate()\n{\n\treturn mSelectedDate;\n}", "title": "" }, { "docid": "16ee39b2d675df74a04ed60acefdf14e", "score": "0.5896412", "text": "function getData(data) {\n var currentDataset;\n switch (data) {\n case \"default\":\n currentDataset = dataset_20180616;\n break;\n case \"june15\":\n currentDataset = dataset_20180615;\n break;\n case \"june13\":\n currentDataset = dataset_20180613;\n break;\n case \"june12\":\n currentDataset = dataset_20180612;\n break;\n case \"june09\":\n currentDataset = dataset_20180609;\n break;\n case \"june08\":\n currentDataset = dataset_20180608;\n break;\n case \"june07\":\n currentDataset = dataset_20180607;\n break;\n }\n processData(currentDataset);\n updatePlotly();\n}", "title": "" }, { "docid": "48d700e22088ada866eea516141a25e1", "score": "0.58612233", "text": "initDate(selected){\n if(typeof selected !== 'undefined' && selected !== null){\n let dateArr = selected.split('/');\n let d = new Date(dateArr[0], dateArr[1], 0); \n return {\n list: dateArr,\n maxDay: d.getDate()\n };\n }else{\n let date= new Date();\n let getYear = date.getFullYear();\n let getMonth = date.getMonth() + 1;\n let getDay = date.getDate();\n let d = new Date(getYear, getMonth, 0); \n return {\n list: [getYear,getMonth-1,getDay],\n maxDay: d.getDate()\n };\n }\n }", "title": "" }, { "docid": "937a2387df9c25dd6681f9fb7c44d127", "score": "0.58582556", "text": "function handleClick() {\n let date = d3.select(\"#datetime\").property(\"value\");\n // set a default filter and save it to a new variable. \n let filteredData = tableData;\n\n // if date is entered then fiter and get the rows for only that date.\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n // Rebuild the table using the filtered data\n // @NOTE: If no date was entered, then filteredData will\n // just be the original tableData.\n buildTable(filteredData);\n }", "title": "" }, { "docid": "b3dcc1fa0f8b9e195a1c7aeee4561d5b", "score": "0.5857378", "text": "getByDate(req, res) {\n var sql = `SELECT * FROM noticia WHERE DATE(data) = \"${req.params.date}\" ORDER BY data DESC`;\n console.log(sql)\n // get a connection from the pool\n pool.getConnection(function(err, connection) {\n if(err) {\n res.send(JSON.stringify({\"error\": err, \"response\": null}));\n }\n connection.query(sql, function(err, results) {\n connection.release();\n if(err) {\n res.send(JSON.stringify({\"error\": err, \"response\": null}));\n }\n res.send(JSON.stringify({\"error\": null, \"response\": results}));\n });\n });\n }", "title": "" }, { "docid": "92816e87524ed4ab813bb1a920cefebf", "score": "0.5855256", "text": "function getDailyRequested(data) {\n\n for (i = 0; i<data.length;i++){\n\n var obj = data[i];\n\tdaily_requested_date.push(obj.date);\n\n\tdaily_requested_size.push(obj.size);\n \n }\n \n}", "title": "" }, { "docid": "3d2388705be8f5c7ce514db29b9f2584", "score": "0.58381754", "text": "function filter_date(fil_data){\n var inputElement = d3.select(\"#datetime\");\n var inputDate = inputElement.property(\"value\");\n // If statement\n if(inputDate){\n var filteredData = fil_data.filter(dataRow => dataRow.datetime === inputDate);\n return filteredData\n }\n // If not equal return placeholder value\n return fil_data\n}", "title": "" }, { "docid": "014aa5cbd3ba58a5816b53f4a2f3f780", "score": "0.5829476", "text": "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n this._previewStart = this._previewEnd = null;\n this._changeDetectorRef.markForCheck();\n }", "title": "" }, { "docid": "014aa5cbd3ba58a5816b53f4a2f3f780", "score": "0.5829476", "text": "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n this._previewStart = this._previewEnd = null;\n this._changeDetectorRef.markForCheck();\n }", "title": "" }, { "docid": "5f4d25e7dfe9900860009ae892f02291", "score": "0.582332", "text": "function viewCal(event, date) {\n event.stopPropagation();\n var $input = $('.datepicker').pickadate();\n var picker = $input.pickadate('picker');\n picker.set('select', parseInt(date));\n picker.open();\n}", "title": "" }, { "docid": "5dd9475f2a4fd1d10ee3e9f4a729fa2b", "score": "0.5792469", "text": "function getOneDaysPunches(dateSelected = 'today') {\n const today = moment().format('L').split('/').join('-');\n const yesterday = moment()\n .subtract(1, 'days')\n .format('L')\n .split('/')\n .join('-');\n fetch(`/api/admin/punches/${dateSelected === 'today' ? today : yesterday}`)\n .then((res) => {\n return res.json();\n })\n .then((reply) =>\n // separate data into date and punch data (data comes in a list of the object values from the dB):\n dispatch(getPunchDataForOneDate(reply.data[0], reply.data.slice(1)))\n );\n }", "title": "" }, { "docid": "bc55aba31d95bff2e200e5a1c6064470", "score": "0.57919097", "text": "function _getDates() {\r\n restApi.getDates().\r\n success(function (data, status, headers, config) {\r\n vm.datesList = data;\r\n }).\r\n error(function (data, status, headers, config) {\r\n vm.datesList = data;\r\n });\r\n }", "title": "" }, { "docid": "c6330db7b34bd635a19a1e4a7ff3f53a", "score": "0.57745796", "text": "function filter_data(selected){\n\n filtered_data = all_data\n\n if (selected.country != 'all')\n filtered_data = all_data.filter(function(d){ return d.country_code == selected.country})\n\n if(selected.app != 'all')\n filtered_data = filtered_data.filter(function(d){ return d.app_name == selected.app})\n\n if(selected.diff != 'all')\n filtered_data = filtered_data.filter(function(d){ return d.diff == selected.diff})\n\n if(selected.time_start != 'all')\n\t\t\tfiltered_data = filtered_data.filter(function(d){ return d.created_date >= selected.time_start})\n\n\t\tif(selected.time_end != 'all')\n\t\t\tfiltered_data = filtered_data.filter(function(d){ return d.created_date <= selected.time_end})\n\n\t\tif(selected.isp != 'all')\n filtered_data = filtered_data.filter(function(d){ return d.carrier_name == selected.isp})\n\n\n\t\treturn filtered_data\n\n }", "title": "" }, { "docid": "066d099044a33ced38480c9a567c35b2", "score": "0.5772035", "text": "function getYearData(chosenYear) {\n numYear = parseInt(chosenYear, 10);\n\n //displays all data\n if (chosenYear === \"All\") {\n for (var i = 0; i < allDates.length; i++) {\n currentDate.push(allDates[i]);\n currentCases.push(allCases[i]);\n currentDeaths.push(allDeaths[i]);\n currentTemps.push(allTemps[i]);\n currentRain.push(allRain[i]);\n currentHumid.push(allHumid[i]);\n }\n //selected data\n } else {\n numYear = numYear * 100;\n currentDate = [];\n currentCases = [];\n currentDeaths = [];\n currentTemps = [];\n currentRain = [];\n currentHumid = [];\n for (var i = 0; i < allDates.length; i++) {\n if (allDates[i] > numYear && allDates[i] < numYear + 13) {\n currentDate.push(allDates[i]);\n currentCases.push(allCases[i]);\n currentDeaths.push(allDeaths[i]);\n currentTemps.push(allTemps[i]);\n currentRain.push(allRain[i]);\n currentHumid.push(allHumid[i]);\n }\n }\n }\n //set max & mins for ranges\n minTemp = Math.min.apply(null, currentTemps).toFixed(2);\n maxTemp = Math.max.apply(null, currentTemps).toFixed(2);\n minRain = Math.min.apply(null, currentRain);\n maxRain = Math.max.apply(null, currentRain);\n minHumid = Math.min.apply(null, currentHumid).toFixed(2);\n maxHumid = Math.max.apply(null, currentHumid).toFixed(2);\n minDeath = Math.min.apply(null, currentDeaths);\n maxDeath = Math.max.apply(null, currentDeaths);\n minCase = Number.parseFloat(Math.min.apply(null, currentCases));\n maxCase = Number.parseFloat(Math.max.apply(null, currentCases));\n }", "title": "" }, { "docid": "5d961afa74fea23fb5b87e49d112dc21", "score": "0.57707155", "text": "async function getSelectedMonthData(chosenYear, chosenMonth) {\n const response = await fetch(\n `https://api.dryg.net/dagar/v2.1/${chosenYear}/${chosenMonth + 1}`\n );\n const data = await response.json();\n const allDays = data.dagar;\n\n return allDays;\n}", "title": "" }, { "docid": "59dea3a76423ccc6e2116ad4abd6d74c", "score": "0.5768466", "text": "function getEventsByDay(date) {\n var d = new Date(date);\n d.setHours(0,0,0,0);\n return $http.get('api/events/' + d).then(function (res) {\n return res.data;\n })\n }", "title": "" }, { "docid": "d953b77ea170ae15182d665cb8d0b14b", "score": "0.5764622", "text": "function getPreferDate(){\r\n\t\t\t\t\t\r\n\t\t\tvar getDates = base_url + \"get-dates?stylist_id=\" + $('#booking-stylist-id').val() + \"&service_id=\" + $('#booking-service-id').val() + \"&gender=\" + bookingGender;\r\n\t\t\t\r\n\t\t\t//var getDates = \"scripts/dates.json\";\r\n\t\t\t/*var dates = [];\r\n\t\t\tvar dateLength;*/\r\n\t\t\t\r\n\t\t\t$.getJSON( getDates, function( data ) {\r\n\t\t\t\tif(data.error == true){\r\n\t\t\t\t\t$('.steps.active').find('.step-error').html(data.message);\r\n\t\t\t\t\t$('#loading-screen').fadeOut();\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif(returnEdit == 0){\r\n\t\t\t\t\tnextStep();\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t$('.steps.active').find('.step-error').html('');\r\n\t\t\t\t/*$.each( data, function( key, val ) {\r\n\t\t\t\t\tdates.push(val);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tdateLength = dates.length - 1;*/\r\n\t\t\t\t//console.log(parseInt(dateLength));\r\n\t\t\t\t\r\n\t\t\t\t$('#calendar').datepicker({\r\n\t\t\t\t\tstartDate: data.start_date,\r\n\t\t\t\t\tendDate: data.end_date,\r\n\t\t\t\t\tdatesDisabled: data.disabled\r\n\t\t\t\t}).on('changeDate', function(e){\r\n\t\t\t\t //console.log($('#calendar').datepicker('getFormattedDate'));\r\n\t\t\t\t\t$('#booking-selected-dt').val(e.format('mm/dd/yyyy'))\r\n\t\t\t\t\t\r\n\t\t\t\t\tbookingDate = $('#booking-selected-dt').val();\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif($('#booking-selected-dt').val() !== ''){\r\n\t\t\t\t\t$('#calendar').datepicker(\"update\", $('#booking-selected-dt').val());\r\n\t\t\t\t};\r\n\t\t\t\t//$('#calendar').datepicker('setDates', data);\r\n\t\t\t \r\n\t\t\t\t/*$( \"<ul/>\", {\r\n\t\t\t\t \"class\": \"my-new-list\",\r\n\t\t\t\t html: items.join( \"\" )\r\n\t\t\t\t}).appendTo( \"body\" );*/\r\n\t\t\t}).done(function() {\r\n\t\t\t\t// Preloader\r\n\t\t\t\tif(returnEdit == 0){\r\n\t\t\t\t\t$('#loading-screen').fadeOut();\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "2dfacf8d8c84d2d099e490aa309b1769", "score": "0.57613647", "text": "function handleDateChange(date) {\n //setSelectedDate(date);\n }", "title": "" }, { "docid": "5fa7722516034e5f409013a4d6dc9417", "score": "0.5760977", "text": "fetchInitialData(userType, userId){\n\t\t\tlet selected = 0;\n\n\t\t\tthis.$emit(\"send-selected-date\", selected, this.date_from, this.date_to, this.selectedDate);\n\t\t\t\n\t\t\tdate_from = this.selectedDate.toISOString(true).substring(0,10);\n\t\t\tdate_to = \"\"; // leave blank\n\t\t\tthis.selectedHistory = 0;\n\n\t\t\tthis.getListOfPayments(selected, date_from, date_to, userType, userId);\n\t\t}", "title": "" }, { "docid": "05e06eb63f3d8d4fb11e73a3d75cf500", "score": "0.57551134", "text": "function selectedAppointmentDate() {\n var dateForAppointment = JSON.parse(localStorage.getItem('appointmentDate'));\n if((dateForAppointment.date == $scope.fromDate.getDate())&&\n (dateForAppointment.month == $scope.monthName[$scope.fromDate.getMonth()])&&\n (dateForAppointment.year == $scope.fromDate.getFullYear()) ){\n getActiveTimeDiff(dateForAppointment);\n }\n else{\n //// initialized slots again ///\n slotValues();\n }\n }", "title": "" }, { "docid": "f3be2a5cf93c74595513e92c50d66eb7", "score": "0.57519686", "text": "function getCalendar(){\n\t\n\t\tvar options = {\n\t\tdate: new Date(),\n\t\tmode: 'date'\n\t\t};\n\t\tdatePicker.show(options, onSuccess, onError);\t\n\t\n}", "title": "" }, { "docid": "a52115b756053d7c067b652243d89679", "score": "0.5745224", "text": "function onChangeDatepicker(){\n vm.dateString = getFormattedDateString(vm.dts, vm.dte);\n performDateSearch();\n }", "title": "" }, { "docid": "16a5fdcf08c1eb2cacd7a179abee3617", "score": "0.5744896", "text": "function filter_data(selected) {\n\t\tfiltered_data = all_data;\n\n\t\tif (selected.country != \"all\")\n\t\t\tfiltered_data = filtered_data.filter(function(d) {\n\t\t\t\treturn d.country_code == selected.country;\n\t\t\t});\n\n\t\tif (selected.app != \"all\")\n\t\t\tfiltered_data = filtered_data.filter(function(d) {\n\t\t\t\treturn d.app_name == selected.app;\n\t\t\t});\n\n\t\tif (selected.diff != \"all\")\n\t\t\tfiltered_data = filtered_data.filter(function(d) {\n\t\t\t\treturn d.diff == selected.diff;\n\t\t\t});\n\n\t\tif (selected.time_start != \"all\")\n\t\t\tfiltered_data = filtered_data.filter(function(d) {\n\t\t\t\treturn d.created_date >= selected.time_start;\n\t\t\t});\n\n\t\tif (selected.time_end != \"all\")\n\t\t\tfiltered_data = filtered_data.filter(function(d) {\n\t\t\t\treturn d.created_date <= selected.time_end;\n\t\t\t});\n\n\t\tif (selected.isp != \"all\")\n\t\t\tfiltered_data = filtered_data.filter(function(d) {\n\t\t\t\treturn d.carrier_name == selected.isp;\n\t\t\t});\n\n\t\treturn filtered_data;\n\t}", "title": "" }, { "docid": "b7f2a6e798ba3c3f131f65d277b6cf7b", "score": "0.57414734", "text": "function fetchDailySlice(dateString) {\n dateString = dateString || 'latest';\n\n let url = './data/' + dateString.replace(/-/g, '.') + '.json';\n if (dateString == 'latest') {\n url += '?nocache=' + timestamp;\n }\n fetch(url)\n .then(function(response) {\n if (response.status == 200) {\n return response.json();\n } else {\n\n onAllDailySlicesFetched();\n }\n })\n .then(function(jsonData) {\n if (!jsonData) {\n return;\n }\n let currentDate = jsonData.date;\n // Memasukkan kembali fitur pada objects yang dikenali peta (mapbox), Reformat struktur ke geojson.\n jsonData.type = 'FeatureCollection';\n for (let i = 0; i < jsonData.features.length; i++) {\n let feature = jsonData.features[i];\n feature.type = 'Feature';\n let coords = feature.properties.geoid.split('|');\n // Membalik latitude dan longitude.\n feature.geometry = {'type': 'Point', 'coordinates': [coords[1], coords[0]]};\n }\n\n dates.unshift(currentDate);\n featuresByDay[currentDate] = jsonData;\n\n // Hanya menggunakan data terbaru untuk peta sampai data terdownload semuanya.\n if (dateString == 'latest') {\n map.getSource('counts').setData(jsonData);\n }\n // Mengambil potongan data sebelumnya\n fetchDailySlice(oneDayBefore(currentDate));\n });\n}", "title": "" }, { "docid": "8a27ea2c569cbac47838cfbbe9e748c1", "score": "0.5741053", "text": "function firstSelectedDate() {\n // get the first selected date \n var date1Selected = document.querySelector('.calendar-1').value;\n \n var url = `https://cors-anywhere.herokuapp.com/https://www.lb.lt/lt/currency/daylyexport/?xml=1&class=Eu&type=day&date_day=${date1Selected}`;\n \n var methodType = \"GET\";\n\n get(url, methodType, function(error, resp) {\n if(error) {\n console.log(error);\n } else {\n // get the selected currency \n var currencySelection = document.querySelector('.currency-selection');\n var currencySelected = currencySelection.options[currencySelection.selectedIndex].value; \n \n // compare currency selected with currency in db \n for (var i = 1; i < resp.children.length; i++) { \n var child = resp.children[i]; \n if(currencySelected === child.children[1].textContent){\n currencyName1 = child.children[0].textContent; // pavadinimas\n currencyCode1 = child.children[1].textContent; // kodas\n currencyValue1 = child.children[2].textContent; // santykis\n currencyDate1 = child.children[3].textContent; // data\n }\n }\n }\n });\n // to avoid undefined in output\n setTimeout(() => secondSelectedDate(), 1000);\n}", "title": "" }, { "docid": "a974ab366839af2e3ca149c6881613e7", "score": "0.5740035", "text": "function load_date() {\r\n $('#year').load('get_date.php?item=year', function(r, s, xmlRequest) {\r\n $('#year').val(r);\r\n });\r\n\tvar d = new Date().getMonth();\r\n\t$('#month_'+d).attr('selected', 1);\r\n $('#day').load('get_date.php?item=day', function(r, s, xmlRequest) {\r\n\t\t$('#day').val(r);\r\n\t\tvar d = new Date().getDate();\r\n\t\t$('#day_'+d).attr('selected', 1);\r\n });\r\n}", "title": "" }, { "docid": "b59670ae4bd29797934e92eb17c66b32", "score": "0.5739493", "text": "onDateChange(data) {\n const { dispatch } = this.props\n if (data === null) {\n dispatch({\n type: SET_SEARCH_OPTIONS,\n data: {\n fromDate: null,\n toDate: null,\n },\n })\n } else if (data.length === 2) {\n dispatch({\n type: SET_SEARCH_OPTIONS,\n data: {\n fromDate: data[0],\n toDate: data[1],\n },\n })\n }\n }", "title": "" }, { "docid": "7552cd97f27af520881b9d7657f78ea9", "score": "0.57375765", "text": "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "title": "" }, { "docid": "7552cd97f27af520881b9d7657f78ea9", "score": "0.57375765", "text": "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "title": "" }, { "docid": "7552cd97f27af520881b9d7657f78ea9", "score": "0.57375765", "text": "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "title": "" }, { "docid": "7552cd97f27af520881b9d7657f78ea9", "score": "0.57375765", "text": "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "title": "" }, { "docid": "b561a4917a23f6b41aa8beaeab69fe1e", "score": "0.57347375", "text": "selectDate(event) {\n this.onSelectDate({\n $event: {\n date: event[0]._model.label\n }\n });\n }", "title": "" }, { "docid": "535ebd92af216943ece9fff2849f5642", "score": "0.5731809", "text": "function clickHandler() {\n // prevent refresh\n d3.event.preventDefault();\n // Select date\n var inputDateField = d3.select(\"#datetime\");\n // get value\n var dateVal = inputDateField.property(\"value\");\n // print to console\n console.log(dateVal);\n // filter data file\n var filteredData = data.filter(data => data.datetime === dateVal);\n // call buildTable function with filtered data/break if out of range\n buildTable(filteredData);\n // console.log(filteredData)\n}", "title": "" }, { "docid": "a188854b14eb5609544fc7741e9b0083", "score": "0.5717566", "text": "function handleClick() {\n var date = d3.select(\"#datetime\").property(\"value\");\n \n var outThere = tableData;\n\n if (date) {\n outThere = outThere.filter( ufo => ufo.datetime === date);\n };\n\n buildtable(outThere)\n}", "title": "" }, { "docid": "10ec99010de9ac5053ba6bb67237a5eb", "score": "0.5716687", "text": "getEvents(date, view) {\n const start = moment(date).startOf('month').format('YYYY-MM-DD HH:mm:ss');\n const end = moment(date).endOf('month').format('YYYY-MM-DD HH:mm:ss');\n if (this.monthAndYearValid(date.getMonth(), date.getFullYear())) {\n TTTPost('/get-games-with-details', {\n start: start,\n end: end\n }).then(res => {\n if (res.data.eventDetails) {\n this.setState({\n eventList: res.data.eventDetails,\n selectedEvent: null\n });\n }\n });\n this.props.history.push(this.getDateRedirect(date.getMonth(), \n date.getFullYear()));\n }\n }", "title": "" }, { "docid": "02104a5cf5647bf9e3c6ade6761e6440", "score": "0.57155794", "text": "function handleClick() {\n var inputValue = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData\n console.log(\"A new date was entered\");\n if (inputValue) {\n filteredData = filteredData.filter(date => date.datetime === inputValue);\n };\n loadData(filteredData);\n}", "title": "" }, { "docid": "16148ed5070e0a0fc690ee817c791b09", "score": "0.571295", "text": "function SonicDashboardBubble_getDate() {\n var servrDat = $(\"#hdnSrvtDtime\").val();\n var sliderVal = $(\"#slider-210\").val();\n if (servrDat != '') {\n\n var mySplitResult = servrDat.split(\",\");\n var a = new Date(mySplitResult[0], (mySplitResult[1] - 1).toString(), mySplitResult[2], mySplitResult[3], mySplitResult[4], mySplitResult[5]);\n var selected = $(\"input[type='radio'][name='radio-choice-h-330']:checked\");\n var mydate;\n switch (selected.val()) {\n\n case 'MONTHLY':\n mydate = a.addMonths(parseInt(sliderVal));\n $(\"#LblDaily\").text(mydate.toString('MMM yyyy'));\n $(\"#hdnDateSelected\").val(mydate.toString('MM/dd/yyyy'));\n break;\n\n case 'DAILY':\n\n var dt = a.addDays(sliderVal);\n var dy = dt.toString('d');\n\n var mt = dt.toString('MMM');\n var yr = dt.toString('yyyy');\n $(\"#hdnDateSelected\").val(dt.toString('MM/dd/yyyy'));\n if (((dy.substring(dy.length, 1) == '1') && (dy != '11')) || (dy == '1')) {\n $(\"#LblDaily\").text(dy + 'st ' + mt + ' ' + yr);\n }\n\n else if (((dy.substring(dy.length, 1) == '2') && (dy != '12')) || (dy == '2')) {\n $(\"#LblDaily\").text(dy + 'nd ' + mt + ' ' + yr);\n }\n else if (((dy.substring(dy.length, 1) == '3') && (dy != '13')) || (dy == '3')) {\n $(\"#LblDaily\").text(dy + 'rd ' + mt + ' ' + yr);\n }\n else {\n $(\"#LblDaily\").text(dy + 'th ' + mt + ' ' + yr);\n }\n break;\n\n case 'WEEKLY':\n\n var dt;\n if (sliderVal == 0) {\n dt = a;\n }\n else {\n dt = a.sunday();\n dt.addWeeks(sliderVal);\n }\n\n var dy = dt.toString('d');\n var mt = dt.toString('MMM');\n var yr = dt.toString('yyyy');\n $(\"#hdnDateSelected\").val(dt.toString('MM/dd/yyyy'));\n if (((dy.substring(dy.length, 0) == '1') || (dy.substring(dy.length, 1) == '1') && (dy != '11'))) {\n $(\"#LblDaily\").text(dy + 'st ' + mt + ' ' + yr);\n }\n\n else if (((dy.substring(dy.length, 0) == '2') || (dy.substring(dy.length, 1) == '2') && (dy != '12'))) {\n $(\"#LblDaily\").text(dy + 'nd ' + mt + ' ' + yr);\n }\n else if (((dy.substring(dy.length, 0) == '3') || (dy.substring(dy.length, 1) == '3') && (dy != '13'))) {\n $(\"#LblDaily\").text(dy + 'rd ' + mt + ' ' + yr);\n }\n else {\n $(\"#LblDaily\").text(dy + 'th ' + mt + ' ' + yr);\n }\n\n break;\n\n case 'INTRADAY':\n\n var dt = a.addHours(sliderVal);\n var dy = dt.toString('d');\n var mt = dt.toString('MMM');\n var yr = dt.toString('yyyy');\n var hr = dt.toString('h');\n var tt = dt.toString('tt');\n $(\"#hdnDateSelected\").val(dt.toString('MM/dd/yyyy'));\n if (hr == 0) { hr = 12; }\n\n if (((dy.substring(dy.length, 1) == '1') && (dy != '11')) || (dy == '1')) {\n $(\"#LblDaily\").text(hr + ' ' + tt + ' ' + dy + 'st ' + mt + ' ' + yr);\n }\n\n else if (((dy.substring(dy.length, 1) == '2') && (dy != '12')) || (dy == '2')) {\n $(\"#LblDaily\").text(hr + ' ' + tt + ' ' + dy + 'nd ' + mt + ' ' + yr);\n }\n else if (((dy.substring(dy.length, 1) == '3') && (dy != '13')) || (dy == '3')) {\n $(\"#LblDaily\").text(hr + ' ' + tt + ' ' + dy + 'rd ' + mt + ' ' + yr);\n }\n else {\n $(\"#LblDaily\").text(hr + ' ' + tt + ' ' + dy + 'th ' + mt + ' ' + yr);\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "392cc87a9e2a9bdb24ab4822251da74e", "score": "0.57093537", "text": "function getSelectedData(start, end) {\n $.ajax({\n beforeSend: function(xhr, settings) {\n if (!csrfSafeMethod(settings.type) && !this.crossDomain) {\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n }},\n url : \"/profile/report\",\n type : \"POST\",\n dataType: \"json\",\n data : { method : \"load\", startDate : start, endDate: end},\n success : function(response) {\n renderTable(response)\n console.log(\"success\")\n }\n })\n}", "title": "" }, { "docid": "1ab00ebfc5f64caf59ca16bf25421543", "score": "0.5701116", "text": "static async getCalsByDate(username){\n let date = Date();\n date = date.slice(4,15);\n\n const usercheck = await db.query(\n `SELECT username FROM user_weights WHERE username = $1`, [username]\n );\n\n if(usercheck.rows.length === 0){\n return new ExpressError('There are no calories for the current username', 404);\n } \n\n const result = await db.query(\n `SELECT id from user_cals WHERE date_cal = $1 AND username = $2`,[date, username]\n );\n\n if(result.rows.length === 0){\n return new ExpressError('There are no calories entered for that date', 404);\n }\n \n return result.rows[0]\n }", "title": "" }, { "docid": "21924e98c06eb3e4a139780bf98c3988", "score": "0.569885", "text": "function getDate(location) {\n return $(location).find(\".date\").datepicker(\"getDate\");\n}", "title": "" }, { "docid": "9c79498a66e00128fa95501a139cc832", "score": "0.56974024", "text": "function getOverViewByDate( startDate, endDate, onSuccess, onError ){\n\t\t\tif( myDB != null ){\n\t\t\t\tmyDB.transaction(function(t) {\n\t t.executeSql(\n\t \"SELECT S.id, S.orderQty, S.total, S.custId, time( S.stamp) AS stamp, C.name, C.phone, C.address \\\n\t FROM OrderSummary AS S\t\t\t\t\t \\\n\t LEFT JOIN custInfo AS C \t\t\t\t \\\n\t \tON S.custId = C.id \t\t\t\t\t \\\n\t \tWHERE S.stamp BETWEEN ? AND ? \"\t\n\t \t, [ startDate , endDate ]\n\t \t, onSuccess\n\t \t, onError );\n\t });\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "eb19d074622c3b373b7b58ed0ab94473", "score": "0.56846595", "text": "selectDay (event) {\n\t\t\tconst date = event.target.getAttribute('data-date');\n\t\t\tif (!date) return;\n\t\t\tthis.currentDay = date;\n\t\t}", "title": "" }, { "docid": "e2784e7c299d89c891884fd676855fd7", "score": "0.56816345", "text": "function filterTable(){\n var inputDate= new Date(document.getElementById(\"date-picker\").value)\n var dataDate\n var filteredData =[]\n\n if (isTable == false){\n for(var i=0 ; i < wholeData.length ; i++){\n dataDate=new Date(wholeData[i].fields.date);\n\n if(dataDate.getTime() === inputDate.getTime()){/dataDate.setHours(0,0,0,0)== inputDate.setHours(0,0,0,0)/\n filteredData.push(wholeData[i])\n\n\n }}\n\n }\n else{\n\n for(var i=0 ; i < continent.length ; i++){\n dataDate=new Date(continent[i].fields.date);\n\n if(dataDate.getTime() === inputDate.getTime()){/dataDate.setHours(0,0,0,0)== inputDate.setHours(0,0,0,0)/\n filteredData.push(continent[i])\n\n\n }}\n }\n\n if(filteredData.length == 0 ){\n alert(\"There is no info about this date.\")\n\n }else{\n if (isTable == false){\n console.log('filteredData[0]')\n console.log(filteredData[0])\n buildTable(filteredData)\n\n }\n else{\n\n buildTableContinent(filteredData)\n }\n\n\n\n }\n\n }", "title": "" }, { "docid": "1da0e3248322d7cbdd62214cb541643f", "score": "0.567979", "text": "function getRouteDate() {\n\t$.ajax({\n\t type : \"POST\",\n\t async : false,\n\t dataType : 'json',\n\t data : {\n\t \t'vo.vehID' : select_vehicle_name.getSelectedValue(),\n\t \t'vo.plateNumber' : sel_lisencePlate,\n\t \t'vo.beginDate' : sel_startDate,\n\t \t'vo.beginTime' : sel_startTime,\n\t \t'vo.endTime' : sel_endTime\n\t },\n\t url : basePath + \"monitor/google-display!getGeo\",\n\t success : function(d) {\n\t\t\tif(\"empty\" != d.result){\n\t\t\t\tvehidd=select_vehicle_name.getSelectedValue();\n\t\t\t\tdataList = d;\n\t\t\t\taddRouteAll();\n\t\t\t} else {\n\t\t\t\talert('no data!');\n\t\t\t}\n\t },\n\t error : function(d) {\n\t\t\talert(\"Exception occurs!\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e5fac5bde59e080a957572474f70eb9c", "score": "0.5679669", "text": "handleDateChange(event) {\n this.bFormEdited = true;\n let elemName = event.target.name;\n let index = event.target.dataset.index;\n let selectedValue = event.target.value;\n //Date is changed for Retro Start Date\n if (elemName === \"retroStartDate\") {\n this.dataAdjustment[index].dRetroStartDate = selectedValue;\n }\n //Date is changed for Retro End Date\n else if (elemName === \"retroEndDate\") {\n this.dataAdjustment[index].dRetroEndDate = selectedValue;\n }\n }", "title": "" }, { "docid": "612a7b57990078e3f583a9b484f1cb0e", "score": "0.5676657", "text": "function get_data_per_day(selected_day){\n\n const template = \"<li data-hour='{hour}'>🕒 {hour} <span>{cupos} cupos disponibles</span></li>\";\n const dayname = moment(selected_day, 'YYYY-MM-DD').locale('es').format('dddd');\n\n console.log(dayname);\n\n $.ajax({\n url: dcms_object.ajaxurl,\n type: 'post',\n dataType: 'json',\n data: {\n action:'dcms_get_available_hours',\n nonce: dcms_object.nonce,\n type: $(calendar_el).attr('id'),\n date: selected_day,\n dayname\n },\n beforeSend: function(){\n $('.cal-sel-date .available-hours li').remove();\n $('.cal-sel-date .waiting').show();\n $('.cal-sel-date .no-data').hide();\n }\n })\n .done( function(res){\n if ( $.isEmptyObject(res) ){\n $('.cal-sel-date .no-data').show();\n } else {\n\n for (const hour in res) {\n const cupos = res[hour];\n\n if ( ! hide_hour_before_current(hour, selected_day) ){\n const str = template.replaceAll('{hour}', hour).replaceAll('{cupos}', cupos);\n $('.cal-sel-date .available-hours').append(str);\n }\n\n }\n\n if ( $('.cal-sel-date .available-hours').text().trim() == ''){\n $('.cal-sel-date .no-data').show();\n }\n }\n\n })\n .always( function(){\n $('.cal-sel-date .waiting').hide();\n }); // ajax\n } // get_data_per_day", "title": "" }, { "docid": "71983e1e9cb165bf070dd64b0f6c3879", "score": "0.56559503", "text": "function selectAllForDateBudget() {\n dbObject.transaction(function (transaction){\n transaction.executeSql('SELECT * FROM DATEBUDGET;', [], dateViewHandler, errorHandler);\n });\n }", "title": "" }, { "docid": "587cb649a16c7c36b9697c454d157bf9", "score": "0.5655915", "text": "function showNewsFeedByDate(date, commodity){\n\n\tdata = {\n\t\tdate,\n\t\tcommodity\t\n\t}\n\n\tconsole.log(data)\n\n\trequestPostData(\"/agri_req/getNewsByDate\", {\"data\": data})\n\t.then(data=> {\n\t\tconsole.log(data);\n\t\t\n\t\tnews_data = data[\"news\"];\n\t\tsetNewsFeedByDate(news_data);\n\n\n\t});\n}", "title": "" }, { "docid": "46a805d2d123481b2126c06629c0e839", "score": "0.56487507", "text": "function onDateChosen (date) {\n if (date) {\n date = new Date(date);\n $scope.request.time.datetime.setDate(date.getDate());\n $scope.request.time.datetime.setMonth(date.getMonth());\n $scope.request.time.datetime.setFullYear(date.getFullYear());\n ga('send', 'event', 'TripDateChosen', 'PlanTripController.onDateChosen()', 'Custom date for trip was set!');\n }\n else {\n var error = 'Received undefined date from datepicker.';\n console.error(error);\n ga('send', 'event', 'DatePickerReturnedBadValue', 'PlanTripController.onDateChosen()', error);\n }\n }", "title": "" }, { "docid": "da3c418864cb896c3ab1af77d1680fdf", "score": "0.56458366", "text": "function buttonClick(){\n\n // Search for the date entered\n var searchedDate = d3.select(\"#datetime\").property(\"value\");\n\n // Take the data and filter it\n\tvar filteredData = tableData\n\t\n\t// var sdate = d3.select(\"#datetime\").property(\"value\")\n\tif (searchedDate) {\n\t\t// Apply `filter` to the table data to only keep the\n\t\t// rows where the `datetime` value matches the filter value\n\t\tvar filteredData = filteredData.filter(row => row.datetime === searchedDate)}\n\t loadTableRows(filteredData);\n}", "title": "" }, { "docid": "d5b7148a8010f4ae3a4a33c2e4824888", "score": "0.5643619", "text": "function set_gifts_date() {\n // get the date values\n var today = new Date();\n year = today.getFullYear();\n month = today.getMonth() + 1;\n\n // iterate over all the dates. If the user has an option that matches the current month, select it.\n $(\"#s_filter_gifts_by_date option\").each(function () {\n if ($(this).val() == year + \"-\" + month) {\n $(\"#s_filter_gifts_by_date\").val($(this).val());\n return false;\n }\n });\n\n // show the new data\n $(\"#s_filter_gifts_by_date\").trigger(\"change\");\n}", "title": "" }, { "docid": "b1d1d49f922ad1f2e2cf101a41d4d1d5", "score": "0.564237", "text": "getGameDates() {\n TTTGet(\"/get-game-dates\")\n .then(res => {\n this.setState({\n gameDates: res.data.date\n });\n this.loadFormattedGameDates();\n });\n }", "title": "" }, { "docid": "f91e9e247e9e3c40f5fc4eccea768433", "score": "0.5638972", "text": "function getRoomsByDate(date) {\n var timestamp = roomsService.filterDateToTimestamp(date, false);\n roomsService.getRoomsByDate(timestamp).then(function (rooms) {\n vm.rooms = rooms;\n console.log(rooms);\n }).finally(function (done) {\n console.log(done);\n vm.settings.loading = false;\n }).catch(function (reject) {\n console.log(reject);\n messageService.error(\"Please check your internet connection\" + reject);\n });\n }", "title": "" }, { "docid": "aefad1c71eecae61f57753b551530752", "score": "0.5633565", "text": "getExercises(date){\n let i, e;\n for(i in this.Exercises){ \n e = this.Exercises[i];\n if (e.Date == date){\n return e;\n }\n }\n }", "title": "" }, { "docid": "f4f64f9454935ab3c0a64aa2a4665341", "score": "0.5631553", "text": "function handleClick() {\n let date = d3.select(\"#datetime\").property(\"value\");\n // Now we need to set a default filter and save it to a new variable\n let filteredData = tableData;\n // The next step is to check for a date filter using an if statement.\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date); // his line is what applies the filter to the table data. It's basically saying, \"Show only the rows where the date is equal to the date filter we created above.\" The triple equal signs test for equality, meaning that the date in the table has to match our filter exactly.\n };\n // Build the Filtered Table\n // @NOTE: If no date was entered, then filteredData will\n // just be the original tableData.\n buildTable(filteredData);\n}", "title": "" }, { "docid": "93f07386c8a4214cd9fe1015e6d357a7", "score": "0.562367", "text": "connectDateRange(dataDate) {\n\t\tconst dateTemplate = document.getElementById(\"date-template\");\n\t\tconst dateFilterStart = dateTemplate.content.cloneNode(true);\n\t\tconst dateFilterEnd = dateTemplate.content.cloneNode(true);\n\t\tconst inputStart = dateFilterStart.querySelector(\"input\");\n\t\tconst pickerStart = datepicker(inputStart, {\n\t\t\tid: 1,\n\t\t\tonSelect: (instance, date) => {\n\t\t\t\tconst dateRange = pickerStart.getRange();\n\t\t\t\t// only check for update data if both are defined\n\t\t\t\tif (dateRange.start && dateRange.end) {\n\t\t\t\t\tthis.checkRange(dateRange, dataDate);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// Default date is set to April 1st because that was provided in JSON\n\t\tpickerStart.setDate(new Date(\"04/01/2019\"), true);\n\t\tconst inputEnd = dateFilterEnd.querySelector(\"input\");\n\t\tconst pickerEnd = datepicker(inputEnd, {\n\t\t\tid: 1,\n\t\t\tonSelect: (instance, date) => {\n\t\t\t\tconst dateRange = pickerStart.getRange();\n\n\t\t\t\tif (dateRange.start && dateRange.end) {\n\t\t\t\t\tthis.checkRange(dateRange, dataDate);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tpickerEnd.setDate(new Date(\"04/01/2019\"), true);\n\t\tconst filterPanel = document\n\t\t\t.getElementById(this.id)\n\t\t\t.closest(\".page\")\n\t\t\t.querySelector(\".panel-filters\");\n\t\tfilterPanel.innerHTML = \"<span>Period:</span>\";\n\t\tfilterPanel.appendChild(dateFilterStart);\n\t\tfilterPanel.appendChild(dateFilterEnd);\n\t}", "title": "" }, { "docid": "255824633b17d95b6aadf80bb12cc08f", "score": "0.56208694", "text": "function selected(cal, date) {\r\n cal.sel.value = date; // just update the date in the input field.\r\n \r\n if (cal.dateClicked )\r\n cal.callCloseHandler();\r\n}", "title": "" }, { "docid": "255824633b17d95b6aadf80bb12cc08f", "score": "0.56208694", "text": "function selected(cal, date) {\r\n cal.sel.value = date; // just update the date in the input field.\r\n \r\n if (cal.dateClicked )\r\n cal.callCloseHandler();\r\n}", "title": "" }, { "docid": "4eac6bc07bfb0c5f68397f576c2a232a", "score": "0.5615555", "text": "function handleClick(){\n // getting the value of the input date entered \n let dateValue = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n // find the data based on the date entered\n if(dateValue) {\n filteredData = filteredData.filter((row) => row.datetime === dateValue);\n }\n printRows(filteredData);\n}", "title": "" }, { "docid": "7dc1ff70eb755ebc535fcfcb67e71737", "score": "0.56074375", "text": "function returnLaunchInfoByDate(dateIn){\n\tvar def = $.Deferred();\n\tvar launchInfoOut = [];\n\n\tvar spaceCraft = new Miso.Dataset({\n\t\turl: \"data/spacecraft.csv\",\n\t\tdelimiter: \",\"\n\t});\n\n\t_.when(spaceCraft.fetch({\n\t\tsuccess: function(){\n\t\t\tthis.each(function(row){\n\t\t\t\tvar dateNum = Number(row.LaunchDate.replace(/-/g, \"\"));\n\t\t\t\tif( dateNum == dateIn){\n\t\t\t\t\tlaunchInfoOut.push(row);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t})).then(function(){\n\t\tdef.resolve(launchInfoOut);\n\t});\n\n\treturn def.promise();\n}", "title": "" } ]
d3125e053fadb1e7fb0bfb563f4c0d15
Fonction pour obtenir les panneaux d'une maison en particulier
[ { "docid": "11b7729d54bc643fea0557b4acce5867", "score": "0.0", "text": "function getPanels(req, res) {\n Home.findById({ _id: req.params.homeId })\n .populate('panels')\n .exec((err, home) => {\n if (err)\n return res.status(500).send({ message: `Erreur ${err}` });\n if (!home)\n return res.status(400).send({ message: `On ne peut pas trouver les données de ce panneau` })\n\n return res.status(200).send({ home });\n })\n}", "title": "" } ]
[ { "docid": "37385f5d8a528088a6618351e07cd57e", "score": "0.54351616", "text": "get panelists() {\n var url = \"https://api.zoom.us/v2/webinars/\" + this.webinarID + \"/panelists?page_size=300\";\n return this.callAPI(url);\n }", "title": "" }, { "docid": "4807a70ecf4a55607695a0e0fe038d9b", "score": "0.534673", "text": "function panelContents(props){\n return(\n <div>\n {props.map((pan, index) =>{\n if(pan.type == \"panelception\"){\n return(\n <div>\n {panelception(pan)}\n <br/>\n </div>\n )\n }\n else{\n return(\n <div>\n {panel(pan)}\n <br/>\n </div>\n )\n }\n })\n }\n </div>\n )\n}", "title": "" }, { "docid": "869eaf64b5b9ceff4a5c77025cc4f8d7", "score": "0.52962196", "text": "getPlatos() {\n return this.platos;\n }", "title": "" }, { "docid": "6186bfa2eacff847deb918175f5647ba", "score": "0.52019364", "text": "function getPanels(numSides) {\n //75 is a good radius for 6 sides, this adjusts accordingly:\n var radius = (75 * numSides) / 6,\n yRot = Math.PI / -2;\n\n var angle = 2 * Math.PI / numSides; // arbitrary\n\n var panels = [];\n\n var rotation,\n position;\n\n roomRadius = radius;\n\n for (var i = 0; i < numSides; i++) {\n rotation = {\n x: 0,\n y: -angle * i + yRot,\n z: 0\n };\n\n position = {\n x: parseFloat((radius * Math.cos(angle * i)).toFixed(3)),\n y: (useVr) ? 15 : 10,\n z: parseFloat((radius * Math.sin(angle * i)).toFixed(3))\n };\n\n panels.push({rotation: rotation, position: position, file: 1, index: i});\n }\n return panels;\n }", "title": "" }, { "docid": "af4c9a432b136fd3b2316185e6a6188a", "score": "0.5124014", "text": "function get_visible_part() {\n \n \n var mb = $map[0].getBoundingClientRect(),\n min_margin = 20;\n \n if ($area.length === 0) {\n return [\n [mb.width, mb.height],\n [min_margin,min_margin,min_margin,min_margin]\n ];\n }\n \n var ab = $area[0].getBoundingClientRect(),\n sides = [\n [ [mb.left, mb.top], [mb.right, ab.top] ], // top\n [ [ab.right, mb.top], [mb.right, mb.bottom] ], // right\n [ [mb.left, ab.bottom], [mb.right, mb.bottom] ], // bottom\n [ [mb.left, mb.top], [ab.left, mb.bottom] ] // left\n ],\n square = function(coords) {\n return (coords[1][0] - coords[0][0]) * (coords[1][1] - coords[0][1]);\n },\n side = sides.sort( function(a, b) {\n return square(b) - square(a);\n })[0],\n tl = side[0], // [x, y]\n br = side[1],\n size = [\n mb.width,\n mb.height\n //br[0] - tl[0],\n //br[1] - tl[1]\n ],\n margin = [\n tl[1] - mb.top,\n mb.right - br[0],\n mb.bottom - br[1],\n tl[0] - mb.left\n ].map( function(v) {\n return Math.round(Math.max(v, min_margin));\n }),\n res = [size, margin];\n \n return res;\n }", "title": "" }, { "docid": "84ae009a1998647e53da4e76634f1d4e", "score": "0.5056599", "text": "getDistancia() {\n this.distancia = [...this.sections].map((section) => {\n const offset = section.offsetTop;\n return {\n element: section,\n offset: Math.floor(offset - this.windowPedaco),\n };\n });\n }", "title": "" }, { "docid": "d1fe262f6d7b54ae3486f18ff866d05f", "score": "0.49954426", "text": "function setPaneDimensions() {\n\t\t\t pane_width = element[0].offsetWidth;\n\t\t\t angular.forEach(panes, function (pane) {\n\t\t\t angular.element(pane).css({width : pane_width + 'px'});\n\t\t\t });\n\t\t\t angular.element(container).css({width : pane_width * pane_count + 'px'});\n\t\t\t }", "title": "" }, { "docid": "d461d5a7951bc9f1a0828b868023e59a", "score": "0.49843606", "text": "get viewport() {\n const v = this.v;\n return {\n scale: v[0],\n pan: new OpenSeadragon.Point(v[1], v[2])\n };\n }", "title": "" }, { "docid": "d461d5a7951bc9f1a0828b868023e59a", "score": "0.49843606", "text": "get viewport() {\n const v = this.v;\n return {\n scale: v[0],\n pan: new OpenSeadragon.Point(v[1], v[2])\n };\n }", "title": "" }, { "docid": "03db7d78e33e80c787941612739d2b61", "score": "0.49601603", "text": "function hideallpanes() {\n document.getElementById(\"film-pane\").style.display = \"none\";\n document.getElementById(\"actor-pane\").style.display = \"none\";\n document.getElementById(\"director-pane\").style.display = \"none\";\n document.getElementById(\"error\").innerHTML = \"\";\n\n }", "title": "" }, { "docid": "c40b5295331d76684abce031488a7038", "score": "0.49570352", "text": "function getSlidesToAnimate() {\n var slides;\n var body = document.body;\n\n if(body.classList.contains('tweak-project-slide-transition')){\n if(\n // if both portrait and landscape captions are set to offset\n document.body.classList.contains('project-image-portrait-caption-style-offset')\n && document.body.classList.contains('project-image-landscape-caption-style-offset')\n ) {\n slides = Array.prototype.map.call(document.querySelectorAll('.project-slide-image-container, .project-slide-description-wrapper, .project-slide-video-wrapper'), function(slide){\n return slide;\n });\n // if just the portrait captions are offset\n } else if(document.body.classList.contains('project-image-portrait-caption-style-offset')) {\n slides = Array.prototype.map.call(document.querySelectorAll('.project-slide-portrait .project-slide-image-container, .project-slide-portrait .project-slide-description-wrapper, .project-slide-square .project-slide-image-container, .project-slide-square .project-slide-description-wrapper, .project-slide-landscape, .project-slide-video'), function(slide){\n return slide;\n });\n console.log(slides);\n // if just the landscape captions are offset\n } else if(document.body.classList.contains('project-image-landscape-caption-style-offset')) {\n slides = Array.prototype.map.call(document.querySelectorAll('.project-slide-landscape .project-slide-image-container, .project-slide-landscape .project-slide-description-wrapper, .project-slide-portrait, .project-slide-square, .project-slide-video .project-slide-video-wrapper, .project-slide-video .project-slide-description-wrapper'), function(slide){\n return slide;\n });\n // all slides\n } else {\n slides = Array.prototype.map.call(document.querySelectorAll('.project-slide'), function(slide){\n return slide;\n });\n }\n } else {\n slides = Array.prototype.map.call(document.querySelectorAll('.project-slide'), function(slide){\n return slide;\n });\n }\n\n return slides;\n }", "title": "" }, { "docid": "df831be8fbd61c119c875cfefd6792e1", "score": "0.49413675", "text": "prepareLayout() {\n const { maxPages, currentPage } = this.props;\n let layout = [];\n\n // NOTE: If pages total is 5 or less display all:\n if (maxPages <= 10) {\n for (let i = 1; i <= maxPages; i++) {\n layout.push(i);\n }\n }\n\n // NOTE: Ellipses in the second to last position\n if (maxPages > 10 && currentPage < 6) {\n layout = [1, 2, 3, 4, 5, 6, false, maxPages];\n }\n\n // NOTE: Two ellipses in second and second to last positions\n if (maxPages > 10 && currentPage >= 6 && currentPage < maxPages) {\n layout = [\n 1,\n false,\n currentPage - 2,\n currentPage - 1,\n currentPage,\n currentPage + 1,\n currentPage + 2,\n false,\n maxPages,\n ];\n }\n\n // NOTE: Ellipses in the second position\n if (maxPages > 10 && currentPage >= maxPages - 4) {\n layout = [1, false, maxPages - 5, maxPages - 4, maxPages - 3,\n maxPages - 2, maxPages - 1, maxPages];\n }\n\n return layout;\n }", "title": "" }, { "docid": "93aa302b5d4551d60a2af3b1607d1764", "score": "0.49268344", "text": "function mostrarPadres(){\n\tvar i;\n\tfor(i=0;i<this.cantPadres;i++){\n\t\tdocument.write('padre['+i+']: '+this.padres[i].nombre+' - '+this.padres[i].cantHijos+'<br>');\n\t\tthis.padres[i].mostrarHijos();\n\t}\n}", "title": "" }, { "docid": "e7596a3133b078ac15278777f8760357", "score": "0.4920251", "text": "function initPanes() {\n\t$(\".slider-pane\").each(function(i,e) {\t\t\t\t\t\t\n\t\te.setAttribute(\"data-shown\", \"false\");\t\n\t});\n}", "title": "" }, { "docid": "959ae501e055aecbf0f1d109b7eb886a", "score": "0.48936903", "text": "function setPaneDimensions() {\n pane_width = element.width();\n panes.each(function() {\n $(this).width(pane_width);\n });\n container.width(pane_width*pane_count);\n }", "title": "" }, { "docid": "2325d9c82a1cd4e322ec9f760032a0ec", "score": "0.48637274", "text": "static get Positions() {\n return {\n TOP: 1,\n BOTTOM: -1,\n };\n }", "title": "" }, { "docid": "e2cc8896f52acc2c96ed66b4f31e2f59", "score": "0.48535278", "text": "display(params) {\n\n ui_api.hasParam(params, Object.keys(this.structs.view) );\n \n let ret = [];\n\n params.x.forEach( x => {\n ret.push({\n new: \"line\",\n id : `${this.class}-marker`,\n class: params.marker_type, \n x1: x,\n x2: x,\n y1: params.y - height / 2,\n y2: params.y + height / 2\n })\n })\n\n return ret;\n }", "title": "" }, { "docid": "fb81f2f91a7d67b61a7e87d900969850", "score": "0.48504627", "text": "passagePositions() {\n\t\t\treturn this.$refs.passages.reduce(\n\t\t\t\t(result, passageView) => {\n\t\t\t\t\tresult[passageView.passage.name] = passageView.linkPosition;\n\t\t\t\t\treturn result;\n\t\t\t\t},\n\n\t\t\t\t{}\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "83b2840bc98f66db8c7ca44de0c0f2a4", "score": "0.48397616", "text": "get lens_subgroups() {\n const { subpath_map, rendered_map, lens_group } = this;\n const group = this.lens_group;\n if (group === null) return [];\n const out = to_subgroups(subpath_map, rendered_map, lens_group, false);\n return out.map(sub => ({ ...sub, Lens: true }));\n }", "title": "" }, { "docid": "9941792fbf0d548acb49f38000fb0abd", "score": "0.48341796", "text": "offsets() {\n return { y: visualViewport.pageTop, x: visualViewport.pageLeft };\n }", "title": "" }, { "docid": "dc3498bac44d46657587b05adb4ac242", "score": "0.48339447", "text": "function slicepara(p){\n let ptoarray=p.split(\" \"); //paragraph to array convertions total 80 words\n let aa=ptoarray.slice(0,20); //\n let bb=ptoarray.slice(20,40);\n let cc=ptoarray.slice(40,60);\n let dd=ptoarray.slice(60,80);\n let paraarray=[aa,bb,cc,dd];\n showpara(paraarray);\n \n}", "title": "" }, { "docid": "a9168fad4847cd0e6a8475cd8b777f76", "score": "0.4820936", "text": "function PatrolSet() \n{\n this.mSet = [];\n this.mShowBounds = false;\n}", "title": "" }, { "docid": "f6659493dd5e7b4260910b285255ab32", "score": "0.479977", "text": "function determineOffsets() {\n Math.mode = function() {\n var ary, i, max, mode, str;\n ary = Array.prototype.slice.call(arguments);\n max = 0;\n mode = [];\n str = ary.sort();\n str = \"~\" + str.join('~~') + \"~\"\n str.replace(/(~\\-?\\d+~)\\1*/g, function(a, b) {\n var m = a.length / b.length;\n if (max <= m) {\n if (max < m) {\n mode = [];\n max = m;\n }\n mode.push(+b.replace(/~/g, \"\"));\n }\n });\n return mode;\n }\n\n offsetArray = [];\n offsetList = {};\n $('body > div > p').filter(function() {\n if (offsetList[this.className] == null) {\n offsetList[this.className] = [];\n }\n offsetList[this.className].push(this.offsetLeft)\n offsetArray.push(this.className);\n });\n\n offsetMode = {};\n for (className in offsetList) {\n offsetMode[className] = Math.mode.apply(null, offsetList[className])[0];\n };\n\n for (var i = 0, len = offsetArray.length; i < len; i++) {\n console.log(\"e(\" + offsetMode[offsetArray[i]] + \",\" + offsetArray[i] + \");\");\n }\n\n\n }", "title": "" }, { "docid": "257fd01790bf6720be992aebb2a6c744", "score": "0.47978923", "text": "get allOverlays() {\n return this.stories.reduce((all, story, s) => {\n return all.concat(story.Waypoints.reduce((idx, _, w) => {\n const w_overlays = this.stories[s].Waypoints[w].Overlays || [];\n const w_idx = w_overlays.map((_, o) => { \n return ['waypoint-overlay', s, w, o];\n }).concat([['user-overlay', s, w, 0]]);\n return idx.concat(w_idx);\n }, []));\n }, []);\n }", "title": "" }, { "docid": "257fd01790bf6720be992aebb2a6c744", "score": "0.47978923", "text": "get allOverlays() {\n return this.stories.reduce((all, story, s) => {\n return all.concat(story.Waypoints.reduce((idx, _, w) => {\n const w_overlays = this.stories[s].Waypoints[w].Overlays || [];\n const w_idx = w_overlays.map((_, o) => { \n return ['waypoint-overlay', s, w, o];\n }).concat([['user-overlay', s, w, 0]]);\n return idx.concat(w_idx);\n }, []));\n }, []);\n }", "title": "" }, { "docid": "776b9255eae99ccd59e6c67a302de512", "score": "0.47974497", "text": "function grid_layout_mixer(sets){\n const total = sets.length, res = [];\n for(let i = 0; i<total; i++){\n if( i%4 != 3 ){\n const tem = [sets[i]];\n if( i%4 == 2 && (total > (i+1))){\n tem.push(sets[i+1]);\n }\n res.push(tem);\n }\n }\n return res;\n}", "title": "" }, { "docid": "4ecb48c09f76dc3622fa7c208c1210bd", "score": "0.47901696", "text": "get pan() {\n var pan = {\n x: -this.paper.view.center.x,\n y: -this.paper.view.center.y\n };\n\n if (this.model.focus.isRoot) {\n pan.x += this.model.width / 2;\n pan.y += this.model.height / 2;\n }\n\n return pan;\n }", "title": "" }, { "docid": "d59bc0cb1a804698c0bb9df715163a18", "score": "0.47844636", "text": "static sides(rect) {\n let [p0, p1, p2, p3] = Rectangle.corners(rect);\n return [\n new Pt_1.Group(p0, p1), new Pt_1.Group(p1, p2),\n new Pt_1.Group(p2, p3), new Pt_1.Group(p3, p0)\n ];\n }", "title": "" }, { "docid": "7663308bd67176153b3850eb082ffa29", "score": "0.4778529", "text": "function tratarDadosMedalhas(arrayPaises){\n let paisesOrdenados = ordenarPaises(arrayPaises)\n for(let i = 0; i<paisesOrdenados.length; i++){\n let pais = paisesOrdenados[i]\n \n criarTemplateLinha(\n i+1,\n pais.country,\n pais.flag_url,\n pais.medal_gold,\n pais.medal_silver,\n pais.medal_bronze,\n )\n }\n \n}", "title": "" }, { "docid": "aa587b0b6cb0fe65ad409f005b52403e", "score": "0.47664478", "text": "getSectionsRes() {\r\n\t\treturn [\r\n\t\t\t\"How to Smoke\",\r\n\t\t\t\"Decriminalization\",\r\n\t\t\t\"History\",\r\n\t\t\t\"Medicinal Uses\",\r\n\t\t\t\"Recipes\",\r\n\t\t];\r\n\t}", "title": "" }, { "docid": "7b87890eff3cf468a1c22ee36a9d9a91", "score": "0.47642297", "text": "function parsePanoramaArray(panoArray){\n trimNull(panoArray);\n getAllHeadings(panoArray);\n markerArray = getAllMarkers(panoArray);\n var htmlArray = getAllStreetViewHTML(panoArray);\n displayHTML(htmlArray);\n }", "title": "" }, { "docid": "84a016a4ed691ae94a6a8828e26dfacd", "score": "0.47601706", "text": "function buildAnnotationPane(annotations){\n var contents = \"\";\n\n //if a single annotation is passed in, put it in an array\n if (!_.isArray(annotations)) {\n annotations = [annotations];\n }\n\n for(var i = 0; i < annotations.length; i++){\n contents += buildAnnotationContents(annotations[i]);\n }\n\n return contents;\n }", "title": "" }, { "docid": "5fbd9f5076b2db0131ba99eab98b649e", "score": "0.4750937", "text": "function setPaneDimensions() {\n paneWidth = $el.width();\n \n _.map($panes, function (pane) {\n $(pane).width(paneWidth);\n });\n \n $container.width(paneWidth*paneCount);\n }", "title": "" }, { "docid": "d25ea71f03a398d9cd245fc4d8831494", "score": "0.4749342", "text": "function DisplayMultipleMonadObject(mmo, objType, level, monadSet, monadix, hasPredecessor, hasSuccessor) {\n _super.call(this, mmo, objType, level);\n if (arguments.length == 7) {\n // Non-patriarch\n this.isPatriarch = false;\n this.range = monadSet;\n this.mix = monadix;\n this.children = [];\n this.hasPredecessor = hasPredecessor;\n this.hasSuccessor = hasSuccessor;\n this.borderTitle = getObjectFriendlyName(objType);\n this.myColors = DisplayMultipleMonadObject.frameColors[(level - 1) % DisplayMultipleMonadObject.frameColors.length];\n }\n else {\n // Patriarch\n this.isPatriarch = true;\n this.range = { low: monadSet.segments[0].low, high: monadSet.segments[monadSet.segments.length - 1].high };\n this.mix = 0;\n this.children = [];\n this.hasPredecessor = false;\n this.hasSuccessor = false;\n }\n }", "title": "" }, { "docid": "6bb96c7b43dc53d0124d19d4c3eef7c6", "score": "0.47348794", "text": "function mirarInfo(clikeado, tipo, controlado) {\n let posicion = \"\";\n if (orientacion == \"landscape-primary\") {\n posicion = \"show\";\n } else {\n posicion = \"hide\";\n }\n if (nameclass.includes(clikeado)) {\n $(cont).collapse(posicion);\n $(tipo).collapse(\"show\");\n $(juegos).collapse(\"show\");\n $(controlado).collapse(\"show\");\n }\n}", "title": "" }, { "docid": "4c5abd22d1e171a105d52768ee92f43b", "score": "0.47188026", "text": "function viewPillarOutlines(){\n\t\tif(view.zoom === 'far' || view.height ==='plan'){ //none\n\t\t\tfor(var i = 0; i<4; i++) {highlight(i, 0, 300)}\n\t\t}\n\t\telse if(view.zoom==='normal'){ //all\n\t\t\tfor(var i = 0; i<4; i++) {highlight(i, 1, 300)}\n\t\t}\n\t\telse if(view.zoom==='close'){ //one\n\t\t\tfor(var i = 0; i<4; i++){ if(i!==facing) highlight(i, 0, 300)}\n\t\t\thighlight(facing,1,300)\n\t\t}\n\t\tfunction highlight(which, opacity, dur, delay){\n\t\t\tanim3d(seseme['plr'+which].outline, 'opacity', { 'opacity': opacity, spd: dur, delay: delay})\n\t\t\tanim3d(seseme['plr'+which].outcap, 'opacity', { 'opacity': opacity, spd: dur, delay: delay})\n\t\t}\n\t}", "title": "" }, { "docid": "375cf7de8cb13e4735ee49c00190a5c4", "score": "0.47133422", "text": "function getMonstrePosition(i) {\r\n var tds = x_monstres[i].childNodes;\r\n var j = tds.length;\r\n return new Array(tds[j - 3].firstChild.nodeValue, tds[j - 2].firstChild.nodeValue, tds[j - 1].firstChild.nodeValue);\r\n}", "title": "" }, { "docid": "7ef35d807a80b69664a664ad554c6586", "score": "0.47074014", "text": "function varis(){ \r\n $antmed=[];\r\n $antsic=[];\r\n $antodo=[];\r\n $asfige=[];\r\n $diaext=[];\r\n $diaint=[];\r\n $diaocl=[];\r\n $platra=[];\r\n $anoden=[];\r\n $diarad=[];\r\n if ($iden==1) {\r\n $can=$selected.length;\r\n if ($can>0) {\r\n for ($j = 0; $j < $can; $j++) {\r\n $res = $selected[$j].substring(0, 4);\r\n if ($res=='emba') {\r\n $k=0;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='hema') {\r\n $k=1;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='sire') {\r\n $k=2;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='siin') {\r\n $k=3;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='vaap') {\r\n $k=4;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='poli') {\r\n $k=5;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='dptt') {\r\n $k=6;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='genu') {\r\n $k=7;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='neur') {\r\n $k=8;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='enme') {\r\n $k=9;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='gast') {\r\n $k=10;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='orse') {\r\n $k=11;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='catu') {\r\n $k=12;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='aler') {\r\n $k=13;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='otan') {\r\n $k=14;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antmed[$k]==null) {\r\n $antmed[$k]=$dato;\r\n }else{\r\n $antmed[$k]=$antmed[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='coge') {\r\n $k=0;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='esco') {\r\n $k=1;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='rend') {\r\n $k=2;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='trme') {\r\n $k=3;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='trod') {\r\n $k=4;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antsic[$k]==null) {\r\n $antsic[$k]=$dato;\r\n }else{\r\n $antsic[$k]=$antsic[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='tran') {\r\n $k=0;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='hahi') {\r\n $k=1;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='hanu') {\r\n $k=2;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='haca') {\r\n $k=3;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='hade') {\r\n $k=4;\r\n $lon=$selected[$j].length;\r\n $dato = $selected[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected[$j].substring($lon-1, $lon);\r\n if ($antodo[$k]==null) {\r\n $antodo[$k]=$dato;\r\n }else{\r\n $antodo[$k]=$antodo[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n };\r\n for ($i = 0; $i <= 14; $i++) {\r\n if ($antmed[$i]==null) {\r\n $antmed[$i]=\"\";\r\n // console.log('el valor de antmed en '+$i+' es: '+$antmed[$i]);\r\n }\r\n };\r\n for ($i = 0; $i <= 4; $i++) {\r\n if ($antsic[$i]==null) {\r\n $antsic[$i]=\"\";\r\n // console.log('el valor de antsic en '+$i+' es: '+$antsic[$i]);\r\n }\r\n };\r\n for ($i = 0; $i <= 4; $i++) {\r\n if ($antodo[$i]==null) {\r\n $antodo[$i]=\"\";\r\n // console.log('el valor de antodo en '+$i+' es: '+$antodo[$i]);\r\n }\r\n };\r\n // localStorage['antmed']=$antmed;\r\n localStorage.setItem('antmed', JSON.stringify($antmed));\r\n // localStorage['antsic']=$antsic;\r\n localStorage.setItem('antsic', JSON.stringify($antsic));\r\n // localStorage['antodo']=$antodo;\r\n localStorage.setItem('antodo', JSON.stringify($antodo));\r\n };\r\n };\r\n if ($iden==2) {\r\n $can2=$selected2.length;\r\n if ($can2>0) {\r\n for ($j = 0; $j < $can2; $j++) {\r\n $res2 = $selected2[$j].substring(0, 4);\r\n if ($res2=='asfi') {\r\n $k=0;\r\n $lon=$selected2[$j].length;\r\n $dato = $selected2[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($asfige[$k]==null) {\r\n $asfige[$k]=$dato;\r\n }else{\r\n $asfige[$k]=$asfige[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected2[$j].substring($lon-1, $lon);\r\n if ($asfige[$k]==null) {\r\n $asfige[$k]=$dato;\r\n }else{\r\n $asfige[$k]=$asfige[$k]+'-'+$dato;\r\n }\r\n }\r\n }; \r\n };\r\n for ($i = 0; $i <= 0; $i++) {\r\n if ($asfige[$i]==null) {\r\n $asfige[$i]=\"\";\r\n // console.log('el valor de asfige en '+$i+' es: '+$asfige[$i]);\r\n }\r\n };\r\n // localStorage['asfige']=$asfige;\r\n localStorage.setItem('asfige', JSON.stringify($asfige));\r\n };\r\n };\r\n if ($iden==34) {\r\n $can3=$selected3.length;\r\n if ($can3>0) {\r\n // console.log('si continua a imprimir el arreglo 3')\r\n for ($j = 0; $j < $can3; $j++) {\r\n $res3 = $selected3[$j].substring(0, 4);\r\n // console.log('impresion de identificacion '+$res3)\r\n\r\n if ($res3=='exfr') {\r\n $k=0;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='exna') {\r\n $k=1;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='exla') {\r\n $k=2;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='exat') {\r\n $k=3;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='expe') {\r\n $k=4;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='exad') {\r\n $k=5;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaext[$k]==null) {\r\n $diaext[$k]=$dato;\r\n }else{\r\n $diaext[$k]=$diaext[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n\r\n if ($res3=='inor') {\r\n $k=0;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='inpa') {\r\n $k=1;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='inle') {\r\n $k=2;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='inmu') {\r\n $k=3;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='inpb') {\r\n $k=4;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='inec') {\r\n $k=5;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaint[$k]==null) {\r\n $diaint[$k]=$dato;\r\n }else{\r\n $diaint[$k]=$diaint[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n \r\n if ($res3=='rmpt') {\r\n $k=0;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rmem') {\r\n $k=1;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rmed') {\r\n $k=2;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='pcla') {\r\n $k=3;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='pclb') {\r\n $k=4;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='pcba') {\r\n $k=5;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='pcbb') {\r\n $k=6;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='pclc') {\r\n $k=7;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rmca') {\r\n $k=8;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rmcb') {\r\n $k=9;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rmcc') {\r\n $k=10;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='aple') {\r\n $k=11;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='apmo') {\r\n $k=12;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='apse') {\r\n $k=13;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='somo') {\r\n $k=14;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rtls') {\r\n $k=15;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rtli') {\r\n $k=16;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res3=='rtmc') {\r\n $k=17;\r\n $lon=$selected3[$j].length;\r\n $dato = $selected3[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected3[$j].substring($lon-1, $lon);\r\n if ($diaocl[$k]==null) {\r\n $diaocl[$k]=$dato;\r\n }else{\r\n $diaocl[$k]=$diaocl[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n };\r\n for ($i = 0; $i <= 5; $i++) {\r\n if ($diaext[$i]==null) {\r\n $diaext[$i]=\"\";\r\n // console.log('el valor de diaext en '+$i+' es: '+$diaext[$i]);\r\n }\r\n };\r\n for ($i = 0; $i <= 5; $i++) {\r\n if ($diaint[$i]==null) {\r\n $diaint[$i]=\"\";\r\n // console.log('el valor de diaint en '+$i+' es: '+$diaint[$i]);\r\n }\r\n };\r\n for ($i = 0; $i <= 17; $i++) {\r\n if ($diaocl[$i]==null) {\r\n $diaocl[$i]=\"\";\r\n // console.log('el valor de diaocl en '+$i+' es: '+$diaocl[$i]);\r\n }\r\n };\r\n // localStorage['diaext']=$diaext;\r\n localStorage.setItem('diaext', JSON.stringify($diaext));\r\n // localStorage['diaint']=$diaint;\r\n localStorage.setItem('diaint', JSON.stringify($diaint));\r\n // localStorage['diaocl']=$diaocl;\r\n localStorage.setItem('diaocl', JSON.stringify($diaocl));\r\n };\r\n // };\r\n // if ($iden==33) {\r\n $can33=$selected33.length;\r\n if ($can33>0) {\r\n // console.log('si continua a imprimir el arreglo 3')\r\n for ($j = 0; $j < $can33; $j++) {\r\n // console.log('tiene =>'+$selected33[$j])\r\n $res33 = $selected33[$j].substring(0, 4);\r\n // console.log('impresion de identificacion '+$res3)\r\n\r\n if ($res33=='estr') {\r\n $k=0;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n } \r\n };\r\n if ($res33=='posi') {\r\n $k=1;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n } \r\n };\r\n if ($res33=='nume') {\r\n $k=2;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n } \r\n };\r\n if ($res33=='tafo') {\r\n $k=3;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n } \r\n };\r\n if ($res33=='erup') {\r\n $k=4;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n }\r\n };\r\n if ($res33=='colo') {\r\n $k=5;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n }\r\n };\r\n if ($res33=='pulp') {\r\n $k=6;\r\n $lon=$selected33[$j].length;\r\n $dato = $selected33[$j].substring(4, $lon); \r\n if ($anoden[$k]==null) {\r\n $anoden[$k]=$dato;\r\n }else{\r\n $anoden[$k]=$anoden[$k]+'-'+$dato;\r\n }\r\n };\r\n };\r\n for ($i = 0; $i <= 6; $i++) {\r\n if ($anoden[$i]==null) {\r\n $anoden[$i]=\"\";\r\n // console.log('el valor de anoden en '+$i+' es: '+$anoden[$i]);\r\n }\r\n };\r\n // localStorage['anoden']=$anoden;\r\n localStorage.setItem('anoden', JSON.stringify($anoden));\r\n };\r\n // };\r\n // if ($iden==34) {\r\n $can34=$selected34.length;\r\n if ($can34>0) {\r\n $k=0;\r\n for ($j = 0; $j < $can34; $j++) {\r\n if ($diarad[$k]==null) {\r\n $diarad[$k]=$selected34[$j];\r\n }else{\r\n $diarad[$k]=$diarad[$k]+'-'+$selected34[$j];\r\n }\r\n // console.log('en este arreglo se immprime diarad'+$j+'='+$diarad[$j]) \r\n };\r\n for ($i = 0; $i <= 0; $i++) {\r\n if ($diarad[$i]==null) {\r\n $diarad[$i]=\"\";\r\n // console.log('el valor de diarad en '+$i+' es: '+$diarad[$i]);\r\n }\r\n };\r\n // localStorage['diarad']=$diarad;\r\n localStorage.setItem('diarad', JSON.stringify($diarad));\r\n };\r\n };\r\n if ($iden==4) {\r\n $can=$selected4.length;\r\n if ($can>0) {\r\n for ($j = 0; $j < $can; $j++) {\r\n $res = $selected4[$j].substring(0, 4);\r\n if ($res=='pltr') {\r\n $k=0;\r\n $lon=$selected4[$j].length;\r\n $dato = $selected4[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($platra[$k]==null) {\r\n $platra[$k]=$dato;\r\n }else{\r\n $platra[$k]=$platra[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected4[$j].substring($lon-1, $lon);\r\n if ($platra[$k]==null) {\r\n $platra[$k]=$dato;\r\n }else{\r\n $platra[$k]=$platra[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='remi') {\r\n $k=1;\r\n $lon=$selected4[$j].length;\r\n $dato = $selected4[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($platra[$k]==null) {\r\n $platra[$k]=$dato;\r\n }else{\r\n $platra[$k]=$platra[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected4[$j].substring($lon-1, $lon);\r\n if ($platra[$k]==null) {\r\n $platra[$k]=$dato;\r\n }else{\r\n $platra[$k]=$platra[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n if ($res=='ppod') {\r\n $k=2;\r\n $lon=$selected4[$j].length;\r\n $dato = $selected4[$j].substring($lon-2, $lon);\r\n if ($dato>0) {\r\n if ($platra[$k]==null) {\r\n $platra[$k]=$dato;\r\n }else{\r\n $platra[$k]=$platra[$k]+'-'+$dato;\r\n }\r\n }else{\r\n $dato = $selected4[$j].substring($lon-1, $lon);\r\n if ($platra[$k]==null) {\r\n $platra[$k]=$dato;\r\n }else{\r\n $platra[$k]=$platra[$k]+'-'+$dato;\r\n }\r\n }\r\n };\r\n };\r\n for ($i = 0; $i <= 2; $i++) {\r\n if ($platra[$i]==null) {\r\n $platra[$i]=\"\";\r\n // console.log('el valor de platra en '+$i+' es: '+$platra[$i]);\r\n }\r\n };\r\n // localStorage['platra']=$platra;\r\n localStorage.setItem('platra', JSON.stringify($platra));\r\n };\r\n guardar();\r\n };\r\n\r\n}", "title": "" }, { "docid": "2092ce9a8f2f8f3e7b7b4f95f3e94ffa", "score": "0.4662518", "text": "function getVariables() {\n vw = getViewWidth();\n items = getItems();\n indexMax = slideCountNew - items - indexAdjust;\n\n if (axis === 'horizontal' && !fixedWidth) { slideWidth = getSlideWidth(); }\n navCountVisible = getVisibleNavCount();\n slideBy = getSlideBy();\n }", "title": "" }, { "docid": "e6c62d5051088b49c12a8cdd48114a05", "score": "0.4662061", "text": "comprobarGanador(){\n var numEspacios=0;\n for (let i = 0; i < 9; i++) {\n if (this.mapa[i] == 0)\n numEspacios++;\n }\n // Las líneas horizontales\n if (this.mapa[0] == this.mapa[1] && this.mapa[1] == this.mapa[2] && this.mapa[0] != 0) return this.mapa[0];\n if (this.mapa[3] == this.mapa[4] && this.mapa[4] == this.mapa[5] && this.mapa[3] != 0) return this.mapa[3];\n if (this.mapa[6] == this.mapa[7] && this.mapa[7] == this.mapa[8] && this.mapa[6] != 0) return this.mapa[6];\n //Las líneas verticales\n if (this.mapa[0] == this.mapa[3] && this.mapa[3] == this.mapa[6] && this.mapa[0] != 0) return this.mapa[0];\n if (this.mapa[1] == this.mapa[4] && this.mapa[4] == this.mapa[7] && this.mapa[1] != 0) return this.mapa[1];\n if (this.mapa[2] == this.mapa[5] && this.mapa[5] == this.mapa[8] && this.mapa[2] != 0) return this.mapa[2];\n //Las diagonales\n if (this.mapa[0] == this.mapa[4] && this.mapa[4] == this.mapa[8] && this.mapa[0] != 0) return this.mapa[0];\n if (this.mapa[2] == this.mapa[4] && this.mapa[4] == this.mapa[6] && this.mapa[2] != 0) return this.mapa[2];\n if (numEspacios > 0) {\n return 0;\n } else {\n return 3;\n }\n\n }", "title": "" }, { "docid": "a6d1f39be6cb871ae752b3e9ef8254f4", "score": "0.46521974", "text": "displaySections() {\n Array.from(this.sections.values()).forEach(section => {\n console.log(section.name);\n });\n }", "title": "" }, { "docid": "59125c45148937aa4b522317adc200bf", "score": "0.46329576", "text": "get swimLanes() {}", "title": "" }, { "docid": "69d28c7d5fb6406c92b9e7a111625a08", "score": "0.46286207", "text": "getZones() {\n const annotations = this._annotationLayer.getAnnotations()\n const zones = []\n for( const annotation of annotations ) {\n const zone = annotationToZone(annotation.underlying)\n zones.push(zone)\n }\n return zones\n }", "title": "" }, { "docid": "59cfbf20585f7a2ae9a5d38f252f8c56", "score": "0.46236905", "text": "getSelections() {\n return this.viewer.currentOverlays.map((overlay) => {\n if (overlay.element.className === 'selection-overlay') {\n return this.overlayToImageRect(overlay);\n }\n });\n }", "title": "" }, { "docid": "5d7be8758a0dcf3115cfd7ce4ae5b703", "score": "0.4621823", "text": "function at_manor()\r\n{\tif (document.body.textContent.length == 0)\r\n\t\tparent.mainpane.location = '/town_right.php';\r\n\telse if (GetPref('zonespoil') == 1)\r\n\t{\r\n\t\t$('img').each(function()\r\n\t\t{\tvar img = $(this);\r\n\t\t\tvar src = img.attr('src');\r\n\t\t\tif (src.indexOf(\"sm1.gif\") != -1)\r\n\t\t\t\timg.attr('title','ML: 105-115');\r\n\t\t\telse if (src.indexOf(\"sm4.gif\") != -1)\r\n\t\t\t\timg.attr('title','ML: 20');\r\n\t\t\telse if (src.indexOf(\"sm3.gif\") != -1)\r\n\t\t\t\timg.attr('title','ML: 8-9');\r\n\t\t\telse if (src.indexOf(\"sm6.gif\") != -1)\r\n\t\t\t\timg.attr('title','ML: 13-14');\r\n\t\t\telse if (src.indexOf(\"sm7.gif\") != -1)\r\n\t\t\t\timg.attr('title','ML: 49-57');\r\n\t\t\telse if (src.indexOf(\"sm9.gif\") != -1)\r\n\t\t\t\timg.attr('title','ML: 1');\r\n\t\t});\r\n}\t}", "title": "" }, { "docid": "24c3b7ed89be1f0169a9c6dcbaf69e94", "score": "0.4615988", "text": "function slidePanes(){\n\n\t\t// Decide where pane2 should end up\n\t\tvar leftOffset = $('#pane2').offset().left - $('#pane1').offset().left;\n\t\tvar delay = 200;\n\n\t\t// Fade off & remove pane3, starting with thumbnail\n\t\t$('#pane3 .thumbnail').css({\n\t\t\topacity: '0'\n\t\t});\n\n\t\t$('#pane3').animate({\n\t\t\topacity: '0'\n\t\t}, 300, function(){\n\t\t\t$('#pane3').remove();\n\t\t});\n\n\t\t// Move pane1 over to become new pane2\n\t\t$('#pane1').delay(delay+200).animate({\n\t\t\t'margin-left': '+=' + leftOffset + 'px'\n\t\t}, 500, function(){\n\n\t\t\t// Reorganize divs as necessary\n\t\t\t$('#pane2').attr('id', 'pane3');\n\t\t\t$('#thumb2').attr('id', 'thumb3');\n\t\t\t$('#thumb2-placeholder').attr('id', 'thumb3-placeholder');\n\n\t\t\t$('#pane1').attr('id', 'pane2');\n\t\t\t$('#thumb1').attr('id', 'thumb2');\n\t\t\t$('#thumb1-placeholder').attr('id', 'thumb2-placeholder');\n\n\t\t\t// Add new pane\n\t\t\taddNewPane();\n\n\t\t\t// Align margins\n\t\t\t$('#pane2').animate({\n\t\t\t\t'margin-left': '15px'\n\t\t\t}, 0);\n\n\t\t\t$('#pane3').animate({\n\t\t\t\t'margin-left': '15px'\n\t\t\t}, 0);\n\t\t});\n\t}", "title": "" }, { "docid": "0fca3c61e09c8468d2a07101efb43647", "score": "0.4614602", "text": "function horizontales(){\n\tvar tablero = tableroArr();\n for (var i = 0; i < 7; i++) {\n\t\tfor (var j = 0; j < 7; j++) {\n if (i > 2){\n var candy01 = tablero[i][j];\n \t\t\tvar candy02 = tablero[i-1][(j)];\n \t\t\tvar candy03 = tablero[i-2][(j)];\n \t\t\tvar a = $(candy01).attr(\"src\");\n \t\t\tvar b = $(candy02).attr(\"src\");\n \t\t\tvar c = $(candy03).attr(\"src\");\n \t\t\tif ((a == b) && (a == c)) {\n \t\t\t\tvar clr = [candy01, candy02, candy03];\n\t\t\t\t\th = true;\n\t\t\t\t\tpuntaje();\n \t\t\t\tcandyFade(clr);\n \t\t\t}\n }\n\t\t}\n\t}\n}", "title": "" }, { "docid": "33466e6b333a0e82857f367efc33c44e", "score": "0.46124762", "text": "getPengs() {\n return this.rawMelds.filter((m) => m.type === MeldTypes.peng);\n }", "title": "" }, { "docid": "7dd0fe8892b25bbb5f86f9174ca90590", "score": "0.46097833", "text": "get active_masks() {\n const masks = this.masks;\n return this.m.map(function(m) {\n return masks[m];\n }).filter(mask => mask != undefined);\n }", "title": "" }, { "docid": "7dd0fe8892b25bbb5f86f9174ca90590", "score": "0.46097833", "text": "get active_masks() {\n const masks = this.masks;\n return this.m.map(function(m) {\n return masks[m];\n }).filter(mask => mask != undefined);\n }", "title": "" }, { "docid": "32d0fe5e93e154070401d93874647264", "score": "0.4607463", "text": "layout() {\n const x = d3Hierarchy.treemap();\n x.ratio = _ => {\n const t = x.tile();\n if (t.ratio) x.tile(t.ratio(_));\n };\n x.method = _ => {\n if (vegaUtil.hasOwnProperty(Tiles, _)) x.tile(Tiles[_]); else vegaUtil.error('Unrecognized Treemap layout method: ' + _);\n };\n return x;\n }", "title": "" }, { "docid": "1941b3ec5e0504e7af7fd89fa1d83c91", "score": "0.4605193", "text": "get columnsToDisplay() {\n return this.columns.filter((c) => c.isHidden !== true).map((c) => c.binding);\n }", "title": "" }, { "docid": "b78a7b47dcc36d5997279dc82261352a", "score": "0.46025112", "text": "function printm(m)\n{\n if(m.length == 2)\n for(var i=0; i<m.length; i++)\n console.log(m[i][0], m[i][1]);\n else if(m.length == 3)\n for(var i=0; i<m.length; i++)\n console.log(m[i][0], m[i][1], m[i][2]);\n else if(m.length == 4)\n for(var i=0; i<m.length; i++)\n console.log(m[i][0], m[i][1], m[i][2], m[i][3]);\n}", "title": "" }, { "docid": "c67af130fe8f7e1efa1e1e4d874a4349", "score": "0.46020737", "text": "function getPorts(root) {\n var ports = [\n {\n id: \"port1\",\n shape: \"Circle\",\n offset: { x: 0, y: 0.5 },\n horizontalAlignment: \"Left\",\n verticalAlignment: \"Bottom\",\n margin: { right: -2, bottom: -5.5 }\n },\n {\n id: \"port2\",\n shape: \"Circle\",\n offset: { x: 1, y: 0.99 },\n horizontalAlignment: \"Right\",\n verticalAlignment: \"Bottom\",\n margin: { right: -2, bottom: -5.5 }\n }\n ];\n if (!root) {\n ports[0].offset.y = 1;\n }\n else {\n ports[0].verticalAlignment = \"Center\";\n ports[0].horizontalAlignment = \"Center\";\n }\n return ports;\n}", "title": "" }, { "docid": "5b30f7a9b65dfecd136572e9fe643d54", "score": "0.4598112", "text": "topo() {\n return this.pilha[-1];\n }", "title": "" }, { "docid": "7557ee46d4792d3658ee8dc43371dc89", "score": "0.45927575", "text": "getWords(tiles, orientation) {\n if (tiles.length === 1) {\n return [];\n }\n\n const words = [];\n const sortedTiles = this.sortTiles(tiles, orientation);\n const wordAlongOrientation = this.getWord(sortedTiles, orientation);\n words.push(wordAlongOrientation);\n\n const newOrientation = (orientation === 'horizontal') ? 'vertical' : 'horizontal';\n for (let tile of tiles) {\n let word = this.getWord([tile], newOrientation);\n if (word !== null) {\n words.push(word);\n }\n }\n return words\n }", "title": "" }, { "docid": "6959168581da81a24a68e9d4c138a89f", "score": "0.45838693", "text": "function mostrarMapa(posicion){\n\n let ubicacionFalla = [posicion[1], posicion[0]];\n \n crearDivMapa();\n \n let map = L.map('mapa').\n setView([ubicacionFalla[0], ubicacionFalla[1]],\n 14);\n\n\n L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors,' +\n '<a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"http://cloudmade.com\">CloudMade</a>',\n maxZoom: 18\n }).addTo(map);\n\n L.marker([ubicacionFalla[0], ubicacionFalla[1]]).addTo(map);\n\n L.control.scale().addTo(map);\n\n \n}", "title": "" }, { "docid": "587bb3860c7e0dcc57000ba0f8f713e4", "score": "0.45806578", "text": "function setPaneW() { paneW = $element[0].offsetWidth; }", "title": "" }, { "docid": "52aa982f9e0b7e2d60eaf8099f029fcd", "score": "0.4580396", "text": "function getCustomPanorama(pano) {\n if (pano === \"reception\") {\n return {\n location: {\n pano: \"reception\",\n description: \"Google Sydney - Reception\"\n },\n links: [],\n // The text for the copyright control.\n copyright: \"Imagery (c) 2010 Google\",\n // The definition of the tiles for this panorama.\n tiles: {\n tileSize: new google.maps.Size(1024, 512),\n worldSize: new google.maps.Size(2048, 1024),\n // The heading in degrees at the origin of the panorama\n // tile set.\n centerHeading: 105,\n getTileUrl: getCustomPanoramaTileUrl\n }\n };\n }\n }", "title": "" }, { "docid": "c9b61f6e3d66705e4ba097c11b3ea858", "score": "0.45798752", "text": "function newLevel(){\n PLATFORMS= [{xpt: 0, ypt:300, xl: 600, yl: 200}];\n}", "title": "" }, { "docid": "99760a34191658bd1aeae86e5781f11b", "score": "0.4579173", "text": "function ObtenPosicion(jugadaHtal, jugadaVcal)\n{\n var x, y, fila, columna;\n var posicion = 0;\n matriz = new Array(3)\n for (x = 0; x < 3; x++) \n {\n matriz[x] = new Array(3)\n for (y = 0; y < 3; y++) \n\t {\n matriz[x][y] = posicion\n posicion ++\n }\n }\n for (x = 0; x < 3; x++) \n {\n for (y = 0; y < 3; y++)\n\t {\n if (matriz[x][y] == jugadaHtal)\n fila = x\n if (matriz[x][y] == jugadaVcal)\n columna = y\n }\n }\n return (matriz[fila][columna])\n}", "title": "" }, { "docid": "9e574c29bc93e5875210dbc7690800d3", "score": "0.45658737", "text": "listFloorsWithMap () {\n for(let i = 0; i < this.floorList.length; i++) {\n this.floorList[i].showMap();\n }\n }", "title": "" }, { "docid": "385bd6c285ae8d4926d119fae0d66011", "score": "0.45575953", "text": "function getSlidePosition(number, side){\nif(side == 'left'){\nvar position = $('.pager', $outerWrapper).eq(number).position().left;\n}else if(side == 'top'){\nvar position = $('.pager', $outerWrapper).eq(number).position().top;\n}\nreturn position;\n}", "title": "" }, { "docid": "825c951da9fc1c6cfda7ee1abd24c444", "score": "0.45568058", "text": "function visionGlobalPuntos (){\r\n\t\ta_a = Math.round (a_a*10)/10;\r\n\t\ta_d = Math.round (a_d*10)/10;\r\n\t\td_a = Math.round (d_a*10)/10;\r\n\t\td_d = Math.round (d_d*10)/10;\r\n\t\tr = Math.round (r*10)/10;\r\n\t\t\r\n\t\tvar tierra = false;\r\n\t\t\r\n\t\tif (pagina == \"barracks\"){\r\n\t\t\ttierra = true;\r\n\t\t}\r\n\r\n\t\tvar div = document.createElement (\"div\");\r\n\t\tdiv.id = \"puntosUnidades\";\r\n\t\tdiv.className = \"dynamic\";\r\n\t\t\r\n\t\tif (tierra){\r\n\t\t\tvar i = 4;\r\n\t\t}else{\r\n\t\t\tvar i = 5;\r\n\t\t}\r\n\t\t\r\n\t\tif (panelesScript[i] == \"1\"){\r\n\t\t\tvar abierto = true;\r\n\t\t\tvar imagen = Img.minimizarPanel;\r\n\t\t\tvar vis = \"visible\";\r\n\t\t\tvar hei = \"auto\";\r\n\t\t}else{\r\n\t\t\tvar abierto = false;\r\n\t\t\tvar imagen = Img.maximizarPanel;\r\n\t\t\tvar vis = \"hidden\";\r\n\t\t\tvar hei = \"0\";\r\n\t\t}\r\n\t\t\r\n\t\tvar contenido = \"<h3 class='header'>\" + Lang[\"globalView\"] + \"<img src='\" + imagen + \"' style='position: absolute; right: 5px; top: 7px; cursor: pointer;'/></h3>\" +\r\n\t\t\t\t\t\t\"<div class='content' style='visibility: \" + vis + \"; height: \" + hei + \";'>\" +\r\n\t\t\t\t\t\t\t\"<h4 style='background-color: #FFFBDB; font-size: 12px; margin: 6px 0; padding: 2px; text-align: center;'>\" + Lang[\"offensiveStrength\"] + \"</h4>\" +\r\n\t\t\t\t\t\t\t\"<table>\" +\r\n\t\t\t\t\t\t\t\t\"<tr>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td width='20px' style='padding-left: 55px; padding-bottom: 3px;'><img title = '\" + Lang[\"attack\"] + \"' src='\" + Img.unidadesAtaque + \"'/></td>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td id='ataqueBoquetes' style='padding-left: 20px;'>\" + a_a + \"</td>\" +\r\n\t\t\t\t\t\t\t\t\"</tr>\" +\r\n\t\t\t\t\t\t\t\t\"<tr>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 55px;'><img title = '\" + Lang[\"defense\"] + \"' src='\" + Img.unidadesDefensa + \"'/></td>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 20px;'>\" + a_d + \"</td>\" +\r\n\t\t\t\t\t\t\t\t\"</tr>\" +\r\n\t\t\t\t\t\t\t\"</table>\" +\r\n\t\t\t\t\t\t\t\"<h4 style='background-color: #FFFBDB; font-size: 12px; margin: 6px 0; padding: 2px; text-align: center;'>\" + Lang[\"defensiveStrength\"] + \"</h4>\" +\r\n\t\t\t\t\t\t\t\"<table>\" +\r\n\t\t\t\t\t\t\t\t\"<tr>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 55px; padding-bottom: 3px;'><img title = '\" + Lang[\"attack\"] + \"' src='\" + Img.unidadesAtaque + \"'/></td>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 20px;'>\" + d_a + \"</td>\" +\r\n\t\t\t\t\t\t\t\t\"</tr>\" +\r\n\t\t\t\t\t\t\t\t\"<tr>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 55px; padding-bottom: 3px;'><img title = '\" + Lang[\"defense\"] + \"' src='\" + Img.unidadesDefensa + \"'/></td>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 20px; padding-bottom: 3px;'>\" + d_d + \"</td>\" +\r\n\t\t\t\t\t\t\t\t\"</tr>\" +\r\n\t\t\t\t\t\t\t\"</table>\" +\r\n\t\t\t\t\t\t\t\"<h4 style='background-color: #FFFBDB; font-size: 12px; margin: 6px 0; padding: 2px; text-align: center;'>\" + Lang[\"endurance\"] + \":</h4>\" +\r\n\t\t\t\t\t\t\t\"<table>\" +\r\n\t\t\t\t\t\t\t\t\"<tr>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 55px; padding-bottom: 3px;'><img title = '\" + Lang[\"endurance\"] + \"' src='\" + Img.unidadesResistencia + \"'/></td>\" +\r\n\t\t\t\t\t\t\t\t\t\"<td style='padding-left: 20px; padding-bottom: 3px;'>\" + r + \"</td>\" +\r\n\t\t\t\t\t\t\t\t\"</tr>\" +\r\n\t\t\t\t\t\t\t\"</table>\";\r\n\t\t\t\t\t\t\t\r\n\t\tif (tierra){\r\n\t\t\tcontenido += \t\"<input id='inputBoquetes' value='0' style='width: 18px; height: 15px; background: #FFF; border: solid thin #BC575D; position: absolute; right: 30px; top: 25px; font-size: 12px;'/>\" +\r\n\t\t\t\t\t\t\t\"<div id='etiBoquetes' class='etiqueta'>\" + Lang[\"labelWall\"] + \"</div>\";\r\n\t\t}\r\n\t\tcontenido +=\t\"</div>\" +\r\n\t\t\t\t\t\t\"<div class='footer'></div>\";\r\n\t\t\r\n\t\tdiv.innerHTML = contenido;\r\n\t\t\r\n\t\tcolocaDetras (div, document.getElementById (\"buildingUpgrade\"));\r\n\t\t\r\n\t\tdocument.getElementById (\"puntosUnidades\").getElementsByTagName (\"img\")[0].addEventListener (\r\n\t\t\t\"click\",\r\n\t\t\tfunction (){\r\n\t\t\t\tvar contenido = this.parentNode.parentNode.childNodes[1];\r\n\t\t\t\t\r\n\t\t\t\tif (abierto){\r\n\t\t\t\t\tabierto = false;\r\n\t\t\t\t\tthis.src = Img.maximizarPanel;\r\n\t\t\t\t\tcontenido.style.visibility = \"hidden\";\r\n\t\t\t\t\tcontenido.style.height = \"0\";\r\n\t\t\t\t\tpanelesScript[i] = 0;\r\n\t\t\t\t\tGM_setValue (server + \"paneles\", panelesScript.join (\"#\"));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tabierto = true;\r\n\t\t\t\t\tthis.src = Img.minimizarPanel;\r\n\t\t\t\t\tcontenido.style.height = \"auto\";\r\n\t\t\t\t\tcontenido.style.visibility = \"visible\";\r\n\t\t\t\t\tpanelesScript[i] = 1;\r\n\t\t\t\t\tGM_setValue (server + \"paneles\", panelesScript.join (\"#\"));\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfalse\r\n\t\t);\r\n\t\t\r\n\t\tif (tierra){\r\n\t\t\tvar eti = document.getElementById (\"etiBoquetes\");\r\n\t\t\tvar ataque = parseFloat (document.getElementById (\"ataqueBoquetes\").textContent);\r\n\t\t\t\r\n\t\t\tvar input = document.getElementById (\"inputBoquetes\");\r\n\t\t\tinput.addEventListener (\"keyup\", function (){ valida (this, ataque, false); }, false);\r\n\t\t\tinput.addEventListener (\"mousemove\", function (e){ mueveEti (e, eti); }, false);\r\n\t\t\tinput.addEventListener (\"mouseout\", function (){ escondeEti (eti); }, false);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "88c916a0f5747a18a51399ea1daef5cd", "score": "0.45553967", "text": "extractPoints(divisions){return{shape:this.getPoints(divisions),holes:this.getPointsHoles(divisions)};}", "title": "" }, { "docid": "88c916a0f5747a18a51399ea1daef5cd", "score": "0.45553967", "text": "extractPoints(divisions){return{shape:this.getPoints(divisions),holes:this.getPointsHoles(divisions)};}", "title": "" }, { "docid": "349d88d900de62a54ad1b31782e3692e", "score": "0.454912", "text": "function get_lookat() {\r\n if (krpano) {\r\n var hlookat = krpano.get(\"view.hlookat\");\r\n var vlookat = krpano.get(\"view.vlookat\");\r\n var fov = krpano.get(\"view.fov\");\r\n\r\n document.getElementById(\"currentview\").innerHTML = 'hlookat=\"' + hlookat.toFixed(2) + '\" ' + 'vlookat=\"' + vlookat.toFixed(2) + '\" ' + 'fov=\"' + fov.toFixed(2) + '\" ';\r\n }\r\n}", "title": "" }, { "docid": "126e005e641316a96c0bdd199b276ec7", "score": "0.45478165", "text": "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "title": "" }, { "docid": "126e005e641316a96c0bdd199b276ec7", "score": "0.45478165", "text": "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "title": "" }, { "docid": "2a1d5384aa26e1d421813f1027331a3f", "score": "0.4547279", "text": "function getWiresName() {\n\twhite1 = galvanometer_container.getChildByName(\"white_keybox_to_key2\");\n\twhite2 = galvanometer_container.getChildByName(\"white_keybox_to_key1\");\n\twhite3 = galvanometer_container.getChildByName(\"white_keybox_to_key3\");\n\twhite4 = galvanometer_container.getChildByName(\"white_keybox_to_key4\");\n\tblack1 = galvanometer_container.getChildByName(\"black_keybox_to_key1\");\n\tblack2 = galvanometer_container.getChildByName(\"black_keybox_to_key2\");\n\tblack3 = galvanometer_container.getChildByName(\"black_keybox_to_key3\");\n\tblack4 = galvanometer_container.getChildByName(\"black_keybox_to_key4\");\n\twires_array = [\n\t\t[white2, black1],\n\t\t[white3, black2],\n\t\t[white4, black3],\n\t\t[white3, black1],\n\t\t[white4, black2],\n\t\t[white4, black2],\n\t\t[white4, black1],\n\t\t[white4, black1]\n\t];\n}", "title": "" }, { "docid": "95f2182fe4d7ed979fe3a1b8aa25cc3f", "score": "0.45402494", "text": "function pantp() {\n\tview.animate({\n\t\tcenter: taipei,\n\t\tduration: 3000,\n zoom: 10\n\t});\n}", "title": "" }, { "docid": "3d0fcf6106a12d594c93acd248227ee6", "score": "0.45368138", "text": "get showCoordinatesSidebar() {\n const outputs = {\n visible: true,\n hidden: false,\n auto: this.state.coordinates && this.state.coordinates.length > 1\n };\n return outputs[this.listView];\n }", "title": "" }, { "docid": "003c64e60ab6483b3dfcf2d8dbbab3f5", "score": "0.4535999", "text": "function mudaLayout() {\n const mural = document.querySelector(\".mural\"); // recuperando o elemento html pela classe css\n mural.classList.toggle(\"mural--linha\");\n }", "title": "" }, { "docid": "38ccbeb61b6f14e5de3989ecb9721705", "score": "0.45294467", "text": "get allMillennialVampires() {\n let arr = [];\n\n if (this.yearConverted > 1980) {\n arr.push(this);\n }\n for (const child of this.offspring) {\n arr = arr.concat(child.allMillennialVampires);\n }\n return arr;\n }", "title": "" }, { "docid": "266853ad8b97a545bf04735ee61a3eed", "score": "0.4525875", "text": "months() {\n\t return _monthLabels.map((ml, i) => ({\n\t label: ml,\n\t label_1: ml.substring(0, 1),\n\t label_2: ml.substring(0, 2),\n\t label_3: ml.substring(0, 3),\n\t number: i + 1,\n\t }));\n\t }", "title": "" }, { "docid": "7f67122057689a7fd073d0f001a9b68b", "score": "0.45248172", "text": "function reset_all_panes(){\n $.each(wb_panes, function(ind, $pane){\n $pane.reset();\n });\n}", "title": "" }, { "docid": "de5603d34bce4a56f0c592f4bbec4225", "score": "0.45203876", "text": "function show_hide_group(num_col, from_col, to_col, id_table, reverse) {\r\n\tvar j = 0;\r\n\t// ajuste de columnas de info\r\n\tfrom_col = from_col + num_col;\r\n\tto_col = to_col + num_col;\r\n\t// parametro que indica el numero de meses que se muestran (no es modificable)\r\n\tvar num_meses = 3;\r\n\tvar from = from_col;\r\n\tvar show = false;\r\n\tif (reverse) {\r\n\t\tfrom = from_col + num_meses;\r\n\t}\r\n\tfor (var i = from; i <= to_col; i++) {\r\n\t\t\t\t//alert('i= '+i+' show= '+show+' reverse= '+reverse+' from: '+from+' from-to_col: '+from_col+'-'+to_col);\r\n\t\tshow_hide_column(num_col, i, show, id_table);\r\n\t\tj++;\r\n\t\tif (j == num_meses) {\r\n\t\t\tshow = true;\r\n\t\t\tif (reverse) {\r\n\t\t\t\tfrom = from_col - 1;\r\n\t\t\t\ti = from_col - 1;\r\n\t\t\t\tto_col = to_col - num_meses;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "b2d0a0b633fccd6b459ef345c345f804", "score": "0.45191637", "text": "function tableroArr(){\n\tvar colArr = [];\n\tfor (var i = 1; i < 8; i++) {\n\t\tvar col=[];\n\t\t$(\".col-\"+i+\" img\").each(function(){\n\t\t\tcol.push(this);\n\t\t});\n\t\tcolArr.push(col);\n\t}\n\t\t//console.log($(colArr[1][2]).attr(\"title\"));\n\t\treturn colArr;\n}", "title": "" }, { "docid": "c8c2ce41602da7a22c936f8c95e79fc7", "score": "0.45183718", "text": "function fix_panes() {\n panes_width = $panes.width();\n panes_offset = $panes.offset();\n resize_col();\n\n // Update bounds\n calculate_bounds();\n $drag.draggable(\"destroy\");\n make_draggable();\n\n // Make sure the drag bar stays in the right place\n $drag.css(\"left\", panes_offset.left + offset * panes_width + \"px\");\n $drag.css(\"position\", \"inherit\");\n\n // Fix pdfViewer, if it exists.\n if (window.pdfViewer) {\n window.pdfViewer.refresh_annotations();\n }\n}", "title": "" }, { "docid": "4fb6b3d1163ce0db21cfa3e231f357dc", "score": "0.45175397", "text": "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "title": "" }, { "docid": "4fb6b3d1163ce0db21cfa3e231f357dc", "score": "0.45175397", "text": "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "title": "" }, { "docid": "4fb6b3d1163ce0db21cfa3e231f357dc", "score": "0.45175397", "text": "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "title": "" }, { "docid": "4fb6b3d1163ce0db21cfa3e231f357dc", "score": "0.45175397", "text": "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "title": "" }, { "docid": "4fb6b3d1163ce0db21cfa3e231f357dc", "score": "0.45175397", "text": "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "title": "" }, { "docid": "4fb6b3d1163ce0db21cfa3e231f357dc", "score": "0.45175397", "text": "get nodes() {\n const lView = this._raw_lView;\n const tNode = lView[TVIEW].firstChild;\n return toDebugNodes(tNode, lView);\n }", "title": "" }, { "docid": "3582397bf7f1092046e061997f7ab543", "score": "0.4514016", "text": "function pais_(visitados){\n var lista = []\n visitados.forEach(element => {\n if(element.location != null)\n {\n var __in = false;\n lista.forEach(element1=>{\n if(element1.location === element.location.toLowerCase()) __in = true;\n });\n if(!__in) lista.push( { location: element.location.toLowerCase()});\n }\n });\n\n //retornamos lista ordenada y limitada a lo que entre\n return lista;\n}", "title": "" }, { "docid": "2deb61b35f9d2a736e35a554922e4f73", "score": "0.45134613", "text": "getParameterList(){\n let parameters = {\n offsetX: \"the offset of the container's left corner along the X-axis. if none, index * windowWidth / len\",\n offsetY: \"the offset of the container's left corner along the Y-axis. if none, index * windowHeight / len\",\n widthOfParent: \"the width of the parent container, if none, the windowWidth of the canvas\",\n heightOfParent: \"the height of the parent container, if none, the windowHeight of the canvas\",\n orientation: \"the orientation of the container: row or column, if none, windowWidth < windowHeight of the canvas\",\n index: \"the index of the container in the parent object, if none, 0\",\n len: \"the number of siblings contained in the parent container. if none, 1.\",\n func: \"a wildcard function. if none, nullFunction.\",\n width: \"the width of the container. if none, the windowWidth / len.\",\n height: \"the height of the container. if none, the windowHeight / len.\",\n };\n return parameters\n }", "title": "" }, { "docid": "5dac7697eb0f2c8e0d902c409968d0ce", "score": "0.4510368", "text": "get childViews() {\n const childViews = [];\n let child = this.childHead;\n while (child) {\n childViews.push(child);\n child = child.next;\n }\n return childViews;\n }", "title": "" }, { "docid": "5dac7697eb0f2c8e0d902c409968d0ce", "score": "0.4510368", "text": "get childViews() {\n const childViews = [];\n let child = this.childHead;\n while (child) {\n childViews.push(child);\n child = child.next;\n }\n return childViews;\n }", "title": "" }, { "docid": "5dac7697eb0f2c8e0d902c409968d0ce", "score": "0.4510368", "text": "get childViews() {\n const childViews = [];\n let child = this.childHead;\n while (child) {\n childViews.push(child);\n child = child.next;\n }\n return childViews;\n }", "title": "" }, { "docid": "5dac7697eb0f2c8e0d902c409968d0ce", "score": "0.4510368", "text": "get childViews() {\n const childViews = [];\n let child = this.childHead;\n while (child) {\n childViews.push(child);\n child = child.next;\n }\n return childViews;\n }", "title": "" }, { "docid": "5dac7697eb0f2c8e0d902c409968d0ce", "score": "0.4510368", "text": "get childViews() {\n const childViews = [];\n let child = this.childHead;\n while (child) {\n childViews.push(child);\n child = child.next;\n }\n return childViews;\n }", "title": "" }, { "docid": "5dac7697eb0f2c8e0d902c409968d0ce", "score": "0.4510368", "text": "get childViews() {\n const childViews = [];\n let child = this.childHead;\n while (child) {\n childViews.push(child);\n child = child.next;\n }\n return childViews;\n }", "title": "" }, { "docid": "06d01c63a1e2b5f5ea931c02dccab0f5", "score": "0.45088044", "text": "function getplanete(id){\r\n if ($N('idcolo') == null) return false;\r\n var selplanete = $N('idcolo')[0];\r\n if (!selplanete) return false;\r\n var planete = selplanete.options[id].innerHTML;\r\n \r\n var str1 = planete.split('\\&nbsp;\\&nbsp;');\r\n var nomplanete = str1[0];\r\n var elem = str1[1].split(\":\");\r\n var coord = \"\";\r\n\r\n if (elem[0].substring(0, 1) == \"[\")\r\n coord = elem[0].substring(1, elem[0].length);\r\n else\r\n coord = elem[0];\r\n\r\n coord += \".\" + elem[1] + \".\";\r\n\r\n if (elem[2].length == 2)\r\n coord += elem[2].substring(0, 1);\r\n else\r\n coord += elem[2];\r\n \r\n return new Array(nomplanete, coord);\r\n }", "title": "" }, { "docid": "9e83162d2ddd452cb5a202b387245322", "score": "0.4499891", "text": "getPlatzers(state){\n return state.platzers;\n }", "title": "" }, { "docid": "d577536bff23332f7c4b6fe9edecab01", "score": "0.44928837", "text": "function buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n }", "title": "" }, { "docid": "a195d04716c77eb13c45f5b9e0cc79a3", "score": "0.44898525", "text": "function display() {\n appLayouts.forEach((x,i)=>{\n console.log('---LAYOUT:' + i);\n // use JSON as tree traverser and filter\n JSON.stringify(x, (k,v)=>{\n\tif (k === 'txt') console.log('UI: '+v.replace(/\\n/g, '\\nUI: '));\n\t//if (k === 'key') console.log('UI.KEY: ' + v);\n\treturn v;\n });\n });\n console.log('(? for help)');\n }", "title": "" }, { "docid": "cfa0584c0d30d89abdd7c562c8894f84", "score": "0.44860512", "text": "function parseMap(tbl) {\n if (typeof tbl == 'undefined') {\n return;\n }\n var m = '';\n var bgReg = /land\\d\\/(\\d+)\\.gif/; //landscape\n var xyReg = /x:(\\d+) y:(\\d+)/; //cell coords example: x:424 y:270\n var delReg = /<(?:\\w+|\\s|=|\\/|#|:|\\.)+>/gi; //delete tags\n for (var i = 0; i < tbl.rows.length; i++) {\n for (var j = 0; j < tbl.rows[i].cells.length; j++) {\n var c = tbl.rows[i].cells[j];\n if (c.hasAttribute('background')) {\n //unit on the ground\n var res = bgReg.exec(c.getAttribute('background'));\n if (res != null) {\n var img = c.getElementsByTagName('img')[0];\n var xy = xyReg.exec(img.getAttribute('tooltip'));\n if (xy && (img.getAttribute('tooltip').search(\"Темнота\") == -1)) {\n m += (xy[1] * 10000 + xy[2] * 1) + '$';\n m += res[1];\n res = img.getAttribute('src').replace('.gif', '');\n if (res != 19 && res != 29 && res != 39 && res != 49 && res != 59 && res != 69) { //peon\n m += '$' + res;\n var d = img.getAttribute('tooltip');\n d = d.replace(delReg, '');\n d = d.split('$');\n for (var n = 0; n < d.length - 1; n++) {\n m += '$' + d[n];\n }\n }\n m += '&';\n }\n }\n } else {\n //ground\n var img = c.getElementsByTagName('img')[0];\n if (img) {\n var res = bgReg.exec(img.getAttribute('src'));\n if (res != null) {\n var xy = xyReg.exec(img.getAttribute('tooltip'));\n if (xy && (img.getAttribute('tooltip').search(\"Темнота\") == -1)) { //terra incognita check\n m += (xy[1] * 10000 + xy[2] * 1) + '$';\n m += res[1] + '&';\n }\n }\n }\n }\n }\n }\n return m;\n }", "title": "" }, { "docid": "cc8f2bb3a4fad86b528a873d4c2ffa48", "score": "0.44816944", "text": "function showMuppets(names) {\n console.log(names[0]);\n console.log(names[1]);\n console.log(names[2]);\n console.log(names[3]);\n}", "title": "" }, { "docid": "c3a2ef9f966d68fc2810dc9f9a4d5015", "score": "0.44795397", "text": "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array\n\t}", "title": "" }, { "docid": "c3a2ef9f966d68fc2810dc9f9a4d5015", "score": "0.44795397", "text": "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array\n\t}", "title": "" } ]
92c9620338036bd608c0ef1ac41753be
Convert a JS object into GET URL parameters
[ { "docid": "6d5b32c1af85da417ed6128981b7f677", "score": "0.0", "text": "function makeUrl(base, params) {\n if (params) {\n let out = base + \"?\";\n Object.keys(params).forEach(k => {\n out += k;\n out += '=';\n out += params[k];\n out += \"&\";\n });\n return out.replace(/&$/g, \"\");\n }\n else {\n return base;\n }\n}", "title": "" } ]
[ { "docid": "fa958565dde7208f58d3a6d965a51a3e", "score": "0.71749943", "text": "function _setGetPrams(obj) {\n var param = '';\n $.each(obj, function (key, element) {\n param += '&' + key + '=' + encodeURI(element);\n });\n return param.slice(1);\n}", "title": "" }, { "docid": "cb82b04878a9a79bf568381ce291e234", "score": "0.7112502", "text": "function objectToParameters(obj) {\n var text = '';\n for (var i in obj) {\n // encodeURIComponent is a built-in function that escapes to URL-safe values\n text += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]) + '&';\n }\n return text;\n}", "title": "" }, { "docid": "b81bc88bb29723bee87a6ddc9ca3a761", "score": "0.7037749", "text": "function objectToQueryString(obj) {\n var str = [];\n angular.forEach(obj, function(nextValue, nextKey) {\n str.push(encodeURIComponent(nextKey) + \"=\" + encodeURIComponent(nextValue));\n });\n return str.join(\"&\");\n }", "title": "" }, { "docid": "0947bf4781a63555947e978f98d26c96", "score": "0.69731915", "text": "function param(object){\n var parameters = [];\n for (var property in object) {\n if (object.hasOwnProperty(property)) {\n parameters.push(encodeURI(property + '=' + object[property]));\n }\n }\n return parameters.join('&');\n}", "title": "" }, { "docid": "da105616a6d2e09df58b10fcb0950647", "score": "0.6967905", "text": "function objectToParam(obj) {\n\tvar str = \"\";\n\tfor (var key in obj) {\n\t if (str != \"\") {\n\t str += \"&\";\n\t }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n\t}\n\t\n\treturn str;\n\t\n}", "title": "" }, { "docid": "1760387a80486f4ba4e59553927fce5b", "score": "0.6831079", "text": "function objectToQueryString(obj) {\n\t\tvar i, sb = [];\n\t\t\n\t\tfor (i in obj) {\n\t\t\tsb.push(encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]));\n\t\t\t\n\t\t}\n\t\t\n\t\treturn sb.join('&');\n\t}", "title": "" }, { "docid": "894b3320eaa93765851afbefbec7b9bf", "score": "0.66900444", "text": "function URL_PARAM_STR_(obj){\n if(obj){\n var url_parameter_array = [];\n var keys = obj ? Object.keys(obj) : [];\n for(var i = 0;i<keys.length;i++){\n var key = keys[i];\n var val = obj[key];\n if((val!=null && val!=undefined && val!=\"\") || val==0){\n url_parameter_array.push(key+\"=\"+encodeURIComponent(val));\n }\n } \n return url_parameter_array.length>0 ? \"?\"+url_parameter_array.join(\"&\") : \"\";\n }else{return \"\";}\n}", "title": "" }, { "docid": "32e01ed23991c90af6d1194a9de209a3", "score": "0.66784614", "text": "function toQueryString(obj) {\n var parts = [];\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n parts.push(encodeURIComponent(i) + \"=\" + encodeURIComponent(obj[i]));\n }\n }\n return parts.join(\"&\");\n }", "title": "" }, { "docid": "1d2c96bb589ae9fe6e5cb26b7c2c77b7", "score": "0.6547811", "text": "function convertToParams(obj) {\n\t\tvar params = {};\n\t\t$.each(fields, function (i, field) {\n\t\t\tif (field.isArray) {\n\t\t\t\tvar concatResult = '';\n\t\t\t\tvar arr = obj[field.name];\n\t\t\t\tif (arr) {\n\t\t\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\t\t\tif (concatResult.length > 0)\n\t\t\t\t\t\t\tconcatResult += ',';\n\t\t\t\t\t\tvar elem = field.mapTo\n\t\t\t\t\t\t\t? field.mapTo(arr[i])\n\t\t\t\t\t\t\t: arr[i];\n\t\t\t\t\t\tif (elem != null && elem != undefined)\n\t\t\t\t\t\t\tconcatResult += elem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (concatResult.length > 0)\n\t\t\t\t\tparams[field.urlName] = concatResult;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (obj[field.name]) {\n\t\t\t\t\tparams[field.urlName] = field.mapTo\n\t\t\t\t\t\t? field.mapTo(obj[field.name])\n\t\t\t\t\t\t: obj[field.name];\n\t\t\t\t}\n\t\t\t\tif (!params[field.urlName] || (field.defaultValue && obj[field.name] == field.defaultValue && !field.alwaysPutIntoUrl))\n\t\t\t\t\tdelete params[field.urlName];\n\t\t\t}\n\t\t});\n\t\treturn params;\n\t}", "title": "" }, { "docid": "5221cc9beb6b3511e7280efe2694eaea", "score": "0.6513423", "text": "function toKeyValue(obj, prepend) {\n var parts = [];\n forEach(obj, function (value, key) {\n parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));\n });\n return parts.length ? prepend + parts.join('&') : '';\n}", "title": "" }, { "docid": "7f4e4fdcd7ddd2aa4cf91ff9a19ffada", "score": "0.6512103", "text": "function objectToQueryString(value) {\n return '?' + Object.keys(value).map(function (key) {\n return encodeURIComponent(key) + '=' + encodeURIComponent(String(value[key]));\n }).join('&');\n }", "title": "" }, { "docid": "dfb63579f70ac7ce1fd9bd6e1a2de5f4", "score": "0.64667016", "text": "static getQueryParams() {\n const url = window.location.href;\n const params = {};\n url.replace(/[?&]([^?&=]+)=([^?&=]+)/g, (match, p1, p2) => {\n params[p1] = p2;\n });\n return params;\n }", "title": "" }, { "docid": "e92def7f2059f442e862bd06d55050c2", "score": "0.6458499", "text": "static toUrl(obj) {\n\tlet str = [];\n\tfor (let p in obj)\n\t\tif (obj.hasOwnProperty(p)) {\n\t\t\tif (obj[p] === true) {\n\t\t\t\tstr.push(encodeURIComponent(p));\n\t\t\t} else {\n\t\t\t\tstr.push(encodeURIComponent(p) + \"=\" + encodeURIComponent(obj[p]));\n\t\t\t}\n\t\t}\n\treturn str.join(\"&\");\n}", "title": "" }, { "docid": "03ad74ed064baf4b730912d680315052", "score": "0.640878", "text": "function objectToQueryString(value) {\n const keys = Object.keys(value).filter(key => key.length > 0);\n if (!keys.length) {\n return '';\n }\n return ('?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n })\n .join('&'));\n }", "title": "" }, { "docid": "03ad74ed064baf4b730912d680315052", "score": "0.640878", "text": "function objectToQueryString(value) {\n const keys = Object.keys(value).filter(key => key.length > 0);\n if (!keys.length) {\n return '';\n }\n return ('?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n })\n .join('&'));\n }", "title": "" }, { "docid": "91baacfa93225a45bdda5aa189bb7a0c", "score": "0.64049643", "text": "addParams(obj) {\n let str = '';\n if (Object.keys(obj).length > 0) {\n Object.keys(obj).forEach((key) => {\n str += '&' + key + '=' + obj[key];\n });\n }\n return str;\n }", "title": "" }, { "docid": "114bb279786e6467f9d2f8a747e553a8", "score": "0.64037734", "text": "function objectToQueryString(value) {\n const keys = Object.keys(value);\n if (!keys.length) {\n return '';\n }\n return ('?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n })\n .join('&'));\n }", "title": "" }, { "docid": "114bb279786e6467f9d2f8a747e553a8", "score": "0.64037734", "text": "function objectToQueryString(value) {\n const keys = Object.keys(value);\n if (!keys.length) {\n return '';\n }\n return ('?' +\n keys\n .map(key => {\n const content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n })\n .join('&'));\n }", "title": "" }, { "docid": "7db71e260df2084ad9b37bbb48a44c2f", "score": "0.640268", "text": "function urlEncode(object){return Object.keys(object).map(function(key){return encodeURIComponent(key)+\"=\"+encodeURIComponent(object[key]);}).join('&');}", "title": "" }, { "docid": "ff05d15a6fcd6a79649a0f85303c69f8", "score": "0.63955176", "text": "function gupo() {\n var urlParams = {};\n var e,\n a = /\\+/g, // Regex for replacing addition symbol with a space\n r = /([^&=]+)=?([^&]*)/g,\n d = function (s) { return decodeURIComponent(s.replace(a, \" \")); },\n q = window.location.search.substring(1);\n \n while (e = r.exec(q))\n urlParams[d(e[1])] = d(e[2]);\n\n return urlParams;\n}", "title": "" }, { "docid": "9aafd687057728a36cda3b024250a4eb", "score": "0.6395427", "text": "function objectToQueryString(value) {\n var keys = Object.keys(value);\n if (!keys.length) {\n return '';\n }\n return '?' + keys.map(function (key) {\n var content = encodeURIComponent(String(value[key]));\n return key + (content ? '=' + content : '');\n }).join('&');\n }", "title": "" }, { "docid": "d63318cd8c7298ee8d707e5093c53811", "score": "0.6390206", "text": "function getParams() {\n const search = window.location.search.substring(1);\n const params = JSON.parse(\n `{\"${ search.replace(/&/g, '\",\"').replace(/=/g,'\":\"').replace(/\\+/g, '%20') }\"}`,\n (key, value) => key === \"\"?value:decodeURIComponent(value));\n console.log(params.id);\n return params;\n}", "title": "" }, { "docid": "60e688c5c184394e848d3e2e300f8eeb", "score": "0.6387963", "text": "function toQueryString(obj) {\r\n return obj ? Object.keys(obj).sort().map(function (key) {\r\n var val = obj[key];\r\n if (Array.isArray(val)) {\r\n return val.sort().map(function (val2) {\r\n return encodeURI(key) + '=' + encodeURI(val2);\r\n }).join('&');\r\n }\r\n\r\n return encodeURI(key) + '=' + encodeURI(val);\r\n }).join('&') : '';\r\n}", "title": "" }, { "docid": "eed3ebb16f4d2783d8de38a5649c7622", "score": "0.6384883", "text": "function serialise(obj) {\n return Object.keys(obj).map(k => `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`).join('&');\n}", "title": "" }, { "docid": "8ad05376f2ea48c353d865fb3cdb1b0a", "score": "0.6381955", "text": "function convertQueryStringToObject() {\n let inputArray = window.location.search.slice(1).split('&');\n let convertedInput = {};\n inputArray.forEach((input) => {\n input = input.split('=');\n convertedInput[input[0]] = decodeURIComponent(input[1].replace(/\\+/g, '%20') || '');\n //We can also do: convertedInput[input[0]] = decodeURIComponent(input[1] || ''); It just doesn't handle spaces \n });\n\n return JSON.parse(JSON.stringify(convertedInput));\n}", "title": "" }, { "docid": "86ec212e0631378b1ff3ac65e79458d4", "score": "0.63727474", "text": "function toQueryString(obj) {\n\treturn obj ? Object.keys(obj).sort().map(function (key) {\n\t\tvar val = obj[key];\n\t\tif (Array.isArray(val)) {\n\t\t\treturn val.sort().map(function (val2) {\n\t\t\t\treturn encodeURIComponent(key) + '=' + encodeURIComponent(val2);\n\t\t\t}).join('&');\n\t\t}\n\t\treturn encodeURIComponent(key) + '=' + encodeURIComponent(val);\n\t}).join('&') : '';\n}", "title": "" }, { "docid": "db7f8638098f3e3a43a9b287a6dfbd12", "score": "0.63677543", "text": "function buildQueryString(obj) {\n 'use strict';\n return forEach(obj, function (k, v) {\n return k + '=' + encodeURIComponent(v);\n }).join('&');\n}", "title": "" }, { "docid": "6a3ca175d4540537c1a307ea0ff44c1f", "score": "0.63446975", "text": "toGetParameters(data) {\n var parameters = \"\";\n var index = 0;\n for(var field in data) {\n if(index++ == 0) {\n parameters += \"?\";\n } else {\n parameters += \"&\";\n }\n parameters += encodeURIComponent(field) + \"=\" + encodeURIComponent(data[field]);\n };\n return parameters;\n }", "title": "" }, { "docid": "5786a4d80382d9b87d6806de9032d570", "score": "0.6320899", "text": "function assembleUrl(url_obj){\n var url=url_obj.path;\n var first=true;\n for(var key in url_obj.params){\n if(!first){\n url+=\"&\";\n }\n else{\n first=false;\n }\n url+=encodeURILax(key)+\"=\"+encodeURILax(url_obj.params[key]);\n }\n return url;\n}", "title": "" }, { "docid": "281825da3f4eb2863f16e9024695d5fc", "score": "0.6318261", "text": "function getUrlParams() {\n var vars = {};\n var terms = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < terms.length; i++) {\n var termSplit = terms[i].split('=');\n vars[termSplit[0]] = unescape(termSplit[1]);\n }\n return vars;\n}", "title": "" }, { "docid": "d944f2e15bd72a8ad0e9e166e089bb5b", "score": "0.631378", "text": "postParameters(obj) {\n let s = '?';\n for (let attr in obj)\n s += `${attr}=${obj[attr]}&`;\n return s.slice(0, -1); // remove last '&'\n }", "title": "" }, { "docid": "64573270ca5edfefa03375109fba24bb", "score": "0.62936044", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(\n // tslint:disable-next-line:no-unsafe-any\n function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]); })\n .join('&');\n}", "title": "" }, { "docid": "64573270ca5edfefa03375109fba24bb", "score": "0.62936044", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(\n // tslint:disable-next-line:no-unsafe-any\n function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]); })\n .join('&');\n}", "title": "" }, { "docid": "64573270ca5edfefa03375109fba24bb", "score": "0.62936044", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(\n // tslint:disable-next-line:no-unsafe-any\n function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]); })\n .join('&');\n}", "title": "" }, { "docid": "64573270ca5edfefa03375109fba24bb", "score": "0.62936044", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(\n // tslint:disable-next-line:no-unsafe-any\n function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]); })\n .join('&');\n}", "title": "" }, { "docid": "23eef8b6cea3e247c28e40d7f5f5b647", "score": "0.62880504", "text": "function urlEncode(object) {\n return Object.keys(object).map( // tslint:disable-next-line:no-unsafe-any\n function (key) {\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]);\n }).join('&');\n}", "title": "" }, { "docid": "2f8fbc6ca62a8102f487935ec28bf45a", "score": "0.6285698", "text": "function getParams() {\r\n var paramArr = window.location.search.substr(1).split(\"&\")[0] === \"\" ? [] : window.location.search.substr(1).split(\"&\");\r\n var params = {};\r\n for (var i = 0; i < paramArr.length; i++) {\r\n var param = paramArr[i];\r\n params[param.split(\"=\")[0]] = decodeURI(param.split(\"=\")[1]);\r\n }\r\n return params;\r\n}", "title": "" }, { "docid": "cc1e24e8b3c0a3f93f7701099d8bbb50", "score": "0.6280912", "text": "function QueryStringToJSON() {\n var pairs = location.search.slice(1).split('&');\n\n var result = {};\n pairs.forEach(function (pair) {\n pair = pair.split('=');\n result[pair[0]] = decodeURIComponent(pair[1] || '');\n });\n\n return JSON.parse(JSON.stringify(result));\n}", "title": "" }, { "docid": "26c71f81e951e66feed324226ea17669", "score": "0.62755775", "text": "static getJsonFromUrl() {\r\n\t var query = location.search.substr(1);\r\n\t var result = {};\r\n\t query.split(\"&\").forEach(function(part) {\r\n\t\tvar item = part.split(\"=\");\r\n\t\tresult[item[0]] = decodeURIComponent(item[1]);\r\n\t });\r\n\t return result;\r\n\t}", "title": "" }, { "docid": "ff15adb8c9309526be770f606c1517d0", "score": "0.6270937", "text": "function _param (obj) {\n\n var query = '', name, value, fullSubName, subName, subValue, innerObj, i;\n\n for (name in obj) {\n value = obj[name];\n\n if (value instanceof Array) {\n for (i = 0; i < value.length; ++i) {\n subValue = value[i];\n fullSubName = name + '[' + i + ']';\n innerObj = {};\n innerObj[fullSubName] = subValue;\n query += _param(innerObj) + '&';\n }\n }\n else if (value instanceof Object) {\n for (subName in value) {\n subValue = value[subName];\n fullSubName = name + '.' + subName;\n innerObj = {};\n innerObj[fullSubName] = subValue;\n query += _param(innerObj) + '&';\n }\n }\n else if (value !== undefined && value !== null)\n query += encodeURIComponent(name) + '=' + encodeURIComponent(value) + '&';\n }\n\n return query.length ? query.substr(0, query.length - 1) : query;\n }", "title": "" }, { "docid": "25d26ec306619887100772d171ed8da8", "score": "0.6265779", "text": "function getURLParams() {\n\tvar nonLeadingPlus = /(?!^)\\+/g; //regex for replacing non-leading + with space\n\tvar search = /([^&=]+)=?([^&]*)/g;\n\tvar decode = function(s) { return decodeURIComponent(s.replace(nonLeadingPlus, \" \")); };\n\t\n\tvar urlParams = {};\n\tvar query = location.search.substring(1);\n\t\n\tvar match = search.exec(query);\n\twhile (match) {\n\t\turlParams[decode(match[1])] = decode(match[2]);\n\t\tmatch = search.exec(query);\n\t}\n\t\n\treturn urlParams;\n}", "title": "" }, { "docid": "7c876d0d274c1da41d718f50fcff3508", "score": "0.62582785", "text": "function toQueryString(paramsObject) {\n return Object\n .keys(paramsObject)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(paramsObject[key])}`)\n .join('&')\n ;\n}", "title": "" }, { "docid": "361e67ce94374a50c2abc6643548549c", "score": "0.62320584", "text": "function getQueryParameters() {\n var args = {};\n var urlParams = window.location.search.slice(1);\n if (urlParams.length > 0) {\n urlParams.split(\"&\").forEach(function (param) {\n var tokens = param.split(\"=\");\n args[tokens[0]] = decodeURIComponent(tokens[1]);\n });\n }\n return args;\n }", "title": "" }, { "docid": "13d5acf00d1c87b6825de5f586df7d7e", "score": "0.62304306", "text": "function getQueryObject() {\n var queryString = location.search.replace(/\\?/g, ''); // remove ?\n queryString = queryString.replace(/\\+/g, ' '); //remove +\n var queryArray = queryString.split('&');\n var paramsObj = {};\n queryArray.forEach(param => {\n var params = param.split('=');\n paramsObj[params[0]] = params[1];\n })\n return paramsObj;\n}", "title": "" }, { "docid": "038ebdfa5a092127ea7af87aa9312fcf", "score": "0.6207925", "text": "obtainQueryParams() {\n const params = new URLSearchParams(window.location.search);\n const ret = {};\n for (const param in this.parameters) {\n if (this.parameters[param].required || params.get(param) !== null) {\n ret[param] = params.get(param);\n }\n }\n return ret;\n }", "title": "" }, { "docid": "dffb7058f49534e6f1caf219eebd4880", "score": "0.619702", "text": "function objToFormURLEncoded(obj) {\n var formBody = [];\n for (var property in obj) {\n var encodedKey = encodeURIComponent(property);\n var encodedValue = encodeURIComponent(obj[property]);\n formBody.push(encodedKey + \"=\" + encodedValue);\n }\n formBody = formBody.join(\"&\");\n\n return formBody;\n}", "title": "" }, { "docid": "7a0a388bd7006330bc737fb53eeedf83", "score": "0.6194634", "text": "function _serialize(obj) {\n var query = [];\n var props = Object.getOwnPropertyNames(obj);\n props.forEach(function (prop) {\n query.push(encodeURIComponent(prop) + \"=\" + encodeURIComponent(obj[prop]));\n });\n return query.join(\"&\");\n}", "title": "" }, { "docid": "a8f153a29b8d5dd20b2841be85c24f8d", "score": "0.6177248", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]); })\n .join('&');\n}", "title": "" }, { "docid": "a8f153a29b8d5dd20b2841be85c24f8d", "score": "0.6177248", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]); })\n .join('&');\n}", "title": "" }, { "docid": "44220dbcf2f81ade0c812c4a1dc390e3", "score": "0.61757964", "text": "function toQueryString(data) {\n let data_str = \"\";\n Object.keys(data).forEach(k => {\n data_str += k + \"=\" + encodeURIComponent(data[k]) + \"&\";\n });\n return data_str.slice(0, -1); //remove last \"&\"\n}", "title": "" }, { "docid": "bc81b1f208d55f47cdd0ba85bec6a2b1", "score": "0.61752534", "text": "function urlencode(obj) {\n var pairs = [];\n for (var key in obj) {\n if ({}.hasOwnProperty.call(obj, key))\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]));\n }\n return pairs.join('&');\n}", "title": "" }, { "docid": "27c5ce45feb4e94349ccc90a6cc737c2", "score": "0.61750317", "text": "function getUrlParams (options$$1) {\n if (options$$1.url.indexOf('?') !== -1) {\n options$$1.requestParams = options$$1.requestParams || {};\n var queryString = options$$1.url.substring(options$$1.url.indexOf('?') + 1);\n options$$1.url = options$$1.url.split('?')[0];\n options$$1.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\n }\n options$$1.url = cleanUrl(options$$1.url.split('?')[0]);\n return options$$1;\n}", "title": "" }, { "docid": "c2d372098aec6d1377f6d87412823a73", "score": "0.6167674", "text": "function getUrlParameters() {\n let vars = {};\n let hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (let i = 0; i < hashes.length; i++) {\n let currVars = hashes[i].split(\"=\");\n vars[currVars[0]] = currVars[1];\n }\n return vars;\n}", "title": "" }, { "docid": "0027bf24e6838bed05f36324285563f0", "score": "0.61586607", "text": "UrlData () {\n const urlParams = new URLSearchParams(location.search)\n const result = {}\n for (const key of urlParams.keys()) {\n result[key] = urlParams.get(key)\n }\n return result\n }", "title": "" }, { "docid": "fe641f1acbd777c26d997a5cb4c8a8fc", "score": "0.6151645", "text": "function serializeURLParams(params) {\n var key, s;\n function add(key, value) {\n value = typeof value === 'function' ? value() : value == null ? '' : value;\n s[s.length] = encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }\n\n if (typeof params === 'object') {\n s = [];\n for (key in params) {\n if (params.hasOwnProperty(key)) {\n buildURLParams(key, params[key], add);\n }\n }\n }\n\n return s.join('&').replace(/%20/, '+');\n}", "title": "" }, { "docid": "699b1d877522a802a2cd80cbb18e6be3", "score": "0.6151334", "text": "function queryString() {\n let pairs = location.search.slice(1).split('&');\n\n let result = {};\n\n pairs.forEach(pair => {\n pair = pair.split('=');\n result[pair[0]] = decodeURIComponent(pair[1] || '');\n });\n\n return JSON.parse(JSON.stringify(result));\n}", "title": "" }, { "docid": "fa8ea0a4930555c4abc9e17f94029936", "score": "0.6135402", "text": "function objectToQueryString(base, obj) {\n var tmp;\n // If a custom toString exists bail here and use that instead\n if(isArray(obj) || (isObjectType(obj) && obj.toString === internalToString)) {\n tmp = [];\n iterateOverObject(obj, function(key, value) {\n if(base) {\n key = base + '[' + key + ']';\n }\n tmp.push(objectToQueryString(key, value));\n });\n return tmp.join('&');\n } else {\n if(!base) return '';\n return sanitizeURIComponent(base) + '=' + (isDate(obj) ? obj.getTime() : sanitizeURIComponent(obj));\n }\n }", "title": "" }, { "docid": "f1c9fff7a330370bf4635057e0078df8", "score": "0.6131402", "text": "function queryStringToObject(value) {\n return value.replace(/^\\?/, '').split('&').reduce(function (acc, val) {\n var _a = val.split('='), key = _a[0], value = _a[1];\n acc[key] = decodeURIComponent(value || '');\n return acc;\n }, {});\n }", "title": "" }, { "docid": "0f2353cbc2aa5bb38268e18e1431edc9", "score": "0.612454", "text": "function getUrlParams() {\n const vars = {};\n window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,\n (_,key,value) => vars[key] = value);\n return vars;\n }", "title": "" }, { "docid": "2e032683a8189fc1acf9a046a080fad6", "score": "0.6100832", "text": "function getParams() {\n var params = {};\n var url = parent.document.URL;\n\n if (url.match(/\\?/)) {\n var pairs = url.replace(/#.*$/, '').replace(/^.*\\?/, '').split(/[&;]/);\n for (var p in pairs) {\n var keyPair = pairs[p].split(/=/);\n params[keyPair[0]] = keyPair[1];\n }\n }\n return params;\n}", "title": "" }, { "docid": "362f60ec9eb7fa026e3876e03a98304c", "score": "0.6093646", "text": "function getQueryParams() {\n var match,\n pl = /\\+/g, // Regex for replacing addition symbol with a space\n search = /([^&=]+)=?([^&]*)/g,\n decode = function (s) { return decodeURIComponent(s.replace(pl, \" \")); },\n query = window.location.search.substring(1);\n\n urlParams = {};\n while (match = search.exec(query)){\n urlParams[decode(match[1])] = decode(match[2]);\n }\n return urlParams;\n}", "title": "" }, { "docid": "1da493898d4140086317c6f7dc4bd74d", "score": "0.6087529", "text": "function getQueryParameters(){\n var query = window.location.search;\n var queryObj = new Object();\n var queryArray = query.split(\"&\");\n for (var param in queryArray){\n paramArray = queryArray[param].split(\"=\");\n if (paramArray && paramArray.length == 2){\n var key = paramArray[0].substring(paramArray[0].indexOf('?')+1);\n queryObj[key] = paramArray[1];\n }\n }\n return queryObj;\n}", "title": "" }, { "docid": "28346c80d2993bbe26e1575becf68e72", "score": "0.6077499", "text": "function concatentateURLParameters() {\n var query = (window.location.search || '?').substr(1),\n map = [];\n query.replace(/([^&=]+)=?([^&]*)(?:&+|$)/g, function (match, key, value) {\n map.push(key + \" \" + value);\n });\n return map;\n }", "title": "" }, { "docid": "7d0e8e2c4ad09035c74e21928f40eca5", "score": "0.60745156", "text": "function retrieveURLArguments()\n{\n var prmstr = window.location.search.substr(1);\n var prmarr = prmstr.split (\"&\");\n var params = {};\n\n for ( var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params[tmparr[0]] = tmparr[1];\n }\n return params;\n}", "title": "" }, { "docid": "067d58e93ea799c129b0acbe29e99fbc", "score": "0.6070234", "text": "_toQueryString(params) {\n return '?' + Object.entries(params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n }", "title": "" }, { "docid": "c338fca58aad7b66d730d24ef03e354f", "score": "0.60640955", "text": "buildQueryParams(queryObject) {\n var q = [];\n if (queryObject) {\n for (var p in queryObject)\n if (queryObject.hasOwnProperty(p)) {\n q.push(\n encodeURIComponent(p) + \"=\" + encodeURIComponent(queryObject[p])\n );\n }\n }\n return \"?\" + q.join(\"&\");\n }", "title": "" }, { "docid": "e8ceb494324a339f27ff2ede418f9f52", "score": "0.60477656", "text": "parseUrlParams() {\n const [a, query] = window.location.href.split(\"?\");\n const obj = {};\n if (!query) {\n return obj;\n }\n query.split(\"&\").forEach((kv) => {\n const [key, value] = kv.split(\"=\");\n obj[key] = decodeURIComponent( value);\n });\n // console.log(obj);\n return obj;\n }", "title": "" }, { "docid": "950d4184de9a9d097f2adedc6620a064", "score": "0.6041669", "text": "function grabUrlEncodedVariables(){\n\t\tvar o = {};\n\t\tvar s = location.search.split('?');\n\t\tfor (var i = 1; i < s.length; i++) {\n\t\t\tvar a = s[i].split('&');\n\t\t\tfor (var j = 0; j < a.length; j++) {\n\t\t\t\tvar v = a[j].split('=');\n\t\t\t\to[v[0]] = v[1];\n\t\t\t};\n\t\t};\n\t\treturn o;\n\t}", "title": "" }, { "docid": "42aba9436d1b71d00bc6ee3861882fb1", "score": "0.60398227", "text": "function parseURLParameters() {\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n var output = {};\n for (var i=0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n output[pair[0]] = pair[1];\n }\n return output;\n}", "title": "" }, { "docid": "cc5dbbf67b7b35eeff8d2ba746584c97", "score": "0.60329056", "text": "function encode(obj){\n var query = [],\n arrValues, reg;\n forOwn(obj, function (val, key) {\n if (isArray(val)) {\n arrValues = key + '=';\n reg = new RegExp('&'+key+'+=$');\n forEach(val, function (aValue) {\n arrValues += encodeURIComponent(aValue) + '&' + key + '=';\n });\n query.push(arrValues.replace(reg, ''));\n } else {\n query.push(key + '=' + encodeURIComponent(val));\n }\n });\n return (query.length) ? '?' + query.join('&') : '';\n }", "title": "" }, { "docid": "02aca2a108121bf012866db7a911e0fc", "score": "0.6027707", "text": "function urlEncode(object) {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}", "title": "" }, { "docid": "ef4f3273d95111ea3343e9a48b2f3913", "score": "0.60239625", "text": "function getParams() {\n var params = {},\n pairs = document.URL.split('?')\n .pop()\n .split('&');\n for (var i = 0, p; i < pairs.length; i++) {\n p = pairs[i].split('=');\n params[ p[0] ] = p[1];\n }\n return params;\n}", "title": "" }, { "docid": "358b7e1f0afabbb6869fddfac62180ea", "score": "0.60163933", "text": "function getParameters() {\n var searchString = window.location.search.substring(1), \n params = searchString.split(\"&\"), \n hash = {};\n\n if (searchString == \"\") return {};\n for (var i = 0; i < params.length; i++) {\n var val = params[i].split(\"=\");\n hash[unescape(val[0])] = unescape(val[1]); \n }\n return hash;\n}", "title": "" }, { "docid": "b30639583a363cac590fc44b0e0a1566", "score": "0.6007783", "text": "function getURLParams() {\n\t// Get a string containing the URL parameters \n\tvar paramsString = window.location.href.split('?')[1];\n\n\t// If there are not URL parameters, return an empty object\n\tif (!paramsString) {\n\t\treturn {};\n\t}\n\t// Split the string containg the URL parameters into\n\t// key-value pairs\n\tvar pairs = paramsString.split('&');\n\n\t// Create an object containing the URL parameters and return it\n\tvar paramsObj = {};\n\tfor (var i = 0; i < pairs.length; i++) {\n\t\tvar pair = pairs[i].split('=');\n\t\tparamsObj[pair[0]] = pair[1];\n\t}\n\treturn paramsObj;\n}", "title": "" }, { "docid": "46c553f4b489048335269ac6480459db", "score": "0.59819496", "text": "function objectToString(obj){\n return Object.keys(obj).map((key) => {if(key != null && key != \"\" && obj[key] != null) return `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`}).join(\"&\");\n}", "title": "" }, { "docid": "3097124b073bc54429a50b6c901ac297", "score": "0.59736294", "text": "function getUrlParams() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \n function(m, key, value) {\n if (value == \"false\") vars[key] = false;\n else if (value == \"true\") vars[key] = true;\n else vars[key] = value;\n });\n return vars;\n }", "title": "" }, { "docid": "2675f41dfb59ffad64e2256ebfee5611", "score": "0.5964499", "text": "function urlparams() {\n var params = {};\n if (location.href.indexOf('?') < 0) return params;\n\n PUBNUB.each(\n location.href.split('?')[1].split('&'),\n function(data) { var d = data.split('='); params[d[0]] = d[1]; }\n );\n\n return params;\n}", "title": "" }, { "docid": "e6d4bded1dacc9e01565a48986fd1b2a", "score": "0.5964073", "text": "getUrlParams (str) {\n let queryString = str || window.location.search || '';\n let keyValPairs = [];\n let params = {};\n\n queryString = queryString.replace(/.*?\\?/,\"\");\n if (queryString.length)\n {\n keyValPairs = queryString.split('&');\n for (let i = 0; i < keyValPairs.length; i++)\n {\n let pairNum = keyValPairs[i];\n let key = pairNum.split('=')[0];\n if (!key.length) continue;\n if (typeof params[key] === 'undefined')\n params[key] = [];\n params[key].push(pairNum.split('=')[1]);\n }\n }\n return params;\n }", "title": "" }, { "docid": "5349ae9a26b3939ffbd941cb8bfcc3fe", "score": "0.5963682", "text": "function getQueryString(data) {\n if (data === undefined)\n return '';\n return Object.keys(data)\n .map(function (key) {\n var val = encodeURIComponent(data[key]);\n return key + \"=\" + val;\n })\n .join('&');\n}", "title": "" }, { "docid": "486eb2ce6e6d078481a1150058b3eb07", "score": "0.59594303", "text": "function getURLArg() {\n\tvar\n\t\tsearch_array = window.location.search.substring(1).split('&'),\n\t\thash_array = window.location.hash.substring(1).split('&'),\n\t\tparams = {search: {}, hash: {}},\n\t\ttmp,\n\t\ti\n\t;\n\tfor (i = search_array.length; i-- > 0;) {\n\t\ttmp = search_array[i].split('=');\n\t\tparams.search[tmp[0]] = params[tmp[0]] = tmp[1] || null;\n\t}\n\tfor (i = hash_array.length; i-- > 0;) {\n\t\ttmp = hash_array[i].split('=');\n\t\tparams.hash[tmp[0]] =params[tmp[0]] = tmp[1] || null;\n\t}\n\treturn params;\n}", "title": "" }, { "docid": "6a59e06a2bc5c4aee0cccba0d2b20c85", "score": "0.59494245", "text": "function getUrlParams() {\n\tvar vars = {};\n\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,\n\t\t\tfunction(m, key, value) {\n\t\t\t\tvars[key] = value;\n\t\t\t});\n\treturn vars;\n}", "title": "" }, { "docid": "58ba587a317682349f473e42b89d6cb3", "score": "0.59416294", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n return acc;\n }, {});\n }", "title": "" }, { "docid": "58ba587a317682349f473e42b89d6cb3", "score": "0.59416294", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n return acc;\n }, {});\n }", "title": "" }, { "docid": "5b03971c13e1b9dbf4a55db2b353ffdf", "score": "0.594007", "text": "function getURLParmsObj(query){\n query = query.replace('?','');\n var params = query.split('&');\n var paramObj = params.map(function(item){\n var values = item.split('=');\n var obj = {};\n obj[values[0]] = values[1];\n return obj;\n });\n return paramObj;\n }", "title": "" }, { "docid": "c422401e9315759847f880b020e7c5c7", "score": "0.59370035", "text": "function getURLParams() {\n\tvar query_string = {};\n\tvar query = window.location.search.substring(1);\n\tvar vars = query.split(\"&\");\n\tfor (var i=0;i<vars.length;i++) {\n\t\tvar pair = vars[i].split(\"=\");\n\t\t\t\t// If first entry with this name\n\t\tif (typeof query_string[pair[0]] === \"undefined\") {\n\t\t\tif (pair[1].indexOf('|') > -1) {\n\t\t\t\tquery_string[pair[0]] = [];\n\t\t\t\tvar arrVals = pair[1].split('|');\n\t\t\t\tfor (var j=0; j<arrVals.length; j++) {\n\t\t\t\t\tquery_string[pair[0]].push(decodeURIComponent(arrVals[j]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tquery_string[pair[0]] = decodeURIComponent(pair[1]);\n\t\t\t}\n\t\t\t\t// If second entry with this name\n\t\t} else if (typeof query_string[pair[0]] === \"string\") {\n\t\t\tvar arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n\t\t\tquery_string[pair[0]] = arr;\n\t\t\t\t// If third or later entry with this name\n\t\t} else {\n\t\t\tquery_string[pair[0]].push(decodeURIComponent(pair[1]));\n\t\t}\n\t}\n\treturn query_string;\n}", "title": "" }, { "docid": "c98a22e60c0945880a030ae0a51af9eb", "score": "0.5934644", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n acc[key] = decodeURIComponent(value || '');\n return acc;\n }, {});\n }", "title": "" }, { "docid": "c98a22e60c0945880a030ae0a51af9eb", "score": "0.5934644", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n acc[key] = decodeURIComponent(value || '');\n return acc;\n }, {});\n }", "title": "" }, { "docid": "33b92ca2cd51dd0c32324cce709d321a", "score": "0.59332216", "text": "function getQueryString(data) {\n if (!data || typeof data !== 'object' || !Object.keys(data).length)\n return '';\n return '?' + Object.keys(data).map((k) => {\n const value = (typeof data[k] === 'object')\n ? JSON.stringify(data[k])\n : encodeURIComponent(data[k]);\n return `${encodeURIComponent(k)}=${value}`;\n }).join('&');\n}", "title": "" }, { "docid": "0bb64ed88a5b01afd1fb90a331ea4bc9", "score": "0.5926158", "text": "function custom_query_params_get() {\n var query = document.location.href.split(/\\?/);\n var query_params = {};\n \n if (query[1] != undefined && query[1] != '') {\n query = query[1].split(/\\&/);\n \n for (var i = 0; i < query.length; i++) {\n var params = query[i].split(/\\=/);\n query_params[params[0]] = params[1];\n }\n }\n \n return query_params;\n}", "title": "" }, { "docid": "273d1c19d31821b0d1ffa599ead34936", "score": "0.59223175", "text": "function getUrlVars() {\n var hash;\n var myJson = {};\n var hashes = url.slice(url.indexOf('?') + 1).split('&');\n for (var i = 0; i < hashers.length; i++) {\n hash = hashes[i].split('=')\n myJson[hash[0]] = hash[1];\n }\n\n return JSON.stringify(myJson);\n }", "title": "" }, { "docid": "d6380807df560636d97abf275287355c", "score": "0.5904106", "text": "function urlObject(url) {\n // /scheduled?view=calendar&type=month&date=01-06-2016\n var optionsStartIndex = url.lastIndexOf('?');\n var options = url.slice(optionsStartIndex).replace('?', '&').split('&');\n var options = _.compact(options);\n var parameters = [];\n _.each(options, function(option){\n var parameter = [];\n var keyValue = option.split('=');\n parameter[keyValue[0]] = keyValue[1];\n addObject(parameters, keyValue)\n });\n parameters = _.object(parameters);\n return parameters;\n }", "title": "" }, { "docid": "68ea78094fc35c0bc621aa620842e81f", "score": "0.5872912", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "title": "" }, { "docid": "04a26fc660e2730f6844c2add7e62456", "score": "0.5866966", "text": "formatQueryParams(params) {\nconst queryItems = Object.keys(params)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)\nreturn queryItems.join('&');\n}", "title": "" }, { "docid": "b23733e92babde625f1ac1fa4b3b7b60", "score": "0.58656085", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "title": "" }, { "docid": "a09461ca31965ba09df3b9d672f2f865", "score": "0.58598816", "text": "function urlEncode(obj) {\r\n\tvar s = '';\r\n\tfor (var key in obj) {\r\n\t\ts += encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]) + '&';\r\n\t}\r\n\tif (s.length > 0) {\r\n\t\ts = s.substr(0, s.length - 1);\r\n\t}\r\n\r\n\treturn (s);\r\n}", "title": "" }, { "docid": "040f175827dd6b5dfc209a82519fb283", "score": "0.5856751", "text": "function getUrlParams() {\n\n\t\tvar parts = window.location.toString().split('/');\n\t\tvar params = {};\n\n\t\t$.each(parts, function(key, val){\n\t\t\tif (val.indexOf('http') < 0 && val.indexOf(':') > -1) {\n\t\t\t\tvar keyval = val.split(':');\n\t\t\t\tparams[keyval[0]] = keyval[1];\n\t\t\t}\n\t\t});\n\n\t\treturn params;\n\t}", "title": "" }, { "docid": "1ca220619f061ce5cf1a44757a7bcf0a", "score": "0.5855519", "text": "function makeURL(params) {\n if (!params) {\n return \"\";\n }\n else return Object.keys(params).map(key => `${key}=${params[key]}`).join(\"&\"); \n}", "title": "" }, { "docid": "1f653d62945bba71f0a0f71ef1f51677", "score": "0.58476746", "text": "function urlQuery() {\n if (typeof document === \"undefined\" || !document.location) return {};\n return (document.location.search || \"\").replace(/^\\?/, \"\").split(\"&\").reduce(function (query$$1, ea) {\n var split = ea.split(\"=\"),\n key = split[0],\n value = split[1];\n if (value === \"true\" || value === \"false\") value = eval(value);else if (!isNaN(Number(value))) value = Number(value);\n query$$1[key] = value;\n return query$$1;\n }, {});\n}", "title": "" }, { "docid": "1f653d62945bba71f0a0f71ef1f51677", "score": "0.58476746", "text": "function urlQuery() {\n if (typeof document === \"undefined\" || !document.location) return {};\n return (document.location.search || \"\").replace(/^\\?/, \"\").split(\"&\").reduce(function (query$$1, ea) {\n var split = ea.split(\"=\"),\n key = split[0],\n value = split[1];\n if (value === \"true\" || value === \"false\") value = eval(value);else if (!isNaN(Number(value))) value = Number(value);\n query$$1[key] = value;\n return query$$1;\n }, {});\n}", "title": "" }, { "docid": "dfd311b7a1ccce09794bb74fdf640877", "score": "0.5847005", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "title": "" }, { "docid": "e93642f9b82aa4671d354092867cb93f", "score": "0.58458805", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" } ]
c760297ac8b7f8fbcc987d2e7805be9a
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same
[ { "docid": "beea1dfd7c9371c46fc98e79e4fdd2fd", "score": "0.0", "text": "function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }", "title": "" } ]
[ { "docid": "1feb4ccf40053ba4ba6e232df98d35b2", "score": "0.7133998", "text": "function inspect(){if(!this.isValid()){return\"moment.invalid(/* \"+this._i+\" */)\"}var func=\"moment\";var zone=\"\";if(!this.isLocal()){func=this.utcOffset()===0?\"moment.utc\":\"moment.parseZone\";zone=\"Z\"}var prefix=\"[\"+func+\"(\\\"]\";var year=0<=this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\";var datetime=\"-MM-DD[T]HH:mm:ss.SSS\";var suffix=zone+\"[\\\")]\";return this.format(prefix+year+datetime+suffix)}", "title": "" }, { "docid": "265a84e92e839d1fb84b9a8078538c5b", "score": "0.70793694", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "title": "" }, { "docid": "265a84e92e839d1fb84b9a8078538c5b", "score": "0.70793694", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "title": "" }, { "docid": "265a84e92e839d1fb84b9a8078538c5b", "score": "0.70793694", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "title": "" }, { "docid": "265a84e92e839d1fb84b9a8078538c5b", "score": "0.70793694", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\t\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "4a64c5952a9132031633867fc06975af", "score": "0.70553046", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "53fb826b4a87bd09bb11e64bb77f0b07", "score": "0.7051972", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t }", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "ea11731976878de02b14946e00ae2b8a", "score": "0.70479727", "text": "function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}", "title": "" }, { "docid": "75fea4007b270cff0af157f6acfd1139", "score": "0.7047397", "text": "function inspect () {\r\n if (!this.isValid()) {\r\n return 'moment.invalid(/* ' + this._i + ' */)';\r\n }\r\n var func = 'moment';\r\n var zone = '';\r\n if (!this.isLocal()) {\r\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\r\n zone = 'Z';\r\n }\r\n var prefix = '[' + func + '(\"]';\r\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\r\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\r\n var suffix = zone + '[\")]';\r\n\r\n return this.format(prefix + year + datetime + suffix);\r\n}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "9b3d5cf6573df06629a449915ca71249", "score": "0.70463514", "text": "function inspect () {\n\t if (!this.isValid()) {\n\t return 'moment.invalid(/* ' + this._i + ' */)';\n\t }\n\t var func = 'moment';\n\t var zone = '';\n\t if (!this.isLocal()) {\n\t func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t zone = 'Z';\n\t }\n\t var prefix = '[' + func + '(\"]';\n\t var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t var suffix = zone + '[\")]';\n\n\t return this.format(prefix + year + datetime + suffix);\n\t}", "title": "" }, { "docid": "f0ba9bf61806e9336f1fb615f9665a4d", "score": "0.704548", "text": "function inspect() {\n\t\t\t\t\tif (!this.isValid()) {\n\t\t\t\t\t\treturn 'moment.invalid(/* ' + this._i + ' */)';\n\t\t\t\t\t}\n\t\t\t\t\tvar func = 'moment';\n\t\t\t\t\tvar zone = '';\n\t\t\t\t\tif (!this.isLocal()) {\n\t\t\t\t\t\tfunc = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n\t\t\t\t\t\tzone = 'Z';\n\t\t\t\t\t}\n\t\t\t\t\tvar prefix = '[' + func + '(\"]';\n\t\t\t\t\tvar year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n\t\t\t\t\tvar datetime = '-MM-DD[T]HH:mm:ss.SSS';\n\t\t\t\t\tvar suffix = zone + '[\")]';\n\n\t\t\t\t\treturn this.format(prefix + year + datetime + suffix);\n\t\t\t\t}", "title": "" } ]
39e61c9707b431a2b637f8a36e201484
Cancel My Join Request
[ { "docid": "dee68c5899ab5bbb746a033b02731ee5", "score": "0.642913", "text": "cancelMyJoinRequest(token, onOK, onError) {\n axios.post(\"/team/request/cancel\",null,\n // { headers: this.createHeader(), withCredentials: true})\n { headers: this.createHeader(token),})\n .then((response) => {onOK(response);})\n .catch((error) => {onError(error);});\n }", "title": "" } ]
[ { "docid": "7d03f8b4605ef3b763feab1371ee22de", "score": "0.6808784", "text": "cancelJoin(e) {\n this.setState({\n showJoinModal: false,\n })\n }", "title": "" }, { "docid": "934934fcb12d5789530c65876e968cfc", "score": "0.6585398", "text": "function cancelRequest(request, button) {\n\t\trequest.abort();\n\t\tbutton.classList.remove(\"working\");\n\t\tbutton.disabled = false;\n\t}", "title": "" }, { "docid": "d9981ef324a64c5d58281c0fe7ef1d2f", "score": "0.6421594", "text": "abort () {\n this.requests.forEach(req => req.abort())\n super.abort()\n }", "title": "" }, { "docid": "3603c1c3cc60b40d49580b931f492a61", "score": "0.6343468", "text": "function sendCancelRequest(token) {\n console.log(\"sending cancel request...\");\n connection.send(JSON.stringify({\n type: \"cancelRequest\",\n token: token,\n }));\n}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.6291898", "text": "function Cancellation() {}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.6291898", "text": "function Cancellation() {}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.6291898", "text": "function Cancellation() {}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.6291898", "text": "function Cancellation() {}", "title": "" }, { "docid": "324ae5219a40368f328fdfd61cf9f145", "score": "0.6260618", "text": "cancel(from, afterCreate, afterMined) {\n CampaignService.cancel(this, from, afterCreate, afterMined);\n }", "title": "" }, { "docid": "902201b22b35daa3f3d4b8baf52179e2", "score": "0.6248715", "text": "cancelRequest({ requests }, key) {\n const requestsForKey = requests[key];\n requestsForKey.last.state = 'canceled';\n requestsForKey.cancelId += 1;\n }", "title": "" }, { "docid": "1b48e02bccc5febe6d0cb1b9ebb3b448", "score": "0.6209508", "text": "cancel() {\n const { _url, serverSettings } = this;\n const init = { method: 'DELETE' };\n const promise = serverconnection_1.ServerConnection.makeRequest(_url, init, serverSettings);\n return promise.then(response => {\n if (response.status !== 204) {\n throw new serverconnection_1.ServerConnection.ResponseError(response);\n }\n });\n }", "title": "" }, { "docid": "ca50a0dbb269db9feb3a6d5fc81f7bd4", "score": "0.6195712", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = redux_saga_core_esm_CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(TASK_CANCEL, false);\n }\n }", "title": "" }, { "docid": "c0c01c2dcd8848c0c7ee7183cd300d77", "score": "0.61906725", "text": "function Cancellation() { }", "title": "" }, { "docid": "c0c01c2dcd8848c0c7ee7183cd300d77", "score": "0.61906725", "text": "function Cancellation() { }", "title": "" }, { "docid": "1f0cb54aa016bc2147fc0e822c736b33", "score": "0.61889744", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"j\" /* TASK_CANCEL */], false);\n }\n }", "title": "" }, { "docid": "1f0cb54aa016bc2147fc0e822c736b33", "score": "0.61889744", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"j\" /* TASK_CANCEL */], false);\n }\n }", "title": "" }, { "docid": "81f491544c13c0c30680ade253c95115", "score": "0.61690646", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED$1;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"j\" /* TASK_CANCEL */], false);\n }\n }", "title": "" }, { "docid": "50313cfe06d92b6221b3a2b372c604a3", "score": "0.61673236", "text": "function cancel() {\n logging.info('Email analytics fetch-all job cancelled before completion');\n\n if (parentPort) {\n parentPort.postMessage('cancelled');\n } else {\n setTimeout(() => {\n process.exit(0);\n }, 1000);\n }\n}", "title": "" }, { "docid": "571d5c00fda443a31dced7c754102c86", "score": "0.6166173", "text": "function _clientRequestAbort(rid) {\n\n\tvar\n\t\tself = this;\n\n\treturn self._command(\"abort\",{rid: rid});\n\n}", "title": "" }, { "docid": "6822594448b47e9075392ab83a90f373", "score": "0.614741", "text": "cancel () {\n this._fetching = false\n }", "title": "" }, { "docid": "184435f09de6af95f5710adf10ef0062", "score": "0.61368823", "text": "cancel() {}", "title": "" }, { "docid": "184435f09de6af95f5710adf10ef0062", "score": "0.61368823", "text": "cancel() {}", "title": "" }, { "docid": "5c0543dbfb1cbbfb6293de0ebd0b99ad", "score": "0.6128841", "text": "function onLeavingChallengesAdvertising() {\n $timeout.cancel(updaterHndl);\n }", "title": "" }, { "docid": "98635d3a13598ce0553977ba1629ddb3", "score": "0.6092834", "text": "function cancelQueryById(requestId) {\n //console.log(\"Cancelling query: \" + requestId);\n var query = 'delete from system:active_requests where requestId = \"' +\n requestId + '\";';\n\n executeQueryUtil(query,false)\n\n .then(function success() {\n// console.log(\"Success cancelling query.\");\n// console.log(\" Data: \" + JSON.stringify(data));\n// console.log(\" Status: \" + JSON.stringify(status));\n },\n\n // sanity check - if there was an error put a message in the console.\n function error(resp) {\n logWorkbenchError(\"Error cancelling query: \" + JSON.stringify(resp));\n// var data = resp.data, status = resp.status;\n// console.log(\"Error cancelling query: \" + query);\n// console.log(\" Response: \" + JSON.stringify(resp));\n// console.log(\" Status: \" + JSON.stringify(status));\n });\n }", "title": "" }, { "docid": "261a9a9748864a13401f2851cb395205", "score": "0.6087179", "text": "function cancel(requestDetails) {\n //console.log(\"Canceling: \" + requestDetails.url);\n return {cancel: true};\n}", "title": "" }, { "docid": "7a392d7dc1eab12a46f44dab5dfa63d3", "score": "0.608469", "text": "cancel() {\n (0, errors_js_1.assert)(this.#signal != null, \"request has not been sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.cancel\" });\n const signal = fetchSignals.get(this);\n if (!signal) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal();\n }", "title": "" }, { "docid": "a1aa8997a400698ce783e48ef2a73e29", "score": "0.60702854", "text": "function cancel() {\r\n var job = this;\r\n\r\n job.isComplete = true;\r\n }", "title": "" }, { "docid": "a1aa8997a400698ce783e48ef2a73e29", "score": "0.60702854", "text": "function cancel() {\r\n var job = this;\r\n\r\n job.isComplete = true;\r\n }", "title": "" }, { "docid": "a1aa8997a400698ce783e48ef2a73e29", "score": "0.60702854", "text": "function cancel() {\r\n var job = this;\r\n\r\n job.isComplete = true;\r\n }", "title": "" }, { "docid": "a1aa8997a400698ce783e48ef2a73e29", "score": "0.60702854", "text": "function cancel() {\r\n var job = this;\r\n\r\n job.isComplete = true;\r\n }", "title": "" }, { "docid": "a79c8ad5bafa90f8e562fb02618391b4", "score": "0.6064802", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"], false);\n }\n }", "title": "" }, { "docid": "a79c8ad5bafa90f8e562fb02618391b4", "score": "0.6064802", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"], false);\n }\n }", "title": "" }, { "docid": "4613b95f248712038f7ca9363a8f498b", "score": "0.60448736", "text": "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED$1;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(TASK_CANCEL, false);\n }\n }", "title": "" }, { "docid": "21b2956c6f3ff882319b6917226a8ec4", "score": "0.60328645", "text": "function cancelCb(notifyParent) {\n if (currentNetworkRequest) {\n currentNetworkRequest.cancel();\n currentNetworkRequest = null;\n }\n\n Curtain.hide();\n\n if (notifyParent) {\n parent.postMessage({\n type: 'abort',\n data: ''\n }, fb.CONTACTS_APP_ORIGIN);\n }\n }", "title": "" }, { "docid": "9ce0812e397562fc9c785432164bc2d7", "score": "0.6026061", "text": "function cancel() {\r\n var job;\r\n\r\n job = this;\r\n\r\n handleCompletion.call(job);\r\n }", "title": "" }, { "docid": "ca36de3f3e5b995d1c952db0e6dd5bd9", "score": "0.6019322", "text": "function cancelQuery() {\n xhr.abort();\n hideLoading();\n }", "title": "" }, { "docid": "a6b4ee05c18f74b4e0034ce12adcaef1", "score": "0.60141426", "text": "stop() {\n\t\tthis.request.abort();\n\t\tif(this.iex){\n\t\t\tthis.socket.disconnect();\n\t\t}\n\t}", "title": "" }, { "docid": "54242d44fafa24502d3ae04ae05652c6", "score": "0.5986743", "text": "function cancelTask(token) {\n console.log(\"sending cancel request...\");\n connection.send(JSON.stringify({\n type: \"cancelRequest\",\n token: token,\n }));\n}", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "0f75228e33b4e93eb8cf5ce56dc8b70b", "score": "0.5982403", "text": "function cancel() {\r\n var job = this;\r\n\r\n handleComplete.call(job, true);\r\n }", "title": "" }, { "docid": "eaf133d8b7dd22f9df3d9dd927105bdd", "score": "0.59668285", "text": "function cancel(){if(status===RUNNING){// Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n// effects in the iterator's finally block will still be executed\nstatus=CANCELLED;queue.cancelAll();// Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\nend(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"j\"/* TASK_CANCEL */],false);}}", "title": "" }, { "docid": "eaf133d8b7dd22f9df3d9dd927105bdd", "score": "0.59668285", "text": "function cancel(){if(status===RUNNING){// Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n// effects in the iterator's finally block will still be executed\nstatus=CANCELLED;queue.cancelAll();// Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\nend(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"j\"/* TASK_CANCEL */],false);}}", "title": "" }, { "docid": "eba962bd03aca64ba1000736901eea9d", "score": "0.5947075", "text": "function cancelQuery() {\n// console.log(\"Cancelling query, currentQuery: \" + qwQueryService.currentQueryRequest);\n if (qwQueryService.currentQueryRequest != null) {\n var queryInFly = mnPendingQueryKeeper.getQueryInFly(qwQueryService.currentQueryRequest);\n queryInFly && queryInFly.canceler(\"test\");\n\n //\n // also submit a new query to delete the running query on the server\n //\n\n var query = 'delete from system:active_requests where clientContextID = \"' +\n qwQueryService.currentQueryRequestID + '\";';\n\n// console.log(\" queryInFly: \" + queryInFly + \"\\n query: \" + query);\n\n executeQueryUtil(query,false)\n\n .then(function success() {\n// console.log(\"Success cancelling query.\");\n// console.log(\" Data: \" + JSON.stringify(data));\n// console.log(\" Status: \" + JSON.stringify(status));\n },\n\n // sanity check - if there was an error put a message in the console.\n function error(resp) {\n// var data = resp.data, status = resp.status;\n logWorkbenchError(\"Error cancelling query: \" + JSON.stringify(resp));\n// console.log(\"Error cancelling query.\");\n// console.log(\" Data: \" + JSON.stringify(data));\n// console.log(\" Status: \" + JSON.stringify(status));\n });\n\n }\n }", "title": "" }, { "docid": "96442ff686fc03a76574f209a1349b53", "score": "0.5939245", "text": "function cancel() {\n\t /**\r\n\t We need to check both Running and Cancelled status\r\n\t Tasks can be Cancelled but still Running\r\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\r\n\t Ending with a Never result will propagate the Cancellation to all joiners\r\n\t **/\n\t end(TASK_CANCEL);\n\t }\n\t }", "title": "" }, { "docid": "ebb05eb9a321ad86c1e7e71d6ec692fe", "score": "0.5927945", "text": "abort()\n {\n const priv = d.get(this);\n\n // abort the queued requests\n priv.queue.forEach(item => item.reject(\"aborted\"));\n priv.queue.length = 0;\n\n // abort the active requests\n if (priv.aborter)\n {\n priv.aborter.abort();\n // can't reuse the old abort controller\n priv.aborter = new AbortController();\n }\n }", "title": "" }, { "docid": "ef63d8967b37e2bee4f1ab0879788e40", "score": "0.59193194", "text": "cancel() {\n this._canceled = true;\n this.emit('end');\n }", "title": "" }, { "docid": "0b577de8f8925d7bad5accb47d702dbc", "score": "0.5899358", "text": "function cancel() {\n canceler.resolve(\"http call aborted\");\n }", "title": "" }, { "docid": "621d9c093fd1f5bbdbd430a4b992e1f8", "score": "0.5890495", "text": "function cancelEvent (eventJoined){\n console.log(eventJoined)\n eventsService.cancelEvent(eventJoined);\n for (var i = 0; i < vm.eventData.joinedEvents.length; i++) {\n if (vm.eventData.joinedEvents[i].id === eventJoined.id && vm.eventData.joinedEvents[i].eventTimeId === eventJoined.eventTimeId) {\n vm.eventData.joinedEvents.splice(i,1);\n }\n }\n }", "title": "" }, { "docid": "1d793d1dd6c3b16027d93a803f647ee2", "score": "0.58712584", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "3736469872de4e6a954623af6d98ba06", "score": "0.5869103", "text": "function cancel() {\n\t /**\n\t We need to check both Running and Cancelled status\n\t Tasks can be Cancelled but still Running\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\n\t Ending with a Never result will propagate the Cancellation to all joiners\n\t **/\n\t end(TASK_CANCEL);\n\t }\n\t }", "title": "" }, { "docid": "3b70aa173da8527aca01c6c4d3cc5477", "score": "0.58389556", "text": "function cancel(){n.fire(\"cancel\")}", "title": "" }, { "docid": "bb18ac5937e17216b4a620bb13a9ff0b", "score": "0.58246017", "text": "requestJoin(options, isNew) {\n console.log('requestJoin: ', options, ' isNew: ', isNew, ' worker: ', cluster.worker.id)\n // Prevent the client from joining the same room from another browser tab\n return this.clients.filter(c => c.id === options.clientId).length === 0\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "6da60d47322df95bb323397e340d9c07", "score": "0.5819809", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "title": "" }, { "docid": "2e74b38b70db805cf3de39bae98b3a53", "score": "0.5807217", "text": "abortAll() {\n while(this._ongoingRequests.length > 0) {\n let request = this._ongoingRequests.pop();\n request.abort();\n }\n }", "title": "" }, { "docid": "db1bd0b885273ca2f2693306f664ccc7", "score": "0.5801916", "text": "function procCancel()\n{\n if (this.url_cancel != '')\n {\n try \n { \n var reqObj = new XMLHttpRequest();\n var uri = this.url_cancel;\n\n reqObj.open('GET', encodeURI(uri), true);\n var obj = this; \n reqObj.onreadystatechange = function(){obj.onCancelMsgState();};\n dumpLog(\"procCancel:send cancel url=\" + uri);\n reqObj.send(null);\n }\n catch(ex)\n {\n return;\n }\n }\n}", "title": "" }, { "docid": "580d86ab4d8ed97130c74cd19f67a6e1", "score": "0.57983994", "text": "componentWillUnmount() {\n if (this.requestSource) {\n // console.log('Cancelling in-flight request:', this.requestSource);\n this.requestSource.cancel();\n }\n }", "title": "" }, { "docid": "5ed78d22c677cb7e41bb8bb675fdf0c0", "score": "0.57961285", "text": "static cancelRequests() {\n axios.cancelAll()\n setTimeout(() => axios.cancel('starters'), 0)\n }", "title": "" }, { "docid": "ff0a9682c770cd2762440ae2e39258e6", "score": "0.5789873", "text": "function cancel () {\n\t\t\tclearExistingTimeout();\n\t\t\tcancelled = true;\n\t\t}", "title": "" }, { "docid": "50fc744c7c4d46aeb70e7bde0b53896d", "score": "0.5773004", "text": "function cancelFetchAll(request, isTimeout) {\n clearTimeout(fetchAll.timeout);\n console.log('cancelled, from timeout? ', isTimeout);\n}", "title": "" }, { "docid": "6c75053768e7d44743296df210182a0d", "score": "0.57471025", "text": "cancel() {\n if (!this.canCancel || !this.isActive) return;\n this.close();\n }", "title": "" }, { "docid": "394a5d105dc502157b7410773bbfe6ea", "score": "0.57351774", "text": "abort() {\n\t\t\tget( this, \"auth\" ).abortSignin();\n\t\t}", "title": "" }, { "docid": "7e7b263264ba7133eb6e5bec82692849", "score": "0.57300043", "text": "function cancelPopups() {\r\n\tCF.setJoins([{join: \"d1\", value: 0}, {join: \"d2\", value: 0}, {join: \"d3\", value: 0}, {join: \"s2\", value: \"\"}]);\r\n}", "title": "" }, { "docid": "61c840401d02d1ce9837c18b6850bc53", "score": "0.572917", "text": "onCancel() {\n\t\tthis.done();\n\t}", "title": "" }, { "docid": "2d11fe115f925c1c3cf63826b88ec5c9", "score": "0.571892", "text": "cancelAuthorisation() {\n this._authorisationHeader = null;\n this._deleteAuthorisation = false;\n }", "title": "" }, { "docid": "bb2897954bd2e17d8362caf846c26379", "score": "0.5717686", "text": "stopRequesting() {\n this.data = [];\n clearInterval(this.data_request);\n }", "title": "" }, { "docid": "53789d119a298b6ec9e66958fccd46e1", "score": "0.5708069", "text": "abort() {\n this.bAbort = true;\n this.httpRequestFetcher?.abort();\n }", "title": "" }, { "docid": "2bdedc2e428af6db2e5dc5141e1f476c", "score": "0.5703777", "text": "function stop() {\n if (request_ == null)\n return;\n\n view.clearTimeout(timeoutTimer_);\n stop_ = true;\n request_.abort();\n request_ = null;\n callbackObject_ = null;\n }", "title": "" }, { "docid": "af9f5e3724de3d97c56337bc6529659c", "score": "0.56943554", "text": "handleClickCancel(event) {\n event.preventDefault();\n\n FlowRouter.go('/lobby');\n }", "title": "" }, { "docid": "7622432e997ca396b2b2b9f4fc4a3901", "score": "0.5682593", "text": "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (task._isRunning && !task._isCancelled) {\n task._isCancelled = true\n taskQueue.cancelAll()\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL)\n }\n }", "title": "" }, { "docid": "ae4998188d07219899dfb60c15026662", "score": "0.56639093", "text": "function cancel() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n }", "title": "" }, { "docid": "82bb4ad4c98a4d4b4e43fb392444a77e", "score": "0.5652338", "text": "attemptCancelRequest(res, data, callback){\n module.exports.getUserStatus(res, data.user_id, function(user){\n if(user.status != status.waiting){\n gen.simpleError(res, \"User Cannot cancel Request at this time\")\n }\n else{\n callback()\n }\n })\n}", "title": "" }, { "docid": "2d9ad5d91a8122112090067100b874e4", "score": "0.5648934", "text": "abort() {\n // TODO (no native way to cancel unresolved yet promises)\n // maybe using Promise.race() with a cancellable promise and\n // the result of Promise.all in a same Array / iterable ... ?\n }", "title": "" }, { "docid": "53b7b3c051af79e4ee41a9be55f61a6e", "score": "0.5647036", "text": "function rejectRequest(username) {\n\t\t \tvar input = \"{\\\"username\\\":\\\"\" + username + \"\\\"}\";\n\t client.deleteRequest(\n\t input,\n\t function(data,type) {\n\t // Request successfully deleted\n\t \tgetContactRequests();\n\t \t\t\tconsole.log(data);\n\t },\n\t function(error) {\n\t // Error while deleting request\n\t console.log(error);\n\t }\n\t );\n\t $(\"#contactRequest\"+username).remove();\n\t }", "title": "" }, { "docid": "5e9176782502a60d115ee4fe1b65f9c4", "score": "0.5645907", "text": "cancel(){const deferred=new Deferred();repoOnDisconnectCancel(this._repo,this._path,deferred.wrapCallback(()=>{}));return deferred.promise;}", "title": "" }, { "docid": "647a11e8608cc624ffee0b244b2bf77b", "score": "0.5626172", "text": "_maybeCancelCountdown(lobby) {\n if (!this.lobbyCountdowns.has(lobby.name)) {\n return\n }\n\n const countdown = this.lobbyCountdowns.get(lobby.name)\n countdown.timer.reject(new Error('Countdown cancelled'))\n this.lobbyCountdowns = this.lobbyCountdowns.delete(lobby.name)\n this._publishTo(lobby, {\n type: 'cancelCountdown',\n })\n this._publishListChange('add', Lobbies.toSummaryJson(lobby))\n }", "title": "" }, { "docid": "2c07556128c58f67fec0d063a2910773", "score": "0.56209", "text": "function handleDeclineFriend(props){\n //ref alla richiesta \n var req = firebase.database().ref('users/'+currentUser.uid+'/requests/'+props.rid)\n //rimozione della richiesta\n req.remove()\n window.location.reload();\n }", "title": "" } ]
acf3c7f6e39be99fd1a0681d3836d4cd
Find Pivot Index We define the pivot index as the index where the sum of the numbers to the left of the index is equal to the sum of the numbers to the right of the index. If no such index exists, we should return 1. If there are multiple pivot indexes, you should return the leftmost pivot index. Input: nums = [1, 7, 3, 6, 5, 6] Output: 3 Explanation: The sum of the numbers to the left of index 3 (nums[3] = 6) is equal to the sum of numbers to the right of index 3. Also, 3 is the first index where this occurs.
[ { "docid": "b1dd20de78287ecaefa0f7b6e5e4a7e6", "score": "0.68158174", "text": "function findPivot(array) {\n //Figure out how to get the left and right sums. recursion? \n //start at 1 index\n let leftHM = {}; //key: index, value is all the values to the left\n let rightHM = {};\n //How to get all the ones preceding it? \n for (let i = 1; i < array.length; i++) {\n leftHM[i] = addSum(0, i, array)\n rightHM[i] = addSum(i + 1, array.length - 1, array)\n }\n // console.log(leftHM, rightHM);\n for (let i in leftHM) {\n for (let j in rightHM) {\n if (leftHM[i] === rightHM[j]) {\n return i;\n }\n }\n }\n return -1;\n}", "title": "" } ]
[ { "docid": "3f6eff981044714da88e3e99f70d5335", "score": "0.85959345", "text": "function pivotIndex(nums) {\n let preSum = [0]\n for (let i = 0; i < nums.length; i++) {\n preSum[i + 1] = nums[i] + preSum[i]\n }\n\n for (let j = 0; j < nums.length; j++) {\n if (preSum[j] === preSum[nums.length] - preSum[j + 1]) {\n return j\n }\n }\n return -1\n}", "title": "" }, { "docid": "48b13aea706a5452ce52109a390d3836", "score": "0.8054733", "text": "function pivotIndex(arr) {\n const sum = arr.reduce(function(acc, val) {\n acc += val;\n return acc;\n }, 0);\n let p1 = 0;\n let p2 = arr.length - 1;\n let sum1 = arr[p1];\n let sum2 = arr[p2];\n let remainder;\n\n while (p1 < p2) {\n remainder = sum - (sum1 + sum2);\n if (sum1 > sum2 && remainder > 0) {\n p2++;\n sum2 += arr[p2];\n } else if (sum2 > sum1 && remainder > 0) {\n p1++;\n sum1 += arr[p1];\n } else if (sum1 > sum2 && remainder < 0) {\n p1++;\n sum1 += arr[p1];\n } else if (sum2 > sum1 && remainder < 0) {\n p2++;\n sum2 += arr[p2];\n } else if (sum1 === sum2) {\n p1++;\n p2--;\n sum2 += arr[p2];\n sum1 += arr[p1];\n } else if(remainder === 0) {\n p2--;\n sum2 += arr[p2];\n }\n if (sum1 === sum2 && p1 === p2) return p1;\n }\n return -1;\n}", "title": "" }, { "docid": "5002a0c33842634e025f537e6d152a1b", "score": "0.66771364", "text": "function findPivotIndex(arr, start, end) {\n // base cases\n if (end < start) {\n return -1;\n }\n if (start == end) {\n return end;\n }\n let mid = Math.floor((start + end) / 2);\n if (mid < end && arr[mid] > arr[mid + 1]) {\n return mid;\n }\n if (mid > start && arr[mid] < arr[mid - 1]) {\n return mid - 1;\n }\n if (arr[start] > arr[mid]) {\n return findPivotIndex(arr, start, mid);\n }\n if (arr[mid] > arr[end]) {\n return findPivotIndex(arr, mid, end);\n }\n}", "title": "" }, { "docid": "be8d571c11f44a018d29563d9ce8249f", "score": "0.64100164", "text": "function pivot(arr, start = 0) {\n function swap(array, i, j) {\n [array[i], array[j]] = [array[j], array[i]];\n }\n const pivotVar = arr[start];\n let swapIdx = start;\n for (let i = start + 1; i < arr.length; i++) {\n if (pivotVar > arr[i]) {\n swapIdx++;\n swap(arr, swapIdx, i);\n }\n }\n swap(arr, start, swapIdx);\n return swapIdx;\n}", "title": "" }, { "docid": "0b298c64d797d5754f938a44f1491bb0", "score": "0.6402042", "text": "function pivot(arr, start = 0, end = arr.length-1){\n let pivot = arr[start];//always choose the first element as pivot\n let swapIndex = start;\n\n for(let i = start+1; i <= end; i++){\n if(pivot > arr[i]){\n //swap and increase index\n swapIndex++;\n swap(arr, swapIndex, i);\n }\n }\n //swap pivot\n swap(arr, start, swapIndex);\n console.log(arr);\n return swapIndex;\n}", "title": "" }, { "docid": "2e506f98be1f42dc576f46601f2a14af", "score": "0.634815", "text": "function pivot(arr, start = 0, end = arr.length - 1) {\n function swap(arr, i, j) {\n let temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n let pivot = arr[start];\n let swapIndex = start;\n for (let i = start + 1; i < arr.length; i++) {\n //compare pivot to next element(arr[i])\n if (pivot > arr[i]) {\n swapIndex++;\n swap(arr, swapIndex, i);\n }\n }\n swap(arr, start, swapIndex);\n return swapIndex;\n}", "title": "" }, { "docid": "4c713842d116e60ac1548667f7761610", "score": "0.6240927", "text": "function pivot(arr, start = 0, end = arr.length - 1) {\n const swap = (arr, idx1, idx2) => {\n [arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]];\n };\n\n // We are assuming the pivot is always the first element\n let pivot = arr[start];\n let swapIdx = start;\n\n for (let i = start + 1; i <= end; i++) {\n if (pivot > arr[i]) {\n swapIdx++;\n swap(arr, swapIdx, i);\n }\n }\n\n // Swap the pivot from the start the swapPoint\n swap(arr, start, swapIdx);\n return swapIdx;\n}", "title": "" }, { "docid": "4c713842d116e60ac1548667f7761610", "score": "0.6240927", "text": "function pivot(arr, start = 0, end = arr.length - 1) {\n const swap = (arr, idx1, idx2) => {\n [arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]];\n };\n\n // We are assuming the pivot is always the first element\n let pivot = arr[start];\n let swapIdx = start;\n\n for (let i = start + 1; i <= end; i++) {\n if (pivot > arr[i]) {\n swapIdx++;\n swap(arr, swapIdx, i);\n }\n }\n\n // Swap the pivot from the start the swapPoint\n swap(arr, start, swapIdx);\n return swapIdx;\n}", "title": "" }, { "docid": "e8f71f898ed39d82b529ae744a3875ad", "score": "0.6240599", "text": "function pivot(arr, start = 0, end = arr.length + 1) {\n // Swap Function Regular Version\n function swap(array, i, j) {\n let temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n // Swap function es6 2015\n // const swap = (arr, idx1, idx2) => {\n // [arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]]; \n // };\n // Assumption => pivot is the first element arr[start] for simplicity but it affect Big O \n let pivot = arr[start]; //index 0 arr = (7) [4, 6, 9, 1, 2, 5, 3], left = 0, right = 6\n let swapIndex = start; // swap index \n\n for (let i = start + 1; i <= end; i++) { // left = 0, right = 6 \n if (pivot > arr[i]) {\n swapIndex++;\n swap(arr, swapIndex, i);\n }\n }\n // Swap pivot from start\n swap(arr, start, swapIndex);\n console.log(arr);\n return swapIndex;\n}", "title": "" }, { "docid": "c2727bf9abd7244e86d5a99b4d127e45", "score": "0.6223989", "text": "function pivot(array, start, end) {\n let pivot = array[start];\n let pivotIndex = start;\n for (let i = start + 1; i <= end; i++) {\n if (array[i] < pivot) {\n pivotIndex++;\n swap(array, i, pivotIndex);\n }\n }\n swap(array, pivotIndex, start);\n\n return pivotIndex;\n}", "title": "" }, { "docid": "b25b1eface982d6cc7ad9162ef2f24b4", "score": "0.62232435", "text": "function pivot(array, startIndex = 0) {\n function swap(array, index1, index2) {\n let temp = array[index1];\n array[index1] = array[index2];\n array[index2] = temp;\n }\n\n const pivot = array[startIndex];\n let swapIndex = startIndex;\n for (let i = startIndex + 1; i < array.length; i++) {\n if (array[i] < pivot) {\n swapIndex++;\n swap(array, swapIndex, i);\n }\n }\n swap(array, swapIndex, startIndex);\n return swapIndex;\n}", "title": "" }, { "docid": "12bbfd672e02d766a2e7d4217b09ae1b", "score": "0.61892337", "text": "function pivot(arr, start=0, end = arr.length-1){\n function swap(array, i, j){\n let temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n\n // we pick the first element as the pivot\n let pivot = arr[start]; \n let swapIdx = start;\n for(let i = start+1; i < arr.length; i++){\n if(pivot > arr[i]){\n swapIdx++;\n swap(arr, swapIdx, i)\n }\n }\n swap(arr, start, swapIdx)\n return swapIdx\n}", "title": "" }, { "docid": "bfbd0c6ec36f0f1746badf3c0d130c33", "score": "0.6178952", "text": "function pivot(arr, start = 0, end = arr.length){\n const swap = (arr, i1, i2) => {\n [arr[i1], arr[i2]] = [arr[i2], arr[i1]];\n };\n\n let pivot = arr[start];\n let swapIndex = start;\n\n for(let i = start + 1; i < arr.length; i++){\n if(pivot > arr[i]){\n swapIndex++;\n swap(arr, swapIndex, i);\n }\n }\n swap(arr, start, swapIndex);\n\n return swapIndex;\n}", "title": "" }, { "docid": "97b2a4626a17268e6de50bef44f4e9d0", "score": "0.61475104", "text": "function pivot(arr, start = 0, end = arr.length + 1) {\n\t//pick a pivot ( we are using first index)\n\tlet pivot = arr[start];\n\tlet swapIdx = start;\n\t//look at each item and compare its value to our pivot.\n\tfor (let i = start + 1; i < arr.length; i++) {\n\t\t//if less than our pivot increase swapIdx ( tracking how many items we have that is less than pivot )\n\t\t//then swap the index we are looking at with what ever is currently at our swap idx\n\t\tif (pivot > arr[i]) {\n\t\t\tswapIdx++;\n\t\t\tswap(arr, swapIdx, i);\n\t\t\tconsole.log(arr);\n\t\t}\n\t}\n\t//swap the start idx with the swapIdx => this puts the value in the right location for our array.\n\tswap(arr, start, swapIdx);\n\tconsole.log(arr);\n\treturn swapIdx;\n}", "title": "" }, { "docid": "4fbbd8655c335325e65770666cc32407", "score": "0.6126106", "text": "function pivotHelper(arr, start = 0, end = arr.length - 1) {\n let pivot = start\n let pivotIndex = pivot\n\n // if element is less than pivot increase pivotIndex and swap curr element\n for(let index = start; index <= end; index++) {\n if(arr[index] < arr[pivot]) {\n pivotIndex++\n [arr[pivotIndex], arr[index]] = [arr[index], arr[pivotIndex]]\n }\n }\n\n // swap pivot with pivot index\n [arr[pivot], arr[pivotIndex]] = [arr[pivotIndex], arr[pivot]]\n\n return pivotIndex\n}", "title": "" }, { "docid": "7a1fd532f8f87b31da8609ea2d36866e", "score": "0.6112912", "text": "function pivot(arr, start = 0, end = arr.length + 1) {\n function swap(array, i, j) {\n [array[i], array[j]] = [array[j], array[i]];\n }\n\n let pivot = arr[start];\n let swapIdx = start;\n\n for (let i = start + 1; i < arr.length; i++) {\n if (pivot > arr[i]) {\n swapIdx++;\n swap(arr, swapIdx, i);\n }\n }\n swap(arr, start, swapIdx);\n return swapIdx;\n}", "title": "" }, { "docid": "e159c45db468a376cfcbbc241b53cc9d", "score": "0.6090206", "text": "function pivot(arr, start = 0, end = arr.length - 1) {\n const swap = (arr, idx1, idx2) => {\n [arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]]\n };\n\n let pivot = arr[start];\n let swapIndex = start;\n\n for (let i = start + 1; i <= end; i++) {\n // If pivot is greater that element at i increase the swap index and move element at i to the right of the pivot\n if (pivot > arr[i]) {\n swapIndex++;\n swap(arr, swapIndex, i);\n }\n }\n /* When all the elements are swaped next to the pivot swap the pivot with the el at swapIndex\n to place all of the elements that are lower then pivot to the left and the greater ones to the right */\n swap(arr, start, swapIndex);\n return swapIndex;\n}", "title": "" }, { "docid": "4f0686f2592259288ba48c285b6f81a0", "score": "0.60695314", "text": "function pivot(arr, start = 0, end = arr.length + 1) {\n function swap(array, i, j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n\n var pivot = arr[start];\n var swapIdx = start;\n\n for (var i = start + 1; i < arr.length; i++) {\n if (pivot > arr[i]) {\n swapIdx++;\n swap(arr, swapIdx, i);\n }\n }\n swap(arr, start, swapIdx);\n return swapIdx;\n}", "title": "" }, { "docid": "c19f71fd511525ca5c0867059f65997f", "score": "0.60492545", "text": "function pivot(arr, start=0, end=arr.length+1) {\n function swap(array, i, j) {\n let temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n \n let pivot = arr[start];\n let swapInd = start;\n \n for (let i = start + 1; i < arr.length; i++) {\n if(pivot > arr[i]) {\n swapInd++;\n swap(arr, swapInd, i);\n }\n }\n swap(arr, start, swapInd);\n return swapInd;\n}", "title": "" }, { "docid": "c979db18d0ae7f0ae46fa7c0259ecc43", "score": "0.6041653", "text": "function findPeakElement(nums) {\n if (nums.length === 1) return 0;\n let found;\n\n function _check(idx) {\n // console.log('checking', idx)\n const l = idx - 1 === -1 ? -Infinity : nums[idx - 1];\n const r = idx + 1 === nums.length ? -Infinity : nums[idx + 1];\n if (l < nums[idx] && nums[idx] > r) {\n return idx;\n }\n }\n\n function _binary(l, r) {\n if (r < l) return;\n const m = l + Math.floor((r - l) / 2);\n if (found === undefined) {\n found = _check(m);\n // console.log('going on', '(', l, m-1, ')', '(', m + 1, r, ')')\n _binary(l, m - 1);\n _binary(m + 1, r);\n }\n }\n\n _binary(0, nums.length - 1);\n return found;\n}", "title": "" }, { "docid": "f2bff7cfcab0995f8c70db4e470d68ca", "score": "0.5995431", "text": "function quickSort(arr, left = 0, right = arr.length - 1) { // arr = (7) [4, 6, 9, 1, 2, 5, 3], left = 0, right = 6\n if (left < right) {\n let pivotIndex = pivot(arr, left, right) // it returns 3 note: pivot function is invoked\n // Left side\n quickSort(arr, left, pivotIndex-1)\n // Right side\n quickSort(arr, pivotIndex+1, right);\n }\n return arr;\n }", "title": "" }, { "docid": "ba291693d74b85797c4056968dc014f9", "score": "0.59154624", "text": "function quick(arr, pivot) {\n console.log(pivot);\n const left = [];\n const right = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < arr[pivot]) {\n left.push(arr[i]);\n } else if (arr[i] > arr[pivot]) {\n right.push(arr[i]);\n }\n }\n\n const sorted = left.concat(arr[pivot]).concat(right);\n console.log(sorted);\n if (pivot == arr.length - 1) {\n return sorted;\n } else {\n quick(sorted, pivot + 1);\n }\n}", "title": "" }, { "docid": "60438fd1b9e40ee8272b573156595565", "score": "0.5912856", "text": "function pivotFinder(array, start = 0, end = array.length -1){\n let pivot = array[start];\n let switchIndex = start;\n\n for (let i = start + 1; i <= end; i++){\n if (array[i] < pivot) {\n switchIndex++;\n [array[switchIndex], array[i]] = [array[i], array[switchIndex]];\n }\n }\n [array[start], array[switchIndex]] = [array[switchIndex], array[start]];\n return switchIndex;\n}", "title": "" }, { "docid": "167b39b82a26a05153aee056178ee22c", "score": "0.5858355", "text": "function pivot(arr) {\r\n let pivot = 0\r\n for(let i=1; i<arr.length;i++) {\r\n //If the value of i is less than the current pivot value, then just bring it to the left of the current pivot\r\n if(arr[i]<arr[pivot]) {\r\n //Delete the greater value and store it in a variable\r\n const leftElement = arr.splice(i,1)[0]\r\n //Add it to the position where the pivot is currently\r\n arr.splice(pivot,0, leftElement)\r\n //Move ahead the pivot pointer\r\n pivot++\r\n } \r\n }\r\n return pivot\r\n}", "title": "" }, { "docid": "e401af7f3571aeb336c20608db14f115", "score": "0.5804474", "text": "function patition(arr, start, end) {\n let pivot = arr[start];\n let left = start + 1;\n let right = end;\n while (left < right) {\n while (left < right && arr[left] < pivot) {\n left++;\n }\n while (left < right && arr[right] > pivot) {\n right--;\n }\n if (left < right) {\n swap(arr, left, right);\n left++;\n right--;\n }\n }\n if (left === right && arr[right] > pivot) right--;\n swap(arr, start, right);\n return right;\n}", "title": "" }, { "docid": "7bae079ceb02fa6e3154692acf6764b5", "score": "0.5791364", "text": "function traverse() {\n // If start item is less than or equal to end item:\n if (arr[startIdx] <= arr[endIdx]) {\n //* This means the array is already sorted\n // simply return the start index\n return startIdx;\n }\n\n // If start index is greater than end index, return -1\n if (startIdx > endIdx) {\n //* This means we're done, and the array is not circularly sorted\n return -1;\n }\n\n // Find the middle item\n const midIdx = Math.floor((startIdx + endIdx) / 2);\n // Find the two adjacent items to the middle item\n const nextIdx = (midIdx + 1) % arr.length;\n const prevIdx = (midIdx + arr.length - 1) % arr.length;\n\n // If middle item is less than or equal to\n // both of its adjacent items:\n if (arr[midIdx] <= arr[nextIdx] && arr[midIdx] <= arr[prevIdx]) {\n //* This means we've found the pivot item\n // return the middle index\n return midIdx;\n }\n\n // If middle item is less than or equal to the end item:\n if (arr[midIdx] <= arr[endIdx]) {\n //* This means the pivot is somewhere to the left\n // Set new end index to be middle index - 1\n endIdx = midIdx - 1;\n }\n // Otherwise:\n else {\n //* This means the pivot is somewhere to the right\n // Set new start index to be middle index + 1\n startIdx = midIdx + 1;\n }\n\n // Make a recursive call to start another iteration\n return traverse();\n }", "title": "" }, { "docid": "2e46e596c1647a5cca3f8b33e1dac519", "score": "0.572015", "text": "function pivot(arr, start = 0, end = arr.length - 1) {\n let pivot = arr[start];\n let swapIdx = start;\n\n for (let i = start + 1; i <= end; i++) {\n if (pivot > arr[i]) {\n swapIdx++;\n [arr[i], arr[swapIdx]] = [arr[swapIdx], arr[i]];\n }\n }\n\n [arr[start], arr[swapIdx]] = [arr[swapIdx], arr[start]];\n\n return swapIdx;\n}", "title": "" }, { "docid": "1b0c1feaf8bd1db692e91c7fd75d1c2c", "score": "0.5685894", "text": "function balanceIndex(nums) {\n for(var bpoint=0; bpoint<nums.length-1;bpoint++){\n var leftSum = 0;\n var rightSum = 0;\n //LEFT SUM\n for(var left=0; left<bpoint; left++){\n leftSum+= nums[left];\n }\n //RIGHT SUM\n for(var right=nums.length-1; right>bpoint; right--){\n rightSum+= nums[right];\n }\n if(leftSum === rightSum){\n return bpoint;\n }\n }\n return -1\n}", "title": "" }, { "docid": "90dced32a9471a9b18ba8a202d30b810", "score": "0.56653243", "text": "function quickSort(nums) {\n\tlet pivot;\n\tconst leftArr = []; // holds the left partition\n\tconst rightArr = []; // holds the right partition\n\n\t// base case => nums array has 1 or 0 elements so just return it\n\tif (nums.length <= 1) {\n\t\treturn nums;\n\t}\n\n\t// partitioning\n\tpivot = nums[nums.length - 1]; // right-most element of the array\n\n\t// if an element if less than the pivot place it in the left array\n\t// if an element if more than the pivot place it in the right array\n\n\tfor (let i = 0; i < nums.length - 1; i++) {\n\t\tif (nums[i] < pivot) {\n\t\t\tleftArr.push(nums[i]);\n\t\t} else {\n\t\t\trightArr.push(nums[i]);\n\t\t}\n\t}\n\n\treturn [...quickSort(leftArr), pivot, ...quickSort(rightArr)]; //combine and return\n}", "title": "" }, { "docid": "b4b0d9feb238f65ba7a41121a7823c2b", "score": "0.5637284", "text": "function pivot(arr, left=0, right=arr.length-1) {\n let shift = left;\n for(let i=left+1; i<=right; i++){\n //move all the small elements to left side\n if(arr[i] < arr[left]) swap(arr, i, ++shift);\n }\n swap3(arr, left, shift);\n return shift;\n}", "title": "" }, { "docid": "5a7b237610eb378dbc841761729d9d0e", "score": "0.5621329", "text": "function quickSort(arr, left = 0, right = arr.length -1){\n if(left < right){\n debugger;\n let pivotIndex = pivot(arr, left, right) //3\n //left\n quickSort(arr,left,pivotIndex-1);\n //right\n quickSort(arr,pivotIndex+1,right);\n }\n return arr;\n }", "title": "" }, { "docid": "677f977861b6d2b66aa50ec9b6b343bc", "score": "0.5529655", "text": "function quickSort(arr, left = 0, right = arr.length - 1) {\n // base case: left === right\n // remember it' is the same array\n // it is just that pivot index keeps going closer towards each other\n // until a point where left === right\n // so we only do it if left < right so that it will not get stack overflow\n\n if (left < right) {\n let pivotIndex = pivot(arr, left, right); // pivotIndex = 3 for the first time\n // left\n quickSort(arr, left, pivotIndex - 1);\n // right\n quickSort(arr, pivotIndex + 1, right);\n }\n return arr;\n}", "title": "" }, { "docid": "a440f580fa325d032b1eb75511dc816a", "score": "0.5516347", "text": "function s(nums, target) {\n // if target exists, return index\n // if not, return index where it should be\n // nums is sorted\n let l = 0;\n let r = nums.length - 1;\n while (l <= r) {\n const m = Math.floor((l + r) / 2);\n if (nums[m] === target) {\n return m;\n } else if (nums[m] < target) {\n l = m + 1;\n } else {\n r = m - 1;\n }\n }\n return l;\n}", "title": "" }, { "docid": "27eeafe3d531d71d65ee465a3e28aaa7", "score": "0.5474119", "text": "function findPeakElement(nums) {\n\n return helper(nums, 0, nums.length - 1);\n}", "title": "" }, { "docid": "749a63969f557dcd72a69706a44f3a24", "score": "0.54712707", "text": "function balanceIndex(array){\n // Fast Fail Check: If the array has less than 3 numbers, we can't have a sum on \n // the right and left\n if(array.length < 3) {\n return -1;\n }\n\n // Set sumLeft to the first number\n let sumLeft = array[0];\n // Set sumRight to the sum of all numbers on the right side of the 1 index\n let sumRight = 0;\n for(let i = 2; i < array.length; i++) {\n sumRight += array[i];\n }\n\n // Loop through the array\n for(let i = 1; i < array.length-1; i++){\n // If the sum of the left equals the sum of the right, return the index\n if(sumLeft == sumRight){\n return i;\n }\n // Otherwise, increment sumLeft by the number at the current index we're checking,\n // and decrement sumRight by the next index's number.\n sumLeft += array[i];\n sumRight -= array[i+1];\n }\n \n // If we've gotten out here, there's no balance index, so return -1\n return -1;\n}", "title": "" }, { "docid": "fd090948b19852b6cbad5d4c7cdbb678", "score": "0.54674846", "text": "function partition(arr,start,end)\n{\n\tvar pivot = arr[end];\n\tvar pIndex = start;\n\n\tfor(var i=0;i<arr.length;i++)\n\t{\n\t\tif(arr[i] <= pivot)\n\t\t{\n\t\t\tswap(arr,i,pIndex++);\n\t\t}\n\t}\n\tswap(arr,pIndex,end);\n\treturn pIndex;\n}", "title": "" }, { "docid": "7ea3e5cc15a5bcfd4b6dcabe1245cd0f", "score": "0.5448113", "text": "function getIndexToIns(arr, num) {\n if (arr.length == 0) {\n return 0;\n }\n arr.sort(function(a, b){return a-b});\n \n if (num > arr[arr.length - 1]) {\n return arr.length;\n }\n \n for (let i = 0; i < arr.length; i++) {\n if (num == arr[i]) {\n return i;\n }\n if (num > arr[i] && num < arr[i+1]) {\n return i+1;\n }\n }\n}", "title": "" }, { "docid": "0dbe02eaecfe8c640e5096410b9a484b", "score": "0.5425099", "text": "function twoSum(nums, target) {\n\n //makes a copy of original array\n var sortArr = nums.slice(0);\n\n //helper function to sort integers\n function sortNumber(a, b) {\n return a - b;\n }\n\n //sorts sortArr\n var sortArr = sortArr.sort(sortNumber);\n\n //creates two pointers on each end of sorted array, and a final array to return\n let left = 0;\n let right = nums.length-1;\n let finalArr = [];\n \n //while indices aren't yet touching...\n while (left < right) {\n //if sum is too small, move left pointer up\n if (sortArr[left] + sortArr[right] < target) {\n left++;\n } \n //if sum is too large, move right pointer down\n else if (sortArr[left] + sortArr[right] > target) {\n right--;\n } \n //if sum === target, \n else {\n console.log(`Got to answer! ${sortArr[left]} + ${sortArr[right]} = ${target}`)\n \n //takes the values we're going to look for in the original array.\n leftNum = sortArr[left];\n rightNum = sortArr[right];\n\n //pushes the left number into our final array to return\n finalArr.push(nums.indexOf(leftNum));\n \n //if the two numbers are equal...\n if (leftNum === rightNum) {\n //...then start looking after the index of the first occurrence of number\n finalArr.push(nums.indexOf(sortArr[right], finalArr[0]+1));\n } else {\n //otherwise, just find first index of other number\n finalArr.push(nums.indexOf(sortArr[right]));\n }\n return finalArr;\n }\n } \n //if we break the while loop without finding match, returns false\n return false;\n\n}", "title": "" }, { "docid": "f6118e0b44db745d77ac8188c4807b37", "score": "0.54132736", "text": "function binarySearch(array, target) {\n if (!array.length) return -1;\n let pivot = Math.floor(array.length / 2);\n\n if (array[pivot] === target) {\n return pivot;\n } else if (array[pivot] > target) {\n return binarySearch(array.slice(0, pivot), target);\n } else {\n let temp = binarySearch(array.slice(pivot+1), target);\n return temp === -1 ? -1 : temp + pivot + 1;\n }\n}", "title": "" }, { "docid": "c8e55b68abb5adecdac86292e7ecb5e1", "score": "0.5384964", "text": "function getIndexToIns(arr, num) {\n let sorted = arr.sort(function (a, b) {\n return a - b;\n });\n\n console.log(sorted);\n\n let index = sorted.findIndex(function (element) {\n return element >= num;\n });\n\n if (index == -1) {\n return (index = sorted.length);\n }\n\n return index;\n}", "title": "" }, { "docid": "48df07d0cf31817f76facb27e9273e2c", "score": "0.536073", "text": "function partition(Arr, start, end, pivot) {\n\n var pivot_value = Arr[pivot][1];\n Arr.swap(pivot, end - 1);\n var store = start;\n\n for (var i = start; i < end - 1; i++) {\n\n // greater than to reverse sort order\n if (Arr[i][1] >= pivot_value) {\n Arr.swap(store, i);\n store++;\n }\n }\n Arr.swap(end - 1, store);\n\n return store;\n}", "title": "" }, { "docid": "636ace38d36036c6f2072f03075e8040", "score": "0.5353136", "text": "function quickSort(arr) {\n if (arr.length <= 1) {\n return arr;\n }\n\n let pivot = arr[arr.length - 1];\n let rest = arr.slice(0, arr.length - 1);\n let left = [];\n let right = [];\n rest.forEach((num) => (num >= pivot ? right.push(num) : left.push(num)));\n\n return quickSort(left).concat(pivot).concat(quickSort(right));\n}", "title": "" }, { "docid": "94f3429667a37e4912f5e02b5d83bdd5", "score": "0.5341105", "text": "function quickNumber(nums) {\n if (nums.length < 2) {\n return nums\n } else {\n // 取个数组中基础base作为比较值\n var centerNum = Math.floor(nums.length / 2)\n var base = nums.splice(centerNum, 1)[0]\n // 对比值\n var leftArr = []\n var rightArr = []\n for (let i = 0; i < nums.length; i++) {\n if (nums[i] > base) {\n rightArr.push(nums[i])\n } else {\n leftArr.push(nums[i])\n }\n }\n }\n return quickNumber(leftArr).concat([base], quickNumber(rightArr))\n}", "title": "" }, { "docid": "e9b3d7d7af4fcfc291de5fa22f1a06c8", "score": "0.53284943", "text": "function maxSubarray(nums) {\n currentSum = 0\n maxSum = 0\n startIndex = 0\n endIndex = 0\n bestStart = 0\n bestEnd = 0\n\n for (let i=0; i< nums.length; i++) {\n if (currentSum <=0) {\n startIndex = i\n endIndex = i\n currentSum = nums[i]\n } else {\n currentSum += nums[i]\n endIndex = i\n }\n \n if (currentSum > maxSum) {\n maxSum = currentSum\n bestStart = startIndex\n bestEnd = endIndex + 1\n }\n }\n \n return nums.slice(bestStart, bestEnd)\n}", "title": "" }, { "docid": "25bd5aaf27f01c0ba061013092c86920", "score": "0.5321499", "text": "function pivotSort(array, pivot) {\n\n\t\tfunction maxKey (array, pivot) {\n\t\t\tvar key = 0, i = 0;\n\t\t\tvar current = 0, maximum = 0;\n\t\t\tfor (i = pivot; i < array.length; i++) {\n\t\t\t\tcurrent = Math.abs(array[i][pivot]);\n\t\t\t\tif (current > maximum){\n\t\t\t\t\tmaximum = current;\n\t\t\t\t\tkey = i; // will be row\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn key;\n\t\t}\n\n\t\tfunction swapNumbers (array, key, pivot) {\n\t\t\t// if Key === 0 do nothing\n\t\t\t// if key does not === 0, swap it with key = 0\n\n\t\t\tvar temp0 = array[pivot];\n\t\t\tvar temp1 = array[key];\n\n\t\t\tif ( key === pivot ) ;\n\t\t\telse {\n\t\t\t\tarray[pivot] = temp1;\n\t\t\t\tarray[key] = temp0; \n\t\t\t}\n\n\t\t}\n\t\tswapNumbers (array, maxKey(array, pivot), pivot);\n\n\t}", "title": "" }, { "docid": "de55bfcc17c69a977825eca8878c6343", "score": "0.53196275", "text": "function findPivotRow(tab, pivotCol) {\n var i, pivotRow = 0;\n var minRatio = -1;\n console.log(\"Ratios A[row_i,0]/A[row_i,\"+pivotCol+\"] = [\");\n\n for(i=1;i<tab.rows;i++){\n var ratio = tab.matrix[i][0] / tab.matrix[i][pivotCol];\n if ( (ratio > 0 && ratio < minRatio ) || minRatio < 0 ) {\n minRatio = ratio;\n pivotRow = i;\n }\n }\n if (minRatio == -1){\n return -1; // Unbounded.\n }\n\n console.log(\"Found pivot A[\"+pivotRow+\",\"+pivotCol+\"], min positive ratio=\"+minRatio+\" in row=\"+pivotRow+\".\");\n\n return pivotRow;\n}", "title": "" }, { "docid": "57a911a014ab4ab95dd58e1d13fb52ec", "score": "0.5315825", "text": "function partition(arr,start,end){\n var pivot = arr[end];\n var pIndex = start;\n for (var i = start; i<=end; i++){\n if(arr[i] <= pivot){\n swap(arr, i, pIndex);\n pIndex++;\n }\n } \n return pIndex-1;\n}", "title": "" }, { "docid": "a6b8bc5db3e34afd3faa8e134a401362", "score": "0.53063184", "text": "function solve(arr) {\n arr = arr.sort((a, b) => a - b);\n if (arr[0] > 1) return 1;\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n if (arr[i + 1] > sum + 1) return sum + 1;\n }\n return sum + 1;\n}", "title": "" }, { "docid": "84adc0784b4a44c043b0046144526087", "score": "0.5294207", "text": "function findEvenIndex(arr)\n{\n var len = arr.length, left_sum = 0, right_sum = 0;\n var left_side = [], right_side = [];\n var sum = function(a,b){ return a+b; }\n\n for (var i = 0; i < len; i++) {\n left_side = arr.slice(0,i);\n right_side = arr.slice(i+1,len);\n left_sum = left_side.reduce(sum,0);\n right_sum = right_side.reduce(sum,0);\n if (left_sum === right_sum) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "23fe5c90fdfe02aeeaa09a4045377cba", "score": "0.5284831", "text": "function findClosestNumberIndex(nums, index) {\n const value = nums[index];\n let swapIndex = index + 1;\n for (let i = nums.length - 1; i > index; i --) {\n if (nums[i] > value) {\n swapIndex = i;\n break;\n }\n }\n\n return swapIndex;\n}", "title": "" }, { "docid": "5a47c70892eaa837b60a5aa752e98350", "score": "0.5276745", "text": "function findEvenIndex(arr)\n{\n for (let i = 0, len = arr.length-1; i < len; i++) {\n let leftArr = arr.slice(0,i);\n let rightArr = arr.slice(i+1);\n\n let left = leftArr[0] ? leftArr.reduce((sum, num) =>sum + num) : 0;\n let right = rightArr[0] ? rightArr.reduce((sum, num) =>sum + num) : 0;\n\n if (left === right) {return i}\n }\n return -1\n}", "title": "" }, { "docid": "03621adcd7b44e5f89476c0e9baa658f", "score": "0.5274707", "text": "function getIndexToIns(arr, num) {\n \n if(arr.length == 0) {\n return 0;\n }\n\n const compareNums = (a , b) => {\n return a - b;\n }\n\n let sortedArr = arr.sort(compareNums);\n\n for(let i = 0; i < sortedArr.length; i++) {\n if(num > arr[i] && num < arr[i + 1] || arr[i + 1] === undefined) {\n return i + 1;\n } else if(num === arr[i]) {\n return i;\n } else if(num === arr[0] || !arr[0]) {\n return 0;\n } \n }\n\n}", "title": "" }, { "docid": "4f7ae0dd49e276679b01856a5ae7ae0b", "score": "0.5268683", "text": "function binarySearchIndex(nums, target) {\n\tlet left = 0; // 1) left pointer, set to first index in array\n\tlet right = nums.length - 1; // 2) right pointer, set to last index in array\n\n\twhile (left <= right) { // 3) loop while <= right. (bec the delta btwn them refers to the subarray/halving, as soon as that disappears/becomes negative, we're done)\n\t\tlet midIdx = Math.floor((left + right) / 2); // 4) grab middle index using left/right pointers\n\t\t// let m = parseInt((l + r) / 2);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// works. converts num to string, then truncates non numbers after first num (ex. 2.9 => 2)\n\t\tlet midNum = nums[midIdx]; // 5) grab num @ middle index\n\n\t\tif (midNum === target) return midIdx; // 6) if midNum == target, found! return midIdx\n\n\t\tif (midNum > target) { // 7) if midNum > target, update right pointer\n\t\t\tright = midIdx - 1;\n\t\t} else { // 8) if midNum < target, update left pointer\n\t\t\tleft = midIdx + 1;\n\t\t}\n\t}\n\n\treturn -1; // 9) target not found if we reach this point after loop\n}", "title": "" }, { "docid": "e505d6dc8e9dd0353cdb20781b9a78e9", "score": "0.52681804", "text": "function partition() {\n let i =0;\n let ind = pivot+1;\n //find elements less than pivot\n let left = []\n let right = []\n while(ind < arr.length){\n if(arr[ind] > arr[pivot])\n right.push(arr[ind]); \n ind--;\n }\n\n while(i< ind-1){\n if(arr[i] < arr[pivot])\n left.push(arr[i])\n i++;\n }\n\n return [...left,pivot,...right];\n //find elements greater than pivot\n }", "title": "" }, { "docid": "4f4f198f59f2f888e3996dd174b3405c", "score": "0.5266263", "text": "function solution(arr) {\n\n const sortedArr = arr.sort();\n let sum = Number.MAX_SAFE_INTEGER;\n\n for(let base = 0; base < 3; base++){\n let currentSumm = 0;\n\n for(let i = 0; i < sortedArr.length; i++){\n let delta = sortedArr[i] - sortedArr[0] + base;\n currentSumm += parseInt(delta/5) + parseInt((delta%5)/2) + parseInt(((delta%5)%2)/1);\n }\n\n sum = Math.min(currentSumm, sum);\n }\n\n return sum;\n\n}", "title": "" }, { "docid": "065b4c78d44f393332b1db7fb024cf96", "score": "0.5263941", "text": "function getIndexToIns(arr, num) {\n // sort and find right index\n var index = arr.sort((curr, next) => curr > next)\n .findIndex((currNum) => num <= currNum);\n // Returns proper answer\n return index === -1 ? arr.length : index;\n}", "title": "" }, { "docid": "f6fcff4d319894dfb56cdc5db546b5e6", "score": "0.52621526", "text": "function findFirst(arr, num, low = 0, high = arr.length - 1) {\n if (high >= low) {\n let mid = Math.floor((low + high) / 2);\n //\n if ((mid === 0 || num > arr[mid - 1]) && arr[mid] === num) {\n return mid;\n } else if (num > arr[mid]) {\n return findFirst(arr, num, mid + 1, high);\n } else {\n return findFirst(arr, num, low, mid - 1);\n }\n }\n return -1;\n}", "title": "" }, { "docid": "f6deb6da961dd9ae3e1cd2e6ce24966c", "score": "0.52613986", "text": "function findDuplicate(nums) {\n if (nums.length === 0) {\n throw new Error(\"There are no values in the input array\");\n }\n\n const n = nums.length - 1;\n\n const triangularSum = (n + 1) * n / 2;\n\n const actualSum = nums.reduce((sum, val) => {\n sum += val;\n return sum;\n }, 0);\n\n if (actualSum > triangularSum) {\n return actualSum - triangularSum;\n }\n\n throw new Error(\"Unable to find duplicate\");\n}", "title": "" }, { "docid": "6526cc9f9040207e0cc419a260db980e", "score": "0.5252705", "text": "function viravorIndex(arr){\r\n for(let i = 0; i < arr.length - 1; i++){\r\n if(arr[i] <= arr[i + 1]) continue;\r\n else{\r\n return i + 1\r\n }\r\n }\r\n return -1\r\n}", "title": "" }, { "docid": "ed010e50549299a640f90b0109c5e5bc", "score": "0.5250263", "text": "function BinarySearch(nums, target) {\n let low = 0;\n let high = nums.length - 1;\n while (low <= high) {\n let midIndex = Math.floor((high + low) / 2);\n if (nums[midIndex] === target) {\n return midIndex;\n } else if (target > nums[midIndex]) {\n low = midIndex + 1;\n } else {\n high = midIndex - 1;\n }\n }\n\n return low;\n}", "title": "" }, { "docid": "470ba4262777852dd10035fc75bce0ae", "score": "0.52453804", "text": "function magicIndex6(arr) {\n let head = 0,\n tail = arr.length - 1;\n\n while (head <= tail) {\n const midIndex = Math.floor((head + tail) / 2);\n if (midIndex === arr[midIndex]) return midIndex;\n else if (midIndex < arr[midIndex]) tail = midIndex - 1;\n else head = midIndex + 1;\n }\n\n return -1;\n}", "title": "" }, { "docid": "5b906f6e2330aaa0993af065644689a9", "score": "0.52351654", "text": "function magicIndex(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > i) {\n i = arr[i]\n } else if (arr[i] === i) {\n return i;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5984d7083994cee73da86e6c69d7e9d0", "score": "0.5232594", "text": "function find(arr) {\n\tarr.sort();\n\tlet i = 0;\n\twhile (i < arr.length && arr[i] < 1) i++;\n\tif (arr[i] > 1) return arr[i]-1;\n\tlet currentNumber = arr[i];\n\tlet expectedNextNumber = currentNumber+1;\n\twhile (i < arr.length) {\n\t\t// Move past all duplicates\n\t\twhile (arr[i+1] === currentNumber) i++;\n\t\ti++;\n\t\tif (arr[i] != expectedNextNumber) return expectedNextNumber;\n\t\tcurrentNumber = arr[i];\n\t\texpectedNextNumber = currentNumber+1;\n\t}\n}", "title": "" }, { "docid": "7edf227442ab20851e919e01797bbcf8", "score": "0.5224346", "text": "function quickSort(arr, left = 0, right = arr.length - 1) {\n if (left < right) {\n let pivotIndex = pivot(arr, left, right);\n // left\n quickSort(arr, left, pivotIndex - 1);\n // right\n quickSort(arr, pivotIndex + 1, right);\n }\n return arr;\n}", "title": "" }, { "docid": "74c54eb9c773dd85b0cf293933ceb0d3", "score": "0.52238595", "text": "function solution() {\n let max = Number.MIN_VALUE;\n let pos = null;\n for (let i = 0; i < arr.length; i ++) {\n let min = arr[i];\n let sum = arr[i]\n for (let j = i + 1; j < arr.length; j ++) {\n min = Math.min(min, arr[j]);\n sum += arr[j];\n if (min * sum > max) {\n max = min * sum;\n pos = [i, j];\n }\n }\n }\n console.log(max, pos);\n}", "title": "" }, { "docid": "a6cbd71015ba66e2edabcb5e966a0f80", "score": "0.5220596", "text": "function maxSubArraySum(arr, num){\n //naive approach\n // if (n > arr.length) return null\n\n // var max = -Infinity\n\n // for(let i = 0; i < arr.length - n + 1; i++){\n // let temp = 0;\n // for(let j = 0; j < n; j++){\n // temp += arr[i+j]\n // }\n // if (temp > max){\n // max = temp;\n // }\n // }\n // return max;\n\n let maxSum = 0;\n let tempSum = 0;\n\n if (arr.length < num) return null;\n\n for (let i = 0; i < num; i++){\n maxSum += arr[i]\n }\n tempSum = maxSum;\n let indices = [0,num]\n //start at num since you've already added the first num digits\n for (let i = num; i< arr.length; i++){\n //this is substracting the first num and adding the next number in the array\n //kinda like sliding the window\n //[(1,2,3),4,5,5,8,1] num = 3, i = 3, arr[i] = 4, arr[i-num] = 1\n //[1,(2,3,4),5,5,8,1] num = 3, i = 4, arr[i] = 5, arr[i-num] = 2\n //[1,2,(3,4,5),5,8,1]\n tempSum = tempSum - arr[i - num] + arr[i]\n if(tempSum > maxSum){\n maxSum = tempSum;\n indices = [i-num + 1, i]\n }\n // maxSum = Math.max(tempSum, maxSum);\n }\n return [maxSum, indices];\n}", "title": "" }, { "docid": "4bf2789d84c479b798d1d84812a451b1", "score": "0.52156675", "text": "function searchRotated(nums, target) {\n let start = 0, end = nums.length-1;\n \n while (start <= end) {\n let mid = Math.floor((start+end)/2);\n if (target === nums[mid]) return mid;\n // Left half is sorted\n if (nums[start] <= nums[mid]) {\n if (target >= nums[start] && target <= nums[mid]) end = mid - 1;\n else start = mid + 1;\n } else {\n if (target >= nums[mid] && target <= nums[end]) start = mid + 1;\n else end = mid - 1;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "0d33eac47e32bfde4f30a1f6b32fab55", "score": "0.5205402", "text": "function arrangeListByPivot(list, start, end, pivotIndex) {\n for (let i = end - 1; i >= start; i--) {\n if (list[i] > list[pivotIndex]) {\n // do two swaps.\n if ((pivotIndex - i) != 1) {\n [list[pivotIndex], list[pivotIndex - 1]] = [list[pivotIndex - 1], list[pivotIndex]];\n }\n [list[pivotIndex], list[i]] = [list[i], list[pivotIndex]];\n // The new index for the pivot\n pivotIndex--;\n }\n }\n return pivotIndex;\n}", "title": "" }, { "docid": "d709e46bfab53afd2c8aebed73cc5d5a", "score": "0.5198614", "text": "function quickSort(arr, left = 0, right = arr.length - 1) {\n // Base Case\n if (left < right) { \n let pivotIndex = pivot(arr, left, right);\n // Left\n quickSort(arr, left, pivotIndex - 1);\n // Right\n quickSort(arr, pivotIndex + 1, right);\n }\n return arr;\n}", "title": "" }, { "docid": "eb09d62446fb0b11ce23af8c22219f90", "score": "0.5197902", "text": "function partition(array, start, end) {\n if (end - start <= 1) return start;\n\n // Pick the pivot\n const pivot = array[start];\n let i = start + 1;\n let j = end - 1;\n while (true) {\n // Find an element that is smaller than/equal to the pivot\n while (array[i] <= pivot && i < j) {\n comparing = [start, i, j];\n takeSnapshot(array, comparing, [], globallySorted);\n i += 1;\n }\n // Find an element that is larger than the pivot\n while (array[j] > pivot && i <= j) {\n comparing = [start, i, j];\n takeSnapshot(array, comparing, [], globallySorted);\n j -= 1;\n }\n // Swap the 2 elements only if i is still to the left of j\n if (i < j) {\n comparing = [start, i, j];\n takeSnapshot(array, comparing, [], globallySorted);\n swap(array, i, j);\n takeSnapshot(array, comparing, [], globallySorted);\n } else {\n break;\n }\n }\n \n // Swap pivot into position\n comparing = [start, j];\n takeSnapshot(array, comparing, [], globallySorted);\n swap(array, start, j)\n takeSnapshot(array, comparing, [], globallySorted);\n return j;\n}", "title": "" }, { "docid": "3d980cd79ab61145fc2041efed648d9f", "score": "0.51950586", "text": "function quickSort(arr, left=0, right=arr.length -1){\n if (left < right){\n let pivotIndex = pivot(arr, left, right);\n quickSort(arr, left, pivotIndex-1);\n quickSort(arr, pivotIndex+1, right);\n }\n return arr;\n}", "title": "" }, { "docid": "f34058562b220ccba78053e382f1a5be", "score": "0.51845056", "text": "function solution_1 (nums, target) {\r\n if (!nums.length) return 0; // UNNECESSARY EDGE CASE HANDLING: no test cases have empty `nums`\r\n let left = 0;\r\n let right = nums.length - 1;\r\n while (true) { // we can do `while (true)` because we are guaranteed to hit one of the return statements in here\r\n if (target < nums[left]) return left; // if `target` is out of range of left number, return `left` (if `target` would normally go b/w previous `middle` and current `left`)\r\n if (target > nums[right]) return right + 1; // if `target` is out of range of right number, return `right + 1` (if `target` would normally go b/w previous `middle` and current `right`)\r\n const middle = Math.floor((right - left) / 2) + left;\r\n if (target < nums[middle]) right = middle - 1; // if middle number is too big, adjust `right`\r\n else if (target > nums[middle]) left = middle + 1; // if middle number is too small, adjust `left`\r\n else return middle; // if middle number is target, return `middle` (if `target` is in our array, this statement will eventually be reached)\r\n }\r\n}", "title": "" }, { "docid": "9fca0b1652380b3e6986fda82bd2eb0f", "score": "0.5172249", "text": "function magicIndex3(arr, start = 0, end = arr.length - 1) {\n if (end < start) return -1;\n\n const midIndex = Math.floor((start + end) / 2),\n valueAtHalf = arr[midIndex];\n\n if (midIndex === valueAtHalf) return midIndex;\n\n const leftIndex = Math.min(midIndex - 1, valueAtHalf),\n left = magicIndex3(arr, start, leftIndex);\n if (left >= 0) return left;\n\n const rightIndex = Math.max(midIndex + 1, valueAtHalf);\n return magicIndex3(arr, rightIndex, end);\n}", "title": "" }, { "docid": "176a3bc4b38be51f4ce9bedf5c6ad4f3", "score": "0.5171074", "text": "function partition(arr, left, right) {\n\t\t\t\tvar pivot = arr[Math.floor((left + right) / 2)].numChildren;\n\t\t\t\tvar i = left;\n\t\t\t\tvar j = right;\n\t\t\t\twhile(i <= j) {\n\t\t\t\t\twhile(arr[i].numChildren > pivot) {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\twhile(arr[j].numChildren < pivot) {\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\tif(i <= j) {\n\t\t\t\t\t\tswap(arr, i, j);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn i;\n\t\t\t}", "title": "" }, { "docid": "7c900d863ce4c578c7cbe435e1c20b81", "score": "0.5159746", "text": "function magicIndex(array) {\n let low = 0, high = array.length - 1;\n \n while (low < high) {\n let mid = Math.floor((high + low) / 2);\n if (array[mid] === mid){\n return mid;\n } else if (array[mid] < mid) {\n low = mid;\n } else {\n high = mid;\n }\n }\n\n return -1;\n}", "title": "" }, { "docid": "98f9c1b4a1433202cd2a099f244a74eb", "score": "0.515944", "text": "function partition(p, r) {\n let x = arr[r]; //pivot\n let i = p - 1; //counter\n\n for (let j = p; j <= r - 1; j++) {\n if (arr[j] <= x) {\n i += 1;\n let temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n }\n let temp = arr[r];\n arr[r] = arr[i + 1];\n arr[i + 1] = temp;\n return i + 1;\n}", "title": "" }, { "docid": "a7f4ce120cbd1b715ea3469ad1d1a7a7", "score": "0.5126974", "text": "function mergeFindIndex(arr,low,high,n){\n if(arr[low]>n || arr[high]<n){\n return -1\n }\n if(arr[low]===n){\n return low\n }\n if(arr[high]===n){\n return high\n }\n\n let mid = Math.floor(low+high/2);\n // if n > then mid value\n if(arr[mid] < n){\n if(mid+1<=high && arr[mid+1]===n){\n return mid+1;\n }else{\n return mergeFindIndex(arr,mid+1,high,n)\n }\n }else{\n // when n is less then mid values\n if(mid-1<=low && arr[mid-1]===n){\n return mid-1;\n }else{\n return mergeFindIndex(arr,low,mid,n)\n }\n }\n}", "title": "" }, { "docid": "207604f145c84c67c7c8db9a11ae9ee6", "score": "0.51240903", "text": "function search(nums, target) {\n let l = 0;\n let r = nums.length - 1;\n\n while (l + 1 < r) {\n const mid = Math.floor((l + r) / 2);\n\n if (nums[mid] === target) return mid;\n\n if (nums[l] < nums[mid]) { // e.g. 4, 5, 6, 7\n if (nums[l] <= target && target <= nums[mid]) r = mid;\n else l = mid;\n } else { // e.g. 7, 0, 1, 2\n if (nums[mid] <= target && target <= nums[r]) l = mid;\n else r = mid;\n }\n }\n\n if (nums[l] === target) return l;\n if (nums[r] === target) return r;\n\n return -1;\n}", "title": "" }, { "docid": "d21bfd309aa56b5a2bfb97813e4e2388", "score": "0.51198876", "text": "function getIndexToIns(arr, num) {\n var sorted = arr.sort(function(a, b) {\n return a - b\n })\n for (var i = 0; i < sorted.length; i++) {\n if (sorted[i] >= num) {\n return i\n }\n }\n if (num > arr[arr.length - 1]) {\n return arr.length\n }\n}", "title": "" }, { "docid": "9636c7133fd092f8a9e246a2bd7e7769", "score": "0.5118484", "text": "function partition(range, pivot, cmp_lt) {\n\tcmp_lt = cmp_lt || exports.cmp_lt;\n\n\tif (range.length === 0) {\n\t\treturn range;\n\t}\n\n\tvar l = 0;\n\tvar u = range.length - 1;\n\n\twhile (true) {\n\t\twhile (l < u && cmp_lt(range[l], pivot)) {\n\t\t\tl += 1;\n\t\t}\n\n\t\twhile (l < u && !cmp_lt(range[u], pivot)) {\n\t\t\tu -= 1;\n\t\t}\n\n\t\tif (l >= u) {\n\t\t\tbreak;\n\t\t}\n\n\t\t_swap(range, u, l);\n\t\tl += 1;\n\t\tu -= 1;\n\t}\n\n\tif (l < range.length && cmp_lt_eq_gen(cmp_lt)(range[l], pivot)) {\n\t\treturn l + 1;\n\t}\n\telse {\n\t\treturn l;\n\t}\n}", "title": "" }, { "docid": "c063b8c4c710e3a03fdc41a5907134d9", "score": "0.5117845", "text": "function sortedFrequency(arr, num) {\n let leftIdx = 0;\n let rightIdx = arr.length - 1;\n let firstIdx;\n let lastIdx;\n\n if (arr[rightIdx] < num) return -1; \n if (arr[0] > num) return -1; \n if (arr[0] === num) firstIdx = 0; \n if (arr[rightIdx] === num) lastIdx = rightIdx; \n if (firstIdx && lastIdx) return arr.length;\n\n while(leftIdx < rightIdx) {\n let middleIdx = Math.floor((leftIdx + rightIdx)/2);\n let middleVal = arr[middleIdx];\n\n if (((middleVal === num && arr[middleIdx - 1] === num) && !Number.isInteger(firstIdx)) || (middleVal > num && arr[middleIdx - 1] > num)) {\n rightIdx = middleIdx - 1;\n } else if ((middleVal < num && arr[middleIdx + 1] < num) || ((middleVal === num && arr[middleIdx + 1] === num) && firstIdx)) {\n leftIdx = middleIdx + 1;\n } else if (middleVal === num && arr[middleIdx - 1] < num) {\n firstIdx = middleIdx;\n if ((firstIdx || firstIdx === 0) && (lastIdx || lastIdx === 0)) return (lastIdx - firstIdx) + 1;\n leftIdx = middleIdx;\n } else if (middleVal > num && arr[middleIdx - 1] === num) {\n lastIdx = middleIdx - 1;\n if ((firstIdx || firstIdx === 0) && (lastIdx || lastIdx === 0)) return (lastIdx - firstIdx) + 1;\n rightIdx = middleIdx - 1;\n } else if (middleVal === num && arr[middleIdx + 1] > num) {\n lastIdx = middleIdx;\n if ((firstIdx || firstIdx === 0) && (lastIdx || lastIdx === 0)) return (lastIdx - firstIdx) + 1;\n rightIdx = middleIdx;\n } else if (middleVal < num && arr[middleIdx + 1] === num) {\n firstIdx = middleIdx + 1;\n if ((firstIdx || firstIdx === 0) && (lastIdx || lastIdx === 0)) return (lastIdx - firstIdx) + 1;\n leftIdx = middleIdx + 1;\n rightIdx = arr.length - 1;\n } \n\n }\n\n}", "title": "" }, { "docid": "e5a4a0c579d62f0d43e0dcd1b75963d8", "score": "0.5111682", "text": "function findRankByRoll(roll) {\n /** roll => interger */\n let currentIndex = 0\n while (currentIndex < rankList.length) {\n if (rankList[currentIndex][0] == roll) return ++currentIndex;\n currentIndex++;\n }\n }", "title": "" }, { "docid": "83fa906ec5e0fe34245a69d3382423db", "score": "0.51110405", "text": "function getIndexToIns(arr, num) {\n // Find my place in this sorted array.\n arr.sort(function(a,b){\n return a - b;\n }); //40,60\n console.log(arr);\n for(let i=0;i<arr.length;i++){\n if(num <= arr[i]){\n return i;\n }\n }\n return arr.length;\n}", "title": "" }, { "docid": "231cf30e056493ecbb853347ac51e4c4", "score": "0.5098005", "text": "function findEvenIndex(arr) {\n\tfor (var i=0; i<arr.length; i++) {\n\t\tvar leftArray = arr.slice(0, i);\n\t\tvar leftArraySum = 0;\n\t\tvar rigthArray = arr.slice(i+1);\n\t\tvar rigthArraySum = 0;\n\n\t\tleftArray.forEach(number => {\n\t\t\tleftArraySum += number;\n\t\t})\n\n\t\trigthArray.forEach(number => {\n\t\t\trigthArraySum += number;\n\t\t})\n\n\t\twhile (leftArraySum === rigthArraySum) {\n\t\t\treturn i;\n\t\t} \n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "59c37a782d5812a7e486d3c4101b3f3e", "score": "0.50964755", "text": "function solution1(A) {\n if (3 > A.length) return 0;\n A.sort((a, b) => a - b);\n let mid = A[Math.round((A.length - 1) / 2)];\n let midx = A.indexOf(mid);\n if (A[midx] === A[midx + 1] && A[midx] + A[midx + 1] > A[midx + 2]) {\n return 1;\n }\n if (A[midx - 1] + A[midx] > A[midx + 1]) return 1;\n else return 0;\n}", "title": "" }, { "docid": "e90f9cf4869ec4f02bbcb2a5c5595637", "score": "0.50933594", "text": "function runProgram(input) {\n\n input = input.trim();\n var newInput = input.split(\"\\n\");\n\n var data = newInput[0].split(\" \").map(Number);\n var arr = newInput[1].split(\" \").map(Number);\n var len = data[0];\n var k = data[1];\n\n\n var res = -1;\n var index;//if we want to find index also.\n\n const fun = (i, l) => {\n\n if (l >= i) {\n let mid = Math.floor((i + k) / 2);\n\n if (arr[mid] k) {\n res = 1;\n index = mid + 1;\n fun(mid + 1, l)\n\n return;\n }\n else if (arr[mid] > k) {\n return fun(i, mid - 1);\n }\n else {\n return fun(mid + 1, l)\n }\n }\n\n}\nlet i = 0;\nfun(i, len); //here i is the initial starting index;\n\n\n\nconsole.log(index)\n\n\n}//End of runProgram()", "title": "" }, { "docid": "761d783eeb80a2b5673d41d131669b8d", "score": "0.50931156", "text": "function partition(list, l, r, pivot) {\n let tmp = list[pivot];\n list[pivot] = list[r];\n list[r] = tmp;\n let store_index = l;\n for (i = l; i < r; i++) {\n if (list[i] < list[r]) {\n tmp = list[i];\n list[i] = list[store_index];\n list[store_index] = tmp;\n store_index += 1;\n }\n }\n tmp = list[r];\n list[r] = list[store_index];\n list[store_index] = tmp;\n\n return store_index\n }", "title": "" }, { "docid": "b3af784c7a4a01d14e9b340747c32cd1", "score": "0.5091478", "text": "function pairSum(arr, target) {\n let left = 0;\n let right = arr.length - 1;\n\n arr.sort(numberSort);\n\n while (left < right) {\n if (arr[left] + arr[right] === target) {\n return [arr[left], arr[right]];\n } else if (arr[left] + arr[right] < target) {\n left++;\n } else {\n right--;\n }\n }\n\n return 0;\n}", "title": "" }, { "docid": "dc9fdf6fcef410bb30e96481a357a48d", "score": "0.50760835", "text": "function getIndexToIns(arr, num) {\n arr.sort(function(a, b){\n return a - b;\n });\n for (let i = 0; i < arr.length; i++) {\n if (num <= arr[i]) {\n return i;\n }\n }\n return arr.length;\n}", "title": "" }, { "docid": "e057a8f53b01612dd4882533ccfa61f8", "score": "0.50670415", "text": "function indexOfSmallest(array) {\n if (array.length <= 1) {\n return 0;\n } else {\n var tmpIndex = indexOfSmallest(array.slice(1)) + 1;\n if (array[0] < array[tmpIndex] || array[tmpIndex] < 0) {\n return 0;\n } else {\n return tmpIndex;\n }\n }\n}", "title": "" }, { "docid": "a99def92bfe316ab78c1458a60bb9c03", "score": "0.5067007", "text": "function findMin(nums) {\n let start = 0, end = nums.length-1;\n while (start < end) {\n if (nums[start] < nums[end]) return nums[start]; // No rotation\n let mid = Math.floor((start+end)/2);\n if (nums[mid] >= nums[start]) start = mid + 1; \n else end = mid; \n }\n return nums[start];\n}", "title": "" }, { "docid": "a86f25ba9e2fb1e42de05261d2c31dfa", "score": "0.50663877", "text": "function rFindMaxVal(arr, ind = 0) {\n if (arr.length == 0) { // Edge case: array is empty - so we add this to prevent stack overflow\n return null; // Arbitrary value picked - I chose \"null\"\n }\n if (ind == arr.length - 1) { // Base case: reached of array, so return that value for comparison\n // console.log(\"End of array - returning\",arr[arr.length - 1]);\n return arr[arr.length - 1];\n } else { // Compare current value in the array to remainder of the array\n var x = Math.max(arr[ind],rFindMaxVal(arr,ind+1)); // Note the recursion here\n // console.log(\"Returning\",x);\n return x;\n }\n}", "title": "" }, { "docid": "cb79b73f8bc2762334e40413d0039d14", "score": "0.5064905", "text": "function partition() {\n let i =0;\n let ind = pivot+1;\n //find elements less than pivot\n let left = []\n let right = []\n while(ind < arr.length){\n if(arr[ind] > arr[pivot])\n right.push(arr[ind]);\n else\n left.push(arr[ind])\n ind++;\n }\n\n while(i< pivot){\n if(arr[i] < arr[pivot])\n left.push(arr[i])\n else if (arr[i] > arr[pivot])\n right.push(arr[i])\n i++;\n }\n console.log(right)\n console.log(left)\n return [...left,arr[pivot],...right];\n //find elements greater than pivot\n }", "title": "" }, { "docid": "e734c8b00c5ec8d7234f0268761a2c1f", "score": "0.50647736", "text": "function partitionArray(leftIndex, rightIndex, pivot)\n {\n let leftPartition = leftIndex - 1;\n let rightPartition = rightIndex;\n\n while(true)\n {\n // Find bigger value than pivot.\n while(array[++leftPartition] < pivot);\n\n // Find smaller value than pivot.\n while(rightPartition > 0 && array[--rightPartition] > pivot);\n\n if(leftPartition >= rightPartition)\n {\n break; // If pointers cross, then done.\n }\n else // Else swap the elements.\n {\n onAction({type: ACTIONS.SWAP, data: [leftPartition, rightPartition]});\n let temp = array[leftPartition]; \n array[leftPartition] = array[rightPartition];\n array[rightPartition] = temp;\n }\n } // End of while(true).\n\n // Restore the pivot.\n onAction({type: ACTIONS.SWAP, data: [leftPartition, rightIndex]});\n let temp2 = array[leftPartition];\n array[leftPartition] = array[rightIndex];\n array[rightIndex] = temp2;\n \n // Return pivot's location.\n return leftPartition;\n } // End of partitionArray().", "title": "" }, { "docid": "4d8f867579bf7d70f108ac85b8a9ce07", "score": "0.5064004", "text": "_quicksortStorage(leftmostIndex, rightmostIndex, comparator) {\n if (leftmostIndex >= rightmostIndex) {\n return; // Can't sort 1 or fewer items\n }\n // Pivot selection can actually be a big deal in quicksort. Picking one of the endpoints as\n // pivot is usually not great, but is also not really the point of this exercise.\n const pivot = this._storage[leftmostIndex];\n let i = leftmostIndex + 1;\n let j = rightmostIndex;\n while (i < j) {\n // All elements to the right of i which are greater than the pivot are in the right place\n while (i < j && comparator(this._storage[j], pivot) > 0) {\n j--;\n }\n // All elements to the left of j which are less than or equal to the pivot are in the right\n // place\n while (i < j && comparator(this._storage[i], pivot) <= 0) {\n i++;\n }\n // i and j now point to elements that are on the wrong side of each other, so we swap them\n // and repeat.\n this._swapStorage(i, j);\n }\n // At this point, i === j, and we can guarantee that all elements to the left of i are \n // less than or equal to the pivot. All elements to the right of i are greater than or\n // equal to the pivot. We want i to point to the last item that is less than or equal to\n // the pivot. If i is pointing to an item, that is greater than the pivot, we know \n // the last item that goes before the pivot is i-1;\n if (comparator(this._storage[i], pivot) > 0 ) {\n i--;\n }\n // now we swap the pivot into the ith place, and we know for sure it doesn't need to move.\n this._swapStorage(leftmostIndex, i);\n // so we can recurse on the left and right halves of the list.\n this._quicksortStorage(leftmostIndex, i - 1, comparator);\n this._quicksortStorage(i + 1, rightmostIndex, comparator);\n }", "title": "" }, { "docid": "30cbf9453f9dd70a32fac08635516856", "score": "0.5061374", "text": "function partition(arr, start, end) {\n // Taking the last element as the pivot\n const pivotValue = arr[end];\n let pivotIndex = start;\n\n for (let i = start; i < end; i++) {\n if (arr[i] < pivotValue) {\n // Swapping elements\n [arr[i], arr[pivotIndex]] = [arr[pivotIndex], arr[i]];\n // Moving to next element\n pivotIndex++;\n }\n }\n\n // Putting the pivot value in the middle\n [arr[pivotIndex], arr[end]] = [arr[end], arr[pivotIndex]];\n return pivotIndex;\n}", "title": "" }, { "docid": "02008ff7ee66ceee3332db5516eb2abe", "score": "0.5057686", "text": "function getIndexToIns(arr, num) {\r\n arr.sort((a, b) => a - b);\r\n\r\n let ind = arr.findIndex((el) => el >= num);\r\n if (ind === -1) {\r\n return arr.length;\r\n } else return ind;\r\n}", "title": "" }, { "docid": "a8abb0f4e261b6388a80a3a396d3a124", "score": "0.5053192", "text": "function sumArray (arr) {\n let curLargest = arr[0] || -Infinity;\n let curSum = -Infinity;\n let curNum;\n for (let i = 0; i <= arr.length; i++){\n curNum = arr[i];\n if ((curNum || 0) <= 0) {\n curLargest = curNum > curLargest ? curNum : curLargest;\n curLargest = curSum > curLargest ? curSum : curLargest;\n curSum = curNum + curSum > 0 ? curNum + curSum : curNum; \n } else {\n curSum = curSum < 0 ? curNum : curSum + curNum;\n }\n }\n return curLargest;\n}", "title": "" }, { "docid": "9a9958e080bcdfecafd22f0e15ac3e5f", "score": "0.50512844", "text": "function getIndex(val, arr){\n for (var i = 0; i < arr.length; i++) {\n if (val < arr[i]){\n return i++;\n }\n }\n return 9;\n}", "title": "" }, { "docid": "50fae5a7149e5b70e3451480ece5ed4a", "score": "0.50495064", "text": "function partitionLomuto(array, left, right) {\n var pivot = right;\n var i = left;\n\n for(var j = left; j < right; j++) {\n if(array[j] <= array[pivot]) {\n swap(array, i , j);\n i = i + 1;\n }\n }\n swap(array, i, j);\n return i;\n}", "title": "" } ]
3f40f8dc9b0c5f63009f46d5d77de13e
detalle del plan de pagos
[ { "docid": "e5e9c11e91d29845fce8d60dd72886e8", "score": "0.0", "text": "async function detallePPPlanP(plan_pago_id) {\n document.form_operation.operation_x.value = 'detail';\n document.form_operation.id.value = plan_pago_id;\n //document.form_operation.submit();\n\n var fd = new FormData(document.forms['form_operation']);\n\n // for (var pair of fd.entries()) {\n // console.log(pair[0] + ', ' + pair[1]);\n // }\n\n div_modulo.html(imagen_modulo);\n\n let result;\n\n try {\n result = await $.ajax({\n url: '/',\n method: 'POST',\n type: 'POST',\n cache: false,\n data: fd,\n contentType: false,\n processData: false,\n success: function (response) {\n if (response != 0) {\n div_modulo.html(response);\n } else {\n alert('error al realizar la operacion, intentelo de nuevo');\n }\n },\n error: function (qXHR, textStatus, errorThrown) {\n console.log(errorThrown); console.log(qXHR); console.log(textStatus);\n },\n });\n //alert(result);\n }\n catch (e) {\n console.error(e);\n }\n}", "title": "" } ]
[ { "docid": "f63fe0b48b4991de972bfe614addbb43", "score": "0.62509185", "text": "function paginar(pagina) {\n $scope.pagina = pagina;\n var pagedData = $scope.listaTratamiento.slice((pagina - 1) * $scope.elementosPagina, pagina * $scope.elementosPagina);\n $scope.listaTratamientoMostrar = pagedData;\n }", "title": "" }, { "docid": "48250540434c31919d5f88c426c01a5f", "score": "0.62337065", "text": "function pagarAlquiler(datosCasilla, casillaDueno) {\n\n //Buscamos en el array la casilla, para sacar los datos\n //Tenemos los datos de la casilla y de la posesion\n\n var aPagar = 0;\n trace(\"tipo \" + datosCasilla.tipo);\n //Comprobamos que tipo de casilla es:\n if (datosCasilla.tipo == \"caballos\") {\n //Comprobamos si tiene más caballos\n var cont = 0;\n for (var i = 0; i < posesionesCasillas.length; i++) {\n //Comprobamos que sea del mismo jugador\n if (posesionesCasillas[i].idUsuario == casillaDueno.idUsuario) {\n //Comprobamos que sea caballo \n trace(\"Tiene más posesiones\");\n trace(posesionesCasillas[i].idCasilla);\n if (posesionesCasillas[i].idCasilla == 6 || posesionesCasillas[i].idCasilla == 11 ||\n posesionesCasillas[i].idCasilla == 16 || posesionesCasillas[i].idCasilla == 21) {\n trace(\"tiene mas caballos\");\n cont += 1;\n }\n }\n }\n //En cont recogemos los caballos que tenga y por cada caballo sera\n if (cont >= 1) {\n aPagar = datosCasilla.precioAlquiler * cont;\n trace(\"Pagara \" + aPagar);\n }\n\n } else if (datosCasilla.tipo == \"bastones\") {\n //Comprobamos si tiene el otro bastón\n var cont = 0;\n for (var i = 0; i < posesionesCasillas.length; i++) {\n //Comprobamos que sea del mismo jugador\n if (posesionesCasillas[i].idUsuario == casillaDueno.idUsuario) {\n //Comprobamos que sea caballo \n trace(\"Tiene más posesiones\");\n trace(posesionesCasillas[i].idCasilla);\n if (posesionesCasillas[i].idCasilla == 13 || posesionesCasillas[i].idCasilla == 29) {\n trace(\"tiene los bastones\");\n cont += 1;\n }\n }\n }\n //Tiramos los dados para sacar un numero:\n// var dados;\n// = tirarDados();\n //Ponemos los dados en color de activo\n// $(\".dado\").css({backgroundColor: \"#f2ea9d\"});\n//// dados = $(\".dado\").bind(\"click\", tirarDados);\n// setTimeout(function() {\n// dados = tirarDados;\n//\n// }, 1000);\n aPagar = 5 * dados * cont;\n trace(\"Pagara \" + aPagar);\n\n } else if (datosCasilla.tipo == \"tierra\") {\n //Comprobar si la casilla tiene casas\n aPagar = datosCasilla.precioAlquiler;\n }\n\n //Comprobamos si tiene dinero para pagar\n //FALTA POR PROBAR\n while (usuario.dinero <= aPagar) {\n botonHipotecar(true);\n }\n listaUsuarios[turno].dinero -= aPagar;\n// listaUsuarios[turno].dinero -= datosCasilla.precioAlquiler;\n usuario.dinero = listaUsuarios[turno].dinero;\n\n $(\"#cabeUsu\" + turno + \" .dinero\").text(usuario.dinero);\n socket.emit(\"cambioDinero\", {sala: sala, usuario: usuario, turno: turno});\n\n //Buscamos el usuario al que hay que pagar\n var usuarioPa = \"\";\n for (var j = 0; j < listaUsuarios.length; j++) {\n if (listaUsuarios[j].id == casillaDueno.idUsuario) {\n trace(\"Recojo usuario\");\n usuarioPa = listaUsuarios[j];\n usuarioPa.dinero += aPagar;\n// usuarioPa.dinero += datosCasilla.precioAlquiler;\n $(\"#cabeUsu\" + j + \" .dinero\").text(usuarioPa.dinero);\n socket.emit(\"cambioDinero\", {sala: sala, usuario: usuarioPa, turno: j});\n } else {\n trace(\"No existe ese usuario\");\n }\n }\n var texto = \"El usuario \" + usuario.nombre + \" le ha pagado un alquiler de \" + datosCasilla.precioAlquiler + \" a \" + usuarioPa.nombre;\n emitirInformacion(texto);\n\n}", "title": "" }, { "docid": "d9dd054a8c771944c64dd926790461fc", "score": "0.59873796", "text": "function generarConfigPlanes(){\n document.getElementById('info-plan').innerHTML=\"\";\n document.getElementById('info-plan').innerHTML+=`Actualmente cuentas con el plan ${plan.nombre}.`\n\n }", "title": "" }, { "docid": "25d54f51eec3a572eb9778a99429f6c7", "score": "0.5904567", "text": "paginacaoDados(dados, pagina, limit){\n const { count : totalItens,rows : Money_transaction} = dados\n const paginaAtual = pagina ? + pagina : 0\n const totalPaginas = Math.trunc(totalItens / limit)\n \n return {Money_transaction, totalPaginas, paginaAtual, totalItens }\n }", "title": "" }, { "docid": "ea197165980e059d605a09c13a1b1e0b", "score": "0.58413434", "text": "privateCreatePlantillaPaginadorHTML(p_numPagActual,p_numPagTotal){\n\n let l_plantillaPagina =\n `\n <!-- grupo paginas -->\n <div datos=\"caja-paginas\" class=\"mw-20rem d-flex justify-content-center align-items-center bg-grisSecondaryExtraSoft ${this.getBorder()} roundedRem-5 text-truncate p-2\">\n\n <!-- pag Anterior -->\n <a href='javascript:void(0)' pagina='pagina-anterior' class='${this.getTextColor()} ${this.getTamanyoFuente()} mr-1'>\n <i class='fas fa-arrow-alt-circle-left'></i>\n </a>\n `\n ;\n \n for(let i = 1; i <= p_numPagTotal;i++){\n if(i == p_numPagActual){\n l_plantillaPagina += \n `\n <a href='javascript:void(0)' pagina='${i}' class='mx-1 ${this.getTamanyoFuente()} ${this.getTextColor()} ${this.getCssClassActiveNumPag()}'>\n ${i}\n </a>\n `;\n }else{\n l_plantillaPagina += \n `\n <a href='javascript:void(0)' pagina='${i}' class='mx-1 ${this.getTamanyoFuente()} ${this.getTextColor()} '>\n ${i}\n </a>\n `;\n }\n }\n\n l_plantillaPagina+= \n `\n <!-- pag Siguiente -->\n <a href='javascript:void(0)' pagina='pagina-siguiente' class='${this.getTextColor()} ${this.getTamanyoFuente()} ml-1'>\n <i class='fas fa-arrow-alt-circle-right'></i>\n </a>\n </div>\n `;\n\n // console.log(l_plantillaPaginador);\n return (l_plantillaPagina);\n\n }", "title": "" }, { "docid": "204133aa232088ae69f3bbbe978d0b69", "score": "0.5790739", "text": "function pagina(numPagina) {\n paginaActiva = numPagina;\n paginasView.innerHTML = '';\n if (paginaActiva > 1) {\n anterior = true;\n paginasView.innerHTML += `<li class=\"page-item\"><a class=\"page-link\" href=\"#\" name=\"pagina\" data-page=\"${paginaActiva - 1}\">\n Anterior\n </a><li>`;\n }\n\n if (numPagina >= 3 && numPagina < totalPaginas - 1 && totalPaginas >= 5) {\n for (let i = numPagina - 2; i <= numPagina + 2; i++) {\n llenarPaginas(i)\n }\n }\n if (numPagina == 2 && numPagina < totalPaginas - 1 && totalPaginas >= 5) {\n for (let i = numPagina - 1; i <= numPagina + 3; i++) {\n llenarPaginas(i)\n }\n }\n if (numPagina == 1 && numPagina < totalPaginas - 1 && totalPaginas >= 5) {\n for (let i = numPagina; i <= numPagina + 4; i++) {\n llenarPaginas(i)\n }\n }\n if (numPagina == totalPaginas - 1 && numPagina <= totalPaginas - 1 && totalPaginas >= 5) {\n for (let i = numPagina - 3; i <= numPagina + 1; i++) {\n llenarPaginas(i)\n }\n }\n if (numPagina == totalPaginas && totalPaginas >= 5) {\n for (let i = numPagina - 4; i <= numPagina; i++) {\n llenarPaginas(i)\n }\n }\n if (totalPaginas <= 5) {\n for (let i = 1; i <= totalPaginas; i++) {\n if (i == 6) {\n break;\n }\n llenarPaginas(i)\n }\n }\n if (paginaActiva < totalPaginas) {\n siguiente = true;\n paginasView.innerHTML += `<li class=\"page-item\"><a class=\"page-link\" href=\"#\" name=\"pagina\" data-page=\"${paginaActiva + 1}\">\n Siguiente\n </a><li>`;\n }\n}", "title": "" }, { "docid": "67572fe4a1ed5ee20fae63dd9c698ad5", "score": "0.576467", "text": "function paginar (pags, limiteLinks, inicioLinks, finPAgs) {\n\n\tif (pags == \"Siguiente\") { // INICIA condicion para mostrar paginado al precionar el lin \"siguiente\"\n\n\t\t\tlimiteLinks = limiteLinks + 5;\n\t\t\tinicioLinks = inicioLinks + 5;\n\n\t\t\t$(\"#paginacion\").empty();\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'<<'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'Anterior'+'</a>&nbsp;');\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+i+'</a>&nbsp;');\n\t\t\t}\n\n\t\t\tif(limiteLinks < finPAgs){ // condicion pa saber si ya llegue al limite de paginas\n\n\t\t\t\t$(\"#paginacion\").append('&nbsp;<a href=\"#\" class=\"links\" id=\"siguiente\">'+'Siguiente'+'</a>&nbsp;');\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" id=\"ultimo\">'+'>>'+'</a>');\n\t\t\t}\n\n\t\t} // ------------------ TERMINA CONDICION DEL LINK \"SIGUIENTE\" --------------------------------------\n\n\n\t\tif (pags == \"Anterior\") { // INICIA condicion para mostrar paginado al precionar el lin \"anterior\"\n\n\t\t\tlimiteLinks = limiteLinks - 5;\n\t\t\tinicioLinks = inicioLinks - 5;\n\n\t\t\t$(\"#paginacion\").empty();\n\n\t\t\tif(inicioLinks > 1){ //condicion para saber si estoy mostrando el limite inicial de los links\n\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'<<'+'</a>&nbsp;');\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'Anterior'+'</a>&nbsp;');\n\t\t\t}\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+i+'</a>&nbsp;');\n\t\t\t}\n\n\t\t\t$(\"#paginacion\").append('&nbsp;<a href=\"#\" class=\"links\" id=\"siguiente\">'+'Siguiente'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" id=\"ultimo\">'+'>>'+'</a>');\n\n\t\t} // --------------------- TERMINA CONDICION DEL LINK \"ANTEIROR\" ---------------------------------\n\n\t\tif(pags == \"&gt;&gt;\"){ // >>\n\t\t\tlimiteLinks = finPAgs;\n\t\t\tinicioLinks = finPAgs - 10;\n\n\t\t\t$(\"#paginacion\").empty();\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'<<'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'Anterior'+'</a>&nbsp;');\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+i+'</a>&nbsp;');\n\t\t\t}\n\n\t\t}\n\n\t\tif(pags == \"&lt;&lt;\"){ // <<\n\t\t\tlimiteLinks = 11;\n\t\t\tinicioLinks = 1;\n\n\t\t\t$(\"#paginacion\").empty();\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+i+'</a>&nbsp;');\n\t\t\t};\n\t\t\t$(\"#paginacion\").append('&nbsp;<a href=\"#\" class=\"links\" id=\"siguiente\">'+'Siguiente'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" id=\"ultimo\">'+'>>'+'</a>');\n\t\t}\n\n\t\tvar response = [limiteLinks, inicioLinks];\n\t\treturn response;\n}", "title": "" }, { "docid": "24a337cb0cde034e131a9f5619eb5597", "score": "0.5761785", "text": "getPaginacao(pagina, tamanho){\n const limit = tamanho ? +tamanho : 5\n const offset = pagina ? pagina * limit : 0\n\n return { limit, offset }\n }", "title": "" }, { "docid": "52ef0ad02be9324c9e0ad314c07b3288", "score": "0.57218766", "text": "function initPaginas() {\n let data = getData();\n totalPaginas = data.paginas;\n paginasView.innerHTML = '';\n for (let i = 1; i <= totalPaginas; i++) {\n if (i == 6) {\n break;\n }\n llenarPaginas(i)\n }\n if (totalPaginas > 1) {\n siguiente = true;\n paginasView.innerHTML += `\n <li class=\"page-item\">\n <a class=\"page-link\" href=\"#\" name=\"pagina\" data-page=\"${paginaActiva + 1}\">Siguiente</a>\n <li>\n `;\n }\n}", "title": "" }, { "docid": "823107122d71af90223aa9e8bc581458", "score": "0.5719846", "text": "function actualizarPaginaArmala() {\n const iPizzaSeleccionada = obtenerInfoDeiPizzaSeleccionada();\n const $desplegables = obtenerDesplegables();\n cantidadDeDesplegables = $desplegables.length;\n \n let $detallePorciones = obtenerDetallePorciones();\n\n // Oculto todos los desplegables\n for(let i=0; i < cantidadDeDesplegables; i++) {\n $desplegables[i].classList.add('d-none');\n $desplegables[i].selectedIndex = 0;\n \n // Muestro los li necesarios\n let liGenerico = crearElementoDeLista(iPizzaSeleccionada.cantidadDePorcionesPorGusto, '***', '***', false);\n mostrarDetallePorciones($detallePorciones, i, liGenerico);\n }\n \n $detallePorciones = obtenerDetallePorciones(); // Actualizo la referencia al DOM\n\n // Muestro los desplegables necesarios\n for(let i=0; i < iPizzaSeleccionada.cantidadDeGustos; i++) {\n $desplegables[i].classList.remove('d-none');\n $detallePorciones[i].classList.toggle('d-none');\n }\n \n canvasPizza.mostrarCanvasInicial();\n inicializarUbicacionesDePorciones(iPizzaSeleccionada);\n\n const costoTotal = calcularCostoTotal();\n mostrarCostoTotal(costoTotal);\n }", "title": "" }, { "docid": "2e5613a3a53fb014f6f554eff62b7a41", "score": "0.57052416", "text": "getPager(totalItems, currentPage, pageSize) {\n currentPage = currentPage || 1;\n pageSize = 1;\n let totalPages = Math.ceil(totalItems / pageSize);\n \n let startPage, endPage;\n if (totalPages <= 1) {\n startPage = 1;\n endPage = totalPages;\n } \n\n let startIndex = (currentPage - 1) * pageSize;\n let endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1);\n let pages =new Array(startPage,endPage+1);\n return {\n totalItems: totalItems,\n currentPage: currentPage,\n pageSize: pageSize,\n totalPages: totalPages,\n startPage: startPage,\n endPage: endPage,\n startIndex: startIndex,\n endIndex: endIndex,\n pages: pages\n };\n }", "title": "" }, { "docid": "d63e3b901bb7fb200144390b4f972840", "score": "0.5691788", "text": "function showPagination(clickedNumber, nb_article, nb_article_par_page, mot_cle){\r\n\r\n\t var divPagination = jQuery('.vdf-pagination');\r\n\t //delete old\r\n\t divPagination.html('');\r\n\r\n\t //1 CALCULE DEBUT\r\n\t var maxNbPaginationShow = 6; //ex: 1 2 3 . . . 7 8 9\r\n\t var nbPagination = Math.ceil(nb_article / nb_article_par_page); //ex: 81 / 9 = 9 pagination\r\n\t var page = 0;\r\n\r\n\t //Calculer le numero de depart de la page ex: 1 2 3 4 5 6 7 8 9\r\n\t //si je clique sur 4 il n'y a pas de point (ecart <= maxNbPagination)\r\n\t //si je clique sur 2 il il y'aura des point (ecart > maxNbPagination)\r\n\t if(clickedNumber == 0){\r\n\t\t page = 0;\r\n\t }\r\n\t else if(nbPagination > maxNbPaginationShow){\r\n\t\t var ecart = nbPagination - clickedNumber; //9-0:9, 9-5:4\r\n\r\n\t\t if(ecart < maxNbPaginationShow){\r\n\t\t\t//Si le nombre cliquee est <6 on affiche sans point\r\n\t\t\t page = nbPagination - maxNbPaginationShow;\r\n\t\t }\r\n\t\t else{\r\n\t\t\t//S'il est <6 on affiche avec les point\r\n\t\t\t page = clickedNumber;\r\n\t\t }\r\n\t }\r\n\t else{\r\n\t\t//Si le nombre pagination est egale au max\r\n\t\t page = 0;\r\n\t }\r\n\r\n\t //2 AJOUT DE LA PAGINATIOIN\r\n\t var pointVide = '<div class=\"pointVide\">...</div>';\r\n\t var linkString = '<div class=\"{0}\" onclick=\"ajax_load_articles({1}, '+nb_article+', '+nb_article_par_page+', \\'' + mot_cle + '\\')\">{2}</div>';\r\n\t var linkPrev = '<div class=\"page prev\" onclick=\"clickPrev('+nb_article+', '+nb_article_par_page+', \\'' + mot_cle + '\\')\">«</div>';\r\n\t var linkSuiv = '<div class=\"page next\" onclick=\"clickNext('+nb_article+', '+nb_article_par_page+', \\'' + mot_cle + '\\')\">»</div>';\r\n\t var comptDebut = 1;\r\n\t var link;\r\n\r\n\t if(clickedNumber > 0){\r\n \t //Affiche 3 chiffre ... 3 chiffre\r\n \t //First part premiere et prev toujours à la page 0\r\n \t link = String.format(linkString, 'page first', 0, 'Première');\r\n \t divPagination.append(link);\r\n \t divPagination.append(linkPrev);\r\n\t }\r\n\r\n\t //page cliquee = 1 donc 1-1=0, 0*3 = 0. Donc du 0 ajoute 3 dans sql limit\r\n //page cliquee = 2 donc 2-1=1, 1*3 = 0. Donc du 3 ajoute 3 dans sql limit\r\n\t for(pager=(page * nb_article_par_page); pager < nb_article; pager += nb_article_par_page){\r\n\r\n\t\t if(comptDebut <=3 || page >= (nbPagination - 3) ){\r\n\t\t\t //affiche les 3 premieres et 3 dernieres chiffre\r\n\t\t\t if(page == clickedNumber){\r\n\t\t\t\t link = String.format(linkString, 'page active', page, page+1);\r\n\t\t\t }\r\n\t\t\t else{\r\n\t\t\t\t link = String.format(linkString, 'page', page, page+1);\r\n\t\t\t }\r\n\r\n \t\t divPagination.append(link);\r\n\t\t }\r\n\t\t else{\r\n\t\t\t //seulement le 4ieme est les point\r\n\t\t\t if(comptDebut == 4){\r\n\t\t\t\t divPagination.append(pointVide);\r\n\t\t\t }\r\n\t\t }\r\n\r\n\t\t page++;\r\n\t\t comptDebut++;\r\n\t }\r\n\r\n\t if(clickedNumber < nbPagination-1){\r\n \t //third part derniere et next\r\n \t divPagination.append(linkSuiv);\r\n \t link = String.format(linkString, 'page last', nbPagination-1, 'Dernière');\r\n \t divPagination.append(link);\r\n\t }\r\n\r\n}", "title": "" }, { "docid": "fc94f1fb66a7475225fa69dd650ae41c", "score": "0.56599957", "text": "getPosicionEnNodoPadreElementosPaginados(){\n return this.l_posicionEnNodoPadreElementosPaginados;\n }", "title": "" }, { "docid": "58fe07bf501c9d54879852b7bd75ca57", "score": "0.5656176", "text": "function start(res, page) {\n const sorties = res\n const pagination1 = pagination(sorties, 6)\n console.log(pagination1)\n displayb(pagination1, page)\n}", "title": "" }, { "docid": "1fd82247e248784a97aa2365092956da", "score": "0.5649252", "text": "function getPages(current, endpoint, special_model){\r\n var start = 1,\r\n stop = endpoint;\r\n //if we have less that 6 pages, we load all they without 3points symbols\r\n if (endpoint < 6) {\r\n $('.space_buttons' + special_model).css('display', 'none');\r\n removeItems('.current-page' + special_model);\r\n start = 1;\r\n stop = endpoint;\r\n } else if (endpoint >= 6) {\r\n //calculte first-button-page\r\n start = current - 2;\r\n //calculate\r\n if (start > 1) $('#navbutton-space_prev' + special_model).css('display', 'inline');\r\n else if (start <= 1) {\r\n $('#navbutton-space_prev' + special_model).css('display', 'none');\r\n start = 1;\r\n }\r\n //calculte last-button-page\r\n stop = start + 4;\r\n if (stop >= endpoint) {\r\n $('#navbutton-space_next' + special_model).css('display', 'none');\r\n stop = endpoint;\r\n start = stop - 5;\r\n } else if (stop < endpoint) $('#navbutton-space_next' + special_model).css('display', 'inline');\r\n removeItems('.current-page' + special_model);\r\n }\r\n setPages(current, start, stop, special_model);\r\n}", "title": "" }, { "docid": "0549610e56d5e28ee166c9d56909df29", "score": "0.5611913", "text": "function PagingInfo(totalCount)\n {\n $scope.totalCount = totalCount;\n $scope.totalPage = Math.ceil( $scope.totalCount / $scope.pageRecord)\n $scope.totalOption=[{}];\n for(var i = 0 ;i< $scope.totalPage;i++)\n {\n $scope.totalOption[i]={size:i+1};\n }\n }", "title": "" }, { "docid": "99e52709c44c8762fdfc9d37fc8c4cbb", "score": "0.5609188", "text": "function _pagamento(){\n \n function __carregar(){\n _load(function(){\n \n if($('.jdialogerror')[0]){\n var _t = $('.jdialogerror').html();\n d.close();\n jAlert(_t,'Editar pagamento');\n return;\n }\n \n /*Setando variavel com os campos presentes na tela*/\n _setCampos();\n /*Eventos padrao das telas*/\n _bindEventosPadrao();\n /*Campos de cadastros*/\n _cadastros();\n \n /*Alterna visualizacao da tela baseado nos elementos dela*/\n var toggleElementos = function(){\n var \n data = campos.data.prevista.val().formatDateMySql(),\n hoje = get_date(\"Y-m-d\"),\n cmp = datecmp(data,hoje),\n conf = p.find('.nl-checkbox-confirmado:checked:visible')[0] ? true : false,\n conc = p.find('.nl-checkbox-conciliado:checked:visible')[0] ? true : false;\n// console.log(!conc && cmp>0);\n /*Lancamento marcado para algum tipo de repeticao?*/\n p.find(\".nl-lembrete,.nl-automatico\").toggle(!conc && cmp>0 );\n /*Habilita concialiacao apenas no passado e confirmado*/\n p.find('.nl-confirmado').toggle(cmp <= 0);\n /*Habilita concialiacao apenas no passado e confirmado*/\n p.find('.nl-conciliado').toggle(conf && cmp <= 0 );\n scroll.update();\n }\n campos.confirmado.click(toggleElementos);\n campos.conciliado.click(toggleElementos);\n /*Sobreescreve calendario padrao criado em cima*/\n campos.data.prevista.blur(toggleElementos).datepicker('option','onClose', toggleElementos );\n \n toggleElementos();\n });\n }\n \n function __salvar(){\n \n var destino = campos.edicao.attr('destino') || lancamento.option('cadastros.conta');\n \n l.option('codigo',id);\n l.option('virtual',virtual);\n /*Pagamentos sao sempre transferencias*/\n l.option('tipo','T');\n /*Este eh um pagamento..*/\n l.option('pagamento',1);\n /*Tipo do lancamento*/\n l.option('automatico', campos.automatico.is(':checked:visible') ? 1 : 0);\n /*A opcao de conta eh sempre a conta de cartao de credito*/\n l.option('cadastros.conta',campos.cadastros.conta.contao.val());\n /*Plastico da conta de origem eh sempre o titular*/\n l.option('cadastros.plastico',campos.cadastros.conta.contao.find('option:selected').attr('plastico') || 0);\n /*A opcao de conta eh sempre a conta de cartao de credito*/\n l.option('cadastros.destino',destino);\n /*Observacoes*/\n l.option('observacoes',campos.observacoes.val());\n /*Validando e setando valor*/\n if(!_setValor(l,'previsto',campos.valor.previsto)) return;\n l.option('valor.efetivo',l.option('valor.previsto'));\n /*Validando e setando data*/\n if(!_setData(l,'prevista',campos.data.prevista)) return;\n \n l.option('data.anterior',virtual);\n l.option('data.efetiva',l.option('data.prevista'));\n l.option('data.compra',l.option('data.prevista'));\n \n /*Status*/\n l.option('status',{\n confirmado : campos.confirmado.is(\":checked:visible\") ? 1 : 0,\n /*Lancamento conciliado?*/\n conciliado : campos.conciliado.is(\":checked:visible\") ? 1 : 0\n });\n /*Lembrete via email..?*/\n l.option('notificacoes.email',{\n enviar: $(\"#checkbox_email:checked:visible\")[0] ? 1 : 0 , \n dias : $(\"#select_email_lancamento\").val()\n });\n l.option('descricao',id || lancamento.option('residuo') ? campos.edicao.attr('descricao') :\n \"Pagamento do cartão \"+ $(\"#select_cartoes option:selected\").html().trim());\n \n \n// console.log(l.options());\n// return;\n// \n \n Ajax('EDITAR',l.encode(),function(r){\n// console.log(r)\n _done();\n });\n }\n \n return {\n title : (id ? 'Editar' : 'Novo') + ' pagamento',\n showButtons : false,\n ajax : __carregar,\n buttons : _buttons(__salvar)\n }\n }", "title": "" }, { "docid": "0dd5063b4c820158bcdf3bfa9b6cb32a", "score": "0.5601217", "text": "paga(beneficiario, denaro){\n if(getPatrimonioTotale() < denaro){ //se non si ha abbastanza denaro si perde la partita\n perditaPartita();\n }else {\n var nuovoPrezzo = pagaLoyaltyPoints(denaro); //pago con la quantita di loyalty points sufficente\n if(beneficiario.equals(\"Banca\")){ //se si deve pagare la banca vengono solo scalati i soldi\n this.soldi = soldi - nuovoPrezzo;\n }else{ //se va pagato un giocatore si scalano i soldi e si aggiungono a lui\n this.soldi = soldi - nuovoPrezzo;\n beneficiario.soldi = beneficiario.soldi + denaro;\n }\n }\n }", "title": "" }, { "docid": "c6b2f9c9adb0dc5eb52fe1c244b53913", "score": "0.55586827", "text": "function pagfun() {\n if ($scope.currentPage != $scope.paging.current) {\n $scope.currentPage = $scope.paging.current;\n getpagedPagedPayroles();\n }\n }", "title": "" }, { "docid": "bfc13aee0b0008cbc411540a985fc3c5", "score": "0.555249", "text": "function PagingInfo(totalCount)\n {\n $scope.totalCount = totalCount;\n $scope.totalPage = Math.ceil( $scope.totalCount / $scope.pageRecord);\n $scope.totalOption=[{}];\n for(var i = 0 ;i< $scope.totalPage;i++)\n {\n $scope.totalOption[i]={size:i+1};\n }\n }", "title": "" }, { "docid": "c506e34f790ae5d03f9412d7f420620f", "score": "0.5537585", "text": "function getPublicaciones(pag) {\n var $container = $('#contenedorLista');\n $container.addClass('loading');\n $container.removeClass('error-get sin-notas');\n\n var url_params = {};\n if(pag) {\n url_params.page = pag;\n }\n else {\n url_params.page = actual_page;\n }\n\n if (ordenamiento) {\n url_params.order = ordenamiento;\n }\n\n $.ajax({\n url: urls.list,\n type: 'GET',\n data: url_params\n })\n .done(function(resp) {\n renderLista(resp);\n actual_page = resp.current_page;\n $container.removeClass('loading');\n if (!resp.data.length) {\n $container.addClass('sin-notas');\n }\n })\n .fail(function() {\n $container.addClass('error-get');\n $container.removeClass('loading');\n });\n}", "title": "" }, { "docid": "91e0b0134306cfbc53926ee4bc66f81e", "score": "0.54892796", "text": "function TarjetaPlanAccion() {\n\n this.toolbar = new ToolBarPlanAccion()\n this.grid = new GridPlanAccion()\n}", "title": "" }, { "docid": "9626fc466b8501e9246f14848cebcf82", "score": "0.54850173", "text": "function getViaPlan() {\n\t\tselectionsIdx = 1;\n\t\ttripArrivalTime = tripsArray[firstTripIdx][(tripsArray[firstTripIdx].length-1)][6];\n\t\tvar queryURL = \"https://api.bart.gov/api/sched.aspx\";\n\n\t\t\t$.ajax({\n\t\t\t\tdata: {\n\t\t\t\t\tcmd: 'depart',\n\t\t\t\t\torig: viaStation,\n\t\t\t\t\tdest: destinationStation,\n\t\t\t\t\ttime: tripArrivalTime,\n\t\t\t\t\tkey: bartKey,\n\t\t\t\t\tb: 0,\n\t\t\t\t\ta: 1,\n\t\t\t\t\tjson: 'y'\n\t\t\t\t},\n\t\t\t\turl: queryURL,\n\t\t\t\tmethod: \"GET\"\n\t\t\t\t}).done(getTripLegs);\n\t}", "title": "" }, { "docid": "7ec4c3c79c765f7d170a6d8b0be92628", "score": "0.54798335", "text": "getNodoPadreElementosPaginados(){\n return this.l_nodoPadreElementosPaginados;\n }", "title": "" }, { "docid": "5914bf0159e10a13591db4f21e0e2224", "score": "0.54795176", "text": "function informacionPlanta() { \n const promiseDatos = traerDatosPlanta(1);\n\n promiseDatos.then(\n result => totalDatosPlanta().then( result => paginador(), error => console.log(error)),\n error => console.log(error)\n\n ).finally(\n /* finaly => console.log() */\n \n );\n\n }", "title": "" }, { "docid": "a30a794dc6331d363c8d479579018645", "score": "0.54350907", "text": "function crearPaginacionFacturas(done){\n\tlet objetoEnviar = {\n\t\t'ppp': productosPorPagina,\n\t\t'pageActual': pageActual,\n\t\t'filtros': filtrosEstado\n\t};\n\n\tif(rehacerPaginador){\n\t\thttpPost(`/admin/get-paginacion-facturas`, objetoEnviar, dataObject => {\n\t\t\tif(dataObject) dataObject = JSON.parse(dataObject);\n\t\t\t//Mensaje de error\n\t\t\tif(dataObject ? dataObject.error : !dataObject){\n\t\t\t\tqAll('.paginacion-facturas').forEach(paginador => {\n\t\t\t\t\tpaginador.style.display = 'block';\n\t\t\t\t\tpaginador.innerHTML = `<div class=\"error\">Error creando la paginación. \n\t\t\t\t\t<button class=\"recargar-paginacion\" onclick=\"crearPaginacionFacturas({})\">Recargar</button></div>`;\n\t\t\t\t});\n\t\t\t//Mensaje no hay más páginas\n\t\t\t}else if(dataObject.paginasTotales <= 1){\n\t\t\t\tqAll('.paginacion-facturas').forEach(paginador => {\n\t\t\t\t\tpaginador.innerHTML = 'No hay más páginas.';\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\t//Crear paginador\n\t\t\t\tpaginasTotales = dataObject.paginasTotales;\n\t\t\t\tlet paginadorHTML = actualizarPaginadorActual();\n\t\t\t\t//Insertamos el paginador creado en cada contenedor\n\t\t\t\tqAll('.paginacion-facturas').forEach(paginador => {\n\t\t\t\t\tpaginador.innerHTML = paginadorHTML;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}else{\n\t\tlet paginadorHTML = actualizarPaginadorActual();\n\t\t//Insertamos el paginador creado en cada contenedor\n\t\tqAll('.paginacion-facturas').forEach(paginador => {\n\t\t\tpaginador.innerHTML = paginadorHTML;\n\t\t});\n\t}\n\t//Mostramos los contenedores de los paginadores\n\tqAll('#filtros-facturas, #paginacion-footer-facturas').forEach(e => {\n\t\te.style.display = 'block';\n\t});\n\n\trehacerPaginador = false;\n}", "title": "" }, { "docid": "e9ac9c7581b07bd125d58e3c00046d04", "score": "0.53813595", "text": "function ListProcurements(page) {\n\t\t\tDataService.list(\"procurements?page=\" + page, function (data) {\n\t\t\t\t$scope.procurements = data.procurementsList;\n\t\t\t\t$scope.totalPages = data.totalPages;\n\t\t\t\t$scope.currentPage = data.currentPage + 1;\n\t\t\t\t$scope.pages = new Array($scope.totalPages);\n\t\t\t\tfor (var i = 0; i < $scope.totalPages; i++) $scope.pages[i] = i + 1;\n\t\t\t\tconsole.log($scope.currentPage);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "4e82b6d61034a2e0ebe9a55acb0e87c6", "score": "0.5373583", "text": "getNodoPadrePaginador(){\n return this.l_nodoPadre;\n }", "title": "" }, { "docid": "6eb57015edc67cb34c8abfec4298228f", "score": "0.53621185", "text": "clickNumPagina(){\n\n // click en paginas 1..2..3..\n this.getNodoPadrePaginador().addEventListener('click',(p_evento) =>\n {\n // let l_numPagTotal = Math.ceil(p_arrayProdFiltrados.length/p_selectNumProdMostradosXPaginaValue);\n let l_numPulsadoChar = p_evento.target.getAttribute(\"pagina\");\n let l_numPulsado = Number.parseInt(l_numPulsadoChar);\n if(p_evento.target.nodeName == \"A\"){\n\n if(!Number.isNaN(l_numPulsado)){\n \n // // limpiamos la pagina antes de mostrar el resultado, si no, se acumularan los productos de otras busquedas\n // _removeChildElementsInDom(p_nodoPadreDondeMuestraResultado);\n\n // actualizamos el valor de pagina actual con el valor de la pagina pulsada\n this.setNumPagActual(l_numPulsado);\n\n // calcula el array tramo a mostrar en la pagina indidicada\n // let l_arrayTramo = this.privateCalculaArrayTramo();\n\n // muestra la pagina especifica con sus productos\n // this.privateAnyadeElementosAPagina(l_arrayTramo);\n\n // dibuja los elementos y el paginador\n this.dibuja();\n\n \n\n // // refresca la informacion del numero de productos mostrado por pagina y del total de productos mostrados que han pasado el filtro\n // _muestraNumProductosMostradosDelTotal(g_spanNumProdMostrados,g_spanNumProdResultantes,l_arrayTramo.length,p_arrayProdFiltrados.length);\n\n }\n \n }else if(p_evento.target.nodeName == \"I\"){\n l_numPulsadoChar = p_evento.target.parentNode.getAttribute(\"pagina\");\n if(l_numPulsadoChar == 'pagina-anterior'){\n // Si nos encontramos en una pagina mayor a la 1\n if(this.getNumPagActual() > 1){\n\n // //limpiamos la pagina antes de mostrar el resultado, si no, se acumularan los productos de otras busquedas\n // _removeChildElementsInDom(p_nodoPadreDondeMuestraResultado);\n \n // actualizamos el valor de pagina actual a una pagina menos a la actual\n this.setNumPagActual(this.getNumPagActual()-1);\n\n // calcula el array tramo a mostrar en la pagina indidicada\n // let l_arrayTramo = this.privateCalculaArrayTramo();\n\n // muestra la pagina especifica con sus productos\n // this.privateAnyadeElementosAPagina(l_arrayTramo);\n\n // dibuja los elementos y el paginador\n this.dibuja();\n\n // // refresca la informacion del numero de productos mostrado por pagina y del total de productos mostrados que han pasado el filtro\n // _muestraNumProductosMostradosDelTotal(g_spanNumProdMostrados,g_spanNumProdResultantes,l_arrayTramo.length,p_arrayProdFiltrados.length);\n\n }\n }else if(l_numPulsadoChar == 'pagina-siguiente'){\n if(this.getNumPagActual() < this.getNumPagTotales()){\n\n // actualizamos el valor de pagina actual a una pagina mas a la actual\n this.setNumPagActual(this.getNumPagActual() + 1);\n \n // //limpiamos la pagina antes de mostrar el resultado, si no, se acumularan los productos de otras busquedas\n // _removeChildElementsInDom(p_nodoPadreDondeMuestraResultado);\n\n // calcula el array tramo a mostrar en la pagina indidicada\n // let l_arrayTramo = this.privateCalculaArrayTramo();\n\n // muestra la pagina especifica con sus productos\n // this.privateAnyadeElementosAPagina(l_arrayTramo);\n \n // dibuja los elementos y el paginador\n this.dibuja();\n\n // // refresca la informacion del numero de productos mostrado por pagina y del total de productos mostrados que han pasado el filtro\n // _muestraNumProductosMostradosDelTotal(g_spanNumProdMostrados,g_spanNumProdResultantes,l_arrayTramo.length,p_arrayProdFiltrados.length);\n\n }\n }\n }\n });\n }", "title": "" }, { "docid": "7ee08c3e3caebdb583ea23d34bb2443e", "score": "0.5360606", "text": "getPosicionEnNodoPadrePaginador(){\n return this.l_posicionEnNodoPadrePaginador;\n }", "title": "" }, { "docid": "bb9f51a87c504f85efd33acbab2d6efe", "score": "0.5360334", "text": "function mostraPag (pag) {\n pag[0].style.display = \"block\";\n pag[1].style.display = \"block\";\n if (pag[2])\n pag[2].style.display = \"flex\";\n visibile = pag;\n}", "title": "" }, { "docid": "fc20c16e1cdfe1aaad932da91d25ef78", "score": "0.5352495", "text": "function pagfun() {\n if ($scope.currentPage != $scope.paging.current) {\n $scope.currentPage = $scope.paging.current;\n getpagedlockers();\n }\n\n }", "title": "" }, { "docid": "0556511237d62f9df1590cd619c95577", "score": "0.53498304", "text": "function _constructTBProphylaxisPlan(encArray, hivSummaryModel, obsfinder) {\n // Find plan.\n var tbProphy = {\n plan: 'Not available',\n estimatedEndDate: 'Unknown',\n };\n var planConceptUuid = CONCEPT_UUIDS.TB_PROPHY_PLAN;\n var found = null;\n\n _.find(encArray, function(enc) {\n found = obsfinder(enc.obs, planConceptUuid);\n return found !== null && !_.isEmpty(found);\n });\n\n if (found) {\n tbProphy.plan = found.value.display;\n }\n\n // Calculate estimated end date of plan (6 months after starting)\n var tempDate = moment(hivSummaryModel.tb_prophylaxis_start_date);\n if (tempDate.isValid()) {\n tbProphy.startDate = hivSummaryModel.tb_prophylaxis_start_date;\n tbProphy.estimatedEndDate =\n moment(hivSummaryModel.tb_prophylaxis_start_date)\n .add(TB_PROPHY_PERIOD, 'months')\n .toDate().toISOString();\n } else {\n tbProphy.startDate = 'Not available';\n tbProphy.estimatedEndDate = 'N/A'\n }\n return tbProphy;\n}", "title": "" }, { "docid": "290537e67a5742325518deb99632b7ba", "score": "0.53495216", "text": "function getData() {\n return { ok: true, paginas: 30 }\n}", "title": "" }, { "docid": "b7f6a61f9d61369904d171cfa8ee9307", "score": "0.5332805", "text": "mapPages(){\n var pagelen = this.pages.length;\n var indexlen = pagelen - (this.maxPage + 1)\n if(this.pages.length > this.maxPage){\n this.pages.splice(this.maxPage,indexlen,\"..\");\n }\n console.log(this.paginate,this.pages);\n }", "title": "" }, { "docid": "4606f377ca93d97b6c9ce9c12d1fa619", "score": "0.53323424", "text": "function paginar(pagina,actual){\n\t\tvar total=$(\"#paginacion\").data(\"total\");\n\t\tvar palabra=$(\"#principal\").data(\"palabra\");\n\t\tvar orden=$(\"#filtro\").val();\n\t\tif($(\"#ubicacion\").data(\"estado\")!=undefined){\n\t\t\tvar estado=$(\"#ubicacion\").data(\"estado\");\n\t\t}else{\n\t\t\tvar estado=\"\";\n\t\t}\n\t\tif($(\"#ubicacion\").data(\"bandera\")!=undefined){\n\t\t\tvar bandera=$(\"#ubicacion\").data(\"bandera\");\n\t\t}else{\n\t\t\tvar bandera=\"\";\n\t\t}\t\t\n\t\tif($(\"#condicion\").data(\"condicion\")!=undefined){\n\t\t\tvar condicion=$(\"#condicion\").data(\"condicion\");\n\t\t}else{\n\t\t\tvar condicion=\"\";\n\t\t}\n\t\tif($(\"#categoria\").data(\"categoria\")!=undefined){\n\t\t\tvar categoria=$(\"#categoria\").data(\"categoria\");\n\t\t}else{\n\t\t\tvar categoria=\"\";\n\t\t}\n\t\tif($(\"#ver_tiendas\").data(\"ver_tiendas\")!=undefined){\n\t\t\tvar ver_tiendas=$(\"#ver_tiendas\").data(\"ver_tiendas\");\n\t\t}else{\n\t\t\tvar ver_tiendas=\"\";\n\t\t}\n\t\tloadingAjax(true);\n\t\t$.ajax({\n\t\t\turl:\"paginas/listado/fcn/f_listado.php\",\n\t\t\tdata:{metodo:\"buscar\",pagina:pagina,total:total,palabra:palabra,categoria:categoria,condicion:condicion,estado:estado,orden:orden,bandera:bandera,ver_tiendas:ver_tiendas},\n\t\t\ttype:\"POST\",\n\t\t\tdataType:\"html\",\n\t\t\tsuccess:function(data){\n\t\t\t\t$(\"#paginacion li\").removeClass(\"active\");\n\t\t\t\t$('#paginacion').find('[data-pagina=' + pagina + ']').parent().addClass(\"active\");\n\t\t\t\t//$('#paginacion data-pagina=2').parent().addClass(\"active\");\n\t\t\t\t$(\"#ajaxContainer\").html(data);\n\t\t\t\t$(\"#inicio\").text(((pagina-1)*25)+1);\n\t\t\t\tif(total<pagina*25){\t\t\n\t\t\t\t\t$(\"#final\").text(total + \" de \");\n\t\t\t\t}else{\n\t\t\t\t\t$(\"#final\").text(pagina*25 + \" de \");\n\t\t\t\t}\n\t\t\t\t$('html,body').animate({\n \t\t\t\tscrollTop: 0\n\t\t\t\t}, 200);\n\t\t\t\tif(pagina % 10 == 1){\n\t\t\t\t\t$(\"#paginacion #anterior1\").addClass(\"hidden\");\n\t\t\t\t}else{\n\t\t\t\t\t$(\"#paginacion #anterior1\").removeClass(\"hidden\");\n\t\t\t\t}\t\t\t\n\t\t\t\t$(\"#principal #paginacion\").data(\"paginaactual\",pagina);\n\t\t\t\tif(pagina*25>=total || pagina % 10==0){\n\t\t\t\t\t$(\"#paginacion #siguiente1\").addClass(\"hidden\");\n\t\t\t\t}else{\n\t\t\t\t\t$(\"#paginacion #siguiente1\").removeClass(\"hidden\");\n\t\t\t\t}\n\t\t\t\tloadingAjax(false);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "0e5d63f3e41f0dd06af8b9af53ddb668", "score": "0.5330609", "text": "function affiche_NM_page(){\n var affiche_on = NMcurrent_stape;\n var affiche_off = new Array('page_information', 'page_fichier', 'page_resume');\n var taille_off = new Number(affiche_off.length);\n \n // on cache tout\n var className = \"actif\";\n if(NMcurrent_stape == 'page_information'){\n NMcurrent_stage = 0;\n }\n else if(NMcurrent_stape == 'page_fichier'){\n NMcurrent_stage = 1;\n }\n else if(NMcurrent_stape == 'page_resume'){\n NMcurrent_stage = 2;\n }\n\n for(i_off=0; i_off<taille_off; i_off++){\n if(i_off >= NMcurrent_stage){\n var className = \"\";\n }\n strContent_PB_page = 'NM_PB_' + affiche_off[i_off] ;\n var id_PB_page = document.getElementById(strContent_PB_page);\n id_PB_page.className = className ;\n }\n \n for(i_off=0; i_off<taille_off; i_off++){\n strContent_page = new String();\n strContent_page = 'NM_' + affiche_off[i_off] ;\n var id_page = document.getElementById(strContent_page);\n if(id_page!=null){\n id_page.className = \"off\";\n }\n }\n // on affiche les éléments de la bonne page\n strContent_PB_page = 'NM_PB_' + affiche_on ;\n var id_PB_page = document.getElementById(strContent_PB_page);\n id_PB_page.className = \"select\";\n \n strContent_page = new String();\n strContent_page = 'NM_' + affiche_on ;\n if(id_page = document.getElementById(strContent_page)){\n id_page.className = \"on\";\n }\n}", "title": "" }, { "docid": "904078989c4e2066aa1a646a2682aa73", "score": "0.53256106", "text": "function paginarBusqueda (pags, limiteLinks, inicioLinks, finPAgs) {\n\n\tif (pags == \"Siguiente\") { // INICIA condicion para mostrar paginado al precionar el lin \"siguiente\"\n\n\t\t\tlimiteLinks = limiteLinks + 5;\n\t\t\tinicioLinks = inicioLinks + 5;\n\n\t\t\t$(\"#paginacion\").empty();\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'<<'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+'Anterior'+'</a>&nbsp;');\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" >'+i+'</a>&nbsp;');\n\t\t\t}\n\n\t\t\tif(limiteLinks < finPAgs){ // condicion pa saber si ya llegue al limite de paginas\n\n\t\t\t\t$(\"#paginacion\").append('&nbsp;<a href=\"#\" class=\"links\" id=\"siguiente\">'+'Siguiente'+'</a>&nbsp;');\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"links\" id=\"ultimo\">'+'>>'+'</a>');\n\t\t\t}\n\n\t\t} // ------------------ TERMINA CONDICION DEL LINK \"SIGUIENTE\" --------------------------------------\n\n\n\t\tif (pags == \"Anterior\") { // INICIA condicion para mostrar paginado al precionar el lin \"anterior\"\n\n\t\t\tlimiteLinks = limiteLinks - 5;\n\t\t\tinicioLinks = inicioLinks - 5;\n\n\t\t\t$(\"#paginacion\").empty();\n\n\t\t\tif(inicioLinks > 1){ //condicion para saber si estoy mostrando el limite inicial de los links\n\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+'<<'+'</a>&nbsp;');\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+'Anterior'+'</a>&nbsp;');\n\t\t\t}\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+i+'</a>&nbsp;');\n\t\t\t}\n\n\t\t\t$(\"#paginacion\").append('&nbsp;<a href=\"#\" class=\"linksBusqueda\" id=\"siguiente\">'+'Siguiente'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" id=\"ultimo\">'+'>>'+'</a>');\n\n\t\t} // --------------------- TERMINA CONDICION DEL LINK \"ANTEIROR\" ---------------------------------\n\n\t\tif(pags == \"&gt;&gt;\"){ // >>\n\t\t\tlimiteLinks = finPAgs;\n\t\t\tinicioLinks = finPAgs - 10;\n\n\t\t\t$(\"#paginacion\").empty();\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+'<<'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+'Anterior'+'</a>&nbsp;');\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+i+'</a>&nbsp;');\n\t\t\t}\n\n\t\t}\n\n\t\tif(pags == \"&lt;&lt;\"){ // <<\n\t\t\tlimiteLinks = 11;\n\t\t\tinicioLinks = 1;\n\n\t\t\t$(\"#paginacion\").empty();\n\n\t\t\tfor (var i = inicioLinks; i < limiteLinks; i++) {\n\t\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" >'+i+'</a>&nbsp;');\n\t\t\t};\n\t\t\t$(\"#paginacion\").append('&nbsp;<a href=\"#\" class=\"linksBusqueda\" id=\"siguiente\">'+'Siguiente'+'</a>&nbsp;');\n\t\t\t$(\"#paginacion\").append('<a href=\"#\" class=\"linksBusqueda\" id=\"ultimo\">'+'>>'+'</a>');\n\t\t}\n\n\t\tvar response = [limiteLinks, inicioLinks];\n\t\treturn response;\n}", "title": "" }, { "docid": "1ae8c93c7fd61423fbea27f96664797c", "score": "0.53162605", "text": "async function pagar() {\n const productosToMp = arrayCanasta.map(Element => {\n let nuevoElemento = {\n category_id: Element.id,\n title: Element.nombre,\n description: Element.descripcion,\n picture_url: Element.imagen,\n unit_price: Number(Element.precio),\n quantity: Number(Element.cantidad),\n currency_id: \"ARS\"\n }\n return nuevoElemento;\n })\n \n const response = await fetch(\n \"https://api.mercadopago.com/checkout/preferences\",\n {\n method: \"POST\",\n headers: {\n Authorization: \n \"Bearer TEST-680675151110839-052307-64069089337ab3707ea2f547622a1b6a-60191006\"\n },\n body: JSON.stringify({\n items: productosToMp,\n })\n }\n );\n \n const data = await response.json();\n window.open(data.init_point, \"_blank\");\n }", "title": "" }, { "docid": "085e646514ef015420d37c909bcd1ad3", "score": "0.53149915", "text": "getPlans() {\n axios.get('/spark/plans')\n .then(response => {\n this.plans = this.billingUser\n ? _.filter(response.data, {type: \"user\"})\n : _.filter(response.data, {type: \"team\"});\n });\n }", "title": "" }, { "docid": "d3e027c2ea509ff40a0192c503bde226", "score": "0.5308011", "text": "function pintarRutaLimitesVelocidad(){\n if(pestanaPrimeraVez){\n $(\"#right-panel3-table3\").empty();\n //pintarPanelPuntosLimitesVelocidad(origen.lat(), origen.lng(), direccionOrigen,\"/static/images/origenCirculo.png\", 0, destino.lat(), destino.lng(), direccionDestino, \"/static/images/destinoCirculo.png\" , 0);\n //pinta punto origen velocidad\n pintarTemplateLimiteVelocidadInicial(origen.lat(), origen.lng(), direccionOrigen,\"/static/images/origenCirculo.png\", \"Punto Origen\", primerLimiteInicial.location.velocidadCarga, primerLimiteInicial.location.velocidadDescarga);\n pintarTemplateLimiteVelocidadFinal(destino.lat(), destino.lng(), direccionDestino,\"/static/images/destinoCirculo.png\", \"Punto Destino\");\n //pinta punto final velocidad\n pestanaPrimeraVez = false;\n }else{\n // pinta la ruta de los limites de velocidad\n borraIconosPosIniFinalMapa3(null);\n borrarMarkersMapaLimitesVelocidad();\n ordenarPuntosLineaLimitesVelocidad();\n pintarPanelListaOrdenadaLimitesVelocidad(false);\n }\n //Borra puntos de control que estan fuera de la ruta\n evaluarLimitesVelocidadEnRuta();\n\n if(polyline3 != null){\n polyline3.setMap(null);\n } \n\n polyline3 = new google.maps.Polyline({\n path: [],\n strokeColor: '#FF0000',\n strokeWeight: 3\n });\n\n var bounds = new google.maps.LatLngBounds();\n var legs = directionsDisplay.getDirections().routes[0].legs;\n for (i=0;i<legs.length;i++) {\n var steps = legs[i].steps;\n for (j=0;j<steps.length;j++) {\n var nextSegment = steps[j].path;\n for (k=0;k<nextSegment.length;k++) {\n polyline3.getPath().push(nextSegment[k]);\n bounds.extend(nextSegment[k]);\n }\n }\n }\n polyline3.setMap(map3);\n makeMarkerRutaLimiteVelocidad( origen, guiImagePuntoControl+\"/static/images/origenPin.png\", \"Origen\" );\n \n makeMarkerRutaLimiteVelocidad( destino, guiImagePuntoControl+\"/static/images/destinoPin.png\", 'Destino' );\n\n}", "title": "" }, { "docid": "a53dcb0e07bdf7851475203454e1f5ea", "score": "0.5306206", "text": "setIndexPage(data){\n console.log('list page',data);\n let idPage = [0];\n data.forEach((res)=>{\n res.page.forEach((page)=>{\n idPage.push(page.id);\n })\n })\n MaxPage = idPage[idPage.length-1];\n MinPage = idPage[0];\n ListPage =idPage;\n CurrentLisPage = data;\n console.log('res list page',idPage);\n console.log('max page', MaxPage);\n console.log('min page', MinPage);\n }", "title": "" }, { "docid": "f6d3366147da0fab79e0b9a14e19ac9f", "score": "0.52893406", "text": "function crearPaginador(total) {\n var i;\n return regeneratorRuntime.wrap(function crearPaginador$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n i = 1;\n\n case 1:\n if (!(i <= total)) {\n _context.next = 7;\n break;\n }\n\n _context.next = 4;\n return i;\n\n case 4:\n i++;\n _context.next = 1;\n break;\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _marked);\n}", "title": "" }, { "docid": "3ca436e9fecba46c2ee1f426c5b9faa8", "score": "0.52874935", "text": "get pagesList() {\n console.log('inside pagesList');\n this.setSize = this.pages.length\n console.log(this.setSize);\n // let mid = Math.floor(this.setSize / 2) + 1;\n // if (this.pageCount > mid) {\n // return this.pages.slice(this.pageCount - mid, this.pageCount + mid - 1);\n // }\n return this.pages.slice(0, this.setSize);\n }", "title": "" }, { "docid": "c352b8f9d2073aac5e0a78c4129e9e26", "score": "0.5269773", "text": "function doPageLinks() {\n var snaps = BD18.snapcount;\n var pages = BD18.pagecount;\n var curpage = BD18.curpage;\n if (pages > 1) {\n var plist = \"<div id='paginator'>\";\n for(var i = 1; i <= pages; i++) { \n if (i === curpage) {\n plist += \"<p><a href='#' class='pagor selected'>Page \";\n plist += i + \"</a></p>\";\n } else {\n plist += \"<p><a href='#' class='pagor'>Page \";\n plist += i + \"</a></p>\";\n }\n }\n plist += \"</div>\";\n $(\"#paginator\").remove();\n $(\"#pagelinks\").append(plist);\n }\n}", "title": "" }, { "docid": "774b719d5b6d4f9740cf3e031cfe94a5", "score": "0.52677506", "text": "getNumPagActual(){\n return this.l_paginaActual;\n }", "title": "" }, { "docid": "3f66487d37cc6b1c1d03fefa0ab73cef", "score": "0.52535295", "text": "function montaPaginas(paginaAtual,total){\n\t$('#pagination').html(\"\");\n\tif(total == 1){\n\t\treturn;\n\t}\n\n\tvar links = 4;\n\tvar inicio = ((paginaAtual - links) > 1 ? (paginaAtual - links) : 1);\n\tvar fim = ((paginaAtual + links) < total ? (paginaAtual + links) : total);\n\n\n\tif(paginaAtual > (links + 2)){\n\t $('#pagination').append(\"<span onclick='pagination(\" + 1 + \");'>\" + 1 + \"</span>\");\n\t $('#pagination').append(\"<span class='no-border'>...</span>\");\n\t}\n\n\tfor(var i = inicio; i <= fim; i++){\n\t if(i == paginaAtual){\n\t\t $('#pagination').append(\"<span class='active'>\" + i + \"</span>\");\n\t }else{\n\t\t $('#pagination').append(\"<span onclick='pagination(\" + i + \");'>\" + i + \"</span>\");\n\t }\n\t}\n\tif(paginaAtual < (total - (links + 2))){\n\t $('#pagination').append(\"<span class='no-border'>...</span>\");\n\t $('#pagination').append(\"<span onclick='pagination(\" + total + \");'>\" + total + \"</span>\");\n\t}\n}", "title": "" }, { "docid": "7fa3b8b4f221115b096ce0c6f59738df", "score": "0.5253484", "text": "function consult_Pager(tableName, itemsPerPage) {\n this.tableName = tableName;\n this.itemsPerPage = itemsPerPage;\n this.currentPage = 1;\n this.pages = 0;\n this.inited = false;\n \n this.showRecords = function(from, to) { \n var rows = document.getElementById(tableName).rows;\n // i starts from 1 to skip table header row\n for (var i = 1; i < rows.length; i++) {\n if (i < from || i > to) \n rows[i].style.display = 'none';\n else\n rows[i].style.display = '';\n }\n }\n \n this.showPage = function(pageNumber) {\n if (! this.inited) {\n // alert(\"not inited\");\n return;\n }\n\n var oldPageAnchor = document.getElementById('pg'+this.currentPage);\n oldPageAnchor.className = 'pg-normal';\n \n this.currentPage = pageNumber;\n var newPageAnchor = document.getElementById('pg'+this.currentPage);\n newPageAnchor.className = 'pg-selected';\n \n var from = (pageNumber - 1) * itemsPerPage + 1;\n var to = from + itemsPerPage - 1;\n this.showRecords(from, to);\n } \n \n this.prev = function() {\n if (this.currentPage > 1)\n this.showPage(this.currentPage - 1);\n }\n \n this.next = function() {\n if (this.currentPage < this.pages) {\n this.showPage(this.currentPage + 1);\n }\n } \n \n this.init = function() {\n var rows = document.getElementById(tableName).rows;\n var records = (rows.length -1); \n this.pages = Math.ceil(records / itemsPerPage);\n this.inited = true;\n }\n\n this.showPageNav = function(pagerName, positionId) {\n if (! this.inited) {\n //alert(\"not inited\");\n return;\n }\n alert(positionId)\n alert(pagerName)\n var element = document.getElementById(positionId); \n var pagerHtml = '<span onclick=\"' + pagerName + '.prev();\" class=\"pg-normal\" \"> <font align=\"bottom\" class=\"jumpbar\"> Page: <i class=\"fa fa-chevron-circle-left\"></i> </font></span> ';\n for (var page = 1; page <= this.pages; page++) \n pagerHtml += '<span id=\"pg' + page + '\" class=\"pg-normal\" onclick=\"' + pagerName + '.showPage(' + page + ');\" \"><font color=\"black\" face=\"verdana\">' + page + '</font></span> ';\n pagerHtml += '<span onclick=\"'+pagerName+'.next();\" class=\"pg-normal\"><font align=\"bottom\" class=\"jumpbar\"><i class=\"fa fa-chevron-circle-right\"></i></font></span>'; \n \n // pagerHtml='<span style=\"margin-right:40vw;>'+pagerHtml+'</span>';\n element.innerHTML =pagerHtml ;\n }\n}", "title": "" }, { "docid": "874b2b28aca33e94d4cdc793ccb84ba8", "score": "0.5252872", "text": "getPageSet(totalPages, pageShowMax, currentPage) {\n\n let pageFrom = 1;\n let pageTo = totalPages;\n let pageSet = [];\n\n if (totalPages > pageShowMax) {\n\n let halfPage = Math.floor(pageShowMax / 2);\n\n if (currentPage > halfPage && currentPage <= (totalPages - halfPage)) {\n pageFrom = currentPage - halfPage;\n pageTo = pageFrom + pageShowMax - 1;\n } else if (currentPage <= halfPage) {\n pageFrom = 1;\n pageTo = pageFrom + pageShowMax - 1;\n } else if (currentPage >= (totalPages - halfPage)) {\n pageTo = totalPages;\n pageFrom = pageTo - pageShowMax + 1;\n }\n }\n\n for (let i = pageFrom; i <= pageTo; i++) {\n pageSet.push(i);\n }\n\n return pageSet;\n }", "title": "" }, { "docid": "7114b3b80063c96a1ef516c329b76301", "score": "0.52520204", "text": "async getSettlementPdf(p_auth, periodo) {\n\n const AUTHORIZATION = `${p_auth.auth.token_type} ${p_auth.auth.access_token}`\n const PATH = `empleado/${p_auth.auth['x-user-name']}`\n\n const result = await fetch(`${BASE_API_URL}${PATH}/liquidacion/descargar/${periodo}`, {\n method: 'GET',\n headers: {\n Authorization: AUTHORIZATION,\n 'Content-Type': CONTENT_TYPE,\n 'x-user-name': p_auth.auth['x-user-name']\n },\n })\n .then(async (query) => await query.json())\n .catch(error => console.log('error', error))\n\n return result\n }", "title": "" }, { "docid": "fab88a58b5cf4ddb4502fede22b6c26a", "score": "0.5248301", "text": "function paginateContractsGroupBy() {\n\t\t////alert(arguments[0]);\n\t\t////alert(arguments[1]);\n\t\t////alert(arguments[2]);\n\t\t////alert(arguments[3]);\n\t\t////alert(arguments[4]);\n\t\t////alert(arguments[5]);\n\t\t////alert(arguments[6]);\n\t\t\n\t\t////alert(document.getElementById(arguments[5]).value);\n var selectObj = document.getElementById(arguments[4]).value;\n\t\t\n\t\t////alert(selectObj);\n var optionsLen = document.getElementById(arguments[4]).length;\n var parameters = new Array();\n parameters[0] = \"sortID\";\n parameters[1] = document.getElementById(arguments[5]).value;\n parameters[2] = \"pageID\";\n\t\t//parameters[3]=arguments[0];\n parameters[4] = \"tableID\";\n parameters[5] = arguments[2];\n parameters[6] = \"contextID\";\n parameters[7] = arguments[3];\n parameters[8] = \"method\";\n parameters[9] = \"paginateContractsGroupBy\";\n parameters[10] = \"mainTableID\";\n parameters[11] = arguments[6];\n if (arguments[0] == \"NEXT\") {\n parameters[3] = parseInt(selectObj) + 1;\n if (parameters[3] > optionsLen) {\n\t\t\t\t//alert(\"In Last Page, no next page available\");\n return;\n }\n document.getElementById(arguments[4]).value = parameters[3];\n }\n if (arguments[0] == \"PREVIOUS\") {\n parameters[3] = parseInt(selectObj) - 1;\n if (parameters[3] == 0) {\n\t\t\t\t//alert(\"Already in First Page\");\n return;\n }\n document.getElementById(arguments[4]).value = parameters[3];\n }\n if (arguments[0] == \"LAST\") {\n parameters[3] = \"LAST\";\n document.getElementById(arguments[4]).value = optionsLen;\n }\n if (arguments[0] == \"FIRST\") {\n parameters[3] = \"FIRST\";\n document.getElementById(arguments[4]).value = 1;\n }\n if (arguments[0] == arguments[4]) {\n parameters[3] = parseInt(selectObj);\n }\n\t\t\n\t\t//var docuForm = document.forms[3]; //Specific reference to form by sequence for NS\n var docuForm = document.getElementById(\"presentlySorted\").form;\n var queryString = new Array();\n queryString = getSelectedCheckBoxes(docuForm);\n\t\t////alert(queryString);\n var parameterLength = parameters.length;\n for (var i = 0; i < queryString.length; i++) {\n parameters[parameterLength + i] = queryString[i];\n }\n XMLHttpRequestSender(\"./performTableActions.do\", parameters, \"true\", \"GET\", \"100000000\", \"3\", arguments[1], parseMessages);\n}", "title": "" }, { "docid": "245c4ad86a37d956b4c48a26ff9559be", "score": "0.524317", "text": "getPagination() {\n const { pagination, path } = this.props;\n const { totalPages } = pagination;\n const buttons = [];\n for (let i = 1; i <= totalPages; i += 1) {\n buttons.push(<NavLink to={`${path}/${i}`} key={`page ${i}`}>{i}</NavLink>);\n }\n return buttons;\n }", "title": "" }, { "docid": "983a894751a1a085713d1c7542405242", "score": "0.52388847", "text": "function Padetis ( eil_padeties ) { \t\t\t\t\t\t\t\t\t\t\t\t\t// i funkcija paduodama koordinate pvz a2\r\n\t\t\r\n\t\tthis.horiz = eil_padeties.slice ( 0, 1 );\t\t\t\t\t\t\t\t\t\t\t// kintamajam horiz priskiriama raidine reiksme\r\n\r\n\t\tthis.vert = parseInt ( eil_padeties.slice ( 1, 2 ) );\t\t\t\t\t\t\t\t\t// kintamajam vert priskiriama skaitine reiksme\r\n\t\r\n\t\tthis.pridetiPokyti = function ( pokytis_padeties ) {\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tnr_horiz = padeties_galimos_raides.indexOf ( this.horiz ) + pokytis_padeties.horiz ;\t\t// pradinis horizontalios asies indekso nr + pokytis\t\tpvz. a=0, b=1 \tpestininko atveju butu a+0, b+0 , nes jis juda vertikalioje asyje\r\n\t\t\t \r\n\t\t\tnr_nauj_vert = this.vert + pokytis_padeties.vert;\t\t\t\t\t\t\t\t// pradine vertikalios asies verte + pokytis \t\t\tpvz. a=0, b=1 \tpestininko atveju butu a+1 arba a+2, b+1 arba b+2 , nes jis juda vertikalioje asyje\r\n\t\t\t\r\n\t\t\tif ( between ( nr_nauj_vert, 0, 9 ) && between ( nr_horiz, -1, 8 ) ) { \t\t\t\t\t// neišėjo už lentos ribų\r\n\t\t\t\r\n\t\t\t\treturn new Padetis ( padeties_galimos_raides [ nr_horiz ] + nr_nauj_vert ); \t\t// jei neiseina uz ribu grazina koordinate, kuri yra lentoje\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\t\r\n\t\tthis.koordinate = function() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// sujungia horizontalę ir vertikalę į vieną koordinatę \r\n\t\t\t\r\n\t\t\treturn this.horiz + this.vert;\r\n\t\t}\r\n\t\t\r\n\t\tthis.yraTuscia = function() {\r\n\t\t\t\r\n\t\t\treturn ( document.getElementById ( this.koordinate() ).innerHTML.trim() == \"\" );\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "bedc4093dc19a1e119042570298ceb7e", "score": "0.52345324", "text": "function construct_footer()\n{\n\tMAX_page = parseInt((data.length-1)/NBL_page); // On calcul le Nombre Maximum de Page\n\tX=MAX_page*NBL_page; //\n\tif (X<data.length-1) MAX_page++; // On ajoute une page dans le cas du reste\n\t \n\t$(\"#pagine\").remove();\n\tif (MAX_page<=1) return; // dans le cas d'une seul page on n'affiche pas les btns\n\t \n\n\tvar pagin_prem = '<li><input type=\"button\" value=\"&laquo;&laquo;\" OnClick=\"data_page(1)\"/></li>';\n\tvar pagine_prec = '<li><input type=\"button\" value=\"&laquo;\" OnClick=\"Page_Prec()\"/><li>';\n\tvar pagine_suiv = '<li><input type=\"button\" value=\"&raquo;\" OnClick=\"Page_Suiv()\"/></li>';\n\tvar pagine_der = '<li><input type=\"button\" value=\"&raquo;&raquo;\" OnClick=\"data_page(' + MAX_page + ')\"/></li>';\n\t\n\t$(\"#section_bas\").append('<ul id=\"pagine\" class=\"pagination pagination-sm no-margin\"></ul>'); \n\t$(\"#pagine\").append('<li id=\"lignes\" class=\"disabled\"><span>'+(data.length-1)+' lignes</span></li>'); \n\t$(\"#pagine\").append(pagin_prem + pagine_prec);\n\t\n\tfor(var i=1; i<=MAX_page; i++) {\n\t $(\"#pagine\").append('<li><input type=\"button\" value=\"'+i+'\" OnClick=\"data_page('+i+')\"/></li>');\n\t}\n\t \n\t$(\"#pagine\").append(pagine_suiv + pagine_der);\n}", "title": "" }, { "docid": "8747b1ca96e9783c17694e03c1ea84c3", "score": "0.52286667", "text": "dibuja(){\n\n if( (this.getNodoPadreElementosPaginados() && this.getNodoPadrePaginador() && this.getArrayTramo() && this.getPosicionEnNodoPadreElementosPaginados() && this.getPlantillaPaginadorHTML() && this.getPosicionEnNodoPadrePaginador()) != null){\n\n // vacia el espacio donde van los productos\n _removeChildElementsInDom(this.getNodoPadreElementosPaginados());\n // vacia el espacio donde se encuentra el paginador\n _removeChildElementsInDom(this.getNodoPadrePaginador());\n\n // anyade los elementos a la pagina de elementos\n for(let l_item of this.getArrayTramo()){\n if(l_item != null){\n _addElementInDom(this.getNodoPadreElementosPaginados(),_plantillaElementProdConsulta(l_item),this.getPosicionEnNodoPadreElementosPaginados());\n }\n }\n\n // anyade los numeros de paginas al paginador\n _addElementInDom(this.getNodoPadrePaginador(),this.getPlantillaPaginadorHTML(),this.getPosicionEnNodoPadrePaginador());\n }\n }", "title": "" }, { "docid": "cd38e91af883d94ca1af590d562e0834", "score": "0.5227199", "text": "function total_pagar(mes,tasa,plazo,total) {\r\n\t\tvar contado = total / (1 + ((tasa * plazo) / 100)); \r\n\t\tvar tp = contado * (1 + (tasa * mes) / 100);\r\n\t\treturn tp.toFixed(2);\r\n\t}", "title": "" }, { "docid": "c6125eccf9c2dd8234aaeaea8f822ec8", "score": "0.5224917", "text": "function existePlan(num, tipo) {\n\tfor (var i = 0; i < arrPlanes.length; i++) {\n\t\tif ((arrPlanes[i].id === num) && (arrPlanes[i].maxMembers === tipo)) return true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "33d113b0c8dcd8e029cfd88e7839eafb", "score": "0.520745", "text": "function getpagedPagedPayroles() {\n //console.log('Trigger get');\n $scope.busyloading = true;\n var par = '', f = createFilterObj(), extdata = { page: $scope.currentPage, pageSize: $scope.resfilter.pageSize, filters: JSON.stringify(f), };\n //console.log(extdata);\n $scope.RestPromice.getPagedFiltered(par, extdata).then(function (res) {\n //console.log('Return of getpaged promise');\n if (res != -1) { handlePagesVars(res); } else { $scope.payroles = []; }\n }).catch().finally(function () { $scope.busyloading = false; })\n }", "title": "" }, { "docid": "60b4a6e649d906ad1b188c686a014b2f", "score": "0.5200113", "text": "function renderAdminTable(obj,type,limit,_query){\n router.get('/'+type+'/', function (req,res,next) {\n var page=req.query.page||1;\n var count=0;\n\n obj.count().then(function(_count){\n count=_count;\n var pages=Math.ceil(count/limit);\n page=Math.min(page,pages);\n page=Math.max(page,1);\n\n var skip=(page-1)*limit;\n\n if(type=='about_site'){\n var newObj = _query ? obj.find({\"$or\":[{\"title\":\"about_site\"},{\"title\":\"site_theory\"},{\"title\":\"rate\"}]}).sort({_id: -1}).limit(limit).skip(skip).populate(_query) : obj.find({\"$or\":[{\"title\":\"about_site\"},{\"title\":\"site_theory\"},{\"title\":\"rate\"}]}).sort({_id: -1}).limit(limit).skip(skip);\n }else if(type=='user_agreement'){\n var newObj = _query ? obj.find({\"$or\":[{\"title\":\"regulation\"},{\"title\":\"protect\"},{\"title\":\"term\"}]}).sort({_id: -1}).limit(limit).skip(skip).populate(_query) : obj.find({\"$or\":[{\"title\":\"regulation\"},{\"title\":\"protect\"},{\"title\":\"term\"}]}).sort({_id: -1}).limit(limit).skip(skip);\n }else if(type=='faq'){\n var newObj = _query ? obj.find({\"$or\":[{\"title\":\"guide\"},{\"title\":\"investor\"},{\"title\":\"recharge\"}]}).sort({_id: -1}).limit(limit).skip(skip).populate(_query) : obj.find({\"$or\":[{\"title\":\"guide\"},{\"title\":\"investor\"},{\"title\":\"recharge\"}]}).sort({_id: -1}).limit(limit).skip(skip);\n }else if (type=='product_category_list'){\n var newObj = _query ? obj.find({'sort': 'product'}).sort({_id: -1}).limit(limit).skip(skip).populate(_query) : obj.find({'sort': 'product'}).sort({_id: -1}).limit(limit).skip(skip);\n }else if (type=='news_category_list'){\n var newObj = _query ? obj.find({'sort': 'news'}).sort({_id: -1}).limit(limit).skip(skip).populate(_query) : obj.find({'sort': 'news'}).sort({_id: -1}).limit(limit).skip(skip);\n }else {\n var newObj = _query ? obj.find().sort({_id: -1}).limit(limit).skip(skip).populate(_query) : obj.find().sort({_id: -1}).limit(limit).skip(skip);\n }\n\n newObj.then(function(data){\n //console.log(data);\n res.render('main/'+type,{\n type:type,\n userInfo:req.session.user,\n data:data,\n page:page,\n pages:pages,\n limit:limit,\n count:count\n });\n });\n });\n });\n}", "title": "" }, { "docid": "509146458db7c64434adc4ff2fa7739c", "score": "0.5191652", "text": "function PopupSeguimientoPlan () {\n\n this.$id = $('#id_tarjeta_seguimiento_plan')\n this.$id_resultado_seguimiento = $('#id_resultado_seguimiento')\n this.$id_fecha_seguimiento = $('#id_fecha_seguimiento_group')\n this.$id_archivo = $('#id_archivo_seguimiento_plan')\n this.$boton_guardar = $('#id_boton_guardar_seguimiento')\n this.$id_boton_nuevo = $('#id_boton_nuevo_seguimiento')\n this.$id_mensaje_error = $('#id_mensaje_error_serguimiento')\n this.$accion\n this.$id_contenedor = $('#id_contenedor_seguimientos')\n this.$pk_seguimiento // usado en el manejo de archivos\n this.$pk_actividad // Used for filter seguimientos\n this.init_Components()\n this.init_Events()\n // this.load_Data()\n}", "title": "" }, { "docid": "36594ecc4ea50484db42863a325c93f8", "score": "0.51759434", "text": "getPlans() {\n axios.get('/spark/plans')\n .then(response => {\n this.plans = response.data;\n });\n }", "title": "" }, { "docid": "f7d24e89782567dfb223a7cb41ee2aeb", "score": "0.51694685", "text": "function generatePaginagtion() {\n // console.log('pages.length', pages.length);\n if (pages.length <= 1) {\n const wikiPaginationSection = document.getElementById('wiki-pagination-section');\n if (wikiPaginationSection) {\n wikiPaginationSection.style.display = 'none';\n }\n } else {\n const list = wikiPagination.querySelector('.elementor-icon-list-items');\n const firstItem = list.querySelector('.elementor-icon-list-item');\n const currentPage = getPageIndex();\n \n for (let i = 1; i < pages.length; i++) {\n const page = i + 1;\n const item = firstItem.cloneNode(true);\n const itemLink = item.querySelector('a');\n const itemText = item.querySelector('.elementor-icon-list-text')\n \n // itemLink.href = `${itemLink.href}${page}/`;\n itemLink.href = `?pageindex=${page}`;\n itemText.textContent = page;\n\n list.appendChild(item);\n\n if (i === currentPage) {\n itemText.classList.add('current');\n }\n }\n\n if (currentPage === 0) {\n firstItem.querySelector('.elementor-icon-list-text').classList.add('current');\n }\n }\n }", "title": "" }, { "docid": "4e508a1494291d8d495bc1b85e6465b3", "score": "0.51672107", "text": "function pagfun() {\n if ($scope.currentPage != $scope.paging.current) {\n $scope.currentPage = $scope.paging.current;\n getpagedstaff();\n }\n }", "title": "" }, { "docid": "93e1b759b31c4a1adc581b8c9ea76772", "score": "0.5164858", "text": "getPlantillaPaginadorHTML(){\n return this.l_plantillaPaginadorHTML;\n }", "title": "" }, { "docid": "280a64f01c60724bdcb6d51c5d8d0e3a", "score": "0.51642853", "text": "getComparePlansObjectDetails(noOfPlans, planType) {\n logger.log(\"***** noOfPlans \" + noOfPlans);\n logger.log(\"***** planType \" + planType);\n let plansObj_arr = [];\n for (let i = 0; i < noOfPlans; i++) {\n let company = eval(commonLoc.compare.img_comparePlan).getAttribute('alt').substring(0, 21);\n let companyTier = \"\";\n if (planType == constants.HEALTHPLAN)\n companyTier = eval(healthPageLoc.compare.compareTier).getText().replace('HSA','');\n else\n companyTier = eval(dentalPageLoc.compare.compareTier).getText();\n let premiumAmt = eval(commonLoc.compare.comparePremiumAmt).getText();\n plansObj_arr.push({ company, companyTier, premiumAmt });\n }\n logger.log(JSON.stringify(plansObj_arr));\n return plansObj_arr;\n }", "title": "" }, { "docid": "211d17011a0de57ce15322f9b15255f9", "score": "0.5152091", "text": "function getPortals() {\r\n $scope.evilPortal.throbber = true;\r\n $api.request({\r\n module: \"EvilPortal\",\r\n action: \"listAvailablePortals\"\r\n }, function(response) {\r\n if (!response.success) {\r\n $scope.sendMessage(\"Error Listing Portals\", \"An error occurred while trying to get list of portals.\");\r\n return;\r\n }\r\n $scope.portals = [];\r\n response.portals.forEach(function(item, index) {\r\n $scope.portals.unshift({\r\n title: item.title,\r\n size: item.size,\r\n storage: item.storage,\r\n active: item.active,\r\n type: item.portalType,\r\n fullPath: item.location\r\n });\r\n });\r\n });\r\n }", "title": "" }, { "docid": "37e3d213789d1ca9ab95a1fb48b71c40", "score": "0.5150749", "text": "function cargarPaginacion() {\n $('#menuAdd').pageMe({ pagerSelector: '#myPager', showPrevNext: true, hidePageNumbers: false, perPage: 3 });\n}", "title": "" }, { "docid": "82a9add45d4ff2c4eb7a72040c77b4f0", "score": "0.51492333", "text": "static get pageSize() {\n return 10;\n }", "title": "" }, { "docid": "80a37d3dcd92ba7ef2eb12a0d38b8407", "score": "0.5139321", "text": "function calculaPlano()\n {\n if ($('select[name=\"plano\"]').val() == 1) {\n if ($('select[name=\"periodo_ativacao\"]').val() == 1) {\n $('#mensalidade').val(Real(String('45,90')));\n $('#mensalidade').html('45,90');\n $('#vlrtotal').html('R$ 137,70');\n } else if ($('select[name=\"periodo_ativacao\"]').val() == 2) {\n $('#mensalidade').val(Real(String('42,90')));\n $('#mensalidade').html('42,90');\n $('#vlrtotal').html('R$ 257,40 (Desconto de R$ 18,00)');\n } else if ($('select[name=\"periodo_ativacao\"]').val() == 3) {\n $('#mensalidade').val(Real(String('39,90')));\n $('#mensalidade').html('39,90');\n $('#vlrtotal').html('R$ 478,80 (Desconto de R$ 72,00)');\n }\n } else if ($('select[name=\"plano\"]').val() == 2) {\n if ($('select[name=\"periodo_ativacao\"]').val() == 1) {\n $('#mensalidade').val(Real(String('75,90')));\n $('#mensalidade').html('75,90');\n $('#vlrtotal').html('R$ 227,70');\n } else if ($('select[name=\"periodo_ativacao\"]').val() == 2) {\n $('#mensalidade').val(Real(String('72,90')));\n $('#mensalidade').html('72,90');\n $('#vlrtotal').html('R$ 437,40 (Desconto de R$ 18,00)');\n } else if ($('select[name=\"periodo_ativacao\"]').val() == 3) {\n $('#mensalidade').val(Real(String('69,90')));\n $('#mensalidade').html('69,90');\n $('#vlrtotal').html('R$ 838,80 (Desconto de R$ 72,00)');\n }\n } else if ($('select[name=\"plano\"]').val() == 3) {\n if ($('select[name=\"periodo_ativacao\"]').val() == 1) {\n $('#mensalidade').val(Real(String('124,90')));\n $('#mensalidade').html('124,90');\n $('#vlrtotal').html('R$ 374,70');\n } else if ($('select[name=\"periodo_ativacao\"]').val() == 2) {\n $('#mensalidade').val(Real(String('122,90')));\n $('#mensalidade').html('122,90');\n $('#vlrtotal').html('R$ 737,40 (Desconto de R$ 12,00)');\n } else if ($('select[name=\"periodo_ativacao\"]').val() == 3) {\n $('#mensalidade').val(Real(String('119,90')));\n $('#mensalidade').html('119,90');\n $('#vlrtotal').html('R$ 1.438,80 (Desconto de R$ 60,00)');\n }\n }\n }", "title": "" }, { "docid": "9aa2c5b0b07f342066d2533c2446a323", "score": "0.5137457", "text": "function planilllaPrincipalTitular(est_p){\r\n var tabla,tabla2;\r\n if(est_p==1){\r\n tabla = '#dataTable1';\r\n tabla2 = '#dataTable2';\r\n }\r\n else\r\n if(est_p==2){//si el partido está enn juego\r\n tabla = '#dataTableA';\r\n tabla2 = '#dataTableB';\r\n\r\n //tabla de cambios\r\n ///lado izq Cambios\r\n $('#dataTableCA').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n ///lado der Cambios\r\n $('#dataTableCB').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n miHecho();\r\n hechosTotales();\r\n }\r\n else\r\n if(est_p==3){//si el partido está en pausa\r\n tabla = '#dataTableA';\r\n tabla2 = '#dataTableB';\r\n\r\n //tabla de cambios\r\n ///lado izq Cambios\r\n $('#dataTableCA').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n ///lado der Cambios\r\n $('#dataTableCB').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n miHecho();\r\n hechosTotales();\r\n }\r\n\r\n else{//si el partido finalizó\r\n tabla = '#dataTableA';\r\n tabla2 = '#dataTableB';\r\n\r\n //tabla de cambios\r\n ///lado izq Cambios\r\n $('#dataTableCA').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n ///lado der Cambios\r\n $('#dataTableCB').DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n searching:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:2,est1:2,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n miHecho();\r\n hechosTotales();\r\n }\r\n\r\n $(tabla).DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaA/'+id_T,\r\n data:{idp:idp,est:1,est1:3,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n $(tabla2).DataTable({\r\n destroy: true,\r\n paging:false,\r\n lengthChange:false,\r\n ordering:false,\r\n info:false,\r\n \"ajax\":{\r\n url:base_url+'Inicio/getTablaB/'+id_T,\r\n data:{idp:idp,est:1,est1:3,est_p:est_p},\r\n type:\"GET\"\r\n },\r\n });\r\n //\r\n\r\n}", "title": "" }, { "docid": "5a37cfd3e92f4a9e560b0ee6e7ebf910", "score": "0.5132309", "text": "propiedades() {\n /** @type {Propiedad} */\n let p = this.PTR_Propiedad;\n\n if (p == null) {\n console.log(\"Este jugador no tiene propiedades.\");\n\n } else {\n console.log(\"La propiedades: \");\n\n while (p != null) {\n console.log(p.nombre, p.renta);\n p = p.linkPropiedad;\n }\n }\n }", "title": "" }, { "docid": "1e0caf46a9dac5e1bbd05a274ba40ea3", "score": "0.51316065", "text": "function lignePaginate(){\n var _lignePaginate = {};\n\n _lignePaginate.init = function(el, options = {numberPerPage: 10,goBar:false,pageCounter:true},filter = [{el: null}]\n ){\n setTableEl(el);\n initTable(_lignePaginate.getEl());\n checkIsTableNull();\n setOptions(options);\n setConstNumberPerPage(options.numberPerPage);\n setFilterOptions(filter);\n launchPaginate();\n }\n /**\n * Config\n **/\n var settings = {\n el:null,\n table:null,\n numberPerPage:10,\n constNumberPerPage:10,\n numberOfPages:0,\n goBar:false,\n pageCounter:true,\n hasPagination:true,\n };\n\n var filterSettings = {\n el:null,\n filterBox:null,\n trs:null,\n }\n\n /**\n * Setters private\n **/\n\n var setConstNumberPerPage = function(number){\n settings.constNumberPerPage = number;\n }\n var setNumberPerPage = function(number){\n settings.numberPerPage = number;\n }\n\n var initTable = function(el){\n if(el.indexOf('#') > -1 ){\n settings.table = document.getElementById(el.replace('#','').trim());\n }else if(el.indexOf('.') > -1 ){\n settings.table = document.querySelector(el);\n }\n }\n\n var iniFilter = function(el){\n if(el.indexOf('#') > -1 ){\n filterSettings.filterBox = document.getElementById(el.replace('#','').trim());\n }else if(el.indexOf('.') > -1 ){\n filterSettings.filterBox = document.querySelector(el);\n }\n }\n\n var setTableEl = function(el){\n settings.el = el;\n }\n\n var setFilterOptions = function (filterOptions) {\n if(filterOptions.el != null){\n setFilterEl(filterOptions.el);\n iniFilter(filterSettings.el);\n checkIsFilterBoxNull();\n setFunctionInFilterBox();\n }\n }\n\n var setFilterEl = function(el){\n filterSettings.el = el;\n }\n\n var setFunctionInFilterBox = function(){\n filterSettings.filterBox.setAttribute('onkeyup','paginate.filter()')\n }\n\n var setGoBar = function(value){\n settings.goBar = value;\n }\n\n var setPageCounter = function(value){\n settings.pageCounter = value;\n }\n\n /**\n * Getters public\n **/\n\n\n _lignePaginate.getEl = function(){\n return settings.el;\n }\n _lignePaginate.getTable = function(){\n return settings.table;\n }\n _lignePaginate.getNumberPerPage = function(){\n return settings.numberPerPage;\n }\n\n _lignePaginate.getConstNumberPerPage = function(){\n return settings.constNumberPerPage;\n }\n\n /**\n * Private Methods\n **/\n\n var table,tr = [],pageCount,numberPerPage,th;\n\n var setOptions = function(options){\n if(options.numberPerPage != settings.numberPerPage){\n setNumberPerPage(options.numberPerPage);\n }\n\n if(typeof options.goBar === 'boolean')\n setGoBar(options.goBar);\n\n if(typeof options.pageCounter === 'boolean')\n setPageCounter(options.pageCounter);\n }\n\n var checkIsTableNull = function(){\n if(settings.table == null){\n throw new Error('Element ' + _lignePaginate.getEl() + ' no exits');\n }\n }\n\n var checkIsFilterBoxNull = function(){\n if(filterSettings.filterBox == null){\n throw new Error('Element ' + _lignePaginate.getEl() + ' no exits');\n }\n }\n\n var paginateAlreadyExists = function() {\n let paginate = document.querySelector('div.paginate');\n if(paginate != null)\n removePaginate(paginate);\n }\n\n var removePaginate = function(element){\n element.parentNode.removeChild(element);\n }\n\n var hiddenPaginateControls = function(){\n document.querySelector('.paginate_controls').style.visibility = 'hidden';\n }\n\n var showPaginatecontrols = function(){\n document.querySelector('.paginate_controls').style.visibility = 'unset';\n }\n\n var pageButtons = function(numberOfPage,currentPage) {\n \n let\tprevDisabled = (currentPage == 1)?\"disabled\":\"\";\n let nextDisabled = (currentPage == numberOfPage)?\"disabled\":\"\";\n\n \n let buttons = \"<input type='button' value='← prev' class='paginate_control_prev' onclick='paginate.sort(\"+(currentPage - 1)+\")' \"+prevDisabled+\">\";\n let buttonNumberOfPage = \"<input type='button' value='\" + currentPage + ' - ' + numberOfPage + \"' disabled>\";\n\n for (let $i=1; $i<=numberOfPage;$i++){\n if(numberOfPage > 10){\n buttons += paginationMoreThatTenPage($i,numberOfPage);\n }else{\n buttons += \"<input type='button' id='id\"+$i+\"'value='\"+$i+\"' onclick='paginate.sort(\"+$i+\")'>\";\n }\n }\n\n let nextButton = \"<input type='button' value='next →' class='paginate_control_next' onclick='paginate.sort(\"+(currentPage + 1)+\")' \"+nextDisabled+\">\";\n buttons += nextButton;\n\n if(settings.pageCounter)\n buttons += buttonNumberOfPage;\n\n if(settings.goBar)\n buttons += addGoToPage();\n\n return buttons;\n }\n \n var paginationMoreThatTenPage = function(iterator,numberOfPage){\n\n let referenceForTheLast = numberOfPage - 1;\n let middleValue = '...';\n\n if(iterator > referenceForTheLast || iterator < 5){\n return \"<input type='button' id='id\"+iterator+\"'value='\"+iterator+\"' onclick='paginate.sort(\"+iterator+\")'>\";\n }else if((iterator + 1) == numberOfPage) {\n return middleValue + \"<input type='button' id='id\"+iterator+\"'value='\"+iterator+\"' style='display: none' onclick='paginate.sort(\"+iterator+\")'>\";\n }else {\n return \"<input type='button' id='id\"+iterator+\"'value='\"+iterator+\"' style='display: none' onclick='paginate.sort(\"+iterator+\")'>\";\n }\n }\n\n var addGoToPage = function(){\n let inputBox = \"<input type='number' id='paginate_page_to_go' value='1' min='1' max='\"+ settings.numberOfPages +\"'>\";\n let goButton = \"<input type='button' id='paginate-go-button' value='Go' onclick='paginate.goToPage()'> \";\n return inputBox + goButton;\n }\n\n /**\n * Public Methods\n **/\n\n _lignePaginate.goToPage = function(){\n let page = document.getElementById(\"paginate_page_to_go\").value;\n _lignePaginate.sort(page);\n }\n\n var launchPaginate = function(){\n paginateAlreadyExists();\n table = settings.table;\n numberPerPage = settings.numberPerPage;\n let rowCount = table.rows.length;\n\n let firstRow = table.rows[0].firstElementChild.tagName;\n\n let hasHead = (firstRow === \"TH\");\n\n let $i,$ii,$j = (hasHead)?1:0;\n \n th = (hasHead?table.rows[(0)].outerHTML:\"\");\n pageCount = Math.ceil(rowCount / numberPerPage);\n settings.numberOfPages = pageCount;\n\n if (pageCount > 1) {\n settings.hasPagination = true;\n for ($i = $j,$ii = 0; $i < rowCount; $i++, $ii++)\n tr[$ii] = table.rows[$i].outerHTML;\n table.insertAdjacentHTML(\"afterend\",\"<div id='buttons' class='paginate paginate_controls'></div\");\n _lignePaginate.sort(1);\n }else{\n settings.hasPagination = false;\n }\n };\n\n _lignePaginate.sort = function(selectedPageNumber) {\n \n let rows = th,startPoint = ((settings.numberPerPage * selectedPageNumber)-settings.numberPerPage);\n for (let $i = startPoint; $i < (startPoint+settings.numberPerPage) && $i < tr.length; $i++)\n rows += tr[$i];\n\n table.innerHTML = rows;\n document.getElementById(\"buttons\").innerHTML = pageButtons(pageCount,selectedPageNumber);\n document.getElementById(\"id\"+selectedPageNumber).classList.add('active');\n \n document.getElementById(\"id\"+selectedPageNumber).style.display = 'unset';\n }\n\n \n _lignePaginate.filter = function() {\n if(settings.hasPagination){\n setNumberPerPage(9999);\n _lignePaginate.sort(1);\n hiddenPaginateControls();\n }\n const filter = document.querySelector(filterSettings.el).value.toUpperCase();\n const trs = document.querySelectorAll( settings.el + ' tr:not(.header)');\n trs.forEach(tr => tr.style.display = [...tr.children].find(td => td.innerHTML.toUpperCase().includes(filter)) ? '' : 'none');\n\n if(filter.length == 0 && settings.hasPagination){\n setNumberPerPage(_lignePaginate.getConstNumberPerPage());\n _lignePaginate.sort(1);\n showPaginatecontrols();\n }\n\n }\n\n return _lignePaginate;\n }", "title": "" }, { "docid": "7e4a259d550d4412607260fc226691d2", "score": "0.512889", "text": "function ev_carregaPaginaAjuda() {\n/*------------------------------*/\nconsole.log(\"e365.js> *** Executando ev_carregaPaginaAjuda() ***\");\n\n /*-- Get do Navbar Top --*/\n pe_getaNavbarTop( \"Ajuda\" , \"page\" );\n\n /*-- Get do Corpo da Pagina --*/\n pe_getaHtmlPagina( \"\" , \"ajuda\" ); \n\n /*-- Get do Navbar Bottom --*/\n pe_getaNavbarBottom( \"home\" );\n\n}", "title": "" }, { "docid": "8d962855951b7377073d32fe0e9aaf04", "score": "0.5122108", "text": "function pintarCaminos(){\n// Creo la cadena que se imprimira en la interfaz y en el documento descargable\n\tcsv_caminos = \"\";\n\tvar html_caminos= \"\";\n\t\n\tvar n =0;\n\tvar costoT;\n\t[].forEach.call(nodos,function (nodo){\n\t\tn=0;\n\t\tif(nodo.nombre != origen){\n\t\t\tif(n == 0){n=1;costoT= nodo.etiqueta.costo;}\n\t\t\tif(csv_caminos != ''){csv_caminos += '\\n';html_caminos += '<br>'}\n\n\t\t\tcsv_caminos += nodo.nombre;\n\t\t\thtml_caminos+= nodo.nombre;\n\n\t\t\tvar antesesor = nodo.nombre;\n\t\t\tdo{\n\t\t\t\tantesesor = getanterior(antesesor);\n\t\t\t\tif(antesesor != ''){\n\t\t\t\t\tcsv_caminos += ','+antesesor;\n\t\t\t\t\thtml_caminos += ','+antesesor;\n\t\t\t\t}\n\t\t\t}while(antesesor != '')\n\t\t\thtml_caminos += ' --Costo Total a este nodo : '+costoT; \n\t\t\tcsv_caminos += ', --Costo Total a este nodo : '+costoT; \n\t\t\t// lo comparo con vacio ya que el inicio se crea con vacio\n\t\t}\n\t});\n\tpintarCaminoHTML(html_caminos);\n}", "title": "" }, { "docid": "4adf083001a0ae0dd87b8bdb23bd6cbc", "score": "0.5115065", "text": "function ev_carregaPaginaContato() {\n/*--------------------------------*/\nconsole.log(\"e365.js> *** Executando ev_carregaPaginaContato() ***\");\n\n /*-- Get do Navbar Top --*/\n pe_getaNavbarTop( \"Contato\" , \"page\" );\n\n /*-- Get do Corpo da Pagina --*/\n pe_getaHtmlPagina( \"../../\" , \"contato\" ); \n\n /*-- Get do Navbar Bottom --*/\n pe_getaNavbarBottom( \"home\" );\n\n}", "title": "" }, { "docid": "674a7bcaeedbb3531b8a2af46c99198f", "score": "0.51128817", "text": "function clickBtnPager() {\n // remet à jour les données de state en demandant la page\n // identifiée dans l'attribut data-page\n // noter ici le 'this' QUI FAIT AUTOMATIQUEMENT REFERENCE\n // A L'ELEMENT AUQUEL ON ATTACHE CE HANDLER\n getQuizzes(this.dataset.page);\n }", "title": "" }, { "docid": "674a7bcaeedbb3531b8a2af46c99198f", "score": "0.51128817", "text": "function clickBtnPager() {\n // remet à jour les données de state en demandant la page\n // identifiée dans l'attribut data-page\n // noter ici le 'this' QUI FAIT AUTOMATIQUEMENT REFERENCE\n // A L'ELEMENT AUQUEL ON ATTACHE CE HANDLER\n getQuizzes(this.dataset.page);\n }", "title": "" }, { "docid": "dd47c764ed7b5b06e9cf4310a07c31ba", "score": "0.5100376", "text": "function traerDatosPlanta(Page){\n\n let filtros = document.getElementsByName(\"FPla\");\n\n\n let data = \"\";\n\n //Orden de datos\n var Orden = obtenerOrden();\n data += \"&Orden=\"+Orden;\n\n\n // Ve que pagina es y trae los datos correspondientes a tal\n let Des = obtenerPagina(Page);\n data += \"&D=\"+Des;\n\n // Temporada de operacion\n var Temporada = document.getElementById(\"selectTemporada\").value;\n data += \"&Temporada=\"+Temporada;\n\n\n for (let i = 0; i < filtros.length; i++){\n let value = filtros[i].value.trim();\n\n \n data += \"&campo\"+[i]+\"=\"+value;\n }\n\n return new Promise(function(resolve, reject) {\n\n $.ajax({\n data:'action=traerDatosPlanta'+data,\n url: urlDes,\n type:'POST',\n dataType:'JSON'\n }).done(function(resp){\n var Contenido = \"\";\n\n if(resp != null && resp.length != 0){\n \n $.each(resp,function(i,item){\n Contenido += \"<tr>\";\n Contenido += \"<td>\"+(parseInt(Des)+i+1)+\"</td>\";\n Contenido += \"<td \"+minText(item.nombre_especie)+\"</td>\";\n Contenido += \"<td \"+minText(item.nombre_cliente)+\"</td>\";\n Contenido += \"<td \"+minText(item.nombre_material)+\"</td>\";\n Contenido += \"<td \"+minText(item.num_anexo)+\"</td>\";\n Contenido += \"<td \"+minText(item.lote_cliente)+\"</td>\";\n Contenido += \"<td \"+minText(item.nombre_agricultor)+\"</td>\";\n Contenido += \"<td \"+minText(separador(item.hectareas))+\"</td>\";\n Contenido += \"<td \"+minText(item.fin_lote)+\"</td>\";\n Contenido += \"<td \"+minText(separador(item.kgs_recepcionado))+\"</td>\";\n Contenido += \"<td \"+minText(separador(item.kgs_limpios))+\"</td>\";\n Contenido += \"<td \"+minText(separador(item.kgs_exportados))+\"</td>\";\n Contenido += \"</tr>\";\n\n });\n\n }else{\n Contenido = \"<tr> <td colspan='13' style='text-align:center'> No existe resultado para la planta </td> </tr>\";\n\n }\n\n document.getElementById(\"datosPlanta\").innerHTML = Contenido;\n\n resolve();\n\n }).fail(function( jqXHR, textStatus, responseText) {\n Contenido = \"<tr> <td colspan='13' style='text-align:center'> Ups.. Intentamos conectarnos con el sistema, pero no hemos podido. </td> </tr>\";\n \n document.getElementById(\"datosPlanta\").innerHTML = Contenido;\n\n reject(textStatus+\" => \"+responseText);\n\n });\n\n });\n\n }", "title": "" }, { "docid": "5bb60151820a176eeef86edc1fb1235d", "score": "0.5097556", "text": "function planClustersRoutes() {\r\n\tlog(\"plan all button clicked\");\r\n\tspinner.show();\r\n\tonHorizonChanged();\r\n\tvar emptyVehicles = vehicles.filter(function(vehicle) {\r\n\t\treturn vehicle.parcels().length == 0;\r\n\t});\r\n\tlog(\"plan vehicle start\");\r\n\tcalRoute(profile, parcels.getIdleParcels(), emptyVehicles, null, function(\r\n\t\t\troutes) {\r\n\t\t_.each(routes, function(route) {\r\n\t\t\tplotRoute(route);\r\n\t\t\tsaveRoute(route);\r\n\t\t});\r\n\t\tspinner.stop();\r\n\t});\r\n}", "title": "" }, { "docid": "735f3332641e6805e01965444e9743b7", "score": "0.50949633", "text": "pages() {\n return [this.add(), this.edit(), this.list()];\n }", "title": "" }, { "docid": "b3529689a3ea900f6f7e0966de391c2b", "score": "0.5091301", "text": "function showAllRows() {\n\tvar pages = $.trim($('#plunder_list_nav tr:first td:last').children().last().html().replace(/\\D+/g, ''));\n\tif ($('#end_page').val() == \"max\") {\n\t\t$('#end_page').text(pages);\n\t}\n\t$('#am_widget_Farm tr:last').remove();\n\tif (pages > parseInt($('#end_page').val(), 10)) {\n\t\tpages = parseInt($('#end_page').val(), 10);\n\t}\n\tsetTimeout(function() {\n\t\tgetPage((parseInt($('#start_page').val(), 10) - 1), pages);\n\t}, 1);\n}", "title": "" }, { "docid": "cfce7d153c46828588fb14cae496dc52", "score": "0.5083166", "text": "function loadPlan(){\r\n\r\n\t\tvar $productionPlanColumn = $(\".productionPlanColumn\")\r\n\r\n\t\tfor(i = 0; i < tableHeads[1].length; i++){\r\n\t\t\t$productionPlanColumn.first().clone().insertAfter($(\".productionPlanColumn\").last()).children(\"h4\").html(tableHeads[1][i] + \" <img src='img/toggleTable.png' width = 11 class = 'collapseBtn'>\")\r\n\r\n\t\t\t$productionPlanColumn = $(\".productionPlanColumn\")\r\n\r\n\t\t\t// headings hinzufügen\r\n\t\t\tfor (k = 0; k < tableSubHeads[1][i].length; k++){\r\n\t\t\t\tif (k >= 1){\r\n\t\t\t\t\t$(\".productionPlanColumn\").last().children(\"ul\").last().clone().insertAfter($(\".productionPlanColumn\").last().children(\"ul\").last())\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$(\".productionPlanColumn\").last().children(\"ul\").last().children(\".tabHeading\").html(tableSubHeads[1][i][k])\r\n\t\t\t\tif (subHeadsCurrent[i][k] != \"\") {\r\n\t\t\t\t\t$(\".productionPlanColumn\").last().children(\"ul\").last().children(\".tabHeading\").parent().addClass(\"current\");\r\n\t\t\t\t\t$(\".productionPlanColumn ul.current\").append(\"<div class='indicator'></div>\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(\".productionPlanColumn\").last().children(\"ul\").last().children(\".tabHeading\").parent().removeClass(\"current\");\r\n\t\t\t\t\t// $(\".indicator\").remove();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcurrentDayPercent.init();\r\n\t\tsetInterval(currentDayPercent.init(), 30000)\r\n\r\n\t\t$(\".productionPlanColumn\").insertAfter($(\".productionPlanColumn:first\"))\r\n\t\t$(\".productionPlanColumn:first\").remove()\r\n\r\n\r\n\t\t$(\"#techNames\").children().each(function(){\r\n\t\t\tif ($(this).children(\"dot\").length == 1){\r\n\t\t\t\t$(this).show()\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\t$(\".productionPlanColumn ul\").css({\"width\": \"52px\"})\r\n\r\n\t\t// heute schwarz färben\r\n\t\t$(\".tabHeading\").each(function(){\r\n\t\t\tif ($(this).parent().hasClass(\"current\")){\r\n\t\t\t\t$(this).css({\"background-color\": \"#2e2e2e\", \"color\": \"white\"})\r\n\t\t\t\ttodayTabNumber = $(this).index(\".tabHeading\")\r\n\t\t\t\treturn false\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\t$productionPlanColumn.children(\"ul\").children(\"li\").each(function(){\r\n\t\t \tif ($(this).html() == \" - \"){\r\n\t\t \t\tvar y = $(this).index(\"\")\r\n\t\t \t\tvar x = $(this).parent().index(\".productionPlanColumn ul\")*3\r\n\r\n\t\t \t\tvar v1 = 0\r\n\t\t \t\tvar v2 = 0\r\n\t\t \t\tvar v3 = 0\r\n\t\t \t\tif (productionPlan[y].length > 1){\r\n\t\t \t\t\tv1 = productionPlan[y][x]\r\n\t\t \t\t\tv2 = productionPlan[y][x+1]\r\n\t\t \t\t\tv3 = productionPlan[y][x+2]\r\n\t\t \t\t}\r\n\r\n\t\t \t\tif (v1 == 0){\r\n\t\t \t\t\t$(this).html(\"<div class = 'freeTime'></div>\")\r\n\t\t \t\t} else if (v1 == 7){\r\n\t\t \t\t\t$(this).html(\"<div class = 'waitingTime'></div>\")\r\n\t\t \t\t} else if (v1 == 6){\r\n\t\t \t\t\t$(this).html(\"<div class = 'rystTime'></div>\")\r\n\t\t \t\t} else if (v1 == 8){\r\n\t\t \t\t\t$(this).html(\"<div class = 'emptyTime'></div>\")\r\n\t\t \t\t} else {\r\n\t\t \t\t\t$(this).html(\"<div class = 'productionTime clickableEntry'><p data-rec='\" + v1 + \"'>\" + v1 + \"</p></div>\")\r\n\t\t \t\t}\r\n\r\n\t\t \t\tif (v2 == 0){\r\n\t\t \t\t\t$(this).append(\"<div class = 'freeTime'></div>\")\r\n\t\t \t\t} else if (v2 == 7){\r\n\t\t \t\t\t$(this).append(\"<div class = 'waitingTime'></div>\")\r\n\t\t \t\t} else if (v2 == 6){\r\n\t\t \t\t\t$(this).append(\"<div class = 'rystTime'></div>\")\r\n\t\t \t\t} else if (v2 == 8){\r\n\t\t \t\t\t$(this).append(\"<div class = 'emptyTime'></div>\")\r\n\t\t \t\t} else {\r\n\t\t \t\t\t$(this).append(\"<div class = 'productionTime clickableEntry'><p data-rec='\" + v2 + \"'>\" + v2 + \"</p></div>\")\r\n\t\t \t\t}\r\n\r\n\t\t \t\tif (v3 == 0){\r\n\t\t \t\t\t$(this).append(\"<div class = 'freeTime'></div>\")\r\n\t\t \t\t} else if (v3 == 7){\r\n\t\t \t\t\t$(this).append(\"<div class = 'waitingTime'></div>\")\r\n\t\t \t\t} else if (v3 == 6){\r\n\t\t \t\t\t$(this).append(\"<div class = 'rystTime'></div>\")\r\n\t\t \t\t} else if (v3 == 8){\r\n\t\t \t\t\t$(this).append(\"<div class = 'emptyTime'></div>\")\r\n\t\t \t\t} else {\r\n\t\t \t\t\t$(this).append(\"<div class = 'productionTime clickableEntry'><p data-rec='\" + v3 + \"'>\" + v3 + \"</p></div>\")\r\n\t\t \t\t}\r\n\t\t\t\t\r\n\t\t \t}\r\n\t\t \tif ($(this).children(\"div:eq(0)\").html() == $(this).children(\"div:eq(1)\").html() && $(this).children(\"div:eq(1)\").html() == $(this).children(\"div:eq(2)\").html() && $(this).children(\"div:eq(0)\").html()){\r\n\t\t \t\t$(this).children(\"div:eq(0)\").children(\"p\").css({\"opacity\":0})\r\n\t\t \t\t$(this).children(\"div:eq(2)\").children(\"p\").css({\"opacity\":0})\r\n\t\t \t}\r\n\t\t \telse if ($(this).children(\"div:eq(0)\").html() == $(this).children(\"div:eq(1)\").html()){\r\n\t\t \t\t$(this).children(\"div:eq(0)\").children(\"p\").css({\"opacity\":0})\r\n\t\t \t\t$(this).children(\"div:eq(1)\").children(\"p\").addClass(\"halfToLeft\")\r\n\t\t \t\tif ($(this).children(\"div:eq(2)\").html() != \"\"){\r\n\t\t \t\t\t$(this).children(\"div:eq(2)\").addClass(\"smallerBoxL\")\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t \telse if ($(this).children(\"div:eq(1)\").html() == $(this).children(\"div:eq(2)\").html() && $(this).children(\"div:eq(1)\").html() != \"\"){\r\n\t\t \t\t$(this).children(\"div:eq(1)\").children(\"p\").css({\"opacity\":0})\r\n\t\t \t\t$(this).children(\"div:eq(2)\").children(\"p\").addClass(\"halfToLeft\")\r\n\t\t \t\tif ($(this).children(\"div:eq(0)\").html() != \"\"){\r\n\t\t \t\t\t$(this).children(\"div:eq(0)\").addClass(\"smallerBoxR\")\r\n\t\t\t \t}\r\n\t\t \t}\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "d1c65dfaad92dfa37e1f9d4f0e449832", "score": "0.5081161", "text": "currentPerPage() {\n return this.$route.query[this.perPageParameter] || 25\n }", "title": "" }, { "docid": "0d7677b1b029d3071cfc70f3cbac3e92", "score": "0.5079862", "text": "function abApEqByDp_paginatedReport(button){\n\tvar restriction = button.restriction;\n\tvar restrictions = null;\n\t\n\trestrictions = {\n\t\t'ds_abApEqByDpPgrp': restriction,\n\t\t'ds_abApEqByDpPgrp_details': restriction\n\t};\n\t\t\t\n\tView.openPaginatedReportDialog('ab-comm-eq-by-dp-pgrp.axvw', restrictions);\n}", "title": "" }, { "docid": "c9c6a7b8448d3acdcaa46b4bbf946e3e", "score": "0.50742227", "text": "function obtenerAdopciones(req,res){\n var fundacionId = req.params.id;\n var page = 1;\n if(req.params.page){\n page = req.params.page;\n }\n\n var itemsPerPage = 6;\n Adopcion.find({fundacion:fundacionId}).populate('adoptante').populate('mascota').sort({creadoEn:-1}).paginate(page,itemsPerPage,(err, adopciones,total)=>{\n if(err) return res.status(500).send({n:'3',message:'Error en la peticion'});\n\n if(adopciones && adopciones.length > 0) {\n return res.status(200).send({\n n:'1',\n adopciones,\n total,\n itemsPerPage,\n pages:Math.ceil(total/itemsPerPage)\n });\n \n }else{\n return res.status(404).send({n:'2',message:'No existe adopciones'});\n }\n \n });\n}", "title": "" }, { "docid": "a0cce0c2a526c82476191cdb008f100e", "score": "0.50672096", "text": "tablero() {\r\n if (this.model.leerPresupuesto() == 0) {\r\n this.view.notificacion(\"No se encontró el presupuesto.\");\r\n } else {\r\n this.view.notificacion(\"Leyendo presupuesto existente.\");\r\n this.model.guardarPrespupuesto();\r\n }\r\n this.view.mostrarTablero();\r\n this.view.actualizarTablero(this.model.presupuesto);\r\n }", "title": "" }, { "docid": "c7131978d709ef369fab97e1c6ad63a6", "score": "0.50661695", "text": "get pageSizeOptions() { return this._pageSizeOptions; }", "title": "" }, { "docid": "c7131978d709ef369fab97e1c6ad63a6", "score": "0.50661695", "text": "get pageSizeOptions() { return this._pageSizeOptions; }", "title": "" }, { "docid": "c7131978d709ef369fab97e1c6ad63a6", "score": "0.50661695", "text": "get pageSizeOptions() { return this._pageSizeOptions; }", "title": "" }, { "docid": "0801033b942d4a135a35670b325bc654", "score": "0.5065963", "text": "function nascondiPag (pag) {\n pag[0].style.display = \"none\";\n pag[1].style.display = \"none\";\n if (pag[2])\n pag[2].style.display = \"none\";\n}", "title": "" }, { "docid": "afcd7100bee17874554d2c4a22740e06", "score": "0.50580436", "text": "function getFlows(routerRef, token = '', perPage = '', filter = '', sort = '') {\n return getList('plans', routerRef, token, perPage, filter, sort);\n}", "title": "" }, { "docid": "698aa29a16a4d0332b90aab72c34046e", "score": "0.5054663", "text": "displayRecordPerPage(page){\n // sets the next button to be disabled\n // and enabled if this evaluates to true / false\n this.nextIsDisabled = this.page === this.totalPage;\n // sets the previous button to be disabled\n // and enabled if this evaluates to true / false\n this.previousIsDisabled = this.page === this.startingRecord;\n\n /*let's say for 2nd page, it will be => \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n page = 2; pageSize = 5; startingRecord = 5, endingRecord = 10\n so, slice(5,10) will give 5th to 9th records.\n */\n this.startingRecord = ((page - 1) * this.pageSize) ;\n this.endingRecord = (this.pageSize * page);\n\n this.endingRecord = (this.endingRecord > this.totalRecountCount)\n ? this.totalRecountCount : this.endingRecord;\n\n this.paginationList = this.sourceData.slice(this.startingRecord, this.endingRecord);\n\n //increment by 1 to display the startingRecord count,\n //so for 2nd page, it will show \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n this.startingRecord = this.startingRecord + 1;\n }", "title": "" }, { "docid": "cc3eb354b783bf7a9883cae8cf595b34", "score": "0.50522524", "text": "darFormatoSubTotales(arrTotales = null, pwa_delivery_comercio_paga_entrega = null, costoEntrega = null) {\n this.init();\n arrTotales = arrTotales && arrTotales.length > 0 ? arrTotales : this.pedidoRepartidor.datosSubtotalesShow;\n const rowTotal = arrTotales[arrTotales.length - 1];\n // lo que paga el cliente\n this.pedidoRepartidor.importePagaCliente = rowTotal.importe;\n pwa_delivery_comercio_paga_entrega = pwa_delivery_comercio_paga_entrega !== null ? pwa_delivery_comercio_paga_entrega : this.pedidoRepartidor.datosComercio.pwa_delivery_comercio_paga_entrega;\n costoEntrega = costoEntrega ? costoEntrega : this.pedidoRepartidor.datosDelivery.costoTotalDelivery;\n // agregar o restar el importe del costo de entrega SI el comercio paga el costo de entrega pwa_delivery_comercio_paga_entrega\n if (pwa_delivery_comercio_paga_entrega === 1) {\n // const costoEntrega = this.pedidoRepartidor.datosDelivery.costoTotalDelivery;\n // ingresamos en la penultima postion del arrTotales\n const postionInsert = arrTotales.length - 1;\n const _row = {\n descripcion: 'Costo de Entrega',\n esImpuesto: 0,\n id: -4,\n importe: -costoEntrega,\n quitar: false,\n tachado: false,\n visible: false,\n visible_cpe: false\n };\n arrTotales.splice(postionInsert, 0, _row);\n // console.log('costo de entrega insertado', arrTotales);\n }\n // -2 = servicio deliver -3 = propina\n rowTotal.importe = arrTotales.filter(x => x.id !== -2 && x.id !== -3 && x.descripcion !== 'TOTAL').map(x => parseFloat(x.importe)).reduce((a, b) => a + b, 0);\n this.pedidoRepartidor.importePedido = rowTotal.importe;\n // this.setImporteTotalPedido(rowTotal.importe);\n // costo total del servico + prpina\n const costoServicio = parseFloat(arrTotales.filter(x => x.id === -2 || x.id === -3).map(x => parseFloat(x.importe)).reduce((a, b) => a + b, 0));\n this.pedidoRepartidor.c_servicio = costoServicio.toString();\n // this.setCostoSercicio(costoServicio.toString());\n const _isHayPropina = arrTotales.filter(x => x.id === -3)[0] ? true : false;\n // this.setIsHayPropina(_isHayPropina);\n this.pedidoRepartidor.isHayPropina = _isHayPropina;\n // cuanto paga el repartidor restando precio_default si el comercio no es afiliado\n this.setLocal();\n // quitamos el importe del servicio\n return arrTotales.filter(x => x.id !== -2 && x.id !== -3);\n }", "title": "" }, { "docid": "1d79ec2319b90418cc2325e99477c156", "score": "0.50461143", "text": "function fetchPublicClassPlan(link) {\n const requestOptions = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: authHeader(),\n },\n\n };\n\n const url = `/class_plan_publication/${link}/`;\n\n\n return axios.get(`${apiUrl}${url}`, requestOptions)\n .then(response => response.data).then(activeClassPlan => activeClassPlan);\n}", "title": "" }, { "docid": "f17a9484bc258a64ac240e2e637563bd", "score": "0.504097", "text": "getAll(userOpts) {\n let array = [];\n let url = `/v2/${ENDPT}`;\n const pageFn = () => {\n return this.context.http.makeRequest({ url }, userOpts).then(function (body) {\n array = array.concat(body.data || []); // concatenate the new data\n url = body.pages.next;\n if (url) {\n return pageFn();\n }\n else {\n return array;\n }\n });\n };\n return pageFn();\n }", "title": "" }, { "docid": "39e98f06aa3b44e5d33865359e24a035", "score": "0.50350547", "text": "function getDisplayedPages(p, totalPages) {\n result = [];\n for (var i = p-2; i <= p+2; i++) {\n if (i >= 1 && i <= totalPages) {\n result.push(i);\n }\n }\n return result;\n}", "title": "" }, { "docid": "f7b6cd514876b6bea303c3ea1f65fe58", "score": "0.5034825", "text": "function CreatePager(element) {\r\n var _colspanLength = $(element).find('th').length;\r\n _dataPagerHtml = '<tfoot><tr><td colspan=\"' + _colspanLength + '\"><div id=\"simplepagerDiv\">' +\r\n \t '<table style=\"margin-left:auto;margin-right:auto;\" align=\"center\">' +\r\n\t\t\t '<tr>' +\r\n\t\t\t\t '<td><img id=\"jqsp_imgFirstPage\" class=\"imgPager first\" title=\"' + options.FirstPageText + '\" src=\"' + options.ImageFirstPageUrl + '\"></td>' +\r\n\t\t\t\t '<td><img id=\"jqsp_imgPreviousPage\" class=\"imgPager prev\" title=\"' + options.PreviousPageText + '\" src=\"' + options.ImagePreviousPageUrl + '\"></td>' +\r\n\t\t\t\t '<td><input id=\"jqsp_txtPaginaActual\" type=\"text\" readonly=\"readonly\" value=\"0/0\" title=\"' + options.CurrentPageText + '\"><input type=\"hidden\" id=\"jqsp_hdnPaginaActual\" value=\"0\"></td>' +\r\n\t\t\t\t '<td><img id=\"jqsp_imgNextPage\" class=\"imgPager next\" title=\"' + options.NextPageText + '\" src=\"' + options.ImageNextPageUrl + '\"></td>' +\r\n\t\t\t\t '<td><img id=\"jqsp_imgLastPage\" class=\"imgPager last\" title=\"' + options.LastPageText + '\" src=\"' + options.ImageLastPageUrl + '\"><input type=\"hidden\" id=\"jqsp_hdnPaginaFinal\" value=\"0\"></td>' +\r\n\t\t\t\t '<td>' + options.PageSizeText + ':</td>' +\r\n\t\t\t\t '<td><select class=\"ddlResultsPerPage\" id=\"jqsp_ddlCantidadPorPagina\" title=\"' + options.PageSizeText + '\">' +\r\n\t\t\t\t\t\t '<option value=\"10\" selected=\"selected\">10</option>' +\r\n\t\t\t\t\t\t '<option value=\"20\">20</option>' +\r\n\t\t\t\t\t\t '<option value=\"30\">30</option>' +\r\n\t\t\t\t\t\t '<option value=\"40\">40</option>' +\r\n\t\t\t\t\t\t '<option value=\"50\">50</option>' +\r\n\t\t\t\t\t '</select>' +\r\n\t\t\t\t\t '<input type=\"hidden\" id=\"jqsp_hdnCantidadPorPagina\" value=\"0\">' +\r\n\t\t\t\t '</td>' +\r\n\t\t\t '</tr>' +\r\n\t\t '</table>' +\r\n '</div></td></tr></tfoot>';\r\n\r\n $(element).find('table').append(_dataPagerHtml);\r\n\r\n var _button = $(element).find('#jqsp_imgFirstPage');\r\n BuildButton(_button);\r\n _button = $(element).find('#jqsp_imgPreviousPage');\r\n BuildButton(_button);\r\n _button = $(element).find('#jqsp_imgNextPage');\r\n BuildButton(_button);\r\n _button = $(element).find('#jqsp_imgLastPage');\r\n BuildButton(_button);\r\n _button = $(element).find('#jqsp_ddlCantidadPorPagina');\r\n BuildButton(_button);\r\n }", "title": "" }, { "docid": "e685c2021edab29ca7b64a53f130f0b7", "score": "0.50305736", "text": "function ev_carregaPaginaSobre() {\n/*------------------------------*/\nconsole.log(\"e365.js> *** Executando ev_carregaPaginaSobre() ***\");\n\n /*-- Get do Navbar Top --*/\n pe_getaNavbarTop( \"Sobre\" , \"page\" );\n\n /*-- Get do Corpo da Pagina --*/\n pe_getaHtmlPagina( \"\" , \"sobre\" ); \n\n /*-- Get do Navbar Bottom --*/\n pe_getaNavbarBottom( \"home\" );\n\n}", "title": "" }, { "docid": "ed5227a1d3e5163e3127403d4a2e79a4", "score": "0.50300646", "text": "function FlexTable_stacks_in_5088_page21_MakePager(page) {\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5088_page21');\n\tif (!table) return;\n\n\tvar rows = table.rows;\n\tif (1 == 1) {\n\t\trstart = 1;\n\t\t} else {\n\t\trstart = 0;\n\t\t}\n\n\tvar rpp = FlexTable_stacks_in_5088_page21_RPP();\n\tif (table.style.display != \"none\") {\n\t\tif ((0 == 1) && (rpp > 0)) {\n\t\t\tvar pages = Math.ceil((rows.length - rstart)/rpp);\n\t\t\t} else {\n\t\t\tvar pages = 1;\n\t\t\t}\n\t\tvar showPlus = true;\n\t\t} else {\n\t\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5088_page21');\n\t\tif (!rtable) return;\n\t\tvar pages = rows.length - rstart;\n\t\tvar showPlus = false;\n\t\t}\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_5088_page21');\n\tif (!pager) return;\n\n\tvar ddd = \" &middot;&middot;&middot; \";\n\n\t/* remove entries keeping only +/-delta = 2 around the selected page, */\n\t/* and (delta-1) = 1 at the beginning and end */\n\t/* 1 ... 3 4 _5_ 6 7 ... 10 */\n\tif (\"2\" == \"all\") {\n\t\tvar delta = pages;\n\t\t} else {\n\t\tif (\"2\" == \"none\") {\n\t\t\tvar delta = 0;\n\t\t\tddd = \"\";\n\t\t\t} else {\n\t\t\tvar delta = 2;\n\t\t\tif (pages <= 3*delta) { delta = pages; }\n\t\t\t}\n\t\t}\n\n\tvar mobile = FlexTable_stacks_in_5088_page21_isMobile();\n\n\tvar delim = \"\";\n\tswitch (1) {\n\t\tcase 1:\n\t\t\t/* large triangles */\n\t\t\tvar larr = \"&#9668;\";\n\t\t\tvar rarr = \"&#9658;\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t/* blue doubles */\n\t\t\tvar larr = \"&#9194;\";\n\t\t\tvar rarr = \"&#9193;\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t/* thick lt/gt */\n\t\t\tvar larr = \"&#10094;\";\n\t\t\tvar rarr = \"&#10095;\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\t/* thin hollow */\n\t\t\tvar larr = \"&#5583;\";\n\t\t\tvar rarr = \"&#5580;\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tvar larr = \"&lt;\";\n\t\t\tvar rarr = \"&gt;\";\n\t\t\tbreak;\n\t\t}\n\n\tif (mobile) {\n\t\tvar spacer = \"&nbsp;&nbsp;\";\n\t\t} else {\n\t\tvar spacer = \"&nbsp;\";\n\t\t}\n\n\tif (delim != \"\") { delim = spacer + delim; }\n\n\tvar pstr = \"\";\n\n\tif (page <= 0) {\n\t\tpstr += larr + spacer + \"<a title=\\\"Reset and show table content in pages.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(1); return false;\\\"><b>&minus;</b></a>\" + spacer + rarr;\n\t\t} else {\n\t\tif (page <= 1) {\n\t\t\tif (1 == 1) {\n\t\t\t\tpstr += \"<a title=\\\"Select the last page of the table.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(\" + pages + \"); return false;\\\">\" + larr + \"</a>\";\n\t\t\t\t} else {\n\t\t\t\tpstr += larr;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\tpstr += \"<a title=\\\"Select the previous page of the table.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(\" + (page-1) + \"); return false;\\\">\" + larr + \"</a>\";\n\t\t\t}\n\n\t\tvar d1flag = false;\n\t\tvar d2flag = false;\n\t\tfor (i=1; i<=pages; i++) {\n\t\t\tif (i == page) {\n\t\t\t\tif (i > 1) { pstr += delim; }\n\t\t\t\tpstr += spacer;\n\t\t\t\tpstr += \"<label title=\\\"Page \" + i + \" of the table is currently selected.\\\"><b>\" + i + \"</b></label>\";\n\t\t\t\t} else {\n\t\t\t\tif ((i < delta) || ((i >= (page - delta)) && (i <= (page + delta))) || (i > (pages - delta + 1))) {\n\t\t\t\t\tif (i > 1) { pstr += delim; }\n\t\t\t\t\tpstr += spacer;\n\t\t\t\t\tpstr += \"<a title=\\\"Select page \" + i + \" of the table.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(\" + i + \"); return false;\\\">\" + i + \"</a>\";\n\t\t\t\t\t} else {\n\t\t\t\t\tif (!d1flag && (i < (page - delta))) {\n\t\t\t\t\t\tpstr += spacer;\n\t\t\t\t\t\tpstr += ddd;\n\t\t\t\t\t\td1flag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\tif (!d2flag && (i > (page + delta))) {\n\t\t\t\t\t\tpstr += spacer;\n\t\t\t\t\t\tpstr += ddd;\n\t\t\t\t\t\td2flag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tif (showPlus) {\n\t\t\tpstr += spacer + \"<a title=\\\"Show all table content without pages.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(0); return false;\\\"><b>+</b></a>\";\n\t\t\t}\n\n\t\tif (page >= pages) {\n\t\t\tif (1 == 1) {\n\t\t\t\tpstr += spacer + \"<a title=\\\"Select the first page of the table.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(\" + 1 + \"); return false;\\\">\" + rarr + \"</a>\";\n\t\t\t\t} else {\n\t\t\t\tpstr += spacer + rarr;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\tpstr += spacer + \"<a title=\\\"Select the next page of the table.\\\" href=\\\"#\\\" onclick=\\\"FlexTable_stacks_in_5088_page21_SetPage(\" + (page+1) + \"); return false;\\\">\" + rarr + \"</a>\";\n\t\t\t}\n\t\t}\n\n\twindow.FlexTable_stacks_in_5088_page21_PageNumber = page;\n\tpager.innerHTML = pstr;\n\t}", "title": "" }, { "docid": "13cd33cd40b89f99269ef14b3df2825e", "score": "0.50286555", "text": "get visiblePageNumbers() {\n const {\n pagesCount,\n currentPageNumber,\n collapseNumPaginationForPagesCount\n } = this;\n const notLinkLabel = '...';\n const showAll = pagesCount <= collapseNumPaginationForPagesCount;\n let groups = []; // array of 8 numbers\n\n let labels = Ember.A([]);\n groups[0] = 1;\n groups[1] = Math.min(1, pagesCount);\n groups[6] = Math.max(1, pagesCount);\n groups[7] = pagesCount;\n groups[3] = Math.max(groups[1] + 1, currentPageNumber - 1);\n groups[4] = Math.min(groups[6] - 1, currentPageNumber + 1);\n groups[2] = Math.floor((groups[1] + groups[3]) / 2);\n groups[5] = Math.floor((groups[4] + groups[6]) / 2);\n\n if (showAll) {\n for (let i = groups[0]; i <= groups[7]; i++) {\n labels[i] = i;\n }\n } else {\n for (let n = groups[0]; n <= groups[1]; n++) {\n labels[n] = n;\n }\n\n const userGroup2 = groups[4] >= groups[3] && groups[3] - groups[1] > 1;\n\n if (userGroup2) {\n labels[groups[2]] = notLinkLabel;\n }\n\n for (let i = groups[3]; i <= groups[4]; i++) {\n labels[i] = i;\n }\n\n const userGroup5 = groups[4] >= groups[3] && groups[6] - groups[4] > 1;\n\n if (userGroup5) {\n labels[groups[5]] = notLinkLabel;\n }\n\n for (let i = groups[6]; i <= groups[7]; i++) {\n labels[i] = i;\n }\n }\n\n return Ember.A(labels.compact().map(label => ({\n label,\n isLink: label !== notLinkLabel,\n isActive: label === currentPageNumber\n })));\n }", "title": "" }, { "docid": "c40377c6c5349b2c6010dd17f947f64e", "score": "0.50222605", "text": "function buildPager() {\n app.pagedItems = [];\n app.itemsPerPage = 15;\n app.currentPage = 1;\n app.figureOutItemsToDisplay();\n }", "title": "" } ]
65ce7ec6669e9387c6f728e0782c4007
declare one function to be used for both $watch functions
[ { "docid": "46d59a4d24da754c0708abea8003c5e3", "score": "0.0", "text": "function setChecked(newArr, oldArr) {\n scope.checked = contains(newArr, value, comparator);\n }", "title": "" } ]
[ { "docid": "e6ceceb9d5647758c0a10f097b92fb19", "score": "0.61836517", "text": "function initWatchVal(){}", "title": "" }, { "docid": "e6ceceb9d5647758c0a10f097b92fb19", "score": "0.61836517", "text": "function initWatchVal(){}", "title": "" }, { "docid": "e6ceceb9d5647758c0a10f097b92fb19", "score": "0.61836517", "text": "function initWatchVal(){}", "title": "" }, { "docid": "f86d8dd0aea9e50952ab6752eb4cfbfe", "score": "0.61785305", "text": "function wrapWatchHelper(ctrl, fn) {\n var isSet = false;\n var oldVal = undefined;\n var newVal = undefined;\n\n var trueExec = ctrl.wrap(function() {\n if (!angular.equals(newVal, oldVal)) {\n isSet = false;\n fn(newVal, oldVal);\n }\n });\n\n return function(nv, ov) {\n if (isSet) {\n newVal = angular.copy(nv);\n } else {\n isSet = true;\n oldVal = angular.copy(ov);\n newVal = angular.copy(nv);\n }\n trueExec();\n };\n}", "title": "" }, { "docid": "72164e377d6a4500ce8ae951d2a992bc", "score": "0.61344683", "text": "watch() {\n // @todo implement watcher\n watcher.init();\n }", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "6a36f369660080c9584a7fb682a72116", "score": "0.6071643", "text": "function initWatchVal() {}", "title": "" }, { "docid": "a34d191f4409887283134191edeac037", "score": "0.60356873", "text": "function watching(newValue, oldValue) {\n if (newValue !== oldValue) {\n // This just calls a factory method if the values are different\n $scope.students = studentFactory.getStudents($scope.start, $scope.end);\n } \n }", "title": "" }, { "docid": "2fb161ad44567cc2950e48576fa74b2f", "score": "0.60145384", "text": "function configureWatchers () {\r\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\r\n }", "title": "" }, { "docid": "ed78fe674fa956abf2c24f01c1637550", "score": "0.596228", "text": "function doOnScopeChange(scope, watchers, cb) {\n var i, watchExp, firstChar, handler;\n\n // set up the watchers if they exist\n if (watchers && cb) {\n for (i = 0; i < watchers.length; i++) {\n handler = generateScopeChangeHandler(cb, watchers);\n watchExp = watchers[i];\n firstChar = watchExp.charAt(0);\n if (firstChar === '^') {\n scope.$watchCollection(watchExp.substring(1), handler);\n }\n else if (firstChar === '*') {\n scope.$watch(watchExp.substring(1), handler, true);\n }\n else {\n scope.$watch(watchExp, handler);\n }\n }\n }\n }", "title": "" }, { "docid": "5458eb44d4b3153ddec4cfae4e7fa316", "score": "0.59266335", "text": "function initWatchVal() { }", "title": "" }, { "docid": "ba93204da49bea9a483c09fc5535d637", "score": "0.5899585", "text": "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "title": "" }, { "docid": "ba93204da49bea9a483c09fc5535d637", "score": "0.5899585", "text": "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "title": "" }, { "docid": "ba93204da49bea9a483c09fc5535d637", "score": "0.5899585", "text": "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "title": "" }, { "docid": "ba93204da49bea9a483c09fc5535d637", "score": "0.5899585", "text": "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "title": "" }, { "docid": "ba93204da49bea9a483c09fc5535d637", "score": "0.5899585", "text": "function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }", "title": "" }, { "docid": "2cc3adb468d356a53f80ef826ff25756", "score": "0.5857142", "text": "function initWatchVal() {\n }", "title": "" }, { "docid": "3feb456653bd5551f235bd0dca52f12d", "score": "0.57991457", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\r\n\t\t\tvar unwatch;\r\n\t\t\treturn unwatch = scope.$watch(function constantInterpolateWatch(scope) {\r\n\t\t\t\tunwatch();\r\n\t\t\t\treturn constantInterp(scope);\r\n\t\t\t}, listener, objectEquality);\r\n\t\t}", "title": "" }, { "docid": "e85c295a3b55c0131dcbe4348c91cba4", "score": "0.5785362", "text": "watch () {\n this.#isWatching = true\n }", "title": "" }, { "docid": "1c75d451949ebd7bfb90acdfb4228b47", "score": "0.57842773", "text": "watch () {\n this.watchRebootEvent()\n this.watchCrashEvent()\n this.watchErrorEvent()\n this.watchSuccessEvent()\n }", "title": "" }, { "docid": "361110e74d3121e25be318a191611115", "score": "0.5767909", "text": "function initializeWatcher() {\n\t\t\t\t\t\tscope.$watch('searcher.searchInput', function(newVal, oldVal) {\n\t\t\t\t\t\t\tif (oldVal == newVal) return;\n\t\t\t\t\t\t\tloadValues(newVal);\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "f9402cb9ba24780b2e289be46f468015", "score": "0.5762135", "text": "addWatcher() {\n this._watch.apply(this, arguments);\n\n return this;\n }", "title": "" }, { "docid": "fde2790c23f1c4a1ec1f5203853747fa", "score": "0.575281", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n\t var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n\t unwatch();\n\t return constantInterp(scope);\n\t }, listener, objectEquality);\n\t return unwatch;\n\t }", "title": "" }, { "docid": "c98fa154a1a88d42e4bf971d1d56a483", "score": "0.566078", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "title": "" }, { "docid": "c98fa154a1a88d42e4bf971d1d56a483", "score": "0.566078", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "title": "" }, { "docid": "c98fa154a1a88d42e4bf971d1d56a483", "score": "0.566078", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "title": "" }, { "docid": "c98fa154a1a88d42e4bf971d1d56a483", "score": "0.566078", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "title": "" }, { "docid": "c98fa154a1a88d42e4bf971d1d56a483", "score": "0.566078", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "title": "" }, { "docid": "c98fa154a1a88d42e4bf971d1d56a483", "score": "0.566078", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }", "title": "" }, { "docid": "a7732203953efd224b9c4b51ebc418cc", "score": "0.56159484", "text": "addWatcher() {\n const vm = this;\n /*\n Remove previous watcher if exist\n */\n if(vm.scrollWatcher != null) vm.scrollWatcher();\n\n /*\n Add new watcher dynamically\n */\n if (vm.ease == 'linear') {\n vm.scrollWatcher = vm.$watch('scroll', () => {\n vm.executeParallax()\n });\n }\n\n if (vm.ease == 'smooth') {\n vm.scrollWatcher = vm.$watch('scrollThrottle', () => {\n switch (vm.smoothType) {\n case 'css':\n vm.executeParallax()\n break;\n case 'js':\n vm.smoothParallaxJs()\n break;\n }\n });\n }\n }", "title": "" }, { "docid": "35f542781012ce35d69d3435c19114a3", "score": "0.5587973", "text": "function watchListener(nv, ov) {\n\t\t\t\t\tif(nv !== ov) {\n\t\t\t\t\t\tbuildList();\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "c1c2fc97d71984356bb6c7a3beb9ffca", "score": "0.5581193", "text": "watch() {\n this._watch.apply(this, arguments);\n\n return this;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "306cf8d6df1dca226289a85161449fd5", "score": "0.5558657", "text": "function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }", "title": "" }, { "docid": "8310a82f05cbf01927067765763b61a4", "score": "0.55464655", "text": "function configureWatchers () {\r\n var wait = parseInt($scope.delay, 10) || 0;\r\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\r\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\r\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\r\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\r\n $scope.$watch('selectedItem', selectedItemChange);\r\n angular.element($window).on('resize', positionDropdown);\r\n $scope.$on('$destroy', cleanup);\r\n }", "title": "" }, { "docid": "1cb57dc98a237b295b1b11f440e9f48b", "score": "0.5532783", "text": "watchSmallChanges() {\n // some uncessary changes.\n uncessaryChangeArray.forEach((opts) => {\n this.$watch(opts, () => {\n this.shouldStop = true;\n }, {\n sync: true,\n deep: true\n });\n });\n }", "title": "" }, { "docid": "e5a2f6694e4bb4b0637b9b5f1470f011", "score": "0.5530099", "text": "watch (fileChanged) {\n setTimeout(() => {\n fileChanged({\n change: \"modified\",\n path: \"file2.txt\",\n source: this.file2Source\n });\n }, 100);\n }", "title": "" }, { "docid": "0545c1fecf60bf66b094b14fab7d5b28", "score": "0.5487611", "text": "function watch() {\n\t// Watch Sass files\n\t//gulp.watch( PATHS.sass, gulp.series( styles ) );\n\tgulp.watch( PATHS.sass ).on( 'change', gulp.series( styles, reload ) );\n\n // Watch Foundation's JavaScript files\n gulp.watch( PATHS.javascriptFoundationAll ).on( 'change', gulp.series( foundationJS, reload ) );\n \n\t// Watch theme's JavaScript files\n\tgulp.watch( PATHS.javascript ).on( 'change', gulp.series( siteJS, reload ) );\n \n\t// Watch theme's PHP files\n\tgulp.watch( PATHS.php ).on( 'change', gulp.series( reload ) );\n}", "title": "" }, { "docid": "e9443abfbcc130195153f5dd948f9893", "score": "0.54872805", "text": "function watch() {\n gulp.watch(files.ts, gulp.series(tsLint));\n\n gulp.watch(files.js, gulp.series(jsLint));\n}", "title": "" }, { "docid": "86bbc5be11b9e191f41720d238fecd21", "score": "0.5461788", "text": "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = value; });\n $attrs.$observe('required', function (value) { ctrl.isRequired = value !== null; });\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n angular.element($window).on('resize', positionDropdown);\n $scope.$on('$destroy', cleanup);\n }", "title": "" }, { "docid": "bc2d308a546200433680dd8fe8c5732e", "score": "0.5455588", "text": "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = !!value; });\n $attrs.$observe('required', function (value) { ctrl.isRequired = !!value; });\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n angular.element($window).on('resize', positionDropdown);\n $scope.$on('$destroy', cleanup);\n }", "title": "" }, { "docid": "613ce4be2b9819fb34ca3c208fff00ac", "score": "0.5451741", "text": "function watch() {\n gulp.watch('src/**/**/*.pug').on('change', gulp.series(views, resetPages, pages, sass, inline,cleanTmp, browser.reload));\n gulp.watch(['src/layouts/**/*', 'src/partials/**/*', 'src/data/**/*']).on('change', gulp.series(views, resetPages, pages, inline,cleanTmp, browser.reload));\n gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss']).on('change', gulp.series(views, resetPages, sass, pages, inline,cleanTmp, browser.reload));\n gulp.watch('src/assets/img/**/*').on('change', gulp.series(images, browser.reload));\n}", "title": "" }, { "docid": "1240e78256155cc514572bca1e7a0239", "score": "0.54441315", "text": "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n\n angular.element($window).on('resize', debouncedOnResize);\n\n $scope.$on('$destroy', cleanup);\n }", "title": "" }, { "docid": "1240e78256155cc514572bca1e7a0239", "score": "0.54441315", "text": "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n\n angular.element($window).on('resize', debouncedOnResize);\n\n $scope.$on('$destroy', cleanup);\n }", "title": "" }, { "docid": "1240e78256155cc514572bca1e7a0239", "score": "0.54441315", "text": "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n\n angular.element($window).on('resize', debouncedOnResize);\n\n $scope.$on('$destroy', cleanup);\n }", "title": "" }, { "docid": "1240e78256155cc514572bca1e7a0239", "score": "0.54441315", "text": "function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n\n angular.element($window).on('resize', debouncedOnResize);\n\n $scope.$on('$destroy', cleanup);\n }", "title": "" }, { "docid": "0a8dab66b1fddb97ff8eea8724fb115e", "score": "0.5438473", "text": "function staticWatcher(newVal) {\n if ((hash = newVal.indexOf('#')) > -1)\n newVal = newVal.substr(hash + 1);\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "title": "" }, { "docid": "2e09c92c96762226b4c4847599b8ea37", "score": "0.5412917", "text": "function runWatch() {\n 'use strict';\n\n /**\n * Watch SASS files for changes and run the css tasks\n *\n * @function watchCss\n */\n function watchCss() {\n gulp.start('scss:dev');\n }\n\n watch(\n global.getSrc('scssFiles'),\n watchCss\n );\n\n /**\n * Watch JS files for changes and run the javascript tasks\n *\n * @function watchJs\n */\n function watchJs() { \n gulp.start('js:dev');\n }\n\n watch(\n global.getSrc('jsFiles'),\n watchJs\n );\n\n /**\n * Watch image files for changes and run the image tasks\n *\n * @function watchImg\n */\n function watchImg() {\n gulp.start('img');\n }\n\n watch(\n global.getSrc('img'),\n watchImg\n );\n\n\n /**\n * Watch font files for changes and run the font tasks\n *\n * @function watchFont\n */\n function watchFont() {\n gulp.start('font');\n }\n\n watch(\n global.getSrc('font'),\n watchFont\n );\n\n /**\n * Watch icon font files for changes and run the font tasks\n *\n * @function watchFont\n */\n function watchIconFont() {\n gulp.start('iconfont');\n }\n\n watch(\n global.getSrc('icons') + '/*.svg',\n watchIconFont\n );\n\n\n /**\n * Watch all dist files for styleguide update\n *\n * Also see styleguide.js task\n */\n gulp.start('styleguide:watch'); \n\n}", "title": "" }, { "docid": "1215bdaaa2731b3d62ee9d34e3bfc76b", "score": "0.5385009", "text": "function devWatch() {\n gulp.watch(path.watch.html).on('change', reload);\n gulp.watch(path.watch.sass, gulp.series('dev:sass'));\n gulp.watch(path.watch.js, gulp.series('dev:js'));\n gulp.watch(path.watch.images, gulp.series('dev:images'));\n}", "title": "" }, { "docid": "40a9eb93db9d16a27f807a26192d8a33", "score": "0.53837824", "text": "function watch() {\n // gulp.watch(PATHS.assets, copyOthers);\n gulp.watch('src/pages/**/*.html').on('all', gulp.series(pages));\n gulp.watch('src/partials/**/*.{html,hbs,handlebars}').on('all', gulp.series(otherPages));\n gulp.watch('src/{layouts,partials}/**/*.html').on('all', gulp.series(resetPages, pages));\n gulp.watch('src/assets/scss/**/*.scss').on('all', gulp.series(sass, adminSass));\n gulp.watch('src/assets/js/**/*.js').on('all', gulp.series(blog_javascript, login_javascript, admin_javascript));\n gulp.watch('src/assets/img/**/*').on('all', gulp.series(images));\n}", "title": "" }, { "docid": "d8a279fa2f835e1cd2f35f2e791080b4", "score": "0.5382651", "text": "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "title": "" }, { "docid": "d8a279fa2f835e1cd2f35f2e791080b4", "score": "0.5382651", "text": "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "title": "" }, { "docid": "d8a279fa2f835e1cd2f35f2e791080b4", "score": "0.5382651", "text": "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "title": "" }, { "docid": "d8a279fa2f835e1cd2f35f2e791080b4", "score": "0.5382651", "text": "function staticWatcher(newVal) {\n var hash = newVal.indexOf('#');\n if (hash > -1){\n newVal = newVal.substr(hash + 1);\n }\n watcher = function watchHref() {\n modelSetter($scope, ($location.path().indexOf(newVal) > -1));\n };\n watcher();\n }", "title": "" }, { "docid": "f148928c1dd1d1194457d8656f1798a6", "score": "0.53700995", "text": "function setWatchersAndListeners() {\n\n /**\n * Listens to the DealerPhotos service's broadcasts when the dealer pic of the user has finished to upload.\n */\n $scope.$on(PROFILE_PIC_BROADCASTING_PREFIX + RBI_SESSION, function (event, args) {\n if (args.success) {\n // Finished uploading the dealer pic, start uploading the bank account, and then the dealer object.\n $rootScope.userProfilePic = $scope.croppedPhotoURL;\n Dealer.registerBasicInfo(RBI_SESSION);\n } else {\n Dialogs.hideDialog(event);\n console.log(\"Couldn't upload the dealer pic. Aborting upload process.\");\n }\n });\n\n /**\n * Listens to the Dealer service's broadcasts when the dealer's info has finished to upload.\n */\n $scope.$on(REGISTER_BROADCASTING_PREFIX + RBI_SESSION, function (event, args) {\n if (args.success) {\n // Registered\n console.log(\"Dealer is registered with basic info successfully!\");\n window.onbeforeunload = null;\n $scope.registrationBasicInfoDone = true;\n Dialogs.hideDialog(event);\n Dealer.existingDealer = false;\n $location.path(\"/register/bank-account\");\n } else {\n Dialogs.hideDialog(event);\n Dialogs.showAlertDialog(\n Translations.dealerRegistration.generalProblemTitle,\n Translations.dealerRegistration.generalProblemContent,\n event);\n }\n });\n\n /**\n * Watching for changes in the $scope.photoURL object so to know when to present the crop dialog for the dealer pic.\n */\n $scope.$watch('photoURL', function () {\n if ($scope.photoURL) {\n if ($scope.photoURL.length > 0) {\n $scope.showCropDialog();\n }\n }\n });\n\n /**\n * Watching for changes in the $scope.croppedPhotoURL object so the title of the button will change accordingly.\n */\n $scope.$watch('croppedPhotoURL', function () {\n if ($scope.croppedPhotoURL == ADD_PROFILE_PIC_BUTTON) {\n $scope.editProfilePic = Translations.dealerRegistration.addPhoto;\n } else {\n $scope.editProfilePic = Translations.dealerRegistration.changePhoto;\n }\n });\n\n /**\n * Watching for changes in the media settings (width of browser window).\n */\n $scope.$watch(function () {\n return $mdMedia('xs');\n });\n }", "title": "" }, { "docid": "f148928c1dd1d1194457d8656f1798a6", "score": "0.53700995", "text": "function setWatchersAndListeners() {\n\n /**\n * Listens to the DealerPhotos service's broadcasts when the dealer pic of the user has finished to upload.\n */\n $scope.$on(PROFILE_PIC_BROADCASTING_PREFIX + RBI_SESSION, function (event, args) {\n if (args.success) {\n // Finished uploading the dealer pic, start uploading the bank account, and then the dealer object.\n $rootScope.userProfilePic = $scope.croppedPhotoURL;\n Dealer.registerBasicInfo(RBI_SESSION);\n } else {\n Dialogs.hideDialog(event);\n console.log(\"Couldn't upload the dealer pic. Aborting upload process.\");\n }\n });\n\n /**\n * Listens to the Dealer service's broadcasts when the dealer's info has finished to upload.\n */\n $scope.$on(REGISTER_BROADCASTING_PREFIX + RBI_SESSION, function (event, args) {\n if (args.success) {\n // Registered\n console.log(\"Dealer is registered with basic info successfully!\");\n window.onbeforeunload = null;\n $scope.registrationBasicInfoDone = true;\n Dialogs.hideDialog(event);\n Dealer.existingDealer = false;\n $location.path(\"/register/bank-account\");\n } else {\n Dialogs.hideDialog(event);\n Dialogs.showAlertDialog(\n Translations.dealerRegistration.generalProblemTitle,\n Translations.dealerRegistration.generalProblemContent,\n event);\n }\n });\n\n /**\n * Watching for changes in the $scope.photoURL object so to know when to present the crop dialog for the dealer pic.\n */\n $scope.$watch('photoURL', function () {\n if ($scope.photoURL) {\n if ($scope.photoURL.length > 0) {\n $scope.showCropDialog();\n }\n }\n });\n\n /**\n * Watching for changes in the $scope.croppedPhotoURL object so the title of the button will change accordingly.\n */\n $scope.$watch('croppedPhotoURL', function () {\n if ($scope.croppedPhotoURL == ADD_PROFILE_PIC_BUTTON) {\n $scope.editProfilePic = Translations.dealerRegistration.addPhoto;\n } else {\n $scope.editProfilePic = Translations.dealerRegistration.changePhoto;\n }\n });\n\n /**\n * Watching for changes in the media settings (width of browser window).\n */\n $scope.$watch(function () {\n return $mdMedia('xs');\n });\n }", "title": "" }, { "docid": "578bd2bb6504152915a4487a7de9b063", "score": "0.5347006", "text": "function watcher() {\n watch(paths.html.src, series(copyHtml, cacheBust));\n watch(paths.images.src, optimizeImages);\n watch(paths.styles.src, parallel(compileStyles, cacheBust));\n watch(paths.scripts.src, parallel(minifyScripts, cacheBust));\n}", "title": "" }, { "docid": "07a98def363ce2d61387a8d45768eb3d", "score": "0.5307606", "text": "watchChanges() {\n // react to vuescroll's change.\n this.$watch(\"mergedOptions\", () => {\n // record current position\n this.recordCurrentPos();\n this.$nextTick(() => {\n // update scroll..\n this.registryResize();\n this.updateMode();\n });\n }, {\n deep: true,\n sync: true\n });\n }", "title": "" } ]
958de290249cfc632b6446d9bc0f2bd1
To make mandis list for filter page
[ { "docid": "22b4659e0e92ddad0d0cec3cb3e84cc2", "score": "0.0", "text": "function fill_mandi_filter(data_json, language) {\n filter_remove_elements($('#mandis'));\n if (language == ENGLISH_LANGUAGE) {\n $.each(data_json, function(index, data) {\n create_filter($('#mandis'), data.id, data.mandi_name_en, true);\n });\n } else {\n $.each(data_json, function(index, data) {\n create_filter($('#mandis'), data.id, data.mandi_name, true);\n });\n }\n}", "title": "" } ]
[ { "docid": "424590abd7fab96943e729157335d1b6", "score": "0.66305137", "text": "function filterData(filter) {\n if (filter == 'all') {\n //show all the list items \n $('#catalogList li').show();\n\t\n\t} else {\n \n /*using the :not attribute and the filter class in it we are selecting \n only the list items that don't have that class and hide them '*/ \n $('#catalogList li:not(#' + filter + ')').hide();\n\t$('#catalogList li:not(#' + filter + ')').removeClass('animated fadeInUp');\n\t// show all elements that do share filter\n\t$('#catalogList li#' + filter).show(); \n\t$('#catalogList li#' + filter).addClass('animated fadeInUp');\n\t}\n \n \n}", "title": "" }, { "docid": "c698cf3946c99dddf4aa9c7f64d35f26", "score": "0.63982385", "text": "function execute_filters(list) {\n\t\t// Create the selector\n\t\tvar selector = list.settings.selector;\n\n\t\t// Filter info\n\t\tif (list.filters.filter) {\n\t\t\tselector = selector + '[data-pufs-filter~=\"' + list.filters.filter + '\"]';\n\t\t}\n\t\t\n\t\t// Search info\n\t\tif (list.filters.search) {\n\t\t\tselector = selector + '[data-pufs-search*=\"' + list.filters.search + '\"]';\n\t\t}\n\n\t\t// Hide em all\n\t\tlist.children(list.settings.selector)\n\t\t\t.addClass('pufs-filtered-out');\n\t\t\n\t\t// Let the filter sort em out\n\t\tlist.children(selector)\n\t\t\t.removeClass('pufs-filtered-out');\n\n\t\t// Reset Paging\n\t\treset_paging(list);\n\t}", "title": "" }, { "docid": "10b19b741cf0b538b1a307f482c3cfad", "score": "0.63568777", "text": "function filterAll() {\n houseFilter = \"all\";\n filterList();\n}", "title": "" }, { "docid": "de6c70dd124113041f582ad51f4f82e0", "score": "0.635069", "text": "function filtroPasseios(){\r\n\r\n // Declare variables\r\n\r\n var input, filter, ul, li, a, i;\r\n\r\n input = document.getElementById('inputSearchPasseios');\r\n\r\n filter = input.value.toUpperCase();\r\n\r\n ul = document.getElementById(\"loopAtividadesPasseios\");\r\n\r\n\r\n\r\n li = ul.querySelectorAll('[data-local]');\r\n\r\n\r\n\r\n // Loop through all list items, and hide those who don't match the search query\r\n\r\n for (i = 0; i < li.length; i++) {\r\n\r\n a = li[i];\r\n\r\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n\r\n li[i].style.display = \"\";\r\n\r\n } else {\r\n\r\n li[i].style.display = \"none\";\r\n\r\n }\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "1cd5f67c302aee8008d1f3df24228041", "score": "0.6329572", "text": "function filter() {\n queryOption = {\n order_by: 'sort_by=created_at&order=DESC',\n perpage: 'perpage=5',\n };\n\n $.each(queryOption, function (key, value) {\n let suffixId = $(`select[name=${key}]`).attr('sb');\n\n $(`#sbOptions_${suffixId} li a`).click(function (e) {\n e.preventDefault();\n queryOption[key] = $(this).attr('rel'); // Get query when chose option filter\n history.pushState({}, '', window.location.pathname + '?' + getSearchQuery(true) + queryOption.order_by + '&' + queryOption.perpage); //Set queryOption to URL before call Ajax\n removeOldPage();\n getClinics();\n });\n })\n}", "title": "" }, { "docid": "46f7b80d59bff966a40b27ad81029b23", "score": "0.63237804", "text": "function serach_items_on_list(el) {\n let filter = $(el).val().toLocaleLowerCase();\n let b = filter.toString();\n collect($('.data-cont'));\n // funkcja pomocnicza - pokazywanie lub ukrywanie na liscie wynikow kontaktow.\n function collect(d) {\n for (let i = 0; i < d.length; i++) {\n let find = $(d[i]).text().toLowerCase()\n if (find.includes(b)) {\n $(d[i]).parent().css('display', 'block');\n } else {\n $(d[i]).parent().css('display', 'none');\n }\n }\n }\n} // koniec - wyszukaj i wyswietl na liscie rezultatow kontakty spelniajace kryteria wyszukiwania", "title": "" }, { "docid": "bfb75e251657ca41abfd8db5e9b5c683", "score": "0.631672", "text": "function filterProductList() {\n\n addProductsPresearch();\n\n}", "title": "" }, { "docid": "bff4f418e38a23fd13534d5bf5af90a5", "score": "0.6297958", "text": "function buildUIFilterList(properties){\n\n properties = properties || {};\n\n var parentId = properties.parentId;\n var fieldname = properties.fieldname;\n var persistant = properties.persistant;\n var legend_prefix = properties.legend_prefix;\n var label_prefix = properties.label_prefix;\n //var persistant_prefix = properties.persistant_prefix || \"\";\n var dataSet = properties.dataSet;\n\n if (fieldname == \"year\"){\n if (!Config.showVisitYears){\n\n return;\n }\n }\n\n var container = document.getElementById(parentId);\n\n for (var i=0, len=dataSet.length; i<len; i++){\n var data = dataSet[i];\n var item = document.createElement(\"div\");\n item.className = \"datafilter\";\n if (persistant) {\n item.className = \"datafilter persistantfilter\";\n item.setAttribute('data-filterId', getUniqueFilterCode(fieldname,data));\n\n }\n item.setAttribute('data-filter', fieldname);\n item.setAttribute('data-value', data);\n if (properties.searchSubstring) item.setAttribute('data-substring','true');\n item.id=legend_prefix + \"_\" + cleanString(data);\n\n item.innerHTML = translations[label_prefix + data] || label_prefix + data;\n\n if (fieldname == \"year\" && !MapService.hasFilterPreset()){\n if (data == \"2009\" || data == \"2010\" || data == \"2011\" || data == \"2012\"){\n\n // only of no url preset list is present\n\n item.className += \" inactive\";\n }\n }\n\n container.appendChild(item);\n }\n\n\n }", "title": "" }, { "docid": "8f6d35f537984bdfbac9e62054ebe531", "score": "0.6289158", "text": "function buildList() {\n const filteredList = filterList(settings.filterBy);\n const sortedList = sortList(filteredList);\n const searchedList = searchList(sortedList);\n\n displayStudents(searchedList);\n}", "title": "" }, { "docid": "8b7d0b91bd4dbbc07b3b32aa371cd923", "score": "0.6243236", "text": "function filterByUser(param) {\n self.selectionModel.allMatter = param;\n if (param == 0) {\n self.viewModel.filters.for = \"mymatter\";\n } else {\n self.viewModel.filters.for = \"allmatter\";\n }\n getMatterList(undefined, 'calDays');\n }", "title": "" }, { "docid": "e269342e98b617e700f6a19de7669bb6", "score": "0.62138957", "text": "filterScenarists()\n {\n if (this.props.data.scenarists.length > 0)\n {\n return <Filter onChange={this.handleFiltersChange} onClick={this.handleFiltersSort} id=\"scenarists\" name=\"Scenarists\" type=\"list\" filters={this.props.data.scenarists} />;\n }\n }", "title": "" }, { "docid": "b03d5da98342b87f4a8e487da4d846db", "score": "0.61971176", "text": "getList(filters) {}", "title": "" }, { "docid": "5f5f7ac63a76dbca9459c73b51d14cb2", "score": "0.6184414", "text": "filteredTodos () {\n return filters[this.visibility](this.todos);\n }", "title": "" }, { "docid": "a8bf7304137e20bba24ccb6b63b8bd52", "score": "0.61681056", "text": "function show(filterName, values) {\n \n}", "title": "" }, { "docid": "9040db2c9a9ae204be409d640ffda031", "score": "0.6166452", "text": "function filtroPasseiosPerformance(){\r\n\r\n // Declare variables\r\n\r\n var input, filter, ul, li, a, i;\r\n\r\n input = document.getElementById('inputSearchPasseios');\r\n\r\n filter = input.value.toUpperCase();\r\n\r\n ul = document.getElementById(\"loopAtividadesPerformance\");\r\n\r\n\r\n\r\n li = ul.querySelectorAll('[data-local]');\r\n\r\n\r\n\r\n // Loop through all list items, and hide those who don't match the search query\r\n\r\n for (i = 0; i < li.length; i++) {\r\n\r\n a = li[i];\r\n\r\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n\r\n li[i].style.display = \"\";\r\n\r\n } else {\r\n\r\n li[i].style.display = \"none\";\r\n\r\n }\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "73d83eae1190390907d281c7e0408700", "score": "0.6158119", "text": "function filterTourismType(value){\t\n\tif(value!=\"\"){\n\t\tjQuery(\".fila_resultado_planes\").attr(\"filter\",\"tourismtype\");\n\t\tjQuery(\".fila_resultado_planes\").css(\"display\",\"none\");\n\t\tjQuery(\".tourismType_param[value='\"+value+\"']\").parents(\".fila_resultado_planes\").attr(\"filter\",\"\");\n\t\tjQuery(\".tourismType_param[value='\"+value+\"']\").parents(\".fila_resultado_planes\").css(\"display\",\"block\");\n\t}else{\n\t\tjQuery(\".fila_resultado_planes\").attr(\"filter\",\"\");\n\t\tjQuery(\".fila_resultado_planes\").css(\"display\",\"block\");\n\t}\n\t\n\t\n\tpaginatorOptions.ignoreRows = jQuery(\".fila_resultado_planes[filter='tourismtype']\");\n\tpaginatorOptions.currPage=1;\n\t//Paginate data\n\tjQuery('#contentProducts').tablePagination(paginatorOptions);\n\t//Set the defaults other filters\n\tsetDefaults(\"tourismType\");\n}", "title": "" }, { "docid": "e81e896f78b5fde6b0bd9463a9398f6f", "score": "0.6152195", "text": "filter() {\n \n // eseguo un for each per controllare tutti i nomi dei contatti per poi confrontarli \n this.contacts.forEach((element) => {\n if(element.name.toLowerCase().includes(this.userFilter.toLowerCase() )) {\n element.visible = true;\n } else {\n element.visible = false;\n };\n });\n }", "title": "" }, { "docid": "ff6d7cf5f473d0f1ab247f43a4bc4d5e", "score": "0.6108113", "text": "function initFiltros() {\n $scope.filterBy = {};\n var now = new Date();\n var mesActual = now.getMonth();\n if (mesActual == 0) {\n $scope.filterBy.mes = \"12\";\n $scope.filterBy.anho = now.getFullYear() - 1;\n } else {\n $scope.filterBy.mes = (now.getMonth()) + \"\";\n $scope.filterBy.anho = now.getFullYear();\n }\n $scope.filterBy.vinculacionFuncionario = \"PERMANENTE\";\n $scope.filterBy.concepto = \"SUELDO\";\n $scope.filterBy.programa =\"TODOS\";\n $scope.filterBy.subprograma= \"TODOS\";\n $scope.filterBy.titularUnidad= \"TODOS\";\n\n var filters = {\n vinculacionFuncionario: \"PERMANENTE\",\n concepto: \"SUELDO\",\n programa: \"TODOS\",\n subprograma: \"TODOS\",\n titularUnidad: \"TODOS\",\n anho : $scope.filterBy.anho,\n mes : $scope.filterBy.mes\n };\n $scope.initFilters(filters);\n }", "title": "" }, { "docid": "8232832a4168b543d606fd1a7c60f476", "score": "0.6095348", "text": "function filter() {\n\tvar form = {};\n\tform[\"orderBy\"] = $(\"#orderBy\").val();\n\tform[\"orderDirection\"] = $(\".filterForm input[type='radio']:checked\").val()\n\tform[\"searchBy\"] = $(\"#searchBy\").val();\n\n\tgetNotes(form);\n}", "title": "" }, { "docid": "afb53c7e79ee15f6e2177433fe158835", "score": "0.608763", "text": "function searchPage(){\r\n let newList = [];\r\n for (let i=0;i<list.length;i++){\r\n if (list[i].textContent.includes(searchBox.value)){\r\n newList.push(list[i]);\r\n } else {\r\n list[i].style.display = 'none';\r\n }\r\n }\r\n\r\n // Deletes the page links so new ones can be generated for the search results.\r\n function deletePageLinks(){\r\n const linksDiv = document.querySelector('.pagination');\r\n studentUl.parentNode.removeChild(linksDiv);\r\n }\r\n\r\n // Shows the filtered search results and deletes and generates new page links.\r\n showPage(newList, 0);\r\n deletePageLinks();\r\n appendPageLinks(newList);\r\n }", "title": "" }, { "docid": "ff6792561039b20db811e388584d7132", "score": "0.6083386", "text": "function setFilters() {\n\n vm.filter = {\n pageNum: 1,\n pageSize: pageSize,\n sortby: 1,\n // includeArchived: 0\n };\n\n }", "title": "" }, { "docid": "24375e5e8dc38b0564e8aa37bda2a4d2", "score": "0.60816693", "text": "function filterItems() {\n /* console.log('`filterItems` ran'); */\n let searchValue = $('.js-list-search').val().toLowerCase();\n \n // default for each item is \"unhidden\"\n STORE.items.forEach(item => item.hidden = false);\n\n // hide items not matching `searchValue`\n if (searchValue) {\n STORE.items.forEach(item => {\n if (!item.name.toLowerCase().includes(searchValue)) {\n item.hidden = true;\n }\n });\n }\n\n // hide `checked` items if checkbox ticked\n if (STORE.hideChecked === true) {\n STORE.items.forEach(item => {\n if (item.checked === true) {\n item.hidden = true;\n }\n });\n }\n}", "title": "" }, { "docid": "96e9510cae3630183e1b0630366425e1", "score": "0.60735154", "text": "function filterList() {\n var filterType = jQuery('#timeFilterOption').val();\n\n if (filterType === 'SHOW_ALL') {\n return populateListHTML(false);\n }\n\n var fromDate = new Date();\n var toDate = new Date();\n\n if (filterType === 'SHOW_CUSTOM_RANGE') {\n fromDate = moment(jQuery(\"#from\").datepicker('getDate')).startOf('day');\n toDate = moment(jQuery(\"#to\").datepicker('getDate')).endOf('day');\n } else if (filterType === 'SHOW_DAY') {\n fromDate = moment().startOf('day');\n toDate = moment().endOf('day');\n } else if (filterType === 'SHOW_WEEK') {\n fromDate = moment().startOf('week');\n toDate = moment().endOf('week');\n } else if (filterType === 'SHOW_MONTH') {\n fromDate = moment().startOf('month');\n toDate = moment().endOf('month');\n } else if (filterType === 'SHOW_YEAR') {\n fromDate = moment().startOf('year');\n toDate = moment().endOf('year');\n }\n populateListHTML(true, fromDate, toDate);\n}", "title": "" }, { "docid": "00edb96fe50cb5a507f9446b046eb0b0", "score": "0.6061463", "text": "filterList(queryString) {\n this.doFilter(queryString);\n }", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6057409", "text": "function setFilters() {}", "title": "" } ]